@npmcli/config 7.0.0 → 7.1.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.
Files changed (2) hide show
  1. package/lib/index.js +9 -1
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -610,7 +610,15 @@ class Config {
610
610
  process.emit('time', 'config:load:file:' + file)
611
611
  // only catch the error from readFile, not from the loadObject call
612
612
  await readFile(file, 'utf8').then(
613
- data => this.#loadObject(ini.parse(data), type, file),
613
+ data => {
614
+ const parsedConfig = ini.parse(data)
615
+ if (type === 'project' && parsedConfig.prefix) {
616
+ // Log error if prefix is mentioned in project .npmrc
617
+ /* eslint-disable-next-line max-len */
618
+ log.error('config', `prefix cannot be changed from project config: ${file}.`)
619
+ }
620
+ return this.#loadObject(parsedConfig, type, file)
621
+ },
614
622
  er => this.#loadObject(null, type, file, er)
615
623
  )
616
624
  process.emit('timeEnd', 'config:load:file:' + file)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npmcli/config",
3
- "version": "7.0.0",
3
+ "version": "7.1.0",
4
4
  "files": [
5
5
  "bin/",
6
6
  "lib/"
@@ -33,7 +33,7 @@
33
33
  "@npmcli/eslint-config": "^4.0.0",
34
34
  "@npmcli/mock-globals": "^1.0.0",
35
35
  "@npmcli/template-oss": "4.18.0",
36
- "tap": "^16.3.4"
36
+ "tap": "^16.3.8"
37
37
  },
38
38
  "dependencies": {
39
39
  "@npmcli/map-workspaces": "^3.0.2",