Skip to content

Commit

Permalink
feat: deprecated --global, --local
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzy committed May 10, 2022
1 parent e16581e commit 8dbfff0
Show file tree
Hide file tree
Showing 16 changed files with 106 additions and 34 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`, `--local` are deprecated. Use `--location=global`
instead.

Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
9 changes: 9 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`, `--local` are deprecated. Use `--location=global`
instead.
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down Expand Up @@ -156,6 +158,13 @@ The command to run for `npm edit` and `npm config edit`.
When passed to `npm config` this refers to which config file to use.
When set to "global" mode, 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 -->
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`, `--local` are deprecated. Use `--location=global`
instead.
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`, `--local` are deprecated. Use `--location=global`
instead.

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`, `--local` are deprecated. Use `--location=global`
instead.
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`, `--local` are deprecated. Use `--location=global`
instead.

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`, `--local` are deprecated. Use `--location=global`
instead.

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`, `--local` are deprecated. Use `--location=global`
instead.

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`, `--local` are deprecated. Use `--location=global`
instead.

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`, `--local` are deprecated. Use `--location=global`
instead.

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`, `--local` are deprecated. Use `--location=global`
instead.

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`, `--local` are deprecated. Use `--location=global`
instead.

Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
Expand Down
43 changes: 26 additions & 17 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 @@ -1001,6 +984,13 @@ npm registry. Must be IPv4 in versions of Node prior to 0.12.

When passed to `npm config` this refers to which config file to use.

When set to "global" mode, 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 -->

Expand Down Expand Up @@ -1928,6 +1918,25 @@ Alias for `--include=dev`.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->

#### `global`

* Default: false
* Type: Boolean
* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global`
instead.

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
14 changes: 14 additions & 0 deletions lib/utils/config/definitions.js
Expand Up @@ -811,6 +811,9 @@ define('global', {
default: false,
type: Boolean,
short: 'g',
deprecated: `
\`--global\`, \`--local\` are deprecated. Use \`--location=global\` instead.
`,
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 @@ -1179,12 +1182,23 @@ define('location', {
`,
description: `
When passed to \`npm config\` this refers to which config file to use.
When set to "global" mode, 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\`
`,
flatten: (key, obj, flatOptions) => {
flatten(key, obj, flatOptions)
if (flatOptions.global) {
flatOptions.location = 'global'
}
if (obj.location === 'global') {
flatOptions.global = true
}
},
})

Expand Down
9 changes: 9 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\`, \`--local\` are deprecated. Use \`--location=global\`
instead.
Operates in "global" mode, so that packages are installed into the \`prefix\`
folder instead of the current working directory. See
Expand Down Expand Up @@ -1076,6 +1078,13 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for locat
* Type: "global", "user", or "project"
When passed to \`npm config\` this refers to which config file to use.
When set to "global" mode, 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\`
`

exports[`test/lib/utils/config/definitions.js TAP > config description for lockfile-version 1`] = `
Expand Down
43 changes: 26 additions & 17 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 @@ -874,6 +857,13 @@ npm registry. Must be IPv4 in versions of Node prior to 0.12.
When passed to \`npm config\` this refers to which config file to use.
When set to "global" mode, 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 -->
Expand Down Expand Up @@ -1801,6 +1791,25 @@ Alias for \`--include=dev\`.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`global\`
* Default: false
* Type: Boolean
* DEPRECATED: \`--global\`, \`--local\` are deprecated. Use \`--location=global\`
instead.
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

0 comments on commit 8dbfff0

Please sign in to comment.