@coze-arch/cli 0.0.2 → 0.0.3-alpha.226a3b

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.
@@ -9,3 +9,4 @@ expo-env.d.ts
9
9
  .DS_Store
10
10
  logs/
11
11
  *.tsbuildinfo
12
+ node-compile-cache/
@@ -0,0 +1,54 @@
1
+ # 项目上下文
2
+
3
+ ### 版本技术栈
4
+
5
+ - **Framework**: Next.js 16 (App Router)
6
+ - **Core**: React 19
7
+ - **Language**: TypeScript 5
8
+ - **UI 组件**: shadcn/ui (基于 Radix UI)
9
+ - **Styling**: Tailwind CSS 4
10
+
11
+ ## 目录结构
12
+
13
+ ```
14
+ ├── public/ # 静态资源
15
+ ├── scripts/ # 构建与启动脚本
16
+ │ ├── build.sh # 构建脚本
17
+ │ ├── dev.sh # 开发环境启动脚本
18
+ │ ├── prepare.sh # 预处理脚本
19
+ │ └── start.sh # 生产环境启动脚本
20
+ ├── src/
21
+ │ ├── app/ # 页面路由与布局
22
+ │ ├── components/ui/ # Shadcn UI 组件库
23
+ │ ├── hooks/ # 自定义 Hooks
24
+ │ ├── lib/ # 工具库
25
+ │ │ └── utils.ts # 通用工具函数 (cn)
26
+ │ └── server.ts # 自定义服务端入口
27
+ ├── next.config.ts # Next.js 配置
28
+ ├── package.json # 项目依赖管理
29
+ └── tsconfig.json # TypeScript 配置
30
+ ```
31
+
32
+ - 项目文件(如 app 目录、pages 目录、components 等)默认初始化到 `src/` 目录下。
33
+
34
+ ## 包管理规范
35
+
36
+ **仅允许使用 pnpm** 作为包管理器,**严禁使用 npm 或 yarn**。
37
+ **常用命令**:
38
+ - 安装依赖:`pnpm add <package>`
39
+ - 安装开发依赖:`pnpm add -D <package>`
40
+ - 安装所有依赖:`pnpm install`
41
+ - 移除依赖:`pnpm remove <package>`
42
+
43
+ ## 开发规范
44
+
45
+ - **项目理解加速**:初始可以依赖项目下`package.json`文件理解项目类型,如果没有或无法理解退化成阅读其他文件。
46
+ - **Hydration 错误预防**:严禁在 JSX 渲染逻辑中直接使用 typeof window、Date.now()、Math.random() 等动态数据。必须使用 'use client' 并配合 useEffect + useState 确保动态内容仅在客户端挂载后渲染;同时严禁非法 HTML 嵌套(如 <p> 嵌套 <div>)。
47
+
48
+
49
+ ## UI 设计与组件规范 (UI & Styling Standards)
50
+
51
+ - 模板默认预装核心组件库 `shadcn/ui`,位于`src/components/ui/`目录下
52
+ - Next.js 项目**必须默认**采用 shadcn/ui 组件、风格和规范,**除非用户指定用其他的组件和规范。**
53
+
54
+
@@ -52,6 +52,7 @@ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
52
52
  .yarn/unplugged
53
53
  .yarn/build-state.yml
54
54
  .yarn/install-state.gz
55
+ node-compile-cache/
55
56
 
56
57
  # Editor directories and files
57
58
  .vscode/*
@@ -0,0 +1,42 @@
1
+ # 项目上下文
2
+
3
+ ## 技术栈
4
+
5
+ - **核心**: Nuxt 4, Vue 3, TypeScript
6
+ - **UI**: Tailwind CSS
7
+
8
+ ## 目录结构
9
+
10
+ ```
11
+ ├── app/ # 页面路由与布局
12
+ │ ├── pages/ # 页面组件
13
+ │ └── app.vue # 根组件
14
+ ├── assets/ # 静态资源
15
+ │ └── css/ # 全局样式
16
+ ├── public/ # 公共静态资源
17
+ ├── scripts/ # 构建与启动脚本
18
+ │ ├── build.sh # 构建脚本
19
+ │ ├── dev.sh # 开发环境启动脚本
20
+ │ ├── prepare.sh # 预处理脚本
21
+ │ └── start.sh # 生产环境启动脚本
22
+ ├── server/ # 服务端逻辑
23
+ │ ├── api/ # API 路由
24
+ │ ├── middleware/ # 中间件
25
+ │ └── routes/ # 服务端路由
26
+ ├── nuxt.config.ts # Nuxt 配置
27
+ ├── package.json # 项目依赖管理
28
+ └── tsconfig.json # TypeScript 配置
29
+ ```
30
+
31
+ ## 包管理规范
32
+
33
+ **仅允许使用 pnpm** 作为包管理器,**严禁使用 npm 或 yarn**。
34
+ **常用命令**:
35
+ - 安装依赖:`pnpm add <package>`
36
+ - 安装开发依赖:`pnpm add -D <package>`
37
+ - 安装所有依赖:`pnpm install`
38
+ - 移除依赖:`pnpm remove <package>`
39
+
40
+ ## 开发规范
41
+
42
+ - 使用 Tailwind CSS 进行样式开发
@@ -5,6 +5,7 @@
5
5
  .nitro
6
6
  .cache
7
7
  dist
8
+ node-compile-cache
8
9
 
9
10
  # Node dependencies
10
11
  node_modules
@@ -7,7 +7,10 @@ const __dirname = dirname(__filename);
7
7
 
8
8
  export default defineNuxtConfig({
9
9
  compatibilityDate: '2025-07-15',
10
- devtools: { enabled: true },
10
+ // Disable devtools in CI/test environments (prevents hanging in headless mode)
11
+ devtools: {
12
+ enabled: process.env.CI !== 'true' && process.env.COZE_PROJECT_ENV !== 'PROD',
13
+ },
11
14
  telemetry: false,
12
15
 
13
16
  // App head configuration
@@ -52,7 +55,11 @@ export default defineNuxtConfig({
52
55
  },
53
56
 
54
57
  // Nuxt modules
55
- modules: ['@nuxt/image', '@nuxtjs/tailwindcss'],
58
+ // Skip @nuxt/image in CI (requires sharp binaries not available in headless environments)
59
+ modules:
60
+ process.env.CI === 'true'
61
+ ? ['@nuxtjs/tailwindcss']
62
+ : ['@nuxt/image', '@nuxtjs/tailwindcss'],
56
63
 
57
64
  // Global CSS
58
65
  css: [resolve(__dirname, 'assets/css/main.css')],
@@ -90,17 +97,20 @@ export default defineNuxtConfig({
90
97
  // Image optimization (similar to Next.js images config)
91
98
  // Using @nuxt/image module for image optimization
92
99
  // 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
- },
100
+ // Skip image config in CI (when @nuxt/image module is disabled)
101
+ ...(process.env.CI !== 'true' && {
102
+ image: {
103
+ domains: ['lf-coze-web-cdn.coze.cn'],
104
+ // Remote patterns configuration
105
+ remotePatterns: [
106
+ {
107
+ protocol: 'https',
108
+ hostname: 'lf-coze-web-cdn.coze.cn',
109
+ pathname: '/**',
110
+ },
111
+ ],
112
+ },
113
+ }),
104
114
 
105
115
  // Security headers (Content Security Policy)
106
116
  nitro: {
@@ -1,6 +1,7 @@
1
1
  # Dependencies
2
2
  node_modules/
3
3
  .pnpm-store/
4
+ node-compile-cache/
4
5
 
5
6
  # Production
6
7
  dist/
@@ -0,0 +1,41 @@
1
+ # 项目上下文
2
+
3
+ ## 技术栈
4
+
5
+ - **核心**: Vite 7, TypeScript, Express
6
+ - **UI**: Tailwind CSS
7
+
8
+ ## 目录结构
9
+
10
+ ```
11
+ ├── scripts/ # 构建与启动脚本
12
+ │ ├── build.sh # 构建脚本
13
+ │ ├── dev.sh # 开发环境启动脚本
14
+ │ ├── prepare.sh # 预处理脚本
15
+ │ └── start.sh # 生产环境启动脚本
16
+ ├── server/ # 服务端逻辑
17
+ │ ├── routes/ # API 路由
18
+ │ ├── server.ts # Express 服务入口
19
+ │ └── vite.ts # Vite 中间件集成
20
+ ├── src/ # 前端源码
21
+ │ ├── index.css # 全局样式
22
+ │ ├── index.ts # 客户端入口
23
+ │ └── main.ts # 主逻辑
24
+ ├── index.html # 入口 HTML
25
+ ├── package.json # 项目依赖管理
26
+ ├── tsconfig.json # TypeScript 配置
27
+ └── vite.config.ts # Vite 配置
28
+ ```
29
+
30
+ ## 包管理规范
31
+
32
+ **仅允许使用 pnpm** 作为包管理器,**严禁使用 npm 或 yarn**。
33
+ **常用命令**:
34
+ - 安装依赖:`pnpm add <package>`
35
+ - 安装开发依赖:`pnpm add -D <package>`
36
+ - 安装所有依赖:`pnpm install`
37
+ - 移除依赖:`pnpm remove <package>`
38
+
39
+ ## 开发规范
40
+
41
+ - 使用 Tailwind CSS 进行样式开发
@@ -40,6 +40,7 @@ pids
40
40
  .cache/
41
41
  .eslintcache
42
42
  .stylelintcache
43
+ node-compile-cache/
43
44
 
44
45
  # Editor directories and files
45
46
  .vscode/*
package/lib/cli.js CHANGED
@@ -2598,7 +2598,7 @@ const registerCommand = program => {
2598
2598
  });
2599
2599
  };
2600
2600
 
2601
- var version = "0.0.2";
2601
+ var version = "0.0.3-alpha.226a3b";
2602
2602
  var packageJson = {
2603
2603
  version: version};
2604
2604
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coze-arch/cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.3-alpha.226a3b",
4
4
  "private": false,
5
5
  "description": "coze coding devtools cli",
6
6
  "license": "MIT",
@@ -14,13 +14,15 @@
14
14
  "bin",
15
15
  "lib/**/.npmrc",
16
16
  "!**/*.tsbuildinfo",
17
- "!**/*.map"
17
+ "!**/*.map",
18
+ "!**/node-compile-cache"
18
19
  ],
19
20
  "scripts": {
20
21
  "prebuild": "tsx scripts/prebuild.ts",
21
22
  "build": "tsx scripts/build.ts",
22
23
  "create": "tsx scripts/create-template.ts",
23
24
  "lint": "eslint ./ --cache",
25
+ "pre-release": "tsx scripts/pre-release.ts",
24
26
  "postpublish": "bash scripts/sync-npmmirror.sh",
25
27
  "test": "vitest --run --passWithNoTests",
26
28
  "test:all": "bash scripts/test-coverage.sh",