diff --git a/lib/commands/install.js b/lib/commands/install.js index 2b465030b1113..7be21582610dc 100644 --- a/lib/commands/install.js +++ b/lib/commands/install.js @@ -29,6 +29,7 @@ class Install extends ArboristWorkspaceCmd { 'foreground-scripts', 'ignore-scripts', 'audit', + 'before', 'bin-links', 'fund', 'dry-run', diff --git a/lib/commands/outdated.js b/lib/commands/outdated.js index 4e0198a95d697..5421b1ddaab89 100644 --- a/lib/commands/outdated.js +++ b/lib/commands/outdated.js @@ -30,6 +30,7 @@ class Outdated extends ArboristWorkspaceCmd { 'parseable', 'global', 'workspace', + 'before', ] #tree diff --git a/lib/commands/update.js b/lib/commands/update.js index 235a9a41177df..0d2fc324d9245 100644 --- a/lib/commands/update.js +++ b/lib/commands/update.js @@ -20,6 +20,7 @@ class Update extends ArboristWorkspaceCmd { 'foreground-scripts', 'ignore-scripts', 'audit', + 'before', 'bin-links', 'fund', 'dry-run', diff --git a/tap-snapshots/test/lib/docs.js.test.cjs b/tap-snapshots/test/lib/docs.js.test.cjs index cbbf8cda7b448..abf35cfd26bc5 100644 --- a/tap-snapshots/test/lib/docs.js.test.cjs +++ b/tap-snapshots/test/lib/docs.js.test.cjs @@ -263,9 +263,9 @@ config is given, this value will always be set to \`legacy\`. * Type: null or Date If passed to \`npm install\`, will rebuild the npm tree such that only -versions that were available **on or before** the \`--before\` time get -installed. If there's no versions available for the current set of direct -dependencies, the command will error. +versions that were available **on or before** the given date are installed. +If there are no versions available for the current set of dependencies, the +command will error. If the requested version is a \`dist-tag\` and the given tag does not pass the \`--before\` filter, the most recent version less than or equal to that tag @@ -3301,8 +3301,9 @@ Options: [--global-style] [--omit [--omit ...]] [--include [--include ...]] [--strict-peer-deps] [--prefer-dedupe] [--no-package-lock] [--package-lock-only] -[--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] -[--no-fund] [--dry-run] [--cpu ] [--os ] [--libc ] +[--foreground-scripts] [--ignore-scripts] [--no-audit] [--before ] +[--no-bin-links] [--no-fund] [--dry-run] [--cpu ] [--os ] +[--libc ] [-w|--workspace [-w|--workspace ...]] [--workspaces] [--include-workspace-root] [--install-links] @@ -3331,6 +3332,7 @@ aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall #### \`foreground-scripts\` #### \`ignore-scripts\` #### \`audit\` +#### \`before\` #### \`bin-links\` #### \`fund\` #### \`dry-run\` @@ -3399,8 +3401,9 @@ Options: [--global-style] [--omit [--omit ...]] [--include [--include ...]] [--strict-peer-deps] [--prefer-dedupe] [--no-package-lock] [--package-lock-only] -[--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] -[--no-fund] [--dry-run] [--cpu ] [--os ] [--libc ] +[--foreground-scripts] [--ignore-scripts] [--no-audit] [--before ] +[--no-bin-links] [--no-fund] [--dry-run] [--cpu ] [--os ] +[--libc ] [-w|--workspace [-w|--workspace ...]] [--workspaces] [--include-workspace-root] [--install-links] @@ -3429,6 +3432,7 @@ alias: it #### \`foreground-scripts\` #### \`ignore-scripts\` #### \`audit\` +#### \`before\` #### \`bin-links\` #### \`fund\` #### \`dry-run\` @@ -3675,6 +3679,7 @@ npm outdated [ ...] Options: [-a|--all] [--json] [-l|--long] [-p|--parseable] [-g|--global] [-w|--workspace [-w|--workspace ...]] +[--before ] Run "npm help outdated" for more info @@ -3688,6 +3693,7 @@ npm outdated [ ...] #### \`parseable\` #### \`global\` #### \`workspace\` +#### \`before\` ` exports[`test/lib/docs.js TAP usage owner > must match snapshot 1`] = ` @@ -4433,7 +4439,8 @@ Options: [--omit [--omit ...]] [--include [--include ...]] [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] -[--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] +[--ignore-scripts] [--no-audit] [--before ] [--no-bin-links] [--no-fund] +[--dry-run] [-w|--workspace [-w|--workspace ...]] [--workspaces] [--include-workspace-root] [--install-links] @@ -4459,6 +4466,7 @@ aliases: up, upgrade, udpate #### \`foreground-scripts\` #### \`ignore-scripts\` #### \`audit\` +#### \`before\` #### \`bin-links\` #### \`fund\` #### \`dry-run\` diff --git a/workspaces/config/lib/definitions/definitions.js b/workspaces/config/lib/definitions/definitions.js index bb24f33afedad..3c4380a09af18 100644 --- a/workspaces/config/lib/definitions/definitions.js +++ b/workspaces/config/lib/definitions/definitions.js @@ -230,12 +230,13 @@ const definitions = { }), before: new Definition('before', { default: null, + hint: '', type: [null, Date], description: ` If passed to \`npm install\`, will rebuild the npm tree such that only - versions that were available **on or before** the \`--before\` time get - installed. If there's no versions available for the current set of - direct dependencies, the command will error. + versions that were available **on or before** the given date are + installed. If there are no versions available for the current set of + dependencies, the command will error. If the requested version is a \`dist-tag\` and the given tag does not pass the \`--before\` filter, the most recent version less than or equal