Skip to content

fix(pm): pass --save-prod to npm for vp add --save-prod - #3515

Merged
fengmk2 merged 4 commits into
voidzero-dev:mainfrom
liangmiQwQ:liang/fix-npm-save-prod
Nov 21, 2026
Merged

fengmk2 merged 4 commits into
voidzero-dev:mainfrom
liangmiQwQ:liang/fix-npm-save-prod

Conversation

@liangmiQwQ

@liangmiQwQ liangmiQwQ commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Right now, vp add --save-prod (-P) runs npm install --save with npm. When the package already exists in devDependencies, npm keeps it there.

This PR passes both --save and --save-prod for an explicit production target. The first flag writes to package.json even when the project sets save=false. The second tells npm to move an existing development or optional dependency into dependencies.

🤖 Generated with Claude Code and Codex

fengmk2 pushed a commit that referenced this pull request Nov 21, 2026
#3517)

Yarn and Bun have no flag for saving to \`dependencies\`, so \`vp add
-P\` runs a plain \`yarn add\` or \`bun add\`. For a new package, the
result is the same as with npm or pnpm.

It differs when the package is already listed in another section. pnpm's
\`--save-prod\` moves it into \`dependencies\`, and npm's does too once
#3515 lands. Yarn Classic, Yarn Modern, and Bun leave it where it is.
The compatibility table currently lists \`-P\` as fully supported on all
of them with no caveat.

This PR adds a note to that row.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@liangmiQwQ
liangmiQwQ marked this pull request as ready for review November 21, 2026 07:15

@liangmiQwQ liangmiQwQ left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

✅ Passed review in the Codex app using GPT-6.2 Astra Max.

@fengmk2 fengmk2 self-assigned this Nov 21, 2026
@fengmk2
fengmk2 merged commit b6da1ac into voidzero-dev:main Nov 21, 2026
78 checks passed
@fengmk2 fengmk2 mentioned this pull request Nov 23, 2026
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.

3 participants