@npmcli/config 8.3.0 → 8.3.2
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 +5 -2
- package/lib/index.js +7 -10
- package/package.json +5 -5
|
@@ -1549,13 +1549,16 @@ const definitions = {
|
|
|
1549
1549
|
type: Boolean,
|
|
1550
1550
|
description: `
|
|
1551
1551
|
When set to \`true\`, npm will display a progress bar during time
|
|
1552
|
-
intensive operations, if \`process.stderr\`
|
|
1552
|
+
intensive operations, if \`process.stderr\` and \`process.stdout\` are a TTY.
|
|
1553
1553
|
|
|
1554
1554
|
Set to \`false\` to suppress the progress bar.
|
|
1555
1555
|
`,
|
|
1556
1556
|
flatten (key, obj, flatOptions) {
|
|
1557
1557
|
flatOptions.progress = !obj.progress ? false
|
|
1558
|
-
|
|
1558
|
+
// progress is only written to stderr but we disable it unless stdout is a tty
|
|
1559
|
+
// also. This prevents the progress from appearing when piping output to another
|
|
1560
|
+
// command which doesn't break anything, but does look very odd to users.
|
|
1561
|
+
: !!process.stderr.isTTY && !!process.stdout.isTTY && process.env.TERM !== 'dumb'
|
|
1559
1562
|
},
|
|
1560
1563
|
}),
|
|
1561
1564
|
provenance: new Definition('provenance', {
|
package/lib/index.js
CHANGED
|
@@ -557,7 +557,7 @@ class Config {
|
|
|
557
557
|
const k = envReplace(key, this.env)
|
|
558
558
|
const v = this.parseField(value, k)
|
|
559
559
|
if (where !== 'default') {
|
|
560
|
-
this.#checkDeprecated(k
|
|
560
|
+
this.#checkDeprecated(k)
|
|
561
561
|
if (this.definitions[key]?.exclusive) {
|
|
562
562
|
for (const exclusive of this.definitions[key].exclusive) {
|
|
563
563
|
if (!this.isDefault(exclusive)) {
|
|
@@ -571,7 +571,7 @@ class Config {
|
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
|
|
574
|
-
#checkDeprecated (key
|
|
574
|
+
#checkDeprecated (key) {
|
|
575
575
|
// XXX(npm9+) make this throw an error
|
|
576
576
|
if (this.deprecated[key]) {
|
|
577
577
|
log.warn('config', key, this.deprecated[key])
|
|
@@ -585,7 +585,7 @@ class Config {
|
|
|
585
585
|
|
|
586
586
|
async #loadFile (file, type) {
|
|
587
587
|
// only catch the error from readFile, not from the loadObject call
|
|
588
|
-
log.silly(`
|
|
588
|
+
log.silly('config', `load:file:${file}`)
|
|
589
589
|
await readFile(file, 'utf8').then(
|
|
590
590
|
data => {
|
|
591
591
|
const parsedConfig = ini.parse(data)
|
|
@@ -684,7 +684,7 @@ class Config {
|
|
|
684
684
|
if (w === this.localPrefix) {
|
|
685
685
|
// see if there's a .npmrc file in the workspace, if so log a warning
|
|
686
686
|
if (await fileExists(this.localPrefix, '.npmrc')) {
|
|
687
|
-
log.warn(`ignoring workspace config at ${this.localPrefix}/.npmrc`)
|
|
687
|
+
log.warn('config', `ignoring workspace config at ${this.localPrefix}/.npmrc`)
|
|
688
688
|
}
|
|
689
689
|
|
|
690
690
|
// set the workspace in the default layer, which allows it to be overridden easily
|
|
@@ -692,7 +692,7 @@ class Config {
|
|
|
692
692
|
data.workspace = [this.localPrefix]
|
|
693
693
|
this.localPrefix = p
|
|
694
694
|
this.localPackage = hasPackageJson
|
|
695
|
-
log.info(`found workspace root at ${this.localPrefix}`)
|
|
695
|
+
log.info('config', `found workspace root at ${this.localPrefix}`)
|
|
696
696
|
// we found a root, so we return now
|
|
697
697
|
return
|
|
698
698
|
}
|
|
@@ -739,7 +739,7 @@ class Config {
|
|
|
739
739
|
const iniData = ini.stringify(conf.raw).trim() + '\n'
|
|
740
740
|
if (!iniData.trim()) {
|
|
741
741
|
// ignore the unlink error (eg, if file doesn't exist)
|
|
742
|
-
await unlink(conf.source).catch(
|
|
742
|
+
await unlink(conf.source).catch(() => {})
|
|
743
743
|
return
|
|
744
744
|
}
|
|
745
745
|
const dir = dirname(conf.source)
|
|
@@ -774,12 +774,9 @@ class Config {
|
|
|
774
774
|
this.delete(`${nerfed}:keyfile`, level)
|
|
775
775
|
}
|
|
776
776
|
|
|
777
|
-
setCredentialsByURI (uri, { token, username, password,
|
|
777
|
+
setCredentialsByURI (uri, { token, username, password, certfile, keyfile }) {
|
|
778
778
|
const nerfed = nerfDart(uri)
|
|
779
779
|
|
|
780
|
-
// email is either provided, a top level key, or nothing
|
|
781
|
-
email = email || this.get('email', 'user')
|
|
782
|
-
|
|
783
780
|
// field that hasn't been used as documented for a LONG time,
|
|
784
781
|
// and as of npm 7.10.0, isn't used at all. We just always
|
|
785
782
|
// send auth if we have it, only to the URIs under the nerf dart.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/config",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.2",
|
|
4
4
|
"files": [
|
|
5
5
|
"bin/",
|
|
6
6
|
"lib/"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"description": "Configuration management for the npm cli",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/npm/cli.git",
|
|
12
|
+
"url": "git+https://github.com/npm/cli.git",
|
|
13
13
|
"directory": "workspaces/config"
|
|
14
14
|
},
|
|
15
15
|
"author": "GitHub Inc.",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@npmcli/eslint-config": "^4.0.0",
|
|
34
34
|
"@npmcli/mock-globals": "^1.0.0",
|
|
35
|
-
"@npmcli/template-oss": "4.
|
|
35
|
+
"@npmcli/template-oss": "4.22.0",
|
|
36
36
|
"tap": "^16.3.8"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@npmcli/map-workspaces": "^3.0.2",
|
|
40
40
|
"ci-info": "^4.0.0",
|
|
41
41
|
"ini": "^4.1.2",
|
|
42
|
-
"nopt": "^7.
|
|
42
|
+
"nopt": "^7.2.1",
|
|
43
43
|
"proc-log": "^4.2.0",
|
|
44
44
|
"read-package-json-fast": "^3.0.2",
|
|
45
45
|
"semver": "^7.3.5",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"templateOSS": {
|
|
52
52
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
53
|
-
"version": "4.
|
|
53
|
+
"version": "4.22.0",
|
|
54
54
|
"content": "../../scripts/template-oss/index.js"
|
|
55
55
|
}
|
|
56
56
|
}
|