@shopify/cli-kit 2.0.7 → 2.0.10

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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @shopify/cli-kit
2
2
 
3
+ ## 2.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 31b75488: Derive app name from package.json, not TOML config
8
+
9
+ ## 2.0.9
10
+
11
+ ### Patch Changes
12
+
13
+ - 4170ac8e: Improve copies related to `dev`
14
+ - 4170ac8e: Add new `completed` helper to output
15
+
16
+ ## 2.0.8
17
+
18
+ ### Patch Changes
19
+
20
+ - Make envfile a dependency to mitigate bundling issues
21
+
3
22
  ## 2.0.7
4
23
 
5
24
  ### Patch Changes
@@ -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.7";
12320
+ var version$4 = "2.0.10";
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",
@@ -12369,7 +12369,8 @@ var dependencies$1 = {
12369
12369
  keytar: "^7.9.0",
12370
12370
  open: "^8.4.0",
12371
12371
  "source-map-support": "^0.5.21",
12372
- stacktracey: "^2.1.8"
12372
+ stacktracey: "^2.1.8",
12373
+ envfile: "^6.17.0"
12373
12374
  };
12374
12375
  var devDependencies = {
12375
12376
  "@iarna/toml": "^2.2.5",
@@ -12385,7 +12386,6 @@ var devDependencies = {
12385
12386
  del: "^6.0.0",
12386
12387
  enquirer: "^2.3.6",
12387
12388
  "env-paths": "^3.0.0",
12388
- envfile: "^6.17.0",
12389
12389
  execa: "^6.0.0",
12390
12390
  "fast-glob": "^3.2.11",
12391
12391
  "find-up": "^6.2.0",
@@ -12432,11 +12432,11 @@ var cliKitPackageJson = {
12432
12432
  devDependencies: devDependencies
12433
12433
  };
12434
12434
 
12435
- var version$3 = "2.0.7";
12435
+ var version$3 = "2.0.10";
12436
12436
 
12437
- var version$2 = "2.0.7";
12437
+ var version$2 = "2.0.10";
12438
12438
 
12439
- var version$1 = "2.0.7";
12439
+ var version$1 = "2.0.10";
12440
12440
 
12441
12441
  const homedir$1 = os$8.homedir();
12442
12442
  const tmpdir$1 = os$8.tmpdir();
@@ -21110,17 +21110,26 @@ 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 */);
21124
21133
  }
21125
21134
  };
