@shopify/cli-kit 2.0.8 → 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.
@@ -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 = false, res) => {
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 = {}, fn = token => token) => {
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.8";
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.14.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.8";
12435
+ var version$3 = "2.0.13";
12436
12436
 
12437
- var version$2 = "2.0.8";
12437
+ var version$2 = "2.0.13";
12438
12438
 
12439
- var version$1 = "2.0.8";
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 = 1, options) => {
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 = {}, type) {
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
- command: (value) => {
21104
+ genericShellCommand: (value) => {
21105
21105
  return new ContentToken(value, {}, 0 /* Command */);
21106
21106
  },
21107
21107
  path: (value) => {
@@ -21110,19 +21110,40 @@ const token = {
21110
21110
  link: (value, link) => {
21111
21111
  return new ContentToken(value, { link }, 2 /* Link */);
21112
21112
  },
21113
+ heading: (value) => {
21114
+ return new ContentToken(value, {}, 3 /* Heading */);
21115
+ },
21116
+ subheading: (value) => {
21117
+ return new ContentToken(value, {}, 4 /* SubHeading */);
21118
+ },
21119
+ errorText: (value) => {
21120
+ return new ContentToken(value, {}, 5 /* ErrorText */);
21121
+ },
21113
21122
  cyan: (value) => {
21114
- return new ContentToken(value, {}, 4 /* Cyan */);
21123
+ return new ContentToken(value, {}, 7 /* Cyan */);
21115
21124
  },
21116
21125
  yellow: (value) => {
21117
- return new ContentToken(value, {}, 3 /* Yellow */);
21126
+ return new ContentToken(value, {}, 6 /* Yellow */);
21118
21127
  },
21119
21128
  magenta: (value) => {
21120
- return new ContentToken(value, {}, 5 /* Magenta */);
21129
+ return new ContentToken(value, {}, 8 /* Magenta */);
21121
21130
  },
21122
21131
  green: (value) => {
21123
- return new ContentToken(value, {}, 6 /* Green */);
21132
+ return new ContentToken(value, {}, 9 /* Green */);
21133
+ },
21134
+ command: (dependencyManager, scriptNameAndArgs) => {
21135
+ return new ContentToken(formatPackageManagerCommand(dependencyManager, scriptNameAndArgs), {}, 0 /* Command */);
21124
21136
  }
21125
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
+ }
21126
21147
  class TokenizedString {
21127
21148
  constructor(value) {
21128
21149
  this.value = value;
@@ -21150,16 +21171,25 @@ function content(strings, ...keys) {
21150
21171
  case 2 /* Link */:
21151
21172
  output += terminalLink(colors$9.green(enumToken.value), enumToken.metadata.link ?? "");
21152
21173
  break;
21153
- case 3 /* Yellow */:
21174
+ case 3 /* Heading */:
21175
+ output += colors$9.bold.underline(enumToken.value);
21176
+ break;
21177
+ case 4 /* SubHeading */:
21178
+ output += colors$9.underline(enumToken.value);
21179
+ break;
21180
+ case 5 /* ErrorText */:
21181
+ output += colors$9.bold.redBright(enumToken.value);
21182
+ break;
21183
+ case 6 /* Yellow */:
21154
21184
  output += colors$9.yellow(enumToken.value);
21155
21185
  break;
21156
- case 4 /* Cyan */:
21186
+ case 7 /* Cyan */:
21157
21187
  output += colors$9.cyan(enumToken.value);
21158
21188
  break;
21159
- case 5 /* Magenta */:
21189
+ case 8 /* Magenta */:
21160
21190
  output += colors$9.magenta(enumToken.value);
21161
21191
  break;
21162
- case 6 /* Green */:
21192
+ case 9 /* Green */:
21163
21193
  output += colors$9.green(enumToken.value);
21164
21194
  break;
21165
21195
  }
@@ -21205,7 +21235,12 @@ const info = (content2) => {
21205
21235
  };
21206
21236
  const success = (content2) => {
21207
21237
  if (shouldOutput("info")) {
21208
- consoleLog(colors$9.bold(`${colors$9.green("\u2714")} Success! ${stringifyMessage(content2)}.`));
21238
+ consoleLog(colors$9.bold(`\u2705 Success! ${stringifyMessage(content2)}.`));
21239
+ }
21240
+ };
21241
+ const completed = (content2) => {
21242
+ if (shouldOutput("info")) {
21243
+ consoleLog(`${colors$9.green("\u2714")} ${stringifyMessage(content2)}.`);
21209
21244
  }
21210
21245
  };
21211
21246
  const debug$5 = (content2) => {
@@ -21270,7 +21305,7 @@ function stringifyMessage(message2) {
21270
21305
  return message2;
21271
21306
  }
21272
21307
  }
21273
- const message = (content2, level = "info") => {
21308
+ const message = (content2, level) => {
21274
21309
  if (shouldOutput(level)) {
21275
21310
  consoleLog(stringifyMessage(content2));
21276
21311
  }
@@ -21280,8 +21315,7 @@ async function concurrent(processes) {
21280
21315
  const concurrentColors = [token.yellow, token.cyan, token.magenta, token.green];
21281
21316
  const prefixColumnSize = Math.max(...processes.map((process2) => process2.prefix.length));
21282
21317
  function linePrefix(prefix, index) {
21283
- const colorIndex = index < concurrentColors.length ? index : index % concurrentColors.length;
21284
- const color = concurrentColors[colorIndex];
21318
+ const color = concurrentColors[0];
21285
21319
  return color(`${prefix}${" ".repeat(prefixColumnSize - prefix.length)} ${colors$9.bold("|")} `);
21286
21320
  }
21287
21321
  try {
@@ -21290,7 +21324,7 @@ async function concurrent(processes) {
21290
21324
  write(chunk, _encoding, next) {
21291
21325
  const lines = stripAnsiEraseCursorEscapeCharacters(chunk.toString("ascii")).split(/\n/);
21292
21326
  for (const line of lines) {
21293
- info(content`${linePrefix(process2.prefix, index)}${line}`);
21327
+ info(content`${linePrefix(process2.prefix)}${line}`);
21294
21328
  }
21295
21329
  next();
21296
21330
  }
@@ -21299,7 +21333,7 @@ async function concurrent(processes) {
21299
21333
  write(chunk, _encoding, next) {
21300
21334
  const lines = stripAnsiEraseCursorEscapeCharacters(chunk.toString("ascii")).split(/\n/);
21301
21335
  for (const line of lines) {
21302
- message(content`${linePrefix(process2.prefix, index)}${colors$9.bold("ERROR")} ${line}`, "error");
21336
+ message(content`${linePrefix(process2.prefix)}${colors$9.bold("ERROR")} ${line}`, "error");
21303
21337
  }
21304
21338
  next();
21305
21339
  }
@@ -21331,9 +21365,12 @@ function withOrWithoutStyle(message2) {
21331
21365
  if (shouldDisplayColors()) {
21332
21366
  return message2;
21333
21367
  } else {
21334
- return colors$9.unstyle(message2);
21368
+ return unstyled(message2);
21335
21369
  }
21336
21370
  }
21371
+ function unstyled(message2) {
21372
+ return colors$9.unstyle(message2);
21373
+ }
21337
21374
  function shouldDisplayColors() {
21338
21375
  return Boolean(process.stdout.isTTY || process.env.FORCE_COLOR);
21339
21376
  }
@@ -21341,17 +21378,20 @@ function shouldDisplayColors() {
21341
21378
  var output = /*#__PURE__*/Object.freeze({
21342
21379
  __proto__: null,
21343
21380
  token: token,
21381
+ TokenizedString: TokenizedString,
21344
21382
  content: content,
21345
21383
  currentLogLevel: currentLogLevel,
21346
21384
  shouldOutput: shouldOutput,
21347
21385
  info: info,
21348
21386
  success: success,
21387
+ completed: completed,
21349
21388
  debug: debug$5,
21350
21389
  warn: warn,
21351
21390
  newline: newline,
21352
21391
  error: error$k,
21353
21392
  stringifyMessage: stringifyMessage,
21354
21393
  concurrent: concurrent,
21394
+ unstyled: unstyled,
21355
21395
  shouldDisplayColors: shouldDisplayColors
21356
21396
  });
21357
21397
 
@@ -21372,7 +21412,13 @@ class AbortSilent extends Fatal {
21372
21412
  class Bug extends Fatal {
21373
21413
  }
21374
21414
  async function handler(error) {
21375
- const fatal = error instanceof Fatal ? error : new Abort(error.message);
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
+ }
21376
21422
  await error$k(fatal);
21377
21423
  return Promise.resolve(error);
21378
21424
  }
@@ -30879,6 +30925,21 @@ function camelCase(input, options) {
30879
30925
  return pascalCase(input, __assign$1({ transform: camelCaseTransform }, options));
30880
30926
  }
30881
30927
 
30928
+ /**
30929
+ * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
30930
+ */
30931
+ /**
30932
+ * Upper case as a function.
30933
+ */
30934
+ function upperCase(str) {
30935
+ return str.toUpperCase();
30936
+ }
30937
+
30938
+ function constantCase(input, options) {
30939
+ if (options === void 0) { options = {}; }
30940
+ return noCase(input, __assign$1({ delimiter: "_", transform: upperCase }, options));
30941
+ }
30942
+
30882
30943
  function dotCase(input, options) {
30883
30944
  if (options === void 0) { options = {}; }
30884
30945
  return noCase(input, __assign$1({ delimiter: "." }, options));
@@ -30924,7 +30985,8 @@ var string = /*#__PURE__*/Object.freeze({
30924
30985
  normalizeStoreName: normalizeStoreName,
30925
30986
  camelize: camelCase,
30926
30987
  hyphenize: paramCase,
30927
- underscore: snakeCase
30988
+ underscore: snakeCase,
30989
+ constantize: constantCase
30928
30990
  });
30929
30991
 
30930
30992
  var dist$6 = {};
@@ -35531,7 +35593,7 @@ function isTaskError(result) {
35531
35593
  function getErrorMessage(result) {
35532
35594
  return Buffer.concat([...result.stdOut, ...result.stdErr]);
35533
35595
  }
35534
- function errorDetectionHandler(overwrite = false, isError = isTaskError, errorMessage = getErrorMessage) {
35596
+ function errorDetectionHandler(overwrite, isError = isTaskError, errorMessage = getErrorMessage) {
35535
35597
  return (error, result) => {
35536
35598
  if (!overwrite && error || !isError(result)) {
35537
35599
  return error;
@@ -40044,7 +40106,7 @@ try {
40044
40106
  const POOL_SIZE = 65536;
40045
40107
 
40046
40108
  /** @param {(Blob | Uint8Array)[]} parts */
40047
- async function * toIterator (parts, clone = true) {
40109
+ async function * toIterator (parts, clone) {
40048
40110
  for (const part of parts) {
40049
40111
  if ('stream' in part) {
40050
40112
  yield * (/** @type {AsyncIterableIterator<Uint8Array>} */ (part.stream()));
@@ -40586,7 +40648,7 @@ class Body$1 {
40586
40648
  return formData;
40587
40649
  }
40588
40650
 
40589
- const {toFormData} = await import('./multipart-parser-28a94b7f.js');
40651
+ const {toFormData} = await import('./multipart-parser-2aa3d069.js');
40590
40652
  return toFormData(this.body, ct);
40591
40653
  }
40592
40654
 
@@ -41239,7 +41301,7 @@ class Response$3 extends Body$1 {
41239
41301
  * @param {number} status An optional status code for the response (e.g., 302.)
41240
41302
  * @returns {Response} A Response object.
41241
41303
  */
41242
- static redirect(url, status = 302) {
41304
+ static redirect(url, status) {
41243
41305
  if (!isRedirect(status)) {
41244
41306
  throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
41245
41307
  }
@@ -54549,15 +54611,22 @@ async function install(directory, dependencyManager2, stdout, stderr, signal) {
54549
54611
  const options = { cwd: directory, stdout, stderr, signal };
54550
54612
  await exec$2(dependencyManager2, ["install"], options);
54551
54613
  }
54614
+ async function getPackageName(packageJsonPath) {
54615
+ const packageJsonContent = await packageJSONContents(packageJsonPath);
54616
+ return packageJsonContent.name;
54617
+ }
54552
54618
  async function getDependencies(packageJsonPath) {
54553
- if (!await exists$1(packageJsonPath)) {
54554
- throw PackageJsonNotFoundError(dirname$1(packageJsonPath));
54555
- }
54556
- const packageJsonContent = JSON.parse(await read$1(packageJsonPath));
54619
+ const packageJsonContent = await packageJSONContents(packageJsonPath);
54557
54620
  const dependencies = packageJsonContent.dependencies ?? {};
54558
54621
  const devDependencies = packageJsonContent.devDependencies ?? {};
54559
54622
  return { ...dependencies, ...devDependencies };
54560
54623
  }
54624
+ async function packageJSONContents(packageJsonPath) {
54625
+ if (!await exists$1(packageJsonPath)) {
54626
+ throw PackageJsonNotFoundError(dirname$1(packageJsonPath));
54627
+ }
54628
+ return JSON.parse(await read$1(packageJsonPath));
54629
+ }
54561
54630
  async function addNPMDependenciesIfNeeded(dependencies, options) {
54562
54631
  const packageJsonPath = join$3(options.directory, "package.json");
54563
54632
  if (!await exists$1(packageJsonPath)) {
@@ -54645,6 +54714,7 @@ var dependency = /*#__PURE__*/Object.freeze({
54645
54714
  dependencyManagerUsedForCreating: dependencyManagerUsedForCreating,
54646
54715
  installNPMDependenciesRecursively: installNPMDependenciesRecursively,
54647
54716
  install: install,
54717
+ getPackageName: getPackageName,
54648
54718
  getDependencies: getDependencies,
54649
54719
  addNPMDependenciesIfNeeded: addNPMDependenciesIfNeeded
54650
54720
  });
@@ -57950,7 +58020,7 @@ var decompressResponse = response => {
57950
58020
  };
57951
58021
 
57952
58022
  class QuickLRU$2 {
57953
- constructor(options = {}) {
58023
+ constructor(options) {
57954
58024
  if (!(options.maxSize && options.maxSize > 0)) {
57955
58025
  throw new TypeError('`maxSize` must be a number greater than 0');
57956
58026
  }
@@ -65817,7 +65887,7 @@ const compare = compare_1;
65817
65887
  // - If no C has a prerelease and the LT.semver tuple, return false
65818
65888
  // - Else return true
65819
65889
 
65820
- const subset = (sub, dom, options = {}) => {
65890
+ const subset = (sub, dom, options) => {
65821
65891
  if (sub === dom) {
65822
65892
  return true
65823
65893
  }
@@ -66563,9 +66633,9 @@ const EmptyUrlError = new Abort("We received the authentication redirect but the
66563
66633
  const AuthenticationError = (message) => {
66564
66634
  return new Abort(message);
66565
66635
  };
66566
- const MissingCodeError = new Bug(`The authentication cannot continue because the redirect doesn't include the code.`);
66567
- const MissingStateError = new Bug(`The authentication cannot continue because the redirect doesn't include the state.`);
66568
- const redirectResponseBody = "Continuing the authentication in your terminal...";
66636
+ const MissingCodeError = new Bug(`The authentication can't continue because the redirect doesn't include the code.`);
66637
+ const MissingStateError = new Bug(`The authentication can't continue because the redirect doesn't include the state.`);
66638
+ const redirectResponseBody = `You're logged in on the Shopify CLI in your terminal`;
66569
66639
  const ResponseTimeoutSeconds = 10;
66570
66640
  class RedirectListener {
66571
66641
  static createServer(callback) {
@@ -66626,8 +66696,8 @@ class RedirectListener {
66626
66696
  async function listenRedirect(host, port, url2) {
66627
66697
  const result = await new Promise((resolve, reject) => {
66628
66698
  const timeout = setTimeout(() => {
66629
- const message = "\nAuto-open timed out. Click this link to open the log in page:\n";
66630
- info(content`${message}${token.link("Auth Link", url2)}\n`);
66699
+ const message = "\nAuto-open timed out. Open the login page: ";
66700
+ info(content`${message}${token.link("Log in to Shopify Partners", url2)}\n`);
66631
66701
  }, ResponseTimeoutSeconds * 1e3);
66632
66702
  const redirectListener = new RedirectListener({
66633
66703
  host,
@@ -66670,7 +66740,7 @@ async function authorize(scopes, state = randomHex(30)) {
66670
66740
  };
66671
66741
  url = `${url}?${new URLSearchParams(params).toString()}`;
66672
66742
  open(url);
66673
- info("\nTo run this command, first log in to Shopify Partners. We're opening the page for you on your browser...");
66743
+ info("\nTo run this command, log in to Shopify Partners.");
66674
66744
  const result = await listenRedirect(host, port, url);
66675
66745
  if (result.state !== state) {
66676
66746
  throw MismatchStateError;
@@ -66732,6 +66802,70 @@ var util$2;
66732
66802
  }
66733
66803
  util.joinValues = joinValues;
66734
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
+ };
66735
66869
 
66736
66870
  const ZodIssueCode = util$2.arrayToEnum([
66737
66871
  "invalid_type",
@@ -66939,70 +67073,6 @@ const setErrorMap = (map) => {
66939
67073
  overrideErrorMap = map;
66940
67074
  };
66941
67075
 
66942
- const ZodParsedType = util$2.arrayToEnum([
66943
- "string",
66944
- "nan",
66945
- "number",
66946
- "integer",
66947
- "float",
66948
- "boolean",
66949
- "date",
66950
- "bigint",
66951
- "symbol",
66952
- "function",
66953
- "undefined",
66954
- "null",
66955
- "array",
66956
- "object",
66957
- "unknown",
66958
- "promise",
66959
- "void",
66960
- "never",
66961
- "map",
66962
- "set",
66963
- ]);
66964
- const getParsedType = (data) => {
66965
- const t = typeof data;
66966
- switch (t) {
66967
- case "undefined":
66968
- return ZodParsedType.undefined;
66969
- case "string":
66970
- return ZodParsedType.string;
66971
- case "number":
66972
- return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
66973
- case "boolean":
66974
- return ZodParsedType.boolean;
66975
- case "function":
66976
- return ZodParsedType.function;
66977
- case "bigint":
66978
- return ZodParsedType.bigint;
66979
- case "object":
66980
- if (Array.isArray(data)) {
66981
- return ZodParsedType.array;
66982
- }
66983
- if (data === null) {
66984
- return ZodParsedType.null;
66985
- }
66986
- if (data.then &&
66987
- typeof data.then === "function" &&
66988
- data.catch &&
66989
- typeof data.catch === "function") {
66990
- return ZodParsedType.promise;
66991
- }
66992
- if (typeof Map !== "undefined" && data instanceof Map) {
66993
- return ZodParsedType.map;
66994
- }
66995
- if (typeof Set !== "undefined" && data instanceof Set) {
66996
- return ZodParsedType.set;
66997
- }
66998
- if (typeof Date !== "undefined" && data instanceof Date) {
66999
- return ZodParsedType.date;
67000
- }
67001
- return ZodParsedType.object;
67002
- default:
67003
- return ZodParsedType.unknown;
67004
- }
67005
- };
67006
67076
  const makeIssue = (params) => {
67007
67077
  const { data, path, errorMaps, issueData } = params;
67008
67078
  const fullPath = [...path, ...(issueData.path || [])];
@@ -67034,7 +67104,7 @@ function addIssueToContext(ctx, issueData) {
67034
67104
  ctx.common.contextualErrorMap,
67035
67105
  ctx.schemaErrorMap,
67036
67106
  overrideErrorMap,
67037
- defaultErrorMap, // then global default map
67107
+ defaultErrorMap,
67038
67108
  ].filter((x) => !!x),
67039
67109
  });
67040
67110
  ctx.common.issues.push(issue);
@@ -67389,10 +67459,14 @@ class ZodString extends ZodType {
67389
67459
  ...errorUtil.errToObj(message),
67390
67460
  });
67391
67461
  /**
67392
- * Deprecated.
67393
- * Use z.string().min(1) instead.
67462
+ * @deprecated Use z.string().min(1) instead.
67463
+ * @see {@link ZodString.min}
67394
67464
  */
67395
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
+ });
67396
67470
  }
67397
67471
  _parse(input) {
67398
67472
  const parsedType = this._getType(input);
@@ -67496,6 +67570,12 @@ class ZodString extends ZodType {
67496
67570
  status.dirty();
67497
67571
  }
67498
67572
  }
67573
+ else if (check.kind === "trim") {
67574
+ input.data = input.data.trim();
67575
+ }
67576
+ else {
67577
+ util$2.assertNever(check);
67578
+ }
67499
67579
  }
67500
67580
  return { status: status.value, value: input.data };
67501
67581
  }
@@ -68058,7 +68138,7 @@ var objectUtil;
68058
68138
  objectUtil.mergeShapes = (first, second) => {
68059
68139
  return {
68060
68140
  ...first,
68061
- ...second, // second overwrites first
68141
+ ...second,
68062
68142
  };
68063
68143
  };
68064
68144
  })(objectUtil || (objectUtil = {}));
@@ -68273,7 +68353,9 @@ class ZodObject extends ZodType {
68273
68353
  pick(mask) {
68274
68354
  const shape = {};
68275
68355
  util$2.objectKeys(mask).map((key) => {
68276
- shape[key] = this.shape[key];
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];
68277
68359
  });
68278
68360
  return new ZodObject({
68279
68361
  ...this._def,
@@ -69062,10 +69144,11 @@ ZodLiteral.create = (value, params) => {
69062
69144
  ...processCreateParams(params),
69063
69145
  });
69064
69146
  };
69065
- function createZodEnum(values) {
69147
+ function createZodEnum(values, params) {
69066
69148
  return new ZodEnum({
69067
69149
  values: values,
69068
69150
  typeName: ZodFirstPartyTypeKind.ZodEnum,
69151
+ ...processCreateParams(params),
69069
69152
  });
69070
69153
  }
69071
69154
  class ZodEnum extends ZodType {
@@ -69401,9 +69484,15 @@ ZodNaN.create = (params) => {
69401
69484
  ...processCreateParams(params),
69402
69485
  });
69403
69486
  };
69404
- const custom = (check, params) => {
69487
+ const custom = (check, params = {}, fatal) => {
69405
69488
  if (check)
69406
- return ZodAny.create().refine(check, params);
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
+ });
69407
69496
  return ZodAny.create();
69408
69497
  };
69409
69498
  const late = {
@@ -69445,7 +69534,7 @@ var ZodFirstPartyTypeKind;
69445
69534
  })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
69446
69535
  const instanceOfType = (cls, params = {
69447
69536
  message: `Input not instance of ${cls.name}`,
69448
- }) => custom((data) => data instanceof cls, params);
69537
+ }) => custom((data) => data instanceof cls, params, true);
69449
69538
  const stringType = ZodString.create;
69450
69539
  const numberType = ZodNumber.create;
69451
69540
  const nanType = ZodNaN.create;
@@ -69484,8 +69573,8 @@ const oboolean = () => booleanType().optional();
69484
69573
 
69485
69574
  var mod = /*#__PURE__*/Object.freeze({
69486
69575
  __proto__: null,
69487
- ZodParsedType: ZodParsedType,
69488
69576
  getParsedType: getParsedType,
69577
+ ZodParsedType: ZodParsedType,
69489
69578
  makeIssue: makeIssue,
69490
69579
  EMPTY_PATH: EMPTY_PATH,
69491
69580
  addIssueToContext: addIssueToContext,
@@ -69720,6 +69809,7 @@ async function executeCompleteFlow(applications, identityFqdn2) {
69720
69809
  applications: result
69721
69810
  }
69722
69811
  };
69812
+ completed("Logged in");
69723
69813
  return session;
69724
69814
  }
69725
69815
  async function refreshTokens(token, applications, fqdn) {
@@ -75667,26 +75757,6 @@ var yaml = /*#__PURE__*/Object.freeze({
75667
75757
  encode: encode
75668
75758
  });
75669
75759
 
75670
- const schema = {
75671
- appInfo: {
75672
- type: "array",
75673
- items: {
75674
- type: "object",
75675
- properties: {
75676
- appId: {
75677
- type: "string"
75678
- },
75679
- orgId: {
75680
- type: "string"
75681
- },
75682
- storeFqdn: {
75683
- type: "string"
75684
- }
75685
- }
75686
- }
75687
- }
75688
- };
75689
-
75690
75760
  var source = {exports: {}};
75691
75761
 
75692
75762
  var isObj$1 = value => {
@@ -84174,7 +84244,7 @@ var mimicFn_1 = mimicFn$1;
84174
84244
 
84175
84245
  const mimicFn = mimicFn_1;
84176
84246
 
84177
- var debounceFn = (inputFunction, options = {}) => {
84247
+ var debounceFn = (inputFunction, options) => {
84178
84248
  if (typeof inputFunction !== 'function') {
84179
84249
  throw new TypeError(`Expected the first argument to be a function, got \`${typeof inputFunction}\``);
84180
84250
  }
@@ -84707,30 +84777,54 @@ module.exports.default = Conf;
84707
84777
  var Conf = /*@__PURE__*/getDefaultExportFromCjs(source.exports);
84708
84778
 
84709
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
+ };
84710
84799
  const cliKit = new Conf({
84711
84800
  schema,
84712
84801
  migrations,
84713
84802
  projectName: "shopify-cli-kit",
84714
84803
  projectVersion: cliKitPackageJson.version
84715
84804
  });
84716
- function getAppInfo(appId) {
84805
+ function getAppInfo(directory) {
84717
84806
  const apps = cliKit.get("appInfo") ?? [];
84718
- return apps.find((app) => app.appId === appId);
84807
+ return apps.find((app) => app.directory === directory);
84719
84808
  }
84720
- function setAppInfo(appId, data) {
84809
+ function setAppInfo(options) {
84721
84810
  const apps = cliKit.get("appInfo") ?? [];
84722
- const index = apps.findIndex((saved) => saved.appId === appId);
84811
+ const index = apps.findIndex((saved) => saved.directory === options.directory);
84723
84812
  if (index === -1) {
84724
- apps.push({ appId, storeFqdn: data.storeFqdn, orgId: data.orgId });
84813
+ apps.push(options);
84725
84814
  } else {
84726
84815
  const app = apps[index];
84727
- apps[index] = { appId, storeFqdn: data.storeFqdn ?? app.storeFqdn, orgId: data.orgId ?? app.orgId };
84816
+ apps[index] = {
84817
+ appId: options.appId,
84818
+ directory: options.directory,
84819
+ storeFqdn: options.storeFqdn ?? app.storeFqdn,
84820
+ orgId: options.orgId ?? app.orgId
84821
+ };
84728
84822
  }
84729
84823
  cliKit.set("appInfo", apps);
84730
84824
  }
84731
- function clearAppInfo(appId) {
84825
+ function clearAppInfo(directory) {
84732
84826
  const apps = cliKit.get("appInfo") ?? [];
84733
- const index = apps.findIndex((saved) => saved.appId === appId);
84827
+ const index = apps.findIndex((saved) => saved.directory === directory);
84734
84828
  if (index !== -1) {
84735
84829
  apps.splice(index, 1);
84736
84830
  }
@@ -170488,7 +170582,7 @@ const printDocASTReducer = {
170488
170582
  * print all items together separated by separator if provided
170489
170583
  */
170490
170584
 
170491
- function join(maybeArray, separator = '') {
170585
+ function join(maybeArray, separator) {
170492
170586
  var _maybeArray$filter$jo;
170493
170587
 
170494
170588
  return (_maybeArray$filter$jo =
@@ -172636,10 +172730,20 @@ var cli = /*#__PURE__*/Object.freeze({
172636
172730
  const generateRandomUUID = () => {
172637
172731
  return randomUUID();
172638
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
+ };
172639
172742
 
172640
172743
  var id = /*#__PURE__*/Object.freeze({
172641
172744
  __proto__: null,
172642
- generateRandomUUID: generateRandomUUID
172745
+ generateRandomUUID: generateRandomUUID,
172746
+ generateShortId: generateShortId
172643
172747
  });
172644
172748
 
172645
172749
  async function directory(callback) {
@@ -172691,4 +172795,4 @@ var plugins = /*#__PURE__*/Object.freeze({
172691
172795
  });
172692
172796
 
172693
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 };
172694
- //# sourceMappingURL=index-3980770e.js.map
172798
+ //# sourceMappingURL=index-814fd0de.js.map