@shopify/shop-minis-cli 0.0.38 → 0.0.39

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 (161) hide show
  1. package/.eslintrc.cjs +84 -0
  2. package/.vscode/extensions.json +3 -0
  3. package/.vscode/settings.json +8 -0
  4. package/.vscode/shop-minis-cli.code-workspace +8 -0
  5. package/build/commands/cancel-submission/index.d.ts +2 -0
  6. package/build/commands/cancel-submission/index.js +22 -0
  7. package/build/commands/cancel-submission/index.js.map +1 -0
  8. package/build/commands/cancel-submission/types.d.ts +3 -0
  9. package/build/commands/cancel-submission/types.js +2 -0
  10. package/build/commands/cancel-submission/types.js.map +1 -0
  11. package/build/commands/check-submission/index.d.ts +2 -0
  12. package/build/commands/check-submission/index.js +22 -0
  13. package/build/commands/check-submission/index.js.map +1 -0
  14. package/build/commands/check-submission/types.d.ts +3 -0
  15. package/build/commands/check-submission/types.js +2 -0
  16. package/build/commands/check-submission/types.js.map +1 -0
  17. package/build/commands/config.d.ts +10 -0
  18. package/build/commands/config.js +34 -0
  19. package/build/commands/config.js.map +1 -0
  20. package/build/commands/create-mini/index.js +38 -40
  21. package/build/commands/create-mini/index.js.map +1 -1
  22. package/build/commands/create-mini/utils/template-app.js +20 -25
  23. package/build/commands/create-mini/utils/template-app.js.map +1 -1
  24. package/build/commands/dev/index.js +13 -20
  25. package/build/commands/dev/index.js.map +1 -1
  26. package/build/commands/dev/utils/android.js +34 -48
  27. package/build/commands/dev/utils/android.js.map +1 -1
  28. package/build/commands/dev/utils/binaries.d.ts +1 -22
  29. package/build/commands/dev/utils/binaries.js +19 -98
  30. package/build/commands/dev/utils/binaries.js.map +1 -1
  31. package/build/commands/dev/utils/deeplink.d.ts +1 -1
  32. package/build/commands/dev/utils/deeplink.js +2 -7
  33. package/build/commands/dev/utils/deeplink.js.map +1 -1
  34. package/build/commands/dev/utils/interactive-terminal.d.ts +1 -1
  35. package/build/commands/dev/utils/interactive-terminal.js +46 -52
  36. package/build/commands/dev/utils/interactive-terminal.js.map +1 -1
  37. package/build/commands/dev/utils/metro/metro-config.js +19 -20
  38. package/build/commands/dev/utils/metro/metro-config.js.map +1 -1
  39. package/build/commands/dev/utils/metro/metro-reporter.d.ts +2 -3
  40. package/build/commands/dev/utils/metro/metro-reporter.js +7 -12
  41. package/build/commands/dev/utils/metro/metro-reporter.js.map +1 -1
  42. package/build/commands/dev/utils/metro/metro-server-middleware.js +5 -12
  43. package/build/commands/dev/utils/metro/metro-server-middleware.js.map +1 -1
  44. package/build/commands/dev/utils/metro/metro-server.d.ts +1 -1
  45. package/build/commands/dev/utils/metro/metro-server.js +6 -13
  46. package/build/commands/dev/utils/metro/metro-server.js.map +1 -1
  47. package/build/commands/dev/utils/network.d.ts +20 -0
  48. package/build/commands/dev/utils/network.js +62 -0
  49. package/build/commands/dev/utils/network.js.map +1 -0
  50. package/build/commands/dev/utils/qr-code.js +3 -10
  51. package/build/commands/dev/utils/qr-code.js.map +1 -1
  52. package/build/commands/dev/utils/simulator.js +25 -35
  53. package/build/commands/dev/utils/simulator.js.map +1 -1
  54. package/build/commands/dev/utils/types.d.ts +1 -0
  55. package/build/commands/dev/utils/types.js +2 -0
  56. package/build/commands/dev/utils/types.js.map +1 -0
  57. package/build/commands/dev/utils/with-retries.js +1 -5
  58. package/build/commands/dev/utils/with-retries.js.map +1 -1
  59. package/build/commands/generate-graphql-types/index.js +25 -26
  60. package/build/commands/generate-graphql-types/index.js.map +1 -1
  61. package/build/commands/schemas/contextual-image.schema.d.ts +22 -0
  62. package/build/commands/schemas/contextual-image.schema.js +23 -0
  63. package/build/commands/schemas/contextual-image.schema.js.map +1 -0
  64. package/build/commands/schemas/contextual-object.schema.d.ts +18 -0
  65. package/build/commands/schemas/contextual-object.schema.js +19 -0
  66. package/build/commands/schemas/contextual-object.schema.js.map +1 -0
  67. package/build/commands/schemas/manifest.schema.d.ts +181 -0
  68. package/build/commands/schemas/manifest.schema.js +230 -0
  69. package/build/commands/schemas/manifest.schema.js.map +1 -0
  70. package/build/commands/schemas/visibility.schema.d.ts +18 -0
  71. package/build/commands/schemas/visibility.schema.js +19 -0
  72. package/build/commands/schemas/visibility.schema.js.map +1 -0
  73. package/build/commands/submit/config.d.ts +9 -0
  74. package/build/commands/submit/config.js +18 -0
  75. package/build/commands/submit/config.js.map +1 -0
  76. package/build/commands/submit/errors.d.ts +19 -0
  77. package/build/commands/submit/errors.js +87 -0
  78. package/build/commands/submit/errors.js.map +1 -0
  79. package/build/commands/submit/gcs.d.ts +6 -0
  80. package/build/commands/submit/gcs.js +10 -0
  81. package/build/commands/submit/gcs.js.map +1 -0
  82. package/build/commands/submit/graphql.d.ts +73 -0
  83. package/build/commands/submit/graphql.js +100 -0
  84. package/build/commands/submit/graphql.js.map +1 -0
  85. package/build/commands/submit/index.d.ts +2 -0
  86. package/build/commands/submit/index.js +21 -0
  87. package/build/commands/submit/index.js.map +1 -0
  88. package/build/commands/submit/submit.d.ts +4 -0
  89. package/build/commands/submit/submit.js +171 -0
  90. package/build/commands/submit/submit.js.map +1 -0
  91. package/build/commands/submit/tasks.d.ts +39 -0
  92. package/build/commands/submit/tasks.js +167 -0
  93. package/build/commands/submit/tasks.js.map +1 -0
  94. package/build/commands/submit/types.d.ts +14 -0
  95. package/build/commands/submit/types.js +2 -0
  96. package/build/commands/submit/types.js.map +1 -0
  97. package/build/commands/submit/validation.d.ts +2 -0
  98. package/build/commands/submit/validation.js +14 -0
  99. package/build/commands/submit/validation.js.map +1 -0
  100. package/build/commands/types/autogenerated/shop-minis-admin-api/fragment-masking.d.ts +13 -0
  101. package/build/commands/types/autogenerated/shop-minis-admin-api/fragment-masking.js +7 -0
  102. package/build/commands/types/autogenerated/shop-minis-admin-api/fragment-masking.js.map +1 -0
  103. package/build/commands/types/autogenerated/shop-minis-admin-api/gql.d.ts +54 -0
  104. package/build/commands/types/autogenerated/shop-minis-admin-api/gql.js +21 -0
  105. package/build/commands/types/autogenerated/shop-minis-admin-api/gql.js.map +1 -0
  106. package/build/commands/types/autogenerated/shop-minis-admin-api/graphql.d.ts +613 -0
  107. package/build/commands/types/autogenerated/shop-minis-admin-api/graphql.js +427 -0
  108. package/build/commands/types/autogenerated/shop-minis-admin-api/graphql.js.map +1 -0
  109. package/build/commands/types/autogenerated/shop-minis-admin-api/index.d.ts +2 -0
  110. package/build/commands/types/autogenerated/shop-minis-admin-api/index.js +3 -0
  111. package/build/commands/types/autogenerated/shop-minis-admin-api/index.js.map +1 -0
  112. package/build/commands/types/helpers.d.ts +1 -0
  113. package/build/commands/types/helpers.js +2 -0
  114. package/build/commands/types/helpers.js.map +1 -0
  115. package/build/commands/utils/archive.d.ts +30 -0
  116. package/build/commands/utils/archive.js +38 -0
  117. package/build/commands/utils/archive.js.map +1 -0
  118. package/build/commands/utils/exec-async-child-process.d.ts +1 -1
  119. package/build/commands/utils/exec-async-child-process.js +6 -13
  120. package/build/commands/utils/exec-async-child-process.js.map +1 -1
  121. package/build/commands/utils/file.d.ts +1 -0
  122. package/build/commands/utils/file.js +7 -0
  123. package/build/commands/utils/file.js.map +1 -0
  124. package/build/commands/{check/utils/manifest.d.ts → utils/minis-manifest.d.ts} +1 -0
  125. package/build/commands/utils/minis-manifest.js +42 -0
  126. package/build/commands/utils/minis-manifest.js.map +1 -0
  127. package/build/commands/utils/wrap-with-loading-indicator.js +3 -10
  128. package/build/commands/utils/wrap-with-loading-indicator.js.map +1 -1
  129. package/build/dev-panel/middleware.js +5 -10
  130. package/build/dev-panel/middleware.js.map +1 -1
  131. package/build/index.js +15 -13
  132. package/build/index.js.map +1 -1
  133. package/jest.config.ts +11 -0
  134. package/package.json +4 -7
  135. package/scripts/graphql-codegen.ts +23 -0
  136. package/templates/__template_common/.eslintrc.json +2 -119
  137. package/templates/__template_common/gitignore +1 -0
  138. package/templates/__template_common/package.json +8 -7
  139. package/templates/__template_common/src/manifest.json +1 -0
  140. package/templates/__template_hello_world/src/screens/BottomSheetScreen.tsx +6 -5
  141. package/templates/__template_hello_world/src/screens/QuizScreen.tsx +2 -2
  142. package/templates/__template_hello_world/src/screens/QuizSlideScreen.tsx +2 -2
  143. package/build/commands/check/index.d.ts +0 -6
  144. package/build/commands/check/index.js +0 -87
  145. package/build/commands/check/index.js.map +0 -1
  146. package/build/commands/check/utils/manifest.js +0 -26
  147. package/build/commands/check/utils/manifest.js.map +0 -1
  148. package/build/commands/check/utils/schemas/contextual-image.schema.json +0 -21
  149. package/build/commands/check/utils/schemas/contextual-object.schema.json +0 -17
  150. package/build/commands/check/utils/schemas/manifest.schema.json +0 -226
  151. package/build/commands/check/utils/schemas/visibility.schema.json +0 -17
  152. package/build/commands/check/utils/versions.d.ts +0 -1
  153. package/build/commands/check/utils/versions.js +0 -14
  154. package/build/commands/check/utils/versions.js.map +0 -1
  155. package/build/commands/dev/utils/binaries.test.d.ts +0 -1
  156. package/build/commands/dev/utils/binaries.test.js +0 -275
  157. package/build/commands/dev/utils/binaries.test.js.map +0 -1
  158. package/build/commands/dev/utils/minis-manifest.d.ts +0 -1
  159. package/build/commands/dev/utils/minis-manifest.js +0 -24
  160. package/build/commands/dev/utils/minis-manifest.js.map +0 -1
  161. package/templates/__template_hello_world/src/utils/getFlagEmoji.spec.tsx +0 -19
@@ -1,16 +1,11 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.deeplinkToSimulator = exports.installShopInSimulator = exports.bootSimulator = exports.getInstalledShopVersion = exports.promptForSimulator = void 0;
7
- const lodash_1 = __importDefault(require("lodash"));
8
- const chalk_1 = __importDefault(require("chalk"));
9
- const prompts_1 = __importDefault(require("prompts"));
10
- const exec_async_child_process_1 = require("../../utils/exec-async-child-process");
11
- const binaries_1 = require("./binaries");
1
+ import _ from 'lodash';
2
+ import chalk from 'chalk';
3
+ import prompts from 'prompts';
4
+ import { execAsync } from '../../utils/exec-async-child-process.js';
5
+ import { PATHS } from '../../config.js';
6
+ import { versionToBinaryFileName } from './binaries.js';
12
7
  async function getSelectableSimulators() {
13
- const { stdout } = await (0, exec_async_child_process_1.execAsync)('xcrun simctl list devices --json');
8
+ const { stdout } = await execAsync('xcrun simctl list devices --json');
14
9
  const simctlOutput = JSON.parse(stdout.join(''));
15
10
  const simulators = Object.keys(simctlOutput.devices)
16
11
  .filter(runtime => runtime.includes('iOS'))
@@ -18,27 +13,27 @@ async function getSelectableSimulators() {
18
13
  ...devices,
19
14
  ...simctlOutput.devices[runtime].map(device => ({
20
15
  ...device,
21
- osVersion: lodash_1.default.last(runtime.split('.')),
16
+ osVersion: _.last(runtime.split('.')),
22
17
  })),
23
18
  ], []);
