@npmcli/config 10.9.0 → 10.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -292,7 +292,6 @@ const definitions = {
|
|
|
292
292
|
default: null,
|
|
293
293
|
hint: '<date>',
|
|
294
294
|
type: [null, Date],
|
|
295
|
-
exclusive: ['min-release-age'],
|
|
296
295
|
description: `
|
|
297
296
|
If passed to \`npm install\`, will rebuild the npm tree such that only
|
|
298
297
|
versions that were available **on or before** the given date are
|
|
@@ -303,6 +302,12 @@ const definitions = {
|
|
|
303
302
|
pass the \`--before\` filter, the most recent version less than or equal
|
|
304
303
|
to that tag will be used. For example, \`foo@latest\` might install
|
|
305
304
|
\`foo@1.2\` even though \`latest\` is \`2.0\`.
|
|
305
|
+
|
|
306
|
+
If \`before\` and \`min-release-age\` are both set in the same source,
|
|
307
|
+
\`before\` wins (an explicit absolute date overrides a relative window).
|
|
308
|
+
Across sources, the standard precedence applies (cli > env > project >
|
|
309
|
+
user > global), so a higher-priority source can always relax or
|
|
310
|
+
override a lower-priority one.
|
|
306
311
|
`,
|
|
307
312
|
flatten,
|
|
308
313
|
}),
|
|
@@ -1409,7 +1414,6 @@ const definitions = {
|
|
|
1409
1414
|
default: null,
|
|
1410
1415
|
hint: '<days>',
|
|
1411
1416
|
type: [null, Number],
|
|
1412
|
-
exclusive: ['before'],
|
|
1413
1417
|
envExport: false,
|
|
1414
1418
|
description: `
|
|
1415
1419
|
If set, npm will build the npm tree such that only versions that were
|
|
@@ -1418,12 +1422,18 @@ const definitions = {
|
|
|
1418
1422
|
command will error.
|
|
1419
1423
|
|
|
1420
1424
|
This flag is a complement to \`before\`, which accepts an exact date
|
|
1421
|
-
instead of a relative number of days.
|
|
1425
|
+
instead of a relative number of days. The two may coexist (e.g.
|
|
1426
|
+
\`min-release-age\` in your \`.npmrc\` is preserved when npm internally
|
|
1427
|
+
spawns a sub-process with \`--before\` while preparing a \`git:\` or
|
|
1428
|
+
\`github:\` dependency); when both apply, \`before\` wins within a
|
|
1429
|
+
single source and across sources the standard precedence rules apply.
|
|
1422
1430
|
`,
|
|
1423
1431
|
flatten: (key, obj, flatOptions) => {
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1432
|
+
const age = obj['min-release-age']
|
|
1433
|
+
// `hasOwn` so a `before` inherited via ConfigData's prototype chain (lib/index.js) from a lower-priority source doesn't silently win.
|
|
1434
|
+
// The `: null` clear depends on `Config#flat` iterating sources low → high.
|
|
1435
|
+
if (age != null && !Object.hasOwn(obj, 'before')) {
|
|
1436
|
+
flatOptions.before = age ? new Date(Date.now() - (86400000 * age)) : null
|
|
1427
1437
|
}
|
|
1428
1438
|
},
|
|
1429
1439
|
}),
|