xc-computent 0.3.0 → 0.3.2

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/README.md CHANGED
@@ -1,121 +1,127 @@
1
- # Computent Component Library
1
+ # xc-computent
2
2
 
3
- A premium, responsive, and performance-focused Vue 3 component library built with Vite, TypeScript, and native CSS custom properties.
3
+ `xc-computent` 是一个专为现代化工作台(Workbench)和任务管理系统打造的优质、响应式且高性能的 **Vue 3 组件库**。项目基于 ViteTypeScript WindiCSS 进行构建,提供高开箱即用性与高度可定制的 UI 组件。
4
4
 
5
5
  ---
6
6
 
7
- ## Features
7
+ ## 🎨 项目特点
8
8
 
9
- - ⚡ **Vite-powered**: Extremely fast hot-module replacement (HMR) for development and rollup-based bundles.
10
- - 📦 **Tree-shakeable**: Import only the components you use.
11
- - 🎨 **Premium Styling**: Sleek, customizable modern dark-theme/slate design tokens.
12
- - 🏷️ **Type Safe**: First-class TypeScript support with auto-generated declaration (`.d.ts`) files.
13
- - 🧩 **Zero Globals Leakage**: Component isolation scoped styles.
9
+ - ⚡ **Vite 驱动**:极速的热更新开发体验,基于 Rollup 进行高效打包。
10
+ - 📦 **支持按需引入**:天然支持 Tree-shaking,仅打包你所使用的组件。
11
+ - 🏷️ **类型安全**:原生支持 TypeScript,自动生成完整的类型声明文件 (`.d.ts`)。
12
+ - 🧩 **样式隔离**:组件样式局部作用域隔离,防止全局样式污染。
13
+ - 🛠️ **预置组件**:首期包含精心设计的任务卡片组件 [ToDoCard](file:///Users/tiantian/Desktop/computent/src/lib/components/ToDoCard/ToDoCard.vue),专为待办、日程等工作流场景优化。
14
14
 
15
15
  ---
16
16
 
17
- ## 🛠️ Local Development & Playground
17
+ ## 🔐 NPM 账号信息
18
18
 
19
- To run the interactive component playground and test your changes:
19
+ 本项目已与以下 NPM 账号关联,以便于版本的发布与维护:
20
20
 
21
- ### 1. Install Dependencies
22
- ```bash
23
- pnpm install
24
- ```
21
+ - **NPM 账号**: `xiao_ka`
22
+ - **身份验证**: 根目录下的 [.npmrc](file:///Users/tiantian/Desktop/computent/.npmrc) 文件已预配置了专属的安全发布 Token (authToken)。
23
+ - 在本项目的根目录下执行 npm 相关操作时,会自动加载此 Token,**无需手动执行 `npm login`**。
25
24
 
26
- ### 2. Run Local Development Server
27
- Starts the playground on `http://localhost:5173` using Vite:
28
- ```bash
29
- pnpm dev
30
- ```
25
+ ---
31
26
 
32
- ### 3. Build the Library
33
- Bundles the components into ESM and UMD formats under the `dist/` folder, and generates all `.d.ts` declaration files:
27
+ ## 🚀 发布到 npm 的完整流程
28
+
29
+ 当你修改了组件代码并准备发布新版本到 npm 时,请遵循以下流程:
30
+
31
+ ### 1. 确认/更新版本号
32
+ 在发布之前,必须更新 [package.json](file:///Users/tiantian/Desktop/computent/package.json) 中的 `"version"` 字段。
33
+ - 例如,从 `0.3.1` 升级到 `0.3.2`:
34
+ ```json
35
+ {
36
+ "name": "xc-computent",
37
+ "version": "0.3.2",
38
+ ...
39
+ }
40
+ ```
41
+ - 也可以直接在控制台运行以下命令自动升级版本:
42
+ ```bash
43
+ # 升级修订号 (e.g., 0.3.1 -> 0.3.2)
44
+ npm version patch
45
+ # 升级次版本号 (e.g., 0.3.1 -> 0.4.0)
46
+ npm version minor
47
+ # 升级主版本号 (e.g., 0.3.1 -> 1.0.0)
48
+ npm version major
49
+ ```
50
+
51
+ ### 2. 构建打包
52
+ 发布前必须先编译生成最新的生产包:
34
53
  ```bash
35
54
  pnpm build
36
55
  ```
56
+ 编译成功后,将在 `dist/` 目录下生成打包好的 ESM、UMD 格式文件以及 TypeScript 声明文件。
37
57
 
38
- ### 4. Local Build Preview
39
- Previews the bundled output locally:
58
+ ### 3. 执行发布
59
+ 直接在项目根目录下运行发布命令:
40
60
  ```bash
41
- pnpm preview
61
+ npm publish
42
62
  ```
63
+ > **💡 提示**:因为 `.npmrc` 中已配置了发布 Token,此命令会直接将包推送到官方 NPM 镜像源中。
43
64
 
44
65
  ---
45
66
 
46
- ## 🚀 How to Publish to npm
67
+ ## 🛠️ 本地开发与预览
47
68
 
48
- Follow these step-by-step instructions to publish this library to the npm registry:
69
+ 如果你需要在本地对组件进行开发或调试:
49
70
 
50
- ### Step 1: Customize Your Package Name
51
- Before publishing, open `package.json` and change the `"name"` property to your desired name (e.g. `"my-awesome-components"`). Ensure the name is unique on npm.
52
- ```json
53
- {
54
- "name": "computent",
55
- "version": "0.1.0",
56
- ...
57
- }
58
- ```
59
-
60
- ### Step 2: Log In to npm
61
- Run the following command in your terminal and follow the prompts to log in (or register):
71
+ ### 1. 安装依赖
62
72
  ```bash
63
- npm login
73
+ pnpm install
64
74
  ```
65
75
 
66
- ### Step 3: Run the Build
67
- Always compile the latest code before publishing:
76
+ ### 2. 运行本地开发服务器 (Playground)
77
+ 启动 Vite 开发服务器以调试组件:
68
78
  ```bash
69
- pnpm build
79
+ pnpm dev
70
80
  ```
71
81
 
72
- ### Step 4: Publish to the Registry
73
- Publish the package to the npm registry. Since we configured `"files": ["dist"]` in `package.json`, only the bundled production code will be uploaded:
82
+ ### 3. 本地预览打包产物
74
83
  ```bash
75
- npm publish
76
- ```
77
- *Note: If you are using a scoped package name (e.g. `@my-org/computent`), you should publish it as public using:*
78
- ```bash
79
- npm publish --access public
84
+ pnpm preview
80
85
  ```
81
86
 
82
87
  ---
83
88
 
84
- ## 📦 How to Use the Published Library
89
+ ## 📦 如何在其他项目中使用
85
90
 
86
- ### 1. Installation
87
- Install the package from npm (replace `computent` with your published package name):
91
+ ### 1. 安装组件库
88
92
  ```bash
89
- npm install computent
93
+ npm install xc-computent
94
+ # 或
95
+ pnpm add xc-computent
90
96
  ```
91
97
 
92
- ### 2. Usage Option A: Global Registration (Vue Plugin)
93
- Import the library and its styles in your `main.ts` / `main.js`:
98
+ ### 2. 全局完整引入
99
+ `main.ts` `main.js` 中引入组件库及其样式:
94
100
  ```typescript
95
- import { createApp } from 'vue';
96
- import App from './App.vue';
101
+ import { createApp } from 'vue'
102
+ import App from './App.vue'
97
103
 
98
- // Import the component library & its styles
99
- import Computent from 'computent';
100
- import 'computent/dist/style.css';
104
+ // 引入组件库与样式
105
+ import XcComputent from 'xc-computent'
106
+ import 'xc-computent/dist/style.css'
101
107
 
102
- const app = createApp(App);
103
- app.use(Computent); // Registers <CButton> and <CBadge> globally
104
- app.mount('#app');
108
+ const app = createApp(App)
109
+ app.use(XcComputent) // 注册全局组件,如 <CToDoCard>
110
+ app.mount('#app')
105
111
  ```
106
112
 
107
- ### 3. Usage Option B: Individual Import (Tree-shaking)
108
- Import only the components you need directly inside your `.vue` files:
109
- ```html
113
+ ### 3. 按需引入 (推荐)
114
+ 直接在 Vue 组件中引入你需要用到的特定组件:
115
+ ```vue
110
116
  <template>
111
- <div>
112
- <Button variant="primary" size="md">Click Me</Button>
113
- <Badge type="success" dot>Online</Badge>
117
+ <div class="workbench">
118
+ <ToDoCard :data="todoData" @action="handleAction" />
114
119
  </div>
115
120
  </template>
116
121
 
117
122
  <script setup lang="ts">
118
- import { Button, Badge } from 'computent';
119
- import 'computent/dist/style.css'; // Don't forget to import styles!
123
+ import { ToDoCard } from 'xc-computent'
124
+ import 'xc-computent/dist/style.css' // 引入组件库样式
120
125
  </script>
121
126
  ```
127
+
@@ -16,6 +16,12 @@ interface ToDoCardProps {
16
16
  flowPathTypeList?: any[];
17
17
  }
18
18
  declare function __VLS_template(): {
19
+ "read-icon"?(_: {
20
+ item: any;
21
+ }): any;
22
+ "delete-icon"?(_: {
23
+ item: any;
24
+ }): any;
19
25
  "form-content"?(_: {
20
26
  item: any;
21
27
  }): any;
@@ -31,12 +37,12 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
31
37
  }>, {
32
38
  details: (item: any, type?: number) => void;
33
39
  }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
34
- details: (...args: any[]) => void;
35
40
  getList: (...args: any[]) => void;
36
41
  doScreen: (...args: any[]) => void;
37
42
  copy: (...args: any[]) => void;
38
43
  delete: (...args: any[]) => void;
39
44
  expedite: (...args: any[]) => void;
45
+ details: (...args: any[]) => void;
40
46
  }, string, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ToDoCardProps>, {
41
47
  countList: () => never[];
42
48
  typeFlowPath: string;
@@ -46,12 +52,12 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
46
52
  contractTypeLabelMap: () => {};
47
53
  flowPathTypeList: () => never[];
48
54
  }>>> & {
49
- onCopy?: ((...args: any[]) => any) | undefined;
50
- onDetails?: ((...args: any[]) => any) | undefined;
51
55
  onGetList?: ((...args: any[]) => any) | undefined;
52
56
  onDoScreen?: ((...args: any[]) => any) | undefined;
57
+ onCopy?: ((...args: any[]) => any) | undefined;
53
58
  onDelete?: ((...args: any[]) => any) | undefined;
54
59
  onExpedite?: ((...args: any[]) => any) | undefined;
60
+ onDetails?: ((...args: any[]) => any) | undefined;
55
61
  }, {
56
62
  countList: any[];
57
63
  typeFlowPath: string;