You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
configure a build process to generate dist directories within each package
this also creates a near-duplicate package.json file in that new directory, still containing workspace: protocol version declarations
run a pnpm -r publish
Describe the Bug
When using the Workspaces feature, we need a way to resolve the workspace:^ protocol in package.jsons when they are within the generated built files after a build process. Given the reproduction setup, running pnpm publish within a packages/**/dist directory results in the following error:
ERR_PNPM_CANNOT_RESOLVE_WORKSPACE_PROTOCOL
Cannot resolve workspace protocol of dependency "@scope/mine" because the dependency is not installed. Try running "pnpm install"
However, this seems to be because the directory packages/**/dist is not declared as a workspace. That in and of itself makes sense, however how am I meant to proceed with a simple publishing process once I have a dist directory? I do not want to publish an entire packages/** directory, as that is Typescript and configuration files that have no business being distributed (nor would my users be able to easily navigate to the proper entry points with so many index.* files around).
I have tried the publishConfig.directory approach, which allows me to work within a packages/** directory as a workspace, and get publish or pack to replace the semvers. However this introduces another complexity in that now the dist directories are necessary at all times for importing during development, since the linked node_modules are now all looking for them. (I can see this as my pnpm-lock.yml updates to start pointing to all of the dists.)
I'd also prefer not to have some build:watch process, in addition to storybook running, to allow all of my workspace packages to talk to one another... but is that the only solution?
Expected Behavior
pnpm workspaces can understand the concept of a built directory, within a package workspace directory and accomplish resolving the workspace: protocol version numbers, while also not creating hard dependencies on the same generated directories during normal development.
Which Node.js version are you using?
22.12.0
Which operating systems have you used?
macOS
Windows
Linux
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response
The text was updated successfully, but these errors were encountered:
+1
Ccurrently having these exact issues.
Some temporary solution can be adding these options the .npmrc and removing the "workspace:" from your packages.jon
Uh oh!
There was an error while loading. Please reload this page.
Verify latest release
pnpm version
10.5.2
Which area(s) of pnpm are affected? (leave empty if unsure)
Lockfile, Workspaces
Link to the code that reproduces this issue or a replay of the bug
No response
Reproduction steps
dist
directories within each packageworkspace:
protocol version declarationsDescribe the Bug
When using the Workspaces feature, we need a way to resolve the
workspace:^
protocol in package.jsons when they are within the generated built files after a build process. Given the reproduction setup, runningpnpm publish
within apackages/**/dist
directory results in the following error:However, this seems to be because the directory
packages/**/dist
is not declared as a workspace. That in and of itself makes sense, however how am I meant to proceed with a simple publishing process once I have adist
directory? I do not want to publish an entirepackages/**
directory, as that is Typescript and configuration files that have no business being distributed (nor would my users be able to easily navigate to the proper entry points with so many index.* files around).I have tried the
publishConfig.directory
approach, which allows me to work within apackages/**
directory as a workspace, and get publish or pack to replace the semvers. However this introduces another complexity in that now thedist
directories are necessary at all times for importing during development, since the linked node_modules are now all looking for them. (I can see this as my pnpm-lock.yml updates to start pointing to all of the dists.)I'd also prefer not to have some build:watch process, in addition to storybook running, to allow all of my workspace packages to talk to one another... but is that the only solution?
Expected Behavior
pnpm workspaces can understand the concept of a built directory, within a package workspace directory and accomplish resolving the workspace: protocol version numbers, while also not creating hard dependencies on the same generated directories during normal development.
Which Node.js version are you using?
22.12.0
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response
The text was updated successfully, but these errors were encountered: