Skip to content

feat(core): add experiments.exe support#1572

Draft
Timeless0911 wants to merge 9 commits intomainfrom
feat/core-experiments-exe
Draft

feat(core): add experiments.exe support#1572
Timeless0911 wants to merge 9 commits intomainfrom
feat/core-experiments-exe

Conversation

@Timeless0911
Copy link
Copy Markdown
Contributor

@Timeless0911 Timeless0911 commented Apr 2, 2026

Summary

Add experimental experiments.exe support so Rslib can package bundled Node.js outputs as single executable applications.

The new flow resolves target binaries, handles cross-platform target generation, and exposes configuration for file naming, output paths, targets, and SEA options.

Basic API shape

type ExeOptions =
  | boolean
  | {
      fileName?: string;
      outputPath?: string;
      targets?: Array<
        | string
        | {
            platform?: 'darwin' | 'linux' | 'win32';
            arch?: 'x64' | 'arm64';
            nodeVersion?: string;
          }
      >;
      seaOptions?: SeaOptions;
    };

Basic usage

export default {
  lib: [
    {
      format: 'esm',
      experiments: {
        exe: {
          fileName: 'hello',
        },
      },
    },
  ],
};

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings April 2, 2026 12:04
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 2, 2026

Deploying rslib with  Cloudflare Pages  Cloudflare Pages

Latest commit: fc26fcc
Status: ✅  Deploy successful!
Preview URL: https://49aea145.rslib.pages.dev
Branch Preview URL: https://feat-core-experiments-exe.rslib.pages.dev

View logs

@Timeless0911 Timeless0911 changed the title feat(core): add experiments.exe support feat(core): add experiments.exe support Apr 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds experimental experiments.exe support to package bundled Node.js (esm/cjs) library outputs as Single Executable Applications (SEA), including target resolution / cross-target generation and new integration + unit test coverage.

Changes:

  • Add experiments.exe configuration types, validation, and an Rsbuild plugin flow that builds SEA executables after compilation.
  • Implement target binary resolution (including downloading official Node binaries) and executable output naming/placement logic.
  • Add docs (EN/ZH), new integration fixtures/tests, and CI wiring for SEA-specific integration tests on Node 25.7.0.

Reviewed changes

Copilot reviewed 34 out of 35 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
website/docs/zh/config/lib/experiments.mdx Documents experiments.exe (ZH), options, constraints, and examples
website/docs/en/config/lib/experiments.mdx Documents experiments.exe (EN), options, constraints, and examples
tests/integration/exe/index.test.ts Integration coverage for cjs/esm/watch + multi-target generation
tests/integration/exe/cjs/src/index.ts CJS SEA fixture entry reading node:sea asset
tests/integration/exe/cjs/src/exeHelper.ts CJS fixture helper to ensure bundling behavior
tests/integration/exe/cjs/rslib.config.ts CJS fixture config enabling experiments.exe + assets
tests/integration/exe/cjs/package.json Declares fixture package metadata
tests/integration/exe/cjs/assets/message.txt CJS fixture SEA asset payload
tests/integration/exe/esm/src/index.ts ESM SEA fixture entry reading node:sea asset
tests/integration/exe/esm/src/exeHelper.ts ESM fixture helper to ensure bundling behavior
tests/integration/exe/esm/rslib.config.ts ESM fixture config enabling experiments.exe + assets
tests/integration/exe/esm/package.json Declares fixture package metadata
tests/integration/exe/esm/assets/message.txt ESM fixture SEA asset payload
tests/integration/exe/multi-target/src/index.ts Multi-target fixture entry for cross-platform outputs
tests/integration/exe/multi-target/src/exeHelper.ts Multi-target fixture helper
tests/integration/exe/multi-target/rslib.config.ts Multi-target config generating linux/darwin/win32 executables
tests/integration/exe/multi-target/package.json Declares multi-target fixture package metadata
tests/integration/exe/multi-target/assets/message.txt Multi-target fixture SEA asset payload
pnpm-lock.yaml Adds workspace importers for new exe fixtures (partial)
packages/core/src/types/utils.ts Extends PkgJson typing to include bin
packages/core/src/types/config.ts Adds SeaOptions, ExeTarget, ExeOptions, and lib.experiments.exe typing/docs
packages/core/src/index.ts Exposes ExeOptions in public API type exports
packages/core/src/config.ts Integrates composeExeConfig and disables externals/helpers when exe is enabled
packages/core/src/exe/index.ts Normalizes exe targets, validates constraints, and composes Rsbuild config
packages/core/src/exe/plugin.ts Builds SEA executables after environment compilation
packages/core/src/exe/build.ts Writes SEA config and runs node --build-sea (+ optional mac signing)
packages/core/src/exe/download.ts Resolves/downloads target Node binaries and enforces version constraints
packages/core/src/exe/utils.ts Command runner, output path resolution, main bundle discovery, signing helper
packages/core/src/exe/version.ts Node/runtime/platform/arch checks + cache dir helpers
packages/core/src/exe/types.ts Internal exe-related type definitions
packages/core/tests/exe.test.ts Unit coverage for version checks, target normalization, and path generation
package.json Splits SEA integration tests into a separate script and excludes them from default integration
.nvmrc Bumps dev Node version to 25.7.0 (SEA minimum)
.github/workflows/test.yml Adds integration-exe job on Node 25.7.0
.github/workflows/reusable-test.yml Runs pnpm run test:integration:exe for the new CI task
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98e566ce14

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Timeless0911 Timeless0911 marked this pull request as draft April 2, 2026 12:46
@Timeless0911 Timeless0911 marked this pull request as draft April 2, 2026 12:46
@Timeless0911 Timeless0911 force-pushed the feat/core-experiments-exe branch from 4a0fa8d to 58e3d6a Compare April 2, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants