diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f87f81..8f43beb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.12.15, 2.13.7] - java: [adopt@1.8] + scala: [2.13.8, 3.1.0] + java: [temurin@11] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -32,10 +32,12 @@ jobs: with: fetch-depth: 0 - - name: Setup Java and Scala - uses: olafurpg/setup-scala@v13 + - name: Setup Java (temurin@11) + if: matrix.java == 'temurin@11' + uses: actions/setup-java@v2 with: - java-version: ${{ matrix.java }} + distribution: temurin + java-version: 11 - name: Cache sbt uses: actions/cache@v2 @@ -56,7 +58,7 @@ jobs: run: sbt ++${{ matrix.scala }} test - name: Compress target directories - run: tar cf targets.tar bootstrap3_scalatags/target fomanticui_scalatags/target bootstrap4_scalatags/target bulma_scalatags/target bootstrap3_scalajsreact/target fontawesome_scalatags/target target bulma_scalajsreact/target bootstrap4_scalajsreact/target fontawesome_scalajsreact/target semanticui_scalajsreact/target semanticui_scalatags/target fomanticui_scalajsreact/target project/target + run: tar cf targets.tar bootstrap3_scalatags/target fomanticui_scalatags/target bootstrap4_scalatags/target bulma_scalatags/target bootstrap3_scalajsreact/target fontawesome_scalatags/target bootstrap5_scalajsreact/target target bulma_scalajsreact/target bootstrap4_scalajsreact/target fontawesome_scalajsreact/target semanticui_scalajsreact/target semanticui_scalatags/target fomanticui_scalajsreact/target bootstrap5_scalatags/target project/target - name: Upload target directories uses: actions/upload-artifact@v2 @@ -71,8 +73,8 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.13.7] - java: [adopt@1.8] + scala: [3.1.0] + java: [temurin@11] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -80,10 +82,12 @@ jobs: with: fetch-depth: 0 - - name: Setup Java and Scala - uses: olafurpg/setup-scala@v13 + - name: Setup Java (temurin@11) + if: matrix.java == 'temurin@11' + uses: actions/setup-java@v2 with: - java-version: ${{ matrix.java }} + distribution: temurin + java-version: 11 - name: Cache sbt uses: actions/cache@v2 @@ -97,22 +101,22 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - name: Download target directories (2.12.15) + - name: Download target directories (2.13.8) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }} + name: target-${{ matrix.os }}-2.13.8-${{ matrix.java }} - - name: Inflate target directories (2.12.15) + - name: Inflate target directories (2.13.8) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.13.7) + - name: Download target directories (3.1.0) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-2.13.7-${{ matrix.java }} + name: target-${{ matrix.os }}-3.1.0-${{ matrix.java }} - - name: Inflate target directories (2.13.7) + - name: Inflate target directories (3.1.0) run: | tar xf targets.tar rm targets.tar diff --git a/.gitignore b/.gitignore index 92322c4..face47b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ .idea/ target/ +/.bsp/ +/.metals/ +/.bloop/ diff --git a/.mergify.yml b/.mergify.yml index f803468..8f59eed 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,10 +1,13 @@ defaults: {} +queue_rules: + - name: default + conditions: [] pull_request_rules: - name: Automatically merge successful scala-steward PRs conditions: - author=scala-steward - - check-success=Build and Test (ubuntu-latest, 2.12.15, adopt@1.8) - - check-success=Build and Test (ubuntu-latest, 2.13.7, adopt@1.8) + - check-success=Build and Test (ubuntu-latest, 2.13.8, temurin@11) + - check-success=Build and Test (ubuntu-latest, 3.1.0, temurin@11) actions: - merge: - strict: true + queue: + name: default diff --git a/README.md b/README.md index df98dae..58f0b40 100644 --- a/README.md +++ b/README.md @@ -54,18 +54,20 @@ Artifacts are published to Bintray and synced to Bintray JCenter. For SBT use `r | CSS library | Scala DOM library | SBT Module ID | |--------------|--------------------------|---------------------------------------------------------------------| -| Bootstrap 3 | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "bootstrap3_scalatags" % "0.7.1"` | -| Bootstrap 3 | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "bootstrap3_scalajsreact" % "0.7.1"` | -| Bootstrap 4 | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "bootstrap4_scalatags" % "0.7.1"` | -| Bootstrap 4 | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "bootstrap4_scalajsreact" % "0.7.1"` | -| Bulma | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "bulma_scalatags" % "0.7.1"` | -| Bulma | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "bulma_scalajsreact" % "0.7.1"` | -| Fomantic UI | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "fomanticui_scalatags" % "0.7.1"` | -| Fomantic UI | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "fomanticui_scalajsreact" % "0.7.1"` | -| Font Awesome | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "fontawesome_scalatags" % "0.7.1"` | -| Font Awesome | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "fontawesome_scalajsreact" % "0.7.1"` | -| Semantic UI | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "semanticui_scalatags" % "0.7.1"` | -| Semantic UI | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "semanticui_scalajsreact" % "0.7.1"` | +| Bootstrap 3 | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "bootstrap3_scalatags" % "0.9.0"` | +| Bootstrap 3 | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "bootstrap3_scalajsreact" % "0.9.0"` | +| Bootstrap 4 | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "bootstrap4_scalatags" % "0.9.0"` | +| Bootstrap 4 | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "bootstrap4_scalajsreact" % "0.9.0"` | +| Bootstrap 5 | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "bootstrap5_scalatags" % "0.9.0"` | +| Bootstrap 5 | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "bootstrap5_scalajsreact" % "0.9.0"` | +| Bulma | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "bulma_scalatags" % "0.9.0"` | +| Bulma | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "bulma_scalajsreact" % "0.9.0"` | +| Fomantic UI | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "fomanticui_scalatags" % "0.9.0"` | +| Fomantic UI | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "fomanticui_scalajsreact" % "0.9.0"` | +| Font Awesome | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "fontawesome_scalatags" % "0.9.0"` | +| Font Awesome | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "fontawesome_scalajsreact" % "0.9.0"` | +| Semantic UI | `scalatags.Text` (JVM) | `"io.github.nafg.css-dsl" %% "semanticui_scalatags" % "0.9.0"` | +| Semantic UI | scalajs-react (scala.js) | `"io.github.nafg.css-dsl" %%% "semanticui_scalajsreact" % "0.9.0"` | ### Import @@ -78,9 +80,13 @@ Artifacts are published to Bintray and synced to Bintray JCenter. For SBT use `r | Bootstrap 4 | None | `import cssdsl.bootstrap4.Dsl._` | | Bootstrap 4 | `bs` | `import cssdsl.bootstrap4.BsDsl._` | | Bootstrap 4 | `bs4` | `import cssdsl.bootstrap4.Bs4Dsl._` | +| Bootstrap 5 | None | `import cssdsl.bootstrap5.Dsl._` | +| Bootstrap 5 | `bs` | `import cssdsl.bootstrap5.BsDsl._` | +| Bootstrap 5 | `bs5` | `import cssdsl.bootstrap5.Bs5Dsl._` | | Bulma | None | `import cssdsl.bulma.Dsl._` | | Bulma | `b` | `import cssdsl.bulma.BDsl._` | | Fomantic UI | `f` | `import cssdsl.fomanticui.FDsl._` | +| Font Awesome | None | `import cssdsl.fontawesome.Dsl._` | | Font Awesome | `fa` | `import cssdsl.fontawesome.FaDsl._` | | Semantic UI | `s` | `import cssdsl.semanticui.SDsl._` | diff --git a/build.sbt b/build.sbt index eaead3f..adeeaaa 100644 --- a/build.sbt +++ b/build.sbt @@ -1,12 +1,22 @@ import scala.sys.process.stringToProcess +import _root_.io.github.nafg.scalacoptions._ -ThisBuild / organization := "io.github.nafg.css-dsl" -ThisBuild / crossScalaVersions := Seq("2.12.15", "2.13.7") -ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.last -ThisBuild / scalacOptions += "-feature" -ThisBuild / scalacOptions += "-deprecation" +def myScalacOptions(version: String) = + ScalacOptions.all(version)( + (opts: options.Common) => opts.feature ++ opts.deprecation, + ) + +inThisBuild( + List( + organization := "io.github.nafg.css-dsl", + scalaVersion := "3.1.0", + crossScalaVersions := Seq("2.13.8", scalaVersion.value), + scalacOptions ++= myScalacOptions(scalaVersion.value), + versionScheme := Some("early-semver") + ) +) name := "css-dsl" publish / skip := true @@ -22,13 +32,13 @@ def latestIn(pkg: String, versionMajor: Int) = npmView(s"$pkg@$versionMajor", "version")(_.last match { case npmViewVersionRegex(v) => v }) def scalaJsReactSettings(config: CssDslConfig) = Seq( - libraryDependencies += "com.github.japgolly.scalajs-react" %%% "core" % "1.7.7", + libraryDependencies += "com.github.japgolly.scalajs-react" %%% "core" % "2.0.0", cssVariant := TargetImpl.ScalaJsReact, cssDslConfig := config ) def scalatagsSettings(config: CssDslConfig) = Seq( - libraryDependencies += "com.lihaoyi" %%% "scalatags" % "0.10.0", + libraryDependencies += "com.lihaoyi" %%% "scalatags" % "0.11.0", cssVariant := TargetImpl.Scalatags, cssDslConfig := config ) @@ -49,6 +59,14 @@ val bootstrap4Config = "https://cdn.jsdelivr.net/npm/bootstrap@" + _ + "/dist/css/bootstrap.min.css" ) +val bootstrap5Config = + CssDslConfig( + "Bootstrap 5", + Set(None, Some("bs"), Some("bs5")), + latestIn("bootstrap", 5), + "https://cdn.jsdelivr.net/npm/bootstrap@" + _ + "/dist/css/bootstrap.min.css" + ) + val bulmaConfig = CssDslConfig( "Bulma", @@ -91,6 +109,11 @@ lazy val bootstrap4_scalajsreact = lazy val bootstrap4_scalatags = project.enablePlugins(GeneratorPlugin).settings(scalatagsSettings(bootstrap4Config)) +lazy val bootstrap5_scalajsreact = + project.enablePlugins(ScalaJSPlugin, GeneratorPlugin).settings(scalaJsReactSettings(bootstrap5Config)) +lazy val bootstrap5_scalatags = + project.enablePlugins(GeneratorPlugin).settings(scalatagsSettings(bootstrap5Config)) + lazy val bulma_scalajsreact = project.enablePlugins(ScalaJSPlugin, GeneratorPlugin).settings(scalaJsReactSettings(bulmaConfig)) lazy val bulma_scalatags = diff --git a/project/WriteMergify.scala b/project/WriteMergify.scala deleted file mode 100644 index f99df17..0000000 --- a/project/WriteMergify.scala +++ /dev/null @@ -1,28 +0,0 @@ -import io.github.nafg.mergify.dsl._ -import sbt._ -import sbtghactions.GenerativePlugin -import sbtghactions.GenerativePlugin.autoImport._ - - -object WriteMergify extends AutoPlugin { - override def requires = GenerativePlugin - - override def trigger = allRequirements - - override def projectSettings = Seq( - githubWorkflowGenerate := { - githubWorkflowGenerate.value - for (job <- githubWorkflowGeneratedCI.value if job.id == "build") - IO.write( - file(".mergify.yml"), - mergify - .withRule("Automatically merge successful scala-steward PRs")( - (Attr.Author :== "scala-steward") +: - (for (o <- job.oses; s <- job.scalas; v <- job.javas) yield - Attr.CheckSuccess :== s"${job.name} ($o, $s, $v)"): _* - )(Action.Merge(strict = true)) - .toYaml - ) - } - ) -} diff --git a/project/build.properties b/project/build.properties index 7a7e80d..dd4ff43 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.5.5 +sbt.version = 1.6.1 diff --git a/project/build.sbt b/project/build.sbt index d658f31..9962d58 100644 --- a/project/build.sbt +++ b/project/build.sbt @@ -1,2 +1,2 @@ -libraryDependencies += "org.scalameta" %% "scalameta" % "4.4.30" -libraryDependencies += "com.helger" % "ph-css" % "6.4.0" +libraryDependencies += "org.scalameta" %% "scalameta" % "4.4.32" +libraryDependencies += "com.helger" % "ph-css" % "6.4.3" diff --git a/project/plugins.sbt b/project/plugins.sbt index 741a88f..21e68fd 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.1") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.8.0") addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.20.0") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10") -addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.13.0") -libraryDependencies += "io.github.nafg.mergify" %% "mergify-writer" % "0.2.1" +addSbtPlugin("io.github.nafg.mergify" % "sbt-mergify-github-actions" % "0.4.0") +libraryDependencies += "io.github.nafg.scalac-options" %% "scalac-options" % "0.1.9"