Skip to content

Support workspace: specifiers (without *, ^, ~) #10381

@gluxon

Description

@gluxon

Contribution

Describe the user story

Currently users can use the workspace: protocol without any value after the colon.

{
  "dependencies": {
    "foo": "workspace:"
  }
}

When running pnpm publish, this becomes:

{
  "dependencies": {
    "foo": ""
  }
}

This is probably a bug since "" is an ambiguous specifier.

Describe the solution you'd like

Using workspace: should equate to workspace:*. The result of pnpm publish should then be:

{
  "dependencies": {
    "foo": "<concrete-version-of-foo-package>"
  }
}

Comment from Zoltan:

Describe the drawbacks of your solution

No response

Describe alternatives you've considered

We could also throw an error when encountering workspace:. From the discussion linked above, it sounds like we'd prefer just supporting this and making workspace: the same as workspace:*.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions