Skip to content

Commit c57f5a2

Browse files
Merge pull request #4 from claude-code-best/feature/prod
Feature/prod
2 parents 8f6800f + 722d59b commit c57f5a2

19 files changed

Lines changed: 1485 additions & 111 deletions

File tree

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{json,yml,yaml}]
15+
indent_style = space
16+
indent_size = 2

.githooks/pre-commit

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
# pre-commit hook: 对暂存的文件运行 Biome 检查
3+
# 仅检查 src/ 下的 .ts/.tsx/.js/.jsx 文件
4+
5+
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^src/.*\.(ts|tsx|js|jsx)$')
6+
7+
if [ -z "$STAGED_FILES" ]; then
8+
exit 0
9+
fi
10+
11+
echo "Running Biome lint on staged files..."
12+
13+
# 使用 biome lint 对暂存文件进行检查(仅 lint,不格式化,不自动修复)
14+
echo "$STAGED_FILES" | xargs bunx biome lint --no-errors-on-unmatched
15+
16+
if [ $? -ne 0 ]; then
17+
echo ""
18+
echo "Biome lint failed. Fix errors or use --no-verify to bypass."
19+
exit 1
20+
fi
21+
22+
exit 0

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, feature/*]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
ci:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: oven-sh/setup-bun@v2
17+
with:
18+
bun-version: latest
19+
20+
- name: Install dependencies
21+
run: bun install --frozen-lockfile
22+
23+
- name: Lint
24+
run: bun run lint
25+
26+
- name: Test
27+
run: bun test
28+
29+
- name: Build
30+
run: bun run build

TODO.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,17 @@
1010
- [x] `color-diff-napi` — 颜色差异计算 NAPI 模块 (纯 TS 实现)
1111
- [x] `image-processor-napi` — 图像处理 NAPI 模块 (sharp + osascript 剪贴板)
1212

13-
<!-- - [ ] `@ant/computer-use-swift` — Computer Use Swift 原生模块
14-
- [ ] `@ant/computer-use-mcp` — Computer Use MCP 服务
15-
- [ ] `@ant/computer-use-input` — Computer Use 输入模块
16-
- [ ] `@ant/claude-for-chrome-mcp` — Chrome MCP 扩展 -->
13+
- [x] `@ant/computer-use-swift` — Computer Use Swift 原生模块 (macOS JXA/screencapture 实现)
14+
- [x] `@ant/computer-use-mcp` — Computer Use MCP 服务 (类型安全 stub + sentinel apps + targetImageSize)
15+
- [x] `@ant/computer-use-input` — Computer Use 输入模块 (macOS AppleScript/JXA 实现)
16+
<!-- - [ ] `@ant/claude-for-chrome-mcp` — Chrome MCP 扩展 -->
17+
18+
## 工程化能力
19+
20+
- [x] 代码格式化与校验
21+
- [x] 冗余代码检查
22+
- [x] git hook 的配置
23+
- [x] 代码健康度检查
24+
- [x] Biome lint 规则调优(适配反编译代码,关闭格式化避免大规模 diff)
25+
- [x] 单元测试基础设施搭建 (test runner 配置)
26+
- [x] CI/CD 流水线 (GitHub Actions)

biome.json

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"includes": ["**", "!!**/dist", "!!**/packages/@ant"]
10+
},
11+
"formatter": {
12+
"enabled": false,
13+
"indentStyle": "tab",
14+
"lineWidth": 120
15+
},
16+
"linter": {
17+
"enabled": true,
18+
"rules": {
19+
"recommended": true,
20+
"suspicious": {
21+
"noExplicitAny": "off",
22+
"noAssignInExpressions": "off",
23+
"noDoubleEquals": "off",
24+
"noRedeclare": "off",
25+
"noImplicitAnyLet": "off",
26+
"noGlobalIsNan": "off",
27+
"noFallthroughSwitchClause": "off",
28+
"noShadowRestrictedNames": "off",
29+
"noArrayIndexKey": "off",
30+
"noConsole": "off",
31+
"noConfusingLabels": "off",
32+
"useIterableCallbackReturn": "off"
33+
},
34+
"style": {
35+
"useConst": "off",
36+
"noNonNullAssertion": "off",
37+
"noParameterAssign": "off",
38+
"useDefaultParameterLast": "off",
39+
"noUnusedTemplateLiteral": "off",
40+
"useTemplate": "off",
41+
"useNumberNamespace": "off",
42+
"useNodejsImportProtocol": "off",
43+
"useImportType": "off"
44+
},
45+
"complexity": {
46+
"noForEach": "off",
47+
"noBannedTypes": "off",
48+
"noUselessConstructor": "off",
49+
"noStaticOnlyClass": "off",
50+
"useOptionalChain": "off",
51+
"noUselessSwitchCase": "off",
52+
"noUselessFragments": "off",
53+
"noUselessTernary": "off",
54+
"noUselessLoneBlockStatements": "off",
55+
"noUselessEmptyExport": "off",
56+
"useArrowFunction": "off",
57+
"useLiteralKeys": "off"
58+
},
59+
"correctness": {
60+
"noUnusedVariables": "off",
61+
"noUnusedImports": "off",
62+
"useExhaustiveDependencies": "off",
63+
"noSwitchDeclarations": "off",
64+
"noUnreachable": "off",
65+
"useHookAtTopLevel": "off",
66+
"noVoidTypeReturn": "off",
67+
"noConstantCondition": "off",
68+
"noUnusedFunctionParameters": "off"
69+
},
70+
"a11y": {
71+
"recommended": false
72+
},
73+
"nursery": {
74+
"recommended": false
75+
}
76+
}
77+
},
78+
"javascript": {
79+
"formatter": {
80+
"quoteStyle": "double"
81+
}
82+
},
83+
"assist": {
84+
"enabled": false
85+
}
86+
}

0 commit comments

Comments
 (0)