@shopify/shop-minis-cli 0.0.161 → 0.0.162

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 (80) hide show
  1. package/build/commands/create-mini/standalone/examples/with-camera-access/.eslintignore +1 -0
  2. package/build/commands/create-mini/standalone/examples/with-camera-access/.eslintrc.js +3 -0
  3. package/build/commands/create-mini/standalone/examples/with-camera-access/.graphqlrc.js +1 -0
  4. package/build/commands/create-mini/standalone/examples/with-camera-access/.prettierrc.json +8 -0
  5. package/build/commands/create-mini/standalone/examples/with-camera-access/README.md +30 -0
  6. package/build/commands/create-mini/standalone/examples/with-camera-access/assets.d.ts +14 -0
  7. package/build/commands/create-mini/standalone/examples/with-camera-access/babel.config.js +5 -0
  8. package/build/commands/create-mini/standalone/examples/with-camera-access/index.tsx +5 -0
  9. package/build/commands/create-mini/standalone/examples/with-camera-access/metro.config.js +3 -0
  10. package/build/commands/create-mini/standalone/examples/with-camera-access/package.json +33 -0
  11. package/build/commands/create-mini/standalone/examples/with-camera-access/src/App.tsx +152 -0
  12. package/build/commands/create-mini/standalone/examples/with-camera-access/src/index.tsx +9 -0
  13. package/build/commands/create-mini/standalone/examples/with-camera-access/src/manifest.json +5 -0
  14. package/build/commands/create-mini/standalone/examples/with-camera-access/tsconfig.json +41 -0
  15. package/build/commands/create-mini/standalone/examples/with-fal-ai/.eslintignore +1 -0
  16. package/build/commands/create-mini/standalone/examples/with-fal-ai/.eslintrc.js +3 -0
  17. package/build/commands/create-mini/standalone/examples/with-fal-ai/.graphqlrc.js +1 -0
  18. package/build/commands/create-mini/standalone/examples/with-fal-ai/.prettierrc.json +8 -0
  19. package/build/commands/create-mini/standalone/examples/with-fal-ai/README.md +46 -0
  20. package/build/commands/create-mini/standalone/examples/with-fal-ai/assets.d.ts +14 -0
  21. package/build/commands/create-mini/standalone/examples/with-fal-ai/babel.config.js +5 -0
  22. package/build/commands/create-mini/standalone/examples/with-fal-ai/index.tsx +5 -0
  23. package/build/commands/create-mini/standalone/examples/with-fal-ai/metro.config.js +3 -0
  24. package/build/commands/create-mini/standalone/examples/with-fal-ai/package.json +33 -0
  25. package/build/commands/create-mini/standalone/examples/with-fal-ai/src/App.tsx +5 -0
  26. package/build/commands/create-mini/standalone/examples/with-fal-ai/src/index.tsx +9 -0
  27. package/build/commands/create-mini/standalone/examples/with-fal-ai/src/manifest.json +21 -0
  28. package/build/commands/create-mini/standalone/examples/with-fal-ai/src/screens/HomeScreen.tsx +142 -0
  29. package/build/commands/create-mini/standalone/examples/with-fal-ai/tsconfig.json +41 -0
  30. package/build/commands/create-mini/standalone/examples/with-getting-started/README.md +18 -0
  31. package/build/commands/create-mini/standalone/examples/with-getting-started/package.json +3 -3
  32. package/build/commands/create-mini/standalone/examples/with-search/.eslintignore +1 -0
  33. package/build/commands/create-mini/standalone/examples/with-search/.eslintrc.js +3 -0
  34. package/build/commands/create-mini/standalone/examples/with-search/.graphqlrc.js +1 -0
  35. package/build/commands/create-mini/standalone/examples/with-search/.prettierrc.json +8 -0
  36. package/build/commands/create-mini/standalone/examples/with-search/README.md +25 -0
  37. package/build/commands/create-mini/standalone/examples/with-search/assets.d.ts +14 -0
  38. package/build/commands/create-mini/standalone/examples/with-search/babel.config.js +5 -0
  39. package/build/commands/create-mini/standalone/examples/with-search/index.tsx +5 -0
  40. package/build/commands/create-mini/standalone/examples/with-search/metro.config.js +3 -0
  41. package/build/commands/create-mini/standalone/examples/with-search/package.json +33 -0
  42. package/build/commands/create-mini/standalone/examples/with-search/src/App.tsx +23 -0
  43. package/build/commands/create-mini/standalone/examples/with-search/src/components/HeaderAction.tsx +32 -0
  44. package/build/commands/create-mini/standalone/examples/with-search/src/components/ShopCard.tsx +92 -0
  45. package/build/commands/create-mini/standalone/examples/with-search/src/index.tsx +9 -0
  46. package/build/commands/create-mini/standalone/examples/with-search/src/manifest.json +7 -0
  47. package/build/commands/create-mini/standalone/examples/with-search/src/screens/MerchantSearchScreen.tsx +126 -0
  48. package/build/commands/create-mini/standalone/examples/with-search/src/screens/ProductSearchScreen.tsx +115 -0
  49. package/build/commands/create-mini/standalone/examples/with-search/src/types/screens.ts +6 -0
  50. package/build/commands/create-mini/standalone/examples/with-search/tsconfig.json +41 -0
  51. package/build/commands/create-mini/standalone/examples/with-user-data/.eslintignore +1 -0
  52. package/build/commands/create-mini/standalone/examples/with-user-data/.eslintrc.js +3 -0
  53. package/build/commands/create-mini/standalone/examples/with-user-data/.graphqlrc.js +1 -0
  54. package/build/commands/create-mini/standalone/examples/with-user-data/.prettierrc.json +8 -0
  55. package/build/commands/create-mini/standalone/examples/with-user-data/README.md +26 -0
  56. package/build/commands/create-mini/standalone/examples/with-user-data/assets.d.ts +14 -0
  57. package/build/commands/create-mini/standalone/examples/with-user-data/babel.config.js +5 -0
  58. package/build/commands/create-mini/standalone/examples/with-user-data/index.tsx +5 -0
  59. package/build/commands/create-mini/standalone/examples/with-user-data/metro.config.js +3 -0
  60. package/build/commands/create-mini/standalone/examples/with-user-data/package.json +33 -0
  61. package/build/commands/create-mini/standalone/examples/with-user-data/src/App.tsx +5 -0
  62. package/build/commands/create-mini/standalone/examples/with-user-data/src/components/ProductSection.tsx +39 -0
  63. package/build/commands/create-mini/standalone/examples/with-user-data/src/components/SectionStyles.ts +9 -0
  64. package/build/commands/create-mini/standalone/examples/with-user-data/src/components/ShopCard.tsx +42 -0
  65. package/build/commands/create-mini/standalone/examples/with-user-data/src/components/ShopSection.tsx +40 -0
  66. package/build/commands/create-mini/standalone/examples/with-user-data/src/index.tsx +9 -0
  67. package/build/commands/create-mini/standalone/examples/with-user-data/src/manifest.json +10 -0
  68. package/build/commands/create-mini/standalone/examples/with-user-data/src/screens/HomeScreen.tsx +67 -0
  69. package/build/commands/create-mini/standalone/examples/with-user-data/tsconfig.json +41 -0
  70. package/build/commands/create-mini/standalone/index.js +11 -4
  71. package/build/commands/create-mini/standalone/index.js.map +1 -1
  72. package/build/commands/create-mini/utils/examples.d.ts +3 -3
  73. package/build/commands/create-mini/utils/examples.js +16 -7
  74. package/build/commands/create-mini/utils/examples.js.map +1 -1
  75. package/build/commands/create-mini/utils/index.js.map +1 -1
  76. package/build/utils/package-manager.d.ts +7 -0
  77. package/build/utils/package-manager.js +15 -0
  78. package/build/utils/package-manager.js.map +1 -1
  79. package/package.json +1 -1
  80. package/scripts/test-create-mini-standalone.ts +24 -7
@@ -1,16 +1,30 @@
1
1
  import {execSync} from 'node:child_process'
2
+ import {readdir} from 'node:fs/promises'
3
+ import path from 'node:path'
2
4
 
3
5
  import {Command} from 'commander'
4
6
 
5
- import {TEMPLATE_VALUES} from '../src/templates-index.js'
7
+ const __dirname = path.resolve()
6
8
 
7
9
  const program = new Command()
8
10
  .name('test-create-mini-standalone')
9
11
  .description('Creates a standalone mini and checks that it is valid')
10
- .action(async (templateName: string) => {
11
- if (!TEMPLATE_VALUES.includes(templateName)) {
12
+ .argument('<example-name>', 'Name of the example to use')
13
+ .action(async (exampleName: string) => {
14
+ const examples = await readdir(
15
+ path.join(
16
+ __dirname,
17
+ 'src',
18
+ 'commands',
19
+ 'create-mini',
20
+ 'standalone',
21
+ 'examples'
22
+ )
23
+ )
24
+
25
+ if (!examples.includes(exampleName)) {
12
26
  console.log(
13
- `\n${templateName} is not a valid template name. Please use one of ${TEMPLATE_VALUES.join(
27
+ `\n${exampleName} is not a valid example name. Please use one of ${examples.join(
14
28
  ', '
15
29
  )}\n`
16
30
  )
@@ -25,9 +39,12 @@ const program = new Command()
25
39
  execSync('rm -rf ../minis/test-standalone', {stdio: 'inherit'}) // just in case this wasn't deleted before
26
40
 
27
41
  // build mini
28
- execSync(`yarn shop-minis create test-standalone --output-dir ../minis/`, {
29
- stdio: 'inherit',
30
- })
42
+ execSync(
43
+ `yarn shop-minis create test-standalone --example ${exampleName} --output-dir ../minis/`,
44
+ {
45
+ stdio: 'inherit',
46
+ }
47
+ )
31
48
 
32
49
  // print package.json
33
50
  execSync(`cat ../minis/test-standalone/package.json`, {stdio: 'inherit'})