21126
21135
  class TokenizedString {
@@ -21150,16 +21159,25 @@ function content(strings, ...keys) {
21150
21159
  case 2 /* Link */:
21151
21160
  output += terminalLink(colors$9.green(enumToken.value), enumToken.metadata.link ?? "");
21152
21161
  break;
21153
- case 3 /* Yellow */:
21162
+ case 3 /* Heading */:
21163
+ output += colors$9.bold.underline(enumToken.value);
21164
+ break;
21165
+ case 4 /* SubHeading */:
21166
+ output += colors$9.underline(enumToken.value);
21167
+ break;
21168
+ case 5 /* ErrorText */:
21169
+ output += colors$9.bold.redBright(enumToken.value);
21170
+ break;
21171
+ case 6 /* Yellow */:
21154
21172
  output += colors$9.yellow(enumToken.value);
21155
21173
  break;
21156
- case 4 /* Cyan */:
21174
+ case 7 /* Cyan */:
21157
21175
  output += colors$9.cyan(enumToken.value);
21158
21176
  break;
21159
- case 5 /* Magenta */:
21177
+ case 8 /* Magenta */:
21160
21178
  output += colors$9.magenta(enumToken.value);
21161
21179
  break;
21162
- case 6 /* Green */:
21180
+ case 9 /* Green */:
21163
21181
  output += colors$9.green(enumToken.value);
21164
21182
  break;
21165
21183
  }
@@ -21205,7 +21223,12 @@ const info = (content2) => {
21205
21223
  };
21206
21224
  const success = (content2) => {
21207
21225
  if (shouldOutput("info")) {
21208
- consoleLog(colors$9.bold(`${colors$9.green("\u2714")} Success! ${stringifyMessage(content2)}.`));
21226
+ consoleLog(colors$9.bold(`\u2705 Success! ${stringifyMessage(content2)}.`));
21227
+ }
21228
+ };
21229
+ const completed = (content2) => {
21230
+ if (shouldOutput("info")) {
21231
+ consoleLog(`${colors$9.green("\u2714")} ${stringifyMessage(content2)}.`);
21209
21232
  }
21210
21233
  };
21211
21234
  const debug$5 = (content2) => {
@@ -21331,9 +21354,12 @@ function withOrWithoutStyle(message2) {
21331
21354
  if (shouldDisplayColors()) {
21332
21355
  return message2;
21333
21356
  } else {
21334
- return colors$9.unstyle(message2);
21357
+ return unstyled(message2);
21335
21358
  }
21336
21359
  }
21360
+ function unstyled(message2) {
21361
+ return colors$9.unstyle(message2);
21362
+ }
21337
21363
  function shouldDisplayColors() {
21338
21364
  return Boolean(process.stdout.isTTY || process.env.FORCE_COLOR);
21339
21365
  }
@@ -21341,17 +21367,20 @@ function shouldDisplayColors() {
21341
21367
  var output = /*#__PURE__*/Object.freeze({
21342
21368
  __proto__: null,
21343
21369
  token: token,
21370
+ TokenizedString: TokenizedString,
21344
21371
  content: content,
21345
21372
  currentLogLevel: currentLogLevel,
21346
21373
  shouldOutput: shouldOutput,
21347
21374
  info: info,
21348
21375
  success: success,
21376
+ completed: completed,
21349
21377
  debug: debug$5,
21350
21378
  warn: warn,
21351
21379
  newline: newline,
21352
21380
  error: error$k,
21353
21381
  stringifyMessage: stringifyMessage,
21354
21382
  concurrent: concurrent,
21383
+ unstyled: unstyled,
21355
21384
  shouldDisplayColors: shouldDisplayColors
21356
21385
  });
21357
21386
 
@@ -30879,6 +30908,21 @@ function camelCase(input, options) {
30879
30908
  return pascalCase(input, __assign$1({ transform: camelCaseTransform }, options));
30880
30909
  }
30881
30910
 
30911
+ /**
30912
+ * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
30913
+ */
30914
+ /**
30915
+ * Upper case as a function.
30916
+ */
30917
+ function upperCase(str) {
30918
+ return str.toUpperCase();
30919
+ }
30920
+
30921
+ function constantCase(input, options) {
30922
+ if (options === void 0) { options = {}; }
30923
+ return noCase(input, __assign$1({ delimiter: "_", transform: upperCase }, options));
30924
+ }
30925
+
30882
30926
  function dotCase(input, options) {
30883
30927
  if (options === void 0) { options = {}; }
30884
30928
  return noCase(input, __assign$1({ delimiter: "." }, options));
@@ -30924,7 +30968,8 @@ var string = /*#__PURE__*/Object.freeze({
30924
30968
  normalizeStoreName: normalizeStoreName,
30925
30969
  camelize: camelCase,
30926
30970
  hyphenize: paramCase,
30927
- underscore: snakeCase
30971
+ underscore: snakeCase,
30972
+ constantize: constantCase
30928
30973
  });
30929
30974
 
30930
30975
  var dist$6 = {};
@@ -40586,7 +40631,7 @@ class Body$1 {
40586
40631
  return formData;
40587
40632
  }
40588
40633
 
40589
- const {toFormData} = await import('./multipart-parser-a191c805.js');
40634
+ const {toFormData} = await import('./multipart-parser-d7cd777b.js');
40590
40635
  return toFormData(this.body, ct);
40591
40636
  }
40592
40637
 
@@ -54549,15 +54594,22 @@ async function install(directory, dependencyManager2, stdout, stderr, signal) {
54549
54594
  const options = { cwd: directory, stdout, stderr, signal };
54550
54595
  await exec$2(dependencyManager2, ["install"], options);
54551
54596
  }
54597
+ async function getPackageName(packageJsonPath) {
54598
+ const packageJsonContent = await packageJSONContents(packageJsonPath);
54599
+ return packageJsonContent.name;
54600
+ }
54552
54601
  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));
54602
+ const packageJsonContent = await packageJSONContents(packageJsonPath);
54557
54603
  const dependencies = packageJsonContent.dependencies ?? {};
54558
54604
  const devDependencies = packageJsonContent.devDependencies ?? {};
54559
54605
  return { ...dependencies, ...devDependencies };
54560
54606
  }
