@kmlckj/licos-ai-cli 0.0.27 → 0.0.29
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/.licosproj/scripts/dev_build.sh +3 -1
- package/lib/__templates__/expo/.licosproj/scripts/dev_run.sh +2 -2
- package/lib/__templates__/expo/.licosproj/scripts/prod_build.sh +2 -2
- package/lib/__templates__/expo/.licosproj/scripts/prod_run.sh +1 -1
- package/lib/__templates__/expo/.licosproj/scripts/server_dev_run.sh +1 -1
- package/lib/__templates__/expo/AGENTS.md +5 -5
- package/lib/__templates__/expo/README.md +5 -5
- package/lib/__templates__/expo/client/package.json +1 -1
- package/lib/__templates__/expo/client/scripts/install-missing-deps.js +11 -6
- package/lib/__templates__/expo/package.json +10 -4
- package/lib/__templates__/expo/server/package.json +5 -5
- package/lib/__templates__/expo/template.config.js +8 -2
- package/lib/__templates__/nextjs/AGENTS.md +3 -3
- package/lib/__templates__/nextjs/README.md +3 -3
- package/lib/__templates__/nextjs/package.json +16 -12
- package/lib/__templates__/nextjs/pnpm-lock.yaml +16 -273
- package/lib/__templates__/nextjs/scripts/build.sh +1 -1
- package/lib/__templates__/nextjs/scripts/prepare.sh +1 -1
- package/lib/__templates__/nextjs/template.config.js +8 -2
- package/lib/__templates__/nuxt-vue/AGENTS.md +3 -3
- package/lib/__templates__/nuxt-vue/README.md +1 -1
- package/lib/__templates__/nuxt-vue/package.json +15 -11
- package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +6 -401
- package/lib/__templates__/nuxt-vue/scripts/build.sh +1 -1
- package/lib/__templates__/nuxt-vue/scripts/prepare.sh +1 -1
- package/lib/__templates__/taro/.licosproj/scripts/deploy_build.sh +1 -1
- package/lib/__templates__/taro/.licosproj/scripts/dev_build.sh +8 -0
- package/lib/__templates__/taro/.licosproj/scripts/dev_run.sh +7 -2
- package/lib/__templates__/taro/AGENTS.md +7 -5
- package/lib/__templates__/taro/README.md +7 -7
- package/lib/__templates__/taro/package.json +6 -3
- package/lib/__templates__/taro/pnpm-lock.yaml +7 -206
- package/lib/__templates__/taro/server/src/main.ts +2 -2
- package/lib/__templates__/vite/AGENTS.md +3 -3
- package/lib/__templates__/vite/README.md +7 -7
- package/lib/__templates__/vite/package.json +16 -12
- package/lib/__templates__/vite/pnpm-lock.yaml +0 -417
- package/lib/__templates__/vite/scripts/build.sh +1 -1
- package/lib/__templates__/vite/scripts/prepare.sh +1 -1
- package/lib/__templates__/vite/template.config.js +8 -2
- package/lib/cli.js +14 -9
- package/package.json +1 -1
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
|
|
32
32
|
**仅允许使用 pnpm** 作为包管理器,**严禁使用 npm 或 yarn**。
|
|
33
33
|
**常用命令**:
|
|
34
|
-
- 安装依赖:`pnpm add <package>`
|
|
35
|
-
- 安装开发依赖:`pnpm add -D <package>`
|
|
36
|
-
- 安装所有依赖:`pnpm install`
|
|
34
|
+
- 安装依赖:`pnpm add --registry=https://registry.npmmirror.com <package>`
|
|
35
|
+
- 安装开发依赖:`pnpm add --registry=https://registry.npmmirror.com -D <package>`
|
|
36
|
+
- 安装所有依赖:`pnpm install --registry=https://registry.npmmirror.com`
|
|
37
37
|
- 移除依赖:`pnpm remove <package>`
|
|
38
38
|
|
|
39
39
|
## 开发规范
|
|
@@ -230,13 +230,13 @@ app.innerHTML = `
|
|
|
230
230
|
|
|
231
231
|
```bash
|
|
232
232
|
# ✅ 安装依赖
|
|
233
|
-
pnpm install
|
|
233
|
+
pnpm install --registry=https://registry.npmmirror.com
|
|
234
234
|
|
|
235
235
|
# ✅ 添加新依赖
|
|
236
|
-
pnpm add package-name
|
|
236
|
+
pnpm add --registry=https://registry.npmmirror.com package-name
|
|
237
237
|
|
|
238
238
|
# ✅ 添加开发依赖
|
|
239
|
-
pnpm add -D package-name
|
|
239
|
+
pnpm add --registry=https://registry.npmmirror.com -D package-name
|
|
240
240
|
|
|
241
241
|
# ❌ 禁止使用 npm 或 yarn
|
|
242
242
|
# npm install # 错误!
|
|
@@ -395,15 +395,15 @@ console.log(apiUrl); // https://api.example.com
|
|
|
395
395
|
**Q: 如何分离前后端端口?**
|
|
396
396
|
|
|
397
397
|
如果需要前后端分离部署,可以:
|
|
398
|
-
- 前端:使用 `
|
|
398
|
+
- 前端:使用 `pnpm exec vite` 单独启动(默认端口 5173)
|
|
399
399
|
- 后端:修改 `server.ts`,移除 Vite middleware,单独启动
|
|
400
400
|
|
|
401
401
|
**Q: 如何添加数据库?**
|
|
402
402
|
|
|
403
403
|
```bash
|
|
404
404
|
# 安装数据库客户端(以 PostgreSQL 为例)
|
|
405
|
-
pnpm add pg
|
|
406
|
-
pnpm add -D @types/pg
|
|
405
|
+
pnpm add --registry=https://registry.npmmirror.com pg
|
|
406
|
+
pnpm add --registry=https://registry.npmmirror.com -D @types/pg
|
|
407
407
|
|
|
408
408
|
# 在 server.ts 中使用
|
|
409
409
|
import { Pool } from 'pg';
|
|
@@ -414,5 +414,5 @@ const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
|
|
414
414
|
|
|
415
415
|
1. 运行 `licos build` 构建前后端
|
|
416
416
|
2. 将整个项目上传到服务器
|
|
417
|
-
3. 运行 `pnpm install --prod`
|
|
417
|
+
3. 运行 `pnpm install --registry=https://registry.npmmirror.com --prod`
|
|
418
418
|
4. 运行 `licos start` 启动服务
|
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
"name": "<%= appName %>",
|
|
3
3
|
"version": "1.0.0",
|
|
4
4
|
"description": "Vanilla TypeScript application with Express + Vite (HTML + CSS + TS + Node API)",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "bash ./scripts/build.sh",
|
|
7
|
-
"dev": "bash ./scripts/dev.sh",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "bash ./scripts/build.sh",
|
|
7
|
+
"dev": "bash ./scripts/dev.sh",
|
|
8
|
+
"ensure:deps": "node -e \"const fs=require('fs'); const bins=['node_modules/.bin/vite','node_modules/.bin/tsx','node_modules/.bin/tsup','node_modules/.bin/eslint','node_modules/.bin/tsc']; process.exit(bins.every((p)=>fs.existsSync(p)||fs.existsSync(p+'.cmd'))?0:1)\" || pnpm install --registry=https://registry.npmmirror.com --prefer-frozen-lockfile --prefer-offline --reporter=append-only",
|
|
9
|
+
"prebuild": "pnpm run ensure:deps",
|
|
10
|
+
"predev": "pnpm run ensure:deps",
|
|
11
|
+
"preinstall": "node -e \"const ua=process.env.npm_config_user_agent||''; if(!ua.includes('pnpm')){console.error('Use pnpm to install dependencies.'); process.exit(1)}\"",
|
|
12
|
+
"prelint": "pnpm run ensure:deps",
|
|
13
|
+
"prets-check": "pnpm run ensure:deps",
|
|
14
|
+
"lint": "eslint",
|
|
15
|
+
"start": "bash ./scripts/start.sh",
|
|
16
|
+
"ts-check": "tsc -p tsconfig.json"
|
|
12
17
|
},
|
|
13
18
|
"dependencies": {
|
|
14
19
|
"@kmlckj/licos-platform-sdk": "0.6.1",
|
|
@@ -18,11 +23,10 @@
|
|
|
18
23
|
"devDependencies": {
|
|
19
24
|
"@types/express": "^5.0.0",
|
|
20
25
|
"@types/node": "^22.10.5",
|
|
21
|
-
"autoprefixer": "^10.4.20",
|
|
22
|
-
"esbuild": "^0.24.2",
|
|
23
|
-
"eslint": "^9",
|
|
24
|
-
"
|
|
25
|
-
"postcss": "^8.4.49",
|
|
26
|
+
"autoprefixer": "^10.4.20",
|
|
27
|
+
"esbuild": "^0.24.2",
|
|
28
|
+
"eslint": "^9",
|
|
29
|
+
"postcss": "^8.4.49",
|
|
26
30
|
"tailwindcss": "^3.4.17",
|
|
27
31
|
"tsup": "^8.3.5",
|
|
28
32
|
"tsx": "^4.19.2",
|