24
19
  return simulators.filter(device => device.isAvailable && device.name.includes('iPhone'));
25
20
  }
26
- async function promptForSimulator() {
21
+ export async function promptForSimulator() {
27
22
  const devices = await getSelectableSimulators();
28
23
  const sortedDevices = [
29
24
  ...devices.filter(device => device.state === 'Booted'),
30
25
  ...devices.filter(device => device.state !== 'Booted'),
31
26
  ];
32
- const { value } = await (0, prompts_1.default)({
27
+ const { value } = await prompts({
33
28
  type: 'autocomplete',
34
29
  name: 'value',
35
30
  limit: 11,
36
31
  message: 'Select a simulator',
37
32
  choices: sortedDevices.map(item => {
38
33
  const isActive = item.state === 'Booted';
39
- const format = isActive ? chalk_1.default.bold : (text) => text;
34
+ const format = isActive ? chalk.bold : (text) => text;
40
35
  return {
41
- title: `${format(item.name)} ${chalk_1.default.dim(`(${item.osVersion})`)}`,
36
+ title: `${format(item.name)} ${chalk.dim(`(${item.osVersion})`)}`,
42
37
  value: item.udid,
43
38
  };
44
39
  }),
@@ -49,10 +44,9 @@ async function promptForSimulator() {
49
44
  });
50
45
  return value ? devices.find(device => device.udid === value) : null;
51
46
  }
52
- exports.promptForSimulator = promptForSimulator;
53
- async function getInstalledShopVersion(udid) {
47
+ export async function getInstalledShopVersion(udid) {
54
48
  try {
55
- const { stdout } = await (0, exec_async_child_process_1.execAsync)(`defaults read $(xcrun simctl get_app_container ${udid} com.shopifyinternal.arrive)/Info CFBundleShortVersionString`);
49
+ const { stdout } = await execAsync(`defaults read $(xcrun simctl get_app_container ${udid} com.shopifyinternal.arrive)/Info CFBundleShortVersionString`);
56
50
  const installedVersion = stdout[0]; // 2.86.0-snapshot+1674205229
57
51
  return installedVersion.split('-')[0];
58
52
  }
@@ -60,30 +54,26 @@ async function getInstalledShopVersion(udid) {
60
54
  return null;
61
55
  }
62
56
  }
63
- exports.getInstalledShopVersion = getInstalledShopVersion;
64
- async function bootSimulator(udid) {
57
+ export async function bootSimulator(udid) {
65
58
  try {
66
- await (0, exec_async_child_process_1.execAsync)(`xcrun simctl boot ${udid}`);
59
+ await execAsync(`xcrun simctl boot ${udid}`);
67
60
  }
68
61
  catch (error) {
69
62
  if (!error.stderr?.match(/Unable to boot device in current state: Booted/)) {
70
63
  throw error;
71
64
  }
72
65
  }
73
- await (0, exec_async_child_process_1.execAsync)(`open -a Simulator.app --args -CurrentDeviceUDID ${udid}`);
66
+ await execAsync(`open -a Simulator.app --args -CurrentDeviceUDID ${udid}`);
74
67
  }
75
- exports.bootSimulator = bootSimulator;
76
- async function installShopInSimulator(udid, version) {
77
- const fileName = (0, binaries_1.versionToBinaryFileName)(version, 'ios');
78
- await (0, exec_async_child_process_1.execAsync)(`unzip -o ${binaries_1.BINARIES_PATH}/${fileName} -d ${binaries_1.BINARIES_PATH}`);
79
- await (0, exec_async_child_process_1.execAsync)(`rm -rf ${binaries_1.BINARIES_PATH}/__MACOSX`); // weird directory that gets created after unzipping on macos
80
- const shopAppPath = `${binaries_1.BINARIES_PATH}/Shop.app`;
81
- await (0, exec_async_child_process_1.execAsync)(`xcrun simctl install ${udid} ${shopAppPath}`);
68
+ export async function installShopInSimulator(udid, version) {
69
+ const fileName = versionToBinaryFileName(version, 'ios');
70
+ await execAsync(`unzip -o ${PATHS.CACHE_DIR}/${fileName} -d ${PATHS.CACHE_DIR}`);
71
+ await execAsync(`rm -rf ${PATHS.CACHE_DIR}/__MACOSX`); // weird directory that gets created after unzipping on macos
72
+ const shopAppPath = `${PATHS.CACHE_DIR}/Shop.app`;
73
+ await execAsync(`xcrun simctl install ${udid} ${shopAppPath}`);
82
74
  }
83
- exports.installShopInSimulator = installShopInSimulator;
84
- async function deeplinkToSimulator(udid, deeplink) {
75
+ export async function deeplinkToSimulator(udid, deeplink) {
85
76
  // TODO: deeplink doesn't seem to be working in iphone SE
86
- await (0, exec_async_child_process_1.execAsync)(`xcrun simctl openurl ${udid} ${deeplink}`);
77
+ await execAsync(`xcrun simctl openurl ${udid} ${deeplink}`);
87
78
  }
88
- exports.deeplinkToSimulator = deeplinkToSimulator;
89
79
  //# sourceMappingURL=simulator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"simulator.js","sourceRoot":"","sources":["../../../../src/commands/dev/utils/simulator.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAsB;AACtB,kDAAyB;AACzB,sDAA6B;AAE7B,mFAA8D;AAE9D,yCAAiE;AAuBjE,KAAK,UAAU,uBAAuB;IACpC,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAA,oCAAS,EAAC,kCAAkC,CAAC,CAAA;IACpE,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAqB,CAAA;IACpE,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;SACjD,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC1C,MAAM,CACL,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC;QACpB,GAAG,OAAO;QACV,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC9C,GAAG,MAAM;YACT,SAAS,EAAE,gBAAC,CAAC,IAAI,CAAC,O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AAE,CAAC,CAAA;AAC5E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,IAAY,EAAE,OAAe;IACxE,MAAM,QAAQ,GAAG,uBAAuB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACxD,MAAM,SAAS,CACb,YAAY,KAAK,CAAC,SAAS,IAAI,QAAQ,OAAO,KAAK,CAAC,SAAS,EAAE,CAChE,CAAA;IACD,MAAM,SAAS,CAAC,WAAW,KAAK,CAAC,SAAS,WAAW,CAAC,CAAA,CAAC,6DAA6D;IAEpH,MAAM,WAAW,GAAG,GAAG,KAAK,CAAC,SAAS,WAAW,CAAA;IACjD,MAAM,SAAS,CAAC,wBAAwB,IAAI,IAAI,WAAW,EAAE,CAAC,CAAA;AAChE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAY,EAAE,QAAgB;IACtE,yDAAyD;IACzD,MAAM,SAAS,CAAC,wBAAwB,IAAI,IAAI,QAAQ,EAAE,CAAC,CAAA;AAC7D,CAAC"}
@@ -0,0 +1 @@
1
+ export type Platform = 'ios' | 'android';
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/commands/dev/utils/types.ts"],"names":[],"mappings":""}
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withRetries = void 0;
4
1
  // TODO: worth adding some specs
5
- async function withRetries(getResult, isResultReady = Boolean, { maxRetries, timeBetweenRetries } = { timeBetweenRetries: 1000, maxRetries: 120 }) {
2
+ export async function withRetries(getResult, isResultReady = Boolean, { maxRetries, timeBetweenRetries } = { timeBetweenRetries: 1000, maxRetries: 120 }) {
6
3
  if (maxRetries === 0) {
7
4
  throw new Error();
8
5
  }
@@ -24,5 +21,4 @@ async function withRetries(getResult, isResultReady = Boolean, { maxRetries, tim
24
21
  }, timeBetweenRetries);
25
22
  });
26
23
  }
27
- exports.withRetries = withRetries;
28
24
  //# sourceMappingURL=with-retries.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"with-retries.js","sourceRoot":"","sources":["../../../../src/commands/dev/utils/with-retries.ts"],"names":[],"mappings":";;;AAAA,gCAAgC;AACzB,KAAK,UAAU,WAAW,CAC/B,SAA2B,EAC3B,gBAAwC,OAAO,EAC/C,EAAC,UAAU,EAAE,kBAAkB,EAAC,GAAG,EAAC,kBAAkB,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAC;IAE9E,IAAI,UAAU,KAAK,CAAC,EAAE;QACpB,MAAM,IAAI,KAAK,EAAE,CAAA;KAClB;IACD,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAA;QAChC,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;YACzB,OAAO,MAAM,CAAA;SACd;KACF;IAAC,MAAM;QACN,aAAa;KACd;IACD,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,UAAU,CAAC,GAAG,EAAE;YACd,OAAO,CACL,WAAW,CAAC,SAAS,EAAE,aAAa,EAAE;gBACpC,kBAAkB;gBAClB,UAAU,EAAE,UAAU,GAAG,CAAC;aAC3B,CAAC,CACH,CAAA;QACH,CAAC,EAAE,kBAAkB,CAAC,CAAA;IACxB,CAAC,CAAC,CAAA;AACJ,CAAC;AA1BD,kCA0BC"}
1
+ {"version":3,"file":"with-retries.js","sourceRoot":"","sources":["../../../../src/commands/dev/utils/with-retries.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,SAA2B,EAC3B,gBAAwC,OAAO,EAC/C,EAAC,UAAU,EAAE,kBAAkB,EAAC,GAAG,EAAC,kBAAkB,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAC;IAE9E,IAAI,UAAU,KAAK,CAAC,EAAE;QACpB,MAAM,IAAI,KAAK,EAAE,CAAA;KAClB;IACD,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAA;QAChC,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;YACzB,OAAO,MAAM,CAAA;SACd;KACF;IAAC,MAAM;QACN,aAAa;KACd;IACD,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,UAAU,CAAC,GAAG,EAAE;YACd,OAAO,CACL,WAAW,CAAC,SAAS,EAAE,aAAa,EAAE;gBACpC,kBAAkB;gBAClB,UAAU,EAAE,UAAU,GAAG,CAAC;aAC3B,CAAC,CACH,CAAA;QACH,CAAC,EAAE,kBAAkB,CAAC,CAAA;IACxB,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1,26 +1,24 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.loadCommand = void 0;
7
- const commander_1 = require("commander");
8
- const chalk_1 = __importDefault(require("chalk"));
9
- const graphql_typescript_definitions_1 = require("graphql-typescript-definitions");
10
- const graphql_config_1 = require("graphql-config");
11
- const minis_manifest_1 = require("../dev/utils/minis-manifest");
12
- function loadCommand(parentProgram) {
13
- const command = new commander_1.Command()
1
+ import { createRequire } from 'node:module';
2
+ import { Command } from 'commander';
3
+ import chalk from 'chalk';
4
+ import { GraphQLConfig } from 'graphql-config';
5
+ import { getMiniManifest } from '../utils/minis-manifest.js';
6
+ // Import as cjs
7
+ // TODO: this way of requiring libraries loses the types
8
+ // https://github.com/Shopify/shop-minis-cli/issues/191
9
+ const { Builder } = createRequire(import.meta.url)('graphql-typescript-definitions');
10
+ export function loadCommand(parentProgram) {
11
+ const command = new Command()
14
12
  .name('generate-graphql-types')
15
13
  .description('Generate types for all of your .graphql files')
16
14
  .option('--watch', 'enable watch mode')
17
15
  .action(async (options) => {
18
16
  const miniDir = process.cwd();
19
- const miniHandle = (0, minis_manifest_1.getMiniManifest)().handle;
20
- console.log('Generating graphql types for', chalk_1.default.green(miniHandle), '\n');
17
+ const miniHandle = getMiniManifest().handle;
18
+ console.log('Generating graphql types for', chalk.green(miniHandle), '\n');
21
19
  // All of the paths below are relative to `miniDir` and refer to dependencies of the mini app itself
22
20
  const schemaTypesPathConfig = 'node_modules/@shopify/shop-minis-platform-sdk/src/api/types/';
23
- const config = new graphql_config_1.GraphQLConfig({
21
+ const config = new GraphQLConfig({
24
22
  config: {
25
23
  schemaPath: 'node_modules/@shopify/shop-minis-platform-sdk/src/api/minis.graphql',
26
24
  includes: [`**/*.graphql`],
@@ -31,26 +29,28 @@ function loadCommand(parentProgram) {
31
29
  },
32
30
  filepath: '',
33
31
  }, []);
34
- const builder = new graphql_typescript_definitions_1.Builder({
32
+ const builderOptions = {
35
33
  cwd: miniDir,
36
34
  addTypename: true,
37
35
  schemaTypesPath: schemaTypesPathConfig,
36
+ // @ts-expect-error this happens because typescript is loading the same definition of GraphQLConfig from different places
38
37
  config,
39
- });
38
+ };
39
+ const builder = new Builder(builderOptions);
40
40
  const schemas = [];
41
41
  const docs = [];
42
- const builtColor = chalk_1.default.inverse.bold.green(' BUILT ');
43
- const errorColor = chalk_1.default.inverse.bold.red(' ERROR ');
42
+ const builtColor = chalk.inverse.bold.green(' BUILT ');
43
+ const errorColor = chalk.inverse.bold.red(' ERROR ');
44
44
  builder.on('start:docs', () => {
45
45
  docs.length = 0;
46
46
  });
47
47
  builder.on('start:schema', () => {
48
48
  schemas.length = 0;
49
49
  });
50
- builder.on('build:docs', doc => {
50
+ builder.on('build:docs', (doc) => {
51
51
  docs.push(doc);
52
52
  });
53
- builder.on('build:schema', schema => {
53
+ builder.on('build:schema', (schema) => {
54
54
  schemas.push(schema);
55
55
  });
56
56
  builder.on('end:docs', () => {
@@ -60,17 +60,17 @@ function loadCommand(parentProgram) {
60
60
  // Make the paths a bit nicer to look at by removing all the path up to the mini's dir
61
61
  const trimmedDocumentPath = documentPath.replace(miniDir, '');
62
62
  const trimmedDefinitionPath = definitionPath.replace(miniDir, '');
63
- console.log(`${builtColor} ${chalk_1.default.dim(trimmedDocumentPath)} → ${trimmedDefinitionPath}`);
63
+ console.log(`${builtColor} ${chalk.dim(trimmedDocumentPath)} → ${trimmedDefinitionPath}`);
64
64
  });
65
65
  });
66
66
  builder.on('end:schema', () => {
67
67
  // It would be good if there was a way to get `graphql-typescript-definitions` to not build the schema types
68
68
  // but instead we will just ignore it and not tell the user what happened
69
69
  });
70
- builder.on('error', error => {
70
+ builder.on('error', (error) => {
71
71
  console.log(`${errorColor} ${error.message}`);
72
72
  if (error.stack) {
73
- console.log(chalk_1.default.dim(error.stack));
73
+ console.log(chalk.dim(error.stack));
74
74
  }
75
75
  console.log();
76
76
  if (!options.watch) {
@@ -86,5 +86,4 @@ function loadCommand(parentProgram) {
86
86
  });
87
87
  parentProgram.addCommand(command);
88
88
  }
89
- exports.loadCommand = loadCommand;
90
89
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/generate-graphql-types/index.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAiC;AACjC,kDAAyB;AACzB,mFAIuC;AACvC,mDAA4C;AAE5C,gEAA2D;AAM3D,SAAgB,WAAW,CAAC,aAAsB;IAChD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE;SAC1B,IAAI,CAAC,wBAAwB,CAAC;SAC9B,WAAW,CAAC,+CAA+C,CAAC;SAC5D,MAAM,CAAC,SAAS,EAAE,mBAAmB,CAAC;SACtC,MAAM,CAAC,KAAK,EAAE,OAA2C,EAAE,EAAE;QAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;QAC7B,MAAM,UAAU,GAAG,IAAA,gCAAe,GAAE,CAAC,MAAM,CAAA;QAE3C,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,eAAK,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,IAAI,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AO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;aAChB;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;YACpC,2FAA2F;YAC3F,2DAA2D;YAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,GAAG,CAAC,EAAC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAC,CAAC,CAAA;IAC9C,CAAC,CAAC,CAAA;IAEJ,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;AACnC,CAAC"}
@@ -0,0 +1,22 @@
1
+ declare const schema: {
2
+ $id: string;
3
+ $schema: string;
4
+ type: string;
5
+ title: string;
6
+ required: string[];
7
+ properties: {
8
+ namespace: {
9
+ type: string;
10
+ };
11
+ key: {
12
+ type: string;
13
+ };
14
+ default_value: {
15
+ type: string;
16
+ items: {
17
+ type: string;
18
+ };
19
+ };
20
+ };
21
+ };
22
+ export default schema;
@@ -0,0 +1,23 @@
1
+ const schema = {
2
+ $id: '/contextual-image.schema.js',
3
+ $schema: 'http://json-schema.org/draft-07/schema',
4
+ type: 'object',
5
+ title: 'Contextual image entry-point',
6
+ required: ['default_value'],
7
+ properties: {
8
+ namespace: {
9
+ type: 'string',
10
+ },
11
+ key: {
12
+ type: 'string',
13
+ },
14
+ default_value: {
15
+ type: 'array',
16
+ items: {
17
+ type: 'string',
18
+ },
19
+ },
20
+ },
21
+ };
22
+ export default schema;
23
+ //# sourceMappingURL=contextual-image.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextual-image.schema.js","sourceRoot":"","sources":["../../../src/commands/schemas/contextual-image.schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACb,GAAG,EAAE,6BAA6B;IAClC,OAAO,EAAE,wCAAwC;IACjD,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,8BAA8B;IACrC,QAAQ,EAAE,CAAC,eAAe,CAAC;IAC3B,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;SACf;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;SACf;QACD,aAAa,EAAE;YACb,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;aACf;SACF;KACF;CACF,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -0,0 +1,18 @@
1
+ declare const schema: {
2
+ $id: string;
3
+ $schema: string;
4
+ type: string;
5
+ title: string;
6
+ properties: {
7
+ namespace: {
8
+ type: string;
9
+ };
10
+ key: {
11
+ type: string;
12
+ };
13
+ default_value: {
14
+ type: string;
15
+ };
16
+ };
17
+ };
18
+ export default schema;
@@ -0,0 +1,19 @@
1
+ const schema = {
2
+ $id: '/contextual-object.schema.js',
3
+ $schema: 'http://json-schema.org/draft-07/schema',
4
+ type: 'object',
5
+ title: 'Contextual entry-point',
6
+ properties: {
7
+ namespace: {
8
+ type: 'string',
9
+ },
10
+ key: {
11
+ type: 'string',
12
+ },
13
+ default_value: {
14
+ type: 'string',
15
+ },
16
+ },
17
+ };
18
+ export default schema;
19
+ //# sourceMappingURL=contextual-object.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextual-object.schema.js","sourceRoot":"","sources":["../../../src/commands/schemas/contextual-object.schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACb,GAAG,EAAE,8BAA8B;IACnC,OAAO,EAAE,wCAAwC;IACjD,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,wBAAwB;IAC/B,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;SACf;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;SACf;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -0,0 +1,181 @@
1
+ declare const schema: {
2
+ $schema: string;
3
+ type: string;
4
+ title: string;
5
+ additionalProperties: boolean;
6
+ properties: {
7
+ name: {
8
+ type: string;
9
+ description: string;
10
+ maxLength: number;
11
+ };
12
+ handle: {
13
+ type: string;
14
+ description: string;
15
+ pattern: string;
16
+ };
17
+ description: {
18
+ type: string;
19
+ description: string;
20
+ maxLength: number;
21
+ };
22
+ icon_url: {
23
+ type: string;
24
+ title: string;
25
+ description: string;
26
+ };
27
+ partner_name: {
28
+ type: string;
29
+ description: string;
30
+ maxLength: number;
31
+ };
32
+ contact_email: {
33
+ type: string;
34
+ description: string;
35
+ format: string;
36
+ };
37
+ shopify_app_ids: {
38
+ type: string;
39
+ description: string;
40
+ items: {
41
+ type: string;
42
+ };
43
+ };
44
+ notification_topics: {
45
+ type: string;
46
+ description: string;
47
+ items: {
48
+ type: string;
49
+ required: string[];
50
+ properties: {
51
+ handle: {
52
+ type: string;
53
+ description: string;
54
+ };
55
+ description: {
56
+ type: string;
57
+ description: string;
58
+ };
59
+ scope: {
60
+ type: string;
61
+ description: string;
62
+ enum: string[];
63
+ };
64
+ };
65
+ };
66
+ };
67
+ notification_templates: {
68
+ type: string;
69
+ description: string;
70
+ items: {
71
+ type: string;
72
+ required: string[];
73
+ properties: {
74
+ handle: {
75
+ type: string;
76
+ description: string;
77
+ };
78
+ topic_handle: {
79
+ type: string;
80
+ description: string;
81
+ };
82
+ title: {
83
+ type: string;
84
+ description: string;
85
+ };
86
+ body: {
87
+ type: string;
88
+ description: string;
89
+ };
90
+ cooldown_minutes: {
91
+ type: string;
92
+ description: string;
93
+ };
94
+ };
95
+ };
96
+ };
97
+ entry_points: {
98
+ type: string;
99
+ description: string;
100
+ items: {
101
+ type: string;
102
+ properties: {
103
+ location: {
104
+ type: string;
105
+ enum: string[];
106
+ };
107
+ type: {
108
+ type: string;
109
+ enum: string[];
110
+ };
111
+ primary_text: {
112
+ $ref: string;
113
+ };
114
+ call_to_action_text: {
115
+ $ref: string;
116
+ };
117
+ images: {
118
+ $ref: string;
119
+ };
120
+ visibility: {
121
+ $ref: string;
122
+ };
123
+ visibility_rule: {
124
+ $ref: string;
125
+ };
126
+ pre_active_images: {
127
+ $ref: string;
128
+ description: string;
129
+ };
130
+ post_active_images: {
131
+ $ref: string;
132
+ description: string;
133
+ };
134
+ notification_topic: {
135
+ type: string;
136
+ description: string;
137
+ };
138
+ event_status: {
139
+ type: string;
140
+ description: string;
141
+ required: string[];
142
+ properties: {
143
+ namespace: {
144
+ type: string;
145
+ };
146
+ key: {
147
+ type: string;
148
+ };
149
+ default_value: {
150
+ type: string;
151
+ enum: string[];
152
+ };
153
+ };
154
+ };
155
+ };
156
+ allOf: {
157
+ if: {
158
+ properties: {
159
+ type: {
160
+ const: string;
161
+ };
162
+ };
163
+ };
164
+ then: {
165
+ required: string[];
166
+ };
167
+ }[];
168
+ };
169
+ };
170
+ ios_app_store_url: {
171
+ type: string;
172
+ description: string;
173
+ };
174
+ android_play_store_url: {
175
+ type: string;
176
+ description: string;
177
+ };
178
+ };
179
+ required: string[];
180
+ };
181
+ export default schema;