-
Notifications
You must be signed in to change notification settings - Fork 753
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
update package-lock.json
with the newer version of the published package ([email protected]
)
#198
Conversation
Whenever we do a release, we have a problem where package-lock.json isn't in sync anymore. Specifically, because workspace definitions are also stored in this file, and we don't update the version numbers, there's a mismatch. I would've just committed this directly to `main`, but I'm opening the PR to make this problem visible, and see if anyone has any suggestions for hot to fix this. Could the "Version Packages" PR generation process also run `npm install` at the root so package-lock.json also gets updated? Is this something the `changesets` team needs to fix?
|
cc @Andarist am I missing something here? Is this a common problem with changesets? Thank you! |
I think this is a result of our use of npm workspaces. See npm/cli#3756 |
Could we do something along the lines of
release.yml github workflow? |
Yeah, but changesets is built for workspaces, so I'd imagine they'd have a "solution". I don't think npx changeset version changes package-lock.json either (I could be wrong?) |
@threepointone it appears that this is currently a known problem with Changesets: changesets/changesets#421 I didn't run into this myself cause Yarn Classic (which is still my primary package manager, old habits) doesn't keep this information in the lockfile. But yes - I believe that this should be handled by Changesets cause it's not good that the user runs into problems like this. I think there are 3 solutions here:
For the time being, I would recommend patching this with a script called after |
@Andarist - thanks for the quick response!
You just run |
From npm/cli#3756 is looks like this is also a problem with |
Workaround a problem in changesets where it does not update the package-lock.json after the version has been bumped in package.json. See changesets/changesets#421 Fixes cloudflare#198
I have created #212 to workaround this for the time-being. |
I won't lie... that this won't work crossed my mind 😂
One concern that I have with this is that at least Yarn Classic can update the lock when running |
Workaround a problem in changesets where it does not update the package-lock.json after the version has been bumped in package.json. See changesets/changesets#421 Fixes cloudflare#198
Workaround a problem in changesets where it does not update the package-lock.json after the version has been bumped in package.json. See changesets/changesets#421 Fixes #198
Whenever we do a changesets release, we have a problem where package-lock.json isn't in sync anymore. Specifically, because workspace definitions are also stored in this file, and we don't update the version numbers, there's a mismatch.
I would've just committed this directly to
main
, but I'm opening the PR to make this problem visible, and see if anyone has any suggestions for hot to fix this. Could the "Version Packages" PR generation process also runnpm install
at the root so package-lock.json also gets updated? Is this something thechangesets
team needs to fix?