Skip to content

fix(init): auto-fix git symlinks when core.symlinks is false#1353

Merged
fengmk2 merged 1 commit intovoidzero-dev:mainfrom
T4ko0522:fix/init-symlinks
Apr 10, 2026
Merged

fix(init): auto-fix git symlinks when core.symlinks is false#1353
fengmk2 merged 1 commit intovoidzero-dev:mainfrom
T4ko0522:fix/init-symlinks

Conversation

@T4ko0522
Copy link
Copy Markdown
Contributor

@T4ko0522 T4ko0522 commented Apr 9, 2026

Problem

This repository contains git symlinks in packages/core/ that reference files in the upstream vite/
directory:

  • packages/core/vite-rolldown.config.ts../../vite/packages/vite/rolldown.config.ts
  • packages/core/rollupLicensePlugin.ts../../vite/packages/vite/rollupLicensePlugin.ts

In a fresh Windows clone of this repository, core.symlinks can be false. In that case, git checks
out these entries as plain text files containing the target path instead of actual symlinks. This
causes the build to fail with Unexpected token, because the files are imported as TypeScript modules
but only contain a path string.

Solution

Add a _fix_symlinks recipe to justfile and run it as part of just init. The recipe checks
core.symlinks, and when it is not true, it enables it and re-checks out all tracked symlink
entries.

Both unix and Windows implementations are included.

The recipe is idempotent: when core.symlinks=true, it does nothing.

Test plan

  • Verified on Windows with a fresh git clone of this repository that core.symlinks=false and the
    symlinks are checked out incorrectly
  • Ran just _fix_symlinks on Windows via PowerShell and confirmed the symlinks were restored
  • Ran the unix _fix_symlinks commands manually in Git Bash and confirmed the symlinks were restored
  • Confirmed idempotency: running the recipe again with core.symlinks=true is a no-op

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 9, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 47888d9
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69d7fcb51148920007441f84

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 10, 2026

@cursor review

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 10, 2026

@T4ko0522 Thanks

@fengmk2 fengmk2 merged commit fe5789e into voidzero-dev:main Apr 10, 2026
36 checks passed
@T4ko0522 T4ko0522 deleted the fix/init-symlinks branch April 10, 2026 04:56
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.

2 participants