GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add min-release-age-exclude config · npm/cli@c3e1a71

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/commands
    • install.js
    • outdated.js
    • query.js
    • update.js
  • tap-snapshots/test/lib
    • commands
      • config.js.test.cjs
    • docs.js.test.cjs
  • test/lib/commands
    • outdated.js
  • workspaces
    • arborist
      • lib
        • arborist
          • build-ideal-tree.js
        • query-selector-all.js
        • release-age-exclude.js
      • test
        • arborist
          • build-ideal-tree.js
        • query-selector-all.js
        • release-age-exclude.js
    • config
      • lib/definitions
        • definitions.js
      • tap-snapshots/test
        • type-description.js.test.cjs
      • test
        • index.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/commands/install.js‎

Copy file name to clipboardExpand all lines: lib/commands/install.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class Install extends ArboristWorkspaceCmd {
3939
'audit',
4040
'before',
4141
'min-release-age',
42+
'min-release-age-exclude',
4243
'bin-links',
4344
'fund',
4445
'dry-run',
Collapse file

‎lib/commands/outdated.js‎

Copy file name to clipboardExpand all lines: lib/commands/outdated.js
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const pacote = require('pacote')
44
const table = require('text-table')
55
const npa = require('npm-package-arg')
66
const pickManifest = require('npm-pick-manifest')
7+
const { isReleaseAgeExcluded } = require('@npmcli/arborist/lib/release-age-exclude.js')
78
const { output } = require('proc-log')
89
const localeCompare = require('@isaacs/string-locale-compare')('en')
910
const ArboristWorkspaceCmd = require('../arborist-cmd.js')
@@ -32,6 +33,7 @@ class Outdated extends ArboristWorkspaceCmd {
3233
'workspace',
3334
'before',
3435
'min-release-age',
36+
'min-release-age-exclude',
3537
]
3638

3739
#tree
@@ -183,8 +185,14 @@ class Outdated extends ArboristWorkspaceCmd {
183185
try {
184186
const packument = await this.#getPackument(spec)
185187
const expected = alias ? alias.fetchSpec : edge.spec
186-
const wanted = pickManifest(packument, expected, this.npm.flatOptions)
187-
const latest = pickManifest(packument, '*', this.npm.flatOptions)
188+
const { minReleaseAgeExclude } = this.npm.flatOptions
189+
// Packages matching `min-release-age-exclude` resolve to their newest
190+
// version, so drop the `before` constraint for them.
191+
const pickOpts = isReleaseAgeExcluded(packument.name, minReleaseAgeExclude)
192+
? { ...this.npm.flatOptions, before: null }
193+
: this.npm.flatOptions
194+
const wanted = pickManifest(packument, expected, pickOpts)
195+
const latest = pickManifest(packument, '*', pickOpts)
188196
if (!current || current !== wanted.version || wanted.version !== latest.version) {
189197
this.#list.push({
190198
name: alias ? edge.spec.replace('npm', edge.name) : edge.name,
Collapse file

‎lib/commands/query.js‎

Copy file name to clipboardExpand all lines: lib/commands/query.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ class Query extends BaseCommand {
4949
'include-workspace-root',
5050
'package-lock-only',
5151
'expect-results',
52+
'before',
53+
'min-release-age',
54+
'min-release-age-exclude',
5255
]
5356

5457
constructor (...args) {
Collapse file

‎lib/commands/update.js‎

Copy file name to clipboardExpand all lines: lib/commands/update.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Update extends ArboristWorkspaceCmd {
2727
'audit',
2828
'before',
2929
'min-release-age',
30+
'min-release-age-exclude',
3031
'bin-links',
3132
'fund',
3233
'dry-run',
Collapse file

‎tap-snapshots/test/lib/commands/config.js.test.cjs‎

Copy file name to clipboardExpand all lines: tap-snapshots/test/lib/commands/config.js.test.cjs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna
111111
"maxsockets": 15,
112112
"message": "%s",
113113
"min-release-age": null,
114+
"min-release-age-exclude": [],
114115
"node-gyp": "{CWD}/node_modules/node-gyp/bin/node-gyp.js",
115116
"node-options": null,
116117
"noproxy": [
@@ -299,6 +300,7 @@ logs-max = 10
299300
maxsockets = 15
300301
message = "%s"
301302
min-release-age = null
303+
min-release-age-exclude = []
302304
name = null
303305
node-gyp = "{CWD}/node_modules/node-gyp/bin/node-gyp.js"
304306
node-options = null
Collapse file

‎tap-snapshots/test/lib/docs.js.test.cjs‎

Copy file name to clipboardExpand all lines: tap-snapshots/test/lib/docs.js.test.cjs
+93-20Lines changed: 93 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ sources, the standard precedence applies (cli > env > project > user >
410410
global), so a higher-priority source can always relax or override a
411411
lower-priority one.
412412
413+
Packages whose names match \`min-release-age-exclude\` are exempt from this
414+
filter.
415+
413416
414417
415418
#### \`bin-links\`
@@ -1300,6 +1303,37 @@ your \`.npmrc\` is preserved when npm internally spawns a sub-process with
13001303
apply, \`before\` wins within a single source and across sources the standard
13011304
precedence rules apply.
13021305
1306+
Packages whose names match \`min-release-age-exclude\` are exempt from this
1307+
filter.
1308+
1309+
This value is not exported to the environment for child processes.
1310+
1311+
#### \`min-release-age-exclude\`
1312+
1313+
* Default:
1314+
* Type: String (can be set multiple times)
1315+
1316+
A list of package names or \`minimatch\` glob patterns that are exempt from
1317+
the \`min-release-age\` (and \`before\`) filter. A matching package can always
1318+
resolve to its newest version, even when a release-age window is set.
1319+
1320+
For example, to apply a release-age window to third-party dependencies while
1321+
letting internally maintained packages update immediately:
1322+
1323+
\`\`\`
1324+
min-release-age=7
1325+
min-release-age-exclude[]=@myorg/*
1326+
min-release-age-exclude[]=my-internal-pkg
1327+
\`\`\`
1328+
1329+
Only the named package is exempt; its own dependencies still follow the
1330+
release-age policy unless they also match a pattern. Patterns match against
1331+
the package name, so \`@myorg/*\` matches \`@myorg/shared-utils\`.
1332+
1333+
Excluding a package does not change which registry it is fetched from. You
1334+
should own your private scope on the public registry so that nobody else can
1335+
publish a package with the same name.
1336+
13031337
This value is not exported to the environment for child processes.
13041338
13051339
#### \`name\`
@@ -1912,13 +1946,13 @@ this to work properly.
19121946
* Default: false
19131947
* Type: Boolean
19141948
1915-
If \`true\`, turn the install-script policy from a silent skip into a hard
1916-
error: any dependency with install scripts not covered by \`allowScripts\`
1917-
will fail the install instead of being silently skipped.
1949+
If \`true\`, turn the install-script policy from a warning into a hard error:
1950+
any dependency with install scripts that is not covered by \`allowScripts\`
1951+
will fail the install instead of being blocked with a warning.
19181952
1919-
By default, dependencies whose install scripts are not approved in
1920-
\`allowScripts\` are silently skipped; this setting promotes that silent skip
1921-
into a hard failure, which is the recommended posture for CI.
1953+
Dependencies explicitly denied with \`false\` in \`allowScripts\` are always
1954+
silently skipped; this setting only affects unreviewed entries (packages
1955+
with install scripts that are neither approved nor denied).
19221956
\`--ignore-scripts\` and \`--dangerously-allow-all-scripts\` both override this
19231957
setting.
19241958
@@ -2513,6 +2547,7 @@ Array [
25132547
"maxsockets",
25142548
"message",
25152549
"min-release-age",
2550+
"min-release-age-exclude",
25162551
"node-gyp",
25172552
"node-options",
25182553
"noproxy",
@@ -2679,6 +2714,7 @@ Array [
26792714
"maxsockets",
26802715
"message",
26812716
"min-release-age",
2717+
"min-release-age-exclude",
26822718
"node-gyp",
26832719
"noproxy",
26842720
"offline",
@@ -2856,6 +2892,7 @@ Object {
28562892
"logColor": false,
28572893
"maxSockets": 15,
28582894
"message": "%s",
2895+
"minReleaseAgeExclude": Array [],
28592896
"name": null,
28602897
"nodeBin": "{NODE}",
28612898
"nodeGyp": "{CWD}/node_modules/node-gyp/bin/node-gyp.js",
@@ -3284,7 +3321,7 @@ Options:
32843321
Comma-separated list of packages whose install-time lifecycle scripts
32853322
32863323
--strict-allow-scripts
3287-
If \`true\`, turn the install-script policy from a silent skip into a
3324+
If \`true\`, turn the install-script policy from a warning into a hard
32883325
32893326
--dangerously-allow-all-scripts
32903327
If \`true\`, bypass the \`allowScripts\` policy entirely and run every
@@ -3846,7 +3883,7 @@ Options:
38463883
Comma-separated list of packages whose install-time lifecycle scripts
38473884
38483885
--strict-allow-scripts
3849-
If \`true\`, turn the install-script policy from a silent skip into a
3886+
If \`true\`, turn the install-script policy from a warning into a hard
38503887
38513888
--dangerously-allow-all-scripts
38523889
If \`true\`, bypass the \`allowScripts\` policy entirely and run every
@@ -4231,8 +4268,10 @@ Options:
42314268
[--allow-remote <all|none|root>]
42324269
[--allow-scripts <package-list> [--allow-scripts <package-list> ...]]
42334270
[--strict-allow-scripts] [--dangerously-allow-all-scripts] [--no-audit]
4234-
[--before <date>] [--min-release-age <days>] [--no-bin-links] [--no-fund]
4235-
[--dry-run] [--cpu <cpu>] [--os <os>] [--libc <libc>]
4271+
[--before <date>] [--min-release-age <days>]
4272+
[--min-release-age-exclude <pkg|glob> [--min-release-age-exclude <pkg|glob> ...]]
4273+
[--no-bin-links] [--no-fund] [--dry-run] [--cpu <cpu>] [--os <os>]
4274+
[--libc <libc>]
42364275
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
42374276
[--workspaces] [--include-workspace-root] [--install-links]
42384277
@@ -4294,7 +4333,7 @@ Options:
42944333
Comma-separated list of packages whose install-time lifecycle scripts
42954334
42964335
--strict-allow-scripts
4297-
If \`true\`, turn the install-script policy from a silent skip into a
4336+
If \`true\`, turn the install-script policy from a warning into a hard
42984337
42994338
--dangerously-allow-all-scripts
43004339
If \`true\`, bypass the \`allowScripts\` policy entirely and run every
@@ -4308,6 +4347,9 @@ Options:
43084347
--min-release-age
43094348
If set, npm will build the npm tree such that only versions that were
43104349
4350+
--min-release-age-exclude
4351+
A list of package names or \`minimatch\` glob patterns that are exempt
4352+
43114353
--bin-links
43124354
Tells npm to create symlinks (or \`.cmd\` shims on Windows) for package
43134355
@@ -4373,6 +4415,7 @@ aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall
43734415
#### \`audit\`
43744416
#### \`before\`
43754417
#### \`min-release-age\`
4418+
#### \`min-release-age-exclude\`
43764419
#### \`bin-links\`
43774420
#### \`fund\`
43784421
#### \`dry-run\`
@@ -4444,7 +4487,7 @@ Options:
44444487
Comma-separated list of packages whose install-time lifecycle scripts
44454488
44464489
--strict-allow-scripts
4447-
If \`true\`, turn the install-script policy from a silent skip into a
4490+
If \`true\`, turn the install-script policy from a warning into a hard
44484491
44494492
--dangerously-allow-all-scripts
44504493
If \`true\`, bypass the \`allowScripts\` policy entirely and run every
@@ -4527,8 +4570,10 @@ Options:
45274570
[--allow-remote <all|none|root>]
45284571
[--allow-scripts <package-list> [--allow-scripts <package-list> ...]]
45294572
[--strict-allow-scripts] [--dangerously-allow-all-scripts] [--no-audit]
4530-
[--before <date>] [--min-release-age <days>] [--no-bin-links] [--no-fund]
4531-
[--dry-run] [--cpu <cpu>] [--os <os>] [--libc <libc>]
4573+
[--before <date>] [--min-release-age <days>]
4574+
[--min-release-age-exclude <pkg|glob> [--min-release-age-exclude <pkg|glob> ...]]
4575+
[--no-bin-links] [--no-fund] [--dry-run] [--cpu <cpu>] [--os <os>]
4576+
[--libc <libc>]
45324577
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
45334578
[--workspaces] [--include-workspace-root] [--install-links]
45344579
@@ -4590,7 +4635,7 @@ Options:
45904635
Comma-separated list of packages whose install-time lifecycle scripts
45914636
45924637
--strict-allow-scripts
4593-
If \`true\`, turn the install-script policy from a silent skip into a
4638+
If \`true\`, turn the install-script policy from a warning into a hard
45944639
45954640
--dangerously-allow-all-scripts
45964641
If \`true\`, bypass the \`allowScripts\` policy entirely and run every
@@ -4604,6 +4649,9 @@ Options:
46044649
--min-release-age
46054650
If set, npm will build the npm tree such that only versions that were
46064651
4652+
--min-release-age-exclude
4653+
A list of package names or \`minimatch\` glob patterns that are exempt
4654+
46074655
--bin-links
46084656
Tells npm to create symlinks (or \`.cmd\` shims on Windows) for package
46094657
@@ -4669,6 +4717,7 @@ alias: it
46694717
#### \`audit\`
46704718
#### \`before\`
46714719
#### \`min-release-age\`
4720+
#### \`min-release-age-exclude\`
46724721
#### \`bin-links\`
46734722
#### \`fund\`
46744723
#### \`dry-run\`
@@ -5115,6 +5164,7 @@ Options:
51155164
[-a|--all] [--json] [-l|--long] [-p|--parseable] [-g|--global]
51165165
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
51175166
[--before <date>] [--min-release-age <days>]
5167+
[--min-release-age-exclude <pkg|glob> [--min-release-age-exclude <pkg|glob> ...]]
51185168
51195169
-a|--all
51205170
Show or act on all packages, not just the ones your project directly
@@ -5140,6 +5190,9 @@ Options:
51405190
--min-release-age
51415191
If set, npm will build the npm tree such that only versions that were
51425192
5193+
--min-release-age-exclude
5194+
A list of package names or \`minimatch\` glob patterns that are exempt
5195+
51435196
51445197
Run "npm help outdated" for more info
51455198
@@ -5155,6 +5208,7 @@ npm outdated [<package-spec> ...]
51555208
#### \`workspace\`
51565209
#### \`before\`
51575210
#### \`min-release-age\`
5211+
#### \`min-release-age-exclude\`
51585212
`
51595213

51605214
exports[`test/lib/docs.js TAP usage owner > must match snapshot 1`] = `
@@ -5510,7 +5564,9 @@ Options:
55105564
[-g|--global]
55115565
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
55125566
[--workspaces] [--include-workspace-root] [--package-lock-only]
5513-
[--expect-results|--expect-result-count <count>]
5567+
[--expect-results|--expect-result-count <count>] [--before <date>]
5568+
[--min-release-age <days>]
5569+
[--min-release-age-exclude <pkg|glob> [--min-release-age-exclude <pkg|glob> ...]]
55145570
55155571
-g|--global
55165572
Operates in "global" mode, so that packages are installed into the
@@ -5530,6 +5586,15 @@ Options:
55305586
--expect-results
55315587
Tells npm whether or not to expect results from the command.
55325588
5589+
--before
5590+
If passed to \`npm install\`, will rebuild the npm tree such that only
5591+
5592+
--min-release-age
5593+
If set, npm will build the npm tree such that only versions that were
5594+
5595+
--min-release-age-exclude
5596+
A list of package names or \`minimatch\` glob patterns that are exempt
5597+
55335598
55345599
Run "npm help query" for more info
55355600
@@ -5544,6 +5609,9 @@ npm query <selector>
55445609
#### \`package-lock-only\`
55455610
#### \`expect-results\`
55465611
#### \`expect-result-count\`
5612+
#### \`before\`
5613+
#### \`min-release-age\`
5614+
#### \`min-release-age-exclude\`
55475615
`
55485616

55495617
exports[`test/lib/docs.js TAP usage rebuild > must match snapshot 1`] = `
@@ -5575,7 +5643,7 @@ Options:
55755643
Comma-separated list of packages whose install-time lifecycle scripts
55765644
55775645
--strict-allow-scripts
5578-
If \`true\`, turn the install-script policy from a silent skip into a
5646+
If \`true\`, turn the install-script policy from a warning into a hard
55795647
55805648
--dangerously-allow-all-scripts
55815649
If \`true\`, bypass the \`allowScripts\` policy entirely and run every
@@ -6351,8 +6419,9 @@ Options:
63516419
[--ignore-scripts]
63526420
[--allow-scripts <package-list> [--allow-scripts <package-list> ...]]
63536421
[--strict-allow-scripts] [--dangerously-allow-all-scripts] [--no-audit]
6354-
[--before <date>] [--min-release-age <days>] [--no-bin-links] [--no-fund]
6355-
[--dry-run]
6422+
[--before <date>] [--min-release-age <days>]
6423+
[--min-release-age-exclude <pkg|glob> [--min-release-age-exclude <pkg|glob> ...]]
6424+
[--no-bin-links] [--no-fund] [--dry-run]
63566425
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
63576426
[--workspaces] [--include-workspace-root] [--install-links]
63586427
@@ -6393,7 +6462,7 @@ Options:
63936462
Comma-separated list of packages whose install-time lifecycle scripts
63946463
63956464
--strict-allow-scripts
6396-
If \`true\`, turn the install-script policy from a silent skip into a
6465+
If \`true\`, turn the install-script policy from a warning into a hard
63976466
63986467
--dangerously-allow-all-scripts
63996468
If \`true\`, bypass the \`allowScripts\` policy entirely and run every
@@ -6407,6 +6476,9 @@ Options:
64076476
--min-release-age
64086477
If set, npm will build the npm tree such that only versions that were
64096478
6479+
--min-release-age-exclude
6480+
A list of package names or \`minimatch\` glob patterns that are exempt
6481+
64106482
--bin-links
64116483
Tells npm to create symlinks (or \`.cmd\` shims on Windows) for package
64126484
@@ -6456,6 +6528,7 @@ aliases: u, up, upgrade, udpate
64566528
#### \`audit\`
64576529
#### \`before\`
64586530
#### \`min-release-age\`
6531+
#### \`min-release-age-exclude\`
64596532
#### \`bin-links\`
64606533
#### \`fund\`
64616534
#### \`dry-run\`

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.