feat(workspaces): native cross-platform bootstrap — bundle git (dugite) + port bash to Node#363
Open
luokerenx4 wants to merge 1 commit into
Open
feat(workspaces): native cross-platform bootstrap — bundle git (dugite) + port bash to Node#363luokerenx4 wants to merge 1 commit into
luokerenx4 wants to merge 1 commit into
Conversation
…e) + port bash to Node Workspace creation (the Harness: every workspace is a fresh git repo) had two external deps that break on a bare machine: bash (the bootstrap scripts) and system git. bash is absent on Windows; git is latent on Mac too (a fresh Mac's /usr/bin/git is an Xcode-CLT stub — our dev Macs only have it because CLT was installed long ago). So workspace creation failed on a bare Windows box, and would on a bare Mac. Now it needs neither: - Bundle git via dugite (GitHub Desktop's package; postinstall fetches a per-platform standalone git — same per-platform model as longbridge, picked up by electron-builder's node_modules inclusion under asar:false). - Port the bash bootstraps to Node: templates/_common.mjs (the sole dugite importer, exposes git()), chat/bootstrap.mjs, auto-quant/bootstrap.mjs. The launcher spawns them on the Electron-bundled Node (process.execPath + ELECTRON_RUN_AS_NODE) — no bash, no shebang reliance, plain ESM. - Route ALL git through the bundled git: runGit (initial commit) and git-service (panel log/branch/status) → dugite's exec(). - template-registry prefers bootstrap.mjs, falls back to bootstrap.sh for third-party templates (which still need bash where they run). dugite MUST stay in pnpm.onlyBuiltDependencies — its postinstall fetches the git binary; drop it and node_modules/dugite/git/ is silently empty. Release CI asserts the binary is present per-platform. Verified: tsc clean, 2003 unit tests + e2e (incl a PATH-stripped case proving no system git/bash) green; packaged .app carries dugite's git 2.53.0 + the .mjs templates. Closes the bare-Windows / bare-Mac workspace-creation gap. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Workspace creation (the Harness: every workspace is a fresh git repo) had two external deps that break on a bare machine —
bash(the bootstrap scripts) and system git. bash is absent on Windows; git is latent on Mac too (a fresh Mac's/usr/bin/gitis an Xcode-CLT stub — our dev Macs only have it because CLT was installed long ago, a dogfooding blind spot). So workspace creation failed on a bare Windows box and would on a bare Mac.Now it needs neither:
dugite(GitHub Desktop's package; postinstall fetches a per-platform standalone git — same per-platform model as longbridge, picked up by electron-builder's node_modules inclusion underasar:false). Pinned exact (3.2.2, embedded git 2.53.0).templates/_common.mjs(the sole dugite importer, exposesgit()),chat/bootstrap.mjs,auto-quant/bootstrap.mjs. The launcher spawns them on the Electron-bundled Node (process.execPath+ELECTRON_RUN_AS_NODE) — no bash, no shebang reliance, plain ESM.runGit(initial commit) andgit-service(panel log/branch/status) → dugite'sexec().template-registryprefersbootstrap.mjs, falls back tobootstrap.shfor third-party templates (which still need bash where they run).dugitemust stay inpnpm.onlyBuiltDependencies— its postinstall fetches the git binary; drop it andnode_modules/dugite/git/is silently empty (no install error, runtime failure). Release CI now asserts the binary is present per-platform.Test plan
npx tsc --noEmitcleanpnpm test— 2003 passingpnpm test:e2e— chat/auto-quant create flow via real dugite, incl a PATH-stripped case (no system git/bash on PATH) proving the bare-machine path.appcarriesnode_modules/dugite/git/bin/git(2.53.0, runs) + the.mjstemplates; old.shgoneBoundary touch
Workspace launcher + packaging only. No trading/auth/broker/migration logic. Adds one runtime dep (dugite) + its onlyBuiltDependencies entry.
🤖 Generated with Claude Code