@shopify/cli 3.91.1 → 3.92.0

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.
Files changed (106) hide show
  1. package/bin/run.js +2 -2
  2. package/dist/assets/dev-console/extensions/dev-console/assets/{index-0hw3R_TS.css → index-DISeE29z.css} +1 -1
  3. package/dist/assets/dev-console/extensions/dev-console/assets/{index-C12jKScn.js → index-WDo4Zf8i.js} +10 -10
  4. package/dist/assets/dev-console/index.html +2 -2
  5. package/dist/{chunk-LFMBIRVC.js → chunk-2GBRPYQO.js} +3 -3
  6. package/dist/{chunk-R622IPZN.js → chunk-3PJMBRB6.js} +3 -3
  7. package/dist/{chunk-SUFC4ISB.js → chunk-3Q7HT6Z6.js} +6 -6
  8. package/dist/{chunk-FKP67FZI.js → chunk-3R4Y7JP2.js} +3 -3
  9. package/dist/{chunk-54FE2FGU.js → chunk-4ZJ6IMY7.js} +2 -2
  10. package/dist/{chunk-K52ORY26.js → chunk-5Z2EIBKO.js} +7 -7
  11. package/dist/{chunk-Z5FK5H2M.js → chunk-6QAGQRBW.js} +7 -7
  12. package/dist/{chunk-RLJICWO6.js → chunk-7HBHG7AR.js} +4 -4
  13. package/dist/{chunk-E44JKFB6.js → chunk-7LLU6ZWI.js} +2 -2
  14. package/dist/{chunk-DUNGALP3.js → chunk-7ZPI3YZT.js} +3 -3
  15. package/dist/{chunk-I23GZAC4.js → chunk-ALCWBCTB.js} +6 -7
  16. package/dist/{chunk-HAG3HJ2V.js → chunk-CETXO4QF.js} +35 -47
  17. package/dist/{chunk-5ZDTGPNX.js → chunk-CFMCPDKD.js} +3 -3
  18. package/dist/{chunk-OIUDJFV2.js → chunk-CLSOJHPG.js} +12 -5
  19. package/dist/{chunk-NYP3N62G.js → chunk-D5DIBYZM.js} +2 -2
  20. package/dist/{chunk-77BDQRQW.js → chunk-DELDMHFW.js} +6 -6
  21. package/dist/{chunk-TY5YKCUW.js → chunk-EKSKCUFY.js} +5 -5
  22. package/dist/{chunk-HTGTTXQL.js → chunk-EURIZXCA.js} +7 -17
  23. package/dist/{chunk-CEUL3KX5.js → chunk-EZZRDRCA.js} +7757 -6910
  24. package/dist/{chunk-VRUH5BDH.js → chunk-GISQNWKA.js} +4 -4
  25. package/dist/{chunk-EG6MBBEN.js → chunk-H4D3T5OG.js} +14 -1
  26. package/dist/{chunk-E4GUDBAR.js → chunk-HOM3AURQ.js} +17174 -13656
  27. package/dist/{chunk-SJXHR42U.js → chunk-KMZDRVOH.js} +2 -2
  28. package/dist/{chunk-ATQVKUJC.js → chunk-L332YARR.js} +4 -4
  29. package/dist/{chunk-A2CZGTAP.js → chunk-NCTTAHU4.js} +110 -166
  30. package/dist/{chunk-DR5R5UTE.js → chunk-PEQG7FIO.js} +6 -6
  31. package/dist/{chunk-ZLV2A27J.js → chunk-PV4DS7Q3.js} +2 -2
  32. package/dist/{chunk-ITTNM7I4.js → chunk-QJQS7BBK.js} +2 -2
  33. package/dist/{chunk-TH7ZYYDZ.js → chunk-QLJ6X5VL.js} +1144 -79
  34. package/dist/{chunk-463KYFYO.js → chunk-S6E4CCUW.js} +2 -2
  35. package/dist/{chunk-VUYVHHZY.js → chunk-SHITJREU.js} +4 -4
  36. package/dist/{chunk-IUKBWIQY.js → chunk-SK7ID6O3.js} +3 -3
  37. package/dist/{chunk-5JYQJQ2E.js → chunk-TCRGWXEM.js} +2 -2
  38. package/dist/{chunk-K45ALTZ7.js → chunk-TKKSRIK5.js} +3 -3
  39. package/dist/{chunk-QFO7QSBW.js → chunk-TSCSVXFR.js} +4 -4
  40. package/dist/{chunk-HOIU6WRE.js → chunk-UB4S5CPZ.js} +3 -3
  41. package/dist/{chunk-RKFRXKFE.js → chunk-UKXV3TI2.js} +3 -3
  42. package/dist/{chunk-2YAGQHB2.js → chunk-UL3ZEXYW.js} +3 -3
  43. package/dist/{chunk-XDCBS7SY.js → chunk-ULMWBRHO.js} +3 -3
  44. package/dist/{chunk-KV3364EL.js → chunk-USGISM5H.js} +1 -1
  45. package/dist/{chunk-PCNR4TMY.js → chunk-VK6V5QGU.js} +5 -5
  46. package/dist/{chunk-SVV4RJVX.js → chunk-VNO7KUNW.js} +4 -4
  47. package/dist/{chunk-WDYPK6VH.js → chunk-WORXIBDA.js} +5 -5
  48. package/dist/cli/commands/auth/login.js +10 -10
  49. package/dist/cli/commands/auth/login.test.js +12 -12
  50. package/dist/cli/commands/auth/logout.js +10 -10
  51. package/dist/cli/commands/auth/logout.test.js +12 -12
  52. package/dist/cli/commands/cache/clear.js +11 -11
  53. package/dist/cli/commands/debug/command-flags.js +10 -10
  54. package/dist/cli/commands/docs/generate.js +10 -10
  55. package/dist/cli/commands/docs/generate.test.js +11 -11
  56. package/dist/cli/commands/doctor-release/doctor-release.js +10 -10
  57. package/dist/cli/commands/doctor-release/theme/index.js +16 -16
  58. package/dist/cli/commands/help.js +10 -10
  59. package/dist/cli/commands/kitchen-sink/async.js +11 -11
  60. package/dist/cli/commands/kitchen-sink/async.test.js +12 -12
  61. package/dist/cli/commands/kitchen-sink/index.js +13 -13
  62. package/dist/cli/commands/kitchen-sink/index.test.js +14 -14
  63. package/dist/cli/commands/kitchen-sink/prompts.js +11 -11
  64. package/dist/cli/commands/kitchen-sink/prompts.test.js +12 -12
  65. package/dist/cli/commands/kitchen-sink/static.js +11 -11
  66. package/dist/cli/commands/kitchen-sink/static.test.js +12 -12
  67. package/dist/cli/commands/notifications/generate.js +11 -11
  68. package/dist/cli/commands/notifications/list.js +11 -11
  69. package/dist/cli/commands/search.js +11 -11
  70. package/dist/cli/commands/upgrade.js +11 -11
  71. package/dist/cli/commands/upgrade.test.js +1 -1
  72. package/dist/cli/commands/version.js +11 -11
  73. package/dist/cli/commands/version.test.js +12 -12
  74. package/dist/cli/services/commands/notifications.js +9 -9
  75. package/dist/cli/services/commands/search.js +5 -5
  76. package/dist/cli/services/commands/search.test.js +6 -6
  77. package/dist/cli/services/commands/version.js +6 -6
  78. package/dist/cli/services/commands/version.test.js +8 -8
  79. package/dist/cli/services/doctor-release/context.js +2 -2
  80. package/dist/cli/services/doctor-release/theme/runner.js +9 -9
  81. package/dist/cli/services/doctor-release/theme/tests/init.js +6 -6
  82. package/dist/cli/services/doctor-release/theme/tests/push.js +6 -6
  83. package/dist/cli/services/kitchen-sink/async.js +5 -5
  84. package/dist/cli/services/kitchen-sink/prompts.js +5 -5
  85. package/dist/cli/services/kitchen-sink/static.js +5 -5
  86. package/dist/{custom-oclif-loader-AAJZ7WBW.js → custom-oclif-loader-QHZYLDHD.js} +5 -5
  87. package/dist/{devtools-BAOTGU3O.js → devtools-PI7DMKVT.js} +4 -4
  88. package/dist/{error-handler-GSQRFK57.js → error-handler-25WG4VTL.js} +8 -8
  89. package/dist/hooks/postrun.js +8 -8
  90. package/dist/hooks/prerun.js +9 -9
  91. package/dist/index.js +68761 -58531
  92. package/dist/{lib-HAW436ZI.js → lib-R4TQWF6K.js} +3 -3
  93. package/dist/{local-GOP2BHNI.js → local-QBNR7GHY.js} +5 -5
  94. package/dist/{morph-7WAMUK6I.js → morph-32Y5BUJM.js} +9 -9
  95. package/dist/{node-package-manager-W4R4DUTE.js → node-package-manager-TKOPH3K5.js} +6 -6
  96. package/dist/{path-GB4VIEM6.js → path-H3TILUQU.js} +4 -2
  97. package/dist/{prettier-5ODD6NHV.js → prettier-4RCJTIXY.js} +2 -2
  98. package/dist/tsconfig.tsbuildinfo +1 -1
  99. package/dist/{ui-VRLRLHWH.js → ui-QCEOAQDC.js} +5 -5
  100. package/dist/{workerd-AO3T6IIJ.js → workerd-L2OEKCQL.js} +13 -13
  101. package/oclif.manifest.json +6 -6
  102. package/package.json +7 -59
  103. package/dist/chunk-2EQNSO7C.js +0 -142
  104. package/dist/cli/services/upgrade.d.ts +0 -5
  105. package/dist/cli/services/upgrade.js +0 -21
  106. package/dist/cli/services/upgrade.test.js +0 -171
@@ -17,18 +17,18 @@ import {
17
17
  renderTasks,
18
18
  renderTextPrompt,
19
19
  renderWarning
20
- } from "./chunk-E4GUDBAR.js";
20
+ } from "./chunk-HOM3AURQ.js";
21
21
  import "./chunk-6NVYATES.js";
22
22
  import "./chunk-CTFDRWUN.js";
23
23
  import "./chunk-7IK72W75.js";
24
- import "./chunk-CEUL3KX5.js";
24
+ import "./chunk-EZZRDRCA.js";
25
25
  import "./chunk-KUJQ4AB6.js";
26
26
  import "./chunk-UMUTXITN.js";
27
- import "./chunk-G2ZZKGSV.js";
28
27
  import "./chunk-UV5N2VL7.js";
29
28
  import "./chunk-XE5EOEBL.js";
30
29
  import "./chunk-Q2H6D2MH.js";
31
- import "./chunk-EG6MBBEN.js";
30
+ import "./chunk-G2ZZKGSV.js";
31
+ import "./chunk-H4D3T5OG.js";
32
32
  import "./chunk-PKR7KJ6P.js";
33
33
  export {
34
34
  handleCtrlC,
@@ -50,4 +50,4 @@ export {
50
50
  renderTextPrompt,
51
51
  renderWarning
52
52
  };
53
- //# sourceMappingURL=ui-VRLRLHWH.js.map
53
+ //# sourceMappingURL=ui-QCEOAQDC.js.map
@@ -10,16 +10,16 @@ import {
10
10
  importLocal,
11
11
  logRequestLine,
12
12
  setConstructors
13
- } from "./chunk-TH7ZYYDZ.js";
14
- import "./chunk-KV3364EL.js";
13
+ } from "./chunk-QLJ6X5VL.js";
14
+ import "./chunk-USGISM5H.js";
15
15
  import "./chunk-56ELYGPH.js";
16
- import "./chunk-I23GZAC4.js";
17
- import "./chunk-SUFC4ISB.js";
18
- import "./chunk-A2CZGTAP.js";
16
+ import "./chunk-ALCWBCTB.js";
17
+ import "./chunk-3Q7HT6Z6.js";
18
+ import "./chunk-NCTTAHU4.js";
19
19
  import "./chunk-SHWOPMLQ.js";
20
20
  import "./chunk-VBBBCVMH.js";
21
- import "./chunk-HAG3HJ2V.js";
22
- import "./chunk-NYP3N62G.js";
21
+ import "./chunk-CETXO4QF.js";
22
+ import "./chunk-D5DIBYZM.js";
23
23
  import {
24
24
  AbortError,
25
25
  createFileReadStream,
@@ -27,26 +27,26 @@ import {
27
27
  readFile,
28
28
  renderSuccess,
29
29
  source_default
30
- } from "./chunk-E4GUDBAR.js";
30
+ } from "./chunk-HOM3AURQ.js";
31
31
  import "./chunk-6NVYATES.js";
32
32
  import "./chunk-CTFDRWUN.js";
33
33
  import "./chunk-7IK72W75.js";
34
- import "./chunk-CEUL3KX5.js";
34
+ import "./chunk-EZZRDRCA.js";
35
35
  import "./chunk-KUJQ4AB6.js";
36
36
  import "./chunk-UMUTXITN.js";
37
- import "./chunk-G2ZZKGSV.js";
38
37
  import "./chunk-UV5N2VL7.js";
39
38
  import "./chunk-XE5EOEBL.js";
40
39
  import "./chunk-Q2H6D2MH.js";
40
+ import "./chunk-G2ZZKGSV.js";
41
41
  import {
42
42
  dirname,
43
43
  resolvePath
44
- } from "./chunk-EG6MBBEN.js";
44
+ } from "./chunk-H4D3T5OG.js";
45
45
  import {
46
46
  init_cjs_shims
47
47
  } from "./chunk-PKR7KJ6P.js";
48
48
 
49
- // ../../node_modules/.pnpm/@shopify+cli-hydrogen@11.1.10_@graphql-codegen+cli@5.0.4_@parcel+watcher@2.5.1_@types+n_eecab4a089defd078c81c0f7991e7529/node_modules/@shopify/cli-hydrogen/dist/lib/mini-oxygen/workerd.js
49
+ // ../../node_modules/.pnpm/@shopify+cli-hydrogen@11.1.10_@graphql-codegen+cli@5.0.4_@parcel+watcher@2.5.1_@types+n_224b49f683ddd0894a6efb2678941bc0/node_modules/@shopify/cli-hydrogen/dist/lib/mini-oxygen/workerd.js
50
50
  init_cjs_shims();
51
51
  import { createRequire } from "node:module";
52
52
  async function startWorkerdServer({
@@ -163,4 +163,4 @@ async function startWorkerdServer({
163
163
  export {
164
164
  startWorkerdServer
165
165
  };
166
- //# sourceMappingURL=workerd-AO3T6IIJ.js.map
166
+ //# sourceMappingURL=workerd-L2OEKCQL.js.map
@@ -1867,8 +1867,8 @@
1867
1867
  "args": {
1868
1868
  },
1869
1869
  "customPluginName": "@shopify/app",
1870
- "description": "Creates GraphQL types based on your \"input query\" (https://shopify.dev/docs/apps/functions/input-output#input) for a function written in JavaScript.",
1871
- "descriptionWithMarkdown": "Creates GraphQL types based on your [input query](https://shopify.dev/docs/apps/functions/input-output#input) for a function written in JavaScript.",
1870
+ "description": "Creates GraphQL types based on your \"input query\" (https://shopify.dev/docs/apps/functions/input-output#input) for a function. Supports JavaScript functions out of the box, or any language via the `build.typegen_command` configuration.",
1871
+ "descriptionWithMarkdown": "Creates GraphQL types based on your [input query](https://shopify.dev/docs/apps/functions/input-output#input) for a function. Supports JavaScript functions out of the box, or any language via the `build.typegen_command` configuration.",
1872
1872
  "flags": {
1873
1873
  "client-id": {
1874
1874
  "description": "The Client ID of your app.",
@@ -1938,7 +1938,7 @@
1938
1938
  "pluginName": "@shopify/cli",
1939
1939
  "pluginType": "core",
1940
1940
  "strict": true,
1941
- "summary": "Generate GraphQL types for a JavaScript function."
1941
+ "summary": "Generate GraphQL types for a function."
1942
1942
  },
1943
1943
  "app:generate:extension": {
1944
1944
  "aliases": [
@@ -1946,8 +1946,8 @@
1946
1946
  "args": {
1947
1947
  },
1948
1948
  "customPluginName": "@shopify/app",
1949
- "description": "Generates a new \"app extension\" (https://shopify.dev/docs/apps/app-extensions). For a list of app extensions that you can generate using this command, refer to \"Supported extensions\" (https://shopify.dev/docs/apps/structure/app-extensions/list).\n\n Each new app extension is created in a folder under `extensions/`. To learn more about the extensions file structure, refer to \"App structure\" (https://shopify.dev/docs/apps/tools/cli/structure) and the documentation for your extension.\n ",
1950
- "descriptionWithMarkdown": "Generates a new [app extension](https://shopify.dev/docs/apps/app-extensions). For a list of app extensions that you can generate using this command, refer to [Supported extensions](https://shopify.dev/docs/apps/structure/app-extensions/list).\n\n Each new app extension is created in a folder under `extensions/`. To learn more about the extensions file structure, refer to [App structure](https://shopify.dev/docs/apps/tools/cli/structure) and the documentation for your extension.\n ",
1949
+ "description": "Generates a new \"app extension\" (https://shopify.dev/docs/apps/build/app-extensions). For a list of app extensions that you can generate using this command, refer to \"Supported extensions\" (https://shopify.dev/docs/apps/build/app-extensions/list-of-app-extensions).\n\n Each new app extension is created in a folder under `extensions/`. To learn more about the extensions file structure, refer to \"App structure\" (https://shopify.dev/docs/apps/build/cli-for-apps/app-structure) and the documentation for your extension.\n ",
1950
+ "descriptionWithMarkdown": "Generates a new [app extension](https://shopify.dev/docs/apps/build/app-extensions). For a list of app extensions that you can generate using this command, refer to [Supported extensions](https://shopify.dev/docs/apps/build/app-extensions/list-of-app-extensions).\n\n Each new app extension is created in a folder under `extensions/`. To learn more about the extensions file structure, refer to [App structure](https://shopify.dev/docs/apps/build/cli-for-apps/app-structure) and the documentation for your extension.\n ",
1951
1951
  "flags": {
1952
1952
  "client-id": {
1953
1953
  "description": "The Client ID of your app.",
@@ -7933,5 +7933,5 @@
7933
7933
  "summary": "Trigger delivery of a sample webhook topic payload to a designated address."
7934
7934
  }
7935
7935
  },
7936
- "version": "3.91.1"
7936
+ "version": "3.92.0"
7937
7937
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/cli",
3
- "version": "3.91.1",
3
+ "version": "3.92.0",
4
4
  "private": false,
5
5
  "description": "A CLI tool to build for the Shopify platform",
6
6
  "keywords": [
@@ -39,56 +39,6 @@
39
39
  "/dist",
40
40
  "/oclif.manifest.json"
41
41
  ],
42
- "eslintConfig": {
43
- "extends": [
44
- "../../.eslintrc.cjs"
45
- ],
46
- "overrides": [
47
- {
48
- "files": [
49
- "**/bin/*.js"
50
- ],
51
- "parser": "espree",
52
- "extends": [
53
- "plugin:@typescript-eslint/disable-type-checked"
54
- ],
55
- "rules": {
56
- "@typescript-eslint/naming-convention": "off",
57
- "@typescript-eslint/no-floating-promises": "off",
58
- "@typescript-eslint/no-misused-promises": "off",
59
- "@typescript-eslint/no-unnecessary-type-assertion": "off",
60
- "@typescript-eslint/switch-exhaustiveness-check": "off",
61
- "import/first": "off",
62
- "import/no-unresolved": "off",
63
- "node/shebang": "off",
64
- "@shopify/cli/specific-imports-in-bootstrap-code": [
65
- "error",
66
- {
67
- "static": [
68
- "../dist/index.js"
69
- ]
70
- }
71
- ],
72
- "@typescript-eslint/consistent-type-assertions": "off"
73
- }
74
- },
75
- {
76
- "files": [
77
- "src/index.ts"
78
- ],
79
- "rules": {
80
- "@shopify/cli/specific-imports-in-bootstrap-code": [
81
- "error",
82
- {
83
- "static": [
84
- "@shopify/cli-kit/node/cli"
85
- ]
86
- }
87
- ]
88
- }
89
- }
90
- ]
91
- },
92
42
  "dependencies": {
93
43
  "@ast-grep/napi": "0.33.0",
94
44
  "esbuild": "0.27.2",
@@ -98,17 +48,15 @@
98
48
  "@oclif/core": "4.5.3",
99
49
  "@oclif/plugin-commands": "4.1.33",
100
50
  "@oclif/plugin-plugins": "5.4.47",
101
- "@shopify/app": "3.91.1",
102
- "@shopify/cli-kit": "3.91.1",
103
- "@shopify/plugin-cloudflare": "3.91.1",
104
- "@shopify/plugin-did-you-mean": "3.91.1",
105
- "@shopify/theme": "3.91.1",
51
+ "@shopify/app": "3.92.0",
52
+ "@shopify/cli-kit": "3.92.0",
53
+ "@shopify/plugin-cloudflare": "3.92.0",
54
+ "@shopify/plugin-did-you-mean": "3.92.0",
55
+ "@shopify/theme": "3.92.0",
106
56
  "@shopify/cli-hydrogen": "11.1.10",
107
57
  "@types/global-agent": "3.0.0",
108
- "@typescript-eslint/eslint-plugin": "7.13.1",
109
58
  "@vitest/coverage-istanbul": "^3.1.4",
110
- "esbuild-plugin-copy": "^2.1.1",
111
- "espree": "9.6.1"
59
+ "esbuild-plugin-copy": "^2.1.1"
112
60
  },
113
61
  "engines": {
114
62
  "node": ">=20.10.0"
@@ -1,142 +0,0 @@
1
- import {
2
- addNPMDependencies,
3
- checkForNewVersion,
4
- findUpAndReadPackageJson,
5
- getPackageManager,
6
- usesWorkspaces
7
- } from "./chunk-HAG3HJ2V.js";
8
- import {
9
- AbortError,
10
- exec,
11
- findPathUp,
12
- glob,
13
- outputContent,
14
- outputInfo,
15
- outputSuccess,
16
- outputToken,
17
- outputWarn
18
- } from "./chunk-E4GUDBAR.js";
19
- import {
20
- dirname,
21
- joinPath,
22
- moduleDirectory
23
- } from "./chunk-EG6MBBEN.js";
24
- import {
25
- init_cjs_shims
26
- } from "./chunk-PKR7KJ6P.js";
27
-
28
- // src/cli/services/upgrade.ts
29
- init_cjs_shims();
30
- var globalPlugins = ["@shopify/theme"];
31
- async function upgrade(directory, currentVersion, { env } = { env: process.env }) {
32
- let newestVersion, projectDir = await getProjectDir(directory);
33
- if (projectDir)
34
- newestVersion = await upgradeLocalShopify(projectDir, currentVersion);
35
- else {
36
- if (usingPackageManager({ env }))
37
- throw new AbortError(
38
- outputContent`Couldn't find an app toml file at ${outputToken.path(
39
- directory
40
- )}, is this a Shopify project directory?`
41
- );
42
- newestVersion = await upgradeGlobalShopify(currentVersion, { env });
43
- }
44
- newestVersion && outputSuccess(`Upgraded Shopify CLI to version ${newestVersion}`);
45
- }
46
- async function getProjectDir(directory) {
47
- let configFiles = ["shopify.app{,.*}.toml", "hydrogen.config.js", "hydrogen.config.ts"], configFile = await findPathUp(async (directory2) => {
48
- let configPaths = await glob(configFiles.map((file) => joinPath(directory2, file)));
49
- return configPaths.length > 0 ? configPaths[0] : void 0;
50
- }, {
51
- cwd: directory,
52
- type: "file"
53
- });
54
- if (configFile) return dirname(configFile);
55
- }
56
- async function upgradeLocalShopify(projectDir, currentVersion) {
57
- let packageJson = (await findUpAndReadPackageJson(projectDir)).content, packageJsonDependencies = packageJson.dependencies || {}, packageJsonDevDependencies = packageJson.devDependencies || {}, allDependencies = { ...packageJsonDependencies, ...packageJsonDevDependencies }, resolvedCLIVersion = allDependencies[await cliDependency()], resolvedAppVersion = allDependencies["@shopify/app"]?.replace(/[\^~]/, "");
58
- resolvedCLIVersion.slice(0, 1).match(/[\^~]/) && (resolvedCLIVersion = currentVersion);
59
- let newestCLIVersion = await checkForNewVersion(await cliDependency(), resolvedCLIVersion), newestAppVersion = resolvedAppVersion ? await checkForNewVersion("@shopify/app", resolvedAppVersion) : void 0;
60
- if (newestCLIVersion)
61
- outputUpgradeMessage(resolvedCLIVersion, newestCLIVersion);
62
- else if (resolvedAppVersion && newestAppVersion)
63
- outputUpgradeMessage(resolvedAppVersion, newestAppVersion);
64
- else {
65
- outputWontInstallMessage(resolvedCLIVersion);
66
- return;
67
- }
68
- return await installJsonDependencies("prod", packageJsonDependencies, projectDir), await installJsonDependencies("dev", packageJsonDevDependencies, projectDir), newestCLIVersion ?? newestAppVersion;
69
- }
70
- async function upgradeGlobalShopify(currentVersion, { env } = { env: process.env }) {
71
- let newestVersion = await checkForNewVersion(await cliDependency(), currentVersion);
72
- if (!newestVersion) {
73
- outputWontInstallMessage(currentVersion);
74
- return;
75
- }
76
- outputUpgradeMessage(currentVersion, newestVersion);
77
- let homebrewPackage = env.SHOPIFY_HOMEBREW_FORMULA;
78
- try {
79
- if (homebrewPackage)
80
- throw new AbortError(
81
- outputContent`Upgrade only works for packages managed by a Node package manager (e.g. npm). Run ${outputToken.genericShellCommand(
82
- "brew upgrade && brew update"
83
- )} instead`
84
- );
85
- await upgradeGlobalViaNpm();
86
- } catch (err) {
87
- throw outputWarn("Upgrade failed!"), err;
88
- }
89
- return newestVersion;
90
- }
91
- async function upgradeGlobalViaNpm() {
92
- let args = [
93
- "install",
94
- "-g",
95
- `${await cliDependency()}@latest`,
96
- ...globalPlugins.map((plugin) => `${plugin}@latest`)
97
- ];
98
- outputInfo(
99
- outputContent`Attempting to upgrade via ${outputToken.genericShellCommand(["npm", ...args].join(" "))}...`
100
- ), await exec("npm", args, { stdio: "inherit" });
101
- }
102
- function outputWontInstallMessage(currentVersion) {
103
- outputInfo(outputContent`You're on the latest version, ${outputToken.yellow(currentVersion)}, no need to upgrade!`);
104
- }
105
- function outputUpgradeMessage(currentVersion, newestVersion) {
106
- outputInfo(
107
- outputContent`Upgrading CLI from ${outputToken.yellow(currentVersion)} to ${outputToken.yellow(newestVersion)}...`
108
- );
109
- }
110
- async function installJsonDependencies(depsEnv, deps, directory) {
111
- let packagesToUpdate = [await cliDependency(), ...await oclifPlugins()].filter((pkg) => !!deps[pkg]).map((pkg) => ({ name: pkg, version: "latest" })), appUsesWorkspaces = await usesWorkspaces(directory);
112
- packagesToUpdate.length > 0 && await addNPMDependencies(packagesToUpdate, {
113
- packageManager: await getPackageManager(directory),
114
- type: depsEnv,
115
- directory,
116
- stdout: process.stdout,
117
- stderr: process.stderr,
118
- addToRootDirectory: appUsesWorkspaces
119
- });
120
- }
121
- async function cliDependency() {
122
- return (await packageJsonContents()).name;
123
- }
124
- async function oclifPlugins() {
125
- return (await packageJsonContents())?.oclif?.plugins || [];
126
- }
127
- var _packageJsonContents;
128
- async function packageJsonContents() {
129
- if (!_packageJsonContents) {
130
- let packageJson = await findUpAndReadPackageJson(moduleDirectory(import.meta.url));
131
- _packageJsonContents = _packageJsonContents || packageJson.content;
132
- }
133
- return _packageJsonContents;
134
- }
135
- function usingPackageManager({ env } = { env: process.env }) {
136
- return !!env.npm_config_user_agent;
137
- }
138
-
139
- export {
140
- upgrade
141
- };
142
- //# sourceMappingURL=chunk-2EQNSO7C.js.map
@@ -1,5 +0,0 @@
1
- interface UpgradeOptions {
2
- env: NodeJS.ProcessEnv;
3
- }
4
- export declare function upgrade(directory: string, currentVersion: string, { env }?: UpgradeOptions): Promise<void>;
5
- export {};
@@ -1,21 +0,0 @@
1
- import {
2
- upgrade
3
- } from "../../chunk-2EQNSO7C.js";
4
- import "../../chunk-HAG3HJ2V.js";
5
- import "../../chunk-E4GUDBAR.js";
6
- import "../../chunk-6NVYATES.js";
7
- import "../../chunk-CTFDRWUN.js";
8
- import "../../chunk-7IK72W75.js";
9
- import "../../chunk-CEUL3KX5.js";
10
- import "../../chunk-KUJQ4AB6.js";
11
- import "../../chunk-UMUTXITN.js";
12
- import "../../chunk-G2ZZKGSV.js";
13
- import "../../chunk-UV5N2VL7.js";
14
- import "../../chunk-XE5EOEBL.js";
15
- import "../../chunk-Q2H6D2MH.js";
16
- import "../../chunk-EG6MBBEN.js";
17
- import "../../chunk-PKR7KJ6P.js";
18
- export {
19
- upgrade
20
- };
21
- //# sourceMappingURL=upgrade.js.map
@@ -1,171 +0,0 @@
1
- import {
2
- upgrade
3
- } from "../../chunk-2EQNSO7C.js";
4
- import {
5
- mockAndCaptureOutput
6
- } from "../../chunk-E44JKFB6.js";
7
- import {
8
- afterEach,
9
- beforeEach,
10
- describe,
11
- globalExpect,
12
- test,
13
- vi
14
- } from "../../chunk-HTGTTXQL.js";
15
- import {
16
- node_package_manager_exports
17
- } from "../../chunk-HAG3HJ2V.js";
18
- import {
19
- AbortError,
20
- captureOutput,
21
- exec,
22
- inTemporaryDirectory,
23
- platformAndArch,
24
- touchFile,
25
- writeFile
26
- } from "../../chunk-E4GUDBAR.js";
27
- import "../../chunk-6NVYATES.js";
28
- import "../../chunk-CTFDRWUN.js";
29
- import "../../chunk-7IK72W75.js";
30
- import "../../chunk-CEUL3KX5.js";
31
- import "../../chunk-KUJQ4AB6.js";
32
- import "../../chunk-UMUTXITN.js";
33
- import "../../chunk-G2ZZKGSV.js";
34
- import "../../chunk-UV5N2VL7.js";
35
- import "../../chunk-XE5EOEBL.js";
36
- import "../../chunk-Q2H6D2MH.js";
37
- import {
38
- joinPath,
39
- normalizePath
40
- } from "../../chunk-EG6MBBEN.js";
41
- import {
42
- init_cjs_shims
43
- } from "../../chunk-PKR7KJ6P.js";
44
-
45
- // src/cli/services/upgrade.test.ts
46
- init_cjs_shims();
47
- var oldCliVersion = "3.0.0", currentCliVersion = "3.10.0";
48
- vi.mock("@shopify/cli-kit/node/os", async () => ({
49
- platformAndArch: vi.fn()
50
- }));
51
- vi.mock("@shopify/cli-kit/node/system");
52
- beforeEach(async () => {
53
- vi.mocked(platformAndArch).mockReturnValue({ platform: "windows", arch: "amd64" });
54
- });
55
- afterEach(() => {
56
- mockAndCaptureOutput().clear();
57
- });
58
- describe("upgrade global CLI", () => {
59
- test("does not upgrade globally if the latest version is found", async () => {
60
- await inTemporaryDirectory(async (tmpDir) => {
61
- let outputMock = mockAndCaptureOutput();
62
- vi.spyOn(node_package_manager_exports, "checkForNewVersion").mockResolvedValue(void 0), await upgrade(tmpDir, currentCliVersion, { env: {} }), globalExpect(outputMock.info()).toMatchInlineSnapshot(`
63
- "You're on the latest version, ${currentCliVersion}, no need to upgrade!"
64
- `);
65
- });
66
- }), test("upgrades globally using npm if the latest version is not found", async () => {
67
- await inTemporaryDirectory(async (tmpDir) => {
68
- let outputMock = mockAndCaptureOutput();
69
- vi.spyOn(node_package_manager_exports, "checkForNewVersion").mockResolvedValue(currentCliVersion), await upgrade(tmpDir, oldCliVersion, { env: {} }), globalExpect(vi.mocked(exec)).toHaveBeenCalledWith(
70
- "npm",
71
- ["install", "-g", "@shopify/cli@latest", "@shopify/theme@latest"],
72
- { stdio: "inherit" }
73
- ), globalExpect(outputMock.info()).toMatchInlineSnapshot(`
74
- "Upgrading CLI from ${oldCliVersion} to ${currentCliVersion}...
75
- Attempting to upgrade via \`npm install -g @shopify/cli@latest @shopify/theme@latest\`..."
76
- `), globalExpect(outputMock.success()).toMatchInlineSnapshot(`
77
- "Upgraded Shopify CLI to version ${currentCliVersion}"
78
- `);
79
- });
80
- }), ["shopify-cli", "shopify-cli@3"].forEach((homebrewPackageName) => {
81
- test("upgrades globally using Homebrew if the latest version is not found and the CLI was installed via Homebrew", async () => {
82
- await inTemporaryDirectory(async (tmpDir) => {
83
- vi.spyOn(node_package_manager_exports, "checkForNewVersion").mockResolvedValue(currentCliVersion), await globalExpect(async () => {
84
- await upgrade(tmpDir, oldCliVersion, { env: { SHOPIFY_HOMEBREW_FORMULA: homebrewPackageName } });
85
- }).rejects.toThrowError(AbortError);
86
- });
87
- });
88
- });
89
- });
90
- describe("upgrade local CLI", () => {
91
- test("throws an error if a valid app config file is missing", async () => {
92
- await inTemporaryDirectory(async (tmpDir) => {
93
- await Promise.all([
94
- writeFile(
95
- joinPath(tmpDir, "package.json"),
96
- JSON.stringify({ dependencies: { "@shopify/cli": currentCliVersion, "@shopify/app": currentCliVersion } })
97
- ),
98
- touchFile(joinPath(tmpDir, "shopify.wrongapp.toml"))
99
- ]);
100
- let outputMock = mockAndCaptureOutput();
101
- vi.spyOn(node_package_manager_exports, "checkForNewVersion").mockResolvedValue(void 0), await globalExpect(upgrade(tmpDir, currentCliVersion, { env: { npm_config_user_agent: "npm" } })).rejects.toBeInstanceOf(
102
- AbortError
103
- );
104
- });
105
- }), test("does not upgrade locally if the latest version is found", async () => {
106
- await inTemporaryDirectory(async (tmpDir) => {
107
- await Promise.all([
108
- writeFile(
109
- joinPath(tmpDir, "package.json"),
110
- JSON.stringify({ dependencies: { "@shopify/cli": currentCliVersion, "@shopify/app": currentCliVersion } })
111
- ),
112
- touchFile(joinPath(tmpDir, "shopify.app.toml"))
113
- ]);
114
- let outputMock = mockAndCaptureOutput();
115
- vi.spyOn(node_package_manager_exports, "checkForNewVersion").mockResolvedValue(void 0), await upgrade(tmpDir, currentCliVersion, { env: { npm_config_user_agent: "npm" } }), globalExpect(outputMock.info()).toMatchInlineSnapshot(`
116
- "You're on the latest version, ${currentCliVersion}, no need to upgrade!"
117
- `);
118
- });
119
- }), test("upgrades locally if the latest version is not found", async () => {
120
- await inTemporaryDirectory(async (tmpDir) => {
121
- await Promise.all([
122
- writeFile(
123
- joinPath(tmpDir, "package.json"),
124
- JSON.stringify({ dependencies: { "@shopify/cli": oldCliVersion, "@shopify/app": oldCliVersion } })
125
- ),
126
- touchFile(joinPath(tmpDir, "shopify.app.toml"))
127
- ]), vi.mocked(captureOutput).mockResolvedValueOnce(tmpDir);
128
- let outputMock = mockAndCaptureOutput();
129
- vi.spyOn(node_package_manager_exports, "checkForNewVersion").mockResolvedValueOnce(currentCliVersion);
130
- let addNPMDependenciesMock = vi.spyOn(node_package_manager_exports, "addNPMDependencies").mockResolvedValue(void 0);
131
- await upgrade(tmpDir, oldCliVersion, { env: {} }), globalExpect(captureOutput).toHaveBeenCalledWith("npm", ["prefix"], { cwd: normalizePath(tmpDir) }), globalExpect(outputMock.info()).toMatchInlineSnapshot(`
132
- "Upgrading CLI from ${oldCliVersion} to ${currentCliVersion}..."
133
- `), globalExpect(addNPMDependenciesMock).toHaveBeenCalledWith([{ name: "@shopify/cli", version: "latest" }], {
134
- packageManager: "npm",
135
- type: "prod",
136
- directory: normalizePath(tmpDir),
137
- stdout: process.stdout,
138
- stderr: process.stderr,
139
- addToRootDirectory: !1
140
- }), globalExpect(outputMock.success()).toMatchInlineSnapshot(`
141
- "Upgraded Shopify CLI to version ${currentCliVersion}"
142
- `);
143
- });
144
- }), test("upgrades locally if CLI is on latest version but APP isnt", async () => {
145
- await inTemporaryDirectory(async (tmpDir) => {
146
- await Promise.all([
147
- writeFile(
148
- joinPath(tmpDir, "package.json"),
149
- JSON.stringify({ dependencies: { "@shopify/cli": currentCliVersion, "@shopify/app": oldCliVersion } })
150
- ),
151
- touchFile(joinPath(tmpDir, "shopify.app.nondefault.toml"))
152
- ]), vi.mocked(captureOutput).mockResolvedValueOnce(tmpDir);
153
- let outputMock = mockAndCaptureOutput();
154
- vi.spyOn(node_package_manager_exports, "checkForNewVersion").mockResolvedValueOnce(void 0).mockResolvedValueOnce(currentCliVersion);
155
- let addNPMDependenciesMock = vi.spyOn(node_package_manager_exports, "addNPMDependencies").mockResolvedValue(void 0);
156
- await upgrade(tmpDir, oldCliVersion, { env: {} }), globalExpect(captureOutput).toHaveBeenCalledWith("npm", ["prefix"], { cwd: normalizePath(tmpDir) }), globalExpect(outputMock.info()).toMatchInlineSnapshot(`
157
- "Upgrading CLI from ${oldCliVersion} to ${currentCliVersion}..."
158
- `), globalExpect(addNPMDependenciesMock).toHaveBeenCalledWith([{ name: "@shopify/cli", version: "latest" }], {
159
- packageManager: "npm",
160
- type: "prod",
161
- directory: normalizePath(tmpDir),
162
- stdout: process.stdout,
163
- stderr: process.stderr,
164
- addToRootDirectory: !1
165
- }), globalExpect(outputMock.success()).toMatchInlineSnapshot(`
166
- "Upgraded Shopify CLI to version ${currentCliVersion}"
167
- `);
168
- });
169
- });
170
- });
171
- //# sourceMappingURL=upgrade.test.js.map