@coze-arch/cli 0.0.1-alpha.de5a13 → 0.0.1-alpha.deaedf

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 (143) hide show
  1. package/README.md +1 -0
  2. package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +1 -1
  3. package/lib/__templates__/expo/client/components/Screen.tsx +2 -2
  4. package/lib/__templates__/expo/client/eslint.config.mjs +7 -0
  5. package/lib/__templates__/expo/client/metro.config.js +3 -0
  6. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +10 -10
  7. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/index.js +9 -0
  8. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/rule.js +112 -0
  9. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/tech.md +94 -0
  10. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/index.js +9 -0
  11. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/rule.js +120 -0
  12. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/tech.md +58 -0
  13. package/lib/__templates__/expo/pnpm-lock.yaml +8 -5
  14. package/lib/__templates__/expo/server/package.json +1 -1
  15. package/lib/__templates__/native-static/.coze +11 -0
  16. package/lib/__templates__/native-static/index.html +33 -0
  17. package/lib/__templates__/native-static/styles/main.css +136 -0
  18. package/lib/__templates__/native-static/template.config.js +22 -0
  19. package/lib/__templates__/nextjs/.babelrc +3 -0
  20. package/lib/__templates__/nextjs/README.md +5 -0
  21. package/lib/__templates__/nextjs/eslint.config.mjs +5 -0
  22. package/lib/__templates__/nextjs/next.config.ts +1 -2
  23. package/lib/__templates__/nextjs/package.json +3 -6
  24. package/lib/__templates__/nextjs/pnpm-lock.yaml +1036 -10
  25. package/lib/__templates__/nextjs/scripts/build.sh +4 -1
  26. package/lib/__templates__/nextjs/scripts/dev.sh +8 -2
  27. package/lib/__templates__/nextjs/scripts/start.sh +7 -1
  28. package/lib/__templates__/nextjs/src/app/layout.tsx +1 -1
  29. package/lib/__templates__/nextjs/src/app/page.tsx +1 -2
  30. package/lib/__templates__/nextjs/src/server.ts +35 -0
  31. package/lib/__templates__/nextjs/tsconfig.json +1 -1
  32. package/lib/__templates__/nuxt-vue/.coze +12 -0
  33. package/lib/__templates__/nuxt-vue/README.md +73 -0
  34. package/lib/__templates__/nuxt-vue/_gitignore +24 -0
  35. package/lib/__templates__/nuxt-vue/_npmrc +23 -0
  36. package/lib/__templates__/nuxt-vue/app/app.vue +6 -0
  37. package/lib/__templates__/nuxt-vue/app/pages/index.vue +23 -0
  38. package/lib/__templates__/nuxt-vue/assets/css/main.css +24 -0
  39. package/lib/__templates__/nuxt-vue/nuxt.config.ts +116 -0
  40. package/lib/__templates__/nuxt-vue/package.json +35 -0
  41. package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +8759 -0
  42. package/lib/__templates__/nuxt-vue/postcss.config.mjs +8 -0
  43. package/lib/__templates__/nuxt-vue/public/favicon.ico +0 -0
  44. package/lib/__templates__/nuxt-vue/public/robots.txt +2 -0
  45. package/lib/__templates__/nuxt-vue/scripts/build.sh +14 -0
  46. package/lib/__templates__/nuxt-vue/scripts/dev.sh +39 -0
  47. package/lib/__templates__/nuxt-vue/scripts/prepare.sh +14 -0
  48. package/lib/__templates__/nuxt-vue/scripts/start.sh +21 -0
  49. package/lib/__templates__/nuxt-vue/server/api/hello.ts +10 -0
  50. package/lib/__templates__/nuxt-vue/server/middleware/logger.ts +10 -0
  51. package/lib/__templates__/nuxt-vue/server/routes/health.ts +10 -0
  52. package/lib/__templates__/nuxt-vue/tailwind.config.js +13 -0
  53. package/lib/__templates__/nuxt-vue/template.config.js +87 -0
  54. package/lib/__templates__/nuxt-vue/tsconfig.json +18 -0
  55. package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +107 -37
  56. package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +24 -1
  57. package/lib/__templates__/taro/README.md +138 -62
  58. package/lib/__templates__/taro/config/index.ts +105 -41
  59. package/lib/__templates__/taro/config/prod.ts +4 -5
  60. package/lib/__templates__/taro/eslint.config.mjs +82 -4
  61. package/lib/__templates__/taro/package.json +23 -7
  62. package/lib/__templates__/taro/patches/@tarojs__plugin-mini-ci@4.1.9.patch +30 -0
  63. package/lib/__templates__/taro/pnpm-lock.yaml +1198 -214
  64. package/lib/__templates__/taro/server/package.json +3 -1
  65. package/lib/__templates__/taro/src/app.css +140 -47
  66. package/lib/__templates__/taro/src/app.tsx +9 -0
  67. package/lib/__templates__/taro/src/components/ui/accordion.tsx +159 -0
  68. package/lib/__templates__/taro/src/components/ui/alert-dialog.tsx +260 -0
  69. package/lib/__templates__/taro/src/components/ui/alert.tsx +60 -0
  70. package/lib/__templates__/taro/src/components/ui/aspect-ratio.tsx +36 -0
  71. package/lib/__templates__/taro/src/components/ui/avatar.tsx +84 -0
  72. package/lib/__templates__/taro/src/components/ui/badge.tsx +37 -0
  73. package/lib/__templates__/taro/src/components/ui/breadcrumb.tsx +117 -0
  74. package/lib/__templates__/taro/src/components/ui/button-group.tsx +83 -0
  75. package/lib/__templates__/taro/src/components/ui/button.tsx +67 -0
  76. package/lib/__templates__/taro/src/components/ui/calendar.tsx +394 -0
  77. package/lib/__templates__/taro/src/components/ui/card.tsx +108 -0
  78. package/lib/__templates__/taro/src/components/ui/carousel.tsx +228 -0
  79. package/lib/__templates__/taro/src/components/ui/checkbox.tsx +58 -0
  80. package/lib/__templates__/taro/src/components/ui/code-block.tsx +169 -0
  81. package/lib/__templates__/taro/src/components/ui/collapsible.tsx +71 -0
  82. package/lib/__templates__/taro/src/components/ui/command.tsx +385 -0
  83. package/lib/__templates__/taro/src/components/ui/context-menu.tsx +614 -0
  84. package/lib/__templates__/taro/src/components/ui/dialog.tsx +256 -0
  85. package/lib/__templates__/taro/src/components/ui/drawer.tsx +192 -0
  86. package/lib/__templates__/taro/src/components/ui/dropdown-menu.tsx +561 -0
  87. package/lib/__templates__/taro/src/components/ui/field.tsx +228 -0
  88. package/lib/__templates__/taro/src/components/ui/hover-card.tsx +282 -0
  89. package/lib/__templates__/taro/src/components/ui/input-group.tsx +197 -0
  90. package/lib/__templates__/taro/src/components/ui/input-otp.tsx +136 -0
  91. package/lib/__templates__/taro/src/components/ui/input.tsx +56 -0
  92. package/lib/__templates__/taro/src/components/ui/label.tsx +24 -0
  93. package/lib/__templates__/taro/src/components/ui/menubar.tsx +595 -0
  94. package/lib/__templates__/taro/src/components/ui/navigation-menu.tsx +264 -0
  95. package/lib/__templates__/taro/src/components/ui/pagination.tsx +118 -0
  96. package/lib/__templates__/taro/src/components/ui/popover.tsx +291 -0
  97. package/lib/__templates__/taro/src/components/ui/portal.tsx +19 -0
  98. package/lib/__templates__/taro/src/components/ui/progress.tsx +28 -0
  99. package/lib/__templates__/taro/src/components/ui/radio-group.tsx +64 -0
  100. package/lib/__templates__/taro/src/components/ui/resizable.tsx +346 -0
  101. package/lib/__templates__/taro/src/components/ui/scroll-area.tsx +34 -0
  102. package/lib/__templates__/taro/src/components/ui/select.tsx +438 -0
  103. package/lib/__templates__/taro/src/components/ui/separator.tsx +30 -0
  104. package/lib/__templates__/taro/src/components/ui/sheet.tsx +262 -0
  105. package/lib/__templates__/taro/src/components/ui/skeleton.tsx +17 -0
  106. package/lib/__templates__/taro/src/components/ui/slider.tsx +203 -0
  107. package/lib/__templates__/taro/src/components/ui/sonner.tsx +1 -0
  108. package/lib/__templates__/taro/src/components/ui/switch.tsx +55 -0
  109. package/lib/__templates__/taro/src/components/ui/table.tsx +142 -0
  110. package/lib/__templates__/taro/src/components/ui/tabs.tsx +114 -0
  111. package/lib/__templates__/taro/src/components/ui/textarea.tsx +54 -0
  112. package/lib/__templates__/taro/src/components/ui/toast.tsx +517 -0
  113. package/lib/__templates__/taro/src/components/ui/toggle-group.tsx +120 -0
  114. package/lib/__templates__/taro/src/components/ui/toggle.tsx +77 -0
  115. package/lib/__templates__/taro/src/components/ui/tooltip.tsx +455 -0
  116. package/lib/__templates__/taro/src/lib/hooks/use-keyboard-offset.ts +37 -0
  117. package/lib/__templates__/taro/src/lib/measure.ts +115 -0
  118. package/lib/__templates__/taro/src/lib/platform.ts +12 -0
  119. package/lib/__templates__/taro/src/lib/utils.ts +6 -0
  120. package/lib/__templates__/taro/src/presets/dev-debug.ts +23 -0
  121. package/lib/__templates__/taro/src/presets/h5-container.tsx +15 -0
  122. package/lib/__templates__/taro/src/presets/h5-navbar.tsx +238 -0
  123. package/lib/__templates__/taro/src/presets/h5-styles.ts +220 -0
  124. package/lib/__templates__/taro/src/presets/index.tsx +18 -0
  125. package/lib/__templates__/templates.json +43 -0
  126. package/lib/__templates__/vite/README.md +190 -11
  127. package/lib/__templates__/vite/_gitignore +1 -0
  128. package/lib/__templates__/vite/eslint.config.mjs +6 -1
  129. package/lib/__templates__/vite/package.json +14 -5
  130. package/lib/__templates__/vite/pnpm-lock.yaml +768 -24
  131. package/lib/__templates__/vite/scripts/build.sh +4 -1
  132. package/lib/__templates__/vite/scripts/dev.sh +9 -2
  133. package/lib/__templates__/vite/scripts/start.sh +9 -3
  134. package/lib/__templates__/vite/server/routes/index.ts +31 -0
  135. package/lib/__templates__/vite/server/server.ts +65 -0
  136. package/lib/__templates__/vite/server/vite.ts +67 -0
  137. package/lib/__templates__/vite/tsconfig.json +4 -3
  138. package/lib/__templates__/vite/vite.config.ts +5 -0
  139. package/lib/cli.js +124 -103
  140. package/package.json +7 -3
  141. package/lib/__templates__/taro/src/app.ts +0 -14
  142. package/lib/__templates__/taro/src/utils/h5-styles.ts +0 -22
  143. 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,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
+ }