@sanity/cli 3.45.1-add-input-error-boundary.14 → 3.45.1-canary.14
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 +5 -5
package/lib/_chunks-cjs/cli.js
CHANGED
@@ -18371,13 +18371,17 @@ const CLIInitStepCompleted = telemetry.defineTrace({
|
|
18371
18371
|
var core$3 = {}, utils$a = {};
|
18372
18372
|
(function(exports2) {
|
18373
18373
|
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) => {
|
18374
|
-
|
18374
|
+
const node2 = block.nodes[n];
|
18375
18375
|
node2 && (type2 && node2.type === type2 || node2.type === "open" || node2.type === "close") && node2.escaped !== !0 && (node2.value = "\\" + node2.value, node2.escaped = !0);
|
18376
18376
|
}, 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) => {
|
18377
18377
|
const result = [], flat = (arr) => {
|
18378
18378
|
for (let i2 = 0; i2 < arr.length; i2++) {
|
18379
|
-
|
18380
|
-
Array.isArray(ele)
|
18379
|
+
const ele = arr[i2];
|
18380
|
+
if (Array.isArray(ele)) {
|
18381
|
+
flat(ele);
|
18382
|
+
continue;
|
18383
|
+
}
|
18384
|
+
ele !== void 0 && result.push(ele);
|
18381
18385
|
}
|
18382
18386
|
return result;
|
18383
18387
|
};
|
@@ -18386,14 +18390,15 @@ var core$3 = {}, utils$a = {};
|
|
18386
18390
|
})(utils$a);
|
18387
18391
|
const utils$9 = utils$a;
|
18388
18392
|
var stringify$4 = (ast, options2 = {}) => {
|
18389
|
-
|
18390
|
-
|
18393
|
+
const stringify3 = (node2, parent = {}) => {
|
18394
|
+
const invalidBlock = options2.escapeInvalid && utils$9.isInvalidBrace(parent), invalidNode = node2.invalid === !0 && options2.escapeInvalid === !0;
|
18395
|
+
let output = "";
|
18391
18396
|
if (node2.value)
|
18392
18397
|
return (invalidBlock || invalidNode) && utils$9.isOpenOrClose(node2) ? "\\" + node2.value : node2.value;
|
18393
18398
|
if (node2.value)
|
18394
18399
|
return node2.value;
|
18395
18400
|
if (node2.nodes)
|
18396
|
-
for (
|
18401
|
+
for (const child of node2.nodes)
|
18397
18402
|
output += stringify3(child);
|
18398
18403
|
return output;
|
18399
18404
|
};
|
@@ -18546,10 +18551,10 @@ const util$3 = require$$0__default$5.default, toRegexRange = toRegexRange_1, isO
|
|
18546
18551
|
let negative = input2[0] === "-" ? "-" : "";
|
18547
18552
|
for (negative && (input2 = input2.slice(1), maxLength--); input2.length < maxLength; ) input2 = "0" + input2;
|
18548
18553
|
return negative ? "-" + input2 : input2;
|
18549
|
-
}, toSequence = (parts, options2) => {
|
18554
|
+
}, toSequence = (parts, options2, maxLen) => {
|
18550
18555
|
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0), parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
18551
18556
|
let prefix = options2.capture ? "" : "?:", positives = "", negatives = "", result;
|
18552
|
-
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;
|
18557
|
+
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;
|
18553
18558
|
}, toRange = (a, b, isNumbers, options2) => {
|
18554
18559
|
if (isNumbers)
|
18555
18560
|
return toRegexRange(a, b, { wrap: !1, ...options2 });
|
@@ -18585,7 +18590,7 @@ const util$3 = require$$0__default$5.default, toRegexRange = toRegexRange_1, isO
|
|
18585
18590
|
let parts = { negatives: [], positives: [] }, push2 = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num)), range2 = [], index = 0;
|
18586
18591
|
for (; descending ? a >= b : a <= b; )
|
18587
18592
|
options2.toRegex === !0 && step > 1 ? push2(a) : range2.push(pad(format2(a, index), maxLen, toNumber)), a = descending ? a - step : a + step, index++;
|
18588
|
-
return options2.toRegex === !0 ? step > 1 ? toSequence(parts, options2) : toRegex(range2, null, { wrap: !1, ...options2 }) : range2;
|
18593
|
+
return options2.toRegex === !0 ? step > 1 ? toSequence(parts, options2, maxLen) : toRegex(range2, null, { wrap: !1, ...options2 }) : range2;
|
18589
18594
|
}, fillLetters = (start, end2, step = 1, options2 = {}) => {
|
18590
18595
|
if (!isNumber(start) && start.length > 1 || !isNumber(end2) && end2.length > 1)
|
18591
18596
|
return invalidRange(start, end2, options2);
|
@@ -18610,10 +18615,13 @@ const util$3 = require$$0__default$5.default, toRegexRange = toRegexRange_1, isO
|
|
18610
18615
|
};
|
18611
18616
|
var fillRange = fill$2;
|
18612
18617
|
const fill$1 = fillRange, utils$8 = utils$a, compile$1 = (ast, options2 = {}) => {
|
18613
|
-
|
18614
|
-
|
18615
|
-
|
18618
|
+
const walk = (node2, parent = {}) => {
|
18619
|
+
const invalidBlock = utils$8.isInvalidBrace(parent), invalidNode = node2.invalid === !0 && options2.escapeInvalid === !0, invalid = invalidBlock === !0 || invalidNode === !0, prefix = options2.escapeInvalid === !0 ? "\\" : "";
|
18620
|
+
let output = "";
|
18621
|
+
if (node2.isOpen === !0)
|
18616
18622
|
return prefix + node2.value;
|
18623
|
+
if (node2.isClose === !0)
|
18624
|
+
return console.log("node.isClose", prefix, node2.value), prefix + node2.value;
|
18617
18625
|
if (node2.type === "open")
|
18618
18626
|
return invalid ? prefix + node2.value : "(";
|
18619
18627
|
if (node2.type === "close")
|
@@ -18623,12 +18631,12 @@ const fill$1 = fillRange, utils$8 = utils$a, compile$1 = (ast, options2 = {}) =>
|
|
18623
18631
|
if (node2.value)
|
18624
18632
|
return node2.value;
|
18625
18633
|
if (node2.nodes && node2.ranges > 0) {
|
18626
|
-
|
18634
|
+
const args = utils$8.reduce(node2.nodes), range2 = fill$1(...args, { ...options2, wrap: !1, toRegex: !0, strictZeros: !0 });
|
18627
18635
|
if (range2.length !== 0)
|
18628
18636
|
return args.length > 1 && range2.length > 1 ? `(${range2})` : range2;
|
18629
18637
|
}
|
18630
18638
|
if (node2.nodes)
|
18631
|
-
for (
|
18639
|
+
for (const child of node2.nodes)
|
18632
18640
|
output += walk(child, node2);
|
18633
18641
|
return output;
|
18634
18642
|
};
|
@@ -18636,20 +18644,20 @@ const fill$1 = fillRange, utils$8 = utils$a, compile$1 = (ast, options2 = {}) =>
|
|
18636
18644
|
};
|
18637
18645
|
var compile_1 = compile$1;
|
18638
18646
|
const fill = fillRange, stringify$2 = stringify$4, utils$7 = utils$a, append = (queue2 = "", stash = "", enclose = !1) => {
|
18639
|
-
|
18647
|
+
const result = [];
|
18640
18648
|
if (queue2 = [].concat(queue2), stash = [].concat(stash), !stash.length) return queue2;
|
18641
18649
|
if (!queue2.length)
|
18642
18650
|
return enclose ? utils$7.flatten(stash).map((ele) => `{${ele}}`) : stash;
|
18643
|
-
for (
|
18651
|
+
for (const item of queue2)
|
18644
18652
|
if (Array.isArray(item))
|
18645
|
-
for (
|
18653
|
+
for (const value of item)
|
18646
18654
|
result.push(append(value, stash, enclose));
|
18647
18655
|
else
|
18648
18656
|
for (let ele of stash)
|
18649
18657
|
enclose === !0 && typeof ele == "string" && (ele = `{${ele}}`), result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
18650
18658
|
return utils$7.flatten(result);
|
18651
18659
|
}, expand$3 = (ast, options2 = {}) => {
|
18652
|
-
|
18660
|
+
const rangeLimit = options2.rangeLimit === void 0 ? 1e3 : options2.rangeLimit, walk = (node2, parent = {}) => {
|
18653
18661
|
node2.queue = [];
|
18654
18662
|
let p = parent, q = parent.queue;
|
18655
18663
|
for (; p.type !== "brace" && p.type !== "root" && p.parent; )
|
@@ -18663,18 +18671,19 @@ const fill = fillRange, stringify$2 = stringify$4, utils$7 = utils$a, append = (
|
|
18663
18671
|
return;
|
18664
18672
|
}
|
18665
18673
|
if (node2.nodes && node2.ranges > 0) {
|
18666
|
-
|
18674
|
+
const args = utils$7.reduce(node2.nodes);
|
18667
18675
|
if (utils$7.exceedsLimit(...args, options2.step, rangeLimit))
|
18668
18676
|
throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
18669
18677
|
let range2 = fill(...args, options2);
|
18670
18678
|
range2.length === 0 && (range2 = stringify$2(node2, options2)), q.push(append(q.pop(), range2)), node2.nodes = [];
|
18671
18679
|
return;
|
18672
18680
|
}
|
18673
|
-
|
18681
|
+
const enclose = utils$7.encloseBrace(node2);
|
18682
|
+
let queue2 = node2.queue, block = node2;
|
18674
18683
|
for (; block.type !== "brace" && block.type !== "root" && block.parent; )
|
18675
18684
|
block = block.parent, queue2 = block.queue;
|
18676
18685
|
for (let i2 = 0; i2 < node2.nodes.length; i2++) {
|
18677
|
-
|
18686
|
+
const child = node2.nodes[i2];
|
18678
18687
|
if (child.type === "comma" && node2.type === "brace") {
|
18679
18688
|
i2 === 1 && queue2.push(""), queue2.push("");
|
18680
18689
|
continue;
|
@@ -18694,7 +18703,7 @@ const fill = fillRange, stringify$2 = stringify$4, utils$7 = utils$a, append = (
|
|
18694
18703
|
return utils$7.flatten(walk(ast));
|
18695
18704
|
};
|
18696
18705
|
var expand_1 = expand$3, constants$3 = {
|
18697
|
-
MAX_LENGTH:
|
18706
|
+
MAX_LENGTH: 1e4,
|
18698
18707
|
// Digits
|
18699
18708
|
CHAR_0: "0",
|
18700
18709
|
/* 0 */
|
@@ -18819,10 +18828,13 @@ const stringify$1 = stringify$4, {
|
|
18819
18828
|
} = constants$3, parse$7 = (input2, options2 = {}) => {
|
18820
18829
|
if (typeof input2 != "string")
|
18821
18830
|
throw new TypeError("Expected a string");
|
18822
|
-
|
18831
|
+
const opts = options2 || {}, max2 = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
|
18823
18832
|
if (input2.length > max2)
|
18824
18833
|
throw new SyntaxError(`Input length (${input2.length}), exceeds max characters (${max2})`);
|
18825
|
-
|
18834
|
+
const ast = { type: "root", input: input2, nodes: [] }, stack2 = [ast];
|
18835
|
+
let block = ast, prev = ast, brackets = 0;
|
18836
|
+
const length = input2.length;
|
18837
|
+
let index = 0, depth2 = 0, value;
|
18826
18838
|
const advance = () => input2[index++], push2 = (node2) => {
|
18827
18839
|
if (node2.type === "text" && prev.type === "dot" && (prev.type = "text"), prev && prev.type === "text" && node2.type === "text") {
|
18828
18840
|
prev.value += node2.value;
|
@@ -18871,7 +18883,8 @@ const stringify$1 = stringify$4, {
|
|
18871
18883
|
continue;
|
18872
18884
|
}
|
18873
18885
|
if (value === CHAR_DOUBLE_QUOTE$1 || value === CHAR_SINGLE_QUOTE$1 || value === CHAR_BACKTICK) {
|
18874
|
-
|
18886
|
+
const open2 = value;
|
18887
|
+
let next;
|
18875
18888
|
for (options2.keepQuotes !== !0 && (value = ""); index < length && (next = advance()); ) {
|
18876
18889
|
if (next === CHAR_BACKSLASH) {
|
18877
18890
|
value += next + advance();
|
@@ -18888,7 +18901,7 @@ const stringify$1 = stringify$4, {
|
|
18888
18901
|
}
|
18889
18902
|
if (value === CHAR_LEFT_CURLY_BRACE$1) {
|
18890
18903
|
depth2++;
|
18891
|
-
|
18904
|
+
const brace = {
|
18892
18905
|
type: "brace",
|
18893
18906
|
open: !0,
|
18894
18907
|
close: !1,
|
@@ -18906,21 +18919,21 @@ const stringify$1 = stringify$4, {
|
|
18906
18919
|
push2({ type: "text", value });
|
18907
18920
|
continue;
|
18908
18921
|
}
|
18909
|
-
|
18922
|
+
const type2 = "close";
|
18910
18923
|
block = stack2.pop(), block.close = !0, push2({ type: type2, value }), depth2--, block = stack2[stack2.length - 1];
|
18911
18924
|
continue;
|
18912
18925
|
}
|
18913
18926
|
if (value === CHAR_COMMA$2 && depth2 > 0) {
|
18914
18927
|
if (block.ranges > 0) {
|
18915
18928
|
block.ranges = 0;
|
18916
|
-
|
18929
|
+
const open2 = block.nodes.shift();
|
18917
18930
|
block.nodes = [open2, { type: "text", value: stringify$1(block) }];
|
18918
18931
|
}
|
18919
18932
|
push2({ type: "comma", value }), block.commas++;
|
18920
18933
|
continue;
|
18921
18934
|
}
|
18922
18935
|
if (value === CHAR_DOT$1 && depth2 > 0 && block.commas === 0) {
|
18923
|
-
|
18936
|
+
const siblings = block.nodes;
|
18924
18937
|
if (depth2 === 0 || siblings.length === 0) {
|
18925
18938
|
push2({ type: "text", value });
|
18926
18939
|
continue;
|
@@ -18935,7 +18948,7 @@ const stringify$1 = stringify$4, {
|
|
18935
18948
|
}
|
18936
18949
|
if (prev.type === "range") {
|
18937
18950
|
siblings.pop();
|
18938
|
-
|
18951
|
+
const before = siblings[siblings.length - 1];
|
18939
18952
|
before.value += prev.value + value, prev = before, block.ranges--;
|
18940
18953
|
continue;
|
18941
18954
|
}
|
@@ -18949,7 +18962,7 @@ const stringify$1 = stringify$4, {
|
|
18949
18962
|
block.nodes.forEach((node2) => {
|
18950
18963
|
node2.nodes || (node2.type === "open" && (node2.isOpen = !0), node2.type === "close" && (node2.isClose = !0), node2.nodes || (node2.type = "text"), node2.invalid = !0);
|
18951
18964
|
});
|
18952
|
-
|
18965
|
+
const parent = stack2[stack2.length - 1], index2 = parent.nodes.indexOf(block);
|
18953
18966
|
parent.nodes.splice(index2, 1, ...block.nodes);
|
18954
18967
|
}
|
18955
18968
|
while (stack2.length > 0);
|
@@ -18959,8 +18972,8 @@ var parse_1$2 = parse$7;
|
|
18959
18972
|
const stringify = stringify$4, compile = compile_1, expand$2 = expand_1, parse$6 = parse_1$2, braces$1 = (input2, options2 = {}) => {
|
18960
18973
|
let output = [];
|
18961
18974
|
if (Array.isArray(input2))
|
18962
|
-
for (
|
18963
|
-
|
18975
|
+
for (const pattern of input2) {
|
18976
|
+
const result = braces$1.create(pattern, options2);
|
18964
18977
|
Array.isArray(result) ? output.push(...result) : output.push(result);
|
18965
18978
|
}
|
18966
18979
|
else
|
@@ -22917,15 +22930,20 @@ function __await(v) {
|
|
22917
22930
|
function __asyncGenerator(thisArg, _arguments, generator) {
|
22918
22931
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
22919
22932
|
var g = generator.apply(thisArg, _arguments || []), i2, q = [];
|
22920
|
-
return i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() {
|
22933
|
+
return i2 = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i2[Symbol.asyncIterator] = function() {
|
22921
22934
|
return this;
|
22922
22935
|
}, i2;
|
22923
|
-
function
|
22936
|
+
function awaitReturn(f2) {
|
22937
|
+
return function(v) {
|
22938
|
+
return Promise.resolve(v).then(f2, reject);
|
22939
|
+
};
|
22940
|
+
}
|
22941
|
+
function verb(n, f2) {
|
22924
22942
|
g[n] && (i2[n] = function(v) {
|
22925
22943
|
return new Promise(function(a, b) {
|
22926
22944
|
q.push([n, v, a, b]) > 1 || resume(n, v);
|
22927
22945
|
});
|
22928
|
-
});
|
22946
|
+
}, f2 && (i2[n] = f2(i2[n])));
|
22929
22947
|
}
|
22930
22948
|
function resume(n, v) {
|
22931
22949
|
try {
|
@@ -23014,17 +23032,23 @@ function __classPrivateFieldIn(state2, receiver) {
|
|
23014
23032
|
function __addDisposableResource(env, value, async2) {
|
23015
23033
|
if (value != null) {
|
23016
23034
|
if (typeof value != "object" && typeof value != "function") throw new TypeError("Object expected.");
|
23017
|
-
var dispose;
|
23035
|
+
var dispose, inner;
|
23018
23036
|
if (async2) {
|
23019
23037
|
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
23020
23038
|
dispose = value[Symbol.asyncDispose];
|
23021
23039
|
}
|
23022
23040
|
if (dispose === void 0) {
|
23023
23041
|
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
23024
|
-
dispose = value[Symbol.dispose];
|
23042
|
+
dispose = value[Symbol.dispose], async2 && (inner = dispose);
|
23025
23043
|
}
|
23026
23044
|
if (typeof dispose != "function") throw new TypeError("Object not disposable.");
|
23027
|
-
|
23045
|
+
inner && (dispose = function() {
|
23046
|
+
try {
|
23047
|
+
inner.call(this);
|
23048
|
+
} catch (e) {
|
23049
|
+
return Promise.reject(e);
|
23050
|
+
}
|
23051
|
+
}), env.stack.push({ value, dispose, async: async2 });
|
23028
23052
|
} else async2 && env.stack.push({ async: !0 });
|
23029
23053
|
return value;
|
23030
23054
|
}
|