@statewalker/webrun-modules-build
v0.1.2
Published
Batch module builder: drives the shared @statewalker/webrun-modules preprocess core through @statewalker/webrun-builder's BuildEngine with an ext-map URL policy, emitting a static .js/.css tree to a cache FilesApi.
Downloads
270
Readme
@statewalker/webrun-modules-build
Batch module builder. Drives the shared @statewalker/webrun-modules preprocess
core through @statewalker/webrun-builder's BuildEngine with an ext-map URL
policy (every emitted module is a static .js), emitting a static .js tree to a
cache FilesApi.
Pipeline
scanner → sources → [Classify] → module/css/json → [Preprocess] → served → [Serve]
└ [Prune] on sources-removed- Classify routes each scanned source to a
module/css/jsonsignal. - Preprocess walks the entry's transitive closure via
walkFrom, emitting the entry + project deps as.js, plus the~depsproxy bodies and resolved npm endpoints as side-effects intocache, then wraps JSON/CSS ids into their static.jsforms. - Prune removes a deleted source's emitted artifact + sidecars.
- Serve collects the emitted entry pointers.
Incremental gating
newProjectBuild installs an opt-in ctx.skipTransform hook consulted by walkFrom
for every closure node (entry, interior, and shared). It reuses the emitted
artifact when the source is byte-identical to a per-id content-hash sidecar and the
artifact still exists — so editing a root re-transforms only the root, and a diamond
transforms its shared node once, not once per path. project and cache must be
distinct FilesApi instances (asserted).
CSS emission
- CSS reached from JS emits a
.jsinjector. Animport "./styles.css"from JS becomes onecssModuleWrapper.jsthat injects a<style>. - F2 —
@import-chained.cssis emitted as a real file. An@import "./other.css"keeps its.cssspecifier; the chained stylesheet is written as a live.cssat itsurlPath(alongside its.jsform) so the injected@importresolves. - F3 —
url()asset references are copied.url("./logo.png")targets a non-code asset id, copied verbatim to its (unchanged) ext-map path.
