@shopify/create-app 3.58.2 → 3.59.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 (74) hide show
  1. package/dist/chunk-3JLUTHGR.js +114 -0
  2. package/dist/chunk-3JNB3A7C.js +14080 -0
  3. package/dist/chunk-4DXNY52K.js +104 -0
  4. package/dist/chunk-4SXWHRL5.js +62 -0
  5. package/dist/chunk-5RH4B5Q7.js +30996 -0
  6. package/dist/chunk-7XQTD3L4.js +213522 -0
  7. package/dist/chunk-ADG25CKO.js +2468 -0
  8. package/dist/chunk-ASLSMEKR.js +18914 -0
  9. package/dist/chunk-BOIUUJSH.js +99 -0
  10. package/dist/chunk-CKY5L2DS.js +37 -0
  11. package/dist/chunk-CPDHSAO5.js +3179 -0
  12. package/dist/chunk-FBB6KUZG.js +821 -0
  13. package/dist/chunk-G6FN5VUE.js +102 -0
  14. package/dist/chunk-GXPKATXW.js +194 -0
  15. package/dist/chunk-H7CRO63U.js +11 -0
  16. package/dist/chunk-JP7Y3CTL.js +72 -0
  17. package/dist/chunk-LKGDG6WW.js +87 -0
  18. package/dist/chunk-M63RTPGR.js +63 -0
  19. package/dist/chunk-ND5WSAZY.js +7817 -0
  20. package/dist/chunk-P4TVG45N.js +900 -0
  21. package/dist/chunk-TMGCRPEZ.js +4283 -0
  22. package/dist/chunk-UVY6LL5H.js +145 -0
  23. package/dist/chunk-VMPTLMJN.js +144 -0
  24. package/dist/chunk-WCNR75S2.js +73 -0
  25. package/dist/chunk-WLJ2CNLG.js +45349 -0
  26. package/dist/chunk-YLEF4RUH.js +144 -0
  27. package/dist/chunk-ZDCQCTOO.js +13764 -0
  28. package/dist/chunk-ZPB26OWQ.js +5605 -0
  29. package/dist/commands/init.d.ts +2 -1
  30. package/dist/commands/init.js +31 -123
  31. package/dist/commands/init.js.map +1 -1
  32. package/dist/commands/init.test.js +123 -0
  33. package/dist/constants-K3R4N3N3.js +19 -0
  34. package/dist/custom-oclif-loader-GA6B7DEF.js +83 -0
  35. package/dist/del-A5YM6R3Y.js +2846 -0
  36. package/dist/devtools-KQM4GF6J.js +3685 -0
  37. package/dist/error-handler-U53E7YKG.js +34 -0
  38. package/dist/hooks/postrun.js +108 -2
  39. package/dist/hooks/prerun.js +77 -2
  40. package/dist/index.js +22 -7
  41. package/dist/lib-76JUGQYQ.js +8 -0
  42. package/dist/local-XVLEGQFE.js +59 -0
  43. package/dist/magic-string.es-6WMSFIAX.js +1291 -0
  44. package/dist/multipart-parser-O2BQODS2.js +359 -0
  45. package/dist/node-package-manager-76YAD3UB.js +68 -0
  46. package/dist/open-B7XFJJCK.js +290 -0
  47. package/dist/out-JZ52TJE3.js +5 -0
  48. package/dist/path-HO4HBKK5.js +28 -0
  49. package/dist/prompts/init.d.ts +4 -3
  50. package/dist/prompts/init.js +23 -118
  51. package/dist/prompts/init.js.map +1 -1
  52. package/dist/prompts/init.test.js +115 -0
  53. package/dist/services/init.d.ts +3 -1
  54. package/dist/services/init.js +25 -139
  55. package/dist/services/init.js.map +1 -1
  56. package/dist/services/init.test.js +18 -0
  57. package/dist/system-XBDENYNR.js +25 -0
  58. package/dist/tsconfig.tsbuildinfo +1 -1
  59. package/dist/ui-ZVCYWXG6.js +49 -0
  60. package/dist/utils/template/cleanup.js +18 -19
  61. package/dist/utils/template/cleanup.test.js +74 -0
  62. package/dist/utils/template/npm.d.ts +2 -1
  63. package/dist/utils/template/npm.js +22 -58
  64. package/dist/utils/template/npm.js.map +1 -1
  65. package/dist/utils/template/npm.test.js +153 -0
  66. package/dist/yoga.wasm +0 -0
  67. package/oclif.manifest.json +1 -1
  68. package/package.json +5 -6
  69. package/dist/constants.d.ts +0 -1
  70. package/dist/constants.js +0 -2
  71. package/dist/constants.js.map +0 -1
  72. package/dist/utils/versions.d.ts +0 -1
  73. package/dist/utils/versions.js +0 -21
  74. package/dist/utils/versions.js.map +0 -1
@@ -1,19 +1,18 @@
1
- import { rmdir, glob } from '@shopify/cli-kit/node/fs';
2
- import { joinPath } from '@shopify/cli-kit/node/path';
3
- export default async function cleanup(webOutputDirectory) {
4
- const gitPaths = await glob([
5
- joinPath(webOutputDirectory, '**', '.git'),
6
- joinPath(webOutputDirectory, '**', '.github'),
7
- joinPath(webOutputDirectory, '**', '.gitmodules'),
8
- joinPath(webOutputDirectory, 'LICENSE*'),
9
- joinPath(webOutputDirectory, '**', 'frontend/LICENSE*'),
10
- joinPath(webOutputDirectory, 'package.json.cli2'),
11
- ], {
12
- dot: true,
13
- onlyFiles: false,
14
- onlyDirectories: false,
15
- ignore: ['**/node_modules/**'],
16
- });
17
- return Promise.all(gitPaths.map((path) => rmdir(path, { force: true }))).then(() => { });
18
- }
19
- //# sourceMappingURL=cleanup.js.map
1
+ import {
2
+ cleanup
3
+ } from "../../chunk-CKY5L2DS.js";
4
+ import "../../chunk-WLJ2CNLG.js";
5
+ import "../../chunk-FBB6KUZG.js";
6
+ import "../../chunk-YLEF4RUH.js";
7
+ import "../../chunk-G6FN5VUE.js";
8
+ import "../../chunk-UVY6LL5H.js";
9
+ import "../../chunk-7XQTD3L4.js";
10
+ import "../../chunk-P4TVG45N.js";
11
+ import "../../chunk-ZPB26OWQ.js";
12
+ import "../../chunk-WCNR75S2.js";
13
+ import "../../chunk-3JLUTHGR.js";
14
+ import "../../chunk-GXPKATXW.js";
15
+ import "../../chunk-M63RTPGR.js";
16
+ export {
17
+ cleanup as default
18
+ };
@@ -0,0 +1,74 @@
1
+ import {
2
+ cleanup
3
+ } from "../../chunk-CKY5L2DS.js";
4
+ import {
5
+ fileExists,
6
+ inTemporaryDirectory,
7
+ mkdir,
8
+ writeFile
9
+ } from "../../chunk-WLJ2CNLG.js";
10
+ import "../../chunk-FBB6KUZG.js";
11
+ import "../../chunk-YLEF4RUH.js";
12
+ import {
13
+ joinPath
14
+ } from "../../chunk-G6FN5VUE.js";
15
+ import "../../chunk-UVY6LL5H.js";
16
+ import "../../chunk-7XQTD3L4.js";
17
+ import "../../chunk-P4TVG45N.js";
18
+ import "../../chunk-ZPB26OWQ.js";
19
+ import "../../chunk-WCNR75S2.js";
20
+ import {
21
+ describe,
22
+ globalExpect,
23
+ test
24
+ } from "../../chunk-3JNB3A7C.js";
25
+ import "../../chunk-3JLUTHGR.js";
26
+ import "../../chunk-GXPKATXW.js";
27
+ import {
28
+ init_cjs_shims
29
+ } from "../../chunk-M63RTPGR.js";
30
+
31
+ // src/utils/template/cleanup.test.ts
32
+ init_cjs_shims();
33
+ describe("cleanup", () => {
34
+ async function mockProjectFolder(tmpDir) {
35
+ await Promise.all([
36
+ // should keep these
37
+ writeFile(joinPath(tmpDir, "server.js"), "console.log()"),
38
+ mkdir(joinPath(tmpDir, "node_modules")),
39
+ // should delete these
40
+ mkdir(joinPath(tmpDir, ".git")),
41
+ mkdir(joinPath(tmpDir, ".github")),
42
+ mkdir(joinPath(tmpDir, ".gitmodules")),
43
+ mkdir(joinPath(tmpDir, "frontend")),
44
+ mkdir(joinPath(tmpDir, "package.json.cli2"))
45
+ ]);
46
+ await Promise.all([
47
+ // should keep these
48
+ writeFile(joinPath(tmpDir, "frontend", "server.js"), "console.log()"),
49
+ // should delete these
50
+ mkdir(joinPath(tmpDir, "frontend", ".git")),
51
+ mkdir(joinPath(tmpDir, "frontend", "node_modules"))
52
+ ]);
53
+ }
54
+ test("cleans up template files in web directory", async () => {
55
+ 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);
63
+ });
64
+ });
65
+ test("keeps non-template files", async () => {
66
+ 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);
72
+ });
73
+ });
74
+ });
@@ -3,8 +3,9 @@ interface UpdateCLIDependenciesOptions {
3
3
  directory: string;
4
4
  packageJSON: PackageJson;
5
5
  local: boolean;
6
+ useGlobalCLI: boolean;
6
7
  }
7
- export declare function updateCLIDependencies({ packageJSON, local }: UpdateCLIDependenciesOptions): Promise<PackageJson>;
8
+ export declare function updateCLIDependencies({ packageJSON, local, useGlobalCLI, }: UpdateCLIDependenciesOptions): Promise<PackageJson>;
8
9
  export declare function getDeepInstallNPMTasks({ from, packageManager, }: {
9
10
  from: string;
10
11
  packageManager: PackageManager;
@@ -1,58 +1,22 @@
1
- import { installNodeModules } from '@shopify/cli-kit/node/node-package-manager';
2
- import { CLI_KIT_VERSION } from '@shopify/cli-kit/common/version';
3
- import { moduleDirectory, normalizePath } from '@shopify/cli-kit/node/path';
4
- import { findPathUp } from '@shopify/cli-kit/node/fs';
5
- import { platform } from 'os';
6
- export async function updateCLIDependencies({ packageJSON, local }) {
7
- packageJSON.dependencies = packageJSON.dependencies || {};
8
- packageJSON.dependencies['@shopify/cli'] = CLI_KIT_VERSION;
9
- packageJSON.dependencies['@shopify/app'] = CLI_KIT_VERSION;
10
- if (local) {
11
- const cliPath = await packagePath('cli');
12
- const appPath = await packagePath('app');
13
- const createAppPath = await packagePath('create-app');
14
- const cliKitPath = await packagePath('cli-kit');
15
- const pluginCloudflarePath = await packagePath('plugin-cloudflare');
16
- const didYouMeanPath = await packagePath('plugin-did-you-mean');
17
- // eslint-disable-next-line require-atomic-updates
18
- packageJSON.dependencies['@shopify/cli'] = cliPath;
19
- // eslint-disable-next-line require-atomic-updates
20
- packageJSON.dependencies['@shopify/app'] = appPath;
21
- const dependencyOverrides = {
22
- '@shopify/cli': cliPath,
23
- '@shopify/app': appPath,
24
- '@shopify/create-app': createAppPath,
25
- '@shopify/cli-kit': cliKitPath,
26
- '@shopify/plugin-did-you-mean': didYouMeanPath,
27
- '@shopify/plugin-cloudflare': pluginCloudflarePath,
28
- };
29
- packageJSON.overrides = packageJSON.overrides
30
- ? { ...packageJSON.overrides, ...dependencyOverrides }
31
- : dependencyOverrides;
32
- packageJSON.resolutions = packageJSON.resolutions
33
- ? { ...packageJSON.resolutions, ...dependencyOverrides }
34
- : dependencyOverrides;
35
- }
36
- return packageJSON;
37
- }
38
- async function packagePath(packageName) {
39
- const packageAbsolutePath = (await findPathUp(`packages/${packageName}`, {
40
- type: 'directory',
41
- cwd: moduleDirectory(import.meta.url),
42
- }));
43
- return `file:${packageAbsolutePath}`;
44
- }
45
- export async function getDeepInstallNPMTasks({ from, packageManager, }) {
46
- /**
47
- * Installation of dependencies using Yarn on Windows might lead
48
- * to "EPERM: operation not permitted, unlink" errors when Yarn tries
49
- * to access the cache. By limiting the network concurrency we mitigate the
50
- * error:
51
- *
52
- * Failing scenario: https://github.com/Shopify/cli/runs/7913938724
53
- * Reported issue: https://github.com/yarnpkg/yarn/issues/7212
54
- */
55
- const args = platform() === 'win32' && packageManager === 'yarn' ? ['--network-concurrency', '1'] : [];
56
- return installNodeModules({ directory: normalizePath(from), packageManager, args });
57
- }
58
- //# sourceMappingURL=npm.js.map
1
+ import {
2
+ getDeepInstallNPMTasks,
3
+ updateCLIDependencies
4
+ } from "../../chunk-4SXWHRL5.js";
5
+ import "../../chunk-H7CRO63U.js";
6
+ import "../../chunk-ZDCQCTOO.js";
7
+ import "../../chunk-WLJ2CNLG.js";
8
+ import "../../chunk-FBB6KUZG.js";
9
+ import "../../chunk-YLEF4RUH.js";
10
+ import "../../chunk-G6FN5VUE.js";
11
+ import "../../chunk-UVY6LL5H.js";
12
+ import "../../chunk-7XQTD3L4.js";
13
+ import "../../chunk-P4TVG45N.js";
14
+ import "../../chunk-ZPB26OWQ.js";
15
+ import "../../chunk-WCNR75S2.js";
16
+ import "../../chunk-3JLUTHGR.js";
17
+ import "../../chunk-GXPKATXW.js";
18
+ import "../../chunk-M63RTPGR.js";
19
+ export {
20
+ getDeepInstallNPMTasks,
21
+ updateCLIDependencies
22
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"npm.js","sourceRoot":"","sources":["../../../src/utils/template/npm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAc,MAAM,4CAA4C,CAAA;AAC1G,OAAO,EAAC,eAAe,EAAC,MAAM,iCAAiC,CAAA;AAC/D,OAAO,EAAC,eAAe,EAAE,aAAa,EAAC,MAAM,4BAA4B,CAAA;AACzE,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAA;AAQ3B,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAAC,WAAW,EAAE,KAAK,EAA+B;IAC5F,WAAW,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,IAAI,EAAE,CAAA;IACzD,WAAW,CAAC,YAAY,CAAC,cAAc,CAAC,GAAG,eAAe,CAAA;IAC1D,WAAW,CAAC,YAAY,CAAC,cAAc,CAAC,GAAG,eAAe,CAAA;IAE1D,IAAI,KAAK,EAAE;QACT,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,CAAA;QACxC,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,CAAA;QACxC,MAAM,aAAa,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,CAAA;QACrD,MAAM,UAAU,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,CAAA;QAC/C,MAAM,oBAAoB,GAAG,MAAM,WAAW,CAAC,mBAAmB,CAAC,CAAA;QACnE,MAAM,cAAc,GAAG,MAAM,WAAW,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C,CAAC,EAAE,CAAA;IACtG,OAAO,kBAAkB,CAAC,EAAC,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,IAAI,EAAC,CAAC,CAAA;AACnF,CAAC","sourcesContent":["import {PackageManager, installNodeModules, PackageJson} from '@shopify/cli-kit/node/node-package-manager'\nimport {CLI_KIT_VERSION} from '@shopify/cli-kit/common/version'\nimport {moduleDirectory, normalizePath} from '@shopify/cli-kit/node/path'\nimport {findPathUp} from '@shopify/cli-kit/node/fs'\nimport {platform} from 'os'\n\ninterface UpdateCLIDependenciesOptions {\n directory: string\n packageJSON: PackageJson\n local: boolean\n}\n\nexport async function updateCLIDependencies({packageJSON, local}: UpdateCLIDependenciesOptions): Promise<PackageJson> {\n packageJSON.dependencies = packageJSON.dependencies || {}\n packageJSON.dependencies['@shopify/cli'] = CLI_KIT_VERSION\n packageJSON.dependencies['@shopify/app'] = CLI_KIT_VERSION\n\n if (local) {\n const cliPath = await packagePath('cli')\n const appPath = await packagePath('app')\n const createAppPath = await packagePath('create-app')\n const cliKitPath = await packagePath('cli-kit')\n const pluginCloudflarePath = await packagePath('plugin-cloudflare')\n const didYouMeanPath = await packagePath('plugin-did-you-mean')\n\n // eslint-disable-next-line require-atomic-updates\n packageJSON.dependencies['@shopify/cli'] = cliPath\n // eslint-disable-next-line require-atomic-updates\n packageJSON.dependencies['@shopify/app'] = appPath\n\n const dependencyOverrides = {\n '@shopify/cli': cliPath,\n '@shopify/app': appPath,\n '@shopify/create-app': createAppPath,\n '@shopify/cli-kit': cliKitPath,\n '@shopify/plugin-did-you-mean': didYouMeanPath,\n '@shopify/plugin-cloudflare': pluginCloudflarePath,\n }\n\n packageJSON.overrides = packageJSON.overrides\n ? {...packageJSON.overrides, ...dependencyOverrides}\n : dependencyOverrides\n\n packageJSON.resolutions = packageJSON.resolutions\n ? {...packageJSON.resolutions, ...dependencyOverrides}\n : dependencyOverrides\n }\n\n return packageJSON\n}\n\nasync function packagePath(packageName: string): Promise<string> {\n const packageAbsolutePath = (await findPathUp(`packages/${packageName}`, {\n type: 'directory',\n cwd: moduleDirectory(import.meta.url),\n })) as string\n return `file:${packageAbsolutePath}`\n}\n\nexport async function getDeepInstallNPMTasks({\n from,\n packageManager,\n}: {\n from: string\n packageManager: PackageManager\n}): Promise<void> {\n /**\n * Installation of dependencies using Yarn on Windows might lead\n * to \"EPERM: operation not permitted, unlink\" errors when Yarn tries\n * to access the cache. By limiting the network concurrency we mitigate the\n * error:\n *\n * Failing scenario: https://github.com/Shopify/cli/runs/7913938724\n * Reported issue: https://github.com/yarnpkg/yarn/issues/7212\n */\n const args = platform() === 'win32' && packageManager === 'yarn' ? ['--network-concurrency', '1'] : []\n return installNodeModules({directory: normalizePath(from), packageManager, args})\n}\n"]}
1
+ {"version":3,"file":"npm.js","sourceRoot":"","sources":["../../../src/utils/template/npm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAc,MAAM,4CAA4C,CAAA;AAC1G,OAAO,EAAC,eAAe,EAAE,aAAa,EAAC,MAAM,4BAA4B,CAAA;AACzE,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,iCAAiC,CAAA;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,IAAI,CAAA;AAS3B,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAC1C,WAAW,EACX,KAAK,EACL,YAAY,GACiB;IAC7B,WAAW,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,IAAI,EAAE,CAAA;IACzD,IAAI,YAAY,EAAE;QAChB,OAAO,WAAW,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;KAChD;SAAM;QACL,WAAW,CAAC,YAAY,CAAC,cAAc,CAAC,GAAG,eAAe,CAAA;KAC3D;IAED,OAAO,WAAW,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;IAE/C,IAAI,KAAK,EAAE;QACT,MAAM,OAAO,GA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-package-manager'\nimport {moduleDirectory, normalizePath} from '@shopify/cli-kit/node/path'\nimport {findPathUp} from '@shopify/cli-kit/node/fs'\nimport {CLI_KIT_VERSION} from '@shopify/cli-kit/common/version'\nimport {platform} from 'os'\n\ninterface UpdateCLIDependenciesOptions {\n directory: string\n packageJSON: PackageJson\n local: boolean\n useGlobalCLI: boolean\n}\n\nexport async function updateCLIDependencies({\n packageJSON,\n local,\n useGlobalCLI,\n}: UpdateCLIDependenciesOptions): Promise<PackageJson> {\n packageJSON.dependencies = packageJSON.dependencies || {}\n if (useGlobalCLI) {\n delete packageJSON.dependencies['@shopify/cli']\n } else {\n packageJSON.dependencies['@shopify/cli'] = CLI_KIT_VERSION\n }\n\n delete packageJSON.dependencies['@shopify/app']\n\n if (local) {\n const cliPath = await packagePath('cli')\n\n // eslint-disable-next-line require-atomic-updates\n packageJSON.dependencies['@shopify/cli'] = cliPath\n\n const dependencyOverrides = {\n '@shopify/cli': cliPath,\n }\n\n packageJSON.overrides = packageJSON.overrides\n ? {...packageJSON.overrides, ...dependencyOverrides}\n : dependencyOverrides\n\n packageJSON.resolutions = packageJSON.resolutions\n ? {...packageJSON.resolutions, ...dependencyOverrides}\n : dependencyOverrides\n }\n\n return packageJSON\n}\n\nasync function packagePath(packageName: string): Promise<string> {\n const packageAbsolutePath = (await findPathUp(`packages/${packageName}`, {\n type: 'directory',\n cwd: moduleDirectory(import.meta.url),\n })) as string\n return `file:${packageAbsolutePath}`\n}\n\nexport async function getDeepInstallNPMTasks({\n from,\n packageManager,\n}: {\n from: string\n packageManager: PackageManager\n}): Promise<void> {\n /**\n * Installation of dependencies using Yarn on Windows might lead\n * to \"EPERM: operation not permitted, unlink\" errors when Yarn tries\n * to access the cache. By limiting the network concurrency we mitigate the\n * error:\n *\n * Failing scenario: https://github.com/Shopify/cli/runs/7913938724\n * Reported issue: https://github.com/yarnpkg/yarn/issues/7212\n */\n const args = platform() === 'win32' && packageManager === 'yarn' ? ['--network-concurrency', '1'] : []\n return installNodeModules({directory: normalizePath(from), packageManager, args})\n}\n"]}
@@ -0,0 +1,153 @@
1
+ import {
2
+ getDeepInstallNPMTasks,
3
+ updateCLIDependencies
4
+ } from "../../chunk-4SXWHRL5.js";
5
+ import "../../chunk-H7CRO63U.js";
6
+ import {
7
+ installNodeModules
8
+ } from "../../chunk-ZDCQCTOO.js";
9
+ import {
10
+ inTemporaryDirectory,
11
+ mkdir,
12
+ readFile,
13
+ writeFile
14
+ } from "../../chunk-WLJ2CNLG.js";
15
+ import "../../chunk-FBB6KUZG.js";
16
+ import "../../chunk-YLEF4RUH.js";
17
+ import {
18
+ joinPath,
19
+ moduleDirectory,
20
+ normalizePath
21
+ } from "../../chunk-G6FN5VUE.js";
22
+ import "../../chunk-UVY6LL5H.js";
23
+ import "../../chunk-7XQTD3L4.js";
24
+ import "../../chunk-P4TVG45N.js";
25
+ import "../../chunk-ZPB26OWQ.js";
26
+ import "../../chunk-WCNR75S2.js";
27
+ import {
28
+ describe,
29
+ globalExpect,
30
+ test,
31
+ vi
32
+ } from "../../chunk-3JNB3A7C.js";
33
+ import "../../chunk-3JLUTHGR.js";
34
+ import "../../chunk-GXPKATXW.js";
35
+ import {
36
+ init_cjs_shims
37
+ } from "../../chunk-M63RTPGR.js";
38
+
39
+ // src/utils/template/npm.test.ts
40
+ init_cjs_shims();
41
+ import { platform } from "os";
42
+ vi.mock("os");
43
+ vi.mock("@shopify/cli-kit/node/node-package-manager");
44
+ vi.mock("@shopify/cli-kit/common/version", () => ({ CLI_KIT_VERSION: "1.2.3" }));
45
+ describe("updateCLIDependencies", () => {
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));
78
+ 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));
87
+ 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));
96
+ globalExpect(dependencyJSON.name).toBe("@shopify/cli");
97
+ });
98
+ test("does not change existing values", async () => {
99
+ const mockPackageJSON = {
100
+ name: "",
101
+ author: "",
102
+ scripts: {},
103
+ dependencies: {
104
+ mock: "value"
105
+ },
106
+ devDependencies: {
107
+ mock: "value"
108
+ },
109
+ resolutions: {
110
+ mock: "value"
111
+ },
112
+ overrides: {
113
+ mock: "value"
114
+ }
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");
121
+ });
122
+ });
123
+ describe("getDeepInstallNPMTasks", () => {
124
+ 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
+ });
135
+ }
136
+ const defaultArgs = {
137
+ packageManager: "npm",
138
+ didInstallEverything: () => {
139
+ }
140
+ };
141
+ test.each([["darwin"], ["win32"]])("each task installs dependencies when the os is %s", async (operativeSystem) => {
142
+ 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({
147
+ directory: `${normalizePath(tmpDir)}`,
148
+ packageManager: "yarn",
149
+ args: expectedArgs
150
+ });
151
+ });
152
+ });
153
+ });
package/dist/yoga.wasm ADDED
Binary file
@@ -98,5 +98,5 @@
98
98
  "summary": "Create a new app project"
