[PR #13398] fix(dev): add postinstall script to configure git symlinks on Windows #14644

Closed
opened 2026-02-16 18:19:25 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13398

State: closed
Merged: No


Summary

  • Add script/windows-symlinks.ts that configures git symlinks on Windows
  • Add postinstall script to automatically run after bun install
  • Fixes TypeScript errors in symlinked .d.ts files on Windows

Problem

On Windows, git config core.symlinks defaults to false, causing git to write symlinks as plain text files. TypeScript then reads the symlink path string as code, resulting in errors like:

src/custom-elements.d.ts(1,1): error TS1128: Declaration or statement expected.

Solution

The postinstall script:

  1. Detects if running on Windows (exits early on other platforms)
  2. Enables core.symlinks in git config
  3. Restores the affected symlinked files from git index

Requirements

  • Windows 10+ with Developer Mode enabled, OR
  • Run terminal as Administrator

Closes #13397

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13398 **State:** closed **Merged:** No --- ## Summary - Add `script/windows-symlinks.ts` that configures git symlinks on Windows - Add `postinstall` script to automatically run after `bun install` - Fixes TypeScript errors in symlinked `.d.ts` files on Windows ## Problem On Windows, `git config core.symlinks` defaults to `false`, causing git to write symlinks as plain text files. TypeScript then reads the symlink path string as code, resulting in errors like: ``` src/custom-elements.d.ts(1,1): error TS1128: Declaration or statement expected. ``` ## Solution The postinstall script: 1. Detects if running on Windows (exits early on other platforms) 2. Enables `core.symlinks` in git config 3. Restores the affected symlinked files from git index ## Requirements - Windows 10+ with Developer Mode enabled, OR - Run terminal as Administrator Closes #13397
yindo added the pull-request label 2026-02-16 18:19:25 -05:00
yindo closed this issue 2026-02-16 18:19:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14644