From 5f686982dc44bb162c35c202ddb8db004f3c58c0 Mon Sep 17 00:00:00 2001 From: Max Black Date: Tue, 18 Nov 2025 23:54:04 -0800 Subject: [PATCH 1/2] docs(version): add --save flag to documentation The --save flag was already implemented and used in workspaces but was not included in the auto-generated documentation. Adding it to the params array will ensure it appears in the npm version help and documentation. When used with workspaces, --save updates the root package.json dependencies to match the new workspace versions. Fixes #8170 --- lib/commands/version.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/commands/version.js b/lib/commands/version.js index cc96adb8db552..fe70322fd7cb9 100644 --- a/lib/commands/version.js +++ b/lib/commands/version.js @@ -13,6 +13,7 @@ class Version extends BaseCommand { 'json', 'preid', 'sign-git-tag', + 'save', 'workspace', 'workspaces', 'workspaces-update', From 2166ceb7ef16cae149acb54557835b39d6e30cfe Mon Sep 17 00:00:00 2001 From: Max Black Date: Wed, 19 Nov 2025 00:39:03 -0800 Subject: [PATCH 2/2] test: update snapshots for --save flag in version command --- tap-snapshots/test/lib/docs.js.test.cjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tap-snapshots/test/lib/docs.js.test.cjs b/tap-snapshots/test/lib/docs.js.test.cjs index 1e152fc8954fe..f173a1cf67720 100644 --- a/tap-snapshots/test/lib/docs.js.test.cjs +++ b/tap-snapshots/test/lib/docs.js.test.cjs @@ -4652,6 +4652,7 @@ npm version [ | major | minor | patch | premajor | preminor | prepat Options: [--allow-same-version] [--no-commit-hooks] [--no-git-tag-version] [--json] [--preid prerelease-id] [--sign-git-tag] +[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] [-w|--workspace [-w|--workspace ...]] [--workspaces] [--no-workspaces-update] [--include-workspace-root] [--ignore-scripts] @@ -4672,6 +4673,7 @@ alias: verison #### \`json\` #### \`preid\` #### \`sign-git-tag\` +#### \`save\` #### \`workspace\` #### \`workspaces\` #### \`workspaces-update\`