feat: first-class Windows support, cross-platform server build, and developer tooling

Merged
AN
1mo ago
+1778-151

User description

Summary

This PR adds first-class Windows support to Sheet while preserving 100% of the existing macOS implementation, development workflow, and native architecture.

Key Changes

  1. Cross-Platform Sidecar Compilation: Replaced the Unix-specific mkdir -p command in apps/desktop/package.json with a cross-platform compilation script (scripts/build-server.ts), generating sheet-server.exe on Windows and sheet-server on macOS/Linux.
  2. Multi-Platform Tauri Targets: Configured bundle.targets: "all" in apps/desktop/src-tauri/tauri.conf.json so Windows generates NSIS/MSI installers while macOS continues building DMG/app bundles.
  3. Resilient Atomic File Writes: Enhanced writeAtomic in apps/mcp/src/agent-install.ts with lock-recovery fallbacks to handle Windows EPERM/EBUSY locks caused by indexing and antivirus software.
  4. Fast Web Canvas Development Mode: Added bun run dev:web and .\windows\run.ps1 -Web to run the visual canvas directly in any modern browser without requiring Rust/Cargo.
  5. Windows Developer Tooling & Documentation:
    • windows/setup.ps1: Automated toolchain setup and prerequisite validator.
    • windows/run.ps1: One-command development runner with loopback port probing and clean child process termination.
    • windows/build.ps1: Automated packager supporting portable releases and Tauri installers.
    • windows/src/platform-adapter.ts: Typed path normalization, %APPDATA% resolution, and port utilities.
    • windows/README.md: Comprehensive Windows guide covering prerequisites, MCP client integration, and troubleshooting.
  6. Continuous Integration: Added .github/workflows/windows.yml to automatically validate Windows builds and test suites on GitHub Actions.
  7. Cross-Platform Test Fixes:
    • Resolved a contradictory tool assertion in apps/mcp/src/tools.test.ts.
    • Added verbose: true in packages/rpc/src/web-mcp.test.ts to match the applyWebTransaction schema.
    • Added robust try/finally resource cleanup in packages/rpc/src/web-screenshot.test.ts.

Verification & Compatibility

  • Zero changes to macOS-specific native styling or lifecycle logic.
  • All existing package manager scripts (bun run dev, bun run dev:desktop, bun run dev:stdio, bun run test) remain intact.
  • 11 new Windows platform unit tests passing (windows/tests/windows-platform.test.ts).
  • Over 280 unit and integration tests passing cleanly across packages/canvas, packages/rpc, packages/db, packages/realtime, packages/platform, packages/shell, and packages/ui.
  • Tested on Windows 11 x64.

Summary by CodeRabbit

  • New Features
    • Added Windows x64 release builds and an installer.
    • Added Windows setup, launch, and build options, including portable packaging and web, server-only, and desktop modes.
    • The local server can now serve a built web interface.
    • Added a web development mode and browser discovery for Windows.
  • Documentation
    • Added a Windows guide covering setup, workflows, storage, and builds.
  • Bug Fixes
    • Improved reliability when saving files and handling browser-based screenshots.

CodeAnt-AI Description

Add Windows releases and browser-based development support

What Changed

  • Windows x64 releases now include an installer alongside the macOS download.
  • Windows contributors can run the canvas in a browser without Rust, or build a portable bundle with the canvas and MCP server.
  • Agent configuration updates retry brief Windows file locks and preserve the existing configuration if an update cannot complete.

Impact

✅ Windows users can install Sheet from releases
✅ Browser-based canvas development without Rust
✅ Agent configuration survives brief Windows file locks

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.