From f5adb5108182455827e19e7caf7e5af0af6d0441 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Tue, 10 May 2022 10:41:36 -0700 Subject: [PATCH] feat: deprecated --global, --local, --location=global --- docs/content/commands/npm-bin.md | 2 + docs/content/commands/npm-config.md | 4 ++ docs/content/commands/npm-outdated.md | 2 + docs/content/commands/npm-prefix.md | 2 + docs/content/commands/npm-root.md | 2 + docs/content/using-npm/config.md | 60 ++++++++++--------- lib/utils/config/definitions.js | 6 ++ .../lib/utils/config/definitions.js.test.cjs | 4 ++ .../lib/utils/config/describe-all.js.test.cjs | 60 ++++++++++--------- 9 files changed, 86 insertions(+), 56 deletions(-) diff --git a/docs/content/commands/npm-bin.md b/docs/content/commands/npm-bin.md index 94b72cfd5c81c..07311b9e00f71 100644 --- a/docs/content/commands/npm-bin.md +++ b/docs/content/commands/npm-bin.md @@ -34,6 +34,8 @@ Print the folder where npm will install executables. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are deprecated. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-config.md b/docs/content/commands/npm-config.md index a66a198ce42d1..f487c189a5ce3 100644 --- a/docs/content/commands/npm-config.md +++ b/docs/content/commands/npm-config.md @@ -124,6 +124,8 @@ Not supported by all npm commands. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are deprecated. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See @@ -153,6 +155,8 @@ The command to run for `npm edit` and `npm config edit`. * Default: "user" unless `--global` is passed, which will also set this value to "global" * Type: "global", "user", or "project" +* DEPRECATED: `--location=global` is deprecated, but the values "user" and + "project" are not. When passed to `npm config` this refers to which config file to use. diff --git a/docs/content/commands/npm-outdated.md b/docs/content/commands/npm-outdated.md index 6fa026550e747..6affb5fa36373 100644 --- a/docs/content/commands/npm-outdated.md +++ b/docs/content/commands/npm-outdated.md @@ -150,6 +150,8 @@ Output parseable results from commands that write to standard output. For * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are deprecated. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-prefix.md b/docs/content/commands/npm-prefix.md index 39328bcc88a14..1cc85a939e7d1 100644 --- a/docs/content/commands/npm-prefix.md +++ b/docs/content/commands/npm-prefix.md @@ -51,6 +51,8 @@ npm prefix -g * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are deprecated. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-root.md b/docs/content/commands/npm-root.md index 40b58e4b33d0b..b2a8bba8ba0f2 100644 --- a/docs/content/commands/npm-root.md +++ b/docs/content/commands/npm-root.md @@ -41,6 +41,8 @@ echo "Global packages installed in: ${global_node_modules}" * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are deprecated. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/using-npm/config.md b/docs/content/using-npm/config.md index df1d996110b31..eb0061a5eff64 100644 --- a/docs/content/using-npm/config.md +++ b/docs/content/using-npm/config.md @@ -687,23 +687,6 @@ results in no commit being made at all. -#### `global` - -* Default: false -* Type: Boolean - -Operates in "global" mode, so that packages are installed into the `prefix` -folder instead of the current working directory. See -[folders](/configuring-npm/folders) for more on the differences in behavior. - -* packages are installed into the `{prefix}/lib/node_modules` folder, instead - of the current working directory. -* bin files are linked to `{prefix}/bin` -* man pages are linked to `{prefix}/share/man` - - - - #### `global-style` * Default: false @@ -993,17 +976,6 @@ npm registry. Must be IPv4 in versions of Node prior to 0.12. -#### `location` - -* Default: "user" unless `--global` is passed, which will also set this value - to "global" -* Type: "global", "user", or "project" - -When passed to `npm config` this refers to which config file to use. - - - - #### `lockfile-version` * Default: Version 2 if no lockfile or current lockfile version less than or @@ -1928,6 +1900,25 @@ Alias for `--include=dev`. +#### `global` + +* Default: false +* Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are deprecated. + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + + #### `init.author.email` * Default: "" @@ -1994,6 +1985,19 @@ Alias for `--init-version` +#### `location` + +* Default: "user" unless `--global` is passed, which will also set this value + to "global" +* Type: "global", "user", or "project" +* DEPRECATED: `--location=global` is deprecated, but the values "user" and + "project" are not. + +When passed to `npm config` this refers to which config file to use. + + + + #### `only` * Default: null diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index a5eac8c826c84..b2bb56da96adf 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -811,6 +811,9 @@ define('global', { default: false, type: Boolean, short: 'g', + deprecated: ` + \`--global\`, \`--location=global\`, \`--no-global\`, and \`--local\` are deprecated. + `, description: ` Operates in "global" mode, so that packages are installed into the \`prefix\` folder instead of the current working directory. See @@ -1177,6 +1180,9 @@ define('location', { defaultDescription: ` "user" unless \`--global\` is passed, which will also set this value to "global" `, + deprecated: ` + \`--location=global\` is deprecated, but the values "user" and "project" are not. + `, description: ` When passed to \`npm config\` this refers to which config file to use. `, diff --git a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs index 42db6ce030b53..57e1f33bebd18 100644 --- a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs @@ -730,6 +730,8 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for globa * Default: false * Type: Boolean +* DEPRECATED: \`--global\`, \`--location=global\`, \`--no-global\`, and \`--local\` + are deprecated. Operates in "global" mode, so that packages are installed into the \`prefix\` folder instead of the current working directory. See @@ -1074,6 +1076,8 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for locat * Default: "user" unless \`--global\` is passed, which will also set this value to "global" * Type: "global", "user", or "project" +* DEPRECATED: \`--location=global\` is deprecated, but the values "user" and + "project" are not. When passed to \`npm config\` this refers to which config file to use. ` diff --git a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs index d0ce3a26f764f..cd6ac9065c0d1 100644 --- a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs @@ -560,23 +560,6 @@ results in no commit being made at all. -#### \`global\` - -* Default: false -* Type: Boolean - -Operates in "global" mode, so that packages are installed into the \`prefix\` -folder instead of the current working directory. See -[folders](/configuring-npm/folders) for more on the differences in behavior. - -* packages are installed into the \`{prefix}/lib/node_modules\` folder, instead - of the current working directory. -* bin files are linked to \`{prefix}/bin\` -* man pages are linked to \`{prefix}/share/man\` - - - - #### \`global-style\` * Default: false @@ -866,17 +849,6 @@ npm registry. Must be IPv4 in versions of Node prior to 0.12. -#### \`location\` - -* Default: "user" unless \`--global\` is passed, which will also set this value - to "global" -* Type: "global", "user", or "project" - -When passed to \`npm config\` this refers to which config file to use. - - - - #### \`lockfile-version\` * Default: Version 2 if no lockfile or current lockfile version less than or @@ -1801,6 +1773,25 @@ Alias for \`--include=dev\`. +#### \`global\` + +* Default: false +* Type: Boolean +* DEPRECATED: \`--global\`, \`--location=global\`, \`--no-global\`, and \`--local\` + are deprecated. + +Operates in "global" mode, so that packages are installed into the \`prefix\` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the \`{prefix}/lib/node_modules\` folder, instead + of the current working directory. +* bin files are linked to \`{prefix}/bin\` +* man pages are linked to \`{prefix}/share/man\` + + + + #### \`init.author.email\` * Default: "" @@ -1867,6 +1858,19 @@ Alias for \`--init-version\` +#### \`location\` + +* Default: "user" unless \`--global\` is passed, which will also set this value + to "global" +* Type: "global", "user", or "project" +* DEPRECATED: \`--location=global\` is deprecated, but the values "user" and + "project" are not. + +When passed to \`npm config\` this refers to which config file to use. + + + + #### \`only\` * Default: null