@shopify/cli-kit 2.0.5 → 2.0.8

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,25 @@
1
1
  # @shopify/cli-kit
2
2
 
3
+ ## 2.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Make envfile a dependency to mitigate bundling issues
8
+
9
+ ## 2.0.7
10
+
11
+ ### Patch Changes
12
+
13
+ - 0d2e8e50: Allow ui.Question to accept preface string
14
+ - 739e8e9d: Add password type for UI Question
15
+ - c95660a6: Add dotenv module that provides utility functions to read and write .env files
16
+
17
+ ## 2.0.6
18
+
19
+ ### Patch Changes
20
+
21
+ - f7e74d33: Retrieve only non-archived stores
22
+
3
23
  ## 2.0.5
4
24
 
5
25
  ### Patch Changes
@@ -38,6 +38,7 @@ import require$$0$d from 'http2';
38
38
  import require$$1$4 from 'tls';
39
39
  import require$$0$e, { createServer } from 'net';
40
40
  import require$$0$f from 'punycode';
41
+ import { parse as parse$i, stringify as stringify$d } from 'envfile';
41
42
 
42
43
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
43
44
 
@@ -5174,7 +5175,7 @@ class Input extends enquirer.StringPrompt {
5174
5175
  const color = this.styles.primary;
5175
5176
  let prompt = [prefix, message].filter(Boolean).join(" ");
5176
5177
  this.state.prompt = prompt;
5177
- const output = await this.format();
5178
+ const output = this.type === "password" ? await this.formatPassword() : await this.format();
5178
5179
  const help = await this.error() || await this.hint();
5179
5180
  const underline = "\u2594".repeat(Math.max(color.unstyle(output).length - 10, 30));
5180
5181
  if (this.state.submitted) {
@@ -5190,6 +5191,12 @@ ${color(">")} ${output}
5190
5191
  this.write([prompt].filter(Boolean).join("\n"));
5191
5192
  this.restore();
5192
5193
  }
5194
+ formatPassword() {
5195
+ if (!this.keypressed)
5196
+ return "";
5197
+ const color = this.state.submitted ? this.styles.primary : this.styles.muted;
5198
+ return color(this.symbols.asterisk.repeat(this.input.length));
5199
+ }
5193
5200
  }
5194
5201
 
