@coze-arch/cli 0.0.1-alpha.e9ff73 → 0.0.1-alpha.eaa612
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/lib/__templates__/expo/client/components/Screen.tsx +2 -2
- package/lib/__templates__/expo/client/eslint.config.mjs +4 -0
- package/lib/__templates__/expo/client/scripts/install-missing-deps.js +10 -10
- package/lib/__templates__/expo/eslint-plugins/forbid-emoji/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/forbid-emoji/rule.js +112 -0
- package/lib/__templates__/expo/eslint-plugins/forbid-emoji/tech.md +94 -0
- package/lib/__templates__/nextjs/README.md +5 -0
- package/lib/__templates__/nextjs/_gitignore +0 -3
- package/lib/__templates__/nextjs/eslint.config.mjs +5 -0
- package/lib/__templates__/nextjs/next.config.ts +1 -2
- package/lib/__templates__/nextjs/package.json +1 -5
- package/lib/__templates__/nextjs/pnpm-lock.yaml +1012 -12
- package/lib/__templates__/nextjs/scripts/build.sh +2 -2
- package/lib/__templates__/nextjs/scripts/dev.sh +3 -4
- package/lib/__templates__/nextjs/scripts/start.sh +3 -3
- package/lib/__templates__/nextjs/src/app/layout.tsx +1 -1
- package/lib/__templates__/nextjs/{server.ts → src/server.ts} +14 -14
- package/lib/__templates__/nextjs/tsconfig.json +1 -1
- package/lib/__templates__/nuxt-app/README.md +5 -15
- package/lib/__templates__/nuxt-app/app/app.vue +1 -188
- package/lib/__templates__/nuxt-app/app/pages/index.vue +23 -0
- package/lib/__templates__/nuxt-app/assets/css/main.css +24 -0
- package/lib/__templates__/nuxt-app/nuxt.config.ts +63 -3
- package/lib/__templates__/nuxt-app/package.json +7 -0
- package/lib/__templates__/nuxt-app/pnpm-lock.yaml +1610 -53
- package/lib/__templates__/nuxt-app/postcss.config.mjs +8 -0
- package/lib/__templates__/nuxt-app/scripts/dev.sh +2 -3
- package/lib/__templates__/nuxt-app/scripts/start.sh +3 -3
- package/lib/__templates__/nuxt-app/server/api/hello.ts +10 -0
- package/lib/__templates__/nuxt-app/server/middleware/logger.ts +10 -0
- package/lib/__templates__/nuxt-app/server/routes/health.ts +10 -0
- package/lib/__templates__/nuxt-app/tailwind.config.js +13 -0
- package/lib/__templates__/nuxt-app/template.config.js +9 -0
- package/lib/__templates__/templates.json +7 -0
- package/lib/__templates__/vite/README.md +189 -11
- package/lib/__templates__/vite/_gitignore +1 -0
- package/lib/__templates__/vite/eslint.config.mjs +6 -1
- package/lib/__templates__/vite/package.json +15 -3
- package/lib/__templates__/vite/pnpm-lock.yaml +750 -15
- package/lib/__templates__/vite/scripts/build-server.js +70 -0
- package/lib/__templates__/vite/scripts/build.sh +4 -1
- package/lib/__templates__/vite/scripts/dev.sh +4 -4
- package/lib/__templates__/vite/scripts/start.sh +5 -5
- package/lib/__templates__/vite/server/index.ts +57 -0
- package/lib/__templates__/vite/server/routes/index.ts +31 -0
- package/lib/__templates__/vite/server/vite.ts +79 -0
- package/lib/__templates__/vite/tsconfig.json +4 -3
- package/lib/cli.js +89 -100
- package/package.json +4 -1
- package/lib/__templates__/nuxt-app/.nuxt/app.config.mjs +0 -21
- package/lib/__templates__/nuxt-app/.nuxt/components.d.ts +0 -64
- package/lib/__templates__/nuxt-app/.nuxt/imports.d.ts +0 -31
- package/lib/__templates__/nuxt-app/.nuxt/manifest/meta/f97812ec-f25e-427b-b45d-eab58fba39f9.json +0 -1
- package/lib/__templates__/nuxt-app/.nuxt/nuxt.d.ts +0 -19
- package/lib/__templates__/nuxt-app/.nuxt/nuxt.node.d.ts +0 -14
- package/lib/__templates__/nuxt-app/.nuxt/nuxt.shared.d.ts +0 -6
- package/lib/__templates__/nuxt-app/.nuxt/schema/nuxt.schema.d.ts +0 -17
- package/lib/__templates__/nuxt-app/.nuxt/schema/nuxt.schema.json +0 -3
- package/lib/__templates__/nuxt-app/.nuxt/tsconfig.app.json +0 -201
- package/lib/__templates__/nuxt-app/.nuxt/tsconfig.json +0 -203
- package/lib/__templates__/nuxt-app/.nuxt/tsconfig.node.json +0 -110
- package/lib/__templates__/nuxt-app/.nuxt/tsconfig.server.json +0 -140
- package/lib/__templates__/nuxt-app/.nuxt/tsconfig.shared.json +0 -152
- package/lib/__templates__/nuxt-app/.nuxt/types/app.config.d.ts +0 -35
- package/lib/__templates__/nuxt-app/.nuxt/types/build.d.ts +0 -24
- package/lib/__templates__/nuxt-app/.nuxt/types/builder-env.d.ts +0 -1
- package/lib/__templates__/nuxt-app/.nuxt/types/components.d.ts +0 -69
- package/lib/__templates__/nuxt-app/.nuxt/types/imports.d.ts +0 -360
- package/lib/__templates__/nuxt-app/.nuxt/types/middleware.d.ts +0 -11
- package/lib/__templates__/nuxt-app/.nuxt/types/modules.d.ts +0 -79
- package/lib/__templates__/nuxt-app/.nuxt/types/nitro-config.d.ts +0 -14
- package/lib/__templates__/nuxt-app/.nuxt/types/nitro-imports.d.ts +0 -151
- package/lib/__templates__/nuxt-app/.nuxt/types/nitro-layouts.d.ts +0 -17
- package/lib/__templates__/nuxt-app/.nuxt/types/nitro-nuxt.d.ts +0 -64
- package/lib/__templates__/nuxt-app/.nuxt/types/nitro-routes.d.ts +0 -17
- package/lib/__templates__/nuxt-app/.nuxt/types/nitro.d.ts +0 -3
- package/lib/__templates__/nuxt-app/.nuxt/types/plugins.d.ts +0 -30
- package/lib/__templates__/nuxt-app/.nuxt/types/runtime-config.d.ts +0 -32
- package/lib/__templates__/nuxt-app/.nuxt/types/shared-imports.d.ts +0 -10
- package/lib/__templates__/nuxt-app/.nuxt/types/vue-shim.d.ts +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
set -Eeuo pipefail
|
|
3
3
|
|
|
4
|
-
PORT
|
|
4
|
+
PORT="${PORT:-<%= port %>}"
|
|
5
5
|
COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
|
|
6
|
-
|
|
7
|
-
DEPLOY_RUN_PORT=<%= port %>
|
|
6
|
+
DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-${PORT}}"
|
|
8
7
|
|
|
9
8
|
cd "${COZE_WORKSPACE_PATH}"
|
|
10
9
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
set -Eeuo pipefail
|
|
3
3
|
|
|
4
4
|
COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
|
|
5
|
-
PORT
|
|
6
|
-
DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-$PORT}"
|
|
5
|
+
PORT="${PORT:-<%= port %>}"
|
|
6
|
+
DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-${PORT}}"
|
|
7
7
|
|
|
8
8
|
start_service() {
|
|
9
9
|
cd "${COZE_WORKSPACE_PATH}"
|
|
10
10
|
echo "Starting Nuxt.js service on port ${DEPLOY_RUN_PORT} for production..."
|
|
11
|
-
PORT=${DEPLOY_RUN_PORT}
|
|
11
|
+
PORT=${DEPLOY_RUN_PORT} node .output/server/index.mjs
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
echo "Starting Nuxt.js service on port ${DEPLOY_RUN_PORT} for production..."
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
export default {
|
|
3
|
+
content: [
|
|
4
|
+
'./app/**/*.{js,ts,jsx,tsx,vue}',
|
|
5
|
+
'./pages/**/*.{js,ts,jsx,tsx,vue}',
|
|
6
|
+
'./components/**/*.{js,ts,jsx,tsx,vue}',
|
|
7
|
+
],
|
|
8
|
+
darkMode: 'media',
|
|
9
|
+
theme: {
|
|
10
|
+
extend: {},
|
|
11
|
+
},
|
|
12
|
+
plugins: [],
|
|
13
|
+
};
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
|
|
9
10
|
const description = `Nuxt.js(服务端 + Vue):\`coze init \${COZE_WORKSPACE_PATH} --template nuxt-app\`
|
|
10
11
|
- 适用:全栈应用、需要服务端接口能力的 Vue 项目
|
|
11
12
|
- 特点:
|
|
@@ -33,6 +34,13 @@ export const paramsSchema = {
|
|
|
33
34
|
maximum: 65535,
|
|
34
35
|
description: 'Development server port (for Nuxt dev server)',
|
|
35
36
|
},
|
|
37
|
+
hmrPort: {
|
|
38
|
+
type: 'number',
|
|
39
|
+
default: 6000,
|
|
40
|
+
minimum: 1024,
|
|
41
|
+
maximum: 65535,
|
|
42
|
+
description: 'Hot Module Replacement (HMR) port',
|
|
43
|
+
},
|
|
36
44
|
},
|
|
37
45
|
required: [],
|
|
38
46
|
additionalProperties: false,
|
|
@@ -45,6 +53,7 @@ const config = {
|
|
|
45
53
|
// 显式定义默认参数,确保在渲染时可用
|
|
46
54
|
defaultParams: {
|
|
47
55
|
port: 5000,
|
|
56
|
+
hmrPort: 6000,
|
|
48
57
|
appName: 'nuxt-app',
|
|
49
58
|
},
|
|
50
59
|
|
|
@@ -81,6 +81,13 @@
|
|
|
81
81
|
"minimum": 1024,
|
|
82
82
|
"maximum": 65535,
|
|
83
83
|
"description": "Development server port (for Nuxt dev server)"
|
|
84
|
+
},
|
|
85
|
+
"hmrPort": {
|
|
86
|
+
"type": "number",
|
|
87
|
+
"default": 6000,
|
|
88
|
+
"minimum": 1024,
|
|
89
|
+
"maximum": 65535,
|
|
90
|
+
"description": "Hot Module Replacement (HMR) port"
|
|
84
91
|
}
|
|
85
92
|
},
|
|
86
93
|
"required": [],
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# <%= appName %>
|
|
2
2
|
|
|
3
|
-
这是一个基于
|
|
3
|
+
这是一个基于 Koa + Vite + TypeScript + Tailwind CSS 的全栈 Web 应用项目,由扣子编程 CLI 创建。
|
|
4
|
+
|
|
5
|
+
**核心特性:**
|
|
6
|
+
- 🚀 前端:Vite + TypeScript + Tailwind CSS
|
|
7
|
+
- 🔧 后端:Koa + TypeScript,提供 RESTful API
|
|
8
|
+
- 🔥 开发模式:Vite HMR + Koa API,单进程启动
|
|
9
|
+
- 📦 生产模式:Koa 静态服务 + API,高性能部署
|
|
4
10
|
|
|
5
11
|
## 快速开始
|
|
6
12
|
|
|
@@ -33,19 +39,147 @@ coze start
|
|
|
33
39
|
## 项目结构
|
|
34
40
|
|
|
35
41
|
```
|
|
36
|
-
├──
|
|
37
|
-
├──
|
|
38
|
-
│ ├──
|
|
39
|
-
│
|
|
40
|
-
│ └──
|
|
41
|
-
├──
|
|
42
|
-
├──
|
|
43
|
-
|
|
42
|
+
├── server/ # 后端服务器目录
|
|
43
|
+
│ ├── index.ts # Koa 服务器入口
|
|
44
|
+
│ ├── routes/ # API 路由目录
|
|
45
|
+
│ │ └── index.ts # 路由定义
|
|
46
|
+
│ └── vite.ts # Vite 集成逻辑
|
|
47
|
+
├── src/ # 前端源码目录
|
|
48
|
+
│ ├── index.ts # 前端应用入口(初始化)
|
|
49
|
+
│ ├── main.ts # 前端主逻辑文件
|
|
50
|
+
│ └── index.css # 全局样式(包含 Tailwind 指令)
|
|
51
|
+
├── index.html # HTML 入口文件
|
|
52
|
+
├── vite.config.ts # Vite 配置
|
|
53
|
+
├── tailwind.config.ts # Tailwind CSS 配置
|
|
54
|
+
└── tsconfig.json # TypeScript 配置
|
|
44
55
|
```
|
|
45
56
|
|
|
57
|
+
**目录说明:**
|
|
58
|
+
|
|
59
|
+
- **`server/`** - 后端服务器代码
|
|
60
|
+
- `index.ts` - 服务器主入口,负责创建和启动 Koa 应用
|
|
61
|
+
- `routes/` - API 路由模块,支持按功能拆分路由
|
|
62
|
+
- `vite.ts` - Vite 开发服务器和静态文件服务集成
|
|
63
|
+
|
|
64
|
+
- **`src/`** - 前端应用代码
|
|
65
|
+
- 所有前端相关代码都在这里
|
|
66
|
+
|
|
67
|
+
**工作原理:**
|
|
68
|
+
|
|
69
|
+
- **开发模式** (`coze dev`):
|
|
70
|
+
- 运行 `server/index.ts` 启动 Koa 服务器
|
|
71
|
+
- Vite 以 middleware 模式集成到 Koa
|
|
72
|
+
- 前端支持 HMR(热模块替换)
|
|
73
|
+
- 后端 API 和前端在同一进程,端口 <%= port %>
|
|
74
|
+
|
|
75
|
+
- **生产模式** (`coze start`):
|
|
76
|
+
- `coze build` 构建前端 → `dist/` 目录
|
|
77
|
+
- `coze build` 构建后端 → `dist-server/index.js` (CommonJS 格式)
|
|
78
|
+
- 运行 `dist-server/index.js` 启动生产服务器
|
|
79
|
+
- Koa 服务静态文件 + API 路由
|
|
80
|
+
- 单一 Node.js 进程,轻量高效
|
|
81
|
+
|
|
46
82
|
## 核心开发规范
|
|
47
83
|
|
|
48
|
-
### 1.
|
|
84
|
+
### 1. 后端 API 开发
|
|
85
|
+
|
|
86
|
+
**添加新的 API 路由**
|
|
87
|
+
|
|
88
|
+
在 `server/routes/index.ts` 中添加路由:
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
// GET 请求示例
|
|
92
|
+
router.get('/api/users', async (ctx) => {
|
|
93
|
+
ctx.body = {
|
|
94
|
+
users: [
|
|
95
|
+
{ id: 1, name: 'Alice' },
|
|
96
|
+
{ id: 2, name: 'Bob' },
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// POST 请求示例
|
|
102
|
+
router.post('/api/users', async (ctx) => {
|
|
103
|
+
const userData = ctx.request.body;
|
|
104
|
+
// 处理业务逻辑
|
|
105
|
+
ctx.body = {
|
|
106
|
+
success: true,
|
|
107
|
+
user: userData,
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// 动态路由参数
|
|
112
|
+
router.get('/api/users/:id', async (ctx) => {
|
|
113
|
+
const userId = ctx.params.id;
|
|
114
|
+
ctx.body = {
|
|
115
|
+
id: userId,
|
|
116
|
+
name: 'User ' + userId,
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**拆分路由模块**(推荐)
|
|
122
|
+
|
|
123
|
+
当路由变多时,可以按功能拆分:
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
// server/routes/users.ts
|
|
127
|
+
import Router from '@koa/router';
|
|
128
|
+
|
|
129
|
+
const router = new Router();
|
|
130
|
+
|
|
131
|
+
router.get('/api/users', async (ctx) => {
|
|
132
|
+
// 用户列表逻辑
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
router.post('/api/users', async (ctx) => {
|
|
136
|
+
// 创建用户逻辑
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
export default router;
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
然后在 `server/index.ts` 中注册:
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
import usersRouter from './routes/users';
|
|
146
|
+
|
|
147
|
+
// 注册路由
|
|
148
|
+
app.use(usersRouter.routes()).use(usersRouter.allowedMethods());
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**前端调用 API**
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
// GET 请求
|
|
155
|
+
async function getUsers() {
|
|
156
|
+
const response = await fetch('/api/users');
|
|
157
|
+
const data = await response.json();
|
|
158
|
+
console.log(data);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// POST 请求
|
|
162
|
+
async function createUser(name: string) {
|
|
163
|
+
const response = await fetch('/api/users', {
|
|
164
|
+
method: 'POST',
|
|
165
|
+
headers: {
|
|
166
|
+
'Content-Type': 'application/json',
|
|
167
|
+
},
|
|
168
|
+
body: JSON.stringify({ name }),
|
|
169
|
+
});
|
|
170
|
+
const data = await response.json();
|
|
171
|
+
console.log(data);
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**API 最佳实践**
|
|
176
|
+
|
|
177
|
+
- ✅ 所有 API 路由以 `/api` 开头,避免与前端路由冲突
|
|
178
|
+
- ✅ 使用 RESTful 设计:GET 查询、POST 创建、PUT 更新、DELETE 删除
|
|
179
|
+
- ✅ 返回统一的响应格式:`{ success: boolean, data?: any, error?: string }`
|
|
180
|
+
- ✅ 添加错误处理和参数验证
|
|
181
|
+
|
|
182
|
+
### 2. 样式开发
|
|
49
183
|
|
|
50
184
|
**使用 Tailwind CSS**
|
|
51
185
|
|
|
@@ -219,17 +353,32 @@ console.log(apiUrl); // https://api.example.com
|
|
|
219
353
|
|
|
220
354
|
## 技术栈
|
|
221
355
|
|
|
222
|
-
|
|
356
|
+
**前端:**
|
|
357
|
+
- **构建工具**: Vite 7.x
|
|
223
358
|
- **语言**: TypeScript 5.x
|
|
224
359
|
- **样式**: Tailwind CSS 3.x
|
|
360
|
+
|
|
361
|
+
**后端:**
|
|
362
|
+
- **框架**: Koa 2.x
|
|
363
|
+
- **路由**: @koa/router 13.x
|
|
364
|
+
- **中间件**: koa-bodyparser, koa-static
|
|
365
|
+
|
|
366
|
+
**工具:**
|
|
225
367
|
- **包管理器**: pnpm 9+
|
|
368
|
+
- **运行时**: Node.js 18+
|
|
369
|
+
- **开发工具**: tsx (TypeScript 执行器)
|
|
226
370
|
|
|
227
371
|
## 参考文档
|
|
228
372
|
|
|
373
|
+
**前端:**
|
|
229
374
|
- [Vite 官方文档](https://cn.vitejs.dev/)
|
|
230
375
|
- [TypeScript 官方文档](https://www.typescriptlang.org/zh/docs/)
|
|
231
376
|
- [Tailwind CSS 文档](https://tailwindcss.com/docs)
|
|
232
377
|
|
|
378
|
+
**后端:**
|
|
379
|
+
- [Koa 官方文档](https://koajs.com/)
|
|
380
|
+
- [Koa Router 文档](https://github.com/koajs/router)
|
|
381
|
+
|
|
233
382
|
## 重要提示
|
|
234
383
|
|
|
235
384
|
1. **必须使用 pnpm** 作为包管理器
|
|
@@ -237,3 +386,32 @@ console.log(apiUrl); // https://api.example.com
|
|
|
237
386
|
3. **使用 Tailwind CSS** 进行样式开发,支持响应式和暗色模式
|
|
238
387
|
4. **环境变量必须以 `VITE_` 开头** 才能在客户端代码中访问
|
|
239
388
|
5. **开发时使用 `coze dev`**,支持热更新和快速刷新
|
|
389
|
+
6. **API 路由以 `/api` 开头**,避免与前端路由冲突
|
|
390
|
+
7. **单进程架构**:开发和生产环境都是前后端在同一进程中运行
|
|
391
|
+
|
|
392
|
+
## 常见问题
|
|
393
|
+
|
|
394
|
+
**Q: 如何分离前后端端口?**
|
|
395
|
+
|
|
396
|
+
如果需要前后端分离部署,可以:
|
|
397
|
+
- 前端:使用 `npx vite` 单独启动(默认端口 5173)
|
|
398
|
+
- 后端:修改 `server.ts`,移除 Vite middleware,单独启动
|
|
399
|
+
|
|
400
|
+
**Q: 如何添加数据库?**
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
# 安装数据库客户端(以 PostgreSQL 为例)
|
|
404
|
+
pnpm add pg
|
|
405
|
+
pnpm add -D @types/pg
|
|
406
|
+
|
|
407
|
+
# 在 server.ts 中使用
|
|
408
|
+
import { Pool } from 'pg';
|
|
409
|
+
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
**Q: 如何部署?**
|
|
413
|
+
|
|
414
|
+
1. 运行 `coze build` 构建前后端
|
|
415
|
+
2. 将整个项目上传到服务器
|
|
416
|
+
3. 运行 `pnpm install --prod`
|
|
417
|
+
4. 运行 `coze start` 启动服务
|
|
@@ -5,5 +5,10 @@ import { defineConfig, globalIgnores } from 'eslint/config';
|
|
|
5
5
|
export default defineConfig([
|
|
6
6
|
eslint.configs.recommended,
|
|
7
7
|
...tseslint.configs.recommended,
|
|
8
|
-
globalIgnores([
|
|
8
|
+
globalIgnores([
|
|
9
|
+
'dist/**',
|
|
10
|
+
'dist-server/**',
|
|
11
|
+
'node_modules/**',
|
|
12
|
+
'scripts/**',
|
|
13
|
+
]),
|
|
9
14
|
]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "<%= appName %>",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
-
"description": "Vanilla TypeScript application with Vite (HTML + CSS + TS)",
|
|
4
|
+
"description": "Vanilla TypeScript application with Koa + Vite (HTML + CSS + TS + Node API)",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "bash ./scripts/build.sh",
|
|
7
7
|
"dev": "bash ./scripts/dev.sh",
|
|
@@ -11,16 +11,27 @@
|
|
|
11
11
|
"ts-check": "tsc -p tsconfig.json"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
+
"@koa/router": "^12.0.1",
|
|
14
15
|
"@supabase/supabase-js": "2.95.3",
|
|
15
|
-
"dotenv": "^17.2.3"
|
|
16
|
+
"dotenv": "^17.2.3",
|
|
17
|
+
"koa": "^2.15.3",
|
|
18
|
+
"koa-bodyparser": "^4.4.1",
|
|
19
|
+
"koa-static": "^5.0.0"
|
|
16
20
|
},
|
|
17
21
|
"devDependencies": {
|
|
22
|
+
"@types/koa": "^2.15.0",
|
|
23
|
+
"@types/koa__router": "^12.0.4",
|
|
24
|
+
"@types/koa-bodyparser": "^4.3.12",
|
|
25
|
+
"@types/koa-static": "^4.0.4",
|
|
26
|
+
"@types/node": "^22.10.5",
|
|
18
27
|
"autoprefixer": "^10.4.20",
|
|
19
28
|
"coze-coding-dev-sdk": "^0.7.16",
|
|
29
|
+
"esbuild": "^0.24.2",
|
|
20
30
|
"eslint": "^9",
|
|
21
31
|
"only-allow": "^1.2.2",
|
|
22
32
|
"postcss": "^8.4.49",
|
|
23
33
|
"tailwindcss": "^3.4.17",
|
|
34
|
+
"tsx": "^4.19.2",
|
|
24
35
|
"typescript": "^5.6.0",
|
|
25
36
|
"typescript-eslint": "^8",
|
|
26
37
|
"vite": "^7.2.4"
|
|
@@ -31,7 +42,8 @@
|
|
|
31
42
|
},
|
|
32
43
|
"pnpm": {
|
|
33
44
|
"overrides": {
|
|
34
|
-
"esbuild": "^0.27.2"
|
|
45
|
+
"esbuild": "^0.27.2",
|
|
46
|
+
"is-generator-function": "1.0.10"
|
|
35
47
|
}
|
|
36
48
|
}
|
|
37
49
|
}
|