@coze-arch/cli 0.0.1-beta.5

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 (126) hide show
  1. package/README.md +142 -0
  2. package/bin/main +2 -0
  3. package/lib/__templates__/expo/.coze +7 -0
  4. package/lib/__templates__/expo/.cozeproj/scripts/deploy_build.sh +109 -0
  5. package/lib/__templates__/expo/.cozeproj/scripts/deploy_run.sh +257 -0
  6. package/lib/__templates__/expo/README.md +13 -0
  7. package/lib/__templates__/expo/_gitignore +11 -0
  8. package/lib/__templates__/expo/app.json +63 -0
  9. package/lib/__templates__/expo/babel.config.js +9 -0
  10. package/lib/__templates__/expo/client/app/(tabs)/_layout.tsx +43 -0
  11. package/lib/__templates__/expo/client/app/(tabs)/home.tsx +1 -0
  12. package/lib/__templates__/expo/client/app/(tabs)/index.tsx +7 -0
  13. package/lib/__templates__/expo/client/app/+not-found.tsx +79 -0
  14. package/lib/__templates__/expo/client/app/_layout.tsx +33 -0
  15. package/lib/__templates__/expo/client/assets/fonts/SpaceMono-Regular.ttf +0 -0
  16. package/lib/__templates__/expo/client/assets/images/adaptive-icon.png +0 -0
  17. package/lib/__templates__/expo/client/assets/images/default-avatar.png +0 -0
  18. package/lib/__templates__/expo/client/assets/images/favicon.png +0 -0
  19. package/lib/__templates__/expo/client/assets/images/icon.png +0 -0
  20. package/lib/__templates__/expo/client/assets/images/partial-react-logo.png +0 -0
  21. package/lib/__templates__/expo/client/assets/images/react-logo.png +0 -0
  22. package/lib/__templates__/expo/client/assets/images/react-logo@2x.png +0 -0
  23. package/lib/__templates__/expo/client/assets/images/react-logo@3x.png +0 -0
  24. package/lib/__templates__/expo/client/assets/images/splash-icon.png +0 -0
  25. package/lib/__templates__/expo/client/components/Screen.tsx +330 -0
  26. package/lib/__templates__/expo/client/components/SmartDateInput.tsx +238 -0
  27. package/lib/__templates__/expo/client/constants/theme.ts +118 -0
  28. package/lib/__templates__/expo/client/contexts/AuthContext.tsx +142 -0
  29. package/lib/__templates__/expo/client/hooks/useColorScheme.ts +1 -0
  30. package/lib/__templates__/expo/client/hooks/useTheme.ts +13 -0
  31. package/lib/__templates__/expo/client/index.js +11 -0
  32. package/lib/__templates__/expo/client/screens/home/index.tsx +54 -0
  33. package/lib/__templates__/expo/client/screens/home/styles.ts +332 -0
  34. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +80 -0
  35. package/lib/__templates__/expo/client/utils/index.ts +55 -0
  36. package/lib/__templates__/expo/eslint-formatter-simple.mjs +49 -0
  37. package/lib/__templates__/expo/eslint.config.mjs +98 -0
  38. package/lib/__templates__/expo/metro.config.js +53 -0
  39. package/lib/__templates__/expo/package.json +100 -0
  40. package/lib/__templates__/expo/pnpm-lock.yaml +13978 -0
  41. package/lib/__templates__/expo/src/index.ts +12 -0
  42. package/lib/__templates__/expo/template.config.js +49 -0
  43. package/lib/__templates__/expo/tsconfig.json +24 -0
  44. package/lib/__templates__/nextjs/.coze +11 -0
  45. package/lib/__templates__/nextjs/.vscode/settings.json +121 -0
  46. package/lib/__templates__/nextjs/README.md +36 -0
  47. package/lib/__templates__/nextjs/_gitignore +99 -0
  48. package/lib/__templates__/nextjs/_npmrc +22 -0
  49. package/lib/__templates__/nextjs/eslint.config.mjs +18 -0
  50. package/lib/__templates__/nextjs/next-env.d.ts +6 -0
  51. package/lib/__templates__/nextjs/next.config.ts +7 -0
  52. package/lib/__templates__/nextjs/package.json +32 -0
  53. package/lib/__templates__/nextjs/pnpm-lock.yaml +4061 -0
  54. package/lib/__templates__/nextjs/postcss.config.mjs +7 -0
  55. package/lib/__templates__/nextjs/public/file.svg +1 -0
  56. package/lib/__templates__/nextjs/public/globe.svg +1 -0
  57. package/lib/__templates__/nextjs/public/next.svg +1 -0
  58. package/lib/__templates__/nextjs/public/vercel.svg +1 -0
  59. package/lib/__templates__/nextjs/public/window.svg +1 -0
  60. package/lib/__templates__/nextjs/scripts/build.sh +14 -0
  61. package/lib/__templates__/nextjs/scripts/dev.sh +51 -0
  62. package/lib/__templates__/nextjs/scripts/start.sh +15 -0
  63. package/lib/__templates__/nextjs/src/app/favicon.ico +0 -0
  64. package/lib/__templates__/nextjs/src/app/globals.css +26 -0
  65. package/lib/__templates__/nextjs/src/app/layout.tsx +34 -0
  66. package/lib/__templates__/nextjs/src/app/page.tsx +66 -0
  67. package/lib/__templates__/nextjs/template.config.js +55 -0
  68. package/lib/__templates__/nextjs/tsconfig.json +34 -0
  69. package/lib/__templates__/react-rsbuild/.coze +11 -0
  70. package/lib/__templates__/react-rsbuild/.vscode/settings.json +121 -0
  71. package/lib/__templates__/react-rsbuild/README.md +61 -0
  72. package/lib/__templates__/react-rsbuild/_gitignore +97 -0
  73. package/lib/__templates__/react-rsbuild/_npmrc +22 -0
  74. package/lib/__templates__/react-rsbuild/package.json +31 -0
  75. package/lib/__templates__/react-rsbuild/pnpm-lock.yaml +997 -0
  76. package/lib/__templates__/react-rsbuild/rsbuild.config.ts +13 -0
  77. package/lib/__templates__/react-rsbuild/scripts/build.sh +14 -0
  78. package/lib/__templates__/react-rsbuild/scripts/dev.sh +51 -0
  79. package/lib/__templates__/react-rsbuild/scripts/start.sh +15 -0
  80. package/lib/__templates__/react-rsbuild/src/App.tsx +60 -0
  81. package/lib/__templates__/react-rsbuild/src/index.css +21 -0
  82. package/lib/__templates__/react-rsbuild/src/index.html +12 -0
  83. package/lib/__templates__/react-rsbuild/src/index.tsx +16 -0
  84. package/lib/__templates__/react-rsbuild/tailwind.config.js +9 -0
  85. package/lib/__templates__/react-rsbuild/template.config.js +54 -0
  86. package/lib/__templates__/react-rsbuild/tsconfig.json +17 -0
  87. package/lib/__templates__/rsbuild/.coze +11 -0
  88. package/lib/__templates__/rsbuild/.vscode/settings.json +7 -0
  89. package/lib/__templates__/rsbuild/README.md +61 -0
  90. package/lib/__templates__/rsbuild/_gitignore +97 -0
  91. package/lib/__templates__/rsbuild/_npmrc +22 -0
  92. package/lib/__templates__/rsbuild/package.json +24 -0
  93. package/lib/__templates__/rsbuild/pnpm-lock.yaml +888 -0
  94. package/lib/__templates__/rsbuild/rsbuild.config.ts +12 -0
  95. package/lib/__templates__/rsbuild/scripts/build.sh +14 -0
  96. package/lib/__templates__/rsbuild/scripts/dev.sh +51 -0
  97. package/lib/__templates__/rsbuild/scripts/start.sh +15 -0
  98. package/lib/__templates__/rsbuild/src/index.css +21 -0
  99. package/lib/__templates__/rsbuild/src/index.html +12 -0
  100. package/lib/__templates__/rsbuild/src/index.ts +5 -0
  101. package/lib/__templates__/rsbuild/src/main.ts +65 -0
  102. package/lib/__templates__/rsbuild/tailwind.config.js +9 -0
  103. package/lib/__templates__/rsbuild/template.config.js +54 -0
  104. package/lib/__templates__/rsbuild/tsconfig.json +16 -0
  105. package/lib/__templates__/templates.json +100 -0
  106. package/lib/__templates__/vite/.coze +11 -0
  107. package/lib/__templates__/vite/.vscode/settings.json +7 -0
  108. package/lib/__templates__/vite/README.md +61 -0
  109. package/lib/__templates__/vite/_gitignore +66 -0
  110. package/lib/__templates__/vite/_npmrc +22 -0
  111. package/lib/__templates__/vite/index.html +13 -0
  112. package/lib/__templates__/vite/package.json +24 -0
  113. package/lib/__templates__/vite/pnpm-lock.yaml +1249 -0
  114. package/lib/__templates__/vite/postcss.config.js +6 -0
  115. package/lib/__templates__/vite/scripts/build.sh +14 -0
  116. package/lib/__templates__/vite/scripts/dev.sh +51 -0
  117. package/lib/__templates__/vite/scripts/start.sh +15 -0
  118. package/lib/__templates__/vite/src/index.css +21 -0
  119. package/lib/__templates__/vite/src/index.ts +5 -0
  120. package/lib/__templates__/vite/src/main.ts +65 -0
  121. package/lib/__templates__/vite/tailwind.config.js +9 -0
  122. package/lib/__templates__/vite/template.config.js +55 -0
  123. package/lib/__templates__/vite/tsconfig.json +16 -0
  124. package/lib/__templates__/vite/vite.config.ts +15 -0
  125. package/lib/cli.js +1575 -0
  126. package/package.json +70 -0
