shoplazza-cli 1.0.7 → 1.0.9

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 (124) hide show
  1. package/README.md +83 -2
  2. package/bin/shoplazza +8 -15
  3. package/lib/app/api/index.js +96 -0
  4. package/lib/app/commands/build.js +101 -53
  5. package/lib/app/commands/connect.js +73 -0
  6. package/lib/app/commands/create.js +105 -0
  7. package/lib/app/commands/deploy.js +45 -208
  8. package/lib/app/commands/list.js +35 -0
  9. package/lib/app/commands/release.js +59 -0
  10. package/lib/app/commands/serve.js +179 -0
  11. package/lib/app/commands/versions.js +55 -0
  12. package/lib/app/index.js +22 -30
  13. package/lib/app/template/basic-app/README.md +125 -0
  14. package/lib/app/template/basic-app/extension.config.json +4 -0
  15. package/lib/app/template/basic-app/package.json +18 -0
  16. package/lib/app/template/basic-app/theme-app/assets/index.css +4 -0
  17. package/lib/app/template/basic-app/theme-app/assets-manifest.json +1 -0
  18. package/lib/app/template/basic-app/theme-app/blocks/index.liquid +16 -0
  19. package/lib/app/template/basic-app/theme-app/locales/ar-SA.json +1 -0
  20. package/lib/app/template/basic-app/theme-app/locales/de-DE.json +1 -0
  21. package/lib/app/template/basic-app/theme-app/locales/en-US.json +6 -0
  22. package/lib/app/template/basic-app/theme-app/locales/es-ES.json +1 -0
  23. package/lib/app/template/basic-app/theme-app/locales/fr-FR.json +1 -0
  24. package/lib/app/template/basic-app/theme-app/locales/id-ID.json +1 -0
  25. package/lib/app/template/basic-app/theme-app/locales/it-IT.json +1 -0
  26. package/lib/app/template/basic-app/theme-app/locales/ja-JP.json +1 -0
  27. package/lib/app/template/basic-app/theme-app/locales/ko-KR.json +1 -0
  28. package/lib/app/template/basic-app/theme-app/locales/nl-NL.json +1 -0
  29. package/lib/app/template/basic-app/theme-app/locales/pl-PL.json +1 -0
  30. package/lib/app/template/basic-app/theme-app/locales/pt-PT.json +1 -0
  31. package/lib/app/template/basic-app/theme-app/locales/ru-RU.json +1 -0
  32. package/lib/app/template/basic-app/theme-app/locales/th-TH.json +1 -0
  33. package/lib/app/template/basic-app/theme-app/locales/zh-CN.json +6 -0
  34. package/lib/app/template/basic-app/theme-app/locales/zh-TW.json +1 -0
  35. package/lib/app/template/basic-app/theme-app/snippets/index.liquid +8 -0
  36. package/lib/app/template/embed-app/README.md +125 -0
  37. package/lib/app/template/embed-app/extension.config.json +4 -0
  38. package/lib/app/template/embed-app/package.json +18 -0
  39. package/lib/app/template/embed-app/theme-app/assets-manifest.json +1 -0
  40. package/lib/app/template/embed-app/theme-app/blocks/index.liquid +18 -0
  41. package/lib/app/template/embed-app/theme-app/locales/ar-SA.json +1 -0
  42. package/lib/app/template/embed-app/theme-app/locales/de-DE.json +1 -0
  43. package/lib/app/template/embed-app/theme-app/locales/en-US.json +6 -0
  44. package/lib/app/template/embed-app/theme-app/locales/es-ES.json +1 -0
  45. package/lib/app/template/embed-app/theme-app/locales/fr-FR.json +1 -0
  46. package/lib/app/template/embed-app/theme-app/locales/id-ID.json +1 -0
  47. package/lib/app/template/embed-app/theme-app/locales/it-IT.json +1 -0
  48. package/lib/app/template/embed-app/theme-app/locales/ja-JP.json +1 -0
  49. package/lib/app/template/embed-app/theme-app/locales/ko-KR.json +1 -0
  50. package/lib/app/template/embed-app/theme-app/locales/nl-NL.json +1 -0
  51. package/lib/app/template/embed-app/theme-app/locales/pl-PL.json +1 -0
  52. package/lib/app/template/embed-app/theme-app/locales/pt-PT.json +1 -0
  53. package/lib/app/template/embed-app/theme-app/locales/ru-RU.json +1 -0
  54. package/lib/app/template/embed-app/theme-app/locales/th-TH.json +1 -0
  55. package/lib/app/template/embed-app/theme-app/locales/zh-CN.json +6 -0
  56. package/lib/app/template/embed-app/theme-app/locales/zh-TW.json +1 -0
  57. package/lib/app/template/embed-app/theme-app/snippets/index.liquid +8 -0
  58. package/lib/app/template/embed-app/theme-app/snippets/index_css.liquid +6 -0
  59. package/lib/app/utils/config.js +32 -0
  60. package/lib/app/utils/index.js +213 -0
  61. package/lib/auth/getCode.js +2 -2
  62. package/lib/auth/index.js +2 -2
  63. package/lib/check.js +28 -0
  64. package/lib/checkout/api.js +12 -36
  65. package/lib/checkout/build.js +1 -1
  66. package/lib/checkout/create.js +1 -1
  67. package/lib/checkout/deploy.js +1 -1
  68. package/lib/checkout/dev/index.js +1 -1
  69. package/lib/checkout/fields.js +1 -1
  70. package/lib/checkout/preview.js +1 -1
  71. package/lib/checkout/pull.js +1 -0
  72. package/lib/checkout/push.js +1 -1
  73. package/lib/checkout/undeploy.js +1 -1
  74. package/lib/checkout/util.js +1 -1
  75. package/lib/checkout/verify.js +1 -1
  76. package/lib/commands/login.js +1 -1
  77. package/lib/commands/logout.js +1 -1
  78. package/lib/commands/theme/delete.js +1 -1
  79. package/lib/commands/theme/package.js +1 -1
  80. package/lib/commands/theme/publish.js +1 -1
  81. package/lib/commands/theme/pull.js +1 -1
  82. package/lib/commands/theme/push.js +1 -1
  83. package/lib/commands/theme/serve.js +2 -2
  84. package/lib/{app → common}/login.js +1 -1
  85. package/lib/function/bin/index.js +20 -0
  86. package/lib/function/bin/javy/javy-arm-linux-v5.0.1 +0 -0
  87. package/lib/function/bin/javy/javy-arm-macos-v5.0.1 +0 -0
  88. package/lib/function/bin/javy/javy-x86_64-linux-v5.0.1 +0 -0
  89. package/lib/function/bin/javy/javy-x86_64-macos-v5.0.1 +0 -0
  90. package/lib/function/bin/javy/javy-x86_64-windows-v5.0.1 +0 -0
  91. package/lib/function/commands/compile.js +42 -0
  92. package/lib/function/commands/create.js +77 -0
  93. package/lib/function/commands/list.js +18 -0
  94. package/lib/function/commands/release.js +69 -0
  95. package/lib/function/index.js +24 -0
  96. package/lib/function/template/js/README.md +37 -0
  97. package/lib/function/template/js/_gitignore +4 -0
  98. package/lib/function/template/js/extension.config.json +5 -0
  99. package/lib/function/template/js/package.json +17 -0
  100. package/lib/function/template/js/src/index.js +64 -0
  101. package/lib/function/utils.js +29 -0
  102. package/lib/openAPI/api.js +1 -1
  103. package/lib/openAPI/index.js +21 -11
  104. package/lib/oss.js +99 -0
  105. package/lib/partner-api/axios.js +67 -0
  106. package/lib/partner-api/index.js +79 -0
  107. package/lib/{checkout → utils}/console.js +3 -2
  108. package/lib/utils/env.js +17 -0
  109. package/lib/utils/file.js +48 -0
  110. package/lib/utils/platform.js +37 -0
  111. package/lib/{utils.js → utils/utils.js} +52 -0
  112. package/package.json +2 -2
  113. package/lib/app/commands/generate.js +0 -50
  114. package/lib/app/commands/publish.js +0 -52
  115. package/lib/app/extensions/index.js +0 -13
  116. package/lib/app/extensions/theme-app.js +0 -103
  117. package/lib/app/inquirers/version.js +0 -131
  118. /package/lib/{app → common}/constants.js +0 -0
  119. /package/lib/{app → common}/db/partner.js +0 -0
  120. /package/lib/{app → common}/inquirers/choose-app.js +0 -0
  121. /package/lib/{app → common}/inquirers/choose-partner.js +0 -0
  122. /package/lib/{app → common}/log.js +0 -0
  123. /package/lib/{app → common}/logout.js +0 -0
  124. /package/lib/{config.js → utils/config.js} +0 -0
@@ -0,0 +1,125 @@
1
+ # Theme Basic App
2
+
3
+ ## Overview
4
+
5
+ Basic Extension (a card that allows store owners to decide where to add it)
6
+
7
+ ## Installation
8
+
9
+ First, ensure you have "Shoplazza CLI" installed. If not, you can install it globally using the following command:
10
+
11
+ ```bash
12
+ npm install -g shoplazza-cli
13
+ ```
14
+
15
+ ## Available Scripts
16
+
17
+ ### `create`
18
+
19
+ Create a theme Extension project
20
+
21
+ ```bash
22
+ shoplazza te create
23
+ ```
24
+
25
+ ---
26
+
27
+ After entering the project directory, you can use the following commands:
28
+
29
+ ### `start`
30
+
31
+ Start development mode
32
+
33
+ ```bash
34
+ npm start
35
+ ```
36
+
37
+ or
38
+
39
+ ```bash
40
+ shoplazza te serve
41
+ ```
42
+
43
+ ### `build`
44
+
45
+ Build a production version of the current Extension
46
+
47
+ ```bash
48
+ npm run build
49
+ ```
50
+
51
+ or
52
+
53
+ ```bash
54
+ shoplazza te build
55
+ ```
56
+
57
+ ### `deploy`
58
+
59
+ Deploy a production version of an Extension to the current store
60
+
61
+ ```bash
62
+ npm run deploy
63
+ ```
64
+
65
+ or
66
+
67
+ ```bash
68
+ shoplazza te deploy
69
+ ```
70
+
71
+ ### `versions`
72
+
73
+ View the production version list of an Extension
74
+
75
+ ```bash
76
+ npm run versions
77
+ ```
78
+
79
+ or
80
+
81
+ ```bash
82
+ shoplazza te versions
83
+ ```
84
+
85
+ ### `list`
86
+
87
+ Query the list of private Extensions in the store
88
+
89
+ ```bash
90
+ npm run list
91
+ ```
92
+
93
+ or
94
+
95
+ ```bash
96
+ shoplazza te list
97
+ ```
98
+
99
+ ### `connect`
100
+
101
+ Bind an Extension to a specific APP
102
+
103
+ ```bash
104
+ npm run connect
105
+ ```
106
+
107
+ or
108
+
109
+ ```bash
110
+ shoplazza te connect
111
+ ```
112
+
113
+ ### `release`
114
+
115
+ Release a production version of an Extension to the bound APP
116
+
117
+ ```bash
118
+ npm run release
119
+ ```
120
+
121
+ or
122
+
123
+ ```bash
124
+ shoplazza te release
125
+ ```
@@ -0,0 +1,4 @@
1
+ {
2
+ "extensionId": "",
3
+ "extensionName": "{{projectName}}"
4
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "1.0.0",
4
+ "description": "theme basic extension",
5
+ "main": "null",
6
+ "scripts": {
7
+ "start": "shoplazza te serve",
8
+ "build": "shoplazza te build",
9
+ "deploy": "shoplazza te deploy",
10
+ "versions": "shoplazza te versions",
11
+ "list": "shoplazza te list",
12
+ "connect": "shoplazza te connect",
13
+ "release": "shoplazza te release"
14
+ },
15
+ "keywords": [],
16
+ "author": "",
17
+ "license": "ISC"
18
+ }
@@ -0,0 +1,4 @@
1
+ .container {
2
+ color: #da534d;
3
+ text-align: center;
4
+ }
@@ -0,0 +1,16 @@
1
+ {% use "{{projectName}}.css" %}
2
+
3
+ <div id="{{projectName}}" class="container">
4
+ <h1>{{ 'i18n.initial.title' | t }}</h1>
5
+ {% include "{{projectName}}" %}
6
+ </div>
7
+
8
+ {% schema %}
9
+ {
10
+ "name": {
11
+ "en-US": "{{projectName}}(dev)",
12
+ "zh-CN": "{{projectName}}(开发)"
13
+ },
14
+ "settings": []
15
+ }
16
+ {% endschema %}
@@ -0,0 +1,6 @@
1
+ {
2
+ "initial":{
3
+ "title": "SHOPLAZZA THEME EXTENSION",
4
+ "sub_title": "BASIC TYPE"
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "initial": {
3
+ "title": "SHOPLAZZA 主题插件",
4
+ "sub_title": "BASIC 类型"
5
+ }
6
+ }
@@ -0,0 +1,8 @@
1
+ <div>
2
+ <h3>{{ 'i18n.initial.sub_title' | t }}</h3>
3
+ </div>
4
+
5
+
6
+
7
+
8
+
@@ -0,0 +1,125 @@
1
+ # Theme Embed App
2
+
3
+ ## Overview
4
+
5
+ Embed Extension (a card that does not require manual addition)
6
+
7
+ ## Installation
8
+
9
+ First, ensure you have "Shoplazza CLI" installed. If not, you can install it globally using the following command:
10
+
11
+ ```bash
12
+ npm install -g shoplazza-cli
13
+ ```
14
+
15
+ ## Available Scripts
16
+
17
+ ### `create`
18
+
19
+ Create a theme Extension project
20
+
21
+ ```bash
22
+ shoplazza te create
23
+ ```
24
+
25
+ ---
26
+
27
+ After entering the project directory, you can use the following commands:
28
+
29
+ ### `start`
30
+
31
+ Start development mode
32
+
33
+ ```bash
34
+ npm start
35
+ ```
36
+
37
+ or
38
+
39
+ ```bash
40
+ shoplazza te serve
41
+ ```
42
+
43
+ ### `build`
44
+
45
+ Build a production version of the current Extension
46
+
47
+ ```bash
48
+ npm run build
49
+ ```
50
+
51
+ or
52
+
53
+ ```bash
54
+ shoplazza te build
55
+ ```
56
+
57
+ ### `deploy`
58
+
59
+ Deploy a production version of an Extension to the current store
60
+
61
+ ```bash
62
+ npm run deploy
63
+ ```
64
+
65
+ or
66
+
67
+ ```bash
68
+ shoplazza te deploy
69
+ ```
70
+
71
+ ### `versions`
72
+
73
+ View the production version list of an Extension
74
+
75
+ ```bash
76
+ npm run versions
77
+ ```
78
+
79
+ or
80
+
81
+ ```bash
82
+ shoplazza te versions
83
+ ```
84
+
85
+ ### `list`
86
+
87
+ Query the list of private Extensions in the store
88
+
89
+ ```bash
90
+ npm run list
91
+ ```
92
+
93
+ or
94
+
95
+ ```bash
96
+ shoplazza te list
97
+ ```
98
+
99
+ ### `connect`
100
+
101
+ Bind an Extension to a specific APP
102
+
103
+ ```bash
104
+ npm run connect
105
+ ```
106
+
107
+ or
108
+
109
+ ```bash
110
+ shoplazza te connect
111
+ ```
112
+
113
+ ### `release`
114
+
115
+ Release a production version of an Extension to the bound APP
116
+
117
+ ```bash
118
+ npm run release
119
+ ```
120
+
121
+ or
122
+
123
+ ```bash
124
+ shoplazza te release
125
+ ```
@@ -0,0 +1,4 @@
1
+ {
2
+ "extensionId": "",
3
+ "extensionTitle": "{{projectName}}"
4
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "1.0.0",
4
+ "description": "theme embed extension",
5
+ "main": "null",
6
+ "scripts": {
7
+ "start": "shoplazza te serve",
8
+ "build": "shoplazza te build",
9
+ "deploy": "shoplazza te deploy",
10
+ "versions": "shoplazza te versions",
11
+ "list": "shoplazza te list",
12
+ "connect": "shoplazza te connect",
13
+ "release": "shoplazza te release"
14
+ },
15
+ "keywords": [],
16
+ "author": "",
17
+ "license": "ISC"
18
+ }
@@ -0,0 +1,18 @@
1
+ {% include "{{projectName}}_css" %}
2
+
3
+ <div id="{{projectName}}" class="container">
4
+ <h1>{{ 'i18n.initial.title' | t }}</h1>
5
+ {% include "{{projectName}}" %}
6
+ </div>
7
+
8
+ {% schema %}
9
+ {
10
+ "name": {
11
+ "en-US": "{{projectName}}(dev)",
12
+ "zh-CN": "{{projectName}}(开发)"
13
+ },
14
+ "icon":"https://assets.shoplazza.com/oss/operation/a425c6e10e32f87a1e7271c9ed9347d8.svg",
15
+ "target":"body",
16
+ "settings": []
17
+ }
18
+ {% endschema %}
@@ -0,0 +1,6 @@
1
+ {
2
+ "initial":{
3
+ "title": "SHOPLAZZA THEME EXTENSION",
4
+ "sub_title": "EMBED TYPE"
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "initial": {
3
+ "title": "SHOPLAZZA 主题插件",
4
+ "sub_title": "EMBED 类型"
5
+ }
6
+ }
@@ -0,0 +1,8 @@
1
+ <div>
2
+ <h3>{{ 'i18n.initial.sub_title' | t }}</h3>
3
+ </div>
4
+
5
+
6
+
7
+
8
+
@@ -0,0 +1,6 @@
1
+ <style>
2
+ .container {
3
+ color: #da534d;
4
+ text-align: center;
5
+ }
6
+ </style>
@@ -0,0 +1,32 @@
1
+ const path = require('path');
2
+ const { get } = require('../../db/user');
3
+
4
+ const WORKSPACE_PATH = process.cwd();
5
+
6
+ const THEME_APP_DIR_PATH = path.resolve(WORKSPACE_PATH, 'theme-app');
7
+
8
+ const THEME_APP_CONFIG_PATH = path.resolve(WORKSPACE_PATH, 'extension.config.json')
9
+
10
+ const STORE_DOMAIN = get('store_domain');
11
+
12
+ const EXCHANGE_TOKEN = get('exchange_token');
13
+
14
+ const THEME_APP_TYPE = {
15
+ BASIC_APP: {
16
+ description: 'Basic Extension(a card storekeeper decide where it add)',
17
+ templatePath: path.resolve(__dirname, '../template/basic-app')
18
+ },
19
+ EMBEDS_APP: {
20
+ description: 'Embed Extension(a card not need add)',
21
+ templatePath: path.resolve(__dirname, '../template/embed-app')
22
+ }
23
+ };
24
+
25
+ module.exports = {
26
+ WORKSPACE_PATH,
27
+ THEME_APP_DIR_PATH,
28
+ THEME_APP_CONFIG_PATH,
29
+ STORE_DOMAIN,
30
+ EXCHANGE_TOKEN,
31
+ THEME_APP_TYPE,
32
+ };