Skip to content

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

Description

@jwarby

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions