@shopify/create-app 3.65.2 → 3.66.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 (86) hide show
  1. package/dist/chunk-2RSJVBMF.js +5625 -0
  2. package/dist/{chunk-Z65QJ5D7.js → chunk-4DRC2PSU.js} +17 -30
  3. package/dist/chunk-4OD45DDO.js +31508 -0
  4. package/dist/chunk-522OB3EU.js +45 -0
  5. package/dist/{chunk-JTKTLA7L.js → chunk-5U24TEX5.js} +5434 -10324
  6. package/dist/{chunk-GJPZCXGT.js → chunk-6A7MXLVB.js} +159 -405
  7. package/dist/{chunk-ZYKRTO5P.js → chunk-7ZCQLP5Y.js} +3 -3
  8. package/dist/{chunk-5LBEKXRW.js → chunk-FIJKOZJF.js} +19 -55
  9. package/dist/{chunk-QSKQTKTB.js → chunk-FT6PCF6E.js} +2441 -5551
  10. package/dist/chunk-GIUM5DCQ.js +2144 -0
  11. package/dist/chunk-HIAKHDLR.js +54 -0
  12. package/dist/chunk-LLSRDN3T.js +15352 -0
  13. package/dist/chunk-LTDD2GRL.js +111 -0
  14. package/dist/{chunk-63QVG2CD.js → chunk-NGBYQF44.js} +9 -9
  15. package/dist/chunk-NLC7NBUB.js +80 -0
  16. package/dist/{chunk-FMKVOTQK.js → chunk-O5K4AU7Q.js} +18 -34
  17. package/dist/chunk-OMDEA7TV.js +10615 -0
  18. package/dist/chunk-PNN7RS7Y.js +105 -0
  19. package/dist/{chunk-ZPL24Y2D.js → chunk-POZ5MGPT.js} +13 -18
  20. package/dist/chunk-T7T35H4F.js +108 -0
  21. package/dist/chunk-UBB7JKND.js +55 -0
  22. package/dist/chunk-VSLR7ET4.js +3034 -0
  23. package/dist/{chunk-SAO7C4LP.js → chunk-VZVGAREJ.js} +46821 -101962
  24. package/dist/{chunk-KDNBKIH4.js → chunk-WBQF4CSV.js} +12 -22
  25. package/dist/chunk-XVNW332R.js +524 -0
  26. package/dist/{chunk-YB6D4XQ7.js → chunk-Y4ECGRAF.js} +13 -23
  27. package/dist/chunk-ZAUZQLNO.js +3774 -0
  28. package/dist/chunk-ZULFH3SL.js +1847 -0
  29. package/dist/commands/init.d.ts +0 -1
  30. package/dist/commands/init.js +27 -27
  31. package/dist/commands/init.test.js +51 -70
  32. package/dist/{constants-24TFXZKQ.js → constants-WG7I7G3O.js} +5 -5
  33. package/dist/custom-oclif-loader-JKRJZ56E.js +47 -0
  34. package/dist/del-NW5KFKFP.js +1820 -0
  35. package/dist/devtools-UBOREV57.js +2572 -0
  36. package/dist/error-handler-26SLAJTC.js +35 -0
  37. package/dist/hooks/postrun.js +35 -42
  38. package/dist/hooks/prerun.js +58 -36
  39. package/dist/index.js +7 -7
  40. package/dist/lib-3K5QYF3J.js +9 -0
  41. package/dist/{local-3VUKCW4R.js → local-H6TW5MNX.js} +13 -13
  42. package/dist/magic-string.es-3RXPUXZF.js +843 -0
  43. package/dist/multipart-parser-QKUAJJP5.js +193 -0
  44. package/dist/{node-package-manager-HYZRZNU6.js → node-package-manager-QAUN6HGS.js} +16 -14
  45. package/dist/open-MZGVNFZO.js +197 -0
  46. package/dist/out-KDGAD475.js +6 -0
  47. package/dist/{path-CFPIDSWV.js → path-L375JOQ2.js} +4 -4
  48. package/dist/prompts/init.js +13 -13
  49. package/dist/prompts/init.test.js +42 -59
  50. package/dist/services/init.js +20 -20
  51. package/dist/services/init.test.js +5 -5
  52. package/dist/system-ZI2HKAKO.js +26 -0
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/dist/{ui-7NEDEALP.js → ui-727JEZUX.js} +13 -13
  55. package/dist/utils/template/cleanup.js +13 -13
  56. package/dist/utils/template/cleanup.test.js +18 -30
  57. package/dist/utils/template/npm.js +15 -15
  58. package/dist/utils/template/npm.test.js +48 -87
  59. package/oclif.manifest.json +1 -1
  60. package/package.json +3 -4
  61. package/dist/chunk-3US34ZNP.js +0 -145
  62. package/dist/chunk-3XYIOBQ2.js +0 -22131
  63. package/dist/chunk-6IZMEXPW.js +0 -105
  64. package/dist/chunk-7DRS5WXI.js +0 -7843
  65. package/dist/chunk-DL3MKXVR.js +0 -4754
  66. package/dist/chunk-HDVJ5FPK.js +0 -63
  67. package/dist/chunk-IKO7JBOJ.js +0 -14788
  68. package/dist/chunk-LSCXQWNO.js +0 -822
  69. package/dist/chunk-M2VKB6RG.js +0 -146
  70. package/dist/chunk-MCED27CG.js +0 -5626
  71. package/dist/chunk-SWNRLCC6.js +0 -61
  72. package/dist/chunk-T5LLJYYS.js +0 -195
  73. package/dist/chunk-U5LTJVWL.js +0 -3185
  74. package/dist/chunk-WR7YKB6H.js +0 -44962
  75. package/dist/chunk-YC4FLMDD.js +0 -74
  76. package/dist/chunk-ZRUHMMSQ.js +0 -2477
  77. package/dist/custom-oclif-loader-5KBN3RSN.js +0 -83
  78. package/dist/del-ZCPTGWOA.js +0 -2847
  79. package/dist/devtools-5N4JAP3R.js +0 -3588
  80. package/dist/error-handler-GTW2KSRC.js +0 -35
  81. package/dist/lib-CTSCLPNV.js +0 -9
  82. package/dist/magic-string.es-ATGURXGQ.js +0 -1353
  83. package/dist/multipart-parser-KYOHF24X.js +0 -360
  84. package/dist/open-JRS7RW22.js +0 -291
  85. package/dist/out-OKI3G7I5.js +0 -6
  86. package/dist/system-4S4YXUXZ.js +0 -26
@@ -17,18 +17,18 @@ import {
17
17
  renderText,
18
18
  renderTextPrompt,
19
19
  renderWarning
20
- } from "./chunk-WR7YKB6H.js";
21
- import "./chunk-LSCXQWNO.js";
22
- import "./chunk-5LBEKXRW.js";
23
- import "./chunk-Z65QJ5D7.js";
24
- import "./chunk-M2VKB6RG.js";
25
- import "./chunk-SAO7C4LP.js";
26
- import "./chunk-GJPZCXGT.js";
27
- import "./chunk-MCED27CG.js";
28
- import "./chunk-YC4FLMDD.js";
29
- import "./chunk-SWNRLCC6.js";
30
- import "./chunk-T5LLJYYS.js";
31
- import "./chunk-ZPL24Y2D.js";
20
+ } from "./chunk-4OD45DDO.js";
21
+ import "./chunk-XVNW332R.js";
22
+ import "./chunk-FIJKOZJF.js";
23
+ import "./chunk-4DRC2PSU.js";
24
+ import "./chunk-LTDD2GRL.js";
25
+ import "./chunk-VZVGAREJ.js";
26
+ import "./chunk-6A7MXLVB.js";
27
+ import "./chunk-ZAUZQLNO.js";
28
+ import "./chunk-UBB7JKND.js";
29
+ import "./chunk-522OB3EU.js";
30
+ import "./chunk-PNN7RS7Y.js";
31
+ import "./chunk-POZ5MGPT.js";
32
32
  export {
33
33
  handleCtrlC,
34
34
  isTTY,
@@ -49,4 +49,4 @@ export {
49
49
  renderTextPrompt,
50
50
  renderWarning
51
51
  };
52
- //# sourceMappingURL=ui-7NEDEALP.js.map
52
+ //# sourceMappingURL=ui-727JEZUX.js.map
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  cleanup
3
- } from "../../chunk-63QVG2CD.js";
4
- import "../../chunk-WR7YKB6H.js";
5
- import "../../chunk-LSCXQWNO.js";
6
- import "../../chunk-5LBEKXRW.js";
7
- import "../../chunk-Z65QJ5D7.js";
8
- import "../../chunk-M2VKB6RG.js";
9
- import "../../chunk-SAO7C4LP.js";
10
- import "../../chunk-GJPZCXGT.js";
11
- import "../../chunk-MCED27CG.js";
12
- import "../../chunk-YC4FLMDD.js";
13
- import "../../chunk-SWNRLCC6.js";
14
- import "../../chunk-T5LLJYYS.js";
15
- import "../../chunk-ZPL24Y2D.js";
3
+ } from "../../chunk-NGBYQF44.js";
4
+ import "../../chunk-4OD45DDO.js";
5
+ import "../../chunk-XVNW332R.js";
6
+ import "../../chunk-FIJKOZJF.js";
7
+ import "../../chunk-4DRC2PSU.js";
8
+ import "../../chunk-LTDD2GRL.js";
9
+ import "../../chunk-VZVGAREJ.js";
10
+ import "../../chunk-6A7MXLVB.js";
11
+ import "../../chunk-ZAUZQLNO.js";
12
+ import "../../chunk-UBB7JKND.js";
13
+ import "../../chunk-522OB3EU.js";
14
+ import "../../chunk-PNN7RS7Y.js";
15
+ import "../../chunk-POZ5MGPT.js";
16
16
  export {
17
17
  cleanup as default
18
18
  };
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  cleanup
3
- } from "../../chunk-63QVG2CD.js";
3
+ } from "../../chunk-NGBYQF44.js";
4
4
  import {
5
5
  fileExists,
6
6
  inTemporaryDirectory,
7
7
  mkdir,
8
8
  writeFile
9
- } from "../../chunk-WR7YKB6H.js";
10
- import "../../chunk-LSCXQWNO.js";
11
- import "../../chunk-5LBEKXRW.js";
9
+ } from "../../chunk-4OD45DDO.js";
10
+ import "../../chunk-XVNW332R.js";
11
+ import "../../chunk-FIJKOZJF.js";
12
12
  import {
13
13
  joinPath
14
- } from "../../chunk-Z65QJ5D7.js";
15
- import "../../chunk-M2VKB6RG.js";
16
- import "../../chunk-SAO7C4LP.js";
17
- import "../../chunk-GJPZCXGT.js";
18
- import "../../chunk-MCED27CG.js";
19
- import "../../chunk-YC4FLMDD.js";
14
+ } from "../../chunk-4DRC2PSU.js";
15
+ import "../../chunk-LTDD2GRL.js";
16
+ import "../../chunk-VZVGAREJ.js";
17
+ import "../../chunk-6A7MXLVB.js";
18
+ import "../../chunk-ZAUZQLNO.js";
19
+ import "../../chunk-UBB7JKND.js";
20
20
  import {
21
21
  describe,
22
22
  globalExpect,
23
23
  test
24
- } from "../../chunk-IKO7JBOJ.js";
25
- import "../../chunk-SWNRLCC6.js";
26
- import "../../chunk-T5LLJYYS.js";
24
+ } from "../../chunk-OMDEA7TV.js";
25
+ import "../../chunk-522OB3EU.js";
26
+ import "../../chunk-PNN7RS7Y.js";
27
27
  import {
28
28
  init_cjs_shims
29
- } from "../../chunk-ZPL24Y2D.js";
29
+ } from "../../chunk-POZ5MGPT.js";
30
30
 
31
31
  // src/utils/template/cleanup.test.ts
32
32
  init_cjs_shims();
@@ -42,8 +42,7 @@ describe("cleanup", () => {
42
42
  mkdir(joinPath(tmpDir, ".gitmodules")),
43
43
  mkdir(joinPath(tmpDir, "frontend")),
44
44
  mkdir(joinPath(tmpDir, "package.json.cli2"))
45
- ]);
46
- await Promise.all([
45
+ ]), await Promise.all([
47
46
  // should keep these
48
47
  writeFile(joinPath(tmpDir, "frontend", "server.js"), "console.log()"),
49
48
  // should delete these
@@ -53,22 +52,11 @@ describe("cleanup", () => {
53
52
  }
54
53
  test("cleans up template files in web directory", async () => {
55
54
  await inTemporaryDirectory(async (tmpDir) => {
56
- await mockProjectFolder(tmpDir);
57
- await cleanup(tmpDir);
58
- await globalExpect(fileExists(joinPath(tmpDir, ".git"))).resolves.toBe(false);
59
- await globalExpect(fileExists(joinPath(tmpDir, ".github"))).resolves.toBe(false);
60
- await globalExpect(fileExists(joinPath(tmpDir, ".gitmodules"))).resolves.toBe(false);
61
- await globalExpect(fileExists(joinPath(tmpDir, "frontend", ".git"))).resolves.toBe(false);
62
- await globalExpect(fileExists(joinPath(tmpDir, "package.json.cli2"))).resolves.toBe(false);
55
+ await mockProjectFolder(tmpDir), await cleanup(tmpDir), await globalExpect(fileExists(joinPath(tmpDir, ".git"))).resolves.toBe(!1), await globalExpect(fileExists(joinPath(tmpDir, ".github"))).resolves.toBe(!1), await globalExpect(fileExists(joinPath(tmpDir, ".gitmodules"))).resolves.toBe(!1), await globalExpect(fileExists(joinPath(tmpDir, "frontend", ".git"))).resolves.toBe(!1), await globalExpect(fileExists(joinPath(tmpDir, "package.json.cli2"))).resolves.toBe(!1);
63
56
  });
64
- });
65
- test("keeps non-template files", async () => {
57
+ }), test("keeps non-template files", async () => {
66
58
  await inTemporaryDirectory(async (tmpDir) => {
67
- await mockProjectFolder(tmpDir);
68
- await cleanup(tmpDir);
69
- await globalExpect(fileExists(joinPath(tmpDir, "server.js"))).resolves.toBe(true);
70
- await globalExpect(fileExists(joinPath(tmpDir, "node_modules"))).resolves.toBe(true);
71
- await globalExpect(fileExists(joinPath(tmpDir, "frontend", "node_modules"))).resolves.toBe(true);
59
+ await mockProjectFolder(tmpDir), await cleanup(tmpDir), await globalExpect(fileExists(joinPath(tmpDir, "server.js"))).resolves.toBe(!0), await globalExpect(fileExists(joinPath(tmpDir, "node_modules"))).resolves.toBe(!0), await globalExpect(fileExists(joinPath(tmpDir, "frontend", "node_modules"))).resolves.toBe(!0);
72
60
  });
73
61
  });
74
62
  });
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  getDeepInstallNPMTasks,
3
3
  updateCLIDependencies
4
- } from "../../chunk-HDVJ5FPK.js";
5
- import "../../chunk-ZYKRTO5P.js";
6
- import "../../chunk-3XYIOBQ2.js";
7
- import "../../chunk-WR7YKB6H.js";
8
- import "../../chunk-LSCXQWNO.js";
9
- import "../../chunk-5LBEKXRW.js";
10
- import "../../chunk-Z65QJ5D7.js";
11
- import "../../chunk-M2VKB6RG.js";
12
- import "../../chunk-SAO7C4LP.js";
13
- import "../../chunk-GJPZCXGT.js";
14
- import "../../chunk-MCED27CG.js";
15
- import "../../chunk-YC4FLMDD.js";
16
- import "../../chunk-SWNRLCC6.js";
17
- import "../../chunk-T5LLJYYS.js";
18
- import "../../chunk-ZPL24Y2D.js";
4
+ } from "../../chunk-HIAKHDLR.js";
5
+ import "../../chunk-7ZCQLP5Y.js";
6
+ import "../../chunk-LLSRDN3T.js";
7
+ import "../../chunk-4OD45DDO.js";
8
+ import "../../chunk-XVNW332R.js";
9
+ import "../../chunk-FIJKOZJF.js";
10
+ import "../../chunk-4DRC2PSU.js";
11
+ import "../../chunk-LTDD2GRL.js";
12
+ import "../../chunk-VZVGAREJ.js";
13
+ import "../../chunk-6A7MXLVB.js";
14
+ import "../../chunk-ZAUZQLNO.js";
15
+ import "../../chunk-UBB7JKND.js";
16
+ import "../../chunk-522OB3EU.js";
17
+ import "../../chunk-PNN7RS7Y.js";
18
+ import "../../chunk-POZ5MGPT.js";
19
19
  export {
20
20
  getDeepInstallNPMTasks,
21
21
  updateCLIDependencies
@@ -1,40 +1,40 @@
1
1
  import {
2
2
  getDeepInstallNPMTasks,
3
3
  updateCLIDependencies
4
- } from "../../chunk-HDVJ5FPK.js";
5
- import "../../chunk-ZYKRTO5P.js";
4
+ } from "../../chunk-HIAKHDLR.js";
5
+ import "../../chunk-7ZCQLP5Y.js";
6
6
  import {
7
7
  installNodeModules
8
- } from "../../chunk-3XYIOBQ2.js";
8
+ } from "../../chunk-LLSRDN3T.js";
9
9
  import {
10
10
  inTemporaryDirectory,
11
11
  mkdir,
12
12
  readFile,
13
13
  writeFile
14
- } from "../../chunk-WR7YKB6H.js";
15
- import "../../chunk-LSCXQWNO.js";
16
- import "../../chunk-5LBEKXRW.js";
14
+ } from "../../chunk-4OD45DDO.js";
15
+ import "../../chunk-XVNW332R.js";
16
+ import "../../chunk-FIJKOZJF.js";
17
17
  import {
18
18
  joinPath,
19
19
  moduleDirectory,
20
20
  normalizePath
21
- } from "../../chunk-Z65QJ5D7.js";
22
- import "../../chunk-M2VKB6RG.js";
23
- import "../../chunk-SAO7C4LP.js";
24
- import "../../chunk-GJPZCXGT.js";
25
- import "../../chunk-MCED27CG.js";
26
- import "../../chunk-YC4FLMDD.js";
21
+ } from "../../chunk-4DRC2PSU.js";
22
+ import "../../chunk-LTDD2GRL.js";
23
+ import "../../chunk-VZVGAREJ.js";
24
+ import "../../chunk-6A7MXLVB.js";
25
+ import "../../chunk-ZAUZQLNO.js";
26
+ import "../../chunk-UBB7JKND.js";
27
27
  import {
28
28
  describe,
29
29
  globalExpect,
30
30
  test,
31
31
  vi
32
- } from "../../chunk-IKO7JBOJ.js";
33
- import "../../chunk-SWNRLCC6.js";
34
- import "../../chunk-T5LLJYYS.js";
32
+ } from "../../chunk-OMDEA7TV.js";
33
+ import "../../chunk-522OB3EU.js";
34
+ import "../../chunk-PNN7RS7Y.js";
35
35
  import {
36
36
  init_cjs_shims
37
- } from "../../chunk-ZPL24Y2D.js";
37
+ } from "../../chunk-POZ5MGPT.js";
38
38
 
39
39
  // src/utils/template/npm.test.ts
40
40
  init_cjs_shims();
@@ -44,59 +44,31 @@ vi.mock("@shopify/cli-kit/node/node-package-manager");
44
44
  vi.mock("@shopify/cli-kit/common/version", () => ({ CLI_KIT_VERSION: "1.2.3" }));
45
45
  describe("updateCLIDependencies", () => {
46
46
  test("updates @shopify/cli and deletes @shopify/app if not using global CLI", async () => {
47
- const mockPackageJSON = {};
48
- const directory = moduleDirectory(import.meta.url);
49
- await updateCLIDependencies({ packageJSON: mockPackageJSON, local: false, directory, useGlobalCLI: false });
50
- globalExpect(mockPackageJSON.dependencies["@shopify/cli"]).toBe("1.2.3");
51
- globalExpect(mockPackageJSON.dependencies["@shopify/app"]).toBeUndefined();
52
- });
53
- test("removes @shopify/cli and @shopify/app if using global CLI", async () => {
54
- const mockPackageJSON = {};
55
- const directory = moduleDirectory(import.meta.url);
56
- await updateCLIDependencies({ packageJSON: mockPackageJSON, local: false, directory, useGlobalCLI: true });
57
- globalExpect(mockPackageJSON.dependencies["@shopify/cli"]).toBeUndefined();
58
- globalExpect(mockPackageJSON.dependencies["@shopify/app"]).toBeUndefined();
59
- });
60
- test("does not update overrides or resolutions if local is false", async () => {
61
- const mockPackageJSON = { overrides: {}, resolutions: {} };
62
- const directory = moduleDirectory(import.meta.url);
63
- await updateCLIDependencies({ packageJSON: mockPackageJSON, local: false, directory, useGlobalCLI: false });
64
- globalExpect(mockPackageJSON.overrides["@shopify/cli"]).toBeUndefined();
65
- globalExpect(mockPackageJSON.overrides["@shopify/app"]).toBeUndefined();
66
- globalExpect(mockPackageJSON.overrides["@shopify/cli-kit"]).toBeUndefined();
67
- globalExpect(mockPackageJSON.resolutions["@shopify/cli"]).toBeUndefined();
68
- globalExpect(mockPackageJSON.resolutions["@shopify/app"]).toBeUndefined();
69
- globalExpect(mockPackageJSON.resolutions["@shopify/cli-kit"]).toBeUndefined();
70
- });
71
- test("updates overrides for @shopify/cli if local is true", async () => {
72
- const mockPackageJSON = {};
73
- const directory = moduleDirectory(import.meta.url);
74
- await updateCLIDependencies({ packageJSON: mockPackageJSON, local: true, directory, useGlobalCLI: false });
75
- const dependencyOveride = mockPackageJSON.overrides["@shopify/cli"];
76
- const dependencyPath = joinPath(dependencyOveride.replace("file:", ""), "package.json");
77
- const dependencyJSON = JSON.parse(await readFile(dependencyPath));
47
+ let mockPackageJSON = {}, directory = moduleDirectory(import.meta.url);
48
+ await updateCLIDependencies({ packageJSON: mockPackageJSON, local: !1, directory, useGlobalCLI: !1 }), globalExpect(mockPackageJSON.dependencies["@shopify/cli"]).toBe("1.2.3"), globalExpect(mockPackageJSON.dependencies["@shopify/app"]).toBeUndefined();
49
+ }), test("removes @shopify/cli and @shopify/app if using global CLI", async () => {
50
+ let mockPackageJSON = {}, directory = moduleDirectory(import.meta.url);
51
+ await updateCLIDependencies({ packageJSON: mockPackageJSON, local: !1, directory, useGlobalCLI: !0 }), globalExpect(mockPackageJSON.dependencies["@shopify/cli"]).toBeUndefined(), globalExpect(mockPackageJSON.dependencies["@shopify/app"]).toBeUndefined();
52
+ }), test("does not update overrides or resolutions if local is false", async () => {
53
+ let mockPackageJSON = { overrides: {}, resolutions: {} }, directory = moduleDirectory(import.meta.url);
54
+ await updateCLIDependencies({ packageJSON: mockPackageJSON, local: !1, directory, useGlobalCLI: !1 }), globalExpect(mockPackageJSON.overrides["@shopify/cli"]).toBeUndefined(), globalExpect(mockPackageJSON.overrides["@shopify/app"]).toBeUndefined(), globalExpect(mockPackageJSON.overrides["@shopify/cli-kit"]).toBeUndefined(), globalExpect(mockPackageJSON.resolutions["@shopify/cli"]).toBeUndefined(), globalExpect(mockPackageJSON.resolutions["@shopify/app"]).toBeUndefined(), globalExpect(mockPackageJSON.resolutions["@shopify/cli-kit"]).toBeUndefined();
55
+ }), test("updates overrides for @shopify/cli if local is true", async () => {
56
+ let mockPackageJSON = {}, directory = moduleDirectory(import.meta.url);
57
+ await updateCLIDependencies({ packageJSON: mockPackageJSON, local: !0, directory, useGlobalCLI: !1 });
58
+ let dependencyOveride = mockPackageJSON.overrides["@shopify/cli"], dependencyPath = joinPath(dependencyOveride.replace("file:", ""), "package.json"), dependencyJSON = JSON.parse(await readFile(dependencyPath));
78
59
  globalExpect(dependencyJSON.name).toBe("@shopify/cli");
79
- });
80
- test("updates resolutions for @shopify/cli if local is true", async () => {
81
- const mockPackageJSON = {};
82
- const directory = moduleDirectory(import.meta.url);
83
- await updateCLIDependencies({ packageJSON: mockPackageJSON, local: true, directory, useGlobalCLI: false });
84
- const dependencyResolution = mockPackageJSON.resolutions["@shopify/cli"];
85
- const dependencyPath = joinPath(dependencyResolution.replace("file:", ""), "package.json");
86
- const dependencyJSON = JSON.parse(await readFile(dependencyPath));
60
+ }), test("updates resolutions for @shopify/cli if local is true", async () => {
61
+ let mockPackageJSON = {}, directory = moduleDirectory(import.meta.url);
62
+ await updateCLIDependencies({ packageJSON: mockPackageJSON, local: !0, directory, useGlobalCLI: !1 });
63
+ let dependencyResolution = mockPackageJSON.resolutions["@shopify/cli"], dependencyPath = joinPath(dependencyResolution.replace("file:", ""), "package.json"), dependencyJSON = JSON.parse(await readFile(dependencyPath));
87
64
  globalExpect(dependencyJSON.name).toBe("@shopify/cli");
88
- });
89
- test("updates dependency for @shopify/cli if local is true", async () => {
90
- const mockPackageJSON = {};
91
- const directory = moduleDirectory(import.meta.url);
92
- await updateCLIDependencies({ packageJSON: mockPackageJSON, local: true, directory, useGlobalCLI: false });
93
- const dependencyResolution = mockPackageJSON.dependencies["@shopify/cli"];
94
- const dependencyPath = joinPath(dependencyResolution.replace("file:", ""), "package.json");
95
- const dependencyJSON = JSON.parse(await readFile(dependencyPath));
65
+ }), test("updates dependency for @shopify/cli if local is true", async () => {
66
+ let mockPackageJSON = {}, directory = moduleDirectory(import.meta.url);
67
+ await updateCLIDependencies({ packageJSON: mockPackageJSON, local: !0, directory, useGlobalCLI: !1 });
68
+ let dependencyResolution = mockPackageJSON.dependencies["@shopify/cli"], dependencyPath = joinPath(dependencyResolution.replace("file:", ""), "package.json"), dependencyJSON = JSON.parse(await readFile(dependencyPath));
96
69
  globalExpect(dependencyJSON.name).toBe("@shopify/cli");
97
- });
98
- test("does not change existing values", async () => {
99
- const mockPackageJSON = {
70
+ }), test("does not change existing values", async () => {
71
+ let mockPackageJSON = {
100
72
  name: "",
101
73
  author: "",
102
74
  scripts: {},
@@ -112,38 +84,27 @@ describe("updateCLIDependencies", () => {
112
84
  overrides: {
113
85
  mock: "value"
114
86
  }
115
- };
116
- const directory = moduleDirectory(import.meta.url);
117
- await updateCLIDependencies({ packageJSON: mockPackageJSON, local: false, directory, useGlobalCLI: false });
118
- globalExpect(mockPackageJSON.dependencies.mock).toBe("value");
119
- globalExpect(mockPackageJSON.overrides.mock).toBe("value");
120
- globalExpect(mockPackageJSON.resolutions.mock).toBe("value");
87
+ }, directory = moduleDirectory(import.meta.url);
88
+ await updateCLIDependencies({ packageJSON: mockPackageJSON, local: !1, directory, useGlobalCLI: !1 }), globalExpect(mockPackageJSON.dependencies.mock).toBe("value"), globalExpect(mockPackageJSON.overrides.mock).toBe("value"), globalExpect(mockPackageJSON.resolutions.mock).toBe("value");
121
89
  });
122
90
  });
123
91
  describe("getDeepInstallNPMTasks", () => {
124
92
  async function mockAppFolder(callback) {
125
- await inTemporaryDirectory(async (tmpDir) => {
126
- await mkdir(joinPath(tmpDir, "web"));
127
- await mkdir(joinPath(tmpDir, "web", "frontend"));
128
- await Promise.all([
129
- writeFile(joinPath(tmpDir, "package.json"), "{}"),
130
- writeFile(joinPath(tmpDir, "web", "package.json"), "{}"),
131
- writeFile(joinPath(tmpDir, "web", "frontend", "package.json"), "{}")
132
- ]);
133
- return callback(tmpDir);
134
- });
93
+ await inTemporaryDirectory(async (tmpDir) => (await mkdir(joinPath(tmpDir, "web")), await mkdir(joinPath(tmpDir, "web", "frontend")), await Promise.all([
94
+ writeFile(joinPath(tmpDir, "package.json"), "{}"),
95
+ writeFile(joinPath(tmpDir, "web", "package.json"), "{}"),
96
+ writeFile(joinPath(tmpDir, "web", "frontend", "package.json"), "{}")
97
+ ]), callback(tmpDir)));
135
98
  }
136
- const defaultArgs = {
99
+ let defaultArgs = {
137
100
  packageManager: "npm",
138
101
  didInstallEverything: () => {
139
102
  }
140
103
  };
141
104
  test.each([["darwin"], ["win32"]])("each task installs dependencies when the os is %s", async (operativeSystem) => {
142
105
  await mockAppFolder(async (tmpDir) => {
143
- const expectedArgs = operativeSystem === "win32" ? ["--network-concurrency", "1"] : [];
144
- vi.mocked(platform).mockReturnValue(operativeSystem);
145
- await getDeepInstallNPMTasks({ ...defaultArgs, packageManager: "yarn", from: tmpDir });
146
- globalExpect(installNodeModules).toHaveBeenCalledWith({
106
+ let expectedArgs = operativeSystem === "win32" ? ["--network-concurrency", "1"] : [];
107
+ vi.mocked(platform).mockReturnValue(operativeSystem), await getDeepInstallNPMTasks({ ...defaultArgs, packageManager: "yarn", from: tmpDir }), globalExpect(installNodeModules).toHaveBeenCalledWith({
147
108
  directory: `${normalizePath(tmpDir)}`,
148
109
  packageManager: "yarn",
149
110
  args: expectedArgs
@@ -99,5 +99,5 @@
99
99
  "summary": "Create a new app project"
100
100
  }
101
101
  },
102
- "version": "3.65.2"
102
+ "version": "3.66.0"
103
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/create-app",
3
- "version": "3.65.2",
3
+ "version": "3.66.0",
4
4
  "private": false,
5
5
  "description": "A CLI tool to create a new Shopify app.",
6
6
  "keywords": [
@@ -45,11 +45,10 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@oclif/core": "3.26.5",
48
- "@shopify/cli-kit": "3.65.2",
48
+ "@shopify/cli-kit": "3.66.0",
49
49
  "@types/node": "18.19.3",
50
50
  "esbuild-plugin-copy": "^2.1.1",
51
- "@vitest/coverage-istanbul": "^1.6.0",
52
- "vitest": "^1.6.0"
51
+ "@vitest/coverage-istanbul": "^1.6.0"
53
52
  },
54
53
  "engines": {
55
54
  "node": "^18.20.0 || >=20.10.0"
@@ -1,145 +0,0 @@
1
- import {
2
- generateRandomNameForSubdirectory,
3
- installGlobalCLIPrompt,
4
- renderSelectPrompt,
5
- renderText,
6
- renderTextPrompt
7
- } from "./chunk-WR7YKB6H.js";
8
- import {
9
- __export,
10
- init_cjs_shims
11
- } from "./chunk-ZPL24Y2D.js";
12
-
13
- // src/prompts/init.ts
14
- var init_exports = {};
15
- __export(init_exports, {
16
- default: () => init_default,
17
- isPredefinedTemplate: () => isPredefinedTemplate,
18
- templates: () => templates,
19
- visibleTemplates: () => visibleTemplates
20
- });
21
- init_cjs_shims();
22
- var templates = {
23
- remix: {
24
- url: "https://github.com/Shopify/shopify-app-template-remix",
25
- label: "Start with Remix (recommended)",
26
- visible: true,
27
- branches: {
28
- prompt: "For your Remix template, which language do you want?",
29
- options: {
30
- javascript: { branch: "javascript", label: "JavaScript" },
31
- typescript: { branch: "main", label: "TypeScript" }
32
- }
33
- }
34
- },
35
- none: {
36
- url: "https://github.com/Shopify/shopify-app-template-none",
37
- label: "Start by adding your first extension",
38
- visible: true
39
- },
40
- node: {
41
- url: "https://github.com/Shopify/shopify-app-template-node",
42
- visible: false
43
- },
44
- php: {
45
- url: "https://github.com/Shopify/shopify-app-template-php",
46
- visible: false
47
- },
48
- ruby: {
49
- url: "https://github.com/Shopify/shopify-app-template-ruby",
50
- visible: false
51
- }
52
- };
53
- var allTemplates = Object.keys(templates);
54
- var visibleTemplates = allTemplates.filter((key) => templates[key].visible);
55
- var templateOptionsInOrder = ["remix", "none"];
56
- var init = async (options) => {
57
- let name = options.name;
58
- let template = options.template;
59
- const flavor = options.flavor;
60
- const defaults = {
61
- name: await generateRandomNameForSubdirectory({ suffix: "app", directory: options.directory }),
62
- template: templates.remix.url
63
- };
64
- let welcomed = false;
65
- if (!name) {
66
- renderText({ text: "\nWelcome. Let\u2019s get started by naming your app project. You can change it later." });
67
- welcomed = true;
68
- name = await renderTextPrompt({
69
- message: "Your project name?",
70
- defaultValue: defaults.name,
71
- validate: (value) => {
72
- if (value.length === 0) {
73
- return "App name can't be empty";
74
- }
75
- if (value.length > 30) {
76
- return "Enter a shorter name (30 character max.)";
77
- }
78
- if (value.toLowerCase().includes("shopify")) {
79
- return "App name can't include the word 'shopify'";
80
- }
81
- }
82
- });
83
- }
84
- if (!template) {
85
- if (!welcomed) {
86
- renderText({ text: "\nWelcome. Let\u2019s get started by choosing a template for your app project." });
87
- welcomed = true;
88
- }
89
- template = await renderSelectPrompt({
90
- choices: templateOptionsInOrder.map((key) => {
91
- return {
92
- label: templates[key].label || key,
93
- value: key
94
- };
95
- }),
96
- message: "Get started building your app:",
97
- defaultValue: allTemplates.find((key) => templates[key].url === defaults.template)
98
- });
99
- }
100
- const answers = {
101
- ...options,
102
- name,
103
- template,
104
- templateType: isPredefinedTemplate(template) ? template : "custom",
105
- globalCLIResult: { install: false, alreadyInstalled: false }
106
- };
107
- let selectedUrl;
108
- let branch;
109
- if (answers.templateType !== "custom") {
110
- const selectedTemplate = templates[answers.templateType];
111
- selectedUrl = selectedTemplate.url;
112
- if (selectedTemplate.branches) {
113
- if (flavor) {
114
- branch = selectedTemplate.branches.options[flavor]?.branch;
115
- } else {
116
- branch = await renderSelectPrompt({
117
- message: selectedTemplate.branches.prompt || "Choose a flavor:",
118
- choices: Object.entries(selectedTemplate.branches.options).map(([_key, branch2]) => ({
119
- value: branch2.branch,
120
- label: branch2.label
121
- }))
122
- });
123
- }
124
- }
125
- }
126
- if (branch) {
127
- selectedUrl += `#${branch}`;
128
- }
129
- answers.template = selectedUrl || answers.template || defaults.template;
130
- answers.globalCLIResult = await installGlobalCLIPrompt();
131
- return answers;
132
- };
133
- var init_default = init;
134
- function isPredefinedTemplate(template) {
135
- return allTemplates.includes(template);
136
- }
137
-
138
- export {
139
- templates,
140
- visibleTemplates,
141
- init_default,
142
- isPredefinedTemplate,
143
- init_exports
144
- };
145
- //# sourceMappingURL=chunk-3US34ZNP.js.map