@coze-arch/cli 0.0.1-alpha.bd5b49 → 0.0.1-alpha.c199b3

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 (155) hide show
  1. package/README.md +1 -0
  2. package/lib/__templates__/expo/README.md +16 -13
  3. package/lib/__templates__/expo/_npmrc +1 -0
  4. package/lib/__templates__/expo/client/app/+not-found.tsx +19 -4
  5. package/lib/__templates__/expo/client/app/_layout.tsx +17 -16
  6. package/lib/__templates__/expo/client/components/Screen.tsx +2 -2
  7. package/lib/__templates__/expo/client/constants/theme.ts +177 -0
  8. package/lib/__templates__/expo/client/eslint.config.mjs +7 -0
  9. package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +48 -0
  10. package/lib/__templates__/expo/client/hooks/useTheme.ts +33 -0
  11. package/lib/__templates__/expo/client/metro.config.js +4 -8
  12. package/lib/__templates__/expo/client/package.json +1 -3
  13. package/lib/__templates__/expo/client/screens/demo/index.tsx +13 -7
  14. package/lib/__templates__/expo/client/screens/demo/styles.ts +28 -0
  15. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +10 -10
  16. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/index.js +9 -0
  17. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/rule.js +112 -0
  18. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/tech.md +94 -0
  19. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/index.js +9 -0
  20. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/rule.js +120 -0
  21. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/tech.md +58 -0
  22. package/lib/__templates__/native-static/.coze +11 -0
  23. package/lib/__templates__/native-static/index.html +33 -0
  24. package/lib/__templates__/native-static/styles/main.css +136 -0
  25. package/lib/__templates__/native-static/template.config.js +22 -0
  26. package/lib/__templates__/nextjs/AGENTS.md +54 -0
  27. package/lib/__templates__/nextjs/README.md +5 -0
  28. package/lib/__templates__/nextjs/eslint.config.mjs +5 -0
  29. package/lib/__templates__/nextjs/next.config.ts +1 -2
  30. package/lib/__templates__/nextjs/package.json +2 -5
  31. package/lib/__templates__/nextjs/pnpm-lock.yaml +1028 -5
  32. package/lib/__templates__/nextjs/scripts/build.sh +4 -1
  33. package/lib/__templates__/nextjs/scripts/dev.sh +8 -2
  34. package/lib/__templates__/nextjs/scripts/start.sh +7 -1
  35. package/lib/__templates__/nextjs/src/app/layout.tsx +1 -1
  36. package/lib/__templates__/nextjs/src/app/page.tsx +1 -2
  37. package/lib/__templates__/nextjs/src/server.ts +35 -0
  38. package/lib/__templates__/nextjs/tsconfig.json +1 -1
  39. package/lib/__templates__/nuxt-vue/.coze +12 -0
  40. package/lib/__templates__/nuxt-vue/AGENTS.md +42 -0
  41. package/lib/__templates__/nuxt-vue/README.md +73 -0
  42. package/lib/__templates__/nuxt-vue/_gitignore +24 -0
  43. package/lib/__templates__/nuxt-vue/_npmrc +23 -0
  44. package/lib/__templates__/nuxt-vue/app/app.vue +6 -0
  45. package/lib/__templates__/nuxt-vue/app/pages/index.vue +23 -0
  46. package/lib/__templates__/nuxt-vue/assets/css/main.css +24 -0
  47. package/lib/__templates__/nuxt-vue/nuxt.config.ts +116 -0
  48. package/lib/__templates__/nuxt-vue/package.json +35 -0
  49. package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +8759 -0
  50. package/lib/__templates__/nuxt-vue/postcss.config.mjs +8 -0
  51. package/lib/__templates__/nuxt-vue/public/favicon.ico +0 -0
  52. package/lib/__templates__/nuxt-vue/public/robots.txt +2 -0
  53. package/lib/__templates__/nuxt-vue/scripts/build.sh +14 -0
  54. package/lib/__templates__/nuxt-vue/scripts/dev.sh +39 -0
  55. package/lib/__templates__/nuxt-vue/scripts/prepare.sh +14 -0
  56. package/lib/__templates__/nuxt-vue/scripts/start.sh +21 -0
  57. package/lib/__templates__/nuxt-vue/server/api/hello.ts +10 -0
  58. package/lib/__templates__/nuxt-vue/server/middleware/logger.ts +10 -0
  59. package/lib/__templates__/nuxt-vue/server/routes/health.ts +10 -0
  60. package/lib/__templates__/nuxt-vue/tailwind.config.js +13 -0
  61. package/lib/__templates__/nuxt-vue/template.config.js +87 -0
  62. package/lib/__templates__/nuxt-vue/tsconfig.json +18 -0
  63. package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +107 -36
  64. package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +24 -1
  65. package/lib/__templates__/taro/README.md +61 -45
  66. package/lib/__templates__/taro/config/index.ts +106 -41
  67. package/lib/__templates__/taro/config/prod.ts +4 -5
  68. package/lib/__templates__/taro/eslint.config.mjs +82 -4
  69. package/lib/__templates__/taro/package.json +22 -7
  70. package/lib/__templates__/taro/patches/@tarojs__plugin-mini-ci@4.1.9.patch +30 -0
  71. package/lib/__templates__/taro/pnpm-lock.yaml +924 -220
  72. package/lib/__templates__/taro/server/package.json +0 -1
  73. package/lib/__templates__/taro/src/app.css +140 -36
  74. package/lib/__templates__/taro/src/app.tsx +9 -0
  75. package/lib/__templates__/taro/src/components/ui/accordion.tsx +159 -0
  76. package/lib/__templates__/taro/src/components/ui/alert-dialog.tsx +260 -0
  77. package/lib/__templates__/taro/src/components/ui/alert.tsx +60 -0
  78. package/lib/__templates__/taro/src/components/ui/aspect-ratio.tsx +36 -0
  79. package/lib/__templates__/taro/src/components/ui/avatar.tsx +84 -0
  80. package/lib/__templates__/taro/src/components/ui/badge.tsx +37 -0
  81. package/lib/__templates__/taro/src/components/ui/breadcrumb.tsx +117 -0
  82. package/lib/__templates__/taro/src/components/ui/button-group.tsx +83 -0
  83. package/lib/__templates__/taro/src/components/ui/button.tsx +67 -0
  84. package/lib/__templates__/taro/src/components/ui/calendar.tsx +394 -0
  85. package/lib/__templates__/taro/src/components/ui/card.tsx +108 -0
  86. package/lib/__templates__/taro/src/components/ui/carousel.tsx +228 -0
  87. package/lib/__templates__/taro/src/components/ui/checkbox.tsx +58 -0
  88. package/lib/__templates__/taro/src/components/ui/code-block.tsx +169 -0
  89. package/lib/__templates__/taro/src/components/ui/collapsible.tsx +71 -0
  90. package/lib/__templates__/taro/src/components/ui/command.tsx +385 -0
  91. package/lib/__templates__/taro/src/components/ui/context-menu.tsx +614 -0
  92. package/lib/__templates__/taro/src/components/ui/dialog.tsx +256 -0
  93. package/lib/__templates__/taro/src/components/ui/drawer.tsx +192 -0
  94. package/lib/__templates__/taro/src/components/ui/dropdown-menu.tsx +561 -0
  95. package/lib/__templates__/taro/src/components/ui/field.tsx +228 -0
  96. package/lib/__templates__/taro/src/components/ui/hover-card.tsx +282 -0
  97. package/lib/__templates__/taro/src/components/ui/input-group.tsx +197 -0
  98. package/lib/__templates__/taro/src/components/ui/input-otp.tsx +136 -0
  99. package/lib/__templates__/taro/src/components/ui/input.tsx +56 -0
  100. package/lib/__templates__/taro/src/components/ui/label.tsx +24 -0
  101. package/lib/__templates__/taro/src/components/ui/menubar.tsx +595 -0
  102. package/lib/__templates__/taro/src/components/ui/navigation-menu.tsx +264 -0
  103. package/lib/__templates__/taro/src/components/ui/pagination.tsx +118 -0
  104. package/lib/__templates__/taro/src/components/ui/popover.tsx +291 -0
  105. package/lib/__templates__/taro/src/components/ui/portal.tsx +19 -0
  106. package/lib/__templates__/taro/src/components/ui/progress.tsx +28 -0
  107. package/lib/__templates__/taro/src/components/ui/radio-group.tsx +64 -0
  108. package/lib/__templates__/taro/src/components/ui/resizable.tsx +346 -0
  109. package/lib/__templates__/taro/src/components/ui/scroll-area.tsx +34 -0
  110. package/lib/__templates__/taro/src/components/ui/select.tsx +438 -0
  111. package/lib/__templates__/taro/src/components/ui/separator.tsx +30 -0
  112. package/lib/__templates__/taro/src/components/ui/sheet.tsx +262 -0
  113. package/lib/__templates__/taro/src/components/ui/skeleton.tsx +17 -0
  114. package/lib/__templates__/taro/src/components/ui/slider.tsx +203 -0
  115. package/lib/__templates__/taro/src/components/ui/sonner.tsx +1 -0
  116. package/lib/__templates__/taro/src/components/ui/switch.tsx +55 -0
  117. package/lib/__templates__/taro/src/components/ui/table.tsx +142 -0
  118. package/lib/__templates__/taro/src/components/ui/tabs.tsx +114 -0
  119. package/lib/__templates__/taro/src/components/ui/textarea.tsx +54 -0
  120. package/lib/__templates__/taro/src/components/ui/toast.tsx +517 -0
  121. package/lib/__templates__/taro/src/components/ui/toggle-group.tsx +120 -0
  122. package/lib/__templates__/taro/src/components/ui/toggle.tsx +77 -0
  123. package/lib/__templates__/taro/src/components/ui/tooltip.tsx +455 -0
  124. package/lib/__templates__/taro/src/lib/hooks/use-keyboard-offset.ts +37 -0
  125. package/lib/__templates__/taro/src/lib/measure.ts +115 -0
  126. package/lib/__templates__/taro/src/lib/platform.ts +12 -0
  127. package/lib/__templates__/taro/src/lib/utils.ts +6 -0
  128. package/lib/__templates__/taro/src/presets/dev-debug.ts +23 -0
  129. package/lib/__templates__/taro/src/presets/h5-container.tsx +15 -0
  130. package/lib/__templates__/taro/src/presets/h5-navbar.tsx +238 -0
  131. package/lib/__templates__/taro/src/presets/h5-styles.ts +220 -0
  132. package/lib/__templates__/taro/src/presets/index.tsx +18 -0
  133. package/lib/__templates__/templates.json +43 -0
  134. package/lib/__templates__/vite/AGENTS.md +41 -0
  135. package/lib/__templates__/vite/README.md +190 -11
  136. package/lib/__templates__/vite/_gitignore +1 -0
  137. package/lib/__templates__/vite/eslint.config.mjs +6 -1
  138. package/lib/__templates__/vite/package.json +10 -3
  139. package/lib/__templates__/vite/pnpm-lock.yaml +755 -15
  140. package/lib/__templates__/vite/scripts/build.sh +4 -1
  141. package/lib/__templates__/vite/scripts/dev.sh +9 -2
  142. package/lib/__templates__/vite/scripts/start.sh +9 -3
  143. package/lib/__templates__/vite/server/routes/index.ts +31 -0
  144. package/lib/__templates__/vite/server/server.ts +65 -0
  145. package/lib/__templates__/vite/server/vite.ts +67 -0
  146. package/lib/__templates__/vite/tsconfig.json +4 -3
  147. package/lib/__templates__/vite/vite.config.ts +5 -0
  148. package/lib/cli.js +3037 -535
  149. package/package.json +10 -3
  150. package/lib/__templates__/expo/client/global.css +0 -78
  151. package/lib/__templates__/expo/client/styles.css +0 -263
  152. package/lib/__templates__/expo/client/uniwind-types.d.ts +0 -10
  153. package/lib/__templates__/taro/src/app.ts +0 -14
  154. package/lib/__templates__/taro/src/utils/h5-styles.ts +0 -33
  155. package/lib/__templates__/taro/src/utils/wx-debug.ts +0 -23
@@ -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 the Next.js project..."
12
12
  npx next build
13
13
 
14
+ echo "Bundling server with tsup..."
15
+ npx tsup src/server.ts --format cjs --platform node --target node20 --outDir dist --no-splitting --no-minify
16
+
14
17
  echo "Build completed successfully!"
@@ -1,10 +1,16 @@
1
1
  #!/bin/bash
2
2
  set -Eeuo pipefail
3
3
 
4
+ <% if (process.env.NODE_ENV === 'test') { %>
5
+ # 测试环境:支持环境变量覆盖端口
6
+ PORT="${PORT:-<%= port %>}"
7
+ COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
8
+ DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-${PORT}}"
9
+ <% } else { %>
4
10
  PORT=<%= port %>
5
11
  COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
6
- NODE_ENV=development
7
12
  DEPLOY_RUN_PORT=<%= port %>
13
+ <% } %>
8
14
 
9
15
  cd "${COZE_WORKSPACE_PATH}"
10
16
 
@@ -30,4 +36,4 @@ echo "Clearing port ${PORT} before start."
30
36
  kill_port_if_listening
31
37
  echo "Starting HTTP service on port ${PORT} for dev..."
32
38
 
33
- npx next dev --webpack --port $PORT
39
+ PORT=$PORT npx tsx watch src/server.ts
@@ -2,13 +2,19 @@
2
2
  set -Eeuo pipefail
3
3
 
4
4
  COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
5
+ <% if (process.env.NODE_ENV === 'test') { %>
6
+ # 测试环境:支持环境变量覆盖端口
7
+ PORT="${PORT:-<%= port %>}"
8
+ DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-${PORT}}"
9
+ <% } else { %>
5
10
  PORT=<%= port %>
6
11
  DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-$PORT}"
12
+ <% } %>
7
13
 
8
14
  start_service() {
9
15
  cd "${COZE_WORKSPACE_PATH}"
10
16
  echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for deploy..."
11
- npx next start --port ${DEPLOY_RUN_PORT}
17
+ PORT=${DEPLOY_RUN_PORT} node dist/server.js
12
18
  }
13
19
 
14
20
  echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for deploy..."
@@ -61,7 +61,7 @@ export default function RootLayout({
61
61
  }: Readonly<{
62
62
  children: React.ReactNode;
63
63
  }>) {
64
- const isDev = process.env.NODE_ENV === 'development';
64
+ const isDev = process.env.COZE_PROJECT_ENV === 'DEV';
65
65
 
66
66
  return (
67
67
  <html lang="en">
@@ -13,7 +13,6 @@ export default function Home() {
13
13
  <main className="flex w-full h-full max-w-3xl flex-col items-center justify-center px-16 py-32 sm:items-center">
14
14
  <div className="flex flex-col items-center justify-between gap-4">
15
15
  <Image
16
- className="dark:invert"
17
16
  src="https://lf-coze-web-cdn.coze.cn/obj/eden-cn/lm-lgvj/ljhwZthlaukjlkulzlp/coze-coding/icon/coze-coding.gif"
18
17
  alt="扣子编程 Logo"
19
18
  width={156}
@@ -24,7 +23,7 @@ export default function Home() {
24
23
  <h1 className="max-w-xl text-base font-semibold leading-tight tracking-tight text-foreground dark:text-foreground">
25
24
  应用开发中
26
25
  </h1>
27
- <p className="max-w-2xl text-sm-14 leading-8 text-muted-foreground dark:text-muted-foreground">
26
+ <p className="max-w-2xl text-sm leading-8 text-muted-foreground dark:text-muted-foreground">
28
27
  请稍后,页面即将呈现
29
28
  </p>
30
29
  </div>
@@ -0,0 +1,35 @@
1
+ import { createServer } from 'http';
2
+ import { parse } from 'url';
3
+ import next from 'next';
4
+
5
+ const dev = process.env.COZE_PROJECT_ENV !== 'PROD';
6
+ const hostname = process.env.HOSTNAME || 'localhost';
7
+ const port = parseInt(process.env.PORT || '<%= port %>', 10);
8
+
9
+ // Create Next.js app
10
+ const app = next({ dev, hostname, port });
11
+ const handle = app.getRequestHandler();
12
+
13
+ app.prepare().then(() => {
14
+ const server = createServer(async (req, res) => {
15
+ try {
16
+ const parsedUrl = parse(req.url!, true);
17
+ await handle(req, res, parsedUrl);
18
+ } catch (err) {
19
+ console.error('Error occurred handling', req.url, err);
20
+ res.statusCode = 500;
21
+ res.end('Internal server error');
22
+ }
23
+ });
24
+ server.once('error', err => {
25
+ console.error(err);
26
+ process.exit(1);
27
+ });
28
+ server.listen(port, () => {
29
+ console.log(
30
+ `> Server listening at http://${hostname}:${port} as ${
31
+ dev ? 'development' : process.env.COZE_PROJECT_ENV
32
+ }`,
33
+ );
34
+ });
35
+ });
@@ -30,5 +30,5 @@
30
30
  ".next/dev/types/**/*.ts",
31
31
  "**/*.mts"
32
32
  ],
33
- "exclude": ["node_modules"]
33
+ "exclude": ["node_modules", "dist"]
34
34
  }
@@ -0,0 +1,12 @@
1
+ [project]
2
+ requires = ["nodejs-24"]
3
+
4
+ [dev]
5
+ build = ["bash", "./scripts/prepare.sh"]
6
+ run = ["bash", "./scripts/dev.sh"]
7
+ deps = ["git"] # -> apt install git
8
+
9
+ [deploy]
10
+ build = ["bash","./scripts/build.sh"]
11
+ run = ["bash","./scripts/start.sh"]
12
+ deps = ["git"] # -> apt install git
@@ -0,0 +1,42 @@
1
+ # 项目上下文
2
+
3
+ ## 技术栈
4
+
5
+ - **核心**: Nuxt 4, Vue 3, TypeScript
6
+ - **UI**: Tailwind CSS
7
+
8
+ ## 目录结构
9
+
10
+ ```
11
+ ├── app/ # 页面路由与布局
12
+ │ ├── pages/ # 页面组件
13
+ │ └── app.vue # 根组件
14
+ ├── assets/ # 静态资源
15
+ │ └── css/ # 全局样式
16
+ ├── public/ # 公共静态资源
17
+ ├── scripts/ # 构建与启动脚本
18
+ │ ├── build.sh # 构建脚本
19
+ │ ├── dev.sh # 开发环境启动脚本
20
+ │ ├── prepare.sh # 预处理脚本
21
+ │ └── start.sh # 生产环境启动脚本
22
+ ├── server/ # 服务端逻辑
23
+ │ ├── api/ # API 路由
24
+ │ ├── middleware/ # 中间件
25
+ │ └── routes/ # 服务端路由
26
+ ├── nuxt.config.ts # Nuxt 配置
27
+ ├── package.json # 项目依赖管理
28
+ └── tsconfig.json # TypeScript 配置
29
+ ```
30
+
31
+ ## 包管理规范
32
+
33
+ **仅允许使用 pnpm** 作为包管理器,**严禁使用 npm 或 yarn**。
34
+ **常用命令**:
35
+ - 安装依赖:`pnpm add <package>`
36
+ - 安装开发依赖:`pnpm add -D <package>`
37
+ - 安装所有依赖:`pnpm install`
38
+ - 移除依赖:`pnpm remove <package>`
39
+
40
+ ## 开发规范
41
+
42
+ - 使用 Tailwind CSS 进行样式开发
@@ -0,0 +1,73 @@
1
+ # <%= appName %>
2
+
3
+ Nuxt.js full-stack application with server-side API capabilities, Vue 3, and Vite.
4
+
5
+ ## Features
6
+
7
+ - 🚀 **Nuxt 4**: Latest Nuxt.js framework
8
+ - ⚡️ **Vite**: Lightning-fast development and build
9
+ - 🎨 **Vue 3**: Composition API and modern Vue features
10
+ - 🔥 **Server API**: Built-in server routes for backend logic
11
+ - 📁 **File-based Routing**: Automatic routing from file structure
12
+ - 🔧 **TypeScript**: Full TypeScript support
13
+ - 🛠️ **DevTools**: Nuxt DevTools enabled
14
+
15
+ ## Setup
16
+
17
+ This project uses pnpm as the package manager. Make sure to install dependencies:
18
+
19
+ ```bash
20
+ pnpm install
21
+ ```
22
+
23
+ ## Development
24
+
25
+ Start the development server on `http://localhost:<%= port %>`:
26
+
27
+ ```bash
28
+ pnpm dev
29
+ ```
30
+
31
+ The server will automatically restart when you make changes to your code.
32
+
33
+ ## Production
34
+
35
+ Build the application for production:
36
+
37
+ ```bash
38
+ pnpm build
39
+ ```
40
+
41
+ Start the production server:
42
+
43
+ ```bash
44
+ pnpm start
45
+ ```
46
+
47
+ ## Project Structure
48
+
49
+ ```
50
+ <%= appName %>/
51
+ ├── app/ # Application source code
52
+ │ ├── app.vue # Root component
53
+ │ ├── components/ # Vue components
54
+ │ └── layouts/ # Layout components
55
+ ├── server/ # Server-side code (optional)
56
+ │ ├── api/ # API endpoints
57
+ │ └── middleware/ # Server middleware
58
+ ├── public/ # Static assets
59
+ ├── assets/ # CSS and other assets
60
+ ├── nuxt.config.ts # Nuxt configuration
61
+ └── package.json # Project dependencies
62
+ ```
63
+
64
+ ## Server API (Optional)
65
+
66
+ You can add server API by creating files in `server/api/` directory. See [server/README.md](./server/README.md) for more details.
67
+
68
+ ## Learn More
69
+
70
+ - [Nuxt Documentation](https://nuxt.com/docs)
71
+ - [Vue 3 Documentation](https://vuejs.org/)
72
+ - [Vite Documentation](https://vitejs.dev/)
73
+ - [Deployment Guide](https://nuxt.com/docs/getting-started/deployment)
@@ -0,0 +1,24 @@
1
+ # Nuxt dev/build outputs
2
+ .output
3
+ .data
4
+ .nuxt
5
+ .nitro
6
+ .cache
7
+ dist
8
+
9
+ # Node dependencies
10
+ node_modules
11
+
12
+ # Logs
13
+ logs
14
+ *.log
15
+
16
+ # Misc
17
+ .DS_Store
18
+ .fleet
19
+ .idea
20
+
21
+ # Local env files
22
+ .env
23
+ .env.*
24
+ !.env.example
@@ -0,0 +1,23 @@
1
+ loglevel=error
2
+ registry=https://registry.npmmirror.com
3
+
4
+ strictStorePkgContentCheck=false
5
+ verifyStoreIntegrity=false
6
+
7
+ # 网络优化
8
+ network-concurrency=16
9
+ fetch-retries=3
10
+ fetch-timeout=60000
11
+
12
+ # 严格使用 peer dependencies
13
+ strict-peer-dependencies=false
14
+
15
+ # 自动生成 lockfile
16
+ auto-install-peers=true
17
+
18
+ # lockfile 配置
19
+ lockfile=true
20
+ prefer-frozen-lockfile=true
21
+
22
+ # 如果 lockfile 存在但过期,更新而不是失败
23
+ resolution-mode=highest
@@ -0,0 +1,6 @@
1
+ <template>
2
+ <div>
3
+ <NuxtRouteAnnouncer />
4
+ <NuxtPage />
5
+ </div>
6
+ </template>
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <div class="flex min-h-screen items-center justify-center">
3
+ <main class="flex w-full max-w-3xl flex-col items-center justify-center px-16 py-32">
4
+ <div class="flex flex-col items-center gap-4">
5
+ <img
6
+ src="https://lf-coze-web-cdn.coze.cn/obj/eden-cn/lm-lgvj/ljhwZthlaukjlkulzlp/coze-coding/icon/coze-coding.gif"
7
+ alt="扣子编程 Logo"
8
+ width="156"
9
+ height="130"
10
+ style="width: 156px; height: 130px; object-fit: contain"
11
+ />
12
+ <div class="flex flex-col items-center gap-2 text-center">
13
+ <h1 class="max-w-xl text-base font-semibold leading-tight tracking-tight">
14
+ 应用开发中
15
+ </h1>
16
+ <p class="max-w-2xl text-sm leading-8 opacity-70">
17
+ 请稍后,页面即将呈现
18
+ </p>
19
+ </div>
20
+ </div>
21
+ </main>
22
+ </div>
23
+ </template>
@@ -0,0 +1,24 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ :root {
6
+ --background: #ffffff;
7
+ --foreground: #000000;
8
+ --muted-foreground: #6b7280;
9
+ }
10
+
11
+ @media (prefers-color-scheme: dark) {
12
+ :root {
13
+ --background: #000000;
14
+ --foreground: #ffffff;
15
+ --muted-foreground: #9ca3af;
16
+ }
17
+ }
18
+
19
+ body {
20
+ margin: 0;
21
+ padding: 0;
22
+ background: var(--background);
23
+ color: var(--foreground);
24
+ }
@@ -0,0 +1,116 @@
1
+ // https://nuxt.com/docs/api/configuration/nuxt-config
2
+ import { fileURLToPath } from 'url';
3
+ import { dirname, resolve } from 'path';
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+
8
+ export default defineNuxtConfig({
9
+ compatibilityDate: '2025-07-15',
10
+ devtools: { enabled: true },
11
+ telemetry: false,
12
+
13
+ // App head configuration
14
+ app: {
15
+ head: {
16
+ title: '新应用 | 扣子编程',
17
+ titleTemplate: '%s | 扣子编程',
18
+ meta: [
19
+ { charset: 'utf-8' },
20
+ { name: 'viewport', content: 'width=device-width, initial-scale=1' },
21
+ {
22
+ name: 'description',
23
+ content:
24
+ '扣子编程是一款一站式云端 Vibe Coding 开发平台。通过对话轻松构建智能体、工作流和网站,实现从创意到上线的无缝衔接。',
25
+ },
26
+ {
27
+ name: 'keywords',
28
+ content:
29
+ '扣子编程,Coze Code,Vibe Coding,AI 编程,智能体搭建,工作流搭建,网站搭建,网站部署,全栈开发,AI 工程师',
30
+ },
31
+ { name: 'author', content: 'Coze Code Team' },
32
+ { name: 'generator', content: 'Coze Code' },
33
+ // Open Graph
34
+ { property: 'og:title', content: '扣子编程 | 你的 AI 工程师已就位' },
35
+ {
36
+ property: 'og:description',
37
+ content:
38
+ '我正在使用扣子编程 Vibe Coding,让创意瞬间上线。告别拖拽,拥抱心流。',
39
+ },
40
+ { property: 'og:url', content: 'https://code.coze.cn' },
41
+ { property: 'og:site_name', content: '扣子编程' },
42
+ { property: 'og:locale', content: 'zh_CN' },
43
+ { property: 'og:type', content: 'website' },
44
+ // Robots
45
+ { name: 'robots', content: 'index, follow' },
46
+ ],
47
+ link: [{ rel: 'canonical', href: 'https://code.coze.cn' }],
48
+ htmlAttrs: {
49
+ lang: 'zh-CN',
50
+ },
51
+ },
52
+ },
53
+
54
+ // Nuxt modules
55
+ modules: ['@nuxt/image', '@nuxtjs/tailwindcss'],
56
+
57
+ // Global CSS
58
+ css: [resolve(__dirname, 'assets/css/main.css')],
59
+
60
+ // Development server configuration
61
+ devServer: {
62
+ port: parseInt(process.env.PORT || '<%= port %>', 10),
63
+ host: process.env.HOSTNAME || 'localhost',
64
+ },
65
+
66
+ // TypeScript configuration
67
+ typescript: {
68
+ strict: false,
69
+ typeCheck: false,
70
+ },
71
+
72
+ // Vite configuration (similar to Next.js allowedDevOrigins)
73
+ vite: {
74
+ server: {
75
+ host: '0.0.0.0',
76
+ cors: {
77
+ origin: ['*.dev.coze.site'],
78
+ credentials: true,
79
+ },
80
+ hmr: {
81
+ overlay: true,
82
+ path: '/hot/vite-hmr',
83
+ port: parseInt(process.env.HMR_PORT || '<%= hmrPort %>', 10),
84
+ clientPort: 443,
85
+ timeout: 30000,
86
+ },
87
+ },
88
+ },
89
+
90
+ // Image optimization (similar to Next.js images config)
91
+ // Using @nuxt/image module for image optimization
92
+ // https://image.nuxt.com/
93
+ image: {
94
+ domains: ['lf-coze-web-cdn.coze.cn'],
95
+ // Remote patterns configuration
96
+ remotePatterns: [
97
+ {
98
+ protocol: 'https',
99
+ hostname: 'lf-coze-web-cdn.coze.cn',
100
+ pathname: '/**',
101
+ },
102
+ ],
103
+ },
104
+
105
+ // Security headers (Content Security Policy)
106
+ nitro: {
107
+ routeRules: {
108
+ '/**': {
109
+ headers: {
110
+ 'Content-Security-Policy':
111
+ "img-src 'self' data: https://lf-coze-web-cdn.coze.cn;",
112
+ },
113
+ },
114
+ },
115
+ },
116
+ });
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "<%= appName %>",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "bash ./scripts/build.sh",
8
+ "dev": "bash ./scripts/dev.sh",
9
+ "generate": "nuxt generate",
10
+ "preinstall": "npx only-allow pnpm",
11
+ "preview": "nuxt preview",
12
+ "start": "bash ./scripts/start.sh"
13
+ },
14
+ "dependencies": {
15
+ "@nuxt/image": "^1.8.1",
16
+ "nuxt": "^4.3.1",
17
+ "tailwind-merge": "^2.6.0",
18
+ "vue": "^3.5.30",
19
+ "vue-router": "^4.6.4"
20
+ },
21
+ "devDependencies": {
22
+ "@nuxtjs/tailwindcss": "^6.14.0",
23
+ "@types/node": "^20",
24
+ "autoprefixer": "^10.4.20",
25
+ "coze-coding-dev-sdk": "^0.7.16",
26
+ "only-allow": "^1.2.2",
27
+ "postcss": "^8.4.49",
28
+ "tailwindcss": "^3.4.17",
29
+ "typescript": "^5"
30
+ },
31
+ "packageManager": "pnpm@9.0.0",
32
+ "engines": {
33
+ "pnpm": ">=9.0.0"
34
+ }
35
+ }