Skip to content

Commit d2bce52

Browse files
authored
Merge pull request #21 from aliyun/feat-skip-build
feat:1.support skip bundle 2.detect user endpoint and remove endpoint…
2 parents 5beebcd + 68b40f6 commit d2bce52

File tree

22 files changed

+560
-265
lines changed

22 files changed

+560
-265
lines changed

CHANGELOG.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
# Changelog
22

3-
## [1.0.3] - 2025-1-15
3+
## [1.0.3] - 2025-11-28
4+
5+
### Fixed
6+
7+
- Fix mock KV storage issues in development environment
8+
9+
## [1.0.2] - 2025-11-19
410

511
### Added
612

7-
- Support for passing endpoint parameter in login command
8-
- User notification when services are activated during login
13+
- Support for `--no-bundle` option in `commit` and `deploy` commands to skip esbuild bundling
14+
- Credential validation utility that automatically detects site type (domestic/international)
15+
- Automatic endpoint detection based on credential validation during login
916

10-
## [1.0.2] - 2025-9-28
17+
### Removed
1118

12-
### Fixed
19+
- `--endpoint` parameter from `login` command (endpoint is now automatically detected)
20+
21+
## [1.0.1] - 2025-1-15
22+
23+
### Added
1324

14-
- support
25+
- Support for passing endpoint parameter in login command
26+
- User notification when services are activated during login
1527

1628
## [1.0.0] - 2025-9-17
1729

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ESA CLI is a command-line tool for building with Alibaba Cloud ESA Functions and
1515

1616
### Prerequisites
1717

18-
- Node.js: 18.x or higher (supports 18.x, 20.x, 22.x)
18+
- Node.js: 20.x or higher (supports 20.x, 22.x)
1919
- OS: macOS (x86, Apple Silicon), Linux
2020
- Recommended to use a Node version manager like Volta or nvm to avoid permission issues and easily switch Node.js versions.
2121

docs/Commands_en.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,11 @@ AccessKey ID (AK)
345345
**--access-key-secret, --sk** _optional_
346346
AccessKey Secret (SK)
347347

348-
**--endpoint, -e** _optional_
349-
API endpoint URL Example: esa.cn-hangzhou.aliyuncs.com
350-
351348
**Environment Variables**
352349
Read from environment variables:
353350

354351
- **ESA_ACCESS_KEY_ID**
355352
- **ESA_ACCESS_KEY_SECRET**
356-
- **ESA_ENDPOINT**
357353

358354
---
359355

docs/Commands_zh_CN.md

Lines changed: 74 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,31 @@
22

33
**ESA CLI 提供多种命令来管理您的阿里云 ESA Functions & Pages。**
44

5-
**init** - 从各种 Web 框架和模板创建新项目。**
6-
\*\***dev** - 启动本地开发服务器。** \***\*commit** - 提交代码并保存为新版本。**
7-
\*\***deploy** - 将您的 Functions & Pages 部署到阿里云。** \***\*deployments** - 管理您的部署和版本。**
8-
\*\***project** - 管理您的 Functions & Pages 项目。** \***\*site** - 列出您已激活的站点。**
9-
\*\***domain** - 管理您的 Functions & Pages 的域名绑定。** \***\*route** - 管理您的 Functions & Pages 的路由绑定。**
10-
\*\***login** - 使用您的阿里云账户授权 ESA CLI。** \***\*logout** - 移除 ESA CLI 访问您账户的授权。**
11-
\*\***config** - 修改您的本地或全局配置。** \***\*lang** - 设置 CLI 的语言。
5+
**init** - 从各种 Web 框架和模板创建新项目。
6+
7+
**dev** - 启动本地开发服务器。
8+
9+
**commit** - 提交代码并保存为新版本。
10+
11+
**deploy** - 将您的 Functions & Pages 部署到阿里云。
12+
13+
**deployments** - 管理您的部署和版本。
14+
15+
**project** - 管理您的 Functions & Pages 项目。
16+
17+
**site** - 列出您已激活的站点。
18+
19+
**domain** - 管理您的 Functions & Pages 的域名绑定。
20+
21+
**route** - 管理您的 Functions & Pages 的路由绑定。
22+
23+
**login** - 使用您的阿里云账户授权 ESA CLI。
24+
25+
**logout** - 移除 ESA CLI 访问您账户的授权。
26+
27+
**config** - 修改您的本地或全局配置。
28+
29+
**lang** - 设置 CLI 的语言。
1230

1331
### 如何运行 ESA CLI 命令
1432

@@ -38,12 +56,12 @@ npx esa-cli <COMMAND> <SUBCOMMAND> [PARAMETERS] [OPTIONS]
3856

3957
```
4058
{
41-
 ...
42-
 "scripts": {
43-
   "deploy": "esa-cli deploy",
44-
   "dev": "esa-cli dev"
59+
...
60+
"scripts": {
61+
"deploy": "esa-cli deploy",
62+
"dev": "esa-cli dev"
4563
}
46-
 ...
64+
...
4765
}
4866
```
4967

