Skip to content

Commit

Permalink
feat: deprecated --global, --local, --location=global
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzy committed May 10, 2022
1 parent e16581e commit 9b8dcd6
Show file tree
Hide file tree
Showing 16 changed files with 100 additions and 56 deletions.
2 changes: 2 additions & 0 deletions docs/content/commands/npm-bin.md
Expand Up @@ -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 all deprecated

Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
4 changes: 4 additions & 0 deletions docs/content/commands/npm-config.md
Expand Up @@ -124,6 +124,8 @@ Not supported by all npm commands.
* Default: false
* Type: Boolean
* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local`
are all deprecated
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions docs/content/commands/npm-diff.md
Expand Up @@ -248,6 +248,8 @@ Treat all files as text in `npm diff`.
* Default: false
* Type: Boolean
* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local`
are all deprecated
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
2 changes: 2 additions & 0 deletions docs/content/commands/npm-install-test.md
Expand Up @@ -70,6 +70,8 @@ rather than using npm's default semver range operator.

* Default: false
* Type: Boolean
* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local`
are all deprecated

Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
2 changes: 2 additions & 0 deletions docs/content/commands/npm-install.md
Expand Up @@ -460,6 +460,8 @@ rather than using npm's default semver range operator.
* Default: false
* Type: Boolean
* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local`
are all deprecated
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
2 changes: 2 additions & 0 deletions docs/content/commands/npm-link.md
Expand Up @@ -153,6 +153,8 @@ rather than using npm's default semver range operator.

* Default: false
* Type: Boolean
* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local`
are all deprecated

Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
2 changes: 2 additions & 0 deletions docs/content/commands/npm-ls.md
Expand Up @@ -137,6 +137,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 all deprecated

Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
2 changes: 2 additions & 0 deletions docs/content/commands/npm-outdated.md
Expand Up @@ -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 all deprecated

Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
2 changes: 2 additions & 0 deletions docs/content/commands/npm-prefix.md
Expand Up @@ -51,6 +51,8 @@ npm prefix -g

* Default: false
* Type: Boolean
* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local`
are all deprecated

Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
2 changes: 2 additions & 0 deletions docs/content/commands/npm-rebuild.md
Expand Up @@ -42,6 +42,8 @@ will be rebuilt.

* Default: false
* Type: Boolean
* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local`
are all deprecated

Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
2 changes: 2 additions & 0 deletions docs/content/commands/npm-root.md
Expand Up @@ -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 all deprecated

Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
2 changes: 2 additions & 0 deletions docs/content/commands/npm-update.md
Expand Up @@ -188,6 +188,8 @@ Will also prevent writing to `package-lock.json` if set to `false`.

* Default: false
* Type: Boolean
* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local`
are all deprecated

Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
60 changes: 32 additions & 28 deletions docs/content/using-npm/config.md
Expand Up @@ -687,23 +687,6 @@ results in no commit being made at all.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->

#### `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`

<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->

#### `global-style`

* Default: false
Expand Down Expand Up @@ -993,17 +976,6 @@ npm registry. Must be IPv4 in versions of Node prior to 0.12.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->

#### `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.

<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->

#### `lockfile-version`

* Default: Version 2 if no lockfile or current lockfile version less than or
Expand Down Expand Up @@ -1928,6 +1900,25 @@ Alias for `--include=dev`.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->

#### `global`

* Default: false
* Type: Boolean
* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local`
are all 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`

<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->

#### `init.author.email`

* Default: ""
Expand Down Expand Up @@ -1994,6 +1985,19 @@ Alias for `--init-version`
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->

#### `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.

<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->

#### `only`

* Default: null
Expand Down
6 changes: 6 additions & 0 deletions lib/utils/config/definitions.js
Expand Up @@ -811,6 +811,9 @@ define('global', {
default: false,
type: Boolean,
short: 'g',
deprecated: `
\`--global\`, \`--location=global\`, \`--no-global\`, and \`--local\` are all deprecated
`,
description: `
Operates in "global" mode, so that packages are installed into the
\`prefix\` folder instead of the current working directory. See
Expand Down Expand Up @@ -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.
`,
Expand Down
4 changes: 4 additions & 0 deletions tap-snapshots/test/lib/utils/config/definitions.js.test.cjs
Expand Up @@ -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 all deprecated
Operates in "global" mode, so that packages are installed into the \`prefix\`
folder instead of the current working directory. See
Expand Down Expand Up @@ -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.
`
Expand Down
60 changes: 32 additions & 28 deletions tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs
Expand Up @@ -560,23 +560,6 @@ results in no commit being made at all.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`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\`
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`global-style\`
* Default: false
Expand Down Expand Up @@ -866,17 +849,6 @@ npm registry. Must be IPv4 in versions of Node prior to 0.12.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`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.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`lockfile-version\`
* Default: Version 2 if no lockfile or current lockfile version less than or
Expand Down Expand Up @@ -1801,6 +1773,25 @@ Alias for \`--include=dev\`.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`global\`
* Default: false
* Type: Boolean
* DEPRECATED: \`--global\`, \`--location=global\`, \`--no-global\`, and \`--local\`
are all 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\`
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`init.author.email\`
* Default: ""
Expand Down Expand Up @@ -1867,6 +1858,19 @@ Alias for \`--init-version\`
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`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.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`only\`
* Default: null
Expand Down

0 comments on commit 9b8dcd6

Please sign in to comment.