Add full Windows support (new targets, install.ps1, build flags, ICO, metadata)#108
Add full Windows support (new targets, install.ps1, build flags, ICO, metadata)#108
Conversation
… metadata) - build.ts: remove bytecode (breaks Windows), add Windows-specific flags (icon, hideConsole, title, publisher, version, description, copyright), support bun-windows-x64-baseline / bun-windows-x64-modern / bun-windows-arm64 - build.test.ts: unit tests for parseTarget, isWindowsTarget, getOutfile, getBuildCompileOptions (35 cases) - install.ps1: detect ARM64, prefer x64-modern with auto-fallback to x64-baseline when asset is absent in the release - cd.yaml: add bun-windows-x64-baseline, bun-windows-x64-modern, bun-windows-arm64 to the build matrix - scripts/generate-ico.ts: generate multi-resolution ICO (16/32/48/256) from docs/public/logo.svg via sharp - docs/public/icons/favicon.ico: generated Windows icon asset - README.md: add Windows PowerShell quick-start block - package.json: add generate-ico script, add sharp dev dependency
|
Coverage after merging feat/windows-install-ps1 into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
🔦 Lighthouse Report
|
There was a problem hiding this comment.
Pull request overview
Adds end-to-end Windows support for github-code-search, covering build-time EXE metadata (icon/details), expanded Windows targets, a native PowerShell installer, and updated docs/CI to ship and document the new artifacts.
Changes:
- Updated
build.tsto support additional Windows targets and to emit Windows-specific executable metadata (icon/title/publisher/etc.), plus exported helper functions with new unit tests. - Added
install.ps1with architecture detection, minimum Windows build guard, download + fallback logic, PATH update, and verification. - Updated docs/README and the docs homepage install section to include PowerShell installation; added an ICO generator and committed the generated icon.
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
build.ts |
Adds Windows targets/metadata + exports helpers used by tests |
build.test.ts |
New unit tests for build helper functions |
install.ps1 |
New PowerShell installer with arch/version checks, download, PATH update, verification |
.github/workflows/cd.yaml |
Publishes additional Windows build variants as release artifacts |
docs/getting-started/installation.md |
Documents Windows installation via PowerShell |
docs/.vitepress/theme/InstallSection.vue |
Adds a Windows tab with PowerShell install command on the homepage |
scripts/generate-ico.ts |
Generates a multi-resolution Windows ICO from the SVG logo |
docs/public/icons/favicon.ico |
Adds generated ICO used for Windows executable icon metadata |
README.md |
Adds Windows PowerShell quick-start snippet |
package.json |
Adds generate-ico script and sharp dev dependency |
bun.lock |
Lockfile updates for the new dependency graph (sharp + transitive deps) |
…roles, win32 normalization - install.ps1: replace all 'return 1' with 'exit 1' so the process exits with a non-zero code when invoked via irm | iex - install.ps1: add -Target param so callers can force a specific variant (x64-modern, x64-baseline, arm64); arch detection only sets a default when -Target is omitted - install.ps1: remove -UseBasicParsing from Invoke-WebRequest (deprecated and removed in PowerShell 6+/pwsh) - InstallSection.vue: replace role=tablist/tab + aria-selected with role=group + aria-pressed on plain buttons (no incomplete tab semantics) - build.ts: normalize process.platform 'win32' to 'windows' in parseTarget() so native Windows builds (no --target) correctly add .exe and Windows metadata - build.test.ts: add regression test documenting the win32 normalization contract
|
Coverage after merging feat/windows-install-ps1 into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
…rd, x64 fallback, focus-visible, ico paths, coverage
|
Coverage after merging feat/windows-install-ps1 into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Installation | ||
|
|
||
| ## Via `curl` (recommended) | ||
| ## Linux / macOS via `curl` (recommended) |
There was a problem hiding this comment.
The section is now titled “Linux / macOS via curl”, but the following sentence still states the curl script supports Windows (MINGW/MSYS/Cygwin). Either broaden the heading (e.g., “Via curl (bash)”) or update the sentence to match the Linux/macOS-only heading to avoid confusing Windows users about which installer to use.
| ## Linux / macOS via `curl` (recommended) | |
| ## Via `curl` (bash, recommended) |
| * Sizes embedded: 16×16, 32×32, 48×48, 256×256 (PNG-compressed, Vista+). | ||
| * | ||
| * Usage: | ||
| * bun run scripts/generate-ico.ts |
There was a problem hiding this comment.
The usage comment suggests bun run scripts/generate-ico.ts, but the repo’s documented invocation is bun run generate-ico (package.json script) or bun scripts/generate-ico.ts. Consider updating the usage block to match the supported command to prevent copy/paste failures.
| * bun run scripts/generate-ico.ts | |
| * bun run generate-ico | |
| * # or: | |
| * bun scripts/generate-ico.ts |
| */ | ||
|
|
||
| import sharp from "sharp"; | ||
| import { mkdirSync, writeFileSync } from "fs"; |
There was a problem hiding this comment.
This script imports from "fs" while other scripts in this repo use the explicit "node:fs" form (e.g. scripts/generate-og.ts). Switching to "node:fs" keeps imports consistent and avoids any bundler/runtime ambiguity.
| import { mkdirSync, writeFileSync } from "fs"; | |
| import { mkdirSync, writeFileSync } from "node:fs"; |
Closes #92
Root cause / motivation
Several gaps prevented
github-code-searchfrom working correctly on Windows:bytecode: trueinBun.build()caused the compiled binary to crash at startup on Windows.bun-windows-x64target left ARM64 and CPU-variant users without a compatible binary.install.ps1script only handled AMD64 and had no fallback logic.What changed
build.tsbytecode: true(fixes Windows crash).compileflags:icon,hideConsole,title,publisher,version,description,copyright(populated frompackage.json).import.meta.dir-based) to avoid CWD-relative resolution failures.parseTarget:bun-windows-x64-baseline,bun-windows-x64-modern,bun-windows-arm64.parseTarget,isWindowsTarget,getOutfile,getBuildCompileOptions) exported for unit testing.build.test.ts(new)35 unit tests covering all pure helpers.
install.ps1PROCESSOR_ARCHITECTURE=ARM64) now resolved to thearm64binary.x64-modern(AVX2, ~99 % of x86-64 hardware since 2013) with automatic fallback tox64-baselineif the asset is absent in the target release..github/workflows/cd.yamlThree new matrix entries (all cross-compiled from
ubuntu-latest):bun-windows-x64-baseline→github-code-search-windows-x64-baseline.exebun-windows-x64-modern→github-code-search-windows-x64-modern.exebun-windows-arm64→github-code-search-windows-arm64.exescripts/generate-ico.ts+docs/public/icons/favicon.ico(new)Multi-resolution ICO (16×16, 32×32, 48×48, 256×256, PNG-compressed) generated from
docs/public/logo.svgviasharp. Regenerate withbun run generate-ico.README.mdQuick-start section now includes the Windows / PowerShell install block.
package.jsongenerate-icoscript added.sharpadded as dev dependency.How to verify
On Windows, right-click the
.exe→ Properties → Details: you should see the title, publisher, version, description and copyright fields populated correctly, and the app icon should display instead of the default "bun" icon.