@shopify/cli-kit 2.0.10 → 2.0.13
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/CHANGELOG.md +6 -0
- package/dist/{index-8ab5821f.js → index-814fd0de.js} +186 -137
- package/dist/index-814fd0de.js.map +1 -0
- package/dist/index.d.ts +120 -141
- package/dist/index.js +1 -1
- package/dist/{multipart-parser-d7cd777b.js → multipart-parser-2aa3d069.js} +2 -2
- package/dist/{multipart-parser-d7cd777b.js.map → multipart-parser-2aa3d069.js.map} +1 -1
- package/package.json +4 -4
- package/dist/index-8ab5821f.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2190,7 +2190,7 @@ class ArrayPrompt$3 extends Prompt$5 {
|
|
|
2190
2190
|
let len = this.choices.length;
|
|
2191
2191
|
let num = this.num;
|
|
2192
2192
|
|
|
2193
|
-
let handle = (val
|
|
2193
|
+
let handle = (val, res) => {
|
|
2194
2194
|
clearTimeout(this.numberTimeout);
|
|
2195
2195
|
if (val) res = number(num);
|
|
2196
2196
|
this.num = '';
|
|
@@ -2810,7 +2810,7 @@ const utils$r = utils$z;
|
|
|
2810
2810
|
* @api public
|
|
2811
2811
|
*/
|
|
2812
2812
|
|
|
2813
|
-
var placeholder$2 = (prompt, options
|
|
2813
|
+
var placeholder$2 = (prompt, options) => {
|
|
2814
2814
|
prompt.cursorHide();
|
|
2815
2815
|
|
|
2816
2816
|
let { input = '', initial = '', pos, showCursor = true, color } = options;
|
|
@@ -4059,7 +4059,7 @@ class Item {
|
|
|
4059
4059
|
}
|
|
4060
4060
|
}
|
|
4061
4061
|
|
|
4062
|
-
const tokenize = async(options = {}, defaults
|
|
4062
|
+
const tokenize = async(options = {}, defaults, fn = token => token) => {
|
|
4063
4063
|
let unique = new Set();
|
|
4064
4064
|
let fields = options.fields || [];
|
|
4065
4065
|
let input = options.template;
|
|
@@ -5610,7 +5610,7 @@ async function pLocate$2(
|
|
|
5610
5610
|
{
|
|
5611
5611
|
concurrency = Number.POSITIVE_INFINITY,
|
|
5612
5612
|
preserveOrder = true,
|
|
5613
|
-
}
|
|
5613
|
+
},
|
|
5614
5614
|
) {
|
|
5615
5615
|
const limit = pLimit$3(concurrency);
|
|
5616
5616
|
|
|
@@ -5677,7 +5677,7 @@ const toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath)
|
|
|
5677
5677
|
|
|
5678
5678
|
const findUpStop = Symbol('findUpStop');
|
|
5679
5679
|
|
|
5680
|
-
async function findUpMultiple(name, options
|
|
5680
|
+
async function findUpMultiple(name, options) {
|
|
5681
5681
|
let directory = path$I.resolve(toPath(options.cwd) || '');
|
|
5682
5682
|
const {root} = path$I.parse(directory);
|
|
5683
5683
|
const stopAt = path$I.resolve(directory, options.stopAt || root);
|
|
@@ -6611,7 +6611,7 @@ const invalidStep = (step, options) => {
|
|
|
6611
6611
|
return [];
|
|
6612
6612
|
};
|
|
6613
6613
|
|
|
6614
|
-
const fillNumbers = (start, end, step = 1, options
|
|
6614
|
+
const fillNumbers = (start, end, step = 1, options) => {
|
|
6615
6615
|
let a = Number(start);
|
|
6616
6616
|
let b = Number(end);
|
|
6617
6617
|
|
|
@@ -6663,7 +6663,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
|
|
|
6663
6663
|
return range;
|
|
6664
6664
|
};
|
|
6665
6665
|
|
|
6666
|
-
const fillLetters = (start, end, step = 1, options
|
|
6666
|
+
const fillLetters = (start, end, step = 1, options) => {
|
|
6667
6667
|
if ((!isNumber$3(start) && start.length > 1) || (!isNumber$3(end) && end.length > 1)) {
|
|
6668
6668
|
return invalidRange(start, end, options);
|
|
6669
6669
|
}
|
|
@@ -12317,7 +12317,7 @@ var path$w = /*#__PURE__*/Object.freeze({
|
|
|
12317
12317
|
});
|
|
12318
12318
|
|
|
12319
12319
|
var name = "@shopify/cli-kit";
|
|
12320
|
-
var version$4 = "2.0.
|
|
12320
|
+
var version$4 = "2.0.13";
|
|
12321
12321
|
var description$1 = "A set of utilities, interfaces, and models that are common across all the platform features";
|
|
12322
12322
|
var keywords = [
|
|
12323
12323
|
"shopify",
|
|
@@ -12366,11 +12366,11 @@ var os$7 = [
|
|
|
12366
12366
|
];
|
|
12367
12367
|
var dependencies$1 = {
|
|
12368
12368
|
"@oclif/core": "1.7.0",
|
|
12369
|
+
envfile: "^6.17.0",
|
|
12369
12370
|
keytar: "^7.9.0",
|
|
12370
12371
|
open: "^8.4.0",
|
|
12371
12372
|
"source-map-support": "^0.5.21",
|
|
12372
|
-
stacktracey: "^2.1.8"
|
|
12373
|
-
envfile: "^6.17.0"
|
|
12373
|
+
stacktracey: "^2.1.8"
|
|
12374
12374
|
};
|
|
12375
12375
|
var devDependencies = {
|
|
12376
12376
|
"@iarna/toml": "^2.2.5",
|
|
@@ -12408,7 +12408,7 @@ var devDependencies = {
|
|
|
12408
12408
|
"term-size": "^3.0.1",
|
|
12409
12409
|
"terminal-link": "^3.0.0",
|
|
12410
12410
|
vitest: "0.10.0",
|
|
12411
|
-
zod: "^3.
|
|
12411
|
+
zod: "^3.17.3"
|
|
12412
12412
|
};
|
|
12413
12413
|
var cliKitPackageJson = {
|
|
12414
12414
|
name: name,
|
|
@@ -12432,11 +12432,11 @@ var cliKitPackageJson = {
|
|
|
12432
12432
|
devDependencies: devDependencies
|
|
12433
12433
|
};
|
|
12434
12434
|
|
|
12435
|
-
var version$3 = "2.0.
|
|
12435
|
+
var version$3 = "2.0.13";
|
|
12436
12436
|
|
|
12437
|
-
var version$2 = "2.0.
|
|
12437
|
+
var version$2 = "2.0.13";
|
|
12438
12438
|
|
|
12439
|
-
var version$1 = "2.0.
|
|
12439
|
+
var version$1 = "2.0.13";
|
|
12440
12440
|
|
|
12441
12441
|
const homedir$1 = os$8.homedir();
|
|
12442
12442
|
const tmpdir$1 = os$8.tmpdir();
|
|
@@ -13225,7 +13225,7 @@ function npmRunPath(options = {}) {
|
|
|
13225
13225
|
return [...result, path_].join(path$I.delimiter);
|
|
13226
13226
|
}
|
|
13227
13227
|
|
|
13228
|
-
function npmRunPathEnv({env = process$2.env, ...options}
|
|
13228
|
+
function npmRunPathEnv({env = process$2.env, ...options}) {
|
|
13229
13229
|
env = {...env};
|
|
13230
13230
|
|
|
13231
13231
|
const path = pathKey({env});
|
|
@@ -19029,7 +19029,7 @@ const rmkidsSync = (p, options) => {
|
|
|
19029
19029
|
var rimraf_1 = rimraf$1;
|
|
19030
19030
|
rimraf$1.sync = rimrafSync;
|
|
19031
19031
|
|
|
19032
|
-
var indentString$3 = (string, count
|
|
19032
|
+
var indentString$3 = (string, count, options) => {
|
|
19033
19033
|
options = {
|
|
19034
19034
|
indent: ' ',
|
|
19035
19035
|
includeEmptyLines: false,
|
|
@@ -21094,14 +21094,14 @@ if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
|
|
|
21094
21094
|
}
|
|
21095
21095
|
|
|
21096
21096
|
class ContentToken {
|
|
21097
|
-
constructor(value, metadata
|
|
21097
|
+
constructor(value, metadata, type) {
|
|
21098
21098
|
this.type = type;
|
|
21099
21099
|
this.value = value;
|
|
21100
21100
|
this.metadata = metadata;
|
|
21101
21101
|
}
|
|
21102
21102
|
}
|
|
21103
21103
|
const token = {
|
|
21104
|
-
|
|
21104
|
+
genericShellCommand: (value) => {
|
|
21105
21105
|
return new ContentToken(value, {}, 0 /* Command */);
|
|
21106
21106
|
},
|
|
21107
21107
|
path: (value) => {
|
|
@@ -21130,8 +21130,20 @@ const token = {
|
|
|
21130
21130
|
},
|
|
21131
21131
|
green: (value) => {
|
|
21132
21132
|
return new ContentToken(value, {}, 9 /* Green */);
|
|
21133
|
+
},
|
|
21134
|
+
command: (dependencyManager, scriptNameAndArgs) => {
|
|
21135
|
+
return new ContentToken(formatPackageManagerCommand(dependencyManager, scriptNameAndArgs), {}, 0 /* Command */);
|
|
21133
21136
|
}
|
|
21134
21137
|
};
|
|
21138
|
+
function formatPackageManagerCommand(dependencyManager, scriptNameAndArgs) {
|
|
21139
|
+
switch (dependencyManager) {
|
|
21140
|
+
case "yarn":
|
|
21141
|
+
return `yarn ${scriptNameAndArgs}`;
|
|
21142
|
+
case "pnpm":
|
|
21143
|
+
case "npm":
|
|
21144
|
+
return `${dependencyManager} run ${scriptNameAndArgs}`;
|
|
21145
|
+
}
|
|
21146
|
+
}
|
|
21135
21147
|
class TokenizedString {
|
|
21136
21148
|
constructor(value) {
|
|
21137
21149
|
this.value = value;
|
|
@@ -21293,7 +21305,7 @@ function stringifyMessage(message2) {
|
|
|
21293
21305
|
return message2;
|
|
21294
21306
|
}
|
|
21295
21307
|
}
|
|
21296
|
-
const message = (content2, level
|
|
21308
|
+
const message = (content2, level) => {
|
|
21297
21309
|
if (shouldOutput(level)) {
|
|
21298
21310
|
consoleLog(stringifyMessage(content2));
|
|
21299
21311
|
}
|
|
@@ -21303,8 +21315,7 @@ async function concurrent(processes) {
|
|
|
21303
21315
|
const concurrentColors = [token.yellow, token.cyan, token.magenta, token.green];
|
|
21304
21316
|
const prefixColumnSize = Math.max(...processes.map((process2) => process2.prefix.length));
|
|
21305
21317
|
function linePrefix(prefix, index) {
|
|
21306
|
-
const
|
|
21307
|
-
const color = concurrentColors[colorIndex];
|
|
21318
|
+
const color = concurrentColors[0];
|
|
21308
21319
|
return color(`${prefix}${" ".repeat(prefixColumnSize - prefix.length)} ${colors$9.bold("|")} `);
|
|
21309
21320
|
}
|
|
21310
21321
|
try {
|
|
@@ -21313,7 +21324,7 @@ async function concurrent(processes) {
|
|
|
21313
21324
|
write(chunk, _encoding, next) {
|
|
21314
21325
|
const lines = stripAnsiEraseCursorEscapeCharacters(chunk.toString("ascii")).split(/\n/);
|
|
21315
21326
|
for (const line of lines) {
|
|
21316
|
-
info(content`${linePrefix(process2.prefix
|
|
21327
|
+
info(content`${linePrefix(process2.prefix)}${line}`);
|
|
21317
21328
|
}
|
|
21318
21329
|
next();
|
|
21319
21330
|
}
|
|
@@ -21322,7 +21333,7 @@ async function concurrent(processes) {
|
|
|
21322
21333
|
write(chunk, _encoding, next) {
|
|
21323
21334
|
const lines = stripAnsiEraseCursorEscapeCharacters(chunk.toString("ascii")).split(/\n/);
|
|
21324
21335
|
for (const line of lines) {
|
|
21325
|
-
message(content`${linePrefix(process2.prefix
|
|
21336
|
+
message(content`${linePrefix(process2.prefix)}${colors$9.bold("ERROR")} ${line}`, "error");
|
|
21326
21337
|
}
|
|
21327
21338
|
next();
|
|
21328
21339
|
}
|
|
@@ -21401,7 +21412,13 @@ class AbortSilent extends Fatal {
|
|
|
21401
21412
|
class Bug extends Fatal {
|
|
21402
21413
|
}
|
|
21403
21414
|
async function handler(error) {
|
|
21404
|
-
|
|
21415
|
+
let fatal;
|
|
21416
|
+
if (error instanceof Fatal) {
|
|
21417
|
+
fatal = error;
|
|
21418
|
+
} else {
|
|
21419
|
+
fatal = new Bug(error.message);
|
|
21420
|
+
fatal.stack = error.stack;
|
|
21421
|
+
}
|
|
21405
21422
|
await error$k(fatal);
|
|
21406
21423
|
return Promise.resolve(error);
|
|
21407
21424
|
}
|
|
@@ -35576,7 +35593,7 @@ function isTaskError(result) {
|
|
|
35576
35593
|
function getErrorMessage(result) {
|
|
35577
35594
|
return Buffer.concat([...result.stdOut, ...result.stdErr]);
|
|
35578
35595
|
}
|
|
35579
|
-
function errorDetectionHandler(overwrite
|
|
35596
|
+
function errorDetectionHandler(overwrite, isError = isTaskError, errorMessage = getErrorMessage) {
|
|
35580
35597
|
return (error, result) => {
|
|
35581
35598
|
if (!overwrite && error || !isError(result)) {
|
|
35582
35599
|
return error;
|
|
@@ -40089,7 +40106,7 @@ try {
|
|
|
40089
40106
|
const POOL_SIZE = 65536;
|
|
40090
40107
|
|
|
40091
40108
|
/** @param {(Blob | Uint8Array)[]} parts */
|
|
40092
|
-
async function * toIterator (parts, clone
|
|
40109
|
+
async function * toIterator (parts, clone) {
|
|
40093
40110
|
for (const part of parts) {
|
|
40094
40111
|
if ('stream' in part) {
|
|
40095
40112
|
yield * (/** @type {AsyncIterableIterator<Uint8Array>} */ (part.stream()));
|
|
@@ -40631,7 +40648,7 @@ class Body$1 {
|
|
|
40631
40648
|
return formData;
|
|
40632
40649
|
}
|
|
40633
40650
|
|
|
40634
|
-
const {toFormData} = await import('./multipart-parser-
|
|
40651
|
+
const {toFormData} = await import('./multipart-parser-2aa3d069.js');
|
|
40635
40652
|
return toFormData(this.body, ct);
|
|
40636
40653
|
}
|
|
40637
40654
|
|
|
@@ -41284,7 +41301,7 @@ class Response$3 extends Body$1 {
|
|
|
41284
41301
|
* @param {number} status An optional status code for the response (e.g., 302.)
|
|
41285
41302
|
* @returns {Response} A Response object.
|
|
41286
41303
|
*/
|
|
41287
|
-
static redirect(url, status
|
|
41304
|
+
static redirect(url, status) {
|
|
41288
41305
|
if (!isRedirect(status)) {
|
|
41289
41306
|
throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
|
|
41290
41307
|
}
|
|
@@ -58003,7 +58020,7 @@ var decompressResponse = response => {
|
|
|
58003
58020
|
};
|
|
58004
58021
|
|
|
58005
58022
|
class QuickLRU$2 {
|
|
58006
|
-
constructor(options
|
|
58023
|
+
constructor(options) {
|
|
58007
58024
|
if (!(options.maxSize && options.maxSize > 0)) {
|
|
58008
58025
|
throw new TypeError('`maxSize` must be a number greater than 0');
|
|
58009
58026
|
}
|
|
@@ -65870,7 +65887,7 @@ const compare = compare_1;
|
|
|
65870
65887
|
// - If no C has a prerelease and the LT.semver tuple, return false
|
|
65871
65888
|
// - Else return true
|
|
65872
65889
|
|
|
65873
|
-
const subset = (sub, dom, options
|
|
65890
|
+
const subset = (sub, dom, options) => {
|
|
65874
65891
|
if (sub === dom) {
|
|
65875
65892
|
return true
|
|
65876
65893
|
}
|
|
@@ -66785,6 +66802,70 @@ var util$2;
|
|
|
66785
66802
|
}
|
|
66786
66803
|
util.joinValues = joinValues;
|
|
66787
66804
|
})(util$2 || (util$2 = {}));
|
|
66805
|
+
const ZodParsedType = util$2.arrayToEnum([
|
|
66806
|
+
"string",
|
|
66807
|
+
"nan",
|
|
66808
|
+
"number",
|
|
66809
|
+
"integer",
|
|
66810
|
+
"float",
|
|
66811
|
+
"boolean",
|
|
66812
|
+
"date",
|
|
66813
|
+
"bigint",
|
|
66814
|
+
"symbol",
|
|
66815
|
+
"function",
|
|
66816
|
+
"undefined",
|
|
66817
|
+
"null",
|
|
66818
|
+
"array",
|
|
66819
|
+
"object",
|
|
66820
|
+
"unknown",
|
|
66821
|
+
"promise",
|
|
66822
|
+
"void",
|
|
66823
|
+
"never",
|
|
66824
|
+
"map",
|
|
66825
|
+
"set",
|
|
66826
|
+
]);
|
|
66827
|
+
const getParsedType = (data) => {
|
|
66828
|
+
const t = typeof data;
|
|
66829
|
+
switch (t) {
|
|
66830
|
+
case "undefined":
|
|
66831
|
+
return ZodParsedType.undefined;
|
|
66832
|
+
case "string":
|
|
66833
|
+
return ZodParsedType.string;
|
|
66834
|
+
case "number":
|
|
66835
|
+
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
66836
|
+
case "boolean":
|
|
66837
|
+
return ZodParsedType.boolean;
|
|
66838
|
+
case "function":
|
|
66839
|
+
return ZodParsedType.function;
|
|
66840
|
+
case "bigint":
|
|
66841
|
+
return ZodParsedType.bigint;
|
|
66842
|
+
case "object":
|
|
66843
|
+
if (Array.isArray(data)) {
|
|
66844
|
+
return ZodParsedType.array;
|
|
66845
|
+
}
|
|
66846
|
+
if (data === null) {
|
|
66847
|
+
return ZodParsedType.null;
|
|
66848
|
+
}
|
|
66849
|
+
if (data.then &&
|
|
66850
|
+
typeof data.then === "function" &&
|
|
66851
|
+
data.catch &&
|
|
66852
|
+
typeof data.catch === "function") {
|
|
66853
|
+
return ZodParsedType.promise;
|
|
66854
|
+
}
|
|
66855
|
+
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
66856
|
+
return ZodParsedType.map;
|
|
66857
|
+
}
|
|
66858
|
+
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
66859
|
+
return ZodParsedType.set;
|
|
66860
|
+
}
|
|
66861
|
+
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
66862
|
+
return ZodParsedType.date;
|
|
66863
|
+
}
|
|
66864
|
+
return ZodParsedType.object;
|
|
66865
|
+
default:
|
|
66866
|
+
return ZodParsedType.unknown;
|
|
66867
|
+
}
|
|
66868
|
+
};
|
|
66788
66869
|
|
|
66789
66870
|
const ZodIssueCode = util$2.arrayToEnum([
|
|
66790
66871
|
"invalid_type",
|
|
@@ -66992,70 +67073,6 @@ const setErrorMap = (map) => {
|
|
|
66992
67073
|
overrideErrorMap = map;
|
|
66993
67074
|
};
|
|
66994
67075
|
|
|
66995
|
-
const ZodParsedType = util$2.arrayToEnum([
|
|
66996
|
-
"string",
|
|
66997
|
-
"nan",
|
|
66998
|
-
"number",
|
|
66999
|
-
"integer",
|
|
67000
|
-
"float",
|
|
67001
|
-
"boolean",
|
|
67002
|
-
"date",
|
|
67003
|
-
"bigint",
|
|
67004
|
-
"symbol",
|
|
67005
|
-
"function",
|
|
67006
|
-
"undefined",
|
|
67007
|
-
"null",
|
|
67008
|
-
"array",
|
|
67009
|
-
"object",
|
|
67010
|
-
"unknown",
|
|
67011
|
-
"promise",
|
|
67012
|
-
"void",
|
|
67013
|
-
"never",
|
|
67014
|
-
"map",
|
|
67015
|
-
"set",
|
|
67016
|
-
]);
|
|
67017
|
-
const getParsedType = (data) => {
|
|
67018
|
-
const t = typeof data;
|
|
67019
|
-
switch (t) {
|
|
67020
|
-
case "undefined":
|
|
67021
|
-
return ZodParsedType.undefined;
|
|
67022
|
-
case "string":
|
|
67023
|
-
return ZodParsedType.string;
|
|
67024
|
-
case "number":
|
|
67025
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
67026
|
-
case "boolean":
|
|
67027
|
-
return ZodParsedType.boolean;
|
|
67028
|
-
case "function":
|
|
67029
|
-
return ZodParsedType.function;
|
|
67030
|
-
case "bigint":
|
|
67031
|
-
return ZodParsedType.bigint;
|
|
67032
|
-
case "object":
|
|
67033
|
-
if (Array.isArray(data)) {
|
|
67034
|
-
return ZodParsedType.array;
|
|
67035
|
-
}
|
|
67036
|
-
if (data === null) {
|
|
67037
|
-
return ZodParsedType.null;
|
|
67038
|
-
}
|
|
67039
|
-
if (data.then &&
|
|
67040
|
-
typeof data.then === "function" &&
|
|
67041
|
-
data.catch &&
|
|
67042
|
-
typeof data.catch === "function") {
|
|
67043
|
-
return ZodParsedType.promise;
|
|
67044
|
-
}
|
|
67045
|
-
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
67046
|
-
return ZodParsedType.map;
|
|
67047
|
-
}
|
|
67048
|
-
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
67049
|
-
return ZodParsedType.set;
|
|
67050
|
-
}
|
|
67051
|
-
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
67052
|
-
return ZodParsedType.date;
|
|
67053
|
-
}
|
|
67054
|
-
return ZodParsedType.object;
|
|
67055
|
-
default:
|
|
67056
|
-
return ZodParsedType.unknown;
|
|
67057
|
-
}
|
|
67058
|
-
};
|
|
67059
67076
|
const makeIssue = (params) => {
|
|
67060
67077
|
const { data, path, errorMaps, issueData } = params;
|
|
67061
67078
|
const fullPath = [...path, ...(issueData.path || [])];
|
|
@@ -67087,7 +67104,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
67087
67104
|
ctx.common.contextualErrorMap,
|
|
67088
67105
|
ctx.schemaErrorMap,
|
|
67089
67106
|
overrideErrorMap,
|
|
67090
|
-
defaultErrorMap,
|
|
67107
|
+
defaultErrorMap,
|
|
67091
67108
|
].filter((x) => !!x),
|
|
67092
67109
|
});
|
|
67093
67110
|
ctx.common.issues.push(issue);
|
|
@@ -67442,10 +67459,14 @@ class ZodString extends ZodType {
|
|
|
67442
67459
|
...errorUtil.errToObj(message),
|
|
67443
67460
|
});
|
|
67444
67461
|
/**
|
|
67445
|
-
*
|
|
67446
|
-
*
|
|
67462
|
+
* @deprecated Use z.string().min(1) instead.
|
|
67463
|
+
* @see {@link ZodString.min}
|
|
67447
67464
|
*/
|
|
67448
67465
|
this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
|
|
67466
|
+
this.trim = () => new ZodString({
|
|
67467
|
+
...this._def,
|
|
67468
|
+
checks: [...this._def.checks, { kind: "trim" }],
|
|
67469
|
+
});
|
|
67449
67470
|
}
|
|
67450
67471
|
_parse(input) {
|
|
67451
67472
|
const parsedType = this._getType(input);
|
|
@@ -67549,6 +67570,12 @@ class ZodString extends ZodType {
|
|
|
67549
67570
|
status.dirty();
|
|
67550
67571
|
}
|
|
67551
67572
|
}
|
|
67573
|
+
else if (check.kind === "trim") {
|
|
67574
|
+
input.data = input.data.trim();
|
|
67575
|
+
}
|
|
67576
|
+
else {
|
|
67577
|
+
util$2.assertNever(check);
|
|
67578
|
+
}
|
|
67552
67579
|
}
|
|
67553
67580
|
return { status: status.value, value: input.data };
|
|
67554
67581
|
}
|
|
@@ -68111,7 +68138,7 @@ var objectUtil;
|
|
|
68111
68138
|
objectUtil.mergeShapes = (first, second) => {
|
|
68112
68139
|
return {
|
|
68113
68140
|
...first,
|
|
68114
|
-
...second,
|
|
68141
|
+
...second,
|
|
68115
68142
|
};
|
|
68116
68143
|
};
|
|
68117
68144
|
})(objectUtil || (objectUtil = {}));
|
|
@@ -68326,7 +68353,9 @@ class ZodObject extends ZodType {
|
|
|
68326
68353
|
pick(mask) {
|
|
68327
68354
|
const shape = {};
|
|
68328
68355
|
util$2.objectKeys(mask).map((key) => {
|
|
68329
|
-
shape
|
|
68356
|
+
// only add to shape if key corresponds to an element of the current shape
|
|
68357
|
+
if (this.shape[key])
|
|
68358
|
+
shape[key] = this.shape[key];
|
|
68330
68359
|
});
|
|
68331
68360
|
return new ZodObject({
|
|
68332
68361
|
...this._def,
|
|
@@ -69115,10 +69144,11 @@ ZodLiteral.create = (value, params) => {
|
|
|
69115
69144
|
...processCreateParams(params),
|
|
69116
69145
|
});
|
|
69117
69146
|
};
|
|
69118
|
-
function createZodEnum(values) {
|
|
69147
|
+
function createZodEnum(values, params) {
|
|
69119
69148
|
return new ZodEnum({
|
|
69120
69149
|
values: values,
|
|
69121
69150
|
typeName: ZodFirstPartyTypeKind.ZodEnum,
|
|
69151
|
+
...processCreateParams(params),
|
|
69122
69152
|
});
|
|
69123
69153
|
}
|
|
69124
69154
|
class ZodEnum extends ZodType {
|
|
@@ -69454,9 +69484,15 @@ ZodNaN.create = (params) => {
|
|
|
69454
69484
|
...processCreateParams(params),
|
|
69455
69485
|
});
|
|
69456
69486
|
};
|
|
69457
|
-
const custom = (check, params) => {
|
|
69487
|
+
const custom = (check, params = {}, fatal) => {
|
|
69458
69488
|
if (check)
|
|
69459
|
-
return ZodAny.create().
|
|
69489
|
+
return ZodAny.create().superRefine((data, ctx) => {
|
|
69490
|
+
if (!check(data)) {
|
|
69491
|
+
const p = typeof params === "function" ? params(data) : params;
|
|
69492
|
+
const p2 = typeof p === "string" ? { message: p } : p;
|
|
69493
|
+
ctx.addIssue({ code: "custom", ...p2, fatal });
|
|
69494
|
+
}
|
|
69495
|
+
});
|
|
69460
69496
|
return ZodAny.create();
|
|
69461
69497
|
};
|
|
69462
69498
|
const late = {
|
|
@@ -69498,7 +69534,7 @@ var ZodFirstPartyTypeKind;
|
|
|
69498
69534
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
69499
69535
|
const instanceOfType = (cls, params = {
|
|
69500
69536
|
message: `Input not instance of ${cls.name}`,
|
|
69501
|
-
}) => custom((data) => data instanceof cls, params);
|
|
69537
|
+
}) => custom((data) => data instanceof cls, params, true);
|
|
69502
69538
|
const stringType = ZodString.create;
|
|
69503
69539
|
const numberType = ZodNumber.create;
|
|
69504
69540
|
const nanType = ZodNaN.create;
|
|
@@ -69537,8 +69573,8 @@ const oboolean = () => booleanType().optional();
|
|
|
69537
69573
|
|
|
69538
69574
|
var mod = /*#__PURE__*/Object.freeze({
|
|
69539
69575
|
__proto__: null,
|
|
69540
|
-
ZodParsedType: ZodParsedType,
|
|
69541
69576
|
getParsedType: getParsedType,
|
|
69577
|
+
ZodParsedType: ZodParsedType,
|
|
69542
69578
|
makeIssue: makeIssue,
|
|
69543
69579
|
EMPTY_PATH: EMPTY_PATH,
|
|
69544
69580
|
addIssueToContext: addIssueToContext,
|
|
@@ -75721,26 +75757,6 @@ var yaml = /*#__PURE__*/Object.freeze({
|
|
|
75721
75757
|
encode: encode
|
|
75722
75758
|
});
|
|
75723
75759
|
|
|
75724
|
-
const schema = {
|
|
75725
|
-
appInfo: {
|
|
75726
|
-
type: "array",
|
|
75727
|
-
items: {
|
|
75728
|
-
type: "object",
|
|
75729
|
-
properties: {
|
|
75730
|
-
appId: {
|
|
75731
|
-
type: "string"
|
|
75732
|
-
},
|
|
75733
|
-
orgId: {
|
|
75734
|
-
type: "string"
|
|
75735
|
-
},
|
|
75736
|
-
storeFqdn: {
|
|
75737
|
-
type: "string"
|
|
75738
|
-
}
|
|
75739
|
-
}
|
|
75740
|
-
}
|
|
75741
|
-
}
|
|
75742
|
-
};
|
|
75743
|
-
|
|
75744
75760
|
var source = {exports: {}};
|
|
75745
75761
|
|
|
75746
75762
|
var isObj$1 = value => {
|
|
@@ -84228,7 +84244,7 @@ var mimicFn_1 = mimicFn$1;
|
|
|
84228
84244
|
|
|
84229
84245
|
const mimicFn = mimicFn_1;
|
|
84230
84246
|
|
|
84231
|
-
var debounceFn = (inputFunction, options
|
|
84247
|
+
var debounceFn = (inputFunction, options) => {
|
|
84232
84248
|
if (typeof inputFunction !== 'function') {
|
|
84233
84249
|
throw new TypeError(`Expected the first argument to be a function, got \`${typeof inputFunction}\``);
|
|
84234
84250
|
}
|
|
@@ -84761,31 +84777,54 @@ module.exports.default = Conf;
|
|
|
84761
84777
|
var Conf = /*@__PURE__*/getDefaultExportFromCjs(source.exports);
|
|
84762
84778
|
|
|
84763
84779
|
const migrations = {};
|
|
84780
|
+
const schema = {
|
|
84781
|
+
appInfo: {
|
|
84782
|
+
type: "array",
|
|
84783
|
+
items: {
|
|
84784
|
+
type: "object",
|
|
84785
|
+
properties: {
|
|
84786
|
+
appId: {
|
|
84787
|
+
type: "string"
|
|
84788
|
+
},
|
|
84789
|
+
orgId: {
|
|
84790
|
+
type: "string"
|
|
84791
|
+
},
|
|
84792
|
+
storeFqdn: {
|
|
84793
|
+
type: "string"
|
|
84794
|
+
}
|
|
84795
|
+
}
|
|
84796
|
+
}
|
|
84797
|
+
}
|
|
84798
|
+
};
|
|
84764
84799
|
const cliKit = new Conf({
|
|
84765
84800
|
schema,
|
|
84766
84801
|
migrations,
|
|
84767
84802
|
projectName: "shopify-cli-kit",
|
|
84768
84803
|
projectVersion: cliKitPackageJson.version
|
|
84769
84804
|
});
|
|
84770
|
-
function getAppInfo(
|
|
84805
|
+
function getAppInfo(directory) {
|
|
84771
84806
|
const apps = cliKit.get("appInfo") ?? [];
|
|
84772
|
-
return apps.find((app) => app.
|
|
84807
|
+
return apps.find((app) => app.directory === directory);
|
|
84773
84808
|
}
|
|
84774
|
-
function setAppInfo(
|
|
84809
|
+
function setAppInfo(options) {
|
|
84775
84810
|
const apps = cliKit.get("appInfo") ?? [];
|
|
84776
|
-
const index = apps.findIndex((saved) => saved.
|
|
84811
|
+
const index = apps.findIndex((saved) => saved.directory === options.directory);
|
|
84777
84812
|
if (index === -1) {
|
|
84778
|
-
apps.push(
|
|
84779
|
-
completed("Updated your project name to match your Shopify app name");
|
|
84813
|
+
apps.push(options);
|
|
84780
84814
|
} else {
|
|
84781
84815
|
const app = apps[index];
|
|
84782
|
-
apps[index] = {
|
|
84816
|
+
apps[index] = {
|
|
84817
|
+
appId: options.appId,
|
|
84818
|
+
directory: options.directory,
|
|
84819
|
+
storeFqdn: options.storeFqdn ?? app.storeFqdn,
|
|
84820
|
+
orgId: options.orgId ?? app.orgId
|
|
84821
|
+
};
|
|
84783
84822
|
}
|
|
84784
84823
|
cliKit.set("appInfo", apps);
|
|
84785
84824
|
}
|
|
84786
|
-
function clearAppInfo(
|
|
84825
|
+
function clearAppInfo(directory) {
|
|
84787
84826
|
const apps = cliKit.get("appInfo") ?? [];
|
|
84788
|
-
const index = apps.findIndex((saved) => saved.
|
|
84827
|
+
const index = apps.findIndex((saved) => saved.directory === directory);
|
|
84789
84828
|
if (index !== -1) {
|
|
84790
84829
|
apps.splice(index, 1);
|
|
84791
84830
|
}
|
|
@@ -170543,7 +170582,7 @@ const printDocASTReducer = {
|
|
|
170543
170582
|
* print all items together separated by separator if provided
|
|
170544
170583
|
*/
|
|
170545
170584
|
|
|
170546
|
-
function join(maybeArray, separator
|
|
170585
|
+
function join(maybeArray, separator) {
|
|
170547
170586
|
var _maybeArray$filter$jo;
|
|
170548
170587
|
|
|
170549
170588
|
return (_maybeArray$filter$jo =
|
|
@@ -172691,10 +172730,20 @@ var cli = /*#__PURE__*/Object.freeze({
|
|
|
172691
172730
|
const generateRandomUUID = () => {
|
|
172692
172731
|
return randomUUID();
|
|
172693
172732
|
};
|
|
172733
|
+
const generateShortId = () => {
|
|
172734
|
+
let result = "";
|
|
172735
|
+
const characters = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
172736
|
+
const charactersLength = characters.length;
|
|
172737
|
+
for (let i = 0; i < 7; i++) {
|
|
172738
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
172739
|
+
}
|
|
172740
|
+
return result;
|
|
172741
|
+
};
|
|
172694
172742
|
|
|
172695
172743
|
var id = /*#__PURE__*/Object.freeze({
|
|
172696
172744
|
__proto__: null,
|
|
172697
|
-
generateRandomUUID: generateRandomUUID
|
|
172745
|
+
generateRandomUUID: generateRandomUUID,
|
|
172746
|
+
generateShortId: generateShortId
|
|
172698
172747
|
});
|
|
172699
172748
|
|
|
172700
172749
|
async function directory(callback) {
|
|
@@ -172746,4 +172795,4 @@ var plugins = /*#__PURE__*/Object.freeze({
|
|
|
172746
172795
|
});
|
|
172747
172796
|
|
|
172748
172797
|
export { npm as A, port as B, cli as C, id as D, temporary as E, FormData$3 as F, dotEnv as G, constants$2 as H, plugins as I, File$1 as a, string as b, github as c, dependency as d, error$j as e, file$1 as f, git as g, os$2 as h, environment as i, session as j, schema$2 as k, toml as l, store as m, api as n, output as o, path$w as p, http$2 as q, archiver as r, system as s, template as t, ui as u, version as v, checksum as w, ruby as x, yaml as y, semver as z };
|
|
172749
|
-
//# sourceMappingURL=index-
|
|
172798
|
+
//# sourceMappingURL=index-814fd0de.js.map
|