-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add first-class support for frozen lockfiles #409
Comments
You can achieve this now with |
This PR to be specific - #420. |
Right, this issue is about adding "first-class" support for frozen lockfiles, precisely so you don't have to muck about with |
Ah, now I understand the issue. All package managers that I know of ( |
Yes, exactly :) sure, that would be great. However, personally I've become disillusioned about scalajs-bundler and using npm dependencies from Scala.js libs in general (I've focused on replacing them with pure Scala libs instead) so atm I no longer have much interest in this, sorry :( |
No worries, makes sense to have this feature anyways. What replacements do you have in mind? Mind sharing some issues/PRs you are working on? I would be interested in checking them out. |
Here's a few off the top of my head, but if there's something specific you are curious about I can point you in the right direction. |
(Note: I'm specifically referencing yarn since that's what I'm familiar with, but this issue is relevant for npm as well).
By default, installing npm dependencies with scalajs-bundler+yarn will also possibly change/update versions of transitive npm dependencies (and modify the lockfile
yarn.lock
). This can cause issues like #259. The solution is that yarn should be run with--frozen-lockfile
so that the versions in the lockfile are actually respected (i.e., you get a reproducible build), unless you are specifically intending to update your npm dependencies.In fact, this issue of frozen lockfiles will be directly addressed in the next major version of yarn: yarnpkg/yarn#4147 (comment)
IMHO the
--frozen-lockfile
argument is important enough that it should be exposed as an sbt setting and/or there should be alternative versions of tasks available to install npm dependencies with/without freezing the lockfile. Even better it should be frozen by default. Arguably this is the expected behaviour for those of us used to maven/sonatype (i.e., transitive dependency versions don't randomly change between builds).This would facilitate integration with plugins such as sbt-github-actions (which have knowledge of whether the build is running in CI).
This would also be extremely helpful in scala-steward so that it is easily able to disable freezing and update a lockfile while updating Scala dependencies. This is critical when changes in npm dependencies are inherited transitively from a Scala dependency. See scala-steward-org/scala-steward#2252.
The text was updated successfully, but these errors were encountered: