Skip to content

feat: auto-detect Windows in dev mode, run server on Node.js#6

Merged
jwangkun merged 3 commits into
PeakCode-AI:mainfrom
FitzzZOwO:feat/windows-dev-auto-detect
Jun 10, 2026
Merged

feat: auto-detect Windows in dev mode, run server on Node.js#6
jwangkun merged 3 commits into
PeakCode-AI:mainfrom
FitzzZOwO:feat/windows-dev-auto-detect

Conversation

@FitzzZOwO

Copy link
Copy Markdown
Contributor

What Changed

  • Windows 开发模式自动检测bun dev 在 Windows 上自动拆分为两个进程 —— turbo 驱动 contracts + Vite,Node.js 直接运行预构建的 server。因为 Bun 在 Windows 上未实现 ConPTY,无法运行 server。同时新增 bun run dev:win 显式命令。
  • 添加 `.gitattributes*:强制所有源码文件使用 LF 行尾,防止 Windows CRLF 导致的跨平台问题。
  • **重构 ProviderHealth.ts\***:移除 runCommandHealthProbe辅助函数,将Effect.timeoutOption+Effect.result` 内联到各调用处,消除不必要的抽象层。
  • 清理相关测试和死代码

Why

在 Windows 上运行 bun dev 会因为 Bun 不支持 ConPTY 而导致 server 进程异常。通过自动检测平台,在 Windows 上切换到 Node.js 运行 server,同时保持 macOS/Linux 上的原有行为不变。这让 Windows 开发者无需额外配置即可参与开发。

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (not applicable)
  • I included a video for animation/interaction changes (not applicable)

 now detects Windows and spawns the server on Node.js
instead of Bun. This works around Bun's lack of Windows ConPTY support
by splitting into two coordinated processes: turbo manages contracts +
Vite (Bun), while the server runs on Node.js where node-pty provides
full Windows PTY support.

macOS/Linux behavior is unchanged — turbo runs all three packages as
before. The explicit dev:win mode is preserved as an opt-in fallback.

Also updates README Windows instructions from a manual two-terminal
workflow to the same
flow used on other platforms.
Prevents spurious CRLF-modified status on generated files
(mockServiceWorker.js, routeTree.gen.ts) when working on Windows
with core.autocrlf=true.
Add .astro/.jsonc/.plist/.td text eol=lf rules and .icns binary rule
@github-actions github-actions Bot added size:L vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Jun 10, 2026

@jwangkun jwangkun left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #6 review: APPROVED. Fixes Windows ConPTY issue in dev mode. typecheck/lint/fmt passed, affected tests pass. See full review details below.

Analysis

  1. dev-runner.ts: Windows split-mode using Effect/ChildProcess patterns - clean
  2. .gitattributes: LF line endings enforced across all source types
  3. README: Windows dev instructions (EN + CN)
  4. No bun.lock changes, no production code changes

Verdict: MERGEABLE

@jwangkun jwangkun merged commit 65db9c2 into PeakCode-AI:main Jun 10, 2026
5 checks passed
@FitzzZOwO FitzzZOwO deleted the feat/windows-dev-auto-detect branch June 11, 2026 01:00
jwangkun pushed a commit that referenced this pull request Jun 18, 2026
Auto-detect Windows platform in `bun dev` and split into two processes: turbo drives contracts + Vite (Bun), while the server runs on Node.js directly. This works around Bun's lack of Windows ConPTY support.

Also:
- Add .gitattributes enforcing LF line endings to prevent CRLF issues
- Add dev:win explicit command as opt-in fallback
- Update README and README.zh.md with Windows development instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants