@coze-arch/cli 0.0.1-alpha.e8683e → 0.0.1-alpha.e89608

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 (128) hide show
  1. package/README.md +1 -0
  2. package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +25 -16
  3. package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +9 -8
  4. package/lib/__templates__/expo/README.md +2 -2
  5. package/lib/__templates__/expo/client/app/+not-found.tsx +30 -0
  6. package/lib/__templates__/expo/client/app.config.ts +2 -2
  7. package/lib/__templates__/expo/client/components/Screen.tsx +2 -2
  8. package/lib/__templates__/expo/client/eslint.config.mjs +21 -1
  9. package/lib/__templates__/expo/client/hooks/useSafeRouter.ts +152 -0
  10. package/lib/__templates__/expo/client/metro.config.js +3 -0
  11. package/lib/__templates__/expo/client/package.json +36 -34
  12. package/lib/__templates__/expo/client/screens/demo/index.tsx +3 -3
  13. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +10 -10
  14. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/index.js +9 -0
  15. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/rule.js +112 -0
  16. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/tech.md +94 -0
  17. package/lib/__templates__/expo/eslint-plugins/react-native/index.js +9 -0
  18. package/lib/__templates__/expo/eslint-plugins/react-native/rule.js +64 -0
  19. package/lib/__templates__/expo/package.json +3 -0
  20. package/lib/__templates__/expo/patches/expo@54.0.33.patch +45 -0
  21. package/lib/__templates__/expo/pnpm-lock.yaml +1318 -2636
  22. package/lib/__templates__/expo/server/package.json +9 -7
  23. package/lib/__templates__/expo/server/src/index.ts +1 -0
  24. package/lib/__templates__/expo/template.config.js +56 -0
  25. package/lib/__templates__/native-static/.coze +11 -0
  26. package/lib/__templates__/native-static/index.html +33 -0
  27. package/lib/__templates__/native-static/styles/main.css +136 -0
  28. package/lib/__templates__/native-static/template.config.js +22 -0
  29. package/lib/__templates__/nextjs/README.md +5 -0
  30. package/lib/__templates__/nextjs/eslint.config.mjs +5 -0
  31. package/lib/__templates__/nextjs/next.config.ts +1 -2
  32. package/lib/__templates__/nextjs/package.json +5 -6
  33. package/lib/__templates__/nextjs/pnpm-lock.yaml +2096 -956
  34. package/lib/__templates__/nextjs/scripts/build.sh +4 -1
  35. package/lib/__templates__/nextjs/scripts/dev.sh +1 -2
  36. package/lib/__templates__/nextjs/scripts/start.sh +1 -1
  37. package/lib/__templates__/nextjs/src/app/layout.tsx +1 -1
  38. package/lib/__templates__/nextjs/src/app/page.tsx +18 -60
  39. package/lib/__templates__/nextjs/src/server.ts +35 -0
  40. package/lib/__templates__/nextjs/template.config.js +49 -14
  41. package/lib/__templates__/nextjs/tsconfig.json +1 -1
  42. package/lib/__templates__/nuxt-vue/.coze +12 -0
  43. package/lib/__templates__/nuxt-vue/README.md +73 -0
  44. package/lib/__templates__/nuxt-vue/_gitignore +24 -0
  45. package/lib/__templates__/nuxt-vue/_npmrc +23 -0
  46. package/lib/__templates__/nuxt-vue/app/app.vue +6 -0
  47. package/lib/__templates__/nuxt-vue/app/pages/index.vue +23 -0
  48. package/lib/__templates__/nuxt-vue/assets/css/main.css +24 -0
  49. package/lib/__templates__/nuxt-vue/nuxt.config.ts +116 -0
  50. package/lib/__templates__/nuxt-vue/package.json +35 -0
  51. package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +8759 -0
  52. package/lib/__templates__/nuxt-vue/postcss.config.mjs +8 -0
  53. package/lib/__templates__/nuxt-vue/public/favicon.ico +0 -0
  54. package/lib/__templates__/nuxt-vue/public/robots.txt +2 -0
  55. package/lib/__templates__/nuxt-vue/scripts/build.sh +14 -0
  56. package/lib/__templates__/nuxt-vue/scripts/dev.sh +31 -0
  57. package/lib/__templates__/nuxt-vue/scripts/prepare.sh +14 -0
  58. package/lib/__templates__/nuxt-vue/scripts/start.sh +15 -0
  59. package/lib/__templates__/nuxt-vue/server/api/hello.ts +10 -0
  60. package/lib/__templates__/nuxt-vue/server/middleware/logger.ts +10 -0
  61. package/lib/__templates__/nuxt-vue/server/routes/health.ts +10 -0
  62. package/lib/__templates__/nuxt-vue/tailwind.config.js +13 -0
  63. package/lib/__templates__/nuxt-vue/template.config.js +87 -0
  64. package/lib/__templates__/nuxt-vue/tsconfig.json +18 -0
  65. package/lib/__templates__/taro/.coze +14 -0
  66. package/lib/__templates__/taro/.cozeproj/scripts/deploy_build.sh +19 -0
  67. package/lib/__templates__/taro/.cozeproj/scripts/deploy_run.sh +14 -0
  68. package/lib/__templates__/taro/.cozeproj/scripts/dev_build.sh +2 -0
  69. package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +151 -0
  70. package/lib/__templates__/taro/.cozeproj/scripts/init_env.sh +5 -0
  71. package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +24 -0
  72. package/lib/__templates__/taro/README.md +751 -0
  73. package/lib/__templates__/taro/_gitignore +40 -0
  74. package/lib/__templates__/taro/_npmrc +18 -0
  75. package/lib/__templates__/taro/babel.config.js +12 -0
  76. package/lib/__templates__/taro/config/dev.ts +9 -0
  77. package/lib/__templates__/taro/config/index.ts +223 -0
  78. package/lib/__templates__/taro/config/prod.ts +34 -0
  79. package/lib/__templates__/taro/eslint.config.mjs +80 -0
  80. package/lib/__templates__/taro/key/private.appid.key +0 -0
  81. package/lib/__templates__/taro/package.json +107 -0
  82. package/lib/__templates__/taro/patches/@tarojs__plugin-mini-ci@4.1.9.patch +30 -0
  83. package/lib/__templates__/taro/pnpm-lock.yaml +23100 -0
  84. package/lib/__templates__/taro/pnpm-workspace.yaml +2 -0
  85. package/lib/__templates__/taro/project.config.json +15 -0
  86. package/lib/__templates__/taro/server/nest-cli.json +10 -0
  87. package/lib/__templates__/taro/server/package.json +40 -0
  88. package/lib/__templates__/taro/server/src/app.controller.ts +23 -0
  89. package/lib/__templates__/taro/server/src/app.module.ts +10 -0
  90. package/lib/__templates__/taro/server/src/app.service.ts +8 -0
  91. package/lib/__templates__/taro/server/src/interceptors/http-status.interceptor.ts +23 -0
  92. package/lib/__templates__/taro/server/src/main.ts +49 -0
  93. package/lib/__templates__/taro/server/tsconfig.json +24 -0
  94. package/lib/__templates__/taro/src/app.config.ts +11 -0
  95. package/lib/__templates__/taro/src/app.css +52 -0
  96. package/lib/__templates__/taro/src/app.tsx +9 -0
  97. package/lib/__templates__/taro/src/index.html +39 -0
  98. package/lib/__templates__/taro/src/network.ts +39 -0
  99. package/lib/__templates__/taro/src/pages/index/index.config.ts +3 -0
  100. package/lib/__templates__/taro/src/pages/index/index.css +1 -0
  101. package/lib/__templates__/taro/src/pages/index/index.tsx +33 -0
  102. package/lib/__templates__/taro/src/presets/dev-debug.ts +23 -0
  103. package/lib/__templates__/taro/src/presets/h5-container.tsx +15 -0
  104. package/lib/__templates__/taro/src/presets/h5-navbar.tsx +201 -0
  105. package/lib/__templates__/taro/src/presets/h5-styles.ts +142 -0
  106. package/lib/__templates__/taro/src/presets/index.tsx +18 -0
  107. package/lib/__templates__/taro/stylelint.config.mjs +4 -0
  108. package/lib/__templates__/taro/template.config.js +68 -0
  109. package/lib/__templates__/taro/tsconfig.json +29 -0
  110. package/lib/__templates__/taro/types/global.d.ts +32 -0
  111. package/lib/__templates__/templates.json +75 -0
  112. package/lib/__templates__/vite/README.md +189 -11
  113. package/lib/__templates__/vite/_gitignore +1 -0
  114. package/lib/__templates__/vite/eslint.config.mjs +6 -1
  115. package/lib/__templates__/vite/package.json +20 -3
  116. package/lib/__templates__/vite/pnpm-lock.yaml +944 -1551
  117. package/lib/__templates__/vite/scripts/build.sh +4 -1
  118. package/lib/__templates__/vite/scripts/dev.sh +2 -2
  119. package/lib/__templates__/vite/scripts/start.sh +3 -3
  120. package/lib/__templates__/vite/server/index.ts +57 -0
  121. package/lib/__templates__/vite/server/routes/index.ts +31 -0
  122. package/lib/__templates__/vite/server/vite.ts +79 -0
  123. package/lib/__templates__/vite/src/main.ts +17 -47
  124. package/lib/__templates__/vite/template.config.js +49 -14
  125. package/lib/__templates__/vite/tsconfig.json +4 -3
  126. package/lib/__templates__/vite/vite.config.ts +1 -0
  127. package/lib/cli.js +651 -173
  128. package/package.json +7 -3
@@ -8,7 +8,10 @@ cd "${COZE_WORKSPACE_PATH}"
8
8
  echo "Installing dependencies..."
9
9
  pnpm install --prefer-frozen-lockfile --prefer-offline --loglevel debug --reporter=append-only
10
10
 
11
- echo "Building the project..."
11
+ echo "Building frontend with Vite..."
12
12
  npx vite build
13
13
 
14
+ echo "Bundling server with tsup..."
15
+ npx tsup server/index.ts --format cjs --platform node --target node20 --outDir dist-server --no-splitting --no-minify --external vite
16
+
14
17
  echo "Build completed successfully!"
@@ -27,6 +27,6 @@ kill_port_if_listening() {
27
27
 
28
28
  echo "Clearing port ${PORT} before start."
29
29
  kill_port_if_listening
30
- echo "Starting HTTP service on port ${PORT} for dev..."
30
+ echo "Starting Koa + Vite dev server on port ${PORT}..."
31
31
 
32
- npx vite --port $PORT
32
+ PORT=$PORT npx tsx watch server/index.ts
@@ -7,9 +7,9 @@ DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-$PORT}"
7
7
 
8
8
  start_service() {
9
9
  cd "${COZE_WORKSPACE_PATH}"
10
- echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for deploy..."
11
- npx vite preview --port $DEPLOY_RUN_PORT
10
+ echo "Starting Koa production server on port ${DEPLOY_RUN_PORT}..."
11
+ PORT=$DEPLOY_RUN_PORT node dist-server/index.js
12
12
  }
13
13
 
14
- echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for deploy..."
14
+ echo "Starting Koa production server on port ${DEPLOY_RUN_PORT}..."
15
15
  start_service
@@ -0,0 +1,57 @@
1
+ import Koa from 'koa';
2
+ import bodyParser from 'koa-bodyparser';
3
+ import router from './routes/index';
4
+ import { setupVite } from './vite';
5
+
6
+ const isDev = process.env.COZE_PROJECT_ENV !== 'PROD';
7
+
8
+ async function createServer() {
9
+ const app = new Koa();
10
+
11
+ // 全局错误处理
12
+ app.use(async (ctx, next) => {
13
+ try {
14
+ await next();
15
+ } catch (err) {
16
+ console.error('Server error:', err);
17
+ const status =
18
+ err instanceof Error && 'status' in err
19
+ ? (err as { status?: number }).status || 500
20
+ : 500;
21
+ ctx.status = status;
22
+ ctx.body = {
23
+ error: err instanceof Error ? err.message : 'Internal server error',
24
+ };
25
+ }
26
+ });
27
+
28
+ // 请求日志(仅开发环境)
29
+ if (isDev) {
30
+ app.use(async (ctx, next) => {
31
+ const start = Date.now();
32
+ await next();
33
+ const ms = Date.now() - start;
34
+ console.log(`${ctx.method} ${ctx.url} - ${ms}ms`);
35
+ });
36
+ }
37
+
38
+ // 添加请求体解析
39
+ app.use(bodyParser());
40
+
41
+ // 注册 API 路由
42
+ app.use(router.routes()).use(router.allowedMethods());
43
+
44
+ // 集成 Vite(开发模式)或静态文件服务(生产模式)
45
+ await setupVite(app);
46
+
47
+ const port = process.env.PORT || <%= port %>;
48
+ app.listen(port, () => {
49
+ console.log(`\n✨ Server running at http://localhost:${port}`);
50
+ console.log(`📝 Environment: ${isDev ? 'development' : 'production'}\n`);
51
+ });
52
+ }
53
+
54
+ createServer().catch((err) => {
55
+ console.error('Failed to start server:', err);
56
+ process.exit(1);
57
+ });
@@ -0,0 +1,31 @@
1
+ import Router from '@koa/router';
2
+
3
+ const router = new Router();
4
+
5
+ // API 路由示例
6
+ router.get('/api/hello', async ctx => {
7
+ ctx.body = {
8
+ message: 'Hello from Koa + Vite!',
9
+ timestamp: new Date().toISOString(),
10
+ };
11
+ });
12
+
13
+ router.post('/api/data', async ctx => {
14
+ const requestData = ctx.request.body;
15
+ ctx.body = {
16
+ success: true,
17
+ data: requestData,
18
+ receivedAt: new Date().toISOString(),
19
+ };
20
+ });
21
+
22
+ // 健康检查接口
23
+ router.get('/api/health', async ctx => {
24
+ ctx.body = {
25
+ status: 'ok',
26
+ env: process.env.COZE_PROJECT_ENV,
27
+ timestamp: new Date().toISOString(),
28
+ };
29
+ });
30
+
31
+ export default router;
@@ -0,0 +1,79 @@
1
+ import type Koa from 'koa';
2
+ import serve from 'koa-static';
3
+ import path from 'path';
4
+ import fs from 'fs';
5
+
6
+ const isDev = process.env.COZE_PROJECT_ENV !== 'PROD';
7
+
8
+ /**
9
+ * 集成 Vite 开发服务器(中间件模式)
10
+ * 使用动态 import 避免在生产构建时打包 vite
11
+ */
12
+ export async function setupViteMiddleware(app: Koa) {
13
+ // 动态导入 vite,只在开发环境运行时加载
14
+ const { createServer: createViteServer } = await import('vite');
15
+
16
+ const vite = await createViteServer({
17
+ server: {
18
+ middlewareMode: true,
19
+ hmr: {
20
+ port: process.env.HMR_PORT ? parseInt(process.env.HMR_PORT) : undefined,
21
+ overlay: true,
22
+ },
23
+ },
24
+ appType: 'spa',
25
+ });
26
+
27
+ // 将 Vite middleware 转换为 Koa middleware
28
+ app.use(async ctx => {
29
+ await new Promise<void>((resolve, reject) => {
30
+ vite.middlewares(ctx.req, ctx.res, (err?: Error) => {
31
+ if (err) {
32
+ reject(err);
33
+ } else {
34
+ resolve();
35
+ }
36
+ });
37
+ });
38
+ });
39
+
40
+ console.log('🚀 Vite dev server initialized');
41
+ }
42
+
43
+ /**
44
+ * 设置生产环境静态文件服务
45
+ */
46
+ export function setupStaticServer(app: Koa) {
47
+ // 在 CommonJS 编译后,__dirname 会自动可用
48
+ // 在 TypeScript 中,我们使用相对于当前文件的路径
49
+ const distPath = path.resolve(process.cwd(), 'dist');
50
+
51
+ if (!fs.existsSync(distPath)) {
52
+ console.error('❌ dist folder not found. Please run "pnpm build" first.');
53
+ process.exit(1);
54
+ }
55
+
56
+ // 服务静态文件
57
+ app.use(serve(distPath));
58
+
59
+ // SPA fallback - 所有非 API 请求返回 index.html
60
+ app.use(async ctx => {
61
+ if (!ctx.path.startsWith('/api')) {
62
+ ctx.type = 'html';
63
+ ctx.body = fs.createReadStream(path.join(distPath, 'index.html'));
64
+ }
65
+ });
66
+
67
+ console.log('📦 Serving static files from dist/');
68
+ }
69
+
70
+ /**
71
+ * 根据环境设置 Vite
72
+ */
73
+ export async function setupVite(app: Koa) {
74
+ if (isDev) {
75
+ await setupViteMiddleware(app);
76
+ } else {
77
+ setupStaticServer(app);
78
+ }
79
+ }
@@ -7,56 +7,26 @@ export function initApp(): void {
7
7
  }
8
8
 
9
9
  app.innerHTML = `
10
- <div class="flex min-h-screen items-center justify-center bg-white text-black transition-colors duration-300 dark:bg-black dark:text-white">
11
- <!-- 主容器 -->
12
- <main class="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between px-16 py-32 sm:items-start">
13
- <!-- 头部:Logo 和 产品名称 -->
14
- <div class="flex items-center gap-3">
10
+ <div class="flex h-full items-center justify-center bg-background text-foreground transition-colors duration-300 dark:bg-background dark:text-foreground overflow-hidden min-h-screen">
11
+ <main class="flex w-full h-full max-w-3xl flex-col items-center justify-center px-16 py-32 sm:items-center">
12
+ <div class="flex flex-col items-center justify-between gap-4">
15
13
  <img
16
- src="https://lf-coze-web-cdn.coze.cn/obj/eden-cn/lm-lgvj/ljhwZthlaukjlkulzlp/favicon.svg"
14
+ src="https://lf-coze-web-cdn.coze.cn/obj/eden-cn/lm-lgvj/ljhwZthlaukjlkulzlp/coze-coding/icon/coze-coding.gif"
17
15
  alt="扣子编程 Logo"
18
- width="40"
19
- height="40"
20
- style="width: 40px; height: 40px; object-fit: contain;"
16
+ width={156}
17
+ height={130}
18
+ style="width: 156px; height: 130px; object-fit: contain;"
21
19
  />
22
- <span class="text-xl font-bold tracking-tight text-black dark:text-zinc-50">
23
- 扣子编程
24
- </span>
25
- </div>
26
-
27
- <!-- 中间内容区:主标题和副标题 -->
28
- <div class="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left">
29
- <h1 class="max-w-xl text-4xl font-semibold leading-tight tracking-tight text-black dark:text-zinc-50">
30
- 扣子编程,你的 AI 开发伙伴已就位
31
- </h1>
32
- <p class="max-w-2xl text-lg leading-8 text-zinc-600 dark:text-zinc-400">
33
- 当前是空白入口文件,项目正在开发中,请稍候...
34
- <br />
35
- 开发完成后界面将自动更新。如未自动更新成功,可以手动点击右上角刷新或重启按钮查看效果。
36
- </p>
37
- </div>
38
-
39
- <!-- 底部按钮区 -->
40
- <div class="flex w-full flex-col gap-4 text-base font-medium sm:w-auto sm:flex-row">
41
- <!-- 按钮 1:前往首页 -->
42
- <a
43
- class="flex h-12 w-full min-w-[160px] items-center justify-center gap-2 rounded-full bg-black px-8 text-white transition-colors hover:bg-zinc-800 dark:bg-white dark:text-black dark:hover:bg-zinc-200 md:w-auto"
44
- href="https://code.coze.cn/"
45
- target="_blank"
46
- rel="noopener noreferrer"
47
- >
48
- 前往首页
49
- </a>
50
-
51
- <!-- 按钮 2:查看文档 -->
52
- <a
53
- class="flex h-12 w-full min-w-[160px] items-center justify-center rounded-full border border-solid border-black/[.08] px-8 transition-colors hover:border-transparent hover:bg-black/[.04] dark:border-white/[.145] dark:hover:bg-[#1a1a1a] md:w-auto"
54
- href="https://docs.coze.cn/"
55
- target="_blank"
56
- rel="noopener noreferrer"
57
- >
58
- 查看文档
59
- </a>
20
+ <div>
21
+ <div class="flex flex-col items-center gap-2 text-center sm:items-center sm:text-center">
22
+ <h1 class="max-w-xl text-base font-semibold leading-tight tracking-tight text-foreground dark:text-foreground">
23
+ 应用开发中
24
+ </h1>
25
+ <p class="max-w-2xl text-sm-14 leading-8 text-muted-foreground dark:text-muted-foreground">
26
+ 请稍后,页面即将呈现
27
+ </p>
28
+ </div>
29
+ </div>
60
30
  </div>
61
31
  </main>
62
32
  </div>
@@ -1,6 +1,7 @@
1
1
 
2
-
3
- import { resolve } from 'path';
2
+ import { spawn } from 'child_process';
3
+ import { resolve, join, basename } from 'path';
4
+ import { appendFileSync, openSync, closeSync, mkdirSync } from 'fs';
4
5
 
5
6
 
6
7
 
@@ -59,32 +60,66 @@ const config = {
59
60
  return context;
60
61
  },
61
62
 
62
- onAfterRender: async (context, outputPath) => {
63
+ onAfterRender: async (_context, outputPath) => {
63
64
  console.log(`\nProject created at: ${outputPath}`);
64
65
  console.log('\nConfiguration:');
65
66
  console.log(' - Framework: vite');
66
67
  console.log(' - TypeScript: enabled');
67
68
  console.log(' - App Router: enabled');
68
- console.log(` - Port: ${context.port}`);
69
+ console.log(` - Port: ${_context.port}`);
70
+ },
69
71
 
70
- // Skip pnpm add in test environment to avoid monorepo workspace issues
72
+ onComplete: async (_context, outputPath) => {
73
+ // Skip pnpm update in test environment to avoid monorepo workspace issues
71
74
  if (process.env.NODE_ENV === 'test') {
72
75
  console.log('⊘ Skipping dependency update in test environment');
73
76
  return;
74
77
  }
75
78
 
76
- const cmd = `pnpm add coze-coding-dev-sdk@"^0.7.0"`;
77
- console.log(`${cmd}`);
79
+ const cmd = 'pnpm';
80
+ const args = ['update', 'coze-coding-dev-sdk@^0.7.0'];
81
+ console.log(
82
+ `\nTriggering: ${cmd} ${args.join(' ')} (running in background)`,
83
+ );
84
+
78
85
  try {
79
86
  const projectRoot = resolve(outputPath);
80
- // execSync(cmd, {
81
- // cwd: projectRoot,
82
- // stdio: 'inherit',
83
- // });
84
- console.log('✓ coze-coding-dev-sdk updated successfully');
87
+
88
+ // Determine log directory
89
+ const logDir = process.env.COZE_LOG_DIR || resolve(__dirname, '../.log');
90
+ mkdirSync(logDir, { recursive: true });
91
+
92
+ // Use project name in log file to avoid conflicts
93
+ const projectName = basename(projectRoot);
94
+ const logFile = join(logDir, `${projectName}-init.log`);
95
+
96
+ // Write log header
97
+ const timestamp = new Date().toISOString();
98
+ appendFileSync(
99
+ logFile,
100
+ `\n=== [${timestamp}] ${cmd} ${args.join(' ')} ===\n`,
101
+ );
102
+
103
+ // Open log file for appending
104
+ const logFd = openSync(logFile, 'a');
105
+
106
+ // Spawn in detached mode
107
+ const child = spawn(cmd, args, {
108
+ cwd: projectRoot,
109
+ detached: true,
110
+ stdio: ['ignore', logFd, logFd],
111
+ });
112
+
113
+ child.unref();
114
+ closeSync(logFd);
115
+
116
+ console.log(
117
+ '✓ coze-coding-dev-sdk update triggered (running in background)',
118
+ );
119
+ console.log(` Log file: ${logFile}`);
85
120
  } catch (error) {
86
- console.error('✗ Failed to update coze-coding-dev-sdk:', error);
87
- throw error;
121
+ console.error('✗ Failed to trigger coze-coding-dev-sdk update:', error);
122
+ console.log(' You can manually run: pnpm update coze-coding-dev-sdk');
88
123
  }
89
124
  },
90
125
  };
@@ -3,14 +3,15 @@
3
3
  "target": "ES2020",
4
4
  "lib": ["ES2020", "DOM", "DOM.Iterable"],
5
5
  "module": "ESNext",
6
- "moduleResolution": "bundler",
6
+ "moduleResolution": "node",
7
7
  "strict": true,
8
8
  "esModuleInterop": true,
9
9
  "skipLibCheck": true,
10
10
  "forceConsistentCasingInFileNames": true,
11
11
  "resolveJsonModule": true,
12
12
  "isolatedModules": true,
13
- "noEmit": true
13
+ "noEmit": true,
14
+ "types": ["node"]
14
15
  },
15
- "include": ["src"]
16
+ "include": ["src", "server"]
16
17
  }
@@ -4,6 +4,7 @@ export default defineConfig({
4
4
  server: {
5
5
  port: <%= port %>,
6
6
  host: '0.0.0.0',
7
+ allowedHosts: true,
7
8
  hmr: {
8
9
  overlay: true,
9
10
  path: '/hot/vite-hmr',