@coze-arch/cli 0.0.32 → 0.0.33-alpha.eeae5b

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.
Files changed (2) hide show
  1. package/lib/cli.js +33 -14
  2. package/package.json +9 -7
package/lib/cli.js CHANGED
@@ -2107,14 +2107,15 @@ const EventBuilder = {
2107
2107
  };
2108
2108
 
2109
2109
  var name = "@coze-arch/cli";
2110
- var version = "0.0.32";
2110
+ var version = "0.0.33-alpha.eeae5b";
2111
2111
  var description = "coze coding devtools cli";
2112
2112
  var license = "MIT";
2113
2113
  var author = "fanwenjie.fe@bytedance.com";
2114
2114
  var maintainers = [
2115
2115
  ];
2116
2116
  var bin = {
2117
- coze: "bin/main"
2117
+ coze: "bin/main",
2118
+ "coze-dev": "bin/main"
2118
2119
  };
2119
2120
  var files = [
2120
2121
  "lib",
@@ -2154,7 +2155,7 @@ var dependencies = {
2154
2155
  ejs: "^3.1.10",
2155
2156
  "fast-glob": "^3.3.3",
2156
2157
  "js-yaml": "^4.2.0",
2157
- minimist: "^1.2.5",
2158
+ minimist: "^1.2.8",
2158
2159
  shelljs: "^0.10.0"
2159
2160
  };
2160
2161
  var devDependencies = {
@@ -2170,7 +2171,7 @@ var devDependencies = {
2170
2171
  "@emnapi/runtime": "^1.11.1",
2171
2172
  "@inquirer/prompts": "^3.2.0",
2172
2173
  "@rollup/plugin-commonjs": "^28.0.2",
2173
- "@rollup/plugin-json": "~6.0.0",
2174
+ "@rollup/plugin-json": "~6.1.0",
2174
2175
  "@rollup/plugin-node-resolve": "^15.3.0",
2175
2176
  "@rollup/plugin-sucrase": "^5.1.0",
2176
2177
  "@types/debug": "^4.1.13",
@@ -2183,11 +2184,11 @@ var devDependencies = {
2183
2184
  "@vitest/coverage-v8": "~4.1.10",
2184
2185
  knip: "^5.30.1",
2185
2186
  minimatch: "^10.2.5",
2186
- playwright: "~1.60.0",
2187
+ playwright: "~1.61.1",
2187
2188
  rollup: "^4.60.1",
2188
2189
  sucrase: "^3.35.1",
2189
2190
  "tree-kill": "^1.2.2",
2190
- tsx: "^4.22.4",
2191
+ tsx: "^4.23.11",
2191
2192
  vitest: "~4.1.10"
2192
2193
  };
2193
2194
  var publishConfig = {
@@ -2196,7 +2197,8 @@ var publishConfig = {
2196
2197
  };
2197
2198
  var cozePublishConfig = {
2198
2199
  bin: {
2199
- coze: "bin/main"
2200
+ coze: "bin/main",
2201
+ "coze-dev": "bin/main"
2200
2202
  }
2201
2203
  };
2202
2204
  var packageJson = {
@@ -2431,7 +2433,12 @@ class Logger {
2431
2433
 
2432
2434
  const envLevel = _optionalChain$q([process, 'access', _ => _.env, 'access', _2 => _2.LOG_LEVEL, 'optionalAccess', _3 => _3.toLowerCase, 'call', _4 => _4()]);
2433
2435
  if (envLevel && envLevel in LOG_LEVEL_MAP) {
2434
- return LOG_LEVEL_MAP[envLevel];
2436
+ // envLevel 已通过 `in` 检查确认为 LOG_LEVEL_MAP 的键;
2437
+ // 显式判空以满足 noUncheckedIndexedAccess,运行时行为不变
2438
+ const mappedLevel = LOG_LEVEL_MAP[envLevel];
2439
+ if (mappedLevel !== undefined) {
2440
+ return mappedLevel;
2441
+ }
2435
2442
  }
2436
2443
 
2437
2444
  return LogLevel.INFO;
@@ -3249,8 +3256,7 @@ const registerCommand$5 = program => {
3249
3256
  });
3250
3257
  };
3251
3258
 
3252
- function _optionalChain$p(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/* eslint-disable @typescript-eslint/no-explicit-any */
3253
- // Safe JSON parsing utilities with type safety and error handling
3259
+ function _optionalChain$p(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// Safe JSON parsing utilities with type safety and error handling
3254
3260
  // Provides fallback values, validation, and error monitoring capabilities
3255
3261
 
3256
3262
  /**
@@ -3286,6 +3292,7 @@ function _optionalChain$p(ops) { let lastAccessLHS = undefined; let value = ops[
3286
3292
 
3287
3293
 
3288
3294
 
3295
+
3289
3296
 
3290
3297
 
3291
3298
  /**
@@ -8021,7 +8028,12 @@ const extractParams$1 = (routePath) => {
8021
8028
  patterns.forEach(pattern => {
8022
8029
  const matches = routePath.matchAll(pattern);
8023
8030
  for (const match of matches) {
8024
- params.push(match[1]);
8031
+ // 每个 pattern 都含单一捕获组 (\w+),匹配成功时 match[1] 必然存在;
8032
+ // 显式判空以满足 noUncheckedIndexedAccess,不改变原有运行时行为
8033
+ const param = match[1];
8034
+ if (param !== undefined) {
8035
+ params.push(param);
8036
+ }
8025
8037
  }
8026
8038
  });
8027
8039
 
@@ -8232,7 +8244,12 @@ const extractParams = (routePath) => {
8232
8244
  patterns.forEach(pattern => {
8233
8245
  const matches = routePath.matchAll(pattern);
8234
8246
  for (const match of matches) {
8235
- paramsSet.add(match[1]);
8247
+ // 每个 pattern 都含单一捕获组 (\w+),匹配成功时 match[1] 必然存在;
8248
+ // 显式判空以满足 noUncheckedIndexedAccess,不改变原有运行时行为
8249
+ const param = match[1];
8250
+ if (param !== undefined) {
8251
+ paramsSet.add(param);
8252
+ }
8236
8253
  }
8237
8254
  });
8238
8255
 
@@ -9946,12 +9963,14 @@ const commitChanges = (projectPath) => {
9946
9963
  const runDev = (projectPath) => {
9947
9964
  // 获取当前 CLI 的可执行文件路径
9948
9965
  // process.argv[0] 是 node,process.argv[1] 是 CLI 入口文件
9949
- const cliPath = process.argv[1];
9966
+ // 二者在 CLI 运行时必然存在,兜底空串仅为满足类型收窄,运行时不会命中
9967
+ const nodeBin = _nullishCoalesce(process.argv[0], () => ( ''));
9968
+ const cliPath = _nullishCoalesce(process.argv[1], () => ( ''));
9950
9969
 
9951
9970
  try {
9952
9971
  // 使用通用的后台执行函数启动开发服务器
9953
9972
  // 调用 CLI 自己的 dev 命令
9954
- const pid = spawnDetached(process.argv[0], [cliPath, 'dev'], {
9973
+ const pid = spawnDetached(nodeBin, [cliPath, 'dev'], {
9955
9974
  cwd: projectPath,
9956
9975
  verbose: false, // 不输出额外的进程信息,由 logger 统一处理
9957
9976
  });
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@coze-arch/cli",
3
- "version": "0.0.32",
3
+ "version": "0.0.33-alpha.eeae5b",
4
4
  "private": false,
5
5
  "description": "coze coding devtools cli",
6
6
  "license": "MIT",
7
7
  "author": "fanwenjie.fe@bytedance.com",
8
8
  "maintainers": [],
9
9
  "bin": {
10
- "coze": "bin/main"
10
+ "coze": "bin/main",
11
+ "coze-dev": "bin/main"
11
12
  },
12
13
  "files": [
13
14
  "lib",
@@ -47,7 +48,7 @@
47
48
  "ejs": "^3.1.10",
48
49
  "fast-glob": "^3.3.3",
49
50
  "js-yaml": "^4.2.0",
50
- "minimist": "^1.2.5",
51
+ "minimist": "^1.2.8",
51
52
  "shelljs": "^0.10.0"
52
53
  },
53
54
  "devDependencies": {
@@ -63,7 +64,7 @@
63
64
  "@emnapi/runtime": "^1.11.1",
64
65
  "@inquirer/prompts": "^3.2.0",
65
66
  "@rollup/plugin-commonjs": "^28.0.2",
66
- "@rollup/plugin-json": "~6.0.0",
67
+ "@rollup/plugin-json": "~6.1.0",
67
68
  "@rollup/plugin-node-resolve": "^15.3.0",
68
69
  "@rollup/plugin-sucrase": "^5.1.0",
69
70
  "@types/debug": "^4.1.13",
@@ -76,11 +77,11 @@
76
77
  "@vitest/coverage-v8": "~4.1.10",
77
78
  "knip": "^5.30.1",
78
79
  "minimatch": "^10.2.5",
79
- "playwright": "~1.60.0",
80
+ "playwright": "~1.61.1",
80
81
  "rollup": "^4.60.1",
81
82
  "sucrase": "^3.35.1",
82
83
  "tree-kill": "^1.2.2",
83
- "tsx": "^4.22.4",
84
+ "tsx": "^4.23.11",
84
85
  "vitest": "~4.1.10"
85
86
  },
86
87
  "publishConfig": {
@@ -89,7 +90,8 @@
89
90
  },
90
91
  "cozePublishConfig": {
91
92
  "bin": {
92
- "coze": "bin/main"
93
+ "coze": "bin/main",
94
+ "coze-dev": "bin/main"
93
95
  }
94
96
  }
95
97
  }