@shopify/cli-kit 3.0.10 → 3.0.11

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,11 @@
1
1
  # @shopify/cli-kit
2
2
 
3
+ ## 3.0.11
4
+
5
+ ### Patch Changes
6
+
7
+ - 1f10093b: Add support for tokenized messages in errors
8
+
3
9
  ## 3.0.10
4
10
 
5
11
  ## 3.0.9
@@ -12317,7 +12317,7 @@ var path$w = /*#__PURE__*/Object.freeze({
12317
12317
  });
12318
12318
 
12319
12319
  var name = "@shopify/cli-kit";
12320
- var version$1 = "3.0.10";
12320
+ var version$1 = "3.0.11";
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",
@@ -12380,12 +12380,12 @@ var devDependencies = {
12380
12380
  "abort-controller": "^3.0.0",
12381
12381
  "ansi-colors": "^4.1.1",
12382
12382
  "change-case": "^4.1.2",
12383
- "color-json": "^2.0.1",
12384
12383
  commondir: "^1.0.1",
12385
12384
  conf: "^10.1.2",
12386
12385
  "cross-zip": "^4.0.0",
12387
12386
  del: "^6.0.0",
12388
12387
  enquirer: "^2.3.6",
12388
+ "color-json": "^2.0.1",
12389
12389
  "env-paths": "^3.0.0",
12390
12390
  execa: "^6.0.0",
12391
12391
  "fast-glob": "^3.2.11",
@@ -21127,7 +21127,7 @@ const defaultColors = {
21127
21127
  key: 'white'
21128
21128
  };
21129
21129
 
21130
- var colorJson$1 = supportsColor() ? function syntaxHighlight(json, colors = defaultColors, colorMap = defaultColorMap, spacing = 2) { // thanks: https://stackoverflow.com/a/7220510/4151489
21130
+ var colorJson = supportsColor() ? function syntaxHighlight(json, colors = defaultColors, colorMap = defaultColorMap, spacing = 2) { // thanks: https://stackoverflow.com/a/7220510/4151489
21131
21131
  if (typeof json != 'string') json = JSON.stringify(json, undefined, spacing);
21132
21132
  else json = JSON.stringify(JSON.parse(json), undefined, spacing);
21133
21133
  return colorMap[colors.separator] + json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
@@ -21157,38 +21157,47 @@ const token = {
21157
21157
  genericShellCommand: (value) => {
21158
21158
  return new ContentToken(value, {}, 0 /* Command */);
21159
21159
  },
21160
+ json: (value) => {
21161
+ return new ContentToken(value, {}, 1 /* Json */);
21162
+ },
21160
21163
  path: (value) => {
21161
- return new ContentToken(value, {}, 1 /* Path */);
21164
+ return new ContentToken(value, {}, 2 /* Path */);
21162
21165
  },
21163
21166
  link: (value, link) => {
21164
- return new ContentToken(value, { link }, 2 /* Link */);
21167
+ return new ContentToken(value, { link }, 3 /* Link */);
21165
21168
  },
21166
21169
  heading: (value) => {
21167
- return new ContentToken(value, {}, 3 /* Heading */);
21170
+ return new ContentToken(value, {}, 4 /* Heading */);
21168
21171
  },
21169
21172
  subheading: (value) => {
21170
- return new ContentToken(value, {}, 4 /* SubHeading */);
21173
+ return new ContentToken(value, {}, 5 /* SubHeading */);
21171
21174
  },
21172
21175
  italic: (value) => {
21173
- return new ContentToken(value, {}, 5 /* Italic */);
21176
+ return new ContentToken(value, {}, 6 /* Italic */);
21174
21177
  },
21175
21178
  errorText: (value) => {
21176
- return new ContentToken(value, {}, 6 /* ErrorText */);
21179
+ return new ContentToken(value, {}, 7 /* ErrorText */);
21177
21180
  },
21178
21181
  cyan: (value) => {
21179
- return new ContentToken(value, {}, 8 /* Cyan */);
21182
+ return new ContentToken(value, {}, 9 /* Cyan */);
21180
21183
  },
21181
21184
  yellow: (value) => {
21182
- return new ContentToken(value, {}, 7 /* Yellow */);
21185
+ return new ContentToken(value, {}, 8 /* Yellow */);
21183
21186
  },
21184
21187
  magenta: (value) => {
21185
- return new ContentToken(value, {}, 9 /* Magenta */);
21188
+ return new ContentToken(value, {}, 10 /* Magenta */);
21186
21189
  },
21187
21190
  green: (value) => {
21188
- return new ContentToken(value, {}, 10 /* Green */);
21191
+ return new ContentToken(value, {}, 11 /* Green */);
21189
21192
  },
21190
- command: (dependencyManager, scriptName, ...scriptArgs) => {
21193
+ packagejsonScript: (dependencyManager, scriptName, ...scriptArgs) => {
21191
21194
  return new ContentToken(formatPackageManagerCommand(dependencyManager, scriptName, scriptArgs), {}, 0 /* Command */);
21195
+ },
21196
+ successIcon: () => {
21197
+ return new ContentToken("\u2714", {}, 11 /* Green */);
21198
+ },
21199
+ failIcon: () => {
21200
+ return new ContentToken("\u2716", {}, 7 /* ErrorText */);
21192
21201
  }
21193
21202
  };
21194
21203
  function formatPackageManagerCommand(dependencyManager, scriptName, scriptArgs) {
@@ -21229,34 +21238,41 @@ function content(strings, ...keys) {
21229
21238
  case 0 /* Command */:
21230
21239
  output += colors$9.bold(colors$9.yellow(enumToken.value));
21231
21240
  break;
21232
- case 1 /* Path */:
21241
+ case 2 /* Path */:
21233
21242
  output += colors$9.italic(enumToken.value);
21234
21243
  break;
21235
- case 2 /* Link */:
21244
+ case 1 /* Json */:
21245
+ try {
21246
+ output += colorJson(enumToken.value ?? {});
21247
+ } catch (_) {
21248
+ output += JSON.stringify(enumToken.value ?? {}, null, 2);
21249
+ }
21250
+ break;
21251
+ case 3 /* Link */:
21236
21252
  output += terminalLink(colors$9.green(enumToken.value), enumToken.metadata.link ?? "");
21237
21253
  break;
21238
- case 3 /* Heading */:
21254
+ case 4 /* Heading */:
21239
21255
  output += colors$9.bold.underline(enumToken.value);
21240
21256
  break;
21241
- case 4 /* SubHeading */:
21257
+ case 5 /* SubHeading */:
21242
21258
  output += colors$9.underline(enumToken.value);
21243
21259
  break;
21244
- case 5 /* Italic */:
21260
+ case 6 /* Italic */:
21245
21261
  output += colors$9.italic(enumToken.value);
21246
21262
  break;
21247
- case 6 /* ErrorText */:
21263
+ case 7 /* ErrorText */:
21248
21264
  output += colors$9.bold.redBright(enumToken.value);
21249
21265
  break;
21250
- case 7 /* Yellow */:
21266
+ case 8 /* Yellow */:
21251
21267
  output += colors$9.yellow(enumToken.value);
21252
21268
  break;
21253
- case 8 /* Cyan */:
21269
+ case 9 /* Cyan */:
21254
21270
  output += colors$9.cyan(enumToken.value);
21255
21271
  break;
21256
- case 9 /* Magenta */:
21272
+ case 10 /* Magenta */:
21257
21273
  output += colors$9.magenta(enumToken.value);
21258
21274
  break;
21259
- case 10 /* Green */:
21275
+ case 11 /* Green */:
21260
21276
  output += colors$9.green(enumToken.value);
21261
21277
  break;
21262
21278
  }
@@ -21319,9 +21335,6 @@ const warn = (content2) => {
21319
21335
  const newline = () => {
21320
21336
  console.log();
21321
21337
  };
21322
- const colorJson = (json) => {
21323
- return colorJson$1(json);
21324
- };
21325
21338
  const error$k = async (content2) => {
21326
21339
  if (shouldOutput("error")) {
21327
21340
  if (!content2.message) {
@@ -21459,7 +21472,6 @@ var output = /*#__PURE__*/Object.freeze({
21459
21472
  debug: debug$5,
21460
21473
  warn: warn,
21461
21474
  newline: newline,
21462
- colorJson: colorJson,
21463
21475
  error: error$k,
21464
21476
  stringifyMessage: stringifyMessage,
21465
21477
  concurrent: concurrent,
@@ -21470,7 +21482,7 @@ var output = /*#__PURE__*/Object.freeze({
21470
21482
  sourceMapSupport.install();
21471
21483
  class Fatal extends Error {
21472
21484
  constructor(message, type, tryMessage = null) {
21473
- super(message);
21485
+ super(stringifyMessage(message));
21474
21486
  this.tryMessage = tryMessage;
21475
21487
  this.type = type;
21476
21488
  }
@@ -40744,7 +40756,7 @@ class Body$1 {
40744
40756
  return formData;
40745
40757
  }
40746
40758
 
40747
- const {toFormData} = await import('./multipart-parser-44064309.js');
40759
+ const {toFormData} = await import('./multipart-parser-589b8668.js');
40748
40760
  return toFormData(this.body, ct);
40749
40761
  }
40750
40762
 
@@ -172311,10 +172323,10 @@ ${sanitizedHeadersOutput(headers)}
172311
172323
  return response;
172312
172324
  } catch (error) {
172313
172325
  if (error instanceof dist$1.ClientError) {
172314
- const errorMessage = `
172315
- The Admin GraphQL API responded unsuccessfully with the HTTP status ${error.response.status} and errors:
172326
+ const errorMessage = content`
172327
+ The Admin GraphQL API responded unsuccessfully with the HTTP status ${`${error.response.status}`} and errors:
172316
172328
 
172317
- ${colorJson(error.response.errors)}
172329
+ ${token.json(error.response.errors)}
172318
172330
  `;
172319
172331
  const abortError = new Abort(errorMessage);
172320
172332
  abortError.stack = error.stack;
@@ -172488,8 +172500,8 @@ const GenerateSignedUploadUrl = dist$1.gql`
172488
172500
  `;
172489
172501
 
172490
172502
  const CreateDeployment = dist$1.gql`
172491
- mutation CreateDeployment($apiKey: String!, $uuid: String!, $bundleUrl: String!) {
172492
- deploymentCreate(input: {apiKey: $apiKey, uuid: $uuid, bundleUrl: $bundleUrl}) {
172503
+ mutation CreateDeployment($apiKey: String!, $uuid: String!, $bundleUrl: String!, $extensions: [ExtensionSettings!]) {
172504
+ deploymentCreate(input: {apiKey: $apiKey, uuid: $uuid, bundleUrl: $bundleUrl, extensions: $extensions}) {
172493
172505
  deployment {
172494
172506
  uuid
172495
172507
  }
@@ -172707,10 +172719,10 @@ var index = /*#__PURE__*/Object.freeze({
172707
172719
  AppFunctionSetMutation: AppFunctionSetMutation
172708
172720
  });
172709
172721
 
172710
- async function request(query, token, variables) {
172722
+ async function request(query, token$1, variables) {
172711
172723
  const fqdn = await partners$1();
172712
172724
  const url = `https://${fqdn}/api/cli/graphql`;
172713
- const headers = await buildHeaders(token);
172725
+ const headers = await buildHeaders(token$1);
172714
172726
  debug$5(`
172715
172727
  Sending Partners GraphQL request:
172716
172728
  ${query}
@@ -172726,10 +172738,10 @@ ${sanitizedHeadersOutput(headers)}
172726
172738
  return response;
172727
172739
  } catch (error) {
172728
172740
  if (error instanceof dist$1.ClientError) {
172729
- const errorMessage = `
172730
- The Partners GraphQL API responded unsuccessfully with the HTTP status ${error.response.status} and errors:
172741
+ const errorMessage = content`
172742
+ The Partners GraphQL API responded unsuccessfully with the HTTP status ${`${error.response.status}`} and errors:
172731
172743
 
172732
- ${colorJson(error.response.errors)}
172744
+ ${token.json(error.response.errors)}
172733
172745
  `;
172734
172746
  const abortError = new Abort(errorMessage);
172735
172747
  abortError.stack = error.stack;
@@ -173465,4 +173477,4 @@ var plugins = /*#__PURE__*/Object.freeze({
173465
173477
  });
173466
173478
 
173467
173479
  export { npm as A, port as B, cli as C, id as D, temporary as E, FormData$3 as F, dotEnv as G, abort as H, constants$2 as I, plugins as J, 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 };
173468
- //# sourceMappingURL=index-84d3a745.js.map
173480
+ //# sourceMappingURL=index-ddf77494.js.map