54607
+ async function packageJSONContents(packageJsonPath) {
54608
+ if (!await exists$1(packageJsonPath)) {
54609
+ throw PackageJsonNotFoundError(dirname$1(packageJsonPath));
54610
+ }
54611
+ return JSON.parse(await read$1(packageJsonPath));
54612
+ }
54561
54613
  async function addNPMDependenciesIfNeeded(dependencies, options) {
54562
54614
  const packageJsonPath = join$3(options.directory, "package.json");
54563
54615
  if (!await exists$1(packageJsonPath)) {
@@ -54645,6 +54697,7 @@ var dependency = /*#__PURE__*/Object.freeze({
54645
54697
  dependencyManagerUsedForCreating: dependencyManagerUsedForCreating,
54646
54698
  installNPMDependenciesRecursively: installNPMDependenciesRecursively,
54647
54699
  install: install,
54700
+ getPackageName: getPackageName,
54648
54701
  getDependencies: getDependencies,
54649
54702
  addNPMDependenciesIfNeeded: addNPMDependenciesIfNeeded
54650
54703
  });
@@ -66563,9 +66616,9 @@ const EmptyUrlError = new Abort("We received the authentication redirect but the
66563
66616
  const AuthenticationError = (message) => {
66564
66617
  return new Abort(message);
66565
66618
  };
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...";
66619
+ const MissingCodeError = new Bug(`The authentication can't continue because the redirect doesn't include the code.`);
66620
+ const MissingStateError = new Bug(`The authentication can't continue because the redirect doesn't include the state.`);
66621
+ const redirectResponseBody = `You're logged in on the Shopify CLI in your terminal`;
66569
66622
  const ResponseTimeoutSeconds = 10;
66570
66623
  class RedirectListener {
66571
66624
  static createServer(callback) {
@@ -66626,8 +66679,8 @@ class RedirectListener {
66626
66679
  async function listenRedirect(host, port, url2) {
66627
66680
  const result = await new Promise((resolve, reject) => {
66628
66681
  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`);
66682
+ const message = "\nAuto-open timed out. Open the login page: ";
66683
+ info(content`${message}${token.link("Log in to Shopify Partners", url2)}\n`);
66631
66684
  }, ResponseTimeoutSeconds * 1e3);
66632
66685
  const redirectListener = new RedirectListener({
66633
66686
  host,
@@ -66670,7 +66723,7 @@ async function authorize(scopes, state = randomHex(30)) {
66670
66723
  };
66671
66724
  url = `${url}?${new URLSearchParams(params).toString()}`;
66672
66725
  open(url);
66673
- info("\nTo run this command, first log in to Shopify Partners. We're opening the page for you on your browser...");
66726
+ info("\nTo run this command, log in to Shopify Partners.");
66674
66727
  const result = await listenRedirect(host, port, url);
66675
66728
  if (result.state !== state) {
66676
66729
  throw MismatchStateError;
@@ -69720,6 +69773,7 @@ async function executeCompleteFlow(applications, identityFqdn2) {
69720
69773
  applications: result
69721
69774
  }
69722
69775
  };
69776
+ completed("Logged in");
69723
69777
  return session;
69724
69778
  }
69725
69779
  async function refreshTokens(token, applications, fqdn) {
@@ -84722,6 +84776,7 @@ function setAppInfo(appId, data) {
84722
84776
  const index = apps.findIndex((saved) => saved.appId === appId);
84723
84777
  if (index === -1) {
84724
84778
  apps.push({ appId, storeFqdn: data.storeFqdn, orgId: data.orgId });
84779
+ completed("Updated your project name to match your Shopify app name");
84725
84780
  } else {
84726
84781
  const app = apps[index];
84727
84782
  apps[index] = { appId, storeFqdn: data.storeFqdn ?? app.storeFqdn, orgId: data.orgId ?? app.orgId };
@@ -172691,4 +172746,4 @@ var plugins = /*#__PURE__*/Object.freeze({
172691
172746
  });
172692
172747
 
172693
172748
  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-22ea06c0.js.map
172749
+ //# sourceMappingURL=index-8ab5821f.js.map