@@ -63,25 +81,25 @@ npm run deploy
6381
esa-cli init [<NAME>] [OPTIONS]
6482
```
6583

66-
**NAME\***可选(默认:工作目录名称)\*
84+
**NAME** _可选(默认:工作目录名称)_
6785
**Functions & Pages 项目的名称。这既是目录名称,也是生成的 ESA CLI 配置中的 name 属性。**
6886

69-
**--framework, -f\***可选\*
87+
**--framework, -f** _可选_
7088
**选择前端框架(react/vue/nextjs...)**
7189

72-
**--language, -l\***可选\*
90+
**--language, -l** _可选_
7391
**选择编程语言(typescript/javascript)。可选:typescript | javascript**
7492

75-
**--template, -t\***可选\*
93+
**--template, -t** _可选_
7694
**指定模板名称**
7795

78-
**--yes, -y\***可选\*
96+
**--yes, -y** _可选_
7997
**对所有交互询问选择"是"(默认 false),模版采用helloworld**
8098

81-
**--git\***可选\*
99+
**--git** _可选_
82100
**在项目中初始化 git**
83101

84-
**--deploy\***可选\*
102+
**--deploy** _可选_
85103
**初始化完成后自动部署**
86104

87105
---
@@ -94,22 +112,22 @@ esa-cli init [<NAME>] [OPTIONS]
94112
esa-cli dev [<ENTRY>] [OPTIONS]
95113
```
96114

97-
**ENTRY\***可选\*
115+
**ENTRY** _可选_
98116
**函数和Pages入口文件**
99117

100-
**--port, -p\***可选\*
118+
**--port, -p** _可选_
101119
**监听端口**
102120

103-
**--minify, -m\***可选\*
121+
**--minify, -m** _可选_
104122
**开发模式下压缩代码(默认 false)**
105123

106-
**--refresh-command\***可选\*
124+
**--refresh-command** _可选_
107125
**保存自动刷新前执行的命令**
108126

109-
**--local-upstream\***可选\*
127+
**--local-upstream** _可选_
110128
**在本地开发中作为源站的主机**
111129

112-
**--debug\***可选\*
130+
**--debug** _可选_
113131
**输出调试日志(默认 false)**
114132

115133
---
@@ -122,19 +140,19 @@ esa-cli dev [<ENTRY>] [OPTIONS]
122140
esa-cli commit [<ENTRY>] [OPTIONS]
123141
```
124142

125-
**ENTRY\***可选\*
143+
**ENTRY** _可选_
126144
**函数和Pages入口文件**
127145

128-
**--minify, -m\***可选\*
146+
**--minify, -m** _可选_
129147
**提交前压缩代码(默认 false)**
130148

131-
**--assets, -a\***可选\*
149+
**--assets, -a** _可选_
132150
**静态资源目录**
133151

134-
**--description, -d\***可选\*
152+
**--description, -d** _可选_
135153
**版本/例程描述(跳过交互输入)**
136154

137-
**--name, -n\***可选\*
155+
**--name, -n** _可选_
138156
**函数和Pages名称**
139157

140158
---
@@ -147,25 +165,25 @@ esa-cli commit [<ENTRY>] [OPTIONS]
147165
esa-cli deploy [<ENTRY>] [OPTIONS]
148166
```
149167

150-
**ENTRY\***可选\*
151-
**函数和Pages入口文件,默认以 **`esa.jsonc`中entry配置为准
168+
**ENTRY** _可选_
169+
**函数和Pages入口文件,默认以 `esa.jsonc`中entry配置为准**
152170

153-
**--version, -v\***可选\*
171+
**--version, -v** _可选_
154172
**指定要部署的版本(跳过交互选择)**
155173

156-
**--environment, -e\***可选\*
174+
**--environment, -e** _可选_
157175
**部署环境。可选:staging | production**
158176

159-
**--name, -n\***可选\*
177+
**--name, -n** _可选_
160178
**函数和Pages名称**
161179

162-
**--assets, -a\***可选\*
180+
**--assets, -a** _可选_
163181
**静态资源目录(例如:./dist)**
164182

165-
**--description, -d\***可选\*
183+
**--description, -d** _可选_
166184
**版本描述**
167185

168-
**--minify, -m\***可选\*
186+
**--minify, -m** _可选_
169187
**是否压缩代码**
170188

171189
---
@@ -190,7 +208,7 @@ esa-cli deployments list
190208
esa-cli deployments delete [<DEPLOYMENT_ID>...] [OPTIONS]
191209
```
192210

193-
**DEPLOYMENT_ID\***必需\*
211+
**DEPLOYMENT_ID** _必需_
194212
**要删除的部署版本ID(可一次传多个)**
195213

196214
---
@@ -215,7 +233,7 @@ esa-cli project list
215233
esa-cli project delete <PROJECT_NAME> [OPTIONS]
216234
```
217235

218-
**PROJECT_NAME\***必需\*
236+
**PROJECT_NAME** _必需_
219237
**要删除的函数或Pages名称**
220238

221239
---
@@ -248,7 +266,7 @@ esa-cli domain add <DOMAIN> [OPTIONS]
248266

249267
**只有在该账号下激活的站点才能绑定**
250268

251-
**DOMAIN\***必需\*
269+
**DOMAIN** _必需_
252270
**要绑定的域名(在该账号站点下已激活)**
253271

254272
### domain list
@@ -267,7 +285,7 @@ esa-cli domain list
267285
esa-cli domain delete <DOMAIN> [OPTIONS]
268286
```
269287

270-
**DOMAIN\***必需\*
288+
**DOMAIN** _必需_
271289
**要删除绑定的域名**
272290

273291
---
@@ -284,23 +302,24 @@ esa-cli domain delete <DOMAIN> [OPTIONS]
284302
esa-cli route add [<ROUTE>] [<SITE>] [OPTIONS]
285303
```
286304

287-
**ROUTE\***可选\*
305+
**ROUTE** _可选_
288306
**路由值,例如:example.com/__.example.com/\***
289307

290-
**SITE\***可选\*
308+
**SITE** _可选_
291309
**站点名称,例如:example.com**
292310

293311
**只有在该账号下激活的站点才能绑定**
294312

295-
**--route, -r\***可选*路由值,例如:example.com/*
313+
**--route, -r** _可选_
314+
**路由值,例如:example.com/\***
296315

297-
- **主机名支持以 **`*` 开头表示后缀匹配(如:`*.example.com`
298-
- **路径支持以 **`*` 结尾表示前缀匹配(如:`/api/*`
316+
- **主机名支持以 `*` 开头表示后缀匹配(如:`*.example.com`**
317+
- **路径支持以 `*` 结尾表示前缀匹配(如:`/api/*`**
299318

300-
**--site, -s\***可选\*
319+
**--site, -s** _可选_
301320
**站点名称(需为账户下已激活站点)**
302321

303-
**--alias, -a\***可选\*
322+
**--alias, -a** _可选_
304323
**路由名称(别名)例如:apple、orange等**
305324

306325
### route list
@@ -319,7 +338,7 @@ esa-cli route list
319338
esa-cli route delete <ROUTE_NAME> [OPTIONS]
320339
```
321340

322-
**ROUTE_NAME\***必需\*
341+
**ROUTE_NAME** _必需_
323342
**要删除的路由名称**
324343

325344
---
@@ -332,20 +351,16 @@ esa-cli route delete <ROUTE_NAME> [OPTIONS]
332351
esa-cli login [OPTIONS]
333352
```
334353

335-
**--access-key-id, --ak\***可选\*
354+
**--access-key-id, --ak** _可选_
336355
**AccessKey ID (AK)**
337356

338-
**--access-key-secret, --sk\***可选\*
357+
**--access-key-secret, --sk** _可选_
339358
**AccessKey Secret (SK)**
340359

341-
**--endpoint, -e\***可选\*
342-
**API 端点 URL 例子: esa.cn-hangzhou.aliyuncs.com**
343-
344-
**环境变量**从环境变量中读取:
360+
**环境变量** _从环境变量中读取:_
345361

346362
- **ESA_ACCESS_KEY_ID**
347363
- **ESA_ACCESS_KEY_SECRET**
348-
- **ESA_ENDPOINT**
349364

350365
---
351366

@@ -367,10 +382,10 @@ esa-cli logout
367382
esa-cli config [OPTIONS]
368383
```
369384

370-
**--local, -l\***可选\*
385+
**--local, -l** _可选_
371386
**编辑本地配置文件(默认 false)**
372387

373-
**--global, -g\***可选\*
388+
**--global, -g** _可选_
374389
**编辑全局配置文件(默认 false)**
375390

376391
---

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "esa-cli",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "A CLI for operating Alibaba Cloud ESA Functions and Pages.",
55
"main": "bin/enter.cjs",
66
"type": "module",

src/commands/commit/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ const commit: CommandModule = {
3939
alias: 'n',
4040
describe: t('commit_option_name').d('Functions& Pages name'),
4141
type: 'string'
42+
})
43+
.option('bundle', {
44+
describe: 'Bundle with esbuild (use --no-bundle to skip)',
45+
type: 'boolean',
46+
default: true
4247
});
4348
},
4449
handler: async (argv: ArgumentsCamelCase) => {
@@ -73,7 +78,9 @@ export async function handleCommit(argv: ArgumentsCamelCase) {
7378
description,
7479
argv?.entry as string,
7580
argv?.assets as string,
76-
argv?.minify as boolean
81+
argv?.minify as boolean,
82+
undefined,
83+
argv.bundle === false
7784
);
7885
const { isSuccess } = res || {};
7986
if (!isSuccess) {

0 commit comments

Comments
 (0)