esa-cli 0.0.2-beta.9 → 1.0.0
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 +32 -149
- package/dist/commands/commit/index.js +49 -104
- package/dist/commands/commit/prodBuild.js +2 -3
- package/dist/commands/common/constant.js +4 -4
- package/dist/commands/common/utils.js +419 -0
- package/dist/commands/config.js +2 -2
- package/dist/commands/deploy/helper.js +51 -54
- package/dist/commands/deploy/index.js +51 -174
- package/dist/commands/deployments/delete.js +32 -22
- package/dist/commands/deployments/index.js +4 -4
- package/dist/commands/deployments/list.js +21 -34
- package/dist/commands/dev/build.js +3 -3
- package/dist/commands/dev/doProcess.js +5 -5
- package/dist/commands/dev/ew2/cacheService.js +33 -0
- package/dist/commands/dev/ew2/devEntry.js +2 -1
- package/dist/commands/dev/ew2/devPack.js +31 -20
- package/dist/commands/dev/ew2/kvService.js +50 -0
- package/dist/commands/dev/ew2/mock/cache.js +99 -15
- package/dist/commands/dev/ew2/mock/kv.js +142 -21
- package/dist/commands/dev/ew2/server.js +165 -29
- package/dist/commands/dev/index.js +17 -18
- package/dist/commands/dev/mockWorker/devPack.js +19 -10
- package/dist/commands/dev/mockWorker/server.js +7 -6
- package/dist/commands/domain/add.js +4 -4
- package/dist/commands/domain/delete.js +7 -7
- package/dist/commands/domain/index.js +4 -4
- package/dist/commands/domain/list.js +10 -10
- package/dist/commands/init/helper.js +654 -20
- package/dist/commands/init/index.js +88 -152
- package/dist/commands/init/snippets/nextjs/next.config.mjs +6 -0
- package/dist/commands/init/snippets/nextjs/next.config.ts +7 -0
- package/dist/commands/init/snippets/react-router/react-router.config.ts +7 -0
- package/dist/commands/init/template.jsonc +84 -0
- package/dist/commands/init/types.js +1 -0
- package/dist/commands/lang.js +2 -2
- package/dist/commands/login/index.js +74 -34
- package/dist/commands/logout.js +6 -6
- package/dist/commands/route/add.js +105 -49
- package/dist/commands/route/delete.js +33 -27
- package/dist/commands/route/helper.js +123 -0
- package/dist/commands/route/index.js +4 -4
- package/dist/commands/route/list.js +56 -17
- package/dist/commands/routine/delete.js +9 -8
- package/dist/commands/routine/index.js +6 -5
- package/dist/commands/routine/list.js +45 -39
- package/dist/commands/site/index.js +3 -3
- package/dist/commands/site/list.js +6 -7
- package/dist/commands/utils.js +61 -25
- package/dist/components/descriptionInput.js +1 -1
- package/dist/components/filterSelector.js +1 -1
- package/dist/components/mutiLevelSelect.js +19 -20
- package/dist/components/mutiSelectTable.js +1 -1
- package/dist/components/routeBuilder.js +68 -0
- package/dist/components/selectInput.js +2 -3
- package/dist/components/selectItem.js +1 -1
- package/dist/docs/Commands_en.md +164 -117
- package/dist/docs/Commands_zh_CN.md +155 -107
- package/dist/docs/Config_en.md +70 -0
- package/dist/docs/Config_zh_CN.md +68 -0
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/locales.json +447 -71
- package/dist/index.js +28 -13
- package/dist/libs/api.js +32 -9
- package/dist/libs/apiService.js +294 -73
- package/dist/libs/git/index.js +86 -9
- package/dist/libs/interface.js +0 -1
- package/dist/libs/logger.js +162 -10
- package/dist/libs/service.js +2 -2
- package/dist/libs/templates/index.js +1 -1
- package/dist/utils/checkAssetsExist.js +80 -0
- package/dist/utils/checkDevPort.js +5 -19
- package/dist/utils/checkEntryFileExist.js +10 -0
- package/dist/utils/checkIsRoutineCreated.js +27 -21
- package/dist/utils/checkVersion.js +119 -1
- package/dist/utils/command.js +149 -0
- package/dist/utils/compress.js +142 -0
- package/dist/utils/download.js +8 -8
- package/dist/utils/fileMd5.js +1 -1
- package/dist/utils/fileUtils/index.js +136 -45
- package/dist/utils/installDeno.js +4 -4
- package/dist/utils/installEw2.js +9 -9
- package/dist/utils/openInBrowser.js +1 -1
- package/dist/utils/prompt.js +97 -0
- package/package.json +24 -13
- package/zh_CN.md +29 -154
package/dist/docs/Commands_en.md
CHANGED
|
@@ -1,224 +1,271 @@
|
|
|
1
|
-
|
|
1
|
+
## Commands
|
|
2
2
|
|
|
3
|
-
### init
|
|
3
|
+
### esa-cli init [name]
|
|
4
|
+
|
|
5
|
+
Initialize a project with a template or a framework.
|
|
4
6
|
|
|
5
|
-
Initialize a routine with a template.
|
|
6
|
-
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
esa-cli init [name]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
11
|
+
- Positionals:
|
|
12
|
+
- name: Project name
|
|
13
|
+
|
|
14
|
+
- Options:
|
|
15
|
+
- -f, --framework string: Choose a frontend framework (react/vue/nextjs...)
|
|
16
|
+
- -l, --language string: Choose programming language (typescript/javascript). Choices: typescript | javascript
|
|
17
|
+
- -t, --template string: Template name to use
|
|
18
|
+
- -y, --yes boolean: Answer "Yes" to all prompts (default: false)
|
|
19
|
+
- --git boolean: Initialize git repository
|
|
20
|
+
- --deploy boolean: Deploy after initialization
|
|
13
21
|
|
|
14
|
-
|
|
22
|
+
---
|
|
15
23
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
#### delete <routineName>
|
|
24
|
+
### esa-cli dev [entry]
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
Start a local server for developing your project.
|
|
21
27
|
|
|
22
28
|
```bash
|
|
23
|
-
|
|
29
|
+
esa-cli dev [entry]
|
|
24
30
|
```
|
|
25
31
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
32
|
+
- Positionals:
|
|
33
|
+
- entry: Entry file of Functions& Pages
|
|
34
|
+
|
|
35
|
+
- Options:
|
|
36
|
+
- -p, --port number: Port to listen on
|
|
37
|
+
- -m, --minify boolean: Minify code during development (default: false)
|
|
38
|
+
- --refresh-command string: Command to run before auto-refresh on save
|
|
39
|
+
- --local-upstream string: Host to act as origin in development
|
|
40
|
+
- --debug boolean: Output debug logs (default: false)
|
|
41
|
+
|
|
42
|
+
---
|
|
28
43
|
|
|
29
|
-
|
|
44
|
+
### esa-cli commit [entry]
|
|
30
45
|
|
|
31
|
-
|
|
46
|
+
Commit your code and save as a new version.
|
|
32
47
|
|
|
33
48
|
```bash
|
|
34
|
-
|
|
49
|
+
esa-cli commit [entry]
|
|
35
50
|
```
|
|
36
51
|
|
|
37
|
-
|
|
52
|
+
- Options:
|
|
53
|
+
- -m, --minify boolean: Minify code before committing (default: false)
|
|
54
|
+
- -a, --assets string: Assets directory
|
|
55
|
+
- -d, --description string: Description for Functions& Pages/version (skip interactive input)
|
|
56
|
+
- -n, --name string: Functions& Pages name
|
|
38
57
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
#### add [route] [site]
|
|
58
|
+
---
|
|
42
59
|
|
|
43
|
-
|
|
60
|
+
### esa-cli deploy [entry]
|
|
61
|
+
|
|
62
|
+
Deploy your project.
|
|
44
63
|
|
|
45
64
|
```bash
|
|
46
|
-
|
|
65
|
+
esa-cli deploy [entry]
|
|
47
66
|
```
|
|
48
67
|
|
|
49
|
-
|
|
68
|
+
- Positionals:
|
|
69
|
+
- entry: Entry file of Functions& Pages
|
|
50
70
|
|
|
51
|
-
|
|
71
|
+
- Options:
|
|
72
|
+
- -v, --version string: Version to deploy (skip interactive selection)
|
|
73
|
+
- -e, --environment string: Environment to deploy to. Choices: staging | production
|
|
74
|
+
- -n, --name string: Name of Functions& Pages
|
|
75
|
+
- -a, --assets string: Assets directory (e.g., ./dist)
|
|
76
|
+
- -d, --description string: Description of the version
|
|
77
|
+
- -m, --minify boolean: Minify the code
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
### esa-cli deployments list
|
|
82
|
+
|
|
83
|
+
List all deployments.
|
|
52
84
|
|
|
53
85
|
```bash
|
|
54
|
-
|
|
86
|
+
esa-cli deployments list
|
|
55
87
|
```
|
|
56
88
|
|
|
57
|
-
|
|
58
|
-
- The name of the routes to delete.
|
|
89
|
+
No additional options.
|
|
59
90
|
|
|
60
|
-
|
|
91
|
+
---
|
|
61
92
|
|
|
62
|
-
|
|
93
|
+
### esa-cli deployments delete [deploymentId...]
|
|
94
|
+
|
|
95
|
+
Delete one or more deployment versions.
|
|
63
96
|
|
|
64
97
|
```bash
|
|
65
|
-
|
|
98
|
+
esa-cli deployments delete [deploymentId...]
|
|
66
99
|
```
|
|
67
100
|
|
|
68
|
-
|
|
101
|
+
- Positionals:
|
|
102
|
+
- deploymentId...: Deployment version IDs to delete (one or more)
|
|
69
103
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
$ esa login
|
|
74
|
-
```
|
|
104
|
+
---
|
|
75
105
|
|
|
76
|
-
###
|
|
106
|
+
### esa-cli project list
|
|
107
|
+
|
|
108
|
+
List all your projects.
|
|
77
109
|
|
|
78
|
-
Start a local server for developing your routine.
|
|
79
|
-
|
|
80
110
|
```bash
|
|
81
|
-
|
|
111
|
+
esa-cli project list
|
|
82
112
|
```
|
|
83
113
|
|
|
84
|
-
|
|
85
|
-
- Entry file of the Routine.
|
|
114
|
+
No additional options.
|
|
86
115
|
|
|
87
|
-
|
|
88
|
-
- Port to listen on.
|
|
116
|
+
---
|
|
89
117
|
|
|
90
|
-
|
|
91
|
-
- Chrome inspect devTool port.
|
|
118
|
+
### esa-cli project delete <projectName>
|
|
92
119
|
|
|
93
|
-
|
|
94
|
-
- Minify code during development.
|
|
120
|
+
Delete a project.
|
|
95
121
|
|
|
96
|
-
|
|
97
|
-
-
|
|
122
|
+
```bash
|
|
123
|
+
esa-cli project delete <projectName>
|
|
124
|
+
```
|
|
98
125
|
|
|
99
|
-
-
|
|
100
|
-
-
|
|
126
|
+
- Positionals:
|
|
127
|
+
- projectName: The name of the project to delete
|
|
101
128
|
|
|
102
|
-
|
|
129
|
+
---
|
|
103
130
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
#### delete <deploymentId>
|
|
131
|
+
### esa-cli site list
|
|
107
132
|
|
|
108
|
-
|
|
133
|
+
List all your sites.
|
|
109
134
|
|
|
110
135
|
```bash
|
|
111
|
-
|
|
136
|
+
esa-cli site list
|
|
112
137
|
```
|
|
113
138
|
|
|
114
|
-
|
|
115
|
-
- The ID of the deployments to delete.
|
|
139
|
+
No additional options.
|
|
116
140
|
|
|
117
|
-
|
|
141
|
+
---
|
|
118
142
|
|
|
119
|
-
|
|
143
|
+
### esa-cli domain add <domain>
|
|
144
|
+
|
|
145
|
+
Bind a domain to your project.
|
|
120
146
|
|
|
121
147
|
```bash
|
|
122
|
-
|
|
148
|
+
esa-cli domain add <domain>
|
|
123
149
|
```
|
|
124
150
|
|
|
125
|
-
|
|
151
|
+
- Positionals:
|
|
152
|
+
- domain: The domain name to bind
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### esa-cli domain list
|
|
157
|
+
|
|
158
|
+
List all related domains.
|
|
126
159
|
|
|
127
|
-
Deploy your project.
|
|
128
|
-
|
|
129
160
|
```bash
|
|
130
|
-
|
|
161
|
+
esa-cli domain list
|
|
131
162
|
```
|
|
132
163
|
|
|
133
|
-
|
|
134
|
-
- Entry file of the Routine.
|
|
164
|
+
No additional options.
|
|
135
165
|
|
|
136
|
-
|
|
166
|
+
---
|
|
137
167
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
#### add <domain>
|
|
168
|
+
### esa-cli domain delete <domain>
|
|
141
169
|
|
|
142
|
-
|
|
170
|
+
Delete a related domain.
|
|
143
171
|
|
|
144
172
|
```bash
|
|
145
|
-
|
|
173
|
+
esa-cli domain delete <domain>
|
|
146
174
|
```
|
|
147
175
|
|
|
148
|
-
-
|
|
149
|
-
- The name
|
|
176
|
+
- Positionals:
|
|
177
|
+
- domain: The domain name to delete
|
|
150
178
|
|
|
151
|
-
|
|
179
|
+
---
|
|
152
180
|
|
|
153
|
-
|
|
181
|
+
### esa-cli route add
|
|
182
|
+
|
|
183
|
+
Bind a route to the current project.
|
|
154
184
|
|
|
155
185
|
```bash
|
|
156
|
-
|
|
186
|
+
esa-cli route add [route] [site] [--alias <routeName>] [--route <route>] [--site <site>]
|
|
157
187
|
```
|
|
158
188
|
|
|
159
|
-
-
|
|
160
|
-
- The
|
|
189
|
+
- Positionals (optional):
|
|
190
|
+
- route: The route value, e.g. example.com/_ or _.example.com/\*
|
|
191
|
+
- site: The site name, e.g. example.com
|
|
161
192
|
|
|
162
|
-
|
|
193
|
+
- Options:
|
|
194
|
+
- -r, --route string: Route value, e.g. example.com/\*
|
|
195
|
+
- Host supports leading `*` for suffix match (e.g., `*.example.com`)
|
|
196
|
+
- Path supports trailing `*` for prefix match (e.g., `/api/*`)
|
|
197
|
+
- -s, --site string: Site name (must be an active site)
|
|
198
|
+
- -a, --alias string: Route name (alias)
|
|
163
199
|
|
|
164
|
-
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### esa-cli route list
|
|
203
|
+
|
|
204
|
+
List all related routes.
|
|
165
205
|
|
|
166
206
|
```bash
|
|
167
|
-
|
|
207
|
+
esa-cli route list
|
|
168
208
|
```
|
|
169
209
|
|
|
170
|
-
|
|
210
|
+
No additional options.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### esa-cli route delete <routeName>
|
|
215
|
+
|
|
216
|
+
Delete a related route.
|
|
171
217
|
|
|
172
|
-
Commit your code, save as a new version.
|
|
173
|
-
|
|
174
218
|
```bash
|
|
175
|
-
|
|
219
|
+
esa-cli route delete <routeName>
|
|
176
220
|
```
|
|
177
221
|
|
|
178
|
-
-
|
|
179
|
-
-
|
|
222
|
+
- Positionals:
|
|
223
|
+
- routeName: The name of the route to delete
|
|
180
224
|
|
|
181
|
-
|
|
182
|
-
- Minify code before committing.
|
|
225
|
+
---
|
|
183
226
|
|
|
184
|
-
###
|
|
227
|
+
### esa-cli login
|
|
228
|
+
|
|
229
|
+
Login to the server.
|
|
185
230
|
|
|
186
|
-
Logout.
|
|
187
|
-
|
|
188
231
|
```bash
|
|
189
|
-
|
|
232
|
+
esa-cli login
|
|
190
233
|
```
|
|
191
234
|
|
|
192
|
-
|
|
235
|
+
- Options:
|
|
236
|
+
- --access-key-id, --ak string: AccessKey ID (AK)
|
|
237
|
+
- --access-key-secret, --sk string: AccessKey Secret (SK)
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
### esa-cli logout
|
|
242
|
+
|
|
243
|
+
Logout.
|
|
193
244
|
|
|
194
|
-
Modify your local or global configuration using -l, -g.
|
|
195
|
-
|
|
196
245
|
```bash
|
|
197
|
-
|
|
246
|
+
esa-cli logout
|
|
198
247
|
```
|
|
199
248
|
|
|
200
|
-
|
|
201
|
-
- Edit global config file.
|
|
249
|
+
---
|
|
202
250
|
|
|
203
|
-
- -l
|
|
204
|
-
- Edit local config file.
|
|
251
|
+
### esa-cli config [-l | -g]
|
|
205
252
|
|
|
206
|
-
|
|
253
|
+
Modify your local or global configuration.
|
|
207
254
|
|
|
208
|
-
Set the language of the CLI.
|
|
209
|
-
|
|
210
255
|
```bash
|
|
211
|
-
|
|
256
|
+
esa-cli config [--local] [--global]
|
|
212
257
|
```
|
|
213
258
|
|
|
214
|
-
|
|
259
|
+
- Options:
|
|
260
|
+
- -l, --local boolean: Edit local config file (default: false)
|
|
261
|
+
- -g, --global boolean: Edit global config file (default: false)
|
|
215
262
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
#### list
|
|
263
|
+
---
|
|
219
264
|
|
|
220
|
-
|
|
265
|
+
### esa-cli lang
|
|
266
|
+
|
|
267
|
+
Set the language of the CLI.
|
|
221
268
|
|
|
222
269
|
```bash
|
|
223
|
-
|
|
270
|
+
esa-cli lang
|
|
224
271
|
```
|