@shopify/shop-minis-cli 0.0.159 → 0.0.161

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 (40) hide show
  1. package/build/commands/create-mini/index.js +8 -178
  2. package/build/commands/create-mini/index.js.map +1 -1
  3. package/build/commands/create-mini/legacy/index.d.ts +2 -0
  4. package/build/commands/create-mini/legacy/index.js +174 -0
  5. package/build/commands/create-mini/legacy/index.js.map +1 -0
  6. package/build/commands/create-mini/{utils → legacy/utils}/template-app.js +12 -23
  7. package/build/commands/create-mini/legacy/utils/template-app.js.map +1 -0
  8. package/build/commands/create-mini/standalone/examples/with-getting-started/.eslintignore +1 -0
  9. package/build/commands/create-mini/standalone/examples/with-getting-started/.eslintrc.js +3 -0
  10. package/build/commands/create-mini/standalone/examples/with-getting-started/.graphqlrc.js +1 -0
  11. package/build/commands/create-mini/standalone/examples/with-getting-started/.prettierrc.json +8 -0
  12. package/build/commands/create-mini/standalone/examples/with-getting-started/assets.d.ts +14 -0
  13. package/build/commands/create-mini/standalone/examples/with-getting-started/babel.config.js +5 -0
  14. package/build/commands/create-mini/standalone/examples/with-getting-started/index.tsx +5 -0
  15. package/build/commands/create-mini/standalone/examples/with-getting-started/metro.config.js +3 -0
  16. package/build/commands/create-mini/standalone/examples/with-getting-started/package.json +33 -0
  17. package/build/commands/create-mini/standalone/examples/with-getting-started/src/App.tsx +23 -0
  18. package/build/commands/create-mini/standalone/examples/with-getting-started/src/index.tsx +9 -0
  19. package/build/commands/create-mini/standalone/examples/with-getting-started/src/manifest.json +7 -0
  20. package/build/commands/create-mini/standalone/examples/with-getting-started/src/screens/HomeScreen.tsx +133 -0
  21. package/build/commands/create-mini/standalone/examples/with-getting-started/src/screens/NativeFeaturesScreen.tsx +138 -0
  22. package/build/commands/create-mini/standalone/examples/with-getting-started/src/types/screens.ts +5 -0
  23. package/build/commands/create-mini/standalone/examples/with-getting-started/tsconfig.json +41 -0
  24. package/build/commands/create-mini/standalone/index.d.ts +2 -0
  25. package/build/commands/create-mini/standalone/index.js +115 -0
  26. package/build/commands/create-mini/standalone/index.js.map +1 -0
  27. package/build/commands/create-mini/utils/examples.d.ts +4 -1
  28. package/build/commands/create-mini/utils/examples.js +28 -2
  29. package/build/commands/create-mini/utils/examples.js.map +1 -1
  30. package/build/commands/create-mini/utils/index.d.ts +3 -0
  31. package/build/commands/create-mini/utils/index.js +23 -0
  32. package/build/commands/create-mini/utils/index.js.map +1 -0
  33. package/build/utils/package-manager.d.ts +5 -0
  34. package/build/utils/package-manager.js +13 -0
  35. package/build/utils/package-manager.js.map +1 -1
  36. package/package.json +5 -3
  37. package/scripts/{test-template.ts → test-create-mini-legacy.ts} +12 -15
  38. package/scripts/test-create-mini-standalone.ts +63 -0
  39. package/build/commands/create-mini/utils/template-app.js.map +0 -1
  40. /package/build/commands/create-mini/{utils → legacy/utils}/template-app.d.ts +0 -0
@@ -5,12 +5,9 @@ import {Command} from 'commander'
5
5
  import {TEMPLATE_VALUES} from '../src/templates-index.js'
6
6
 
7
7
  const program = new Command()
8
- .name('test-template')
9
- .description('Instanciates a template and checks that it is valid')
10
- .argument(
11
- '<template name>',
12
- 'Name of the template to use (blank, hello_world, snowboardz)'
13
- )
8
+ .name('test-create-mini-legacy')
9
+ .description('Creates a legacy mini and checks that it is valid')
10
+ .argument('<template name>', 'Name of the template to use')
14
11
  .action(async (templateName: string) => {
15
12
  if (!TEMPLATE_VALUES.includes(templateName)) {
16
13
  console.log(
@@ -25,24 +22,24 @@ const program = new Command()
25
22
  execSync('yarn build:cli', {stdio: 'inherit'})
26
23
 
27
24
  // set up folder structure
28
- execSync('mkdir -p ../templates/', {stdio: 'inherit'})
29
- execSync('rm -rf ../templates/test-template', {stdio: 'inherit'}) // just in case this wasn't deleted before
25
+ execSync('mkdir -p ../minis/', {stdio: 'inherit'})
26
+ execSync('rm -rf ../minis/test-template', {stdio: 'inherit'}) // just in case this wasn't deleted before
30
27
 
31
28
  // build mini
32
29
  execSync(
33
- `yarn shop-minis create test-template --template ${templateName} --extension-target shop.store.block.render --extension-type=default-card --output-dir ../templates/`,
30
+ `yarn shop-minis create test-template --legacy --template ${templateName} --extension-target shop.store.block.render --extension-type=default-card --output-dir ../minis/`,
34
31
  {stdio: 'inherit'}
35
32
  )
36
33
 
37
34
  // print package.json
38
- execSync(`cat ../templates/test-template/package.json`, {stdio: 'inherit'})
35
+ execSync(`cat ../minis/test-template/package.json`, {stdio: 'inherit'})
39
36
 
40
37
  // run eslint
41
38
  try {
42
- execSync('cd ../templates/test-template && yarn lint', {stdio: 'inherit'})
39
+ execSync('cd ../minis/test-template && yarn lint', {stdio: 'inherit'})
43
40
  } catch {
44
41
  console.log(`\n ⚠️ eslint failed. To reproduce run:
45
- $ cd ../templates/test-template
42
+ $ cd ../minis/test-template
46
43
  $ yarn lint
47
44
  `)
48
45
  process.exit(1)
@@ -50,17 +47,17 @@ const program = new Command()
50
47
 
51
48
  // run typescript checks
52
49
  try {
53
- execSync('cd ../templates/test-template && yarn tsc', {stdio: 'inherit'})
50
+ execSync('cd ../minis/test-template && yarn tsc', {stdio: 'inherit'})
54
51
  } catch {
55
52
  console.log(`\n ⚠️ typescript failed. To reproduce run:
56
- $ cd ../templates/test-template
53
+ $ cd ../minis/test-template
57
54
  $ yarn tsc
58
55
  `)
59
56
  process.exit(1)
60
57
  }
61
58
 
62
59
  // clean up
63
- execSync('rm -rf ../templates/test-template', {stdio: 'inherit'})
60
+ execSync('rm -rf ../minis/test-template', {stdio: 'inherit'})
64
61
  })
65
62
 
66
63
  program.parse()
@@ -0,0 +1,63 @@
1
+ import {execSync} from 'node:child_process'
2
+
3
+ import {Command} from 'commander'
4
+
5
+ import {TEMPLATE_VALUES} from '../src/templates-index.js'
6
+
7
+ const program = new Command()
8
+ .name('test-create-mini-standalone')
9
+ .description('Creates a standalone mini and checks that it is valid')
10
+ .action(async (templateName: string) => {
11
+ if (!TEMPLATE_VALUES.includes(templateName)) {
12
+ console.log(
13
+ `\n${templateName} is not a valid template name. Please use one of ${TEMPLATE_VALUES.join(
14
+ ', '
15
+ )}\n`
16
+ )
17
+ process.exit(1)
18
+ }
19
+
20
+ // build the CLI
21
+ execSync('yarn build:cli', {stdio: 'inherit'})
22
+
23
+ // set up folder structure
24
+ execSync('mkdir -p ../minis/', {stdio: 'inherit'})
25
+ execSync('rm -rf ../minis/test-standalone', {stdio: 'inherit'}) // just in case this wasn't deleted before
26
+
27
+ // build mini
28
+ execSync(`yarn shop-minis create test-standalone --output-dir ../minis/`, {
29
+ stdio: 'inherit',
30
+ })
31
+
32
+ // print package.json
33
+ execSync(`cat ../minis/test-standalone/package.json`, {stdio: 'inherit'})
34
+
35
+ // run eslint
36
+ try {
37
+ execSync('cd ../minis/test-standalone && yarn lint', {stdio: 'inherit'})
38
+ } catch {
39
+ console.log(`\n ⚠️ eslint failed. To reproduce run:
40
+ $ cd ../minis/test-standalone
41
+ $ yarn lint
42
+ `)
43
+ process.exit(1)
44
+ }
45
+
46
+ // run typescript checks
47
+ try {
48
+ execSync('cd ../minis/test-standalone && yarn tsc', {
49
+ stdio: 'inherit',
50
+ })
51
+ } catch {
52
+ console.log(`\n ⚠️ typescript failed. To reproduce run:
53
+ $ cd ../minis/test-standalone
54
+ $ yarn tsc
55
+ `)
56
+ process.exit(1)
57
+ }
58
+
59
+ // clean up
60
+ execSync('rm -rf ../minis/test-standalone', {stdio: 'inherit'})
61
+ })
62
+
63
+ program.parse()
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-app.js","sourceRoot":"","sources":["../../../../src/commands/create-mini/utils/template-app.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAA;AAC1B,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,kBAAkB,CAAA;AAC7D,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,OAAO,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,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