shoplazza-cli 1.0.7-beta.4 → 1.0.8
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.
- package/README.md +83 -2
- package/lib/app/commands/build.js +1 -1
- package/lib/app/commands/create.js +4 -0
- package/lib/app/template/basic-app/README.md +44 -17
- package/lib/app/template/basic-app/package.json +3 -1
- package/lib/app/template/embed-app/README.md +46 -18
- package/lib/app/template/embed-app/package.json +3 -1
- package/lib/checkout/pull.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,9 +56,9 @@ You can use Shoplazza CLI to develop checkout, customized checkout page as you
|
|
|
56
56
|
#### Step 1: 创建一个项目模板
|
|
57
57
|
|
|
58
58
|
创建过程会要求你输入店铺地址和token,token可以在后台中应用->管理私有应用->创建应用 获得。创建过程还要求你输入一个extension名字,一个项目下支持存在多个extension,这是为了方便管理,它们互不影响。
|
|
59
|
-
```
|
|
59
|
+
```bash
|
|
60
60
|
shoplazza checkout create
|
|
61
|
-
|
|
61
|
+
# 安装依赖
|
|
62
62
|
npm i
|
|
63
63
|
```
|
|
64
64
|
|
|
@@ -164,6 +164,87 @@ $ shoplazza theme list
|
|
|
164
164
|
|
|
165
165
|
> You might want to use a theme's ID to pull, push, publish, or delete a theme using Shoplazza CLI.
|
|
166
166
|
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
## Theme Extension Develop
|
|
170
|
+
|
|
171
|
+
### Overview
|
|
172
|
+
|
|
173
|
+
Theme Extension is a method provided by Shoplazza for extending and customizing themes. Developers can use Theme Extensions to enhance and tailor theme pages.
|
|
174
|
+
|
|
175
|
+
### Create an Extension
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
shoplazza te create
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
When creating a new Theme Extension, you will be prompted to choose between two types: **Basic Extension** and **Embed Extension**.
|
|
182
|
+
|
|
183
|
+
- **Basic Extension**: Allows modifying insertion positions via the theme editor.
|
|
184
|
+
- **Embed Extension**: Insertion positions are hard-coded within the Extension.
|
|
185
|
+
|
|
186
|
+
### Start Development
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
cd your-project # Navigate to the project directory
|
|
190
|
+
shoplazza te serve
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Since the Extension is displayed on theme pages, so you need to select a theme for preview. A preview link will be provided after selection.
|
|
194
|
+
|
|
195
|
+
- **First link**: Redirects to the theme editor. You can add the Extension to theme pages here. After adding, save the changes to preview on the client side.
|
|
196
|
+
- **Second link**: Redirects to the storefront preview page. After adding the Extension via the editor, any local code updates will take effect upon refreshing the storefront page.
|
|
197
|
+
|
|
198
|
+
### Build for Production
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
shoplazza te build
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Generates a deployable production build from the current project code. Multiple builds can be created, and one can be selected during deployment.
|
|
205
|
+
|
|
206
|
+
### Deploy an Extension
|
|
207
|
+
|
|
208
|
+
To deploy an Extension to your store:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
shoplazza te deploy
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Once deployed, the Extension will be live in the store.
|
|
215
|
+
|
|
216
|
+
### Connect Extension to an APP
|
|
217
|
+
|
|
218
|
+
An APP is the primary extension method of Shoplazza platform. A Theme Extension is part of an APP, and one APP can connect multiple Theme Extensions. To conect your Extension to an APP:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
shoplazza te connect
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
You will be prompted to enter the APP's `client_id` and `client_secret`, which can be obtained from the Shoplazza Partner Dashboard.
|
|
225
|
+
|
|
226
|
+
### Release an Extension
|
|
227
|
+
To update the Extension version connected to your app, run the release command:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
shoplazza te release
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
The release will be based on the current production version of your store. Once published, the changes will take effect for **all stores that have installed your app**.
|
|
234
|
+
|
|
235
|
+
### CLI Command Guide
|
|
236
|
+
|
|
237
|
+
| Command | Description |
|
|
238
|
+
| :-----------------------------------: | :--------------------------------------------: |
|
|
239
|
+
| `shoplazza te create` | Create a new Theme Extension project |
|
|
240
|
+
| `shoplazza te serve` | Start a local development server |
|
|
241
|
+
| `shoplazza te build` | Build a production version of the Extension |
|
|
242
|
+
| `shoplazza te versions` | View production version list of an Extension |
|
|
243
|
+
| `shoplazza te list` | List private Extensions in the store |
|
|
244
|
+
| `shoplazza te deploy` | Deploy a production build to the current store |
|
|
245
|
+
| `shoplazza te connect <extension-id>` | Bind an Extension to an APP |
|
|
246
|
+
| `shoplazza te release` | Publish an Extension to its bound APP |
|
|
247
|
+
|
|
167
248
|
## Core commands
|
|
168
249
|
|
|
169
250
|
### help
|
|
@@ -60,7 +60,7 @@ async function usePrompt(extensionId) {
|
|
|
60
60
|
console.log(
|
|
61
61
|
chalk.cyanBright(`\n🔍 Latest version: `) +
|
|
62
62
|
chalk.yellow(`${latestVersion.version} `) +
|
|
63
|
-
chalk.white(`(${latestVersion.
|
|
63
|
+
chalk.white(`(${latestVersion.exts})`) +
|
|
64
64
|
chalk.gray(` [Released on: ${latestVersion.created_at}]`)
|
|
65
65
|
);
|
|
66
66
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# Theme Basic App
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Overview
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Basic Extension (a card that allows store owners to decide where to add it)
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
First, ensure you have "Shoplazza CLI" installed. If not, you can install it globally using the following command:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npm install -g shoplazza-cli
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Available Scripts
|
|
16
16
|
|
|
17
17
|
### `create`
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Create a theme Extension project
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
shoplazza te create
|
|
@@ -24,17 +24,17 @@ shoplazza te create
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
After entering the project directory, you can use the following commands:
|
|
28
28
|
|
|
29
29
|
### `start`
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Start development mode
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
34
|
npm start
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
or
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
shoplazza te serve
|
|
@@ -42,13 +42,13 @@ shoplazza te serve
|
|
|
42
42
|
|
|
43
43
|
### `build`
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Build a production version of the current Extension
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
48
|
npm run build
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
or
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
shoplazza te build
|
|
@@ -56,13 +56,13 @@ shoplazza te build
|
|
|
56
56
|
|
|
57
57
|
### `deploy`
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
Deploy a production version of an Extension to the current store
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
62
|
npm run deploy
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
or
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
shoplazza te deploy
|
|
@@ -70,13 +70,13 @@ shoplazza te deploy
|
|
|
70
70
|
|
|
71
71
|
### `versions`
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
View the production version list of an Extension
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
76
|
npm run versions
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
or
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
82
|
shoplazza te versions
|
|
@@ -84,15 +84,42 @@ shoplazza te versions
|
|
|
84
84
|
|
|
85
85
|
### `list`
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
Query the list of private Extensions in the store
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
90
|
npm run list
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
or
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
96
|
shoplazza te list
|
|
97
97
|
```
|
|
98
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
|
+
```
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
"build": "shoplazza te build",
|
|
9
9
|
"deploy": "shoplazza te deploy",
|
|
10
10
|
"versions": "shoplazza te versions",
|
|
11
|
-
"list": "shoplazza te list"
|
|
11
|
+
"list": "shoplazza te list",
|
|
12
|
+
"connect": "shoplazza te connect",
|
|
13
|
+
"release": "shoplazza te release"
|
|
12
14
|
},
|
|
13
15
|
"keywords": [],
|
|
14
16
|
"author": "",
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
# Theme Embed App
|
|
1
|
+
# Theme Embed App
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Overview
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Embed Extension (a card that does not require manual addition)
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
First, ensure you have "Shoplazza CLI" installed. If not, you can install it globally using the following command:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npm install -g shoplazza-cli
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Available Scripts
|
|
16
16
|
|
|
17
17
|
### `create`
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Create a theme Extension project
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
shoplazza te create
|
|
@@ -24,17 +24,17 @@ shoplazza te create
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
After entering the project directory, you can use the following commands:
|
|
28
28
|
|
|
29
29
|
### `start`
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Start development mode
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
34
|
npm start
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
or
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
shoplazza te serve
|
|
@@ -42,13 +42,13 @@ shoplazza te serve
|
|
|
42
42
|
|
|
43
43
|
### `build`
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Build a production version of the current Extension
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
48
|
npm run build
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
or
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
shoplazza te build
|
|
@@ -56,13 +56,13 @@ shoplazza te build
|
|
|
56
56
|
|
|
57
57
|
### `deploy`
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
Deploy a production version of an Extension to the current store
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
62
|
npm run deploy
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
or
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
shoplazza te deploy
|
|
@@ -70,13 +70,13 @@ shoplazza te deploy
|
|
|
70
70
|
|
|
71
71
|
### `versions`
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
View the production version list of an Extension
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
76
|
npm run versions
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
or
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
82
|
shoplazza te versions
|
|
@@ -84,14 +84,42 @@ shoplazza te versions
|
|
|
84
84
|
|
|
85
85
|
### `list`
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
Query the list of private Extensions in the store
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
90
|
npm run list
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
or
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
96
|
shoplazza te list
|
|
97
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
|
+
```
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
"build": "shoplazza te build",
|
|
9
9
|
"deploy": "shoplazza te deploy",
|
|
10
10
|
"versions": "shoplazza te versions",
|
|
11
|
-
"list": "shoplazza te list"
|
|
11
|
+
"list": "shoplazza te list",
|
|
12
|
+
"connect": "shoplazza te connect",
|
|
13
|
+
"release": "shoplazza te release"
|
|
12
14
|
},
|
|
13
15
|
"keywords": [],
|
|
14
16
|
"author": "",
|
package/lib/checkout/pull.js
CHANGED