@npmcli/config 8.3.1 → 8.3.3

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.
@@ -7,7 +7,7 @@ const { join } = require('node:path')
7
7
  const isWindows = process.platform === 'win32'
8
8
 
9
9
  // used by cafile flattening to flatOptions.ca
10
- const { readFileSync } = require('fs')
10
+ const { readFileSync } = require('node:fs')
11
11
  const maybeReadFile = file => {
12
12
  try {
13
13
  return readFileSync(file, 'utf8')
@@ -61,7 +61,7 @@ const editor = process.env.EDITOR ||
61
61
  const shell = isWindows ? process.env.ComSpec || 'cmd'
62
62
  : process.env.SHELL || 'sh'
63
63
 
64
- const { networkInterfaces } = require('os')
64
+ const { networkInterfaces } = require('node:os')
65
65
  const getLocalAddresses = () => {
66
66
  try {
67
67
  return Object.values(networkInterfaces()).map(
@@ -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\` is a TTY.
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
- : !!process.stderr.isTTY && process.env.TERM !== 'dumb'
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', {
@@ -2009,11 +2012,14 @@ const definitions = {
2009
2012
  If you ask npm to install a package and don't tell it a specific version,
2010
2013
  then it will install the specified tag.
2011
2014
 
2012
- Also the tag that is added to the package@version specified by the \`npm
2013
- tag\` command, if no explicit tag is given.
2015
+ It is the tag added to the package@version specified in the
2016
+ \`npm dist-tag add\` command, if no explicit tag is given.
2014
2017
 
2015
2018
  When used by the \`npm diff\` command, this is the tag used to fetch the
2016
2019
  tarball that will be compared with the local files by default.
2020
+
2021
+ If used in the \`npm publish\` command, this is the tag that will be
2022
+ added to the package submitted to the registry.
2017
2023
  `,
2018
2024
  flatten (key, obj, flatOptions) {
2019
2025
  flatOptions.defaultTag = obj[key]
package/lib/index.js CHANGED
@@ -13,7 +13,7 @@ const {
13
13
  unlink,
14
14
  stat,
15
15
  mkdir,
16
- } = require('fs/promises')
16
+ } = require('node:fs/promises')
17
17
 
18
18
  const fileExists = (...p) => stat(resolve(...p))
19
19
  .then((st) => st.isFile())
@@ -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(`config:load:file:${file}`)
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npmcli/config",
3
- "version": "8.3.1",
3
+ "version": "8.3.3",
4
4
  "files": [
5
5
  "bin/",
6
6
  "lib/"
@@ -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.21.3",
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.0.0",
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.21.3",
53
+ "version": "4.22.0",
54
54
  "content": "../../scripts/template-oss/index.js"
55
55
  }
56
56
  }