Skip to content
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

[monorepo]: updating package version is HARD #9689

Closed
aslushnikov opened this issue Oct 21, 2021 · 4 comments
Closed

[monorepo]: updating package version is HARD #9689

aslushnikov opened this issue Oct 21, 2021 · 4 comments
Assignees

Comments

@aslushnikov
Copy link
Contributor

TL;DR: introduce a single command to update package version.

Context

After the migration to a monorepo, it's hard to update package version.

As of today, what needs to be done:

  1. Update version in //package.json
  2. Run npm run lint-packages. This will propagate version to sub-packages
  3. Update version from old to new one in //package-lock.json and //packages/create-playwright/package-lock.json. I usually use sed for this, for BSD sed it looks like this:
    $ sed -i '' -e 's/1.16.0-next/1.16.0/g' package-lock.json
    $ sed -i '' -e 's/1.16.0-next/1.16.0/g' packages/create-playwright/package-lock.json

The last part is especially tricky. Without doing so, the npm install call just fails.

@mxschmitt
Copy link
Member

For step 3. executing npm install should propagate it across the package-lock.json. The package-lock.json inside create-playwright gets removed soon.

Seems like after:

this seems at least partly better. and we can create a small wrapper script around this "version bumping" process for releases (update version in package.json, lint-packages, npm install)

@aslushnikov
Copy link
Contributor Author

Unfortunately, npm i doesn't work - it crashes with some error :(

@mxschmitt
Copy link
Member

Created npm/cli#3940 in the NPM CLI with a small repro.

@mxschmitt
Copy link
Member

Closing for now since we have a workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants