@lark-apaas/fullstack-cli 1.1.63-alpha.20260827110845 → 1.1.63-beta.0

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/dist/index.js CHANGED
@@ -7289,15 +7289,8 @@ function readDevStdSegment(filePath, maxLines, offset) {
7289
7289
 
7290
7290
  // src/commands/read-logs/json-lines.ts
7291
7291
  import fs27 from "fs";
7292
- function normalizePid(value) {
7293
- if (typeof value === "number") {
7294
- return String(value);
7295
- }
7296
- if (typeof value === "string" && value.length > 0) {
7297
- return value;
7298
- }
7299
- return "unknown";
7300
- }
7292
+
7293
+ // src/commands/read-logs/structured-log.ts
7301
7294
  function normalizeLevelName(value) {
7302
7295
  if (typeof value === "string") {
7303
7296
  const trimmed = value.trim().toLowerCase();
@@ -7318,9 +7311,30 @@ function normalizeLevelName(value) {
7318
7311
  }
7319
7312
  return null;
7320
7313
  }
7314
+ var TYPED_LOG_HEADER_LIMIT = 4096;
7315
+ function extractTypedLogV2Level(obj) {
7316
+ if (!obj || typeof obj !== "object") return null;
7317
+ const message = obj["message"];
7318
+ if (typeof message !== "string") return null;
7319
+ const header = message.slice(0, TYPED_LOG_HEADER_LIMIT);
7320
+ const argsIndex = header.search(/"args"\s*:/);
7321
+ const metadataHeader = argsIndex >= 0 ? header.slice(0, argsIndex) : header;
7322
+ if (!/"type"\s*:\s*"typedLogV2"/.test(metadataHeader)) return null;
7323
+ const levelMatch = metadataHeader.match(
7324
+ /"level"\s*:\s*("(?:\\.|[^"\\])*"|-?\d+(?:\.\d+)?)/
7325
+ );
7326
+ if (!levelMatch) return null;
7327
+ try {
7328
+ return normalizeLevelName(JSON.parse(levelMatch[1]));
7329
+ } catch {
7330
+ return null;
7331
+ }
7332
+ }
7321
7333
  function extractLevelName(obj) {
7322
7334
  if (!obj || typeof obj !== "object") return null;
7323
7335
  const record = obj;
7336
+ const typedLogLevel = extractTypedLogV2Level(record);
7337
+ if (typedLogLevel) return typedLogLevel;
7324
7338
  const direct = normalizeLevelName(record["level"]);
7325
7339
  if (direct) return direct;
7326
7340
  const meta = record["meta"];
@@ -7329,6 +7343,17 @@ function extractLevelName(obj) {
7329
7343
  }
7330
7344
  return null;
7331
7345
  }
7346
+
7347
+ // src/commands/read-logs/json-lines.ts
7348
+ function normalizePid(value) {
7349
+ if (typeof value === "number") {
7350
+ return String(value);
7351
+ }
7352
+ if (typeof value === "string" && value.length > 0) {
7353
+ return value;
7354
+ }
7355
+ return "unknown";
7356
+ }
7332
7357
  function buildWantedLevelSet(levels) {
7333
7358
  if (!levels || levels.length === 0) return null;
7334
7359
  const set = /* @__PURE__ */ new Set();
@@ -7704,6 +7729,10 @@ function sanitizeStructuredLog(value) {
7704
7729
  delete sanitized.tenant_id;
7705
7730
  delete sanitized.app_id;
7706
7731
  delete sanitized.pid;
7732
+ const typedLogLevel = extractTypedLogV2Level(obj);
7733
+ if (typedLogLevel) {
7734
+ sanitized.level = typedLogLevel;
7735
+ }
7707
7736
  return sanitized;
7708
7737
  }
7709
7738
  var TRANSIENT_CONNECTION_ERROR_PATTERN = /ECONNREFUSED|ECONNRESET|ETIMEDOUT|ENETUNREACH|socket hang up|proxy error|\[Proxy\] (?:Error:\s*$|Error during|Connection error|Non-connection error|Headers already sent|Service (?:recovered|did not recover))/i;
@@ -7738,6 +7767,8 @@ function hasErrorInStdLines(lines) {
7738
7767
  function hasErrorInLogObject(value) {
7739
7768
  if (!value || typeof value !== "object") return false;
7740
7769
  const obj = value;
7770
+ const typedLogLevel = extractTypedLogV2Level(obj);
7771
+ if (typedLogLevel === "error" || typedLogLevel === "fatal") return true;
7741
7772
  const rawLevel = obj.level;
7742
7773
  const level = typeof rawLevel === "string" ? rawLevel.toLowerCase() : "";
7743
7774
  if (level === "error" || level === "fatal") return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-cli",
3
- "version": "1.1.63-alpha.20260827110845",
3
+ "version": "1.1.63-beta.0",
4
4
  "description": "CLI tool for fullstack template management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,15 +11,6 @@
11
11
  "outDir": "dist/server",
12
12
  "watchAssets": true
13
13
  }
14
- ],
15
- "plugins": [
16
- {
17
- "name": "@nestjs/swagger",
18
- "options": {
19
- "introspectComments": true,
20
- "classValidatorShim": true
21
- }
22
- }
23
14
  ]
24
15
  }
25
- }
16
+ }
@@ -154,18 +154,6 @@ if [ -d "$DIST_DIR/client" ]; then
154
154
  find "$DIST_DIR/client" -maxdepth 1 -name "*.html" -exec mv {} "$DIST_DIR/dist/client/" \;
155
155
  fi
156
156
 
157
- # 拷贝 shared/static → dist/shared/static
158
- # Nest server 生产从 process.cwd() + shared/static 读 (nestjs-core static.controller.ts:100),
159
- # 生产 cwd = dist/, 所以目标是 dist/shared/static。coding-preset 的 static-assets plugin
160
- # 之前 closeBundle 拷贝, 现在删除后交给 build.sh 显式做 (跟 jsPage 的 output_static rsync 对齐)。
161
- # 排除 .ts/.tsx/.js/.jsx: 避免 shared/static/ 里若有开发脚本被误传到生产。
162
- if [ -d "$ROOT_DIR/shared/static" ]; then
163
- mkdir -p "$DIST_DIR/shared/static"
164
- rsync -a --exclude='*.ts' --exclude='*.tsx' --exclude='*.js' --exclude='*.jsx' \
165
- "$ROOT_DIR/shared/static/" "$DIST_DIR/shared/static/"
166
- echo " Static → dist/shared/static/"
167
- fi
168
-
169
157
  # server 相关产物准备(only_frontend_change=true 时跳过)
170
158
  if [[ "${only_frontend_change:-false}" == "true" ]]; then
171
159
  echo " [skip] 跳过 run.sh/.env 复制 (only_frontend_change=true)"