@@ -0,0 +1,12 @@
1
+ import { defineConfig } from '@rsbuild/core';
2
+ import { pluginTailwindCSS } from 'rsbuild-plugin-tailwindcss';
3
+
4
+ export default defineConfig({
5
+ plugins: [pluginTailwindCSS()],
6
+ server: {
7
+ port: <%= port %>,
8
+ },
9
+ html: {
10
+ template: './src/index.html',
11
+ },
12
+ });
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+ set -Eeuo pipefail
3
+
4
+ COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
5
+
6
+ cd "${COZE_WORKSPACE_PATH}"
7
+
8
+ echo "Installing dependencies..."
9
+ pnpm install --prefer-frozen-lockfile --prefer-offline --loglevel debug --reporter=append-only
10
+
11
+ echo "Building the project..."
12
+ npx rsbuild build
13
+
14
+ echo "Build completed successfully!"
@@ -0,0 +1,51 @@
1
+ #!/bin/bash
2
+ set -Eeuo pipefail
3
+
4
+ PORT=<%= port %>
5
+ COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
6
+
7
+ cd "${COZE_WORKSPACE_PATH}"
8
+
9
+ kill_port_if_listening() {
10
+ local pids
11
+
12
+ # Check if lsof is available (macOS/BSD) or ss (Linux)
13
+ if command -v lsof >/dev/null 2>&1; then
14
+ # macOS/BSD using lsof
15
+ pids=$(lsof -ti:${PORT} 2>/dev/null || true)
16
+ elif command -v ss >/dev/null 2>&1; then
17
+ # Linux using ss
18
+ pids=$(ss -H -lntp 2>/dev/null | awk -v port="${PORT}" '$4 ~ ":"port"$"' | grep -o 'pid=[0-9]*' | cut -d= -f2 | paste -sd' ' - || true)
19
+ else
20
+ echo "Warning: neither lsof nor ss found, cannot check port ${PORT}"
21
+ return
22
+ fi
23
+
24
+ if [[ -z "${pids}" ]]; then
25
+ echo "Port ${PORT} is free."
26
+ return
27
+ fi
28
+
29
+ echo "Port ${PORT} in use by PIDs: ${pids} (SIGKILL)"
30
+ echo "${pids}" | xargs -I {} kill -9 {}
31
+ sleep 1
32
+
33
+ # Verify port is cleared
34
+ if command -v lsof >/dev/null 2>&1; then
35
+ pids=$(lsof -ti:${PORT} 2>/dev/null || true)
36
+ elif command -v ss >/dev/null 2>&1; then
37
+ pids=$(ss -H -lntp 2>/dev/null | awk -v port="${PORT}" '$4 ~ ":"port"$"' | grep -o 'pid=[0-9]*' | cut -d= -f2 | paste -sd' ' - || true)
38
+ fi
39
+
40
+ if [[ -n "${pids}" ]]; then
41
+ echo "Warning: port ${PORT} still busy after SIGKILL, PIDs: ${pids}"
42
+ else
43
+ echo "Port ${PORT} cleared."
44
+ fi
45
+ }
46
+
47
+ echo "Clearing port ${PORT} before start."
48
+ kill_port_if_listening
49
+ echo "Starting HTTP service on port ${PORT} for dev..."
50
+
51
+ npx rsbuild dev --port $PORT
@@ -0,0 +1,15 @@
1
+ #!/bin/bash
2
+ set -Eeuo pipefail
3
+
4
+ COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
5
+ PORT=<%= port %>
6
+ DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-$PORT}"
7
+
8
+ start_service() {
9
+ cd "${COZE_WORKSPACE_PATH}"
10
+ echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for deploy..."
11
+ npx rsbuild preview --port $DEPLOY_RUN_PORT
12
+ }
13
+
14
+ echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for deploy..."
15
+ start_service
@@ -0,0 +1,21 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ :root {
6
+ --background: #ffffff;
7
+ --foreground: #171717;
8
+ }
9
+
10
+ @media (prefers-color-scheme: dark) {
11
+ :root {
12
+ --background: #0a0a0a;
13
+ --foreground: #ededed;
14
+ }
15
+ }
16
+
17
+ body {
18
+ background: var(--background);
19
+ color: var(--foreground);
20
+ font-family: Arial, Helvetica, sans-serif;
21
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta name="description" content="扣子编程,你的 AI 开发伙伴已就位" />
7
+ <title>扣子编程 - AI 开发伙伴</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,5 @@
1
+ import './index.css';
2
+ import { initApp } from './main';
3
+
4
+ // Initialize the application
5
+ initApp();
@@ -0,0 +1,65 @@
1
+ export function initApp(): void {
2
+ const app = document.getElementById('app');
3
+
4
+ if (!app) {
5
+ console.error('App element not found');
6
+ return;
7
+ }
8
+
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">
15
+ <img
16
+ class="dark:invert"
17
+ src="https://lf3-static.bytednsdoc.com/obj/eden-cn/hkpzboz/coze_logo.png"
18
+ alt="扣子编程 Logo"
19
+ width="40"
20
+ height="40"
21
+ style="width: 40px; height: 40px; object-fit: contain;"
22
+ />
23
+ <span class="text-xl font-bold tracking-tight text-black dark:text-zinc-50">
24
+ 扣子编程
25
+ </span>
26
+ </div>
27
+
28
+ <!-- 中间内容区:主标题和副标题 -->
29
+ <div class="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left">
30
+ <h1 class="max-w-xl text-4xl font-semibold leading-tight tracking-tight text-black dark:text-zinc-50">
31
+ 扣子编程,你的 AI 开发伙伴已就位
32
+ </h1>
33
+ <p class="max-w-2xl text-lg leading-8 text-zinc-600 dark:text-zinc-400">
34
+ 当前是空白入口文件,项目正在开发中,请稍候...
35
+ <br />
36
+ 开发完成后界面将自动更新。如未自动更新成功,可以手动点击右上角刷新或重启按钮查看效果。
37
+ </p>
38
+ </div>
39
+
40
+ <!-- 底部按钮区 -->
41
+ <div class="flex w-full flex-col gap-4 text-base font-medium sm:w-auto sm:flex-row">
42
+ <!-- 按钮 1:前往首页 -->
43
+ <a
44
+ 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"
45
+ href="https://code.coze.cn/"
46
+ target="_blank"
47
+ rel="noopener noreferrer"
48
+ >
49
+ 前往首页
50
+ </a>
51
+
52
+ <!-- 按钮 2:查看文档 -->
53
+ <a
54
+ 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"
55
+ href="https://docs.coze.cn/"
56
+ target="_blank"
57
+ rel="noopener noreferrer"
58
+ >
59
+ 查看文档
60
+ </a>
61
+ </div>
62
+ </main>
63
+ </div>
64
+ `;
65
+ }
@@ -0,0 +1,9 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ export default {
3
+ content: ['./src/**/*.{html,js,ts,jsx,tsx}'],
4
+ darkMode: 'media',
5
+ theme: {
6
+ extend: {},
7
+ },
8
+ plugins: [],
9
+ };
@@ -0,0 +1,54 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+ export const paramsSchema = {
11
+ type: 'object',
12
+ properties: {
13
+ appName: {
14
+ type: 'string',
15
+ minLength: 1,
16
+ pattern: '^[a-z0-9-]+$',
17
+ description:
18
+ 'Application name (lowercase, alphanumeric and hyphens only)',
19
+ },
20
+ port: {
21
+ type: 'number',
22
+ default: 3000,
23
+ minimum: 1024,
24
+ maximum: 65535,
25
+ description: 'Development server port',
26
+ },
27
+ },
28
+ required: [],
29
+ additionalProperties: false,
30
+ };
31
+
32
+ const config = {
33
+ paramsSchema,
34
+
35
+ defaultParams: {
36
+ port: 3000,
37
+ appName: 'app',
38
+ },
39
+
40
+ onBeforeRender: async context => {
41
+ console.log(`Creating Vanilla TypeScript + Rsbuild project: ${context.appName}`);
42
+ return context;
43
+ },
44
+
45
+ onAfterRender: async (context, outputPath) => {
46
+ console.log(`\nProject created at: ${outputPath}`);
47
+ console.log(`\nConfiguration:`);
48
+ console.log(` - TypeScript: enabled`);
49
+ console.log(` - Framework: None (Vanilla JS/TS)`);
50
+ console.log(` - Port: ${context.port}`);
51
+ },
52
+ };
53
+
54
+ export default config;
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "strict": true,
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "resolveJsonModule": true,
12
+ "isolatedModules": true,
13
+ "noEmit": true
14
+ },
15
+ "include": ["src"]
16
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft-07/schema",
3
+ "templates": [
4
+ {
5
+ "name": "expo",
6
+ "description": "expo template",
7
+ "location": "./expo",
8
+ "paramsSchema": {
9
+ "appName": {
10
+ "type": "string",
11
+ "description": "Application name (lowercase, alphanumeric and hyphens only)",
12
+ "pattern": "^[a-z0-9-]+$"
13
+ },
14
+ "port": {
15
+ "type": "number",
16
+ "description": "Metro bundler port",
17
+ "default": 8081,
18
+ "minimum": 1024,
19
+ "maximum": 65535
20
+ }
21
+ }
22
+ },
23
+ {
24
+ "name": "nextjs",
25
+ "description": "nextjs template",
26
+ "location": "./nextjs",
27
+ "paramsSchema": {
28
+ "appName": {
29
+ "type": "string",
30
+ "description": "Application name (lowercase, alphanumeric and hyphens only)",
31
+ "pattern": "^[a-z0-9-]+$"
32
+ },
33
+ "port": {
34
+ "type": "number",
35
+ "description": "Development server port (for Next.js dev server)",
36
+ "default": 3000,
37
+ "minimum": 1024,
38
+ "maximum": 65535
39
+ }
40
+ }
41
+ },
42
+ {
43
+ "name": "react-rsbuild",
44
+ "description": "react-rsbuild template",
45
+ "location": "./react-rsbuild",
46
+ "paramsSchema": {
47
+ "appName": {
48
+ "type": "string",
49
+ "description": "Application name (lowercase, alphanumeric and hyphens only)",
50
+ "pattern": "^[a-z0-9-]+$"
51
+ },
52
+ "port": {
53
+ "type": "number",
54
+ "description": "Development server port",
55
+ "default": 3000,
56
+ "minimum": 1024,
57
+ "maximum": 65535
58
+ }
59
+ }
60
+ },
61
+ {
62
+ "name": "rsbuild",
63
+ "description": "rsbuild template",
64
+ "location": "./rsbuild",
65
+ "paramsSchema": {
66
+ "appName": {
67
+ "type": "string",
68
+ "description": "Application name (lowercase, alphanumeric and hyphens only)",
69
+ "pattern": "^[a-z0-9-]+$"
70
+ },
71
+ "port": {
72
+ "type": "number",
73
+ "description": "Development server port",
74
+ "default": 3000,
75
+ "minimum": 1024,
76
+ "maximum": 65535
77
+ }
78
+ }
79
+ },
80
+ {
81
+ "name": "vite",
82
+ "description": "vite template",
83
+ "location": "./vite",
84
+ "paramsSchema": {
85
+ "appName": {
86
+ "type": "string",
87
+ "description": "Application name (lowercase, alphanumeric and hyphens only)",
88
+ "pattern": "^[a-z0-9-]+$"
89
+ },
90
+ "port": {
91
+ "type": "number",
92
+ "description": "Development server port",
93
+ "default": 3000,
94
+ "minimum": 1024,
95
+ "maximum": 65535
96
+ }
97
+ }
98
+ }
99
+ ]
100
+ }
@@ -0,0 +1,11 @@
1
+ [project]
2
+ requires = ["nodejs-24"]
3
+
4
+ [dev]
5
+ run = ["npm", "run", "dev"]
6
+ deps = ["git"] # -> apt install git
7
+
8
+ [deploy]
9
+ build = ["npm", "run", "build"]
10
+ run = ["npm", "run", "start"]
11
+ deps = ["git"] # -> apt install git
@@ -0,0 +1,7 @@
1
+ {
2
+ "editor.formatOnSave": true,
3
+ "editor.codeActionsOnSave": {
4
+ "source.fixAll.eslint": "explicit"
5
+ },
6
+ "typescript.tsdk": "node_modules/typescript/lib"
7
+ }
@@ -0,0 +1,61 @@
1
+ # <%= appName %>
2
+
3
+ Vanilla TypeScript application built with Vite.
4
+
5
+ ## Getting Started
6
+
7
+ Install dependencies:
8
+
9
+ ```bash
10
+ npm install
11
+ ```
12
+
13
+ Start development server:
14
+
15
+ ```bash
16
+ npm run dev
17
+ ```
18
+
19
+ Or use coze-coding CLI:
20
+
21
+ ```bash
22
+ coze-coding dev
23
+ ```
24
+
25
+ ## Build
26
+
27
+ Build for production:
28
+
29
+ ```bash
30
+ npm run build
31
+ ```
32
+
33
+ Or:
34
+
35
+ ```bash
36
+ coze-coding build
37
+ ```
38
+
39
+ ## Preview
40
+
41
+ Preview production build:
42
+
43
+ ```bash
44
+ npm run preview
45
+ ```
46
+
47
+ Or:
48
+
49
+ ```bash
50
+ coze-coding start
51
+ ```
52
+
53
+ ## Configuration
54
+
55
+ - Dev Server Port: <%= port %>
56
+
57
+ ## Tech Stack
58
+
59
+ - TypeScript
60
+ - Vite
61
+ - HTML + CSS
@@ -0,0 +1,66 @@
1
+ # Dependencies
2
+ node_modules/
3
+ .pnp
4
+ .pnp.js
5
+
6
+ # Production build
7
+ dist/
8
+ build/
9
+ out/
10
+
11
+ # Testing
12
+ coverage/
13
+ *.lcov
14
+ .nyc_output
15
+
16
+ # Environment variables
17
+ .env
18
+ .env.local
19
+ .env.development.local
20
+ .env.test.local
21
+ .env.production.local
22
+
23
+ # Logs
24
+ logs/
25
+ *.log
26
+ npm-debug.log*
27
+ yarn-debug.log*
28
+ yarn-error.log*
29
+ pnpm-debug.log*
30
+ lerna-debug.log*
31
+
32
+ # Runtime data
33
+ pids
34
+ *.pid
35
+ *.seed
36
+ *.pid.lock
37
+
38
+ # Cache
39
+ .cache/
40
+ .eslintcache
41
+ .stylelintcache
42
+
43
+ # Editor directories and files
44
+ .vscode/*
45
+ !.vscode/extensions.json
46
+ !.vscode/settings.json
47
+ .idea/
48
+ *.suo
49
+ *.ntvs*
50
+ *.njsproj
51
+ *.sln
52
+ *.sw?
53
+
54
+ # OS files
55
+ .DS_Store
56
+ .DS_Store?
57
+ ._*
58
+ Thumbs.db
59
+
60
+ # TypeScript
61
+ *.tsbuildinfo
62
+
63
+ # Vite
64
+ .vite/
65
+
66
+ .coze-logs
@@ -0,0 +1,22 @@
1
+ registry=https://registry.npmjs.org
2
+
3
+ strictStorePkgContentCheck=false
4
+ verifyStoreIntegrity=false
5
+
6
+ # 网络优化
7
+ network-concurrency=16
8
+ fetch-retries=3
9
+ fetch-timeout=60000
10
+
11
+ # 严格使用 peer dependencies
12
+ strict-peer-dependencies=false
13
+
14
+ # 自动生成 lockfile
15
+ auto-install-peers=true
16
+
17
+ # lockfile 配置
18
+ lockfile=true
19
+ prefer-frozen-lockfile=true
20
+
21
+ # 如果 lockfile 存在但过期,更新而不是失败
22
+ resolution-mode=highest
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta name="description" content="扣子编程,你的 AI 开发伙伴已就位" />
7
+ <title>扣子编程 - AI 开发伙伴</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/index.ts"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "<%= appName %>",
3
+ "version": "1.0.0",
4
+ "description": "Vanilla TypeScript application with Vite (HTML + CSS + TS)",
5
+ "scripts": {
6
+ "build": "bash ./scripts/build.sh",
7
+ "dev": "bash ./scripts/dev.sh",
8
+ "preinstall": "npx only-allow pnpm",
9
+ "lint": "eslint",
10
+ "start": "bash ./scripts/start.sh"
11
+ },
12
+ "devDependencies": {
13
+ "autoprefixer": "^10.4.20",
14
+ "only-allow": "^1.2.2",
15
+ "postcss": "^8.4.49",
16
+ "tailwindcss": "^3.4.17",
17
+ "typescript": "^5.6.0",
18
+ "vite": "^6.0.0"
19
+ },
20
+ "packageManager": "pnpm@9.0.0",
21
+ "engines": {
22
+ "pnpm": ">=9.0.0"
23
+ }
24
+ }