src/shims Directory
- Entity ID:
ent-20260420-b01a00000004 - Type:
directory - Scope:
shared - Status:
active - Aliases: shims directory, preload shims
Description
Directory holding runtime equivalents of Bun bundler build-time features, introduced during rebuild because the original bun-based build config was not leaked. Contains bun-bundle.ts (feature flag runtime), macro.ts (MACRO global installer), preload.ts (bootstrap that imports both before any app code), and typically minimal fallback stubs for Bun-specific APIs (e.g. Bun.hash, Bun.file) so esbuild+node can run the CLI.
Key claims
- Claude Code shipped depending on Bun's bundler for compile-time feature stripping
- MACRO shim reads version from package.json at startup with safe fallback
- Test scripts pattern: preload shims then dynamic-import the subsystem
Relations
- bun:bundle Runtime Shim --[contained_in]--> src/shims Directory
- MACRO Global Object --[contained_in]--> src/shims Directory
- esbuild Build System (scripts/build-bundle.ts) --[consumes]--> src/shims Directory