Repository navigation
v3.0.0
What's Changed
A rewrite of the compiler-facing half of xBuild. Macros and the declaration pipeline moved from TypeScript's own AST to oxc, reporting became a level rather than a boolean, lifecycle hooks gained a named and reusable form, and a watch or serve run now holds an interactive terminal.
export const config: xBuildConfig = {
logLevel: 'info',
common: {
plugins: [ timing ],
logOverride: { 'direct-eval': 'silent' }
},
variants: {
main: { esbuild: { outdir: 'dist', entryPoints: [ 'src/**/*.ts' ] } }
},
watch: { debounce: 50 }
};Node.js 22 or newer is required.
npm install -g @remotex-labs/xbuildAdded
plugins— lifecycle hooks as a named set, several of which can stand on one build. AddsonSetup, the one place a plugin changes the options a build receives, run before every build of the variant rather than once.logOverride— the level a single esbuild message is reported at, keyed by its id or by an anchored pattern claiming a family of them.silentdrops a message rather than filing it.watchas a configuration block —filter,recursive,debounce,dot, andfollowSymlinks. Afiltera file names joins the defaults rather than replacing them, and each output directory is excluded automatically.--cleanremovesdistbefore building.- An interactive terminal for watching and serving runs — a status bar on the last row, and single-key shortcuts:
hmenu,bbuild,rreload and build,vverbose,cclear,oopen in a browser,qquit.rhas every TypeScript project reparse its configuration first, which is what catches an edit to a file thetsconfigextends. See Getting Started. - Glob patterns in
esbuild.entryPoints, matched from the working directory and keyed by path with the extension dropped. context.stage.reachableFilesandcontext.stage.droppedon the lifecycle context, andinfoandverbosebuckets on bothcontext.logsandbuildResult.
Changed
- Lifecycle hooks take one object with the shared cother than the context itself —
onLoad({ args, contents, loader, context }).contentsarrives as a string rather than as bytes. - Macros are span edits over an oxc AST. A conditional binding s now dropped across the whole build: the declaration goes, the imports naming it are pruned, and its reads become
undefined. - A
defineflag is decided by the text it substitutes, so onlyfalse,null,undefined, and an absent key leavpty string now set it.-$$inlineserializes objects and arrays as JSON instead of ed, and abigintas its exact digits. It and the configuration file run against the host intrinsics but not the hostglobal, so a write throughglobalThis` stays in the sandbox. logLevelreplaces the top-levelverboseboolean, withverbose,info,warning,error, andsilent.- Declarations follow
esbuild.bundle— a bundled build gets one rolled-up.d.tsper entry point, an unbundled one $argvcarries the whole parsed command line, the project's ownuserArgvoptions included, rather than only the$argvglobal](https://remotex-labs.github.io/xBuild/configuration/cli#the-argv-global).- esbuild's own failures are reported as esbuild wrote them, keeping their locations and notes rather than being redu
- The observable and symlink internals moved out to xObservable and
@ bothServerModuleandWatchService` now report as streams rather than writing to the console.
Removed
BuildService,overwriteConfig, andpatchConfigfrom the public exports. See Programmatic API.- The
contextglobal inside an$$inlinesandbox, andMacroContextInterfacewith it. Reach the same values through afecycle hook. declaration.bundle, whichesbuild.bundlenow decides.- Function references in
$$inline—$$inline(getPort)no longer resolves, since the argument is built on its own.
Migrating from v2.5.x
- Move to Node.js 22 or newer.
- Rename
verbose: truetologLevel: 'verbose'. - Destructure
contextout of every hook argument, and drop.toString()ononLoadcontents. - Drop
declaration.bundle. - Replace
0withfalsein anydefinethat meant off. - Move
$$inlinecallbacks that readcontextontodefinefunctions.
Links
- Documentation · Getting Started
- Full release notes · v2.5.x docs are archived
- Full Changelog: v2.5.1...v3.0.0
Also at /private/tmp/claude-501/-Users-op-dev-sources-remotex-labs-xBuild/b103126f-d246-43bf-898a-caf3a5c423ef/scratchpadd rather pipe it: gh release create v3.0.0 -F (once gh is installed — it isn't on this machine).
- Maintenance/packages by @Garefild in #193
- Migration/oxc by @Garefild in #194
- Bugfix/errors by @Garefild in #195
Full Changelog: v2.5.1...v3.0.0