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

pnpm up replaces workspace: protocol relative paths with version range #3902

Open
jwarby opened this issue Oct 20, 2021 · 0 comments
Open

pnpm up replaces workspace: protocol relative paths with version range #3902

jwarby opened this issue Oct 20, 2021 · 0 comments
Labels
area: monorepo Everything related to the pnpm workspace feature size: S type: bug

Comments

@jwarby
Copy link

jwarby commented Oct 20, 2021

pnpm version: 6.17.2

Code to reproduce the issue:

As mentioned in #3901, running pnpm up changes dependencies which the workspace: protocol with a relative path to a version specifier instead:

- "@my-company-scope/package": "workspace:../path/to/package"
+ "@my-company-scope/package": "workspace:^1.0.0"

The link: in the pnpm-lock.yaml file also gets changed - this is a significant problem if the workspace: path was being used to point at a publish directory (again, discussed in #3901):

- '@my-company-scope/package': link:../../packages/package/dist
+ '@my-company-scope/package': link:../../packages/package

Expected behavior:

  • The workspace: specifier is not modified by pnpm up
  • The associated link: in pnpm-lock.yaml is also not modified

Actual behavior:

  • workspace: path specifier is replaced with current package version using ^ range specifier
  • link: in the pnpm-lock.yaml file is overwritten
    • Note that the link: still gets modified even when running up with the --no-save flag

Additional information:

  • node -v prints: v14.15.1
  • Windows, macOS, or Linux?: Linux
@zkochan zkochan added the area: monorepo Everything related to the pnpm workspace feature label Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: monorepo Everything related to the pnpm workspace feature size: S type: bug
Projects
None yet
Development

No branches or pull requests

2 participants