5195
5202
  class Select extends enquirer.Select {
@@ -10457,7 +10464,7 @@ var async$8 = {};
10457
10464
 
10458
10465
  Object.defineProperty(async$8, "__esModule", { value: true });
10459
10466
  async$8.read = void 0;
10460
- function read$4(path, settings, callback) {
10467
+ function read$5(path, settings, callback) {
10461
10468
  settings.fs.lstat(path, (lstatError, lstat) => {
10462
10469
  if (lstatError !== null) {
10463
10470
  callFailureCallback$2(callback, lstatError);
@@ -10483,7 +10490,7 @@ function read$4(path, settings, callback) {
10483
10490
  });
10484
10491
  });
10485
10492
  }
10486
- async$8.read = read$4;
10493
+ async$8.read = read$5;
10487
10494
  function callFailureCallback$2(callback, error) {
10488
10495
  callback(error);
10489
10496
  }
@@ -10495,7 +10502,7 @@ var sync$a = {};
10495
10502
 
10496
10503
  Object.defineProperty(sync$a, "__esModule", { value: true });
10497
10504
  sync$a.read = void 0;
10498
- function read$3(path, settings) {
10505
+ function read$4(path, settings) {
10499
10506
  const lstat = settings.fs.lstatSync(path);
10500
10507
  if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
10501
10508
  return lstat;
@@ -10514,7 +10521,7 @@ function read$3(path, settings) {
10514
10521
  throw error;
10515
10522
  }
10516
10523
  }
10517
- sync$a.read = read$3;
10524
+ sync$a.read = read$4;
10518
10525
 
10519
10526
  var settings$3 = {};
10520
10527
 
@@ -10724,14 +10731,14 @@ const rpl = runParallel_1;
10724
10731
  const constants_1$1 = constants$3;
10725
10732
  const utils$c = utils$d;
10726
10733
  const common$7 = common$8;
10727
- function read$2(directory, settings, callback) {
10734
+ function read$3(directory, settings, callback) {
10728
10735
  if (!settings.stats && constants_1$1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
10729
10736
  readdirWithFileTypes$1(directory, settings, callback);
10730
10737
  return;
10731
10738
  }
10732
10739
  readdir$1(directory, settings, callback);
10733
10740
  }
10734
- async$4.read = read$2;
10741
+ async$4.read = read$3;
10735
10742
  function readdirWithFileTypes$1(directory, settings, callback) {
10736
10743
  settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
10737
10744
  if (readdirError !== null) {
@@ -10829,13 +10836,13 @@ const fsStat$4 = out$3;
10829
10836
  const constants_1 = constants$3;
10830
10837
  const utils$b = utils$d;
10831
10838
  const common$6 = common$8;
10832
- function read$1(directory, settings) {
10839
+ function read$2(directory, settings) {
10833
10840
  if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
10834
10841
  return readdirWithFileTypes(directory, settings);
10835
10842
  }
10836
10843
  return readdir(directory, settings);
10837
10844
  }
10838
- sync$8.read = read$1;
10845
+ sync$8.read = read$2;
10839
10846
  function readdirWithFileTypes(directory, settings) {
10840
10847
  const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
10841
10848
  return dirents.map((dirent) => {
@@ -12310,7 +12317,7 @@ var path$w = /*#__PURE__*/Object.freeze({
12310
12317
  });
12311
12318
 
12312
12319
  var name = "@shopify/cli-kit";
12313
- var version$4 = "2.0.5";
12320
+ var version$4 = "2.0.8";
12314
12321
  var description$1 = "A set of utilities, interfaces, and models that are common across all the platform features";
12315
12322
  var keywords = [
12316
12323
  "shopify",
@@ -12362,7 +12369,8 @@ var dependencies$1 = {
12362
12369
  keytar: "^7.9.0",
12363
12370
  open: "^8.4.0",
12364
12371
  "source-map-support": "^0.5.21",
12365
- stacktracey: "^2.1.8"
12372
+ stacktracey: "^2.1.8",
12373
+ envfile: "^6.17.0"
12366
12374
  };
12367
12375
  var devDependencies = {
12368
12376
  "@iarna/toml": "^2.2.5",
@@ -12424,11 +12432,11 @@ var cliKitPackageJson = {
12424
12432
  devDependencies: devDependencies
12425
12433
  };
12426
12434
 
12427
- var version$3 = "2.0.5";
12435
+ var version$3 = "2.0.8";
12428
12436
 
12429
- var version$2 = "2.0.5";
12437
+ var version$2 = "2.0.8";
12430
12438
 
12431
- var version$1 = "2.0.5";
12439
+ var version$1 = "2.0.8";
12432
12440
 
12433
12441
  const homedir$1 = os$8.homedir();
12434
12442
  const tmpdir$1 = os$8.tmpdir();
@@ -19606,14 +19614,14 @@ function stripUp(path, strip) {
19606
19614
  async function inTemporaryDirectory(callback) {
19607
19615
  return tempy.directory.task(callback);
19608
19616
  }
19609
- async function read(path) {
19617
+ async function read$1(path) {
19610
19618
  const content = await fs$g.readFile(path, { encoding: "utf-8" });
19611
19619
  return content;
19612
19620
  }
19613
19621
  async function copy(from, to) {
19614
19622
  await fs$g.copy(from, to);
19615
19623
  }
19616
- async function write(path, data) {
19624
+ async function write$1(path, data) {
19617
19625
  await fs$g.writeFile(path, data);
19618
19626
  }
19619
19627
  async function append$2(path, data) {
@@ -19662,9 +19670,9 @@ var file$1 = /*#__PURE__*/Object.freeze({
19662
19670
  __proto__: null,
19663
19671
  stripUp: stripUp,
19664
19672
  inTemporaryDirectory: inTemporaryDirectory,
19665
- read: read,
19673
+ read: read$1,
19666
19674
  copy: copy,
19667
- write: write,
19675
+ write: write$1,
19668
19676
  append: append$2,
19669
19677
  mkdir: mkdir,
19670
19678
  remove: remove$4,
@@ -26253,6 +26261,9 @@ const prompt = async (questions) => {
26253
26261
  const mappedQuestions = questions.map(mapper);
26254
26262
  const value = {};
26255
26263
  for (const question of mappedQuestions) {
26264
+ if (question.preface) {
26265
+ info(question.preface);
26266
+ }
26256
26267
  value[question.name] = await question.run();
26257
26268
  }
26258
26269
  return value;
@@ -26278,14 +26289,17 @@ async function nonEmptyDirectoryPrompt(directory) {
26278
26289
  }
26279
26290
  }
26280
26291
  function mapper(question) {
26281
- if (question.type === "input") {
26282
- return new Input(question);
26283
- } else if (question.type === "select") {
26284
- return new Select(question);
26285
- } else if (question.type === "autocomplete") {
26286
- return new AutoComplete(question);
26292
+ switch (question.type) {
26293
+ case "input":
26294
+ case "password":
26295
+ return new Input(question);
26296
+ case "select":
26297
+ return new Select(question);
26298
+ case "autocomplete":
26299
+ return new AutoComplete(question);
26300
+ default:
26301
+ return void 0;
26287
26302
  }
26288
- return void 0;
26289
26303
  }
26290
26304
 
26291
26305
  var ui = /*#__PURE__*/Object.freeze({
@@ -30781,12 +30795,12 @@ async function recursiveDirectoryCopy(from, to, data) {
30781
30795
  await mkdir(outputPath);
30782
30796
  } else if (templateItemPath.endsWith(".liquid")) {
30783
30797
  await mkdir(dirname$1(outputPath));
30784
- const content = await read(templateItemPath);
30798
+ const content = await read$1(templateItemPath);
30785
30799
  const contentOutput = await create$1(content)(data);
30786
30800
  const isExecutable = await hasExecutablePermissions(templateItemPath);
30787
30801
  const outputPathWithoutLiquid = outputPath.replace(".liquid", "");
30788
30802
  await copy(templateItemPath, outputPathWithoutLiquid);
30789
- await write(outputPathWithoutLiquid, contentOutput);
30803
+ await write$1(outputPathWithoutLiquid, contentOutput);
30790
30804
  if (isExecutable) {
30791
30805
  await chmod(outputPathWithoutLiquid, 493);
30792
30806
  }
@@ -40572,7 +40586,7 @@ class Body$1 {
40572
40586
  return formData;
40573
40587
  }
40574
40588
 
40575
- const {toFormData} = await import('./multipart-parser-a9785137.js');
40589
+ const {toFormData} = await import('./multipart-parser-28a94b7f.js');
40576
40590
  return toFormData(this.body, ct);
40577
40591
  }
40578
40592
 
@@ -54539,17 +54553,17 @@ async function getDependencies(packageJsonPath) {
54539
54553
  if (!await exists$1(packageJsonPath)) {
54540
54554
  throw PackageJsonNotFoundError(dirname$1(packageJsonPath));
54541
54555
  }
54542
- const packageJsonContent = JSON.parse(await read(packageJsonPath));
54556
+ const packageJsonContent = JSON.parse(await read$1(packageJsonPath));
54543
54557
  const dependencies = packageJsonContent.dependencies ?? {};
54544
54558
  const devDependencies = packageJsonContent.devDependencies ?? {};
54545
- return [...Object.keys(dependencies), ...Object.keys(devDependencies)];
54559
+ return { ...dependencies, ...devDependencies };
54546
54560
  }
54547
54561
  async function addNPMDependenciesIfNeeded(dependencies, options) {
54548
54562
  const packageJsonPath = join$3(options.directory, "package.json");
54549
54563
  if (!await exists$1(packageJsonPath)) {
54550
54564
  throw PackageJsonNotFoundError(options.directory);
54551
54565
  }
54552
- const existingDependencies = await getDependencies(packageJsonPath);
54566
+ const existingDependencies = Object.keys(await getDependencies(packageJsonPath));
54553
54567
  const dependenciesToAdd = dependencies.filter((dep) => {
54554
54568
  return !existingDependencies.includes(dep);
54555
54569
  });
@@ -171983,7 +171997,7 @@ const AllStoresByOrganizationQuery = dist$1.gql`
171983
171997
  organizations(id: $id, first: 1) {
171984
171998
  nodes {
171985
171999
  id
171986
- stores(first: 500) {
172000
+ stores(first: 500, archived: false) {
171987
172001
  nodes {
171988
172002
  shopId
171989
172003
  link
@@ -172322,7 +172336,7 @@ async function execCLI(args, adminSession) {
172322
172336
  }
172323
172337
  async function installDependencies() {
172324
172338
  const exists = await exists$1(rubyCLIPath());
172325
- const renderer = exists ? "silent" : "default";
172339
+ const renderer = isUnitTest() || exists ? "silent" : "default";
172326
172340
  const list = new Listr([
172327
172341
  {
172328
172342
  title: "Installing theme dependencies",
@@ -172361,7 +172375,7 @@ function createWorkingDirectory() {
172361
172375
  }
172362
172376
  async function createGemfile() {
172363
172377
  const gemPath = join$3(rubyCLIPath(), "Gemfile");
172364
- await write(gemPath, `source 'https://rubygems.org'
172378
+ await write$1(gemPath, `source 'https://rubygems.org'
172365
172379
  gem 'shopify-cli', '${RubyCLIVersion}'`);
172366
172380
  }
172367
172381
  async function bundleInstall() {
@@ -172379,12 +172393,12 @@ var ruby = /*#__PURE__*/Object.freeze({
172379
172393
 
172380
172394
  async function readPackageJSON(directory) {
172381
172395
  const packagePath = join$3(directory, "package.json");
172382
- const packageJSON = JSON.parse(await read(packagePath));
172396
+ const packageJSON = JSON.parse(await read$1(packagePath));
172383
172397
  return packageJSON;
172384
172398
  }
172385
172399
  async function writePackageJSON(directory, packageJSON) {
172386
172400
  const packagePath = join$3(directory, "package.json");
172387
- await write(packagePath, JSON.stringify(packageJSON, null, 2));
172401
+ await write$1(packagePath, JSON.stringify(packageJSON, null, 2));
172388
172402
  }
172389
172403
  async function updateAppData(packageJSON, name) {
172390
172404
  packageJSON.name = name;
@@ -172638,6 +172652,30 @@ var temporary = /*#__PURE__*/Object.freeze({
172638
172652
  directory: directory
172639
172653
  });
172640
172654
 
172655
+ const DotEnvNotFoundError = (path) => {
172656
+ return new Abort(`The environment file at ${path} does not exist.`);
172657
+ };
172658
+ async function read(path) {
172659
+ if (!await exists$1(path)) {
172660
+ throw DotEnvNotFoundError(path);
172661
+ }
172662
+ const content = await read$1(path);
172663
+ return {
172664
+ path,
172665
+ variables: parse$i(content)
172666
+ };
172667
+ }
172668
+ async function write(file) {
172669
+ await write$1(file.path, stringify$d(file.variables));
172670
+ }
172671
+
172672
+ var dotEnv = /*#__PURE__*/Object.freeze({
172673
+ __proto__: null,
172674
+ DotEnvNotFoundError: DotEnvNotFoundError,
172675
+ read: read,
172676
+ write: write
172677
+ });
172678
+
172641
172679
  const TUNNEL_PLUGINS = ["@shopify/plugin-ngrok"];
172642
172680
  async function lookupTunnelPlugin(plugins) {
172643
172681
  const tunnelPlugin = plugins.find((plugin) => TUNNEL_PLUGINS.includes(plugin.name));
@@ -172652,5 +172690,5 @@ var plugins = /*#__PURE__*/Object.freeze({
172652
172690
  lookupTunnelPlugin: lookupTunnelPlugin
172653
172691
  });
172654
172692
 
172655
- export { npm as A, port as B, cli as C, id as D, temporary as E, FormData$3 as F, constants$2 as G, plugins as H, 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 };
172656
- //# sourceMappingURL=index-731964a3.js.map
172693
+ 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