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
As a developer, I want to be able to use the version command, so that I can handle version bumps in a single command.
As a developer, I want pnpm to implement the version command instead of passing through to npm, so that I can bump versions in a workspace context.
Describe the solution you'd like
npm has the version command, which is meant to be workspace-aware. However, it's not pnpm-workspace-aware, which means that in order to use it via pnpm, I have to do the following:
pnpm --filter <workspace_name> exec pnpm version <version bump type>
While this works to run the version command on a particular workspace, it's cumbersome (since the -w flag on the version command doesn't know about pnpm workspaces, and you have to use exec pnpm after filtering the workspace).
Additionally, npm has this 4 year old npm bug regarding the version command, which means that it won't handle committing the package.json change and tagging when using it on non-root packages (i.e. workspaces). It changes the package.json version field correctly, but that's all it accomplishes.
Ideally, pnpm would implement the version command, which would make it pnpm-workspace-aware, and also ensuring the aforementioned bug doesn't occur.
Describe the drawbacks of your solution
It's additional code with an admittedly small overall benefit for a package manager (even though it's an entirely isolated piece of functionality, and is highly unlikely to have code-churn).
Describe alternatives you've considered
The following works, but is overly cumbersome. Also requires a weird hack to fool version into thinking it's at the top level (creating an empty .git directory).
The following would work, but again requires a weird hack to fool version into thinking it's at the top level. It also requires being defined in each workspace's package.json.
Contribution
Describe the user story
As a developer, I want to be able to use the version command, so that I can handle version bumps in a single command.
As a developer, I want pnpm to implement the version command instead of passing through to npm, so that I can bump versions in a workspace context.
Describe the solution you'd like
npm
has the version command, which is meant to be workspace-aware. However, it's not pnpm-workspace-aware, which means that in order to use it viapnpm
, I have to do the following:While this works to run the version command on a particular workspace, it's cumbersome (since the
-w
flag on the version command doesn't know aboutpnpm
workspaces, and you have to useexec pnpm
after filtering the workspace).Additionally,
npm
has this 4 year oldnpm
bug regarding the version command, which means that it won't handle committing the package.json change and tagging when using it on non-root packages (i.e. workspaces). It changes thepackage.json
version field correctly, but that's all it accomplishes.Ideally,
pnpm
would implement theversion
command, which would make it pnpm-workspace-aware, and also ensuring the aforementioned bug doesn't occur.Describe the drawbacks of your solution
It's additional code with an admittedly small overall benefit for a package manager (even though it's an entirely isolated piece of functionality, and is highly unlikely to have code-churn).
Describe alternatives you've considered
The following works, but is overly cumbersome. Also requires a weird hack to fool
version
into thinking it's at the top level (creating an empty.git
directory).The following would work, but again requires a weird hack to fool
version
into thinking it's at the top level. It also requires being defined in each workspace'spackage.json
.The text was updated successfully, but these errors were encountered: