@npmcli/config
Advanced tools
Comparing version 8.2.2 to 8.3.0
@@ -5,3 +5,3 @@ // TODO: set the scope config from package.json or explicit cli config | ||
const nopt = require('nopt') | ||
const log = require('proc-log') | ||
const { log, time } = require('proc-log') | ||
@@ -205,3 +205,3 @@ const { resolve, dirname, join } = require('node:path') | ||
// create the object for flat options passed to deps | ||
process.emit('time', 'config:load:flatten') | ||
const timeEnd = time.start('config:load:flatten') | ||
this.#flatOptions = {} | ||
@@ -214,3 +214,3 @@ // walk from least priority to highest | ||
this.#flatOptions.npmBin = this.npmBin | ||
process.emit('timeEnd', 'config:load:flatten') | ||
timeEnd() | ||
@@ -239,33 +239,20 @@ return this.#flatOptions | ||
process.emit('time', 'config:load') | ||
// first load the defaults, which sets the global prefix | ||
process.emit('time', 'config:load:defaults') | ||
this.loadDefaults() | ||
process.emit('timeEnd', 'config:load:defaults') | ||
// next load the builtin config, as this sets new effective defaults | ||
process.emit('time', 'config:load:builtin') | ||
await this.loadBuiltinConfig() | ||
process.emit('timeEnd', 'config:load:builtin') | ||
// cli and env are not async, and can set the prefix, relevant to project | ||
process.emit('time', 'config:load:cli') | ||
this.loadCLI() | ||
process.emit('timeEnd', 'config:load:cli') | ||
process.emit('time', 'config:load:env') | ||
this.loadEnv() | ||
process.emit('timeEnd', 'config:load:env') | ||
// next project config, which can affect userconfig location | ||
process.emit('time', 'config:load:project') | ||
await this.loadProjectConfig() | ||
process.emit('timeEnd', 'config:load:project') | ||
// then user config, which can affect globalconfig location | ||
process.emit('time', 'config:load:user') | ||
await this.loadUserConfig() | ||
process.emit('timeEnd', 'config:load:user') | ||
// last but not least, global config file | ||
process.emit('time', 'config:load:global') | ||
await this.loadGlobalConfig() | ||
process.emit('timeEnd', 'config:load:global') | ||
@@ -279,7 +266,3 @@ // set this before calling setEnvs, so that we don't have to share | ||
process.emit('time', 'config:load:setEnvs') | ||
this.setEnvs() | ||
process.emit('timeEnd', 'config:load:setEnvs') | ||
process.emit('timeEnd', 'config:load') | ||
} | ||
@@ -609,4 +592,4 @@ | ||
async #loadFile (file, type) { | ||
process.emit('time', 'config:load:file:' + file) | ||
// only catch the error from readFile, not from the loadObject call | ||
log.silly(`config:load:file:${file}`) | ||
await readFile(file, 'utf8').then( | ||
@@ -624,3 +607,2 @@ data => { | ||
) | ||
process.emit('timeEnd', 'config:load:file:' + file) | ||
} | ||
@@ -627,0 +609,0 @@ |
{ | ||
"name": "@npmcli/config", | ||
"version": "8.2.2", | ||
"version": "8.3.0", | ||
"files": [ | ||
@@ -43,3 +43,3 @@ "bin/", | ||
"nopt": "^7.0.0", | ||
"proc-log": "^3.0.0", | ||
"proc-log": "^4.2.0", | ||
"read-package-json-fast": "^3.0.2", | ||
@@ -46,0 +46,0 @@ "semver": "^7.3.5", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
133158
3565
+ Addedproc-log@4.2.0(transitive)
- Removedproc-log@3.0.0(transitive)
Updatedproc-log@^4.2.0