Stacks #2590 measured 8.9 MiB of fresh-process RSS from importing the published @stacksjs/bun-router root barrel before registering a route. The root intentionally exports auth, containers, sessions, testing, typed clients, response helpers, middleware, and the entire router surface, so changing it would break the public API.
Add a stable @stacksjs/bun-router/runtime entry for framework and API-server consumers that need the registered Router and its serve/dispatch path without importing unrelated root-barrel features.
The entry should expose the runtime values Stacks uses directly: the fully registered Router, request enhancement and context helpers, response compression/factory helpers, and typed-router creation. It must preserve the root entry unchanged.
Acceptance:
- The package exports
./runtimewith JavaScript and declarations. - A built-package consumer can register and serve a native route through the runtime entry, with byte-identical response behavior.
- The runtime entry does not export unrelated root-only surfaces such as auth, the dependency container, session stores, or testing utilities.
- A build-graph test starts at the emitted runtime entry and records its statically reachable chunks, preventing a later root-barrel re-export from silently restoring the full graph.
- Fresh Bun 1.4.2 processes measure imports of the same required symbols from the root and runtime entries. Report every sample and the median wall time and RSS, including a null result if no saving appears.
- Link the resulting commit and measurements back to stacksjs/stacks#2590. No dependency adoption or package publication is part of this issue.
This is the upstream prerequisite for a later Stacks narrow entry. Importing a hash-named chunk or an undeclared source subpath is not acceptable.