@cloudbase/cli 2.6.0-alpha.2 → 2.6.0-alpha.4
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/.yarn/cache/@cloudbase-functions-framework-npm-1.0.0-beta.3-68c4d9136e-3d11f97edc.zip +0 -0
- package/.yarn/cache/@types-ws-npm-8.5.12-90c42288cf-ddefb6ad16.zip +0 -0
- package/.yarn/cache/ws-npm-8.18.0-56f68bc4d6-91d4d35bc9.zip +0 -0
- package/.yarn/install-state.gz +0 -0
- package/lib/commands/fun/base.js +9 -55
- package/package.json +2 -2
- package/.yarn/cache/@cloudbase-functions-framework-npm-0.0.12-a0ad7a7857-95be5c50de.zip +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/lib/commands/fun/base.js
CHANGED
|
@@ -123,8 +123,8 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
123
123
|
desc: '目标函数文件所在目录路径。默认为当前路径'
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
|
-
flags: '--
|
|
127
|
-
desc: '
|
|
126
|
+
flags: '--includeNodeModules',
|
|
127
|
+
desc: '包含本地 node_modules 目录,默认为 false 不包含'
|
|
128
128
|
}
|
|
129
129
|
],
|
|
130
130
|
requiredEnvId: false,
|
|
@@ -134,7 +134,8 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
134
134
|
}
|
|
135
135
|
execute(envId, log, options) {
|
|
136
136
|
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
-
let { serviceName, appId, source,
|
|
137
|
+
let { serviceName, appId, source, includeNodeModules = false } = options;
|
|
138
|
+
const target = 'main';
|
|
138
139
|
source = path_1.default.resolve(source || process.cwd());
|
|
139
140
|
const loadResult = yield (0, functions_framework_1.loadUserFunction)(source, target);
|
|
140
141
|
if (!(loadResult === null || loadResult === void 0 ? void 0 : loadResult.userFunction)) {
|
|
@@ -142,7 +143,7 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
142
143
|
log.error(`${source} 不是一个有效的函数式托管代码目录,可以通过 --source <source> 指定代码目录路径`);
|
|
143
144
|
}
|
|
144
145
|
else if (loadResult === null || loadResult === void 0 ? void 0 : loadResult.reason.includes('is not defined in the provided module')) {
|
|
145
|
-
log.error(`主文件并未导出目标函数 ${target},请导出 ${target}
|
|
146
|
+
log.error(`主文件并未导出目标函数 ${target},请导出 ${target} 目标函数`);
|
|
146
147
|
}
|
|
147
148
|
else {
|
|
148
149
|
log.error(loadResult === null || loadResult === void 0 ? void 0 : loadResult.reason);
|
|
@@ -227,7 +228,8 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
227
228
|
const { PackageName, PackageVersion } = yield (0, run_1.packageDeploy)({
|
|
228
229
|
envId,
|
|
229
230
|
serviceName,
|
|
230
|
-
filePath: source
|
|
231
|
+
filePath: source,
|
|
232
|
+
fileToIgnore: includeNodeModules ? [] : ['node_modules/**/*']
|
|
231
233
|
});
|
|
232
234
|
packageName = PackageName;
|
|
233
235
|
packageVersion = PackageVersion;
|
|
@@ -297,44 +299,8 @@ let FunRunCommand = class FunRunCommand extends common_1.Command {
|
|
|
297
299
|
desc: '监听的端口,默认为 3000'
|
|
298
300
|
},
|
|
299
301
|
{
|
|
300
|
-
flags: '--
|
|
301
|
-
desc: '
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
flags: '--signatureType <signatureType>',
|
|
305
|
-
desc: '函数格式,默认为 event,当前仅支持 event'
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
flags: '--gracefulShutdown <gracefulShutdown>',
|
|
309
|
-
desc: '是否启用服务的优雅停止,默认为 true'
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
flags: 'KILL_TIMEOUT <timeout>',
|
|
313
|
-
desc: '优雅停止时,等待请求处理完成的超时时间,默认为 5000 毫秒'
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
flags: '--timeout <timeout>',
|
|
317
|
-
desc: 'Node.js Server 超时时间,默认为 0,见 https://nodejs.org/api/http.html#servertimeout'
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
flags: '--keepAliveTimeout <keepAliveTimeout>',
|
|
321
|
-
desc: 'Node.js Server keep-alive 超时时间,默认为 65000 毫秒,见 https://nodejs.org/api/http.html#server-keepalivetimeout'
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
flags: '--captureStack <captureStack>',
|
|
325
|
-
desc: '请求出错时,是否返回错误堆栈,默认为 NODE_ENV 不为 production 时开启'
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
flags: '--concurrencyLimit <concurrencyLimit>',
|
|
329
|
-
desc: '并发请求数限制,默认为 0,0 为不限制'
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
flags: '--noExit <noExit>',
|
|
333
|
-
desc: '是否禁用 process.exit() 避免进程意外退出,默认为 false'
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
flags: '--logHeaderBody <logHeaderBody>',
|
|
337
|
-
desc: '是否在请求日志中记录请求头、请求体、响应头、响应体,默认为 false,如记录,将会限制 body 大小为 2KB'
|
|
302
|
+
flags: '-w, --watch',
|
|
303
|
+
desc: '是否启用热重启模式,如启用,将会在文件变更时自动重启服务,默认为 false'
|
|
338
304
|
},
|
|
339
305
|
{
|
|
340
306
|
flags: '--dry-run',
|
|
@@ -343,18 +309,6 @@ let FunRunCommand = class FunRunCommand extends common_1.Command {
|
|
|
343
309
|
{
|
|
344
310
|
flags: '--logDirname <logDirname>',
|
|
345
311
|
desc: '日志文件目录,默认为 ./logs'
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
flags: '--maxLogFileSize <maxLogFileSize>',
|
|
349
|
-
desc: '单个日志文件最大字节数,默认为 128MB'
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
flags: '--maxLogFiles <maxLogFiles>',
|
|
353
|
-
desc: '最多同时存在的日志文件数量,默认为 4'
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
flags: '-w, --watch',
|
|
357
|
-
desc: '是否启用热重启模式,如启用,将会在文件变更时自动重启服务,默认为 false'
|
|
358
312
|
}
|
|
359
313
|
],
|
|
360
314
|
requiredEnvId: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/cli",
|
|
3
|
-
"version": "2.6.0-alpha.
|
|
3
|
+
"version": "2.6.0-alpha.4",
|
|
4
4
|
"description": "cli tool for cloudbase",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@cloudbase/cloud-api": "^0.5.5",
|
|
35
35
|
"@cloudbase/framework-core": "^1.9.7",
|
|
36
|
-
"@cloudbase/functions-framework": "^0.0.
|
|
36
|
+
"@cloudbase/functions-framework": "^1.0.0-beta.3",
|
|
37
37
|
"@cloudbase/lowcode-cli": "^0.21.1",
|
|
38
38
|
"@cloudbase/manager-node": "4.2.8",
|
|
39
39
|
"@cloudbase/toolbox": "^0.7.5",
|