@lark-apaas/fullstack-cli 1.1.40 → 1.1.41

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.
@@ -1,6 +1,6 @@
1
1
  // src/config/drizzle.config.ts
2
2
  import { defineConfig } from "drizzle-kit";
3
- var outputDir = process.env.__DRIZZLE_OUT_DIR__ || "./server/database/.introspect";
3
+ var outputDir = process.env.__DRIZZLE_OUT_DIR__ || "./tmp/.introspect";
4
4
  var schemaPath = process.env.__DRIZZLE_SCHEMA_PATH__ || "./server/database/schema.ts";
5
5
  var parsedUrl = new URL(process.env.SUDA_DATABASE_URL || "");
6
6
  var envSchemaFilter = process.env.DRIZZLE_SCHEMA_FILTER;
package/dist/index.js CHANGED
@@ -2167,7 +2167,9 @@ async function run(options = {}) {
2167
2167
  process.exit(1);
2168
2168
  }
2169
2169
  const outputPath = options.output || process.env.DB_SCHEMA_OUTPUT || "server/database/schema.ts";
2170
- const OUT_DIR = path2.resolve(process.cwd(), "server/database/.introspect");
2170
+ const INTROSPECT_ROOT = path2.resolve(process.cwd(), "tmp/.introspect");
2171
+ fs4.mkdirSync(INTROSPECT_ROOT, { recursive: true });
2172
+ const OUT_DIR = fs4.mkdtempSync(path2.join(INTROSPECT_ROOT, "run-"));
2171
2173
  const SCHEMA_FILE = path2.resolve(process.cwd(), outputPath);
2172
2174
  console.log("[gen-db-schema] Starting...");
2173
2175
  const __filename = fileURLToPath2(import.meta.url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-cli",
3
- "version": "1.1.40",
3
+ "version": "1.1.41",
4
4
  "description": "CLI tool for fullstack template management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,7 +1,7 @@
1
1
  import { defineConfig, Config } from 'drizzle-kit';
2
2
  require('dotenv').config();
3
3
 
4
- const outputDir = process.env.__DRIZZLE_OUT_DIR__ || './server/database/.introspect';
4
+ const outputDir = process.env.__DRIZZLE_OUT_DIR__ || './tmp/.introspect';
5
5
  const schemaPath = process.env.__DRIZZLE_SCHEMA_PATH__ || './server/database/schema.ts';
6
6
 
7
7
  const parsedUrl = new URL(process.env.SUDA_DATABASE_URL || '');
@@ -79,12 +79,17 @@ echo ""
79
79
  echo "🔨 [4/6] 并行构建 server 和 client"
80
80
  STEP_START=$(node -e "console.log(Date.now())")
81
81
 
82
+ # 给 server/client 构建子进程预留 8GB heap,缓解 vite build transform 阶段 OOM
83
+ # (典型错误:Reached heap limit Allocation failed)。
84
+ # 仅在外部未设置 NODE_OPTIONS 时注入,允许 CI / 用户通过外部环境变量完全覆盖
85
+ BUILD_NODE_OPTIONS="${NODE_OPTIONS:---max-old-space-size=8192}"
86
+
82
87
  # 根据 only_frontend_change 决定是否构建 server
83
88
  if [[ "${only_frontend_change:-false}" == "true" ]]; then
84
89
  echo "🔨 [4/6] 仅构建 client (only_frontend_change=true)"
85
90
 
86
91
  echo " ├─ 启动 client 构建..."
87
- npm run build:client > /tmp/build-client.log 2>&1
92
+ NODE_OPTIONS="$BUILD_NODE_OPTIONS" npm run build:client > /tmp/build-client.log 2>&1
88
93
  CLIENT_EXIT=$?
89
94
 
90
95
  if [ $CLIENT_EXIT -ne 0 ]; then
@@ -99,11 +104,11 @@ else
99
104
 
100
105
  # 并行构建
101
106
  echo " ├─ 启动 server 构建..."
102
- npm run build:server > /tmp/build-server.log 2>&1 &
107
+ NODE_OPTIONS="$BUILD_NODE_OPTIONS" npm run build:server > /tmp/build-server.log 2>&1 &
103
108
  SERVER_PID=$!
104
109
 
105
110
  echo " ├─ 启动 client 构建..."
106
- npm run build:client > /tmp/build-client.log 2>&1 &
111
+ NODE_OPTIONS="$BUILD_NODE_OPTIONS" npm run build:client > /tmp/build-client.log 2>&1 &
107
112
  CLIENT_PID=$!
108
113
 
109
114
  # 等待两个构建完成