Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --install-strategy=hoisted|nested|shallow, remove --global-style, --legacy-bundling #5709

Merged
merged 3 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: replace --legacy-bundling with --install-strategy=nested
BREAKING CHANGE: removed --legacy-bundling config
  • Loading branch information
fritzy committed Oct 18, 2022
commit d79c016216256cf5834630e33ba3f7de2ec5c907
1 change: 0 additions & 1 deletion lib/commands/dedupe.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class Dedupe extends ArboristWorkspaceCmd {
static name = 'dedupe'
static params = [
'install-strategy',
'legacy-bundling',
'strict-peer-deps',
'package-lock',
'omit',
Expand Down
1 change: 0 additions & 1 deletion lib/commands/find-dupes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class FindDupes extends ArboristWorkspaceCmd {
static name = 'find-dupes'
static params = [
'install-strategy',
'legacy-bundling',
'strict-peer-deps',
'package-lock',
'omit',
Expand Down
1 change: 0 additions & 1 deletion lib/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class Install extends ArboristWorkspaceCmd {
'save-exact',
'global',
'install-strategy',
'legacy-bundling',
'omit',
'strict-peer-deps',
'package-lock',
Expand Down
1 change: 0 additions & 1 deletion lib/commands/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Link extends ArboristWorkspaceCmd {
'save-exact',
'global',
'install-strategy',
'legacy-bundling',
'strict-peer-deps',
'package-lock',
'omit',
Expand Down
1 change: 0 additions & 1 deletion lib/commands/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class Update extends ArboristWorkspaceCmd {
'save',
'global',
'install-strategy',
'legacy-bundling',
'omit',
'strict-peer-deps',
'package-lock',
Expand Down
12 changes: 0 additions & 12 deletions lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1108,18 +1108,6 @@ define('key', {
flatten,
})

define('legacy-bundling', {
default: false,
type: Boolean,
description: `
Causes npm to install the package such that versions of npm prior to 1.4,
such as the one included with node 0.8, can install the package. This
eliminates all automatic deduping. If used with \`global-style\` this
option will be preferred.
`,
flatten,
})

define('legacy-peer-deps', {
default: false,
type: Boolean,
Expand Down
2 changes: 1 addition & 1 deletion smoke-tests/tap-snapshots/test/index.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ npm ERR! npm ci
npm ERR!
npm ERR! Options:
npm ERR! [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
npm ERR! [-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
npm ERR! [-E|--save-exact] [-g|--global] [--install-strategy <hoisted|nested|shallow>]
npm ERR! [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm ERR! [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
npm ERR! [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
Expand Down
6 changes: 2 additions & 4 deletions tap-snapshots/test/lib/commands/config.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna
"git": "git",
"git-tag-version": true,
"global": false,
"global-style": false,
"globalconfig": "{GLOBALPREFIX}/npmrc",
"heading": "npm",
"https-proxy": null,
Expand All @@ -82,8 +81,8 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna
"init.module": "{HOME}/.npm-init.js",
"init.version": "1.0.0",
"install-links": true,
"install-strategy": "hoisted",
"key": null,
"legacy-bundling": false,
"legacy-peer-deps": false,
"link": false,
"local-address": null,
Expand Down Expand Up @@ -212,7 +211,6 @@ fund = true
git = "git"
git-tag-version = true
global = false
global-style = false
globalconfig = "{GLOBALPREFIX}/npmrc"
heading = "npm"
https-proxy = null
Expand All @@ -234,9 +232,9 @@ init.license = "ISC"
init.module = "{HOME}/.npm-init.js"
init.version = "1.0.0"
install-links = true
install-strategy = "hoisted"
json = false
key = null
legacy-bundling = false
legacy-peer-deps = false
link = false
local-address = null
Expand Down
92 changes: 36 additions & 56 deletions tap-snapshots/test/lib/docs.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1034,18 +1034,6 @@ folder instead of the current working directory. See
* bin files are linked to \`{prefix}/bin\`
* man pages are linked to \`{prefix}/share/man\`

#### \`global-style\`

* Default: false
* Type: Boolean

Causes npm to install the package into your local \`node_modules\` folder with
the same layout it uses with the global \`node_modules\` folder. Only your
direct dependencies will show in \`node_modules\` and everything they depend
on will be flattened in their \`node_modules\` folders. This obviously will
eliminate some deduping. If used with \`legacy-bundling\`, \`legacy-bundling\`
will be preferred.

#### \`globalconfig\`

* Default: The global --prefix setting plus 'etc/npmrc'. For example,
Expand Down Expand Up @@ -1188,6 +1176,18 @@ When set file: protocol dependencies will be packed and installed as regular
dependencies instead of creating a symlink. This option has no effect on
workspaces.

#### \`install-strategy\`

* Default: "hoisted"
* Type: "hoisted", "nested", or "shallow"

Sets the strategy for installing packages in node_modules. hoisted
(default): Install non-duplicated in top-level, and duplicated as necessary
within directory structure. nested: (formerly --legacy-bundling) install in
place, no hoisting. shallow (formerly --global-style) only install direct
deps at top-level. linked: (coming soon) install in node_modules/.store,
link in place, unhoisted.

#### \`json\`

* Default: false
Expand Down Expand Up @@ -1215,16 +1215,6 @@ key="-----BEGIN PRIVATE KEY-----\\nXXXX\\nXXXX\\n-----END PRIVATE KEY-----"
It is _not_ the path to a key file, though you can set a registry-scoped
"keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".

#### \`legacy-bundling\`

* Default: false
* Type: Boolean

Causes npm to install the package such that versions of npm prior to 1.4,
such as the one included with node 0.8, can install the package. This
eliminates all automatic deduping. If used with \`global-style\` this option
will be preferred.

#### \`legacy-peer-deps\`

* Default: false
Expand Down Expand Up @@ -1483,8 +1473,8 @@ look for updates immediately even for fresh package data.
#### \`prefix\`

* Default: In global mode, the folder where the node executable is installed.
In local mode, the nearest parent folder containing either a package.json
file or a node_modules folder.
Otherwise, the nearest parent folder containing either a package.json file
or a node_modules folder.
* Type: Path

The location to install global items. If set on the command line, then it
Expand Down Expand Up @@ -2139,7 +2129,6 @@ Array [
"git",
"git-tag-version",
"global",
"global-style",
"globalconfig",
"heading",
"https-proxy",
Expand All @@ -2161,9 +2150,9 @@ Array [
"init.module",
"init.version",
"install-links",
"install-strategy",
"json",
"key",
"legacy-bundling",
"legacy-peer-deps",
"link",
"local-address",
Expand Down Expand Up @@ -2290,7 +2279,6 @@ Array [
"git",
"git-tag-version",
"global",
"global-style",
"globalconfig",
"heading",
"https-proxy",
Expand All @@ -2300,9 +2288,9 @@ Array [
"include-staged",
"include-workspace-root",
"install-links",
"install-strategy",
"json",
"key",
"legacy-bundling",
"legacy-peer-deps",
"local-address",
"location",
Expand Down Expand Up @@ -2589,7 +2577,7 @@ npm ci

Options:
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
[-E|--save-exact] [-g|--global] [--install-strategy <hoisted|nested|shallow>]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
[--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
Expand All @@ -2609,8 +2597,7 @@ aliases: clean-install, ic, install-clean, isntall-clean
#### \`save\`
#### \`save-exact\`
#### \`global\`
#### \`global-style\`
#### \`legacy-bundling\`
#### \`install-strategy\`
#### \`omit\`
#### \`strict-peer-deps\`
#### \`package-lock\`
Expand Down Expand Up @@ -2685,9 +2672,9 @@ Usage:
npm dedupe

Options:
[--global-style] [--legacy-bundling] [--strict-peer-deps] [--no-package-lock]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]] [--ignore-scripts]
[--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
[--install-strategy <hoisted|nested|shallow>] [--strict-peer-deps]
[--no-package-lock] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-ws|--workspaces] [--include-workspace-root] [--no-install-links]

Expand All @@ -2701,8 +2688,7 @@ npm dedupe
alias: ddp
\`\`\`

#### \`global-style\`
#### \`legacy-bundling\`
#### \`install-strategy\`
#### \`strict-peer-deps\`
#### \`package-lock\`
#### \`omit\`
Expand Down Expand Up @@ -2946,9 +2932,9 @@ Usage:
npm find-dupes

Options:
[--global-style] [--legacy-bundling] [--strict-peer-deps] [--no-package-lock]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]] [--ignore-scripts]
[--no-audit] [--no-bin-links] [--no-fund]
[--install-strategy <hoisted|nested|shallow>] [--strict-peer-deps]
[--no-package-lock] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-ws|--workspaces] [--include-workspace-root] [--no-install-links]

Expand All @@ -2958,8 +2944,7 @@ Run "npm help find-dupes" for more info
npm find-dupes
\`\`\`

#### \`global-style\`
#### \`legacy-bundling\`
#### \`install-strategy\`
#### \`strict-peer-deps\`
#### \`package-lock\`
#### \`omit\`
Expand Down Expand Up @@ -3117,7 +3102,7 @@ npm install [<package-spec> ...]

Options:
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
[-E|--save-exact] [-g|--global] [--install-strategy <hoisted|nested|shallow>]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
[--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
Expand All @@ -3137,8 +3122,7 @@ aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall
#### \`save\`
#### \`save-exact\`
#### \`global\`
#### \`global-style\`
#### \`legacy-bundling\`
#### \`install-strategy\`
#### \`omit\`
#### \`strict-peer-deps\`
#### \`package-lock\`
Expand All @@ -3162,7 +3146,7 @@ npm install-ci-test

Options:
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
[-E|--save-exact] [-g|--global] [--install-strategy <hoisted|nested|shallow>]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
[--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
Expand All @@ -3182,8 +3166,7 @@ alias: cit
#### \`save\`
#### \`save-exact\`
#### \`global\`
#### \`global-style\`
#### \`legacy-bundling\`
#### \`install-strategy\`
#### \`omit\`
#### \`strict-peer-deps\`
#### \`package-lock\`
Expand All @@ -3207,7 +3190,7 @@ npm install-test [<package-spec> ...]

Options:
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
[-E|--save-exact] [-g|--global] [--install-strategy <hoisted|nested|shallow>]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
[--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
Expand All @@ -3227,8 +3210,7 @@ alias: it
#### \`save\`
#### \`save-exact\`
#### \`global\`
#### \`global-style\`
#### \`legacy-bundling\`
#### \`install-strategy\`
#### \`omit\`
#### \`strict-peer-deps\`
#### \`package-lock\`
Expand All @@ -3252,7 +3234,7 @@ npm link [<package-spec>]

Options:
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
[-E|--save-exact] [-g|--global] [--install-strategy <hoisted|nested|shallow>]
[--strict-peer-deps] [--no-package-lock]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]] [--ignore-scripts]
[--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
Expand All @@ -3272,8 +3254,7 @@ alias: ln
#### \`save\`
#### \`save-exact\`
#### \`global\`
#### \`global-style\`
#### \`legacy-bundling\`
#### \`install-strategy\`
#### \`strict-peer-deps\`
#### \`package-lock\`
#### \`omit\`
Expand Down Expand Up @@ -4124,7 +4105,7 @@ npm update [<pkg>...]

Options:
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-g|--global] [--global-style] [--legacy-bundling]
[-g|--global] [--install-strategy <hoisted|nested|shallow>]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
[--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
Expand All @@ -4143,8 +4124,7 @@ aliases: up, upgrade, udpate

#### \`save\`
#### \`global\`
#### \`global-style\`
#### \`legacy-bundling\`
#### \`install-strategy\`
#### \`omit\`
#### \`strict-peer-deps\`
#### \`package-lock\`
Expand Down
Loading