@shopify/cli-kit 1.1.1 → 2.0.1

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,12 @@
1
1
  # @shopify/cli-kit
2
2
 
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 9cb99f12: Add new UI selection type: autocomplete
8
+ - 882e54e6: Improve validation of --api-key and --store flags for dev
9
+
3
10
  ## 1.1.1
4
11
 
5
12
  ### Patch Changes
@@ -2687,7 +2687,7 @@ const highlight = (input, color) => {
2687
2687
  };
2688
2688
  };
2689
2689
 
2690
- class AutoComplete extends Select$3 {
2690
+ class AutoComplete$1 extends Select$3 {
2691
2691
  constructor(options) {
2692
2692
  super(options);
2693
2693
  this.cursorShow();
@@ -2785,7 +2785,7 @@ class AutoComplete extends Select$3 {
2785
2785
  }
2786
2786
  }
2787
2787
 
2788
- var autocomplete = AutoComplete;
2788
+ var autocomplete = AutoComplete$1;
2789
2789
 
2790
2790
  const utils$r = utils$z;
2791
2791
 
@@ -5109,6 +5109,44 @@ exp('StringPrompt');
5109
5109
 
5110
5110
  var enquirer = Enquirer;
5111
5111
 
5112
+ class AutoComplete extends enquirer.AutoComplete {
5113
+ constructor(options) {
5114
+ const originalResult = options.result;
5115
+ options.result = (value) => {
5116
+ const answer = this.focused.value || this.focused.name || value;
5117
+ if (originalResult) {
5118
+ return originalResult(answer);
5119
+ }
5120
+ return answer;
5121
+ };
5122
+ super(options);
5123
+ this.styles.primary = ansiColors.exports.magenta;
5124
+ this.styles.em = ansiColors.exports.magenta;
5125
+ }
5126
+ pointer(_choice, i) {
5127
+ const color = this.styles.primary;
5128
+ const showPointer = !this.state.multiple && this.state.index === i;
5129
+ return showPointer ? color(">") : " ";
5130
+ }
5131
+ prefix(_state) {
5132
+ const color = this.styles.primary.bold;
5133
+ return this.state.status === "submitted" ? color("\u2714") : color("?");
5134
+ }
5135
+ format() {
5136
+ if (!this.focused)
5137
+ return this.input;
5138
+ if (this.options.multiple && this.state.submitted) {
5139
+ return this.selected.map((ch) => this.styles.primary(ch.message)).join(", ");
5140
+ }
5141
+ if (this.state.submitted) {
5142
+ this.value = this.focused.value;
5143
+ this.input = this.focused.value;
5144
+ return this.styles.primary(this.focused.name);
5145
+ }
5146
+ return this.input;
5147
+ }
5148
+ }
5149
+
5112
5150
  class Input extends enquirer.StringPrompt {
5113
5151
  constructor(options) {
5114
5152
  super(options);
@@ -10513,6 +10551,8 @@ function mapper$1(question) {
10513
10551
  return new Input(question);
10514
10552
  } else if (question.type === "select") {
10515
10553
  return new Select(question);
10554
+ } else if (question.type === "autocomplete") {
10555
+ return new AutoComplete(question);
10516
10556
  }
10517
10557
  return void 0;
10518
10558
  }
@@ -17576,7 +17616,7 @@ var path$u = /*#__PURE__*/Object.freeze({
17576
17616
  });
17577
17617
 
17578
17618
  var name = "@shopify/cli-kit";
17579
- var version$4 = "1.1.1";
17619
+ var version$4 = "2.0.1";
17580
17620
  var description$1 = "A set of utilities, interfaces, and models that are common across all the platform features";
17581
17621
  var keywords = [
17582
17622
  "shopify",
@@ -17616,7 +17656,7 @@ var eslintConfig = {
17616
17656
  ]
17617
17657
  };
17618
17658
  var engines = {
17619
- node: "^14.13.1 || ^16.0.0 || ^17.0.0"
17659
+ node: "^14.13.1 || ^16.0.0 || ^17.0.0 || ^18.0.0"
17620
17660
  };
17621
17661
  var os$5 = [
17622
17662
  "darwin",
@@ -17686,11 +17726,11 @@ var cliKitPackageJson = {
17686
17726
  devDependencies: devDependencies
17687
17727
  };
17688
17728
 
17689
- var version$3 = "1.1.1";
17729
+ var version$3 = "2.0.1";
17690
17730
 
17691
- var version$2 = "1.1.1";
17731
+ var version$2 = "2.0.1";
17692
17732
 
17693
- var version$1 = "1.1.1";
17733
+ var version$1 = "2.0.1";
17694
17734
 
17695
17735
  const homedir$1 = os$7.homedir();
17696
17736
  const tmpdir$1 = os$7.tmpdir();
@@ -19672,25 +19712,19 @@ const exec = (command, args, options) => {
19672
19712
  return commandProcess;
19673
19713
  };
19674
19714
  const concurrentExec = async (commands) => {
19675
- const abortController = new AbortController();
19676
- try {
19677
- await concurrent(commands.map((command) => {
19678
- return {
19679
- prefix: command.prefix,
19680
- action: async (stdout, stderr) => {
19681
- await exec(command.executable, command.args, {
19682
- stdout,
19683
- stderr,
19684
- cwd: command.cwd,
19685
- signal: abortController.signal
19686
- });
19687
- }
19688
- };
19689
- }));
19690
- } catch (error) {
19691
- abortController.abort();
19692
- throw error;
19693
- }
19715
+ await concurrent(commands.map((command) => {
19716
+ return {
19717
+ prefix: command.prefix,
19718
+ action: async (stdout, stderr, signal) => {
19719
+ await exec(command.executable, command.args, {
19720
+ stdout,
19721
+ stderr,
19722
+ cwd: command.cwd,
19723
+ signal
19724
+ });
19725
+ }
19726
+ };
19727
+ }));
19694
19728
  };
19695
19729
 
19696
19730
  var system = /*#__PURE__*/Object.freeze({
@@ -25005,7 +25039,7 @@ const info = (content2) => {
25005
25039
  };
25006
25040
  const success = (content2) => {
25007
25041
  if (shouldOutput("info")) {
25008
- consoleLog(colors$9.bold(`${colors$9.magenta("\u2714")} Success! ${stringifyMessage(content2)}`));
25042
+ consoleLog(colors$9.bold(`${colors$9.green("\u2714")} Success! ${stringifyMessage(content2)}.`));
25009
25043
  }
25010
25044
  };
25011
25045
  const debug$5 = (content2) => {
@@ -25076,36 +25110,41 @@ const message = (content2, level = "info") => {
25076
25110
  }
25077
25111
  };
25078
25112
  async function concurrent(processes) {
25079
- const colors2 = [token.yellow, token.cyan, token.magenta, token.green];
25113
+ const abortController = new AbortController();
25114
+ const concurrentColors = [token.yellow, token.cyan, token.magenta, token.green];
25080
25115
  const prefixColumnSize = Math.max(...processes.map((process2) => process2.prefix.length));
25081
25116
  function linePrefix(prefix, index) {
25082
- const colorIndex = index < colors2.length ? index : index % colors2.length;
25083
- const color = colors2[colorIndex];
25084
- const lineContents = `${" ".repeat(prefixColumnSize - prefix.length)}[${prefix}]: `;
25085
- return color(lineContents);
25086
- }
25087
- await Promise.all(processes.map(async (process2, index) => {
25088
- const stdout = new Writable$1({
25089
- write(chunk, _encoding, next) {
25090
- const lines = stripAnsiEraseCursorEscapeCharacters(chunk.toString("ascii")).split(/\n/);
25091
- for (const line of lines) {
25092
- info(content`${linePrefix(process2.prefix, index)}${line}`);
25117
+ const colorIndex = index < concurrentColors.length ? index : index % concurrentColors.length;
25118
+ const color = concurrentColors[colorIndex];
25119
+ return color(`${prefix}:${" ".repeat(prefixColumnSize - prefix.length)} `);
25120
+ }
25121
+ try {
25122
+ await Promise.all(processes.map(async (process2, index) => {
25123
+ const stdout = new Writable$1({
25124
+ write(chunk, _encoding, next) {
25125
+ const lines = stripAnsiEraseCursorEscapeCharacters(chunk.toString("ascii")).split(/\n/);
25126
+ for (const line of lines) {
25127
+ info(content`${linePrefix(process2.prefix, index)}${line}`);
25128
+ }
25129
+ next();
25093
25130
  }
25094
- next();
25095
- }
25096
- });
25097
- const stderr = new Writable$1({
25098
- write(chunk, _encoding, next) {
25099
- const lines = stripAnsiEraseCursorEscapeCharacters(chunk.toString("ascii")).split(/\n/);
25100
- for (const line of lines) {
25101
- consoleLog("ERROR");
25102
- message(content`${linePrefix(process2.prefix, index)}${line}`, "error");
25131
+ });
25132
+ const stderr = new Writable$1({
25133
+ write(chunk, _encoding, next) {
25134
+ const lines = stripAnsiEraseCursorEscapeCharacters(chunk.toString("ascii")).split(/\n/);
25135
+ for (const line of lines) {
25136
+ consoleLog("ERROR");
25137
+ message(content`${linePrefix(process2.prefix, index)}${line}`, "error");
25138
+ }
25139
+ next();
25103
25140
  }
25104
- next();
25105
- }
25106
- });
25107
- await process2.action(stdout, stderr);
25108
- }));
25141
+ });
25142
+ await process2.action(stdout, stderr, abortController.signal);
25143
+ }));
25144
+ } catch (_error) {
25145
+ abortController.abort();
25146
+ throw _error;
25147
+ }
25109
25148
  }
25110
25149
  const eraseCursorAnsiRegex = [
25111
25150
  "2K",
@@ -39456,7 +39495,7 @@ class Body$1 {
39456
39495
  return formData;
39457
39496
  }
39458
39497
 
39459
- const {toFormData} = await import('./multipart-parser-561fdeba.js');
39498
+ const {toFormData} = await import('./multipart-parser-daf59a75.js');
39460
39499
  return toFormData(this.body, ct);
39461
39500
  }
39462
39501
 
@@ -170097,7 +170136,7 @@ const FindOrganizationQuery = dist$1.gql`
170097
170136
 
170098
170137
  const AllOrganizationsQuery = dist$1.gql`
170099
170138
  {
170100
- organizations {
170139
+ organizations(first: 200) {
170101
170140
  nodes {
170102
170141
  id
170103
170142
  businessName
@@ -170148,12 +170187,27 @@ const UpdateURLsQuery = dist$1.gql`
170148
170187
  }
170149
170188
  `;
170150
170189
 
170190
+ const FindAppQuery = dist$1.gql`
170191
+ query FindApp($apiKey: String!) {
170192
+ app(apiKey: $apiKey) {
170193
+ id
170194
+ title
170195
+ apiKey
170196
+ apiSecretKeys {
170197
+ secret
170198
+ }
170199
+ appType
170200
+ }
170201
+ }
170202
+ `;
170203
+
170151
170204
  var index = /*#__PURE__*/Object.freeze({
170152
170205
  __proto__: null,
170153
170206
  FindOrganizationQuery: FindOrganizationQuery,
170154
170207
  AllOrganizationsQuery: AllOrganizationsQuery,
170155
170208
  CreateAppQuery: CreateAppQuery,
170156
- UpdateURLsQuery: UpdateURLsQuery
170209
+ UpdateURLsQuery: UpdateURLsQuery,
170210
+ FindAppQuery: FindAppQuery
170157
170211
  });
170158
170212
 
170159
170213
  var api = /*#__PURE__*/Object.freeze({
@@ -170533,7 +170587,7 @@ function getLocalHosts(additional) {
170533
170587
  return Array.from(hosts);
170534
170588
  }
170535
170589
 
170536
- function getRandomPort() {
170590
+ async function getRandomPort() {
170537
170591
  return getRandomPort$1();
170538
170592
  }
170539
170593
 
@@ -170543,4 +170597,4 @@ var port = /*#__PURE__*/Object.freeze({
170543
170597
  });
170544
170598
 
170545
170599
  export { npm as A, port as B, constants$2 as C, FormData$2 as F, 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$1 as h, environment as i, session as j, schema$2 as k, toml as l, tunnel as m, store as n, output as o, path$u as p, api as q, http$2 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 };
170546
- //# sourceMappingURL=index-8fb3a5d8.js.map
170600
+ //# sourceMappingURL=index-f61d934a.js.map