@npmcli/config 10.7.0 → 10.8.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.
- package/lib/definitions/definitions.js +14 -0
- package/lib/index.js +13 -3
- package/package.json +3 -3
|
@@ -946,6 +946,17 @@ const definitions = {
|
|
|
946
946
|
`,
|
|
947
947
|
flatten,
|
|
948
948
|
}),
|
|
949
|
+
'include-attestations': new Definition('include-attestations', {
|
|
950
|
+
default: false,
|
|
951
|
+
type: Boolean,
|
|
952
|
+
description: `
|
|
953
|
+
When used with \`npm audit signatures --json\`, includes the full
|
|
954
|
+
sigstore attestation bundles in the JSON output for each verified
|
|
955
|
+
package. The bundles contain DSSE envelopes, verification material,
|
|
956
|
+
and transparency log entries.
|
|
957
|
+
`,
|
|
958
|
+
flatten,
|
|
959
|
+
}),
|
|
949
960
|
'init-author-email': new Definition('init-author-email', {
|
|
950
961
|
default: '',
|
|
951
962
|
hint: '<email>',
|
|
@@ -1353,6 +1364,7 @@ const definitions = {
|
|
|
1353
1364
|
hint: '<days>',
|
|
1354
1365
|
type: [null, Number],
|
|
1355
1366
|
exclusive: ['before'],
|
|
1367
|
+
envExport: false,
|
|
1356
1368
|
description: `
|
|
1357
1369
|
If set, npm will build the npm tree such that only versions that were
|
|
1358
1370
|
available more than the given number of days ago will be installed. If
|
|
@@ -1612,6 +1624,7 @@ const definitions = {
|
|
|
1612
1624
|
'prefer-offline': new Definition('prefer-offline', {
|
|
1613
1625
|
default: false,
|
|
1614
1626
|
type: Boolean,
|
|
1627
|
+
exclusive: ['prefer-online'],
|
|
1615
1628
|
description: `
|
|
1616
1629
|
If true, staleness checks for cached data will be bypassed, but missing
|
|
1617
1630
|
data will be requested from the server. To force full offline mode, use
|
|
@@ -1622,6 +1635,7 @@ const definitions = {
|
|
|
1622
1635
|
'prefer-online': new Definition('prefer-online', {
|
|
1623
1636
|
default: false,
|
|
1624
1637
|
type: Boolean,
|
|
1638
|
+
exclusive: ['prefer-offline'],
|
|
1625
1639
|
description: `
|
|
1626
1640
|
If true, staleness checks for cached data will be forced, making the CLI
|
|
1627
1641
|
look for updates immediately even for fresh package data.
|
package/lib/index.js
CHANGED
|
@@ -582,7 +582,7 @@ class Config {
|
|
|
582
582
|
}
|
|
583
583
|
} else {
|
|
584
584
|
conf.raw = obj
|
|
585
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
585
|
+
outer: for (const [key, value] of Object.entries(obj)) {
|
|
586
586
|
const k = envReplace(key, this.env)
|
|
587
587
|
const v = this.parseField(value, k)
|
|
588
588
|
if (where !== 'default') {
|
|
@@ -590,6 +590,13 @@ class Config {
|
|
|
590
590
|
if (this.definitions[key]?.exclusive) {
|
|
591
591
|
for (const exclusive of this.definitions[key].exclusive) {
|
|
592
592
|
if (!this.isDefault(exclusive)) {
|
|
593
|
+
// when loading from env, skip only if sibling was explicitly set via CLI
|
|
594
|
+
if (where === 'env') {
|
|
595
|
+
const cliData = this.data.get('cli').data
|
|
596
|
+
if (Object.hasOwn(cliData, exclusive)) {
|
|
597
|
+
continue outer
|
|
598
|
+
}
|
|
599
|
+
}
|
|
593
600
|
throw new TypeError(`--${key} cannot be provided when using --${exclusive}`)
|
|
594
601
|
}
|
|
595
602
|
}
|
|
@@ -608,13 +615,16 @@ class Config {
|
|
|
608
615
|
if (internalEnv.includes(key)) {
|
|
609
616
|
return
|
|
610
617
|
}
|
|
618
|
+
const hint = where !== 'cli'
|
|
619
|
+
? ' See `npm help npmrc` for supported config options.'
|
|
620
|
+
: ''
|
|
611
621
|
if (!key.includes(':')) {
|
|
612
|
-
this.queueWarning(key, `Unknown ${where} config "${where === 'cli' ? '--' : ''}${key}". This will stop working in the next major version of npm
|
|
622
|
+
this.queueWarning(key, `Unknown ${where} config "${where === 'cli' ? '--' : ''}${key}". This will stop working in the next major version of npm.${hint}`)
|
|
613
623
|
return
|
|
614
624
|
}
|
|
615
625
|
const baseKey = key.split(':').pop()
|
|
616
626
|
if (!this.definitions[baseKey] && !this.nerfDarts.includes(baseKey)) {
|
|
617
|
-
this.queueWarning(baseKey, `Unknown ${where} config "${baseKey}" (${key}). This will stop working in the next major version of npm
|
|
627
|
+
this.queueWarning(baseKey, `Unknown ${where} config "${baseKey}" (${key}). This will stop working in the next major version of npm.${hint}`)
|
|
618
628
|
}
|
|
619
629
|
}
|
|
620
630
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/config",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.8.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"bin/",
|
|
6
6
|
"lib/"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@npmcli/eslint-config": "^5.0.1",
|
|
35
35
|
"@npmcli/mock-globals": "^1.0.0",
|
|
36
|
-
"@npmcli/template-oss": "4.
|
|
36
|
+
"@npmcli/template-oss": "4.29.0",
|
|
37
37
|
"tap": "^16.3.8"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"templateOSS": {
|
|
53
53
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
54
|
-
"version": "4.
|
|
54
|
+
"version": "4.29.0",
|
|
55
55
|
"content": "../../scripts/template-oss/index.js"
|
|
56
56
|
}
|
|
57
57
|
}
|