99
99
  }
100
100
  },
101
- "version": "3.58.2"
101
+ "version": "3.59.0"
102
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/create-app",
3
- "version": "3.58.2",
3
+ "version": "3.59.0",
4
4
  "private": false,
5
5
  "description": "A CLI tool to create a new Shopify app.",
6
6
  "keywords": [
@@ -42,13 +42,11 @@
42
42
  "../../.eslintrc.cjs"
43
43
  ]
44
44
  },
45
- "dependencies": {
46
- "@oclif/core": "3.19.6",
47
- "@shopify/cli-kit": "3.58.2"
48
- },
45
+ "dependencies": {},
49
46
  "devDependencies": {
50
47
  "@types/node": "18.19.3",
51
- "vite": "^4.4.9",
48
+ "esbuild-plugin-copy": "^2.1.1",
49
+ "@vitest/coverage-istanbul": "^0.34.3",
52
50
  "vitest": "^0.34.3"
53
51
  },
54
52
  "engines": {
@@ -77,6 +75,7 @@
77
75
  },
78
76
  "scripts": {
79
77
  "build": "nx build",
78
+ "bundle": "nx bundle",
80
79
  "clean": "nx clean",
81
80
  "lint": "nx lint",
82
81
  "lint:fix": "nx lint:fix",
@@ -1 +0,0 @@
1
- export {};
package/dist/constants.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -1 +0,0 @@
1
- export declare function cliVersion(): Promise<string>;
@@ -1,21 +0,0 @@
1
- import { BugError } from '@shopify/cli-kit/node/error';
2
- import { readFile, findPathUp } from '@shopify/cli-kit/node/fs';
3
- import { dirname } from '@shopify/cli-kit/node/path';
4
- import { fileURLToPath } from 'url';
5
- export async function cliVersion() {
6
- const cliPackageJsonpath = (await findPathUp('@shopify/cli/package.json', {
7
- cwd: dirname(fileURLToPath(import.meta.url)),
8
- type: 'file',
9
- allowSymlinks: true,
10
- })) ??
11
- (await findPathUp('packages/cli/package.json', {
12
- cwd: dirname(fileURLToPath(import.meta.url)),
13
- type: 'file',
14
- }));
15
- if (!cliPackageJsonpath) {
16
- throw new BugError("Couldn't determine the version of the CLI");
17
- }
18
- const packageJson = JSON.parse(await readFile(cliPackageJsonpath));
19
- return packageJson.version;
20
- }
21
- //# sourceMappingURL=versions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/utils/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAA;AACpD,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAC,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAA;AAClD,OAAO,EAAC,aAAa,EAAC,MAAM,KAAK,CAAA;AAEjC,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,kBAAkB,GACtB,CAAC,MAAM,UAAU,CAAC,2BAA2B,EAAE;QAC7C,GAAG,EAAE,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,EAAE,MAAM;QACZ,aAAa,EAAE,IAAI;KACpB,CAAC,CAAC;QACH,CAAC,MAAM,UAAU,CAAC,2BAA2B,EAAE;YAC7C,GAAG,EAAE,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC5C,IAAI,EAAE,MAAM;SACb,CAAC,CAAC,CAAA;IACL,IAAI,CAAC,kBAAkB,EAAE;QACvB,MAAM,IAAI,QAAQ,CAAC,2CAA2C,CAAC,CAAA;KAChE;IACD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAA;IAClE,OAAO,WAAW,CAAC,OAAO,CAAA;AAC5B,CAAC","sourcesContent":["import {BugError} from '@shopify/cli-kit/node/error'\nimport {readFile, findPathUp} from '@shopify/cli-kit/node/fs'\nimport {dirname} from '@shopify/cli-kit/node/path'\nimport {fileURLToPath} from 'url'\n\nexport async function cliVersion(): Promise<string> {\n const cliPackageJsonpath =\n (await findPathUp('@shopify/cli/package.json', {\n cwd: dirname(fileURLToPath(import.meta.url)),\n type: 'file',\n allowSymlinks: true,\n })) ??\n (await findPathUp('packages/cli/package.json', {\n cwd: dirname(fileURLToPath(import.meta.url)),\n type: 'file',\n }))\n if (!cliPackageJsonpath) {\n throw new BugError(\"Couldn't determine the version of the CLI\")\n }\n const packageJson = JSON.parse(await readFile(cliPackageJsonpath))\n return packageJson.version\n}\n"]}