Skip to content

Commit

Permalink
Force scalajs-dom version bump in didJS module
Browse files Browse the repository at this point in the history
See scala-steward-org/scala-steward#3222
===
I never added the dependency scalajs-dom to 'libraryDependencies' it must be one of the plugins.

After exploring the 'dependencyTree' the module didJS:
- I force the the latest dependency of `zio` (a transitive dependency of `zio-json`)
 - this will force a version bump of scalajs-dom from version `2.3.0` to `2.7.0`
- In the JS part of crossProject I forced again a version bump of scalajs-dom version to `2.8.0`

But I still have the version 2.3.0 in the libraryDependencies.
The 'didJS / libraryDependencies' now show both 'org.scala-js:scalajs-dom_sjs1_3:2.3.0' and 'org.scala-js:scalajs-dom:2.8.0'.
If the name was the same I would be confident that latest would supersede the other.

Not sure if I should force a remove of that by filtering the content in 'libraryDependencies'?
  • Loading branch information
FabioPinheiro committed Nov 27, 2023
1 parent 8b48e1f commit a3e9bf4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ lazy val D = new {
)

/* Depend on the scalajs-dom library. It provides static types for the browser DOM APIs. */
val dom = Def.setting("org.scala-js" %%% "scalajs-dom" % V.scalajsDom)
val scalajsDom = Def.setting("org.scala-js" %%% "scalajs-dom" % V.scalajsDom)

val zio = Def.setting("dev.zio" %%% "zio" % V.zio)
val zioStreams = Def.setting("dev.zio" %%% "zio-streams" % V.zio)
Expand Down Expand Up @@ -363,8 +363,10 @@ lazy val did = crossProject(JSPlatform, JVMPlatform)
.settings(
name := "did",
libraryDependencies += D.zioJson.value,
libraryDependencies += D.zio.value, // Just to force a version bump (including scalajsDom)
libraryDependencies += D.zioMunitTest.value,
)
.jsSettings(libraryDependencies += D.scalajsDom.value) // just to really really force a version bump
.jsSettings(libraryDependencies += D.scalajsJavaSecureRandom.value.cross(CrossVersion.for3Use2_13))
.jsConfigure(scalaJSLibConfigure)
.jsSettings(
Expand Down Expand Up @@ -400,7 +402,7 @@ lazy val didFramework = crossProject(JSPlatform, JVMPlatform)
)
.dependsOn(did % "compile;test->test")
.jvmSettings(libraryDependencies += D.ziohttp.value)
.jsSettings(libraryDependencies += D.dom.value)
.jsSettings(libraryDependencies += D.scalajsDom.value)
.jsConfigure(scalaJSLibConfigure) // Because of didJS now uses NPM libs
.configure(docConfigure)

Expand Down Expand Up @@ -510,7 +512,7 @@ lazy val didUniresolver = crossProject(JSPlatform, JVMPlatform)
.jvmSettings(libraryDependencies += D.ziohttp.value)
// .enablePlugins(ScalaJSBundlerPlugin).jsSettings(Test / npmDependencies += "node-fetch" -> "3.3.0")
.jsSettings( // TODO https://scalacenter.github.io/scalajs-bundler/reference.html#jsdom
libraryDependencies += D.dom.value,
libraryDependencies += D.scalajsDom.value,
// jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv(),
// Test / requireJsDomEnv := true,
)
Expand All @@ -531,7 +533,7 @@ lazy val serviceworker = project
scalaJSModuleInitializers := Seq( // scalaJSUseMainModuleInitializer := true,
ModuleInitializer.mainMethod("fmgp.serviceworker.SW", "main").withModuleID("sw")
),
libraryDependencies += D.dom.value,
libraryDependencies += D.scalajsDom.value,
libraryDependencies ++= Seq(D.zio.value, D.zioJson.value),
)

Expand Down

0 comments on commit a3e9bf4

Please sign in to comment.