MACRO Global Object
- Entity ID:
ent-20260420-b01a00000003 - Type:
concept - Scope:
shared - Status:
active - Aliases: MACRO, MACRO.VERSION, MACRO.PACKAGE_URL, MACRO.ISSUES_EXPLAINER
Description
Compile-time-inlined global object that Bun's bundler substitutes into the source during builds. Holds three fields: VERSION (package.json version), PACKAGE_URL (npm name, typically '@anthropic-ai/claude-code'), and ISSUES_EXPLAINER (issue-tracker URL/instructions). Without the bundler, references fail at runtime. Some files guard with typeof MACRO !== 'undefined' but most don't — requires a runtime shim (src/shims/macro.ts) that reads package.json at startup and installs MACRO on globalThis before app code runs.
Key claims
- Claude Code shipped depending on Bun's bundler for compile-time feature stripping
- esbuild replaces Bun's bundler for rebuild via three targeted overrides
- MACRO shim reads version from package.json at startup with safe fallback
Relations
- MACRO Global Object --[contained_in]--> src/shims Directory
- esbuild Build System (scripts/build-bundle.ts) --[injects]--> MACRO Global Object