@sanity/cli 3.54.1-ref-focus-repro.4 → 3.56.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.
- package/lib/_chunks-cjs/cli.js +26 -5
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/package.json +8 -8
package/lib/_chunks-cjs/cli.js
CHANGED
@@ -5132,7 +5132,7 @@ function getEnvValue(env, name) {
|
|
5132
5132
|
return env_replace_1.envReplace;
|
5133
5133
|
} });
|
5134
5134
|
})(dist$3);
|
5135
|
-
const fs$j = require$$0__default$1.default, path$p = require$$0__default.default, { envReplace } = dist$3, parseField = (types2, field, key2) => {
|
5135
|
+
const fs$j = require$$0__default$1.default, path$p = require$$0__default.default, { envReplace } = dist$3, parseKey = (key2) => typeof key2 != "string" ? key2 : envReplace(key2, process.env), parseField = (types2, field, key2) => {
|
5136
5136
|
if (typeof field != "string")
|
5137
5137
|
return field;
|
5138
5138
|
const typeList = [].concat(types2[key2]), isPath = typeList.indexOf(path$p) !== -1, isBool = typeList.indexOf(Boolean) !== -1, isString = typeList.indexOf(String) !== -1, isNumber2 = typeList.indexOf(Number) !== -1;
|
@@ -5187,6 +5187,7 @@ const fs$j = require$$0__default$1.default, path$p = require$$0__default.default
|
|
5187
5187
|
util$8.envReplace = envReplace;
|
5188
5188
|
util$8.findPrefix = findPrefix;
|
5189
5189
|
util$8.parseField = parseField;
|
5190
|
+
util$8.parseKey = parseKey;
|
5190
5191
|
var types$2 = {}, hasRequiredTypes$1;
|
5191
5192
|
function requireTypes$1() {
|
5192
5193
|
if (hasRequiredTypes$1) return types$2;
|
@@ -5328,8 +5329,10 @@ class Conf extends ConfigChain {
|
|
5328
5329
|
// https://github.com/npm/cli/blob/latest/lib/config/core.js#L326-L338
|
5329
5330
|
add(data, marker) {
|
5330
5331
|
try {
|
5331
|
-
for (const
|
5332
|
-
|
5332
|
+
for (const [key2, value] of Object.entries(data)) {
|
5333
|
+
const substKey = util$7.parseKey(key2);
|
5334
|
+
substKey !== key2 && delete data[key2], data[substKey] = this._parseField(value, substKey);
|
5335
|
+
}
|
5333
5336
|
} catch (error2) {
|
5334
5337
|
throw error2;
|
5335
5338
|
}
|
@@ -5346,7 +5349,7 @@ class Conf extends ConfigChain {
|
|
5346
5349
|
} catch (error2) {
|
5347
5350
|
if (error2.code === "ENOENT")
|
5348
5351
|
this.add({}, marker);
|
5349
|
-
else
|
5352
|
+
else if (error2.code !== "EISDIR")
|
5350
5353
|
return `Issue while reading "${file2}". ${error2.message}`;
|
5351
5354
|
}
|
5352
5355
|
}
|
@@ -5355,7 +5358,10 @@ class Conf extends ConfigChain {
|
|
5355
5358
|
env = env || process.env;
|
5356
5359
|
const conf2 = {};
|
5357
5360
|
return Object.keys(env).filter((x) => /^npm_config_/i.test(x)).forEach((x) => {
|
5358
|
-
|
5361
|
+
if (!env[x])
|
5362
|
+
return;
|
5363
|
+
const key2 = envKeyToSetting(x.substr(11)), rawVal = env[x];
|
5364
|
+
conf2[key2] = deserializeEnvVal(key2, rawVal);
|
5359
5365
|
}), super.addEnv("", conf2, "env");
|
5360
5366
|
}
|
5361
5367
|
// https://github.com/npm/cli/blob/latest/lib/config/load-prefix.js
|
@@ -5419,6 +5425,20 @@ class Conf extends ConfigChain {
|
|
5419
5425
|
}
|
5420
5426
|
}
|
5421
5427
|
}
|
5428
|
+
function deserializeEnvVal(envKey, envValue) {
|
5429
|
+
function deserializeList(envValue2) {
|
5430
|
+
const npmConfigSep = `
|
5431
|
+
|
5432
|
+
`;
|
5433
|
+
return envValue2.indexOf(npmConfigSep) ? envValue2.split(npmConfigSep) : envValue2.split(",");
|
5434
|
+
}
|
5435
|
+
switch (envKey) {
|
5436
|
+
case "hoist-pattern":
|
5437
|
+
case "public-hoist-pattern":
|
5438
|
+
return deserializeList(envValue);
|
5439
|
+
}
|
5440
|
+
return envValue;
|
5441
|
+
}
|
5422
5442
|
var conf = Conf, defaults$3 = {};
|
5423
5443
|
(function(exports2) {
|
5424
5444
|
const os2 = require$$0__default$2.default, path2 = require$$0__default.default, temp = os2.tmpdir(), uidOrPid = process.getuid ? process.getuid() : process.pid, hasUnicode = () => !0, isWindows2 = process.platform === "win32", osenv = {
|
@@ -21672,6 +21692,7 @@ const path$8 = require$$0__default.default, pathExists$3 = pathExistsExports, lo
|
|
21672
21692
|
var whichPm = async function(pkgPath) {
|
21673
21693
|
const modulesPath = path$8.join(pkgPath, "node_modules");
|
21674
21694
|
if (await pathExists$3(path$8.join(modulesPath, ".yarn-integrity"))) return { name: "yarn" };
|
21695
|
+
if (await pathExists$3(path$8.join(pkgPath, "bun.lockb"))) return { name: "bun" };
|
21675
21696
|
try {
|
21676
21697
|
const modules = await loadYamlFile(path$8.join(modulesPath, ".modules.yaml"));
|
21677
21698
|
return toNameAndVersion(modules.packageManager);
|