Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .codegraph/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CodeGraph data files — local to each machine, not for committing.
# Ignore everything in .codegraph/ except this file itself, so transient
# files (the database, daemon.pid, sockets, logs) never show up in git.
*
!.gitignore
100 changes: 100 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,103 @@ jobs:

- name: Run tests
run: pnpm --filter @vaebe/ccui test

e2e-coverage:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: 22.x
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check E2E coverage
run: pnpm check:e2e-coverage

e2e:
needs: e2e-coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: 22.x
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Chromium
run: pnpm --filter @vaebe/ccui-e2e exec playwright install --with-deps chromium

- name: Run E2E tests
run: pnpm --filter @vaebe/ccui-e2e exec playwright test --shard=${{ matrix.shard }}/4 --reporter=blob

- name: Upload E2E shard report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-blob-${{ matrix.shard }}
path: packages/e2e/blob-report/
if-no-files-found: ignore
retention-days: 7

e2e-report:
if: ${{ !cancelled() }}
needs: e2e
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: 22.x
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Download shard reports
uses: actions/download-artifact@v5
with:
pattern: playwright-blob-*
path: packages/e2e/all-blob-reports
merge-multiple: true

- name: Merge Playwright report
run: pnpm --filter @vaebe/ccui-e2e exec playwright merge-reports --reporter=html ./all-blob-reports

- name: Upload merged E2E report
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: packages/e2e/playwright-report/
if-no-files-found: error
retention-days: 7
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ packages/*/CHANGELOG.md
# test
packages/ccui/coverage
packages/ccui/ui/**/__snapshots__
packages/e2e/blob-report/
packages/e2e/all-blob-reports/
packages/e2e/playwright-report/
packages/e2e/test-results/
test-results/
.pnpm-debug.log
.claude
.codeflicker
docs-notes/screenshots
docs-notes/screenshots
391 changes: 0 additions & 391 deletions CCUI-OPTIMIZATION-RISK-REPORT.md

This file was deleted.

16 changes: 8 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ v2 beta 阶段集中清理:把 v2 引入的 Ant 风格新名(v2 beta 期间

模板批量替换(kebab-case 与 PascalCase 同时改):

| 组件 | 删除(新名) | 替换为(旧名) |
|---|---|---|
| Input | `allow-clear` / `addon-before` / `addon-after` | `clearable` / `prepend` / `append` |
| Tooltip | `title` / `arrow` / `mouse-enter-delay` / `mouse-leave-delay` / `overlay-class-name` | `content` / `show-arrow` / `show-after` / `hide-after` / `popper-class` |
| Popover | `arrow` / `mouse-enter-delay` / `mouse-leave-delay` / `overlay-class-name` / `get-popup-container` | `show-arrow` / `show-after` / `hide-after` / `popper-class` / `teleported` |
| Popconfirm | `ok-text` / `ok-type` | `confirm-text` / `confirm-type` |
| Button | `html-type` / `shape="round"` / `shape="circle"` / `variant="..."` | `native-type` / `round` boolean / `circle` boolean / `plain` boolean |
| InputNumber | `size="lg"` / `"md"` / `"sm"` | `size="large"` / `"default"` / `"small"` |
| 组件 | 删除(新名) | 替换为(旧名) |
| ----------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| Input | `allow-clear` / `addon-before` / `addon-after` | `clearable` / `prepend` / `append` |
| Tooltip | `title` / `arrow` / `mouse-enter-delay` / `mouse-leave-delay` / `overlay-class-name` | `content` / `show-arrow` / `show-after` / `hide-after` / `popper-class` |
| Popover | `arrow` / `mouse-enter-delay` / `mouse-leave-delay` / `overlay-class-name` / `get-popup-container` | `show-arrow` / `show-after` / `hide-after` / `popper-class` / `teleported` |
| Popconfirm | `ok-text` / `ok-type` | `confirm-text` / `confirm-type` |
| Button | `html-type` / `shape="round"` / `shape="circle"` / `variant="..."` | `native-type` / `round` boolean / `circle` boolean / `plain` boolean |
| InputNumber | `size="lg"` / `"md"` / `"sm"` | `size="large"` / `"default"` / `"small"` |

`<c-tooltip>` / `<c-popover>` 自定义浮层内容:原来用 `<template #title>` 的需要改为 `<template #content>`;Tooltip 浮层箭头 `pointAtCenter` 复合用法以及 Tooltip / Popover 的 `getPopupContainer` 容器函数已无替代——继续依赖请评估自行 fork 或在外层 portal 组件包装。

Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ npm install @vaebe/ccui --save
yarn add @vaebe/ccui

# pnpm
pnpm install @vaebe/ccui
pnpm add @vaebe/ccui
```

## 🚀 快速开始
Expand Down Expand Up @@ -61,7 +61,7 @@ app.mount('#app')

## 📚 组件

覆盖通用 / 导航 / 反馈 / 数据录入 / 数据展示 / 布局 / 其他七大类,共 **84 个组件 / 工具入口**。**API 命名采用 Vue-first 习惯**(受控显示用 `visible` / `v-model:visible`,而非 React 生态的 `open`),完整命名约定见 [`docs-notes/decisions/benchmark-principles.md`](./docs-notes/decisions/benchmark-principles.md)。
覆盖通用 / 导航 / 反馈 / 数据录入 / 数据展示 / 布局 / 其他七大类,共 **83 个组件 / 工具与主题指南入口**。**API 命名采用 Vue-first 习惯**(受控显示用 `visible` / `v-model:visible`,而非 React 生态的 `open`),完整命名约定见 [`docs-notes/decisions/benchmark-principles.md`](./docs-notes/decisions/benchmark-principles.md)。

完整组件列表、API 与在线示例见 [📖 在线文档](https://vaebe.github.io/ccui/)。

Expand All @@ -71,12 +71,14 @@ app.mount('#app')

## 🛠️ 开发

> 仓库已接入 [Vite+](https://viteplus.dev/),需要预先全局安装 `vp`:
> 仓库已接入 [Vite+](https://viteplus.dev/),需要预先全局安装 `vp`(Linux / macOS)
>
> ```bash
> npm i -g vp
> curl -fsSL https://vite.plus | bash
> ```
>
> Windows 安装方式见 [Vite+ 官方指南](https://viteplus.dev/guide/)。
>
> 同时要求 Node `>= 22.10`(用于 cli 包的原生 TypeScript type stripping)。

```bash
Expand Down Expand Up @@ -146,7 +148,7 @@ node scripts/publish.mjs --tag latest # 正式发版

## 📄 许可证

[Apache-2.0](./LICENSE)
[MIT](./LICENSE)

## 🔗 相关链接

Expand Down
25 changes: 13 additions & 12 deletions docs-notes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,31 @@
ccui 工程层的 **shared memory**:决策约束、发布流程、维护基线。面向开发者本人 / AI / 未来贡献者,**不进入 VitePress 文档站**。

> 与 [`packages/docs/`](../packages/docs/)(VitePress 文档站)的分工:
>
> - `packages/docs/` —— 面向使用方,写 demo / props / events。
> - `docs-notes/` —— 面向贡献者,写决策、约束、流程、未决项。
>
> 一句话判别:读者是「写业务的工程师」→ `packages/docs/`;读者是「下一次会话的我自己 / Claude / Codex」→ `docs-notes/`。

## 目录

| 文件 / 目录 | 用途 |
| ---------------------------------------------------------- | ------------------------------------------------- |
| [decisions/](./decisions/) | 不变性约束(一旦合入,后续工作必须遵守) |
| [releasing.md](./releasing.md) | npm 发布流程、2FA / passkey、故障排查 |
| [bundle-size-baseline.md](./bundle-size-baseline.md) | 当前体积基线(v2.0 snapshot) |
| 文件 / 目录 | 用途 |
| ---------------------------------------------------- | ---------------------------------------- |
| [decisions/](./decisions/) | 不变性约束(一旦合入,后续工作必须遵守) |
| [releasing.md](./releasing.md) | npm 发布流程、2FA / passkey、故障排查 |
| [bundle-size-baseline.md](./bundle-size-baseline.md) | 当前体积基线(v2.0 snapshot) |

## decisions/

约束类决策。**和「修复记录」严格区分**:只有具备「反向决策成本」与「长期不变性约束」的内容才进。

| 文件 | 主题 |
| -------------------------------------------------------------------------- | ----------------------------------------------------- |
| [benchmark-principles.md](./decisions/benchmark-principles.md) | 对标 Ant Design 的边界:不照搬 React-only,翻译 Vue 化 |
| [brand-color.md](./decisions/brand-color.md) | 默认主色 `#1677ff` 全量对齐 v6 |
| [design-values.md](./decisions/design-values.md) | 自然 / 确定 / 意义 / 生长 四原则在 ccui 的体现 |
| [config-provider-locale.md](./decisions/config-provider-locale.md) | ConfigProvider locale / theme.algorithm 接通承诺 |
| [testing-principles.md](./decisions/testing-principles.md) | 测试术语用 Vue 语境 + 测试优先级(先测真实行为) |
| 文件 | 主题 |
| ------------------------------------------------------------------ | ------------------------------------------------------ |
| [benchmark-principles.md](./decisions/benchmark-principles.md) | 对标 Ant Design 的边界:不照搬 React-only,翻译 Vue 化 |
| [brand-color.md](./decisions/brand-color.md) | 默认主色 `#1677ff` 全量对齐 v6 |
| [design-values.md](./decisions/design-values.md) | 自然 / 确定 / 意义 / 生长 四原则在 ccui 的体现 |
| [config-provider-locale.md](./decisions/config-provider-locale.md) | ConfigProvider locale / theme.algorithm 接通承诺 |
| [testing-principles.md](./decisions/testing-principles.md) | 测试术语用 Vue 语境 + 测试优先级(先测真实行为) |

## 写新笔记的约定

Expand Down
56 changes: 28 additions & 28 deletions docs-notes/bundle-size-baseline.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,53 @@ build cmd:`pnpm build:lib`(实际跑 `vp run --filter ccui-cli build:lib`

## 总览(全量 all-in-one bundle)

| 项 | raw | gzip |
|---|---|---|
| `vue-ccui.es.js` | 515.57 KB | 132.51 KB |
| `vue-ccui.umd.js` | 418.43 KB | 118.41 KB |
| `style.css`(顶层合并 css) | 268.59 KB | 36.64 KB |
| 项 | raw | gzip |
| --------------------------- | --------- | --------- |
| `vue-ccui.es.js` | 515.57 KB | 132.51 KB |
| `vue-ccui.umd.js` | 418.43 KB | 118.41 KB |
| `style.css`(顶层合并 css) | 268.59 KB | 36.64 KB |

注:`external = ['vue', 'vue-router', '@vueuse/core', '@floating-ui/dom']`,gzip 体积已扣掉这些 peer。

## 前 10 大组件 chunk(按组件目录 `index.es.js`,按 gzip 排序)

| chunk | raw | gzip |
|---|---|---|
| tree-select | 79.77 KB | 24.06 KB |
| date-picker | 73.59 KB | 22.79 KB |
| range-picker | 67.18 KB | 21.37 KB |
| chunk | raw | gzip |
| ----------------- | -------- | -------- |
| tree-select | 79.77 KB | 24.06 KB |
| date-picker | 73.59 KB | 22.79 KB |
| range-picker | 67.18 KB | 21.37 KB |
| time-range-picker | 68.14 KB | 21.29 KB |
| time-picker | 62.64 KB | 20.37 KB |
| cascader | 60.39 KB | 19.06 KB |
| auto-complete | 51.86 KB | 17.00 KB |
| modal | 49.99 KB | 16.19 KB |
| select | 50.81 KB | 15.96 KB |
| tree | 52.30 KB | 15.77 KB |
| time-picker | 62.64 KB | 20.37 KB |
| cascader | 60.39 KB | 19.06 KB |
| auto-complete | 51.86 KB | 17.00 KB |
| modal | 49.99 KB | 16.19 KB |
| select | 50.81 KB | 15.96 KB |
| tree | 52.30 KB | 15.77 KB |

## Locale 包

ccui 当前 4 个 locale 用静态 `export` 暴露(`ui/locale/index.ts`),全量 `vue-ccui.es.js` 会把 4 份字符串都打进去;并未单独 emit 为 `locale/zh-CN.js` chunk。源文件体量参考:

| locale 源文件 | source raw |
|---|---|
| zh-CN.ts | 1941 B |
| en-US.ts | 1732 B |
| ja-JP.ts | 1859 B |
| ko-KR.ts | 1883 B |
| ------------- | ---------- |
| zh-CN.ts | 1941 B |
| en-US.ts | 1732 B |
| ja-JP.ts | 1859 B |
| ko-KR.ts | 1883 B |

**结论**:i18n 字符串走 named export,用户侧 `import { enUS } from '@vaebe/ccui'` 走 tree-shaking 即可只带一份。全量 bundle 默认带全 4 份(合计 < 8 KB 源码、gzip 后量级更小),未做强行 split。

## dayjs locale 分包

`packages/ccui/build/` 顶层除主 bundle 外另有以下 lazy chunk:

| chunk | raw | gzip |
|---|---|---|
| `en-BVwCvuzF.js` | 840 B | 536 B |
| `ja-B4U4rt8A.js` | 1763 B | 825 B |
| `ko-BG35I8uK.js` | 1791 B | 827 B |
| `zh-cn-C8nbfD5S.js` | 2017 B | 993 B |
| `chunk-Ndeg2fpE.js`(rolldown 共享 runtime) | 998 B | 560 B |
| chunk | raw | gzip |
| -------------------------------------------- | ------ | ----- |
| `en-BVwCvuzF.js` | 840 B | 536 B |
| `ja-B4U4rt8A.js` | 1763 B | 825 B |
| `ko-BG35I8uK.js` | 1791 B | 827 B |
| `zh-cn-C8nbfD5S.js` | 2017 B | 993 B |
| `chunk-Ndeg2fpE.js`(rolldown 共享 runtime) | 998 B | 560 B |

每个 chunk 头部都是 `import { t } from "./vue-ccui.es.js"` + `import('dayjs/locale/xxx')` 的产物,说明 `ui/shared/utils/dayjs-locale.ts` 里 `switch` 显式 `import('dayjs/locale/zh-cn')` 等被打包工具成功识别为按需 chunk。

Expand Down
Loading
Loading