Closed
Conversation
✅ Deploy Preview for tsdown-main ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
tsdown
create-tsdown
tsdown-migrate
commit: |
68cbd6d to
687236c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for the exe format, which compiles TypeScript into standalone Node.js Single Executable Applications (SEA) using Node.js >= 25.5.0's --build-sea API. The feature is marked as experimental and emits warnings during builds.
Changes:
- Adds
exeformat that internally normalizes tocjsfor bundling, then post-processes the output into a standalone executable - Implements automatic format-specific overrides (disables DTS, sourcemap, exports checking, etc.) and forces all dependencies to be bundled
- Includes Node version validation, macOS codesigning, and intelligent output name resolution from
--out-file, entry keys, or fallback to "app"
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/features/exe.ts | Core SEA build logic including Node version validation, executable generation via node --build-sea, macOS codesigning, and cleanup |
| src/features/exe.test.ts | Unit tests for resolveExeName function covering various edge cases |
| tests/exe.test.ts | E2E tests for exe format including multi-entry validation and executable runtime tests (conditionally run on Node >= 25.5.0) |
| src/config/types.ts | Type definitions adding ExeOptions interface and 'exe' to Format union type |
| src/config/options.ts | Config resolution with exe format validation (single entry check) and SEA-specific overrides |
| src/build.ts | Integration of exe post-processing after rolldown build and watch mode disablement for exe |
| src/features/rolldown.ts | Disables code splitting for exe format (SEA requires single script) |
| src/features/cjs.ts | Suppresses legacy CJS warning for exe format |
| src/cli.ts | Adds --out-file CLI option and updates format help text |
| src/utils/package.ts | Adds normalizeFormat case for exe -> cjs and isExeFormat type guard |
| src/utils/format.ts | Extends formatBytes to auto-scale to MB for values >= 1,000,000 (for large exe binaries) |
| tests/utils.ts | Skips snapshot generation for exe format tests (binaries aren't suitable for snapshots) |
| .node-version | Updates from lts/* to 25.6.1 to support SEA build API |
| dts.snapshot.json | Type snapshot updates reflecting new ExeOptions export |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1 task
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.
Description
Add a new
exeformat that compiles TypeScript into a standalone Node.js Single Executable Application (SEA) using thenode --build-seaAPI.CLI usage:
Config file:
Key behaviors:
node --build-seasupport)outDiris only used as a staging directory for intermediate JS output and is cleaned up after the build; the final binary is output to the project root (cwd)--out-file/outFile> first entry key >"app"fallback;.exeextension auto-appended on Windowsdts: false,sourcemap: false,exports: false,publint: false,attw: false,unbundle: false,report: false, and all dependencies are force-bundledcodeSplitting: false) — SEA only supports a single script as its entry, so dynamicimport()calls must be inlined into the bundle rather than emitted as separate chunkscodesign --sign -(warns on failure)exeis internally mapped tocjsfor Rolldown, the usual CJS deprecation warning would be misleadingformatBytesnow auto-scales to MB for large outputs (exe binaries embed the Node.js runtime)Linked Issues
Additional context
The
exeformat is internally normalized tocjs— Rolldown bundles everything into a single CJS file, thennode --build-seaproduces the final standalone binary as a post-build step.