fix: Windows compatibility across postinstall, desktop, plugins, and scripts#211
Open
mynameistito wants to merge 2 commits intoRhysSullivan:mainfrom
Open
fix: Windows compatibility across postinstall, desktop, plugins, and scripts#211mynameistito wants to merge 2 commits intoRhysSullivan:mainfrom
mynameistito wants to merge 2 commits intoRhysSullivan:mainfrom
Conversation
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.
Fixes 10 Windows compatibility issues found by scanning the codebase. Each fix is targeted and minimal.
Issues fixed
apps/cli/src/build.ts(postinstall script)Expand-Archivefails on Windows PowerShell 5.x (Fixes: #205)powershell.exefails to autoloadMicrosoft.PowerShell.Archivein some environments. Now triespwsh(PowerShell 7) first and falls back topowershell.exeif it fails or isn't present.platform === "win32"comparison always false (Fixes: #206)platformis mapped throughplatformMapto"windows", but the legacy binary path check compared against"win32". The old.executor.exebinary was never cleaned up on Windows. Fixed to compare against"windows".chmodcalled unconditionally on Windows (Fixes: #207)fs.chmodSync(cachedBinary, 0o755)throws on Windows. Guarded withif (platform !== "windows").packages/kernel/runtime-deno-subprocess/src/index.tsDeno lookup uses
HOMEand no.exe(Fixes: #208)HOMEis typically unset on Windows; the correct var isUSERPROFILE. Deno on Windows also installs to%USERPROFILE%\.deno\bin\deno.exe. Both fixed.Worker script path resolution broken on Windows (Fixes: #210)
resolveWorkerScriptPathhad amoduleUrl.startsWith("/")shortcut that silently broke on Windows, whereimport.meta.urlisfile:///C:/.... Removed the shortcut so all cases go throughfileURLToPath.packages/plugins/file-secrets/src/index.tsAuth stored in
~/.local/shareon Windows (Fixes: #209).local/shareis an XDG/Linux convention. On Windows the correct location is%LOCALAPPDATA%.xdgDataHome()now branches onprocess.platform === "win32"and usesLOCALAPPDATA(falling back toAPPDATA).apps/desktop/src/main.tsDesktop app skips PATH patching entirely on Windows (Fixes: #203)
After copying the CLI binary, the app returned early on
win32without touching PATH. Windows users had to update PATH manually. Now adds the bin dir toHKCU\Environmentviareg addso new terminals pick it up automatically.Scope path display breaks on Windows paths (Fixes: #204)
scopePath.split("/").pop()produces wrong results for Windows paths with backslashes. Fixed to usepath.basename()with trailing separator stripped.apps/local/src/web/shell.tsxPath splitting uses
/only (Fixes: #204)name.split("/")inScopeLabelbreaks on Windows paths. Fixed to split on[/\].package.json+scripts/clean.tscleanscript usesrm -rfand GNUfind(Fixes: #201)Neither works on Windows without WSL. Replaced with
scripts/clean.ts, a small cross-platform Bun script that replicates the same directory removal logic usingfs.rmSync.apps/cloud/package.jsonDeploy script uses
sh -c(Fixes: #202)shisn't available on Windows. Replacedsh -c 'vite build && wrangler deploy'by running each command directly withop run.Fixes: #196
Test Checklist
Postinstall (most important)
bun install -g executorcompletes without error on Windows (noExpand-Archivemodule load failure)pwshfirst: rename/removepwsh.exetemporarily and confirm it falls back topowershell.execleanly%APPDATA%\...\executor\runtime\executor.exeexists and is runnableClean script
bun run cleanfrom repo root completes without error on Windowsnode_modules,dist,.turboare removed from root and allapps/+packages/subdirsFile secrets path
auth.jsonis created under%LOCALAPPDATA%\executor\not~\.local\share\executor\Deno subprocess runtime
%USERPROFILE%\.deno\bin\deno.exewithout needingDENO_BINset manuallyDENO_BINoverride still works when setDesktop PATH patching
executor— should be found on PATH without manual editsreg query HKCU\Environment /v Pathcontains the executor bin dir after installScope path display
C:\Users\name\projects\myapp— label should showmyapp, not a broken stringCloud deploy (needs op + wrangler)
bun run deployinapps/cloudno longer fails withsh: command not foundIdentified and fixed with AI assistance.