esa-cli 0.0.2-beta.2 → 0.0.2-beta.20
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/dist/commands/commit/index.js +48 -115
- package/dist/commands/commit/prodBuild.js +2 -3
- package/dist/commands/common/constant.js +0 -19
- package/dist/commands/common/utils.js +416 -0
- package/dist/commands/config.js +1 -1
- package/dist/commands/deploy/helper.js +51 -72
- package/dist/commands/deploy/index.js +50 -188
- package/dist/commands/deployments/delete.js +32 -22
- package/dist/commands/deployments/index.js +2 -2
- package/dist/commands/deployments/list.js +22 -38
- 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 +39 -43
- package/dist/commands/dev/ew2/kvService.js +27 -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 -17
- package/dist/commands/dev/mockWorker/devPack.js +35 -24
- package/dist/commands/dev/mockWorker/server.js +7 -6
- package/dist/commands/domain/add.js +2 -2
- package/dist/commands/domain/delete.js +7 -7
- package/dist/commands/domain/index.js +2 -2
- package/dist/commands/domain/list.js +10 -10
- package/dist/commands/init/helper.js +759 -0
- package/dist/commands/init/index.js +88 -220
- 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 +5 -5
- 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 +2 -2
- package/dist/commands/route/list.js +56 -17
- package/dist/commands/routine/delete.js +2 -2
- package/dist/commands/routine/index.js +2 -2
- package/dist/commands/routine/list.js +43 -37
- package/dist/commands/site/index.js +1 -1
- package/dist/commands/site/list.js +6 -7
- package/dist/commands/utils.js +59 -23
- package/dist/components/descriptionInput.js +1 -1
- package/dist/components/filterSelector.js +1 -1
- package/dist/components/mutiLevelSelect.js +43 -55
- 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 +142 -131
- package/dist/docs/Commands_zh_CN.md +139 -127
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/locales.json +435 -23
- package/dist/index.js +27 -20
- package/dist/libs/api.js +32 -9
- package/dist/libs/apiService.js +267 -88
- 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 +3 -2
- package/dist/utils/checkAssetsExist.js +80 -0
- package/dist/utils/checkDevPort.js +3 -17
- package/dist/utils/checkEntryFileExist.js +10 -0
- package/dist/utils/checkIsRoutineCreated.js +28 -27
- package/dist/utils/checkVersion.js +119 -1
- package/dist/utils/command.js +149 -0
- package/dist/utils/compress.js +136 -0
- package/dist/utils/download.js +182 -0
- package/dist/utils/fileMd5.js +1 -1
- package/dist/utils/fileUtils/base.js +1 -1
- package/dist/utils/fileUtils/index.js +136 -44
- package/dist/utils/installDeno.js +8 -8
- package/dist/utils/installEw2.js +7 -7
- package/dist/utils/openInBrowser.js +1 -1
- package/dist/utils/prompt.js +97 -0
- package/package.json +19 -12
package/dist/docs/Commands_en.md
CHANGED
|
@@ -1,224 +1,235 @@
|
|
|
1
|
-
|
|
1
|
+
## Commands
|
|
2
2
|
|
|
3
|
-
### init
|
|
3
|
+
### esa init [name]
|
|
4
|
+
|
|
5
|
+
Initialize a routine with a template or a framework.
|
|
4
6
|
|
|
5
|
-
Initialize a routine with a template.
|
|
6
|
-
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
esa 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 dev [entry]
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
Start a local server for developing your routine.
|
|
21
27
|
|
|
22
28
|
```bash
|
|
23
|
-
|
|
29
|
+
esa dev [entry]
|
|
24
30
|
```
|
|
25
31
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
32
|
+
- Positionals:
|
|
33
|
+
- entry: Entry file of the Routine
|
|
28
34
|
|
|
29
|
-
|
|
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)
|
|
30
41
|
|
|
31
|
-
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
### esa commit [entry]
|
|
45
|
+
|
|
46
|
+
Commit your code and save as a new version.
|
|
32
47
|
|
|
33
48
|
```bash
|
|
34
|
-
|
|
49
|
+
esa 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 the routine/version (skip interactive input)
|
|
56
|
+
- -n, --name string: Edge Routine name
|
|
38
57
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
#### add [route] [site]
|
|
58
|
+
---
|
|
42
59
|
|
|
43
|
-
|
|
60
|
+
### esa deploy [entry]
|
|
61
|
+
|
|
62
|
+
Deploy your project.
|
|
44
63
|
|
|
45
64
|
```bash
|
|
46
|
-
|
|
65
|
+
esa deploy [entry]
|
|
47
66
|
```
|
|
48
67
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Delete a related route.
|
|
68
|
+
- Positionals:
|
|
69
|
+
- entry: Entry file of the Routine
|
|
52
70
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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 the routine
|
|
75
|
+
- -a, --assets string: Assets directory (e.g., ./dist)
|
|
76
|
+
- -d, --description string: Description of the version
|
|
77
|
+
- -m, --minify boolean: Minify the code
|
|
56
78
|
|
|
57
|
-
|
|
58
|
-
- The name of the routes to delete.
|
|
79
|
+
---
|
|
59
80
|
|
|
60
|
-
|
|
81
|
+
### esa deployments [list | delete]
|
|
61
82
|
|
|
62
|
-
|
|
83
|
+
Manage your deployments.
|
|
63
84
|
|
|
64
85
|
```bash
|
|
65
|
-
|
|
86
|
+
esa deployments list
|
|
87
|
+
esa deployments delete [deploymentId...]
|
|
66
88
|
```
|
|
67
89
|
|
|
68
|
-
|
|
90
|
+
- Subcommands:
|
|
91
|
+
- list: List all deployments
|
|
92
|
+
- delete [deploymentId...]: Delete one or more deployment versions
|
|
69
93
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
$ esa login
|
|
74
|
-
```
|
|
94
|
+
---
|
|
75
95
|
|
|
76
|
-
###
|
|
96
|
+
### esa routine [list | delete]
|
|
97
|
+
|
|
98
|
+
Manage your routines.
|
|
77
99
|
|
|
78
|
-
Start a local server for developing your routine.
|
|
79
|
-
|
|
80
100
|
```bash
|
|
81
|
-
|
|
101
|
+
esa routine list
|
|
102
|
+
esa routine delete <routineName>
|
|
82
103
|
```
|
|
83
104
|
|
|
84
|
-
-
|
|
85
|
-
-
|
|
105
|
+
- Subcommands:
|
|
106
|
+
- list: List all your routines
|
|
107
|
+
- delete <routineName>: Delete a routine
|
|
86
108
|
|
|
87
|
-
|
|
88
|
-
- Port to listen on.
|
|
109
|
+
---
|
|
89
110
|
|
|
90
|
-
|
|
91
|
-
- Chrome inspect devTool port.
|
|
111
|
+
### esa site [list]
|
|
92
112
|
|
|
93
|
-
|
|
94
|
-
- Minify code during development.
|
|
113
|
+
Manage your sites.
|
|
95
114
|
|
|
96
|
-
|
|
97
|
-
|
|
115
|
+
```bash
|
|
116
|
+
esa site list
|
|
117
|
+
```
|
|
98
118
|
|
|
99
|
-
-
|
|
100
|
-
-
|
|
119
|
+
- Subcommands:
|
|
120
|
+
- list: List all your sites
|
|
101
121
|
|
|
102
|
-
|
|
122
|
+
---
|
|
103
123
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
#### delete <deploymentId>
|
|
124
|
+
### esa domain <add | list | delete>
|
|
107
125
|
|
|
108
|
-
|
|
126
|
+
Manage the domain names bound to your routine.
|
|
109
127
|
|
|
110
128
|
```bash
|
|
111
|
-
|
|
129
|
+
esa domain add <domain>
|
|
130
|
+
esa domain list
|
|
131
|
+
esa domain delete <domain>
|
|
112
132
|
```
|
|
113
133
|
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
134
|
+
- Subcommands:
|
|
135
|
+
- add <domain>: Bind a domain to a routine
|
|
136
|
+
- list: List all related domains
|
|
137
|
+
- delete <domain>: Delete a related domain
|
|
118
138
|
|
|
119
|
-
|
|
139
|
+
---
|
|
120
140
|
|
|
121
|
-
|
|
122
|
-
$ esa deployments list
|
|
123
|
-
```
|
|
141
|
+
### esa route <add | list | delete>
|
|
124
142
|
|
|
125
|
-
|
|
143
|
+
Manage the routes bound to your routine.
|
|
126
144
|
|
|
127
|
-
Deploy your project.
|
|
128
|
-
|
|
129
145
|
```bash
|
|
130
|
-
|
|
146
|
+
esa route add
|
|
147
|
+
esa route list
|
|
148
|
+
esa route delete <routeName>
|
|
131
149
|
```
|
|
132
150
|
|
|
133
|
-
-
|
|
134
|
-
-
|
|
151
|
+
- Subcommands:
|
|
152
|
+
- add: Bind a Route to a routine
|
|
153
|
+
- list: List all related routes
|
|
154
|
+
- delete <routeName>: Delete a related route
|
|
135
155
|
|
|
136
|
-
|
|
156
|
+
#### esa route add
|
|
137
157
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
#### add <domain>
|
|
141
|
-
|
|
142
|
-
Bind a domain to a routine.
|
|
158
|
+
Bind a route to the current routine.
|
|
143
159
|
|
|
144
160
|
```bash
|
|
145
|
-
|
|
161
|
+
esa route add [route] [site] [--alias <routeName>] [--route <route>] [--site <site>]
|
|
146
162
|
```
|
|
147
163
|
|
|
148
|
-
-
|
|
149
|
-
- The
|
|
164
|
+
- Positionals (optional):
|
|
165
|
+
- route: The route value, e.g. example.com/_ or _.example.com/\*
|
|
166
|
+
- site: The site name, e.g. example.com
|
|
150
167
|
|
|
151
|
-
|
|
168
|
+
- Options:
|
|
169
|
+
- -r, --route string: Route value, e.g. example.com/\*
|
|
170
|
+
- Host supports leading `*` for suffix match (e.g., `*.example.com`)
|
|
171
|
+
- Path supports trailing `*` for prefix match (e.g., `/api/*`)
|
|
172
|
+
- -s, --site string: Site name (must be an active site)
|
|
173
|
+
- -a, --alias string: Route name (alias)
|
|
152
174
|
|
|
153
|
-
|
|
175
|
+
- Interactive behavior:
|
|
176
|
+
- If `--alias` is missing, you will be prompted to input a route name
|
|
177
|
+
- If `--site` is missing, you will be prompted to choose from active sites
|
|
178
|
+
- If `--route` is missing, you will be prompted to input the route value
|
|
154
179
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
180
|
+
- Route matching notes:
|
|
181
|
+
- Host supports `*` prefix: `*.example.com` matches any host ending with `.example.com`
|
|
182
|
+
- Path supports `*` suffix: `/api/*` matches any path starting with `/api/`
|
|
183
|
+
- Examples: `example.com/*`, `*.example.com/`, `*.example.com/api/*`
|
|
158
184
|
|
|
159
|
-
-
|
|
160
|
-
-
|
|
185
|
+
- Examples:
|
|
186
|
+
- `esa route add -a home -s example.com -r example.com/*`
|
|
187
|
+
- `esa route add example.com/* example.com -a home`
|
|
161
188
|
|
|
162
|
-
|
|
189
|
+
---
|
|
163
190
|
|
|
164
|
-
|
|
191
|
+
### esa login
|
|
165
192
|
|
|
166
|
-
|
|
167
|
-
$ esa domain list
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### commit [entry]
|
|
193
|
+
Login to the server.
|
|
171
194
|
|
|
172
|
-
Commit your code, save as a new version.
|
|
173
|
-
|
|
174
195
|
```bash
|
|
175
|
-
|
|
196
|
+
esa login
|
|
176
197
|
```
|
|
177
198
|
|
|
178
|
-
-
|
|
179
|
-
-
|
|
199
|
+
- Options:
|
|
200
|
+
- --access-key-id, --ak string: AccessKey ID (AK)
|
|
201
|
+
- --access-key-secret, --sk string: AccessKey Secret (SK)
|
|
180
202
|
|
|
181
|
-
|
|
182
|
-
- Minify code before committing.
|
|
203
|
+
---
|
|
183
204
|
|
|
184
|
-
### logout
|
|
205
|
+
### esa logout
|
|
185
206
|
|
|
186
207
|
Logout.
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
$ esa logout
|
|
190
|
-
```
|
|
191
208
|
|
|
192
|
-
### config
|
|
193
|
-
|
|
194
|
-
Modify your local or global configuration using -l, -g.
|
|
195
|
-
|
|
196
209
|
```bash
|
|
197
|
-
|
|
210
|
+
esa logout
|
|
198
211
|
```
|
|
199
212
|
|
|
200
|
-
|
|
201
|
-
- Edit global config file.
|
|
213
|
+
---
|
|
202
214
|
|
|
203
|
-
|
|
204
|
-
- Edit local config file.
|
|
215
|
+
### esa config [-l | -g]
|
|
205
216
|
|
|
206
|
-
|
|
217
|
+
Modify your local or global configuration.
|
|
207
218
|
|
|
208
|
-
Set the language of the CLI.
|
|
209
|
-
|
|
210
219
|
```bash
|
|
211
|
-
|
|
220
|
+
esa config [--local] [--global]
|
|
212
221
|
```
|
|
213
222
|
|
|
214
|
-
|
|
223
|
+
- Options:
|
|
224
|
+
- -l, --local boolean: Edit local config file (default: false)
|
|
225
|
+
- -g, --global boolean: Edit global config file (default: false)
|
|
215
226
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
#### list
|
|
227
|
+
---
|
|
219
228
|
|
|
220
|
-
|
|
229
|
+
### esa lang
|
|
230
|
+
|
|
231
|
+
Set the language of the CLI.
|
|
221
232
|
|
|
222
233
|
```bash
|
|
223
|
-
|
|
234
|
+
esa lang
|
|
224
235
|
```
|