@sanity/cli 4.16.0-next.45 → 4.16.0-next.46
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 +16 -237
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/lib/_chunks-cjs/index.js +31 -0
- package/lib/_chunks-cjs/index.js.map +1 -0
- package/package.json +8 -8
package/lib/_chunks-cjs/cli.js
CHANGED
|
@@ -21659,229 +21659,6 @@ var findYarnWorkspaceRoot2, hasRequiredFindYarnWorkspaceRoot2;
|
|
|
21659
21659
|
function requireFindYarnWorkspaceRoot2() {
|
|
21660
21660
|
return hasRequiredFindYarnWorkspaceRoot2 || (hasRequiredFindYarnWorkspaceRoot2 = 1, findYarnWorkspaceRoot2 = requireCore$3().findWorkspaceRoot), findYarnWorkspaceRoot2;
|
|
21661
21661
|
}
|
|
21662
|
-
var findUp = { exports: {} }, locatePath = { exports: {} }, yoctoQueue, hasRequiredYoctoQueue;
|
|
21663
|
-
function requireYoctoQueue() {
|
|
21664
|
-
if (hasRequiredYoctoQueue) return yoctoQueue;
|
|
21665
|
-
hasRequiredYoctoQueue = 1;
|
|
21666
|
-
class Node {
|
|
21667
|
-
/// value;
|
|
21668
|
-
/// next;
|
|
21669
|
-
constructor(value) {
|
|
21670
|
-
this.value = value, this.next = void 0;
|
|
21671
|
-
}
|
|
21672
|
-
}
|
|
21673
|
-
class Queue {
|
|
21674
|
-
// TODO: Use private class fields when targeting Node.js 12.
|
|
21675
|
-
// #_head;
|
|
21676
|
-
// #_tail;
|
|
21677
|
-
// #_size;
|
|
21678
|
-
constructor() {
|
|
21679
|
-
this.clear();
|
|
21680
|
-
}
|
|
21681
|
-
enqueue(value) {
|
|
21682
|
-
const node = new Node(value);
|
|
21683
|
-
this._head ? (this._tail.next = node, this._tail = node) : (this._head = node, this._tail = node), this._size++;
|
|
21684
|
-
}
|
|
21685
|
-
dequeue() {
|
|
21686
|
-
const current = this._head;
|
|
21687
|
-
if (current)
|
|
21688
|
-
return this._head = this._head.next, this._size--, current.value;
|
|
21689
|
-
}
|
|
21690
|
-
clear() {
|
|
21691
|
-
this._head = void 0, this._tail = void 0, this._size = 0;
|
|
21692
|
-
}
|
|
21693
|
-
get size() {
|
|
21694
|
-
return this._size;
|
|
21695
|
-
}
|
|
21696
|
-
*[Symbol.iterator]() {
|
|
21697
|
-
let current = this._head;
|
|
21698
|
-
for (; current; )
|
|
21699
|
-
yield current.value, current = current.next;
|
|
21700
|
-
}
|
|
21701
|
-
}
|
|
21702
|
-
return yoctoQueue = Queue, yoctoQueue;
|
|
21703
|
-
}
|
|
21704
|
-
var pLimit_1, hasRequiredPLimit;
|
|
21705
|
-
function requirePLimit() {
|
|
21706
|
-
if (hasRequiredPLimit) return pLimit_1;
|
|
21707
|
-
hasRequiredPLimit = 1;
|
|
21708
|
-
const Queue = requireYoctoQueue();
|
|
21709
|
-
return pLimit_1 = (concurrency) => {
|
|
21710
|
-
if (!((Number.isInteger(concurrency) || concurrency === 1 / 0) && concurrency > 0))
|
|
21711
|
-
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
21712
|
-
const queue2 = new Queue();
|
|
21713
|
-
let activeCount = 0;
|
|
21714
|
-
const next = () => {
|
|
21715
|
-
activeCount--, queue2.size > 0 && queue2.dequeue()();
|
|
21716
|
-
}, run = async (fn, resolve, ...args) => {
|
|
21717
|
-
activeCount++;
|
|
21718
|
-
const result = (async () => fn(...args))();
|
|
21719
|
-
resolve(result);
|
|
21720
|
-
try {
|
|
21721
|
-
await result;
|
|
21722
|
-
} catch {
|
|
21723
|
-
}
|
|
21724
|
-
next();
|
|
21725
|
-
}, enqueue = (fn, resolve, ...args) => {
|
|
21726
|
-
queue2.enqueue(run.bind(null, fn, resolve, ...args)), (async () => (await Promise.resolve(), activeCount < concurrency && queue2.size > 0 && queue2.dequeue()()))();
|
|
21727
|
-
}, generator = (fn, ...args) => new Promise((resolve) => {
|
|
21728
|
-
enqueue(fn, resolve, ...args);
|
|
21729
|
-
});
|
|
21730
|
-
return Object.defineProperties(generator, {
|
|
21731
|
-
activeCount: {
|
|
21732
|
-
get: () => activeCount
|
|
21733
|
-
},
|
|
21734
|
-
pendingCount: {
|
|
21735
|
-
get: () => queue2.size
|
|
21736
|
-
},
|
|
21737
|
-
clearQueue: {
|
|
21738
|
-
value: () => {
|
|
21739
|
-
queue2.clear();
|
|
21740
|
-
}
|
|
21741
|
-
}
|
|
21742
|
-
}), generator;
|
|
21743
|
-
}, pLimit_1;
|
|
21744
|
-
}
|
|
21745
|
-
var pLocate_1, hasRequiredPLocate;
|
|
21746
|
-
function requirePLocate() {
|
|
21747
|
-
if (hasRequiredPLocate) return pLocate_1;
|
|
21748
|
-
hasRequiredPLocate = 1;
|
|
21749
|
-
const pLimit = requirePLimit();
|
|
21750
|
-
class EndError extends Error {
|
|
21751
|
-
constructor(value) {
|
|
21752
|
-
super(), this.value = value;
|
|
21753
|
-
}
|
|
21754
|
-
}
|
|
21755
|
-
const testElement = async (element, tester) => tester(await element), finder = async (element) => {
|
|
21756
|
-
const values = await Promise.all(element);
|
|
21757
|
-
if (values[1] === !0)
|
|
21758
|
-
throw new EndError(values[0]);
|
|
21759
|
-
return !1;
|
|
21760
|
-
};
|
|
21761
|
-
return pLocate_1 = async (iterable, tester, options2) => {
|
|
21762
|
-
options2 = {
|
|
21763
|
-
concurrency: 1 / 0,
|
|
21764
|
-
preserveOrder: !0,
|
|
21765
|
-
...options2
|
|
21766
|
-
};
|
|
21767
|
-
const limit = pLimit(options2.concurrency), items = [...iterable].map((element) => [element, limit(testElement, element, tester)]), checkLimit = pLimit(options2.preserveOrder ? 1 : 1 / 0);
|
|
21768
|
-
try {
|
|
21769
|
-
await Promise.all(items.map((element) => checkLimit(finder, element)));
|
|
21770
|
-
} catch (error2) {
|
|
21771
|
-
if (error2 instanceof EndError)
|
|
21772
|
-
return error2.value;
|
|
21773
|
-
throw error2;
|
|
21774
|
-
}
|
|
21775
|
-
}, pLocate_1;
|
|
21776
|
-
}
|
|
21777
|
-
var hasRequiredLocatePath;
|
|
21778
|
-
function requireLocatePath() {
|
|
21779
|
-
if (hasRequiredLocatePath) return locatePath.exports;
|
|
21780
|
-
hasRequiredLocatePath = 1;
|
|
21781
|
-
const path2 = require$$0__default$1.default, fs2 = require$$0__default.default, { promisify } = require$$0__default$5.default, pLocate = requirePLocate(), fsStat = promisify(fs2.stat), fsLStat = promisify(fs2.lstat), typeMappings = {
|
|
21782
|
-
directory: "isDirectory",
|
|
21783
|
-
file: "isFile"
|
|
21784
|
-
};
|
|
21785
|
-
function checkType({ type: type2 }) {
|
|
21786
|
-
if (!(type2 in typeMappings))
|
|
21787
|
-
throw new Error(`Invalid type specified: ${type2}`);
|
|
21788
|
-
}
|
|
21789
|
-
const matchType = (type2, stat2) => type2 === void 0 || stat2[typeMappings[type2]]();
|
|
21790
|
-
return locatePath.exports = async (paths, options2) => {
|
|
21791
|
-
options2 = {
|
|
21792
|
-
cwd: process.cwd(),
|
|
21793
|
-
type: "file",
|
|
21794
|
-
allowSymlinks: !0,
|
|
21795
|
-
...options2
|
|
21796
|
-
}, checkType(options2);
|
|
21797
|
-
const statFn = options2.allowSymlinks ? fsStat : fsLStat;
|
|
21798
|
-
return pLocate(paths, async (path_) => {
|
|
21799
|
-
try {
|
|
21800
|
-
const stat2 = await statFn(path2.resolve(options2.cwd, path_));
|
|
21801
|
-
return matchType(options2.type, stat2);
|
|
21802
|
-
} catch {
|
|
21803
|
-
return !1;
|
|
21804
|
-
}
|
|
21805
|
-
}, options2);
|
|
21806
|
-
}, locatePath.exports.sync = (paths, options2) => {
|
|
21807
|
-
options2 = {
|
|
21808
|
-
cwd: process.cwd(),
|
|
21809
|
-
allowSymlinks: !0,
|
|
21810
|
-
type: "file",
|
|
21811
|
-
...options2
|
|
21812
|
-
}, checkType(options2);
|
|
21813
|
-
const statFn = options2.allowSymlinks ? fs2.statSync : fs2.lstatSync;
|
|
21814
|
-
for (const path_ of paths)
|
|
21815
|
-
try {
|
|
21816
|
-
const stat2 = statFn(path2.resolve(options2.cwd, path_));
|
|
21817
|
-
if (matchType(options2.type, stat2))
|
|
21818
|
-
return path_;
|
|
21819
|
-
} catch {
|
|
21820
|
-
}
|
|
21821
|
-
}, locatePath.exports;
|
|
21822
|
-
}
|
|
21823
|
-
var pathExists = { exports: {} }, hasRequiredPathExists;
|
|
21824
|
-
function requirePathExists() {
|
|
21825
|
-
if (hasRequiredPathExists) return pathExists.exports;
|
|
21826
|
-
hasRequiredPathExists = 1;
|
|
21827
|
-
const fs2 = require$$0__default.default, { promisify } = require$$0__default$5.default, pAccess = promisify(fs2.access);
|
|
21828
|
-
return pathExists.exports = async (path2) => {
|
|
21829
|
-
try {
|
|
21830
|
-
return await pAccess(path2), !0;
|
|
21831
|
-
} catch {
|
|
21832
|
-
return !1;
|
|
21833
|
-
}
|
|
21834
|
-
}, pathExists.exports.sync = (path2) => {
|
|
21835
|
-
try {
|
|
21836
|
-
return fs2.accessSync(path2), !0;
|
|
21837
|
-
} catch {
|
|
21838
|
-
return !1;
|
|
21839
|
-
}
|
|
21840
|
-
}, pathExists.exports;
|
|
21841
|
-
}
|
|
21842
|
-
var hasRequiredFindUp;
|
|
21843
|
-
function requireFindUp() {
|
|
21844
|
-
return hasRequiredFindUp || (hasRequiredFindUp = 1, (function(module2) {
|
|
21845
|
-
const path2 = require$$0__default$1.default, locatePath2 = requireLocatePath(), pathExists2 = requirePathExists(), stop = Symbol("findUp.stop");
|
|
21846
|
-
module2.exports = async (name, options2 = {}) => {
|
|
21847
|
-
let directory = path2.resolve(options2.cwd || "");
|
|
21848
|
-
const { root: root2 } = path2.parse(directory), paths = [].concat(name), runMatcher = async (locateOptions) => {
|
|
21849
|
-
if (typeof name != "function")
|
|
21850
|
-
return locatePath2(paths, locateOptions);
|
|
21851
|
-
const foundPath = await name(locateOptions.cwd);
|
|
21852
|
-
return typeof foundPath == "string" ? locatePath2([foundPath], locateOptions) : foundPath;
|
|
21853
|
-
};
|
|
21854
|
-
for (; ; ) {
|
|
21855
|
-
const foundPath = await runMatcher({ ...options2, cwd: directory });
|
|
21856
|
-
if (foundPath === stop)
|
|
21857
|
-
return;
|
|
21858
|
-
if (foundPath)
|
|
21859
|
-
return path2.resolve(directory, foundPath);
|
|
21860
|
-
if (directory === root2)
|
|
21861
|
-
return;
|
|
21862
|
-
directory = path2.dirname(directory);
|
|
21863
|
-
}
|
|
21864
|
-
}, module2.exports.sync = (name, options2 = {}) => {
|
|
21865
|
-
let directory = path2.resolve(options2.cwd || "");
|
|
21866
|
-
const { root: root2 } = path2.parse(directory), paths = [].concat(name), runMatcher = (locateOptions) => {
|
|
21867
|
-
if (typeof name != "function")
|
|
21868
|
-
return locatePath2.sync(paths, locateOptions);
|
|
21869
|
-
const foundPath = name(locateOptions.cwd);
|
|
21870
|
-
return typeof foundPath == "string" ? locatePath2.sync([foundPath], locateOptions) : foundPath;
|
|
21871
|
-
};
|
|
21872
|
-
for (; ; ) {
|
|
21873
|
-
const foundPath = runMatcher({ ...options2, cwd: directory });
|
|
21874
|
-
if (foundPath === stop)
|
|
21875
|
-
return;
|
|
21876
|
-
if (foundPath)
|
|
21877
|
-
return path2.resolve(directory, foundPath);
|
|
21878
|
-
if (directory === root2)
|
|
21879
|
-
return;
|
|
21880
|
-
directory = path2.dirname(directory);
|
|
21881
|
-
}
|
|
21882
|
-
}, module2.exports.exists = pathExists2, module2.exports.sync.exists = pathExists2.sync, module2.exports.stop = stop;
|
|
21883
|
-
})(findUp)), findUp.exports;
|
|
21884
|
-
}
|
|
21885
21662
|
var loadYamlFile = { exports: {} }, pify, hasRequiredPify;
|
|
21886
21663
|
function requirePify() {
|
|
21887
21664
|
if (hasRequiredPify) return pify;
|
|
@@ -23422,18 +23199,17 @@ var whichPm, hasRequiredWhichPm;
|
|
|
23422
23199
|
function requireWhichPm() {
|
|
23423
23200
|
if (hasRequiredWhichPm) return whichPm;
|
|
23424
23201
|
hasRequiredWhichPm = 1;
|
|
23425
|
-
const path2 = require$$0__default$1.default,
|
|
23202
|
+
const path2 = require$$0__default$1.default, fs2 = require$$0__default.default, loadYamlFile2 = requireLoadYamlFile();
|
|
23426
23203
|
whichPm = async function(pkgPath) {
|
|
23427
23204
|
const modulesPath = path2.join(pkgPath, "node_modules");
|
|
23428
|
-
if (
|
|
23429
|
-
if (await pathExists2(path2.join(pkgPath, "bun.lockb"))) return { name: "bun" };
|
|
23205
|
+
if (fs2.existsSync(path2.join(modulesPath, ".yarn-integrity"))) return { name: "yarn" };
|
|
23430
23206
|
try {
|
|
23431
23207
|
const modules = await loadYamlFile2(path2.join(modulesPath, ".modules.yaml"));
|
|
23432
23208
|
return toNameAndVersion(modules.packageManager);
|
|
23433
23209
|
} catch (err) {
|
|
23434
23210
|
if (err.code !== "ENOENT") throw err;
|
|
23435
23211
|
}
|
|
23436
|
-
return
|
|
23212
|
+
return fs2.existsSync(path2.join(pkgPath, "bun.lockb")) ? { name: "bun" } : fs2.existsSync(modulesPath) ? { name: "npm" } : null;
|
|
23437
23213
|
};
|
|
23438
23214
|
function toNameAndVersion(pkgSpec) {
|
|
23439
23215
|
if (pkgSpec[0] === "@") {
|
|
@@ -23455,36 +23231,39 @@ var preferredPm, hasRequiredPreferredPm;
|
|
|
23455
23231
|
function requirePreferredPm() {
|
|
23456
23232
|
if (hasRequiredPreferredPm) return preferredPm;
|
|
23457
23233
|
hasRequiredPreferredPm = 1;
|
|
23458
|
-
const findYarnWorkspaceRoot = requireFindYarnWorkspaceRoot2(),
|
|
23234
|
+
const findYarnWorkspaceRoot = requireFindYarnWorkspaceRoot2(), fs2 = require$$0__default.default, path2 = require$$0__default$1.default, whichPM = requireWhichPm();
|
|
23459
23235
|
return preferredPm = async function(pkgPath) {
|
|
23460
23236
|
if (typeof pkgPath != "string")
|
|
23461
23237
|
throw new TypeError(`pkgPath should be a string, got ${typeof pkgPath}`);
|
|
23462
|
-
if (
|
|
23238
|
+
if (fs2.existsSync(path2.join(pkgPath, "package-lock.json")))
|
|
23463
23239
|
return {
|
|
23464
23240
|
name: "npm",
|
|
23465
23241
|
version: ">=5"
|
|
23466
23242
|
};
|
|
23467
|
-
if (
|
|
23243
|
+
if (fs2.existsSync(path2.join(pkgPath, "yarn.lock")))
|
|
23468
23244
|
return {
|
|
23469
23245
|
name: "yarn",
|
|
23470
23246
|
version: "*"
|
|
23471
23247
|
};
|
|
23472
|
-
if (
|
|
23248
|
+
if (fs2.existsSync(path2.join(pkgPath, "pnpm-lock.yaml")))
|
|
23473
23249
|
return {
|
|
23474
23250
|
name: "pnpm",
|
|
23475
23251
|
version: ">=3"
|
|
23476
23252
|
};
|
|
23477
|
-
if (
|
|
23253
|
+
if (fs2.existsSync(path2.join(pkgPath, "shrinkwrap.yaml")))
|
|
23478
23254
|
return {
|
|
23479
23255
|
name: "pnpm",
|
|
23480
23256
|
version: "1 || 2"
|
|
23481
23257
|
};
|
|
23482
|
-
if (
|
|
23258
|
+
if (fs2.existsSync(path2.join(pkgPath, "bun.lockb")) || fs2.existsSync(path2.join(pkgPath, "bun.lock")))
|
|
23483
23259
|
return {
|
|
23484
23260
|
name: "bun",
|
|
23485
23261
|
version: "*"
|
|
23486
23262
|
};
|
|
23487
|
-
|
|
23263
|
+
const { findUp } = await Promise.resolve().then(function() {
|
|
23264
|
+
return require("./index.js");
|
|
23265
|
+
});
|
|
23266
|
+
if (await findUp("pnpm-lock.yaml", { cwd: pkgPath }))
|
|
23488
23267
|
return {
|
|
23489
23268
|
name: "pnpm",
|
|
23490
23269
|
version: ">=3"
|
|
@@ -23492,7 +23271,7 @@ function requirePreferredPm() {
|
|
|
23492
23271
|
try {
|
|
23493
23272
|
const workspaceRoot = findYarnWorkspaceRoot(pkgPath);
|
|
23494
23273
|
if (typeof workspaceRoot == "string")
|
|
23495
|
-
return
|
|
23274
|
+
return fs2.existsSync(path2.join(workspaceRoot, "package-lock.json")) ? {
|
|
23496
23275
|
name: "npm",
|
|
23497
23276
|
version: ">=7"
|
|
23498
23277
|
} : {
|
|
@@ -23884,9 +23663,9 @@ function requireGitconfiglocal() {
|
|
|
23884
23663
|
options2.gitDir || process.env.GIT_DIR || ".git",
|
|
23885
23664
|
"config"
|
|
23886
23665
|
);
|
|
23887
|
-
return await
|
|
23666
|
+
return await pathExists(folder) ? folder : dir === path2.resolve(dir, "..") ? !1 : findGit(path2.resolve(dir, ".."), options2);
|
|
23888
23667
|
}
|
|
23889
|
-
function
|
|
23668
|
+
function pathExists(filePath) {
|
|
23890
23669
|
return fs2.access(filePath).then(
|
|
23891
23670
|
() => !0,
|
|
23892
23671
|
() => !1
|