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
Open
feat(build): expose esbuild plugins API and CSS bundling (#44), with RuntimeAdapter parity and hardened file-watcher#45ofriw wants to merge 168 commits into
ofriw wants to merge 168 commits into
Conversation
…tion-testing buildAssets with esbuildPlugins
…ministic commitsForKey indexing
…ference missing files
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>
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.
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.
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)
esbuildPluginsoncompile()andbuildAssets(), (2) plugin forwarding through the debug server's live-rebuild loop viacreateBuildContext(entryPoints, extraPlugins?), and (3) multi-chunk CSS output handling — extracting companion.cssfiles from esbuild output, merging them with optionalcssPathstatic CSS, and emitting composite source maps. CSS Modules (.module.css) work out of the box without a custom plugin since esbuild's nativelocal-cssloader 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 toManagedItem.rebase(),GoatDBconstructor 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
.cssand.module.cssfrom any component, and GoatDB serves/index.csswith 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 ofcreateBuildContext()orbundleResultFromBuildResult()will need to adapt to theBuildOutputreturn type.Attached is an agent optimized description of the changes in this PR - AGENT_REVIEW.md