@shopify/cli-kit 3.0.14 → 3.0.17

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,28 @@
1
1
  # @shopify/cli-kit
2
2
 
3
+ ## 3.0.17
4
+
5
+ ### Patch Changes
6
+
7
+ - df0d0347: Use inquirer with SHOPIFY_USE_INQUIRER
8
+ - 6657a57c: Stop passing configuration when deploying a function
9
+
10
+ ## 3.0.16
11
+
12
+ ### Patch Changes
13
+
14
+ - eb915dee: Loose version requirements to help dependency managers dedupe dependencies
15
+ - 85ee088d: Add a utility function to know whether Git is present in the environment
16
+ - 2ecbff43: Fix issues with windows being reported as unsuported platform
17
+ - a750e67c: Improve dependency upgrade messages to leverage new shopify upgrade command
18
+
19
+ ## 3.0.15
20
+
21
+ ### Patch Changes
22
+
23
+ - c3b711ec: Improve Ruby Bundler upgrade message
24
+ - 99378ca0: Push dependency manager detection into cli-kit
25
+
3
26
  ## 3.0.14
4
27
 
5
28
  ### Patch Changes
@@ -4,7 +4,7 @@ import require$$0$2 from 'readline';
4
4
  import require$$0$5, { sep as sep$1, extname as extname$1, resolve as resolve$4, dirname as dirname$2 } from 'path';
5
5
  import path$I from 'node:path';
6
6
  import url$1, { fileURLToPath, pathToFileURL, format as format$6 } from 'node:url';
7
- import process$2, { platform as platform$1 } from 'node:process';
7
+ import process$2, { platform as platform$2 } from 'node:process';
8
8
  import fs$L, { promises } from 'node:fs';
9
9
  import require$$1$2, { constants as constants$8, EOL, networkInterfaces } from 'os';
10
10
  import require$$0$6, { promisify as promisify$7 } from 'util';
@@ -25,6 +25,7 @@ import tty__default from 'tty';
25
25
  import StackTracey from 'stacktracey';
26
26
  import { Errors, Flags } from '@oclif/core';
27
27
  import sourceMapSupport from 'source-map-support';
28
+ import inquirer from 'inquirer';
28
29
  import { createRequire } from 'module';
29
30
  import http$4 from 'node:http';
30
31
  import https$3 from 'node:https';
@@ -12321,7 +12322,7 @@ var path$w = /*#__PURE__*/Object.freeze({
12321
12322
  });
12322
12323
 
12323
12324
  var name = "@shopify/cli-kit";
12324
- var version$2 = "3.0.14";
12325
+ var version$2 = "3.0.17";
12325
12326
  var description$1 = "A set of utilities, interfaces, and models that are common across all the platform features";
12326
12327
  var keywords = [
12327
12328
  "shopify",
@@ -12369,8 +12370,9 @@ var os$7 = [
12369
12370
  "win32"
12370
12371
  ];
12371
12372
  var dependencies$1 = {
12372
- "@oclif/core": "1.9.0",
12373
+ "@oclif/core": "^1.0",
12373
12374
  envfile: "^6.17.0",
12375
+ inquirer: "^8.2.4",
12374
12376
  keytar: "^7.9.0",
12375
12377
  open: "^8.4.0",
12376
12378
  prettier: "^2.6.2",
@@ -12380,6 +12382,7 @@ var dependencies$1 = {
12380
12382
  var devDependencies = {
12381
12383
  "@iarna/toml": "^2.2.5",
12382
12384
  "@types/cross-zip": "^4.0.0",
12385
+ "@types/inquirer": "^8.2.1",
12383
12386
  "@types/js-yaml": "^4.0.5",
12384
12387
  "@types/semver": "^7.3.9",
12385
12388
  "abort-controller": "^3.0.0",
@@ -14774,7 +14777,7 @@ var constants$1 = require$$0$b;
14774
14777
  var origCwd = process.cwd;
14775
14778
  var cwd = null;
14776
14779
 
14777
- var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
14780
+ var platform$1 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
14778
14781
 
14779
14782
  process.cwd = function() {
14780
14783
  if (!cwd)
@@ -14864,7 +14867,7 @@ function patch$2 (fs) {
14864
14867
  // failures. Also, take care to yield the scheduler. Windows scheduling gives
14865
14868
  // CPU to a busy looping process, which can cause the program causing the lock
14866
14869
  // contention to be starved of CPU by node, so the contention doesn't resolve.
14867
- if (platform === "win32") {
14870
+ if (platform$1 === "win32") {
14868
14871
  fs.rename = typeof fs.rename !== 'function' ? fs.rename
14869
14872
  : (function (fs$rename) {
14870
14873
  function rename (from, to, cb) {
@@ -19637,8 +19640,8 @@ function stripUp(path, strip) {
19637
19640
  async function inTemporaryDirectory(callback) {
19638
19641
  return tempy.directory.task(callback);
19639
19642
  }
19640
- async function read$1(path) {
19641
- const content = await fs$g.readFile(path, { encoding: "utf-8" });
19643
+ async function read$1(path, options = { encoding: "utf-8" }) {
19644
+ const content = await fs$g.readFile(path, options);
19642
19645
  return content;
19643
19646
  }
19644
19647
  async function copy(from, to) {
@@ -19669,6 +19672,9 @@ async function mkTmpDir() {
19669
19672
  async function isDirectory(path) {
19670
19673
  return (await fs$g.promises.lstat(path)).isDirectory();
19671
19674
  }
19675
+ async function size$1(path) {
19676
+ return (await fs$g.stat(path)).size;
19677
+ }
19672
19678
  async function move(src, dest, options = {}) {
19673
19679
  await fs$g.move(src, dest, options);
19674
19680
  }
@@ -19721,6 +19727,7 @@ var file$1 = /*#__PURE__*/Object.freeze({
19721
19727
  rmdir: rmdir,
19722
19728
  mkTmpDir: mkTmpDir,
19723
19729
  isDirectory: isDirectory,
19730
+ size: size$1,
19724
19731
  move: move,
19725
19732
  chmod: chmod,
19726
19733
  hasExecutablePermissions: hasExecutablePermissions,
@@ -19762,6 +19769,14 @@ function isUnitTest(env = process.env) {
19762
19769
  function analyticsDisabled(env = process.env) {
19763
19770
  return isTruthy$1(env[constants$2.environmentVariables.noAnalytics]);
19764
19771
  }
19772
+ async function hasGit() {
19773
+ try {
19774
+ await exec$2("git", ["--version"]);
19775
+ return true;
19776
+ } catch {
19777
+ return false;
19778
+ }
19779
+ }
19765
19780
 
19766
19781
  var local = /*#__PURE__*/Object.freeze({
19767
19782
  __proto__: null,
@@ -19771,7 +19786,8 @@ var local = /*#__PURE__*/Object.freeze({
19771
19786
  isVerbose: isVerbose,
19772
19787
  isShopify: isShopify,
19773
19788
  isUnitTest: isUnitTest,
19774
- analyticsDisabled: analyticsDisabled
19789
+ analyticsDisabled: analyticsDisabled,
19790
+ hasGit: hasGit
19775
19791
  });
19776
19792
 
19777
19793
  const ESC = '\u001B[';
@@ -21566,7 +21582,7 @@ class Abort extends Fatal {
21566
21582
  super(message, 0 /* Abort */, tryMessage);
21567
21583
  }
21568
21584
  }
21569
- class AbortSilent$1 extends Fatal {
21585
+ class AbortSilent extends Fatal {
21570
21586
  constructor() {
21571
21587
  super("", 1 /* AbortSilent */);
21572
21588
  }
@@ -21616,7 +21632,7 @@ var error$j = /*#__PURE__*/Object.freeze({
21616
21632
  CancelExecution: CancelExecution,
21617
21633
  Fatal: Fatal,
21618
21634
  Abort: Abort,
21619
- AbortSilent: AbortSilent$1,
21635
+ AbortSilent: AbortSilent,
21620
21636
  Bug: Bug,
21621
21637
  handler: handler,
21622
21638
  mapper: mapper$1,
@@ -25088,12 +25104,15 @@ var wrapAnsi_1 = (string, columns, options) => {
25088
25104
  .join('\n');
25089
25105
  };
25090
25106
 
25091
- const env$1 = process.env || {};
25092
- const argv = process.argv || [];
25107
+ const {
25108
+ env: env$1 = {},
25109
+ argv = [],
25110
+ platform = "",
25111
+ } = typeof process === "undefined" ? {} : process;
25093
25112
 
25094
25113
  const isDisabled = "NO_COLOR" in env$1 || argv.includes("--no-color");
25095
25114
  const isForced = "FORCE_COLOR" in env$1 || argv.includes("--color");
25096
- const isWindows = process.platform === "win32";
25115
+ const isWindows = platform === "win32";
25097
25116
  const isDumbTerminal = env$1.TERM === "dumb";
25098
25117
 
25099
25118
  const isCompatibleTerminal =
@@ -25104,7 +25123,8 @@ const isCI =
25104
25123
  ("GITHUB_ACTIONS" in env$1 || "GITLAB_CI" in env$1 || "CIRCLECI" in env$1);
25105
25124
 
25106
25125
  const isColorSupported =
25107
- !isDisabled && (isForced || (isWindows && !isDumbTerminal) || isCompatibleTerminal || isCI);
25126
+ !isDisabled &&
25127
+ (isForced || (isWindows && !isDumbTerminal) || isCompatibleTerminal || isCI);
25108
25128
 
25109
25129
  const replaceClose = (
25110
25130
  index,
@@ -26485,22 +26505,35 @@ var Listr = class {
26485
26505
  }
26486
26506
  };
26487
26507
 
26488
- const prompt = async (questions) => {
26508
+ const prompt = async (questions, debugForceInquirer = false) => {
26489
26509
  if (!isTerminalInteractive() && questions.length !== 0) {
26490
26510
  throw new Bug(content`
26491
26511
  The CLI prompted in a non-interactive terminal with the following questions:
26492
26512
  ${token.json(questions)}
26493
26513
  `);
26494
26514
  }
26495
- const mappedQuestions = questions.map(mapper);
26496
- const value = {};
26497
- for (const question of mappedQuestions) {
26498
- if (question.preface) {
26499
- info(question.preface);
26515
+ if (debugForceInquirer || isTruthy$1(process.env.SHOPIFY_USE_INQUIRER)) {
26516
+ const results = [];
26517
+ for (const question of questions) {
26518
+ if (question.preface) {
26519
+ info(question.preface);
26520
+ }
26521
+ const questionName = question.name;
26522
+ const answer = (await inquirer.prompt([convertQuestionForInquirer(question)]))[questionName];
26523
+ results.push([questionName, answer]);
26524
+ }
26525
+ return Object.fromEntries(results);
26526
+ } else {
26527
+ const mappedQuestions = questions.map(mapper);
26528
+ const value = {};
26529
+ for (const question of mappedQuestions) {
26530
+ if (question.preface) {
26531
+ info(question.preface);
26532
+ }
26533
+ value[question.name] = await question.run();
26500
26534
  }
26501
- value[question.name] = await question.run();
26535
+ return value;
26502
26536
  }
26503
- return value;
26504
26537
  };
26505
26538
  async function nonEmptyDirectoryPrompt(directory) {
26506
26539
  if (await exists$1(directory)) {
@@ -26522,6 +26555,19 @@ async function nonEmptyDirectoryPrompt(directory) {
26522
26555
  remove$4(directory);
26523
26556
  }
26524
26557
  }
26558
+ function convertQuestionForInquirer(question) {
26559
+ switch (question.type) {
26560
+ case "input":
26561
+ case "password":
26562
+ return question;
26563
+ case "select":
26564
+ case "autocomplete":
26565
+ return {
26566
+ ...question,
26567
+ type: "list"
26568
+ };
26569
+ }
26570
+ }
26525
26571
  function mapper(question) {
26526
26572
  switch (question.type) {
26527
26573
  case "input":
@@ -35949,10 +35995,15 @@ init_git_response_error();
35949
35995
  var esm_default = gitInstanceFactory;
35950
35996
 
35951
35997
  const factory = esm_default;
35998
+ const GitNotPresentError = () => {
35999
+ return new Abort(`Git is necessary in the environment to continue`, content`Install ${token.link("git", "https://git-scm.com/book/en/v2/Getting-Started-Installing-Git")}`);
36000
+ };
35952
36001
  async function initializeRepository(directory) {
36002
+ await ensurePresentOrAbort();
35953
36003
  await esm_default(directory).init();
35954
36004
  }
35955
36005
  async function downloadRepository({ repoUrl, destination }) {
36006
+ await ensurePresentOrAbort();
35956
36007
  const [repository, branch] = repoUrl.split("#");
35957
36008
  const options = { "--recurse-submodules": null };
35958
36009
  if (branch) {
@@ -35960,16 +36011,25 @@ async function downloadRepository({ repoUrl, destination }) {
35960
36011
  }
35961
36012
  await esm_default().clone(repository, destination, options, (err) => {
35962
36013
  if (err) {
35963
- throw new Abort(err.message);
36014
+ const abortError = new Abort(err.message);
36015
+ abortError.stack = err.stack;
36016
+ throw abortError;
35964
36017
  }
35965
36018
  });
35966
36019
  }
36020
+ async function ensurePresentOrAbort() {
36021
+ if (!await hasGit()) {
36022
+ throw GitNotPresentError();
36023
+ }
36024
+ }
35967
36025
 
35968
36026
  var git = /*#__PURE__*/Object.freeze({
35969
36027
  __proto__: null,
35970
36028
  factory: factory,
36029
+ GitNotPresentError: GitNotPresentError,
35971
36030
  initializeRepository: initializeRepository,
35972
- downloadRepository: downloadRepository
36031
+ downloadRepository: downloadRepository,
36032
+ ensurePresentOrAbort: ensurePresentOrAbort
35973
36033
  });
35974
36034
 
35975
36035
  /**
@@ -40840,7 +40900,7 @@ class Body$1 {
40840
40900
  return formData;
40841
40901
  }
40842
40902
 
40843
- const {toFormData} = await import('./multipart-parser-31f44703.js');
40903
+ const {toFormData} = await import('./multipart-parser-cc9089c4.js');
40844
40904
  return toFormData(this.body, ct);
40845
40905
  }
40846
40906
 
@@ -42291,7 +42351,9 @@ async function fetch$4(url, options_) {
42291
42351
  });
42292
42352
 
42293
42353
  fixResponseChunkedTransferBadEnding(request_, error => {
42294
- response.body.destroy(error);
42354
+ if (response && response.body) {
42355
+ response.body.destroy(error);
42356
+ }
42295
42357
  });
42296
42358
 
42297
42359
  /* c8 ignore next 18 */
@@ -54764,11 +54826,26 @@ function parseRepoUrl(src) {
54764
54826
  const http = `https://${normalizedSite}/${user}/${name}`;
54765
54827
  return { site: normalizedSite, user, name, ref, subDirectory, ssh, http };
54766
54828
  }
54829
+ function parseGithubRepoReference(src) {
54830
+ const url = new URL(src);
54831
+ if (url.origin !== "https://github.com") {
54832
+ throw new Abort("Only GitHub repository references are supported.");
54833
+ }
54834
+ const branch = url.hash ? url.hash.slice(1) : void 0;
54835
+ const [_, user, repo, ...repoPath] = url.pathname.split("/");
54836
+ const filePath = repoPath.length > 0 ? repoPath.join("/") : void 0;
54837
+ return {
54838
+ repoBaseUrl: `${url.origin}/${user}/${repo}`,
54839
+ branch,
54840
+ filePath
54841
+ };
54842
+ }
54767
54843
 
54768
54844
  var github = /*#__PURE__*/Object.freeze({
54769
54845
  __proto__: null,
54770
54846
  getLatestRelease: getLatestRelease,
54771
- parseRepoUrl: parseRepoUrl
54847
+ parseRepoUrl: parseRepoUrl,
54848
+ parseGithubRepoReference: parseGithubRepoReference
54772
54849
  });
54773
54850
 
54774
54851
  var distWeb = {exports: {}};
@@ -67398,6 +67475,14 @@ var semver = /*#__PURE__*/Object.freeze({
67398
67475
  coerce: coerce_1
67399
67476
  });
67400
67477
 
67478
+ const genericConfigurationFileNames = {
67479
+ yarn: {
67480
+ lockfile: "yarn.lock"
67481
+ },
67482
+ pnpm: {
67483
+ lockfile: "pnpm-lock.yaml"
67484
+ }
67485
+ };
67401
67486
  const dependencyManager = ["yarn", "npm", "pnpm"];
67402
67487
  const PackageJsonNotFoundError = (directory) => {
67403
67488
  return new Abort(`The directory ${directory} doesn't have a package.json.`);
@@ -67411,6 +67496,17 @@ function dependencyManagerUsedForCreating(env = process.env) {
67411
67496
  return "npm";
67412
67497
  }
67413
67498
  }
67499
+ async function getDependencyManager(directory) {
67500
+ const yarnLockPath = join$3(directory, genericConfigurationFileNames.yarn.lockfile);
67501
+ const pnpmLockPath = join$3(directory, genericConfigurationFileNames.pnpm.lockfile);
67502
+ if (await exists$1(yarnLockPath)) {
67503
+ return "yarn";
67504
+ } else if (await exists$1(pnpmLockPath)) {
67505
+ return "pnpm";
67506
+ } else {
67507
+ return "npm";
67508
+ }
67509
+ }
67414
67510
  async function installNPMDependenciesRecursively(options) {
67415
67511
  const packageJsons = await out(join$3(options.directory, "**/package.json"), {
67416
67512
  ignore: [join$3(options.directory, "node_modules/**/package.json")],
@@ -67455,9 +67551,9 @@ async function checkForNewVersion(dependency, currentVersion) {
67455
67551
  return void 0;
67456
67552
  }
67457
67553
  }
67458
- function getOutputUpdateCLIReminder(dependencyManager2, packages) {
67459
- const updateCommand = dependencyManager2 === "yarn" ? "upgrade" : "update";
67460
- return content`To update to the latest version of the Shopify CLI, run ${token.genericShellCommand(`${dependencyManager2} ${updateCommand}${packages === void 0 ? "" : ` ${packages.join(", ")}`}`)}`.value;
67554
+ function getOutputUpdateCLIReminder(dependencyManager2, version) {
67555
+ const updateCommand = token.packagejsonScript(dependencyManager2, "shopify", "upgrade");
67556
+ return content`💡 Version ${version} available! Run ${updateCommand}`.value;
67461
67557
  }
67462
67558
  async function packageJSONContents(packageJsonPath) {
67463
67559
  if (!await exists$1(packageJsonPath)) {
@@ -67496,6 +67592,9 @@ async function addNPMDependenciesIfNeeded(dependencies, options) {
67496
67592
  signal: options.signal
67497
67593
  });
67498
67594
  }
67595
+ async function addLatestNPMDependencies(dependencies, options) {
67596
+ await addNPMDependenciesIfNeeded(dependencies.map((dependency) => `${dependency}@latest`), options);
67597
+ }
67499
67598
  function argumentsToAddDependenciesWithNPM(dependencies, type) {
67500
67599
  let command = ["install"];
67501
67600
  command = command.concat(dependencies);
@@ -67547,16 +67646,20 @@ function argumentsToAddDependenciesWithPNPM(dependencies, type) {
67547
67646
 
67548
67647
  var dependency = /*#__PURE__*/Object.freeze({
67549
67648
  __proto__: null,
67649
+ genericConfigurationFileNames: genericConfigurationFileNames,
67550
67650
  dependencyManager: dependencyManager,
67551
67651
  PackageJsonNotFoundError: PackageJsonNotFoundError,
67552
67652
  dependencyManagerUsedForCreating: dependencyManagerUsedForCreating,
67653
+ getDependencyManager: getDependencyManager,
67553
67654
  installNPMDependenciesRecursively: installNPMDependenciesRecursively,
67554
67655
  install: install,
67555
67656
  getPackageName: getPackageName,
67556
67657
  getDependencies: getDependencies,
67557
67658
  checkForNewVersion: checkForNewVersion,
67558
67659
  getOutputUpdateCLIReminder: getOutputUpdateCLIReminder,
67559
- addNPMDependenciesIfNeeded: addNPMDependenciesIfNeeded
67660
+ packageJSONContents: packageJSONContents,
67661
+ addNPMDependenciesIfNeeded: addNPMDependenciesIfNeeded,
67662
+ addLatestNPMDependencies: addLatestNPMDependencies
67560
67663
  });
67561
67664
 
67562
67665
  const getEnvironmentVariable = () => {
@@ -67572,7 +67675,7 @@ const getUsernameFromOsUserInfo = () => {
67572
67675
  };
67573
67676
  const cleanWindowsCommand = (value) => value.replace(/^.*\\/, "");
67574
67677
  const makeUsernameFromId = (userId) => `no-username-${userId}`;
67575
- const username = async (platform = platform$1) => {
67678
+ const username = async (platform = platform$2) => {
67576
67679
  const environmentVariable = getEnvironmentVariable();
67577
67680
  if (environmentVariable) {
67578
67681
  return environmentVariable;
@@ -67597,12 +67700,16 @@ const username = async (platform = platform$1) => {
67597
67700
  return null;
67598
67701
  }
67599
67702
  };
67600
- const platformAndArch = (platform = platform$1) => {
67703
+ const platformAndArch = (platform = platform$2) => {
67601
67704
  let arch$1 = arch();
67602
67705
  if (arch$1 === "x64") {
67603
67706
  arch$1 = "amd64";
67604
67707
  }
67605
- return { platform, arch: arch$1 };
67708
+ let platformString = platform;
67709
+ if (platform.match(/^win.+/)) {
67710
+ platformString = "windows";
67711
+ }
67712
+ return { platform: platformString, arch: arch$1 };
67606
67713
  };
67607
67714
 
67608
67715
  var os$2 = /*#__PURE__*/Object.freeze({
@@ -155201,6 +155308,17 @@ const AllOrganizationsQuery = dist$3.gql`
155201
155308
  businessName
155202
155309
  website
155203
155310
  appsNext
155311
+ apps {
155312
+ nodes {
155313
+ id
155314
+ title
155315
+ apiKey
155316
+ apiSecretKeys {
155317
+ secret
155318
+ }
155319
+ appType
155320
+ }
155321
+ }
155204
155322
  }
155205
155323
  }
155206
155324
  }
@@ -155262,7 +155380,7 @@ const FindAppQuery = dist$3.gql`
155262
155380
  }
155263
155381
  `;
155264
155382
 
155265
- const UpdateDraftMutation = dist$3.gql`
155383
+ const ExtensionUpdateDraftMutation = dist$3.gql`
155266
155384
  mutation ExtensionUpdateDraft($apiKey: String!, $registrationId: ID!, $config: JSON!, $context: String) {
155267
155385
  extensionUpdateDraft(
155268
155386
  input: {apiKey: $apiKey, registrationId: $registrationId, config: $config, context: $context}
@@ -155300,7 +155418,7 @@ const GenerateSignedUploadUrl = dist$3.gql`
155300
155418
  `;
155301
155419
 
155302
155420
  const CreateDeployment = dist$3.gql`
155303
- mutation CreateDeployment($apiKey: String!, $uuid: String!, $bundleUrl: String!, $extensions: [ExtensionSettings!]) {
155421
+ mutation CreateDeployment($apiKey: String!, $uuid: String!, $bundleUrl: String!, $extensions: [ExtensionSettings!]!) {
155304
155422
  deploymentCreate(input: {apiKey: $apiKey, uuid: $uuid, bundleUrl: $bundleUrl, extensions: $extensions}) {
155305
155423
  deployment {
155306
155424
  uuid
@@ -155459,9 +155577,9 @@ const AppFunctionSetMutation = dist$3.gql`
155459
155577
  $force: Boolean
155460
155578
  $schemaMajorVersion: String
155461
155579
  $schemaMinorVersion: String
155462
- $scriptConfigVersion: String!
155580
+ $scriptConfigVersion: String
155463
155581
  $configurationUi: Boolean!
155464
- $configurationDefinition: String!
155582
+ $configurationDefinition: String
155465
155583
  $moduleUploadUrl: String!
155466
155584
  $library: LibraryInput
155467
155585
  $inputQuery: String
@@ -155504,7 +155622,7 @@ var index = /*#__PURE__*/Object.freeze({
155504
155622
  CreateAppQuery: CreateAppQuery,
155505
155623
  UpdateURLsQuery: UpdateURLsQuery,
155506
155624
  FindAppQuery: FindAppQuery,
155507
- UpdateDraftMutation: UpdateDraftMutation,
155625
+ ExtensionUpdateDraftMutation: ExtensionUpdateDraftMutation,
155508
155626
  GenerateSignedUploadUrl: GenerateSignedUploadUrl,
155509
155627
  CreateDeployment: CreateDeployment,
155510
155628
  AllStoresByOrganizationQuery: AllStoresByOrganizationQuery,
@@ -174244,6 +174362,8 @@ var checksum = /*#__PURE__*/Object.freeze({
174244
174362
  const RubyCLIVersion = "2.16.0";
174245
174363
  const ThemeCheckVersion = "1.10.2";
174246
174364
  const MinBundlerVersion = "2.3.8";
174365
+ const MinRubyVersion = "2.3.0";
174366
+ const MinRubyGemVersion = "2.5.0";
174247
174367
  async function execCLI(args, adminSession) {
174248
174368
  await installCLIDependencies();
174249
174369
  const env = {
@@ -174323,23 +174443,42 @@ async function installCLIDependencies() {
174323
174443
  await list.run();
174324
174444
  }
174325
174445
  async function validateRubyEnv() {
174446
+ await validateRuby();
174447
+ await validateRubyGems();
174448
+ await validateBundler();
174449
+ }
174450
+ async function validateRuby() {
174451
+ let version2;
174326
174452
  try {
174327
- await exec$2("ruby", ["-v"]);
174453
+ const stdout = await captureOutput("ruby", ["-v"]);
174454
+ version2 = coerce_1(stdout);
174328
174455
  } catch {
174329
- throw new Abort("Ruby environment not found", "Make sure you have ruby installed on your system: https://www.ruby-lang.org/en/documentation/installation/");
174456
+ throw new Abort("Ruby environment not found", `Make sure you have Ruby installed on your system: ${content`${token.link("", "https://www.ruby-lang.org/en/documentation/installation/")}`.value}`);
174330
174457
  }
174331
- const bundlerVersion = await getBundlerVersion();
174332
- const isValid = bundlerVersion?.compare(MinBundlerVersion);
174458
+ const isValid = version2?.compare(MinRubyVersion);
174333
174459
  if (isValid === -1 || isValid === void 0) {
174334
- throw new Abort(`Bundler version ${bundlerVersion} is not supported`, `Make sure you have Bundler version ${MinBundlerVersion} or higher installed on your system: https://bundler.io/`);
174460
+ throw new Abort(`Ruby version ${content`${token.yellow(version2.raw)}`.value} is not supported`, `Make sure you have at least Ruby ${content`${token.yellow(MinRubyVersion)}`.value} installed on your system: ${content`${token.link("", "https://www.ruby-lang.org/en/documentation/installation/")}`.value}`);
174335
174461
  }
174336
174462
  }
174337
- async function getBundlerVersion() {
174463
+ async function validateRubyGems() {
174464
+ const stdout = await captureOutput("gem", ["-v"]);
174465
+ const version2 = coerce_1(stdout);
174466
+ const isValid = version2?.compare(MinRubyGemVersion);
174467
+ if (isValid === -1 || isValid === void 0) {
174468
+ throw new Abort(`RubyGems version ${content`${token.yellow(version2.raw)}`.value} is not supported`, `To update to the latest version of RubyGems, run ${content`${token.genericShellCommand("gem update --system")}`.value}`);
174469
+ }
174470
+ }
174471
+ async function validateBundler() {
174472
+ let version2;
174338
174473
  try {
174339
174474
  const stdout = await captureOutput("bundler", ["-v"]);
174340
- return coerce_1(stdout);
174475
+ version2 = coerce_1(stdout);
174341
174476
  } catch {
174342
- throw new Abort("Bundler not found", "Make sure you have Bundler installed on your system: https://bundler.io/");
174477
+ throw new Abort("Bundler not found", `To install the latest version of Bundler, run ${content`${token.genericShellCommand("gem install bundler")}`.value}`);
174478
+ }
174479
+ const isValid = version2?.compare(MinBundlerVersion);
174480
+ if (isValid === -1 || isValid === void 0) {
174481
+ throw new Abort(`Bundler version ${content`${token.yellow(version2.raw)}`.value} is not supported`, `To update to the latest version of Bundler, run ${content`${token.genericShellCommand("gem install bundler")}`.value}`);
174343
174482
  }
174344
174483
  }
174345
174484
  function createShopifyCLIWorkingDirectory() {
@@ -174729,4 +174868,4 @@ var vscode = /*#__PURE__*/Object.freeze({
174729
174868
  });
174730
174869
 
174731
174870
  export { semver as A, npm as B, port as C, cli as D, id as E, FormData$3 as F, temporary as G, dotEnv as H, abort as I, constants$2 as J, plugins as K, vscode as L, File$1 as a, string as b, github as c, dependency as d, error$j as e, file$1 as f, git as g, haiku as h, os$2 as i, environment as j, session as k, schema$2 as l, toml as m, store as n, output as o, path$w as p, api as q, http$2 as r, system as s, template as t, ui as u, version$1 as v, archiver as w, checksum as x, yaml as y, ruby as z };
174732
- //# sourceMappingURL=index-3f46deaa.js.map
174871
+ //# sourceMappingURL=index-3f7f30b9.js.map