@sanity/cli 3.46.0 → 3.47.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 +63 -39
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/package.json +6 -6
package/lib/_chunks-cjs/cli.js
CHANGED
@@ -18391,13 +18391,17 @@ const CLIInitStepCompleted = telemetry.defineTrace({
|
|
18391
18391
|
var core$3 = {}, utils$a = {};
|
18392
18392
|
(function(exports2) {
|
18393
18393
|
exports2.isInteger = (num) => typeof num == "number" ? Number.isInteger(num) : typeof num == "string" && num.trim() !== "" ? Number.isInteger(Number(num)) : !1, exports2.find = (node2, type2) => node2.nodes.find((node3) => node3.type === type2), exports2.exceedsLimit = (min2, max2, step = 1, limit) => limit === !1 || !exports2.isInteger(min2) || !exports2.isInteger(max2) ? !1 : (Number(max2) - Number(min2)) / Number(step) >= limit, exports2.escapeNode = (block, n = 0, type2) => {
|
18394
|
-
|
18394
|
+
const node2 = block.nodes[n];
|
18395
18395
|
node2 && (type2 && node2.type === type2 || node2.type === "open" || node2.type === "close") && node2.escaped !== !0 && (node2.value = "\\" + node2.value, node2.escaped = !0);
|
18396
18396
|
}, exports2.encloseBrace = (node2) => node2.type !== "brace" || node2.commas >> 0 + node2.ranges >> 0 ? !1 : (node2.invalid = !0, !0), exports2.isInvalidBrace = (block) => block.type !== "brace" ? !1 : block.invalid === !0 || block.dollar ? !0 : !(block.commas >> 0 + block.ranges >> 0) || block.open !== !0 || block.close !== !0 ? (block.invalid = !0, !0) : !1, exports2.isOpenOrClose = (node2) => node2.type === "open" || node2.type === "close" ? !0 : node2.open === !0 || node2.close === !0, exports2.reduce = (nodes) => nodes.reduce((acc, node2) => (node2.type === "text" && acc.push(node2.value), node2.type === "range" && (node2.type = "text"), acc), []), exports2.flatten = (...args) => {
|
18397
18397
|
const result = [], flat = (arr) => {
|
18398
18398
|
for (let i2 = 0; i2 < arr.length; i2++) {
|
18399
|
-
|
18400
|
-
Array.isArray(ele)
|
18399
|
+
const ele = arr[i2];
|
18400
|
+
if (Array.isArray(ele)) {
|
18401
|
+
flat(ele);
|
18402
|
+
continue;
|
18403
|
+
}
|
18404
|
+
ele !== void 0 && result.push(ele);
|
18401
18405
|
}
|
18402
18406
|
return result;
|
18403
18407
|
};
|
@@ -18406,14 +18410,15 @@ var core$3 = {}, utils$a = {};
|
|
18406
18410
|
})(utils$a);
|
18407
18411
|
const utils$9 = utils$a;
|
18408
18412
|
var stringify$4 = (ast, options2 = {}) => {
|
18409
|
-
|
18410
|
-
|
18413
|
+
const stringify3 = (node2, parent = {}) => {
|
18414
|
+
const invalidBlock = options2.escapeInvalid && utils$9.isInvalidBrace(parent), invalidNode = node2.invalid === !0 && options2.escapeInvalid === !0;
|
18415
|
+
let output = "";
|
18411
18416
|
if (node2.value)
|
18412
18417
|
return (invalidBlock || invalidNode) && utils$9.isOpenOrClose(node2) ? "\\" + node2.value : node2.value;
|
18413
18418
|
if (node2.value)
|
18414
18419
|
return node2.value;
|
18415
18420
|
if (node2.nodes)
|
18416
|
-
for (
|
18421
|
+
for (const child of node2.nodes)
|
18417
18422
|
output += stringify3(child);
|
18418
18423
|
return output;
|
18419
18424
|
};
|
@@ -18566,10 +18571,10 @@ const util$3 = require$$0__default$5.default, toRegexRange = toRegexRange_1, isO
|
|
18566
18571
|
let negative = input2[0] === "-" ? "-" : "";
|
18567
18572
|
for (negative && (input2 = input2.slice(1), maxLength--); input2.length < maxLength; ) input2 = "0" + input2;
|
18568
18573
|
return negative ? "-" + input2 : input2;
|
18569
|
-
}, toSequence = (parts, options2) => {
|
18574
|
+
}, toSequence = (parts, options2, maxLen) => {
|
18570
18575
|
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0), parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
18571
18576
|
let prefix = options2.capture ? "" : "?:", positives = "", negatives = "", result;
|
18572
|
-
return parts.positives.length && (positives = parts.positives.join("|")), parts.negatives.length && (negatives = `-(${prefix}${parts.negatives.join("|")})`), positives && negatives ? result = `${positives}|${negatives}` : result = positives || negatives, options2.wrap ? `(${prefix}${result})` : result;
|
18577
|
+
return parts.positives.length && (positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|")), parts.negatives.length && (negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`), positives && negatives ? result = `${positives}|${negatives}` : result = positives || negatives, options2.wrap ? `(${prefix}${result})` : result;
|
18573
18578
|
}, toRange = (a, b, isNumbers, options2) => {
|
18574
18579
|
if (isNumbers)
|
18575
18580
|
return toRegexRange(a, b, { wrap: !1, ...options2 });
|
@@ -18605,7 +18610,7 @@ const util$3 = require$$0__default$5.default, toRegexRange = toRegexRange_1, isO
|
|
18605
18610
|
let parts = { negatives: [], positives: [] }, push2 = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num)), range2 = [], index = 0;
|
18606
18611
|
for (; descending ? a >= b : a <= b; )
|
18607
18612
|
options2.toRegex === !0 && step > 1 ? push2(a) : range2.push(pad(format2(a, index), maxLen, toNumber)), a = descending ? a - step : a + step, index++;
|
18608
|
-
return options2.toRegex === !0 ? step > 1 ? toSequence(parts, options2) : toRegex(range2, null, { wrap: !1, ...options2 }) : range2;
|
18613
|
+
return options2.toRegex === !0 ? step > 1 ? toSequence(parts, options2, maxLen) : toRegex(range2, null, { wrap: !1, ...options2 }) : range2;
|
18609
18614
|
}, fillLetters = (start, end2, step = 1, options2 = {}) => {
|
18610
18615
|
if (!isNumber(start) && start.length > 1 || !isNumber(end2) && end2.length > 1)
|
18611
18616
|
return invalidRange(start, end2, options2);
|
@@ -18630,10 +18635,13 @@ const util$3 = require$$0__default$5.default, toRegexRange = toRegexRange_1, isO
|
|
18630
18635
|
};
|
18631
18636
|
var fillRange = fill$2;
|
18632
18637
|
const fill$1 = fillRange, utils$8 = utils$a, compile$1 = (ast, options2 = {}) => {
|
18633
|
-
|
18634
|
-
|
18635
|
-
|
18638
|
+
const walk = (node2, parent = {}) => {
|
18639
|
+
const invalidBlock = utils$8.isInvalidBrace(parent), invalidNode = node2.invalid === !0 && options2.escapeInvalid === !0, invalid = invalidBlock === !0 || invalidNode === !0, prefix = options2.escapeInvalid === !0 ? "\\" : "";
|
18640
|
+
let output = "";
|
18641
|
+
if (node2.isOpen === !0)
|
18636
18642
|
return prefix + node2.value;
|
18643
|
+
if (node2.isClose === !0)
|
18644
|
+
return console.log("node.isClose", prefix, node2.value), prefix + node2.value;
|
18637
18645
|
if (node2.type === "open")
|
18638
18646
|
return invalid ? prefix + node2.value : "(";
|
18639
18647
|
if (node2.type === "close")
|
@@ -18643,12 +18651,12 @@ const fill$1 = fillRange, utils$8 = utils$a, compile$1 = (ast, options2 = {}) =>
|
|
18643
18651
|
if (node2.value)
|
18644
18652
|
return node2.value;
|
18645
18653
|
if (node2.nodes && node2.ranges > 0) {
|
18646
|
-
|
18654
|
+
const args = utils$8.reduce(node2.nodes), range2 = fill$1(...args, { ...options2, wrap: !1, toRegex: !0, strictZeros: !0 });
|
18647
18655
|
if (range2.length !== 0)
|
18648
18656
|
return args.length > 1 && range2.length > 1 ? `(${range2})` : range2;
|
18649
18657
|
}
|
18650
18658
|
if (node2.nodes)
|
18651
|
-
for (
|
18659
|
+
for (const child of node2.nodes)
|
18652
18660
|
output += walk(child, node2);
|
18653
18661
|
return output;
|
18654
18662
|
};
|
@@ -18656,20 +18664,20 @@ const fill$1 = fillRange, utils$8 = utils$a, compile$1 = (ast, options2 = {}) =>
|
|
18656
18664
|
};
|
18657
18665
|
var compile_1 = compile$1;
|
18658
18666
|
const fill = fillRange, stringify$2 = stringify$4, utils$7 = utils$a, append = (queue2 = "", stash = "", enclose = !1) => {
|
18659
|
-
|
18667
|
+
const result = [];
|
18660
18668
|
if (queue2 = [].concat(queue2), stash = [].concat(stash), !stash.length) return queue2;
|
18661
18669
|
if (!queue2.length)
|
18662
18670
|
return enclose ? utils$7.flatten(stash).map((ele) => `{${ele}}`) : stash;
|
18663
|
-
for (
|
18671
|
+
for (const item of queue2)
|
18664
18672
|
if (Array.isArray(item))
|
18665
|
-
for (
|
18673
|
+
for (const value of item)
|
18666
18674
|
result.push(append(value, stash, enclose));
|
18667
18675
|
else
|
18668
18676
|
for (let ele of stash)
|
18669
18677
|
enclose === !0 && typeof ele == "string" && (ele = `{${ele}}`), result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
18670
18678
|
return utils$7.flatten(result);
|
18671
18679
|
}, expand$3 = (ast, options2 = {}) => {
|
18672
|
-
|
18680
|
+
const rangeLimit = options2.rangeLimit === void 0 ? 1e3 : options2.rangeLimit, walk = (node2, parent = {}) => {
|
18673
18681
|
node2.queue = [];
|
18674
18682
|
let p = parent, q = parent.queue;
|
18675
18683
|
for (; p.type !== "brace" && p.type !== "root" && p.parent; )
|
@@ -18683,18 +18691,19 @@ const fill = fillRange, stringify$2 = stringify$4, utils$7 = utils$a, append = (
|
|
18683
18691
|
return;
|
18684
18692
|
}
|
18685
18693
|
if (node2.nodes && node2.ranges > 0) {
|
18686
|
-
|
18694
|
+
const args = utils$7.reduce(node2.nodes);
|
18687
18695
|
if (utils$7.exceedsLimit(...args, options2.step, rangeLimit))
|
18688
18696
|
throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
18689
18697
|
let range2 = fill(...args, options2);
|
18690
18698
|
range2.length === 0 && (range2 = stringify$2(node2, options2)), q.push(append(q.pop(), range2)), node2.nodes = [];
|
18691
18699
|
return;
|
18692
18700
|
}
|
18693
|
-
|
18701
|
+
const enclose = utils$7.encloseBrace(node2);
|
18702
|
+
let queue2 = node2.queue, block = node2;
|
18694
18703
|
for (; block.type !== "brace" && block.type !== "root" && block.parent; )
|
18695
18704
|
block = block.parent, queue2 = block.queue;
|
18696
18705
|
for (let i2 = 0; i2 < node2.nodes.length; i2++) {
|
18697
|
-
|
18706
|
+
const child = node2.nodes[i2];
|
18698
18707
|
if (child.type === "comma" && node2.type === "brace") {
|
18699
18708
|
i2 === 1 && queue2.push(""), queue2.push("");
|
18700
18709
|
continue;
|
@@ -18714,7 +18723,7 @@ const fill = fillRange, stringify$2 = stringify$4, utils$7 = utils$a, append = (
|
|
18714
18723
|
return utils$7.flatten(walk(ast));
|
18715
18724
|
};
|
18716
18725
|
var expand_1 = expand$3, constants$3 = {
|
18717
|
-
MAX_LENGTH:
|
18726
|
+
MAX_LENGTH: 1e4,
|
18718
18727
|
// Digits
|
18719
18728
|
CHAR_0: "0",
|
18720
18729
|
/* 0 */
|
@@ -18839,10 +18848,13 @@ const stringify$1 = stringify$4, {
|
|
18839
18848
|
} = constants$3, parse$7 = (input2, options2 = {}) => {
|
18840
18849
|
if (typeof input2 != "string")
|
18841
18850
|
throw new TypeError("Expected a string");
|
18842
|
-
|
18851
|
+
const opts = options2 || {}, max2 = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
|
18843
18852
|
if (input2.length > max2)
|
18844
18853
|
throw new SyntaxError(`Input length (${input2.length}), exceeds max characters (${max2})`);
|
18845
|
-
|
18854
|
+
const ast = { type: "root", input: input2, nodes: [] }, stack2 = [ast];
|
18855
|
+
let block = ast, prev = ast, brackets = 0;
|
18856
|
+
const length = input2.length;
|
18857
|
+
let index = 0, depth2 = 0, value;
|
18846
18858
|
const advance = () => input2[index++], push2 = (node2) => {
|
18847
18859
|
if (node2.type === "text" && prev.type === "dot" && (prev.type = "text"), prev && prev.type === "text" && node2.type === "text") {
|
18848
18860
|
prev.value += node2.value;
|
@@ -18891,7 +18903,8 @@ const stringify$1 = stringify$4, {
|
|
18891
18903
|
continue;
|
18892
18904
|
}
|
18893
18905
|
if (value === CHAR_DOUBLE_QUOTE$1 || value === CHAR_SINGLE_QUOTE$1 || value === CHAR_BACKTICK) {
|
18894
|
-
|
18906
|
+
const open2 = value;
|
18907
|
+
let next;
|
18895
18908
|
for (options2.keepQuotes !== !0 && (value = ""); index < length && (next = advance()); ) {
|
18896
18909
|
if (next === CHAR_BACKSLASH) {
|
18897
18910
|
value += next + advance();
|
@@ -18908,7 +18921,7 @@ const stringify$1 = stringify$4, {
|
|
18908
18921
|
}
|
18909
18922
|
if (value === CHAR_LEFT_CURLY_BRACE$1) {
|
18910
18923
|
depth2++;
|
18911
|
-
|
18924
|
+
const brace = {
|
18912
18925
|
type: "brace",
|
18913
18926
|
open: !0,
|
18914
18927
|
close: !1,
|
@@ -18926,21 +18939,21 @@ const stringify$1 = stringify$4, {
|
|
18926
18939
|
push2({ type: "text", value });
|
18927
18940
|
continue;
|
18928
18941
|
}
|
18929
|
-
|
18942
|
+
const type2 = "close";
|
18930
18943
|
block = stack2.pop(), block.close = !0, push2({ type: type2, value }), depth2--, block = stack2[stack2.length - 1];
|
18931
18944
|
continue;
|
18932
18945
|
}
|
18933
18946
|
if (value === CHAR_COMMA$2 && depth2 > 0) {
|
18934
18947
|
if (block.ranges > 0) {
|
18935
18948
|
block.ranges = 0;
|
18936
|
-
|
18949
|
+
const open2 = block.nodes.shift();
|
18937
18950
|
block.nodes = [open2, { type: "text", value: stringify$1(block) }];
|
18938
18951
|
}
|
18939
18952
|
push2({ type: "comma", value }), block.commas++;
|
18940
18953
|
continue;
|
18941
18954
|
}
|
18942
18955
|
if (value === CHAR_DOT$1 && depth2 > 0 && block.commas === 0) {
|
18943
|
-
|
18956
|
+
const siblings = block.nodes;
|
18944
18957
|
if (depth2 === 0 || siblings.length === 0) {
|
18945
18958
|
push2({ type: "text", value });
|
18946
18959
|
continue;
|
@@ -18955,7 +18968,7 @@ const stringify$1 = stringify$4, {
|
|
18955
18968
|
}
|
18956
18969
|
if (prev.type === "range") {
|
18957
18970
|
siblings.pop();
|
18958
|
-
|
18971
|
+
const before = siblings[siblings.length - 1];
|
18959
18972
|
before.value += prev.value + value, prev = before, block.ranges--;
|
18960
18973
|
continue;
|
18961
18974
|
}
|
@@ -18969,7 +18982,7 @@ const stringify$1 = stringify$4, {
|
|
18969
18982
|
block.nodes.forEach((node2) => {
|
18970
18983
|
node2.nodes || (node2.type === "open" && (node2.isOpen = !0), node2.type === "close" && (node2.isClose = !0), node2.nodes || (node2.type = "text"), node2.invalid = !0);
|
18971
18984
|
});
|
18972
|
-
|
18985
|
+
const parent = stack2[stack2.length - 1], index2 = parent.nodes.indexOf(block);
|
18973
18986
|
parent.nodes.splice(index2, 1, ...block.nodes);
|
18974
18987
|
}
|
18975
18988
|
while (stack2.length > 0);
|
@@ -18979,8 +18992,8 @@ var parse_1$2 = parse$7;
|
|
18979
18992
|
const stringify = stringify$4, compile = compile_1, expand$2 = expand_1, parse$6 = parse_1$2, braces$1 = (input2, options2 = {}) => {
|
18980
18993
|
let output = [];
|
18981
18994
|
if (Array.isArray(input2))
|
18982
|
-
for (
|
18983
|
-
|
18995
|
+
for (const pattern of input2) {
|
18996
|
+
const result = braces$1.create(pattern, options2);
|
18984
18997
|
Array.isArray(result) ? output.push(...result) : output.push(result);
|
18985
18998
|
}
|
18986
18999
|
else
|
@@ -22937,15 +22950,20 @@ function __await(v) {
|
|
22937
22950
|
function __asyncGenerator(thisArg, _arguments, generator) {
|
22938
22951
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
22939
22952
|
var g = generator.apply(thisArg, _arguments || []), i2, q = [];
|
22940
|
-
return i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() {
|
22953
|
+
return i2 = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i2[Symbol.asyncIterator] = function() {
|
22941
22954
|
return this;
|
22942
22955
|
}, i2;
|
22943
|
-
function
|
22956
|
+
function awaitReturn(f2) {
|
22957
|
+
return function(v) {
|
22958
|
+
return Promise.resolve(v).then(f2, reject);
|
22959
|
+
};
|
22960
|
+
}
|
22961
|
+
function verb(n, f2) {
|
22944
22962
|
g[n] && (i2[n] = function(v) {
|
22945
22963
|
return new Promise(function(a, b) {
|
22946
22964
|
q.push([n, v, a, b]) > 1 || resume(n, v);
|
22947
22965
|
});
|
22948
|
-
});
|
22966
|
+
}, f2 && (i2[n] = f2(i2[n])));
|
22949
22967
|
}
|
22950
22968
|
function resume(n, v) {
|
22951
22969
|
try {
|
@@ -23034,17 +23052,23 @@ function __classPrivateFieldIn(state2, receiver) {
|
|
23034
23052
|
function __addDisposableResource(env, value, async2) {
|
23035
23053
|
if (value != null) {
|
23036
23054
|
if (typeof value != "object" && typeof value != "function") throw new TypeError("Object expected.");
|
23037
|
-
var dispose;
|
23055
|
+
var dispose, inner;
|
23038
23056
|
if (async2) {
|
23039
23057
|
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
23040
23058
|
dispose = value[Symbol.asyncDispose];
|
23041
23059
|
}
|
23042
23060
|
if (dispose === void 0) {
|
23043
23061
|
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
23044
|
-
dispose = value[Symbol.dispose];
|
23062
|
+
dispose = value[Symbol.dispose], async2 && (inner = dispose);
|
23045
23063
|
}
|
23046
23064
|
if (typeof dispose != "function") throw new TypeError("Object not disposable.");
|
23047
|
-
|
23065
|
+
inner && (dispose = function() {
|
23066
|
+
try {
|
23067
|
+
inner.call(this);
|
23068
|
+
} catch (e) {
|
23069
|
+
return Promise.reject(e);
|
23070
|
+
}
|
23071
|
+
}), env.stack.push({ value, dispose, async: async2 });
|
23048
23072
|
} else async2 && env.stack.push({ async: !0 });
|
23049
23073
|
return value;
|
23050
23074
|
}
|