@kmlckj/licos-ai-cli 0.0.28 → 0.0.30

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 (44) hide show
  1. package/lib/__templates__/expo/.licosproj/scripts/dev_build.sh +3 -1
  2. package/lib/__templates__/expo/.licosproj/scripts/dev_run.sh +2 -2
  3. package/lib/__templates__/expo/.licosproj/scripts/prod_build.sh +2 -2
  4. package/lib/__templates__/expo/.licosproj/scripts/prod_run.sh +1 -1
  5. package/lib/__templates__/expo/.licosproj/scripts/server_dev_run.sh +1 -1
  6. package/lib/__templates__/expo/AGENTS.md +7 -5
  7. package/lib/__templates__/expo/README.md +5 -5
  8. package/lib/__templates__/expo/client/package.json +1 -1
  9. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +11 -6
  10. package/lib/__templates__/expo/package.json +7 -4
  11. package/lib/__templates__/expo/pnpm-lock.yaml +5 -5
  12. package/lib/__templates__/expo/server/package.json +6 -6
  13. package/lib/__templates__/expo/template.config.js +12 -2
  14. package/lib/__templates__/nextjs/AGENTS.md +5 -3
  15. package/lib/__templates__/nextjs/README.md +3 -3
  16. package/lib/__templates__/nextjs/package.json +15 -13
  17. package/lib/__templates__/nextjs/pnpm-lock.yaml +21 -278
  18. package/lib/__templates__/nextjs/scripts/build.sh +1 -1
  19. package/lib/__templates__/nextjs/scripts/prepare.sh +1 -1
  20. package/lib/__templates__/nextjs/template.config.js +12 -2
  21. package/lib/__templates__/nuxt-vue/AGENTS.md +5 -3
  22. package/lib/__templates__/nuxt-vue/README.md +1 -1
  23. package/lib/__templates__/nuxt-vue/package.json +16 -12
  24. package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +11 -406
  25. package/lib/__templates__/nuxt-vue/scripts/build.sh +1 -1
  26. package/lib/__templates__/nuxt-vue/scripts/prepare.sh +1 -1
  27. package/lib/__templates__/taro/.licosproj/scripts/deploy_build.sh +1 -1
  28. package/lib/__templates__/taro/.licosproj/scripts/dev_build.sh +1 -1
  29. package/lib/__templates__/taro/.licosproj/scripts/dev_run.sh +1 -1
  30. package/lib/__templates__/taro/AGENTS.md +7 -6
  31. package/lib/__templates__/taro/README.md +7 -7
  32. package/lib/__templates__/taro/package.json +3 -5
  33. package/lib/__templates__/taro/pnpm-lock.yaml +12 -211
  34. package/lib/__templates__/taro/server/package.json +1 -1
  35. package/lib/__templates__/taro/server/src/main.ts +2 -2
  36. package/lib/__templates__/vite/AGENTS.md +5 -3
  37. package/lib/__templates__/vite/README.md +7 -7
  38. package/lib/__templates__/vite/package.json +15 -13
  39. package/lib/__templates__/vite/pnpm-lock.yaml +5 -422
  40. package/lib/__templates__/vite/scripts/build.sh +1 -1
  41. package/lib/__templates__/vite/scripts/prepare.sh +1 -1
  42. package/lib/__templates__/vite/template.config.js +12 -2
  43. package/lib/cli.js +18 -10
  44. package/package.json +1 -1
@@ -38,12 +38,12 @@ async function bootstrap() {
38
38
  console.log(`Server running on http://localhost:${port}`);
39
39
  } catch (err) {
40
40
  if (err.code === 'EADDRINUSE') {
41
- console.error(`❌ 端口 \({port} 被占用! 请运行 'npx kill-port \){port}' 然后重试。`);
41
+ console.error(`端口 ${port} 被占用,请释放该端口后重试。`);
42
42
  process.exit(1);
43
43
  } else {
44
44
  throw err;
45
45
  }
46
46
  }
47
- console.log(`Application is running on: http://localhost:<%= serverPort %>`);
47
+ console.log(`Application is running on: http://localhost:${port}`);
48
48
  }
49
49
  bootstrap();
@@ -31,11 +31,13 @@
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
+ 除非用户明确要求,修改代码时不要运行 `pnpm install`、`pnpm dev`、`pnpm build`、`pnpm lint`、`pnpm ts-check`。平台预览和部署会负责依赖安装与启动。
40
+
39
41
  ## 开发规范
40
42
 
41
43
  - 使用 Tailwind CSS 进行样式开发
@@ -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
- - 前端:使用 `npx vite` 单独启动(默认端口 5173)
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,27 +2,29 @@
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
- "preinstall": "npx only-allow pnpm",
9
- "lint": "eslint",
10
- "start": "bash ./scripts/start.sh",
11
- "ts-check": "tsc -p tsconfig.json"
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
+ "lint": "eslint",
13
+ "start": "bash ./scripts/start.sh",
14
+ "ts-check": "tsc -p tsconfig.json"
12
15
  },
13
16
  "dependencies": {
14
- "@kmlckj/licos-platform-sdk": "0.6.1",
17
+ "@kmlckj/licos-platform-sdk": "0.6.2",
15
18
  "dotenv": "^17.2.3",
16
19
  "express": "^4.21.2"
17
20
  },
18
21
  "devDependencies": {
19
22
  "@types/express": "^5.0.0",
20
23
  "@types/node": "^22.10.5",
21
- "autoprefixer": "^10.4.20",
22
- "esbuild": "^0.24.2",
23
- "eslint": "^9",
24
- "only-allow": "^1.2.2",
25
- "postcss": "^8.4.49",
24
+ "autoprefixer": "^10.4.20",
25
+ "esbuild": "^0.24.2",
26
+ "eslint": "^9",
27
+ "postcss": "^8.4.49",
26
28
  "tailwindcss": "^3.4.17",
27
29
  "tsup": "^8.3.5",
28
30
  "tsx": "^4.19.2",