Skip to content

Commit 3ca88e4

Browse files
authored
Merge branch 'claude-code-best:main' into main
2 parents de200a4 + f484fc3 commit 3ca88e4

1,444 files changed

Lines changed: 76996 additions & 87376 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
root = true
22

33
[*]
4-
indent_style = tab
5-
indent_size = 4
4+
indent_style = space
5+
indent_size = 2
66
end_of_line = lf
77
charset = utf-8
88
trim_trailing_whitespace = true

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
CLAUDE_CODE_SKIP_CHROME_MCP_SETUP: "1"
3232
run: bun install --frozen-lockfile
3333

34+
- name: Lint and format check
35+
run: bunx biome ci .
36+
3437
- name: Type check
3538
run: bun run typecheck
3639

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ coverage
55
.env
66
*.log
77
.idea
8-
.vscode
8+
.vscode/*
9+
!.vscode/extensions.json
910
*.suo
1011
*.lock
1112
src/utils/vendor/

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bunx lint-staged

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bun 1.3.13

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"biomejs.biome",
4+
"ms-typescript.typescript",
5+
"oven.bun-vscode",
6+
"editorconfig.editorconfig"
7+
]
8+
}

CLAUDE.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ bun test src/utils/__tests__/hash.test.ts # run single file
4848
bun test --coverage # with coverage report
4949

5050
# Lint & Format (Biome)
51-
bun run lint # check only
52-
bun run lint:fix # auto-fix
53-
bun run format # format all src/
51+
bun run lint # lint check (全项目)
52+
bun run lint:fix # auto-fix lint issues
53+
bun run format # format all (全项目)
54+
bun run check # lint + format check (全项目)
55+
bun run check:fix # lint + format auto-fix
5456

5557
# Health check
5658
bun run health
@@ -82,9 +84,11 @@ bun run docs:dev
8284
- **Dev mode**: `scripts/dev.ts` 通过 Bun `-d` flag 注入 `MACRO.*` defines,运行 `src/entrypoints/cli.tsx`。默认启用全部 feature。
8385
- **Module system**: ESM (`"type": "module"`), TSX with `react-jsx` transform.
8486
- **Monorepo**: Bun workspaces — 15 个 workspace packages + 若干辅助目录 in `packages/` resolved via `workspace:*`
85-
- **Lint/Format**: Biome (`biome.json`)。`bun run lint` / `bun run lint:fix` / `bun run format`
87+
- **Lint/Format**: Biome (`biome.json`)。覆盖 `src/``scripts/``packages/` 全项目(含 `packages/@ant/`)。`bun run lint` / `bun run lint:fix` / `bun run format` / `bun run check` / `bun run check:fix`。42 条规则因 decompiled 代码被关闭,仅保留 `recommended` 基线。
88+
- **Pre-commit**: husky + lint-staged。提交时自动对暂存文件执行 `biome check --fix`(TS/JS)和 `biome format --write`(JSON)。
89+
- **CI Lint**: `ci.yml` 在依赖安装后、类型检查前执行 `bunx biome ci .`,lint 或格式化不达标则 CI 失败。
8690
- **Defines**: 集中管理在 `scripts/defines.ts`。当前版本 `2.1.888`
87-
- **CI**: GitHub Actions — `ci.yml`构建+测试)、`release-rcs.yml`(RCS 发布)、`update-contributors.yml`(自动更新贡献者)。
91+
- **CI**: GitHub Actions — `ci.yml`lint + 构建 + 测试)、`release-rcs.yml`(RCS 发布)、`update-contributors.yml`(自动更新贡献者)。
8892

8993
### Entry & Bootstrap
9094

@@ -328,7 +332,9 @@ bun run typecheck
328332
- **`src/` path alias** — tsconfig maps `src/*` to `./src/*`. Imports like `import { ... } from 'src/utils/...'` are valid.
329333
- **MACRO defines** — 集中管理在 `scripts/defines.ts`。Dev mode 通过 `bun -d` 注入,build 通过 `Bun.build({ define })` 注入。修改版本号等常量只改这个文件。
330334
- **构建产物兼容 Node.js**`build.ts` 会自动后处理 `import.meta.require`,产物可直接用 `node dist/cli.js` 运行。
331-
- **Biome 配置** — 大量 lint 规则被关闭(decompiled 代码不适合严格 lint)。`.tsx` 文件用 120 行宽 + 强制分号;其他文件 80 行宽 + 按需分号。
335+
- **Biome 配置** — 42 条 lint 规则因 decompiled 代码被关闭,仅保留 `recommended` 基线。格式化覆盖全项目(`src/``scripts/``packages/`,含 `packages/@ant/`)。`.tsx` 文件用 120 行宽 + 强制分号;其他文件 80 行宽 + 按需分号。JSON 格式化已启用。`.editorconfig` 与 Biome 配置对齐(2-space 缩进)。修改任何代码后应运行 `bun run check` 确认无 lint/格式问题,pre-commit hook 会自动拦截不合格提交。
336+
- **tsc 与 Biome 冲突处理** — 当 tsc 要求声明属性(赋值使用)但 biome 报 `noUnusedPrivateClassMembers`(只写不读)时,用 `// biome-ignore lint/correctness/noUnusedPrivateClassMembers: <原因>` 抑制 lint 警告,保留类型声明。`biome ci` 必须零 warnings。
337+
- **`@ts-expect-error` 维护** — 只在下方代码确实有类型错误时保留 `@ts-expect-error`。如果类型系统已更新导致 directive 变为 unused(TS2578),直接移除注释。MACRO 替换产生的永假比较(如 `'production' === 'development'`)仍需保留 `@ts-expect-error`
332338
- **Ink 框架在 `packages/@ant/ink/`** — 不是 `src/ink/`(该目录不存在)。Ink 相关的组件、hooks、keybindings 都在 packages 中。
333339
- **Provider 优先级**`modelType` 参数 > 环境变量 > 默认 `firstParty`。新增 provider 需在 `src/utils/model/providers.ts` 注册。
334340

0 commit comments

Comments
 (0)