@lark-apaas/fullstack-cli 1.1.28-alpha.1 → 1.1.28-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/dist/index.js CHANGED
@@ -7198,13 +7198,18 @@ async function getDefaultBucketId(appId) {
7198
7198
  async function preUploadStaticAttachment(appId, bucketId) {
7199
7199
  const client = getHttpClient();
7200
7200
  const url = `/v1/app/${appId}/storage/bucket/${bucketId}/preUploadStatic`;
7201
+ console.error(`[api-client] preUploadStatic request: POST ${url}, appId=${appId}, bucketId=${bucketId}`);
7201
7202
  const response = await client.post(url, {});
7202
7203
  if (!response.ok || response.status !== 200) {
7204
+ const body = await response.text().catch(() => "(unable to read body)");
7205
+ console.error(`[api-client] preUploadStatic HTTP error: ${response.status} ${response.statusText}, body: ${body}`);
7203
7206
  throw new Error(
7204
7207
  `preUploadStatic \u8BF7\u6C42\u5931\u8D25: ${response.status} ${response.statusText}`
7205
7208
  );
7206
7209
  }
7207
- return response.json();
7210
+ const data = await response.json();
7211
+ console.error(`[api-client] preUploadStatic response: ${JSON.stringify(data)}`);
7212
+ return data;
7208
7213
  }
7209
7214
  async function uploadStaticAttachmentCallback(appId, bucketId, body) {
7210
7215
  const client = getHttpClient();
@@ -7337,7 +7342,7 @@ async function uploadStatic(options) {
7337
7342
  async function fetchPreUpload(appId, bucketId) {
7338
7343
  const response = await preUploadStaticAttachment(appId, bucketId);
7339
7344
  if (response.status_code !== "0") {
7340
- throw new Error(`preUploadStatic \u8FD4\u56DE\u5F02\u5E38, status_code: ${response.status_code}`);
7345
+ throw new Error(`preUploadStatic \u8FD4\u56DE\u5F02\u5E38, \u5B8C\u6574\u54CD\u5E94: ${JSON.stringify(response)}`);
7341
7346
  }
7342
7347
  const { uploadPrefix, uploadID, uploadCredential } = response.data || {};
7343
7348
  if (!uploadPrefix || !uploadID) {
@@ -7383,7 +7388,7 @@ async function preUploadStatic(options) {
7383
7388
  console.error(`${LOG_PREFIX2} \u8C03\u7528 preUploadStatic...`);
7384
7389
  const response = await preUploadStaticAttachment(appId, bucketId);
7385
7390
  if (response.status_code !== "0") {
7386
- console.error(`${LOG_PREFIX2} preUploadStatic \u8FD4\u56DE\u5F02\u5E38, status_code: ${response.status_code}`);
7391
+ console.error(`${LOG_PREFIX2} preUploadStatic \u8FD4\u56DE\u5F02\u5E38, \u5B8C\u6574\u54CD\u5E94: ${JSON.stringify(response)}`);
7387
7392
  return;
7388
7393
  }
7389
7394
  const { downloadUrlPrefix, uploadPrefix, uploadID, uploadCredential } = response.data || {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-cli",
3
- "version": "1.1.28-alpha.1",
3
+ "version": "1.1.28-alpha.3",
4
4
  "description": "CLI tool for fullstack template management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,46 +19,28 @@ print_time() {
19
19
  }
20
20
 
21
21
  # ==================== 步骤 0 ====================
22
- echo "🗑️ [0/6] 安装插件"
22
+ echo "🗑️ [0/5] 安装插件"
23
23
  STEP_START=$(node -e "console.log(Date.now())")
24
24
  npx fullstack-cli action-plugin init
25
25
  print_time $STEP_START
26
26
  echo ""
27
27
 
28
28
  # ==================== 步骤 1 ====================
29
- echo "📝 [1/6] 更新 openapi 代码"
29
+ echo "📝 [1/5] 更新 openapi 代码"
30
30
  STEP_START=$(node -e "console.log(Date.now())")
31
31
  npm run gen:openapi
32
32
  print_time $STEP_START
33
33
  echo ""
34
34
 
35
35
  # ==================== 步骤 2 ====================
36
- echo "🗑️ [2/6] 清理 dist 目录"
36
+ echo "🗑️ [2/5] 清理 dist 目录"
37
37
  STEP_START=$(node -e "console.log(Date.now())")
38
38
  rm -rf "$ROOT_DIR/dist"
39
39
  print_time $STEP_START
40
40
  echo ""
41
41
 
42
42
  # ==================== 步骤 3 ====================
43
- echo "🔗 [3/6] 预上传:获取 TOS 信息并注入环境变量"
44
- STEP_START=$(node -e "console.log(Date.now())")
45
-
46
- if [ -d "$ROOT_DIR/shared/static" ] && [ "$(ls -A "$ROOT_DIR/shared/static" 2>/dev/null)" ]; then
47
- eval "$(npx fullstack-cli build pre-upload-static --app-id "${app_id}")"
48
- if [ -n "$STATIC_ASSETS_BASE_URL" ]; then
49
- echo " STATIC_ASSETS_BASE_URL=$STATIC_ASSETS_BASE_URL"
50
- else
51
- echo " ⚠️ 未获取到 TOS URL 前缀,将使用默认路径"
52
- fi
53
- else
54
- echo " 跳过:shared/static 目录不存在或为空"
55
- fi
56
-
57
- print_time $STEP_START
58
- echo ""
59
-
60
- # ==================== 步骤 4 ====================
61
- echo "🔨 [4/6] 并行构建 server 和 client"
43
+ echo "🔨 [3/5] 并行构建 server 和 client"
62
44
  STEP_START=$(node -e "console.log(Date.now())")
63
45
 
64
46
  # 并行构建
@@ -95,8 +77,8 @@ echo " ✅ Client 构建完成"
95
77
  print_time $STEP_START
96
78
  echo ""
97
79
 
98
- # ==================== 步骤 5 ====================
99
- echo "📦 [5/6] 准备 server 依赖产物"
80
+ # ==================== 步骤 4 ====================
81
+ echo "📦 [4/5] 准备 server 依赖产物"
100
82
  STEP_START=$(node -e "console.log(Date.now())")
101
83
 
102
84
  mkdir -p "$OUT_DIR/dist/client"
@@ -114,8 +96,8 @@ rm -rf "$ROOT_DIR/dist/tsconfig.node.tsbuildinfo"
114
96
  print_time $STEP_START
115
97
  echo ""
116
98
 
117
- # ==================== 步骤 6 ====================
118
- echo "✂️ [6/6] 智能依赖裁剪"
99
+ # ==================== 步骤 5 ====================
100
+ echo "✂️ [5/5] 智能依赖裁剪"
119
101
  STEP_START=$(node -e "console.log(Date.now())")
120
102
 
121
103
  # 分析实际依赖、复制并裁剪 node_modules、生成精简的 package.json