feat(build): support pnpm workspace: protocol in dependencies#78
Open
matehortua-godaddy wants to merge 2 commits into
Open
feat(build): support pnpm workspace: protocol in dependencies#78matehortua-godaddy wants to merge 2 commits into
matehortua-godaddy wants to merge 2 commits into
Conversation
When using @radpack/build in a pnpm workspace monorepo, dependency specifiers like `workspace:*`, `workspace:^1.0.0`, or `workspace:~` are used to reference local packages. The build step now strips the `workspace:` prefix before version resolution, treating them as their underlying semver range. This enables radpack-built packages to coexist in pnpm workspaces without requiring manual version pinning workarounds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When pnpm's workspace:^ or workspace:~ is stripped to just ^ or ~, get-version now resolves the latest available version and applies the appropriate prefix (caret or tilde) to the manifest output. This ensures radpack manifests contain proper versioned externals like @wsb/guac-widget-shared@^1 even when the source package.json uses workspace:^ shorthand.
gingur
approved these changes
Jun 10, 2026
rmarrou-godaddy
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
workspace:prefix from dependency version specifiers inparse-options.jsbefore passing them to version resolution@radpack/buildto work in pnpm workspace monorepos where packages useworkspace:*,workspace:^,workspace:~, orworkspace:^x.y.zspecifiersworkspace:*is treated as*(wildcard, use latest at run-time)workspace:^1.0.0is treated as^1.0.0(standard semver range)Motivation
When using
@radpack/buildin a pnpm workspace monorepo, the build fails with:The
workspace:protocol is a pnpm-specific feature for referencing local packages. It has no semver meaning — it's a package manager instruction that should be transparent to build tools.Changes
packages/build/src/parse-options.js: Stripworkspace:prefix when building the dependencies mappackages/build/test/unit/parse-options.test.js: New test file covering all workspace protocol variantsTest plan
workspace:*specifiers