Skip to content

feat: treat bare workspace: protocol as workspace:*#10436

Merged
zkochan merged 5 commits intopnpm:mainfrom
shuntatakemoto:shuntatakemoto/workspace-bare-as-star
Jan 26, 2026
Merged

feat: treat bare workspace: protocol as workspace:*#10436
zkochan merged 5 commits intopnpm:mainfrom
shuntatakemoto:shuntatakemoto/workspace-bare-as-star

Conversation

@shuntatakemoto
Copy link
Contributor

close #10381

This PR changes the bare workspace: protocol (without *, ^ or ~) to be treated as equivalent to workspace:*, so it resolves to the referenced package's concrete version during publish.

There are existing repositories using this syntax: https://github.com/search?q=path%3Apackage.json+%22%5C%22workspace%3A%5C%22%22&type=code&p=1

Copilot AI review requested due to automatic review settings January 10, 2026 08:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the bare workspace: protocol (without version specifier), treating it equivalently to workspace:* so that it resolves to the referenced package's concrete version during publish.

Changes:

  • Modified workspace resolution to treat empty version strings as wildcards
  • Updated npm resolver to convert bare workspace: to *
  • Enhanced manifest export logic to handle bare workspace protocol

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
workspace/resolve-workspace-range/src/index.ts Added empty string check to treat bare protocol like *, ^, ~
resolving/npm-resolver/src/workspacePrefToNpm.ts Added conversion of empty version to *
resolving/npm-resolver/test/workspacePrefToNpm.test.ts Added test case for bare workspace: protocol
pkg-manifest/exportable-manifest/src/index.ts Updated regex and logic to match bare workspace protocol
pkg-manifest/exportable-manifest/test/index.test.ts Added test case with quux: 'workspace:' dependency
.changeset/nine-areas-glow.md Documented the new feature as a minor version bump

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


export function resolveWorkspaceRange (range: string, versions: string[]): string | null {
if (range === '*' || range === '^' || range === '~') {
if (range === '*' || range === '^' || range === '~' || range === '') {
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change adds support for empty range strings (for bare workspace: protocol), but there are no test cases covering this new behavior. Consider adding tests to verify that resolveWorkspaceRange('', versions) correctly returns the maximum version from the provided versions array, similar to how '*', '^', and '~' are handled.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zkochan zkochan merged commit 0625e20 into pnpm:main Jan 26, 2026
11 of 12 checks passed
@welcome
Copy link

welcome bot commented Jan 26, 2026

Congrats on merging your first pull request! 🎉🎉🎉

zkochan added a commit that referenced this pull request Feb 6, 2026
* feat: treat bare `workspace:` protocol as `workspace:*`

* chore: add chageset

* test(exportable-manifest): add test for `workspace` with explicit versions

* test: add tests and update changesets

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
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

Successfully merging this pull request may close these issues.

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

3 participants