Skip to content

fix: 修复类型问题(#267)#271

Merged
claude-code-best merged 4 commits intomainfrom
types/fix-some-bugs
Apr 15, 2026
Merged

fix: 修复类型问题(#267)#271
claude-code-best merged 4 commits intomainfrom
types/fix-some-bugs

Conversation

@claude-code-best
Copy link
Copy Markdown
Owner

@claude-code-best claude-code-best commented Apr 15, 2026

Summary by CodeRabbit

  • New Features

    • Added typecheck npm script for TypeScript validation.
    • Added window-target screenshot capture capability to the API.
  • Bug Fixes

    • Improved Node.js compatibility by removing Bun-specific runtime polyfills and replacing them with native alternatives.
  • Chores

    • Consolidated TypeScript configuration across all packages using a shared base configuration.
    • Bumped version to 1.3.7.
    • Updated dependencies including @types/bun and added @types/node.

@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 15, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ccb-863780bf 🟢 Ready View Preview Apr 15, 2026, 2:52 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request standardizes TypeScript configuration across packages, migrates Bun-specific APIs to Node.js alternatives for better compatibility, adds type safety through non-null assertions in route handlers, and introduces new screenshot capture method stubs to platform backends.

Changes

Cohort / File(s) Summary
TypeScript Configuration
tsconfig.base.json, tsconfig.json, packages/**/tsconfig.json
Added centralized tsconfig.base.json with shared compiler options (ESNext, strict mode, React JSX), refactored root tsconfig.json to extend base config and broadened include glob to all packages, and added package-specific tsconfig.json files across ~15 packages.
Build System & Package Configuration
build.ts, package.json, CLAUDE.md
Updated build post-processing to patch Bun destructuring in bundled code; removed old Bun polyfill generation; bumped version to 1.3.7; added typecheck npm script; updated @types/bun and added @types/node dependencies; documented new typecheck step in CLI workflow.
macOS Backend Migration
packages/@ant/computer-use-input/src/backends/darwin.ts
Replaced Bun $ template execution with Node.js child_process (execFile, execFileSync, promisify) for osascript and jxa invocations, maintaining same function signatures and behavior.
Screenshot API Extension
packages/@ant/computer-use-swift/src/types.ts, packages/@ant/computer-use-swift/src/backends/darwin.ts, packages/@ant/computer-use-swift/src/backends/linux.ts
Added `captureWindowTarget(titleOrHwnd: string
Route Handler Type Safety
packages/remote-control-server/src/routes/v1/*.ts, packages/remote-control-server/src/routes/v2/*.ts, packages/remote-control-server/src/routes/web/*.ts
Applied non-null assertions (!) to route parameters (c.req.param("id"), c.req.param("workId")) and context values (c.get("uuid")) across ~10 route handlers to eliminate undefined typing from path and context variables.
Test Updates
packages/agent-tools/src/__tests__/compat.test.ts, packages/mcp-client/src/__tests__/*.test.ts, packages/color-diff-napi/src/__tests__/*.test.ts, packages/remote-control-server/src/__tests__/*.test.ts
Updated type casts in compatibility tests (as unknown as CoreTool), added parameters to tool method calls (isReadOnly, description), and adjusted test setup (empty session creation object).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

v6

Poem

🐰 TypeScript bundles gather tight,
Bun gives way to Node's light,
Non-null assertions mark the way,
Cross-platform screenshots here to stay! 📸

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title 'fix: 修复类型问题(#267)' is vague and uses non-descriptive language. While it mentions 'types' (类型问题), it doesn't convey the specific nature of the changes, which include TypeScript config consolidation, Bun destructuring patches, Node.js compatibility fixes, and API additions. Provide a more specific title that captures the main technical change, such as 'fix: consolidate TypeScript configuration and fix Bun/Node.js compatibility' or 'fix: add tsconfig.base.json and update package TypeScript configs'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch types/fix-some-bugs

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude-code-best claude-code-best merged commit 1a4e970 into main Apr 15, 2026
7 of 8 checks passed
y574444354 added a commit to y574444354/csc that referenced this pull request Apr 15, 2026
同步上游 4 个新提交:
- fix: 修复类型问题(claude-code-best#267) (claude-code-best#271)
- docs: 修复链接
- fix: 修复 node 下 ws 没打包问题
- fix: 修复 n 快捷键导致关闭的问题

冲突解决:
- README.md: 保留上游特性表格 + 保留 fork 品牌内容
- package.json: 保留 @costrict/csc 名称和版本,接纳上游 typecheck 脚本
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant