Skip to content

fix: split TUI into lazy chunk so prefix never loads natives on Windows - #121

Merged
hyldmo merged 1 commit into
mainfrom
hyldmo/windows-bundle-split
Sep 11, 2026
Merged

hyldmo merged 1 commit into
mainfrom
hyldmo/windows-bundle-split

Conversation

@hyldmo

@hyldmo hyldmo commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Follow-up to #119: farero reported yarn verify (2.19.1, --prefix, true-shorthand config) still segfaults at startup on Windows, fault in ghostty-opentui.node.

Root cause (not the config shape)

Published 2.19.1 dist/numux.js inlines src/ui/app.ts and keeps a top-level from "ghostty-opentui" import. Bun.build without splitting: true emits a single chunk, so the #119 source-level dynamic import was defeated by hoisting: every invocation, including --version, evaluates natives at startup and dies on Windows. The true shorthand is pure string building (lint: truebun run lint) and never touched natives; my first smoke only ran source, which is why it stayed green.

Changes

  • build.ts: splitting: true (+ stable chunk naming). Verified: dist/numux.js has zero ghostty/opentui references; natives live only in lazy chunks behind runtime import().
  • scripts/windows-prefix-smoke.ts: every scenario now runs against both src/index.ts and the built bundle (hard-fails if dist is missing), plus a new true-shorthand case with isolated package.json. 28 assertions, green locally on both entries.
  • ci.yml: windows job builds before smoking.

Proof pending

Windows dispatch on this branch will show the bundle phase green. After merge, semantic-release cuts the fix version for farero to consume.

@hyldmo
hyldmo merged commit b7abff3 into main Sep 11, 2026
6 checks passed
@hyldmo
hyldmo deleted the hyldmo/windows-bundle-split branch September 11, 2026 14:21
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.19.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant