@npmcli/config 10.9.0 → 11.0.0-pre.0.0

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
  }),
@@ -818,7 +823,7 @@ const definitions = {
818
823
  default: true,
819
824
  type: Boolean,
820
825
  description: `
821
- Format \`package-lock.json\` or \`npm-shrinkwrap.json\` as a human
826
+ Format \`package-lock.json\` as a human
822
827
  readable file.
823
828
  `,
824
829
  flatten,
@@ -1300,8 +1305,8 @@ const definitions = {
1300
1305
  Version 3 if no lockfile, auto-converting v1 lockfiles to v3; otherwise,
1301
1306
  maintain current lockfile version.`,
1302
1307
  description: `
1303
- Set the lockfile format version to be used in package-lock.json and
1304
- npm-shrinkwrap-json files. Possible options are:
1308
+ Set the lockfile format version to be used in package-lock.json files.
1309
+ Possible options are:
1305
1310
 
1306
1311
  1: The lockfile version used by npm versions 5 and 6. Lacks some data that
1307
1312
  is used during the install, resulting in slower and possibly less
@@ -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
- if (obj['min-release-age'] !== null) {
1425
- flatOptions.before = new Date(Date.now() - (86400000 * obj['min-release-age']))
1426
- obj.before = flatOptions.before
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
  }),
@@ -1494,7 +1504,7 @@ const definitions = {
1494
1504
  Dependency types to omit from the installation tree on disk.
1495
1505
 
1496
1506
  Note that these dependencies _are_ still resolved and added to the
1497
- \`package-lock.json\` or \`npm-shrinkwrap.json\` file. They are just
1507
+ \`package-lock.json\` file. They are just
1498
1508
  not physically installed on disk.
1499
1509
 
1500
1510
  If a package type appears in both the \`--include\` and \`--omit\`
@@ -2170,20 +2180,6 @@ const definitions = {
2170
2180
  `,
2171
2181
  flatten,
2172
2182
  }),
2173
- shrinkwrap: new Definition('shrinkwrap', {
2174
- default: true,
2175
- type: Boolean,
2176
- deprecated: `
2177
- Use the --package-lock setting instead.
2178
- `,
2179
- description: `
2180
- Alias for --package-lock
2181
- `,
2182
- flatten (key, obj, flatOptions) {
2183
- obj['package-lock'] = obj.shrinkwrap
2184
- definitions['package-lock'].flatten('package-lock', obj, flatOptions)
2185
- },
2186
- }),
2187
2183
  'sign-git-commit': new Definition('sign-git-commit', {
2188
2184
  default: false,
2189
2185
  type: Boolean,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npmcli/config",
3
- "version": "10.9.0",
3
+ "version": "11.0.0-pre.0.0",
4
4
  "files": [
5
5
  "bin/",
6
6
  "lib/"