fix(bump): node apply drops pnpm -w outside a workspace (v2.0.6) - #42
Merged
Conversation
_install_cmd read an empty workspaceName as "workspace root" and fell back to `pnpm add -w`, but workspaceName is empty for the root manifest of ANY repo — including a plain single-package one, where pnpm rejects -w with "--workspace-root may only be used inside a workspace". Since in-range bumps never reach this path, every range-widening (i.e. major) bump in a non-workspace pnpm repo failed. Gate -w on pnpm-workspace.yaml actually existing — pnpm ignores package.json's `workspaces` field, so that file's presence is the definition of a pnpm workspace. A real workspace root keeps -w (plain `pnpm add` there fails with ERR_PNPM_ADDING_TO_ROOT); a plain repo gets no flag, matching the npm branch's existing behavior. Fixes #40. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016FKf6Gee6Zzd4xF6Ldho54
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
ecosystem node applyfailed on every range-widening bump in a single-package pnpm repo:_install_cmdread an emptyworkspaceNameas "workspace root" and unconditionally fell back topnpm add -w, which pnpm rejects outside a workspace (ERROR --workspace-root may only be used inside a workspace). Since in-range bumps never reach the manifest-rewriting path, the practical effect was that major bumps were unappliable in exactly the repos most likely to be single-package.Fix
Gate
-wonpnpm-workspace.yamlactually existing at the project root — pnpm ignores package.json'sworkspacesfield, so that file's presence is the definition of a pnpm workspace:--filter <name>(unchanged)-w(unchanged; plainpnpm addthere fails withERR_PNPM_ADDING_TO_ROOT)handle("apply")passes its root down so the probe honors the working directory.Tests
TDD:
test_pnpm_plain_repo_omits_workspace_flagwritten first and watched failing with exactly the buggy command (pnpm add -w -D eslint@^11.0.0), plustest_pnpm_workspace_root_keeps_w_flagpinning the workspace-root behavior. Full suite: 851 passed, 456 subtests passed; ruff clean.Version bumped 2.0.5 → 2.0.6 in both plugin manifests.
Fixes #40.
🤖 Generated with Claude Code
https://claude.ai/code/session_016FKf6Gee6Zzd4xF6Ldho54