@cloudbase/cli 2.6.7 → 2.6.8
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/bin/tcb.js +0 -19
- package/lib/commands/runf/base.js +12 -2
- package/package.json +1 -1
- package/types/commands/runf/base.d.ts +1 -1
package/bin/tcb.js
CHANGED
|
@@ -42,7 +42,6 @@ async function main() {
|
|
|
42
42
|
|
|
43
43
|
// 定义最小版本和推荐版本
|
|
44
44
|
const NODE_MIN_VERSION = 18
|
|
45
|
-
const NODE_RECOMMENDED_VERSIONS = [18]
|
|
46
45
|
|
|
47
46
|
// 检查当前版本是否满足最小版本要求
|
|
48
47
|
if (NODE_MIN_VERSION > currentMajorVersion) {
|
|
@@ -51,27 +50,9 @@ async function main() {
|
|
|
51
50
|
`当前 Node.js 版本为 v${currentMajorVersion}。请升级到至少 v${NODE_MIN_VERSION} 版本。`
|
|
52
51
|
)
|
|
53
52
|
)
|
|
54
|
-
console.warn(
|
|
55
|
-
chalk.bold.yellow(
|
|
56
|
-
`建议使用 ${NODE_RECOMMENDED_VERSIONS.map((item) => `v${item}`).join(
|
|
57
|
-
' 或 '
|
|
58
|
-
)} 版本。`
|
|
59
|
-
)
|
|
60
|
-
)
|
|
61
53
|
process.exit(1)
|
|
62
54
|
}
|
|
63
55
|
|
|
64
|
-
// 检查当前版本是否在推荐版本列表中
|
|
65
|
-
if (!NODE_RECOMMENDED_VERSIONS.some((version) => currentMajorVersion === version)) {
|
|
66
|
-
console.warn(
|
|
67
|
-
chalk.bold.yellow(
|
|
68
|
-
`当前 Node.js 版本为 v${currentMajorVersion}。建议使用 ${NODE_RECOMMENDED_VERSIONS.map(
|
|
69
|
-
(item) => `v${item}`
|
|
70
|
-
).join(' 或 ')} 版本。`
|
|
71
|
-
)
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
56
|
// Sentry 错误上报
|
|
76
57
|
Sentry.init({
|
|
77
58
|
release: pkg.version,
|
|
@@ -457,11 +457,19 @@ let RunfRunCommand = class RunfRunCommand extends common_1.Command {
|
|
|
457
457
|
desc: '本地运行云函数 2.0 代码'
|
|
458
458
|
};
|
|
459
459
|
}
|
|
460
|
-
execute(logger) {
|
|
460
|
+
execute(logger, ctx, options) {
|
|
461
461
|
return __awaiter(this, void 0, void 0, function* () {
|
|
462
462
|
const args = process.argv.slice(2);
|
|
463
463
|
const watchFlag = ['--watch', '-w'];
|
|
464
464
|
const defaultIgnoreFiles = ['logs/*.*'];
|
|
465
|
+
const credential = yield getCredential(ctx, options);
|
|
466
|
+
process.env.EXTENDED_CONTEXT = JSON.stringify({
|
|
467
|
+
tmpSecret: {
|
|
468
|
+
secretId: credential.secretId,
|
|
469
|
+
secretKey: credential.secretKey,
|
|
470
|
+
token: credential.token
|
|
471
|
+
}
|
|
472
|
+
});
|
|
465
473
|
if (watchFlag.some((flag) => args.includes(flag))) {
|
|
466
474
|
const cmd = args.filter((arg) => !watchFlag.includes(arg)).join(' ');
|
|
467
475
|
(0, nodemon_1.default)({
|
|
@@ -506,8 +514,10 @@ let RunfRunCommand = class RunfRunCommand extends common_1.Command {
|
|
|
506
514
|
__decorate([
|
|
507
515
|
(0, decorators_1.InjectParams)(),
|
|
508
516
|
__param(0, (0, decorators_1.Log)()),
|
|
517
|
+
__param(1, (0, decorators_1.CmdContext)()),
|
|
518
|
+
__param(2, (0, decorators_1.ArgsOptions)()),
|
|
509
519
|
__metadata("design:type", Function),
|
|
510
|
-
__metadata("design:paramtypes", [decorators_1.Logger]),
|
|
520
|
+
__metadata("design:paramtypes", [decorators_1.Logger, Object, Object]),
|
|
511
521
|
__metadata("design:returntype", Promise)
|
|
512
522
|
], RunfRunCommand.prototype, "execute", null);
|
|
513
523
|
RunfRunCommand = __decorate([
|
package/package.json
CHANGED