Skip to content

feat(build): expose esbuild plugins API and CSS bundling (#44), with RuntimeAdapter parity and hardened file-watcher#45

Open
ofriw wants to merge 168 commits into
mainfrom
build-process
Open

feat(build): expose esbuild plugins API and CSS bundling (#44), with RuntimeAdapter parity and hardened file-watcher#45
ofriw wants to merge 168 commits into
mainfrom
build-process

Conversation

@ofriw

@ofriw ofriw commented Apr 25, 2026

Copy link
Copy Markdown
Collaborator

Note: This PR was generated by an AI agent. If you'd like to talk with other humans, drop by our Discord!


Closes #44 — originally a request to expose esbuild plugins in compile() and the dev server rebuild loop so CSS Modules would work end-to-end. The scope grew considerably as each layer needed supporting infrastructure.

What this PR does

The core deliverable for #44 is shipping all three surfaces the issue identified as missing: (1) esbuildPlugins on compile() and buildAssets(), (2) plugin forwarding through the debug server's live-rebuild loop via createBuildContext(entryPoints, extraPlugins?), and (3) multi-chunk CSS output handling — extracting companion .css files from esbuild output, merging them with optional cssPath static CSS, and emitting composite source maps. CSS Modules (.module.css) work out of the box without a custom plugin since esbuild's native local-css loader is our fallback.

Along the way the scope expanded naturally: the RuntimeAdapter interface grew three new methods (openBrowser, setupSignalHandler, exit) to eliminate the remaining ad-hoc platform checks in the debug-server and process exit paths, the file-watcher was hardened with a Windows polling fallback after discovering a libuv crash in Node.js 24.16.0, and the CI workflow gained caching, static analysis, and Playwright test coverage. Fixes to ManagedItem.rebase(), GoatDB constructor readiness, Server.stop() idempotency, and lazy email initialization were discovered and addressed en route.

Value add

For maintainers: the runtime adapter is now the only abstraction boundary between runtimes. For users: CSS bundling "just works" — import .css and .module.css from any component, and GoatDB serves /index.css with proper source maps. The debug server forwards custom esbuild plugins to every rebuild cycle. There are no breaking API changes to user-facing surfaces (compile(), startDebugServer() signatures are backward-compatible), though internal consumers of createBuildContext() or bundleResultFromBuildResult() will need to adapt to the BuildOutput return type.


Attached is an agent optimized description of the changes in this PR - AGENT_REVIEW.md

ofriw and others added 30 commits April 23, 2026 22:08
…tion-testing buildAssets with esbuildPlugins
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ofriw added 30 commits June 6, 2026 17:24
CI fails on PR #45 because the code uses double quotes while
deno.json enforces singleQuote: true. Run deno fmt to normalize
quotes across 6 files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(build): expose esbuild plugins API in compile() and dev server rebuild loop

1 participant