@cloudbase/cli 2.6.0-alpha.2 → 2.6.0-alpha.3
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/lib/commands/fun/base.js +5 -56
- package/package.json +1 -1
package/lib/commands/fun/base.js
CHANGED
|
@@ -121,10 +121,6 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
121
121
|
{
|
|
122
122
|
flags: '--source <source>',
|
|
123
123
|
desc: '目标函数文件所在目录路径。默认为当前路径'
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
flags: '--target <target>',
|
|
127
|
-
desc: '目标函数名称,默认为 main'
|
|
128
124
|
}
|
|
129
125
|
],
|
|
130
126
|
requiredEnvId: false,
|
|
@@ -134,7 +130,8 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
134
130
|
}
|
|
135
131
|
execute(envId, log, options) {
|
|
136
132
|
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
-
let { serviceName, appId, source
|
|
133
|
+
let { serviceName, appId, source } = options;
|
|
134
|
+
const target = 'main';
|
|
138
135
|
source = path_1.default.resolve(source || process.cwd());
|
|
139
136
|
const loadResult = yield (0, functions_framework_1.loadUserFunction)(source, target);
|
|
140
137
|
if (!(loadResult === null || loadResult === void 0 ? void 0 : loadResult.userFunction)) {
|
|
@@ -142,7 +139,7 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
142
139
|
log.error(`${source} 不是一个有效的函数式托管代码目录,可以通过 --source <source> 指定代码目录路径`);
|
|
143
140
|
}
|
|
144
141
|
else if (loadResult === null || loadResult === void 0 ? void 0 : loadResult.reason.includes('is not defined in the provided module')) {
|
|
145
|
-
log.error(`主文件并未导出目标函数 ${target},请导出 ${target}
|
|
142
|
+
log.error(`主文件并未导出目标函数 ${target},请导出 ${target} 目标函数`);
|
|
146
143
|
}
|
|
147
144
|
else {
|
|
148
145
|
log.error(loadResult === null || loadResult === void 0 ? void 0 : loadResult.reason);
|
|
@@ -297,44 +294,8 @@ let FunRunCommand = class FunRunCommand extends common_1.Command {
|
|
|
297
294
|
desc: '监听的端口,默认为 3000'
|
|
298
295
|
},
|
|
299
296
|
{
|
|
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'
|
|
297
|
+
flags: '-w, --watch',
|
|
298
|
+
desc: '是否启用热重启模式,如启用,将会在文件变更时自动重启服务,默认为 false'
|
|
338
299
|
},
|
|
339
300
|
{
|
|
340
301
|
flags: '--dry-run',
|
|
@@ -343,18 +304,6 @@ let FunRunCommand = class FunRunCommand extends common_1.Command {
|
|
|
343
304
|
{
|
|
344
305
|
flags: '--logDirname <logDirname>',
|
|
345
306
|
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
307
|
}
|
|
359
308
|
],
|
|
360
309
|
requiredEnvId: false,
|