From a0d35ff20aed6aab8508123eb540bc9c61fb127d Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 4 Nov 2021 12:55:21 -0700 Subject: [PATCH] deps: @npmcli/config@2.3.1 * fix: dont load project configs in global mode PR-URL: https://github.com/npm/cli/pull/3996 Credit: @nlf Close: #3996 Reviewed-by: @wraithgar PR-URL: https://github.com/npm/cli/pull/3996 Credit: @nlf Close: #3996 Reviewed-by: @wraithgar --- node_modules/@npmcli/config/lib/index.js | 6 ++++++ node_modules/@npmcli/config/package.json | 2 +- package-lock.json | 12 ++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/node_modules/@npmcli/config/lib/index.js b/node_modules/@npmcli/config/lib/index.js index f947896f0ba34..724ce14c38fc9 100644 --- a/node_modules/@npmcli/config/lib/index.js +++ b/node_modules/@npmcli/config/lib/index.js @@ -497,6 +497,12 @@ class Config { } async loadProjectConfig () { + if (this[_get]('global') === true || this[_get]('location') === 'global') { + this.data.get('project').source = '(global mode enabled, ignored)' + this.sources.set(this.data.get('project').source, 'project') + return + } + // the localPrefix can be set by the CLI config, but otherwise is // found by walking up the folder tree await this.loadLocalPrefix() diff --git a/node_modules/@npmcli/config/package.json b/node_modules/@npmcli/config/package.json index b31eecbe35979..f36d8f7b11ec5 100644 --- a/node_modules/@npmcli/config/package.json +++ b/node_modules/@npmcli/config/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/config", - "version": "2.3.0", + "version": "2.3.1", "files": [ "lib" ], diff --git a/package-lock.json b/package-lock.json index d624d051e6e52..84a12e2926664 100644 --- a/package-lock.json +++ b/package-lock.json @@ -824,9 +824,9 @@ "inBundle": true }, "node_modules/@npmcli/config": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-2.3.0.tgz", - "integrity": "sha512-yjiC1xv7KTmUTqfRwN2ZL7BHV160ctGF0fLXmKkkMXj40UOvBe45Apwvt5JsFRtXSoHkUYy1ouzscziuWNzklg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-2.3.1.tgz", + "integrity": "sha512-F/8R/Zqun8682TgaCILUNoaVfd1LVaYZ/jcVt9KWzfKpzcPus1zEApAl54PqVqVJbNq6f01QTDQHD6L/n56BXw==", "inBundle": true, "dependencies": { "ini": "^2.0.0", @@ -11126,9 +11126,9 @@ "integrity": "sha512-3BGrt6FLjqM6br5AhWRKTr3u5GIVkjRYeAFrMp3HjnfICrg4xOrVRwFavKT6tsp++bq5dluL5t8ME/Nha/6c1Q==" }, "@npmcli/config": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-2.3.0.tgz", - "integrity": "sha512-yjiC1xv7KTmUTqfRwN2ZL7BHV160ctGF0fLXmKkkMXj40UOvBe45Apwvt5JsFRtXSoHkUYy1ouzscziuWNzklg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-2.3.1.tgz", + "integrity": "sha512-F/8R/Zqun8682TgaCILUNoaVfd1LVaYZ/jcVt9KWzfKpzcPus1zEApAl54PqVqVJbNq6f01QTDQHD6L/n56BXw==", "requires": { "ini": "^2.0.0", "mkdirp-infer-owner": "^2.0.0",