@shopify/cli-kit 3.0.15 → 3.0.16

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,14 @@
1
1
  # @shopify/cli-kit
2
2
 
3
+ ## 3.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - eb915dee: Loose version requirements to help dependency managers dedupe dependencies
8
+ - 85ee088d: Add a utility function to know whether Git is present in the environment
9
+ - 2ecbff43: Fix issues with windows being reported as unsuported platform
10
+ - a750e67c: Improve dependency upgrade messages to leverage new shopify upgrade command
11
+
3
12
  ## 3.0.15
4
13
 
5
14
  ### Patch Changes
@@ -12321,7 +12321,7 @@ var path$w = /*#__PURE__*/Object.freeze({
12321
12321
  });
12322
12322
 
12323
12323
  var name = "@shopify/cli-kit";
12324
- var version$2 = "3.0.15";
12324
+ var version$2 = "3.0.16";
12325
12325
  var description$1 = "A set of utilities, interfaces, and models that are common across all the platform features";
12326
12326
  var keywords = [
12327
12327
  "shopify",
@@ -12369,7 +12369,7 @@ var os$7 = [
12369
12369
  "win32"
12370
12370
  ];
12371
12371
  var dependencies$1 = {
12372
- "@oclif/core": "1.9.0",
12372
+ "@oclif/core": "^1.0",
12373
12373
  envfile: "^6.17.0",
12374
12374
  keytar: "^7.9.0",
12375
12375
  open: "^8.4.0",
@@ -19637,8 +19637,8 @@ function stripUp(path, strip) {
19637
19637
  async function inTemporaryDirectory(callback) {
19638
19638
  return tempy.directory.task(callback);
19639
19639
  }
19640
- async function read$1(path) {
19641
- const content = await fs$g.readFile(path, { encoding: "utf-8" });
19640
+ async function read$1(path, options = { encoding: "utf-8" }) {
19641
+ const content = await fs$g.readFile(path, options);
19642
19642
  return content;
19643
19643
  }
19644
19644
  async function copy(from, to) {
@@ -19669,6 +19669,9 @@ async function mkTmpDir() {
19669
19669
  async function isDirectory(path) {
19670
19670
  return (await fs$g.promises.lstat(path)).isDirectory();
19671
19671
  }
19672
+ async function size$1(path) {
19673
+ return (await fs$g.stat(path)).size;
19674
+ }
19672
19675
  async function move(src, dest, options = {}) {
19673
19676
  await fs$g.move(src, dest, options);
19674
19677
  }
@@ -19721,6 +19724,7 @@ var file$1 = /*#__PURE__*/Object.freeze({
19721
19724
  rmdir: rmdir,
19722
19725
  mkTmpDir: mkTmpDir,
19723
19726
  isDirectory: isDirectory,
19727
+ size: size$1,
19724
19728
  move: move,
19725
19729
  chmod: chmod,
19726
19730
  hasExecutablePermissions: hasExecutablePermissions,
@@ -19762,6 +19766,14 @@ function isUnitTest(env = process.env) {
19762
19766
  function analyticsDisabled(env = process.env) {
19763
19767
  return isTruthy$1(env[constants$2.environmentVariables.noAnalytics]);
19764
19768
  }
19769
+ async function hasGit() {
19770
+ try {
19771
+ await exec$2("git", ["--version"]);
19772
+ return true;
19773
+ } catch {
19774
+ return false;
19775
+ }
19776
+ }
19765
19777
 
19766
19778
  var local = /*#__PURE__*/Object.freeze({
19767
19779
  __proto__: null,
@@ -19771,7 +19783,8 @@ var local = /*#__PURE__*/Object.freeze({
19771
19783
  isVerbose: isVerbose,
19772
19784
  isShopify: isShopify,
19773
19785
  isUnitTest: isUnitTest,
19774
- analyticsDisabled: analyticsDisabled
19786
+ analyticsDisabled: analyticsDisabled,
19787
+ hasGit: hasGit
19775
19788
  });
19776
19789
 
19777
19790
  const ESC = '\u001B[';
@@ -35953,10 +35966,15 @@ init_git_response_error();
35953
35966
  var esm_default = gitInstanceFactory;
35954
35967
 
35955
35968
  const factory = esm_default;
35969
+ const GitNotPresentError = () => {
35970
+ 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")}`);
35971
+ };
35956
35972
  async function initializeRepository(directory) {
35973
+ await ensurePresentOrAbort();
35957
35974
  await esm_default(directory).init();
35958
35975
  }
35959
35976
  async function downloadRepository({ repoUrl, destination }) {
35977
+ await ensurePresentOrAbort();
35960
35978
  const [repository, branch] = repoUrl.split("#");
35961
35979
  const options = { "--recurse-submodules": null };
35962
35980
  if (branch) {
@@ -35964,16 +35982,25 @@ async function downloadRepository({ repoUrl, destination }) {
35964
35982
  }
35965
35983
  await esm_default().clone(repository, destination, options, (err) => {
35966
35984
  if (err) {
35967
- throw new Abort(err.message);
35985
+ const abortError = new Abort(err.message);
35986
+ abortError.stack = err.stack;
35987
+ throw abortError;
35968
35988
  }
35969
35989
  });
35970
35990
  }
35991
+ async function ensurePresentOrAbort() {
35992
+ if (!await hasGit()) {
35993
+ throw GitNotPresentError();
35994
+ }
35995
+ }
35971
35996
 
35972
35997
  var git = /*#__PURE__*/Object.freeze({
35973
35998
  __proto__: null,
35974
35999
  factory: factory,
36000
+ GitNotPresentError: GitNotPresentError,
35975
36001
  initializeRepository: initializeRepository,
35976
- downloadRepository: downloadRepository
36002
+ downloadRepository: downloadRepository,
36003
+ ensurePresentOrAbort: ensurePresentOrAbort
35977
36004
  });
35978
36005
 
35979
36006
  /**
@@ -40844,7 +40871,7 @@ class Body$1 {
40844
40871
  return formData;
40845
40872
  }
40846
40873
 
40847
- const {toFormData} = await import('./multipart-parser-ac67c8ac.js');
40874
+ const {toFormData} = await import('./multipart-parser-654817b0.js');
40848
40875
  return toFormData(this.body, ct);
40849
40876
  }
40850
40877
 
@@ -67495,9 +67522,9 @@ async function checkForNewVersion(dependency, currentVersion) {
67495
67522
  return void 0;
67496
67523
  }
67497
67524
  }
67498
- function getOutputUpdateCLIReminder(dependencyManager2, packages) {
67499
- const updateCommand = dependencyManager2 === "yarn" ? "upgrade" : "update";
67500
- return content`To update to the latest version of the Shopify CLI, run ${token.genericShellCommand(`${dependencyManager2} ${updateCommand}${packages === void 0 ? "" : ` ${packages.join(", ")}`}`)}`.value;
67525
+ function getOutputUpdateCLIReminder(dependencyManager2, version) {
67526
+ const updateCommand = token.packagejsonScript(dependencyManager2, "shopify", "upgrade");
67527
+ return content`💡 Version ${version} available! Run ${updateCommand}`.value;
67501
67528
  }
67502
67529
  async function packageJSONContents(packageJsonPath) {
67503
67530
  if (!await exists$1(packageJsonPath)) {
@@ -67649,7 +67676,11 @@ const platformAndArch = (platform = platform$2) => {
67649
67676
  if (arch$1 === "x64") {
67650
67677
  arch$1 = "amd64";
67651
67678
  }
67652
- return { platform, arch: arch$1 };
67679
+ let platformString = platform;
67680
+ if (platform.match(/^win.+/)) {
67681
+ platformString = "windows";
67682
+ }
67683
+ return { platform: platformString, arch: arch$1 };
67653
67684
  };
67654
67685
 
67655
67686
  var os$2 = /*#__PURE__*/Object.freeze({
@@ -155320,7 +155351,7 @@ const FindAppQuery = dist$3.gql`
155320
155351
  }
155321
155352
  `;
155322
155353
 
155323
- const UpdateDraftMutation = dist$3.gql`
155354
+ const ExtensionUpdateDraftMutation = dist$3.gql`
155324
155355
  mutation ExtensionUpdateDraft($apiKey: String!, $registrationId: ID!, $config: JSON!, $context: String) {
155325
155356
  extensionUpdateDraft(
155326
155357
  input: {apiKey: $apiKey, registrationId: $registrationId, config: $config, context: $context}
@@ -155562,7 +155593,7 @@ var index = /*#__PURE__*/Object.freeze({
155562
155593
  CreateAppQuery: CreateAppQuery,
155563
155594
  UpdateURLsQuery: UpdateURLsQuery,
155564
155595
  FindAppQuery: FindAppQuery,
155565
- UpdateDraftMutation: UpdateDraftMutation,
155596
+ ExtensionUpdateDraftMutation: ExtensionUpdateDraftMutation,
155566
155597
  GenerateSignedUploadUrl: GenerateSignedUploadUrl,
155567
155598
  CreateDeployment: CreateDeployment,
155568
155599
  AllStoresByOrganizationQuery: AllStoresByOrganizationQuery,
@@ -174808,4 +174839,4 @@ var vscode = /*#__PURE__*/Object.freeze({
174808
174839
  });
174809
174840
 
174810
174841
  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 };
174811
- //# sourceMappingURL=index-f32e5d27.js.map
174842
+ //# sourceMappingURL=index-43045fd6.js.map