scala-steward icon indicating copy to clipboard operation
scala-steward copied to clipboard

Stewart try to update it as being another dependency

Open FabioPinheiro opened this issue 2 years ago • 3 comments

I can't find any reason why Stewart could try to update scala-java-time as being the scalajs-dom. In this PR https://github.com/FabioPinheiro/scala-did/pull/177 title Update scalajs-dom_sjs1_3 to 2.8.0.

Updated to 2.8.0 but the latest version is 2.5.0 https://mvnrepository.com/artifact/io.github.cquiroz/scala-java-time

lazy val V = new {
  val scalajsDom = "2.8.0"
  val scalaJavaTime = "2.3.0"
  ...
}
lazy val D = new {
  val dom = Def.setting("org.scala-js" %%% "scalajs-dom" % V.scalajsDom)
  val scalaJavaT = Def.setting("io.github.cquiroz" %%% "scala-java-time" % V.scalaJavaTime)
  val scalaJavaTZ = Def.setting("io.github.cquiroz" %%% "scala-java-time-tzdb" % V.scalaJavaTime)
  ...
}

FabioPinheiro avatar Nov 26 '23 16:11 FabioPinheiro

If you run sbt libraryDependencies, you'll see that some modules of your project depend on org.scala-js:scalajs-dom_sjs1_3:2.3.0. For example:

[info] didJS / libraryDependencies
[info] 	List(org.scala-lang:scala3-library_sjs1:3.3.1,
  org.scala-js:scalajs-library_2.13:1.14.0,
  org.scala-js:scalajs-test-bridge_2.13:1.14.0:test,
  org.scala-js:scalajs-dom_sjs1_3:2.3.0,
  com.olvind:scalablytyped-runtime_sjs1_3:2.4.2,
  org.scalameta:munit:1.0.0-M10:test, dev.zio:zio-json:0.6.2,
  com.github.poslegm:munit-zio:0.2.0:test,
  org.scala-js:scalajs-java-securerandom:1.0.0)

Scala Steward bumped the scala-java-time version because it was the only 2.3.0 version it could find in the build and the names of both libraries have the same prefix. I guess you want to change your build such that all scalajs-dom dependencies have the same version.

fthomas avatar Nov 27 '23 20:11 fthomas

Thanks @fthomas Indeed that was unexpected. I never added the dependency to libraryDependencies it must be one of the plugins.

After exploring the dependencyTree that module

  • 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?

(In summary I'm more confused than Scala Stewart)

FabioPinheiro avatar Nov 27 '23 21:11 FabioPinheiro

Not sure how Stewart search for those versions.

okay I can imagine if we force it and search by text* will point out that variable is the best place to try.

Hum but after update shouldn't Stewart confirm that the version was updated?

I'm convinced the version is coming from one of the plugins (but I didn't search). In this case there isn't much that Stewart can do about it. Unless we want to add the dependency forcing the latest version. Feel free to close the ticket if your thing it's working as expected.

FabioPinheiro avatar Nov 27 '23 22:11 FabioPinheiro