Two packaging bugs:
1. The './schema.json' export pointed to dist/src/generated/schema.json
but nothing copied it there (tsc is emitDeclarationOnly, Bun.build
doesn't emit JSON). Consumers got ERR_MODULE_NOT_FOUND.
Fix: cpSync after tsc runs.
2. zod is a peerDependency but was bundled into every entry point
(~270KB each). This causes dual-instance bugs where consumer-side
'instanceof ZodError' and schema.extend() break across boundaries.
Fix: add zod to external list for all non-with-deps entries.
Bundle size impact:
app.js 293952 -> 24561 (-91.6%)
app-bridge.js 299517 -> 30112 (-89.9%)
react/index.js 295558 -> 26153 (-91.2%)
server/index.js 291500 -> 22135 (-92.4%)
app-with-deps 321814 -> 321814 (unchanged, intentional)
* feat: make MCP SDK a peer dependency
- Move @modelcontextprotocol/sdk from dependencies to peerDependencies (^1.20.0)
- Add to devDependencies for local development (^1.24.3)
- Externalize SDK from all build entry points (app, app-bridge, react, server)
Benefits:
- Consumers control their SDK version
- Deduplication when consumer already has SDK
- Follows pattern of react/zod peer deps
* fix: require SDK ^1.24.0 for Zod 4 compatibility
Earlier SDK versions have Zod type incompatibilities that cause build errors.
* chore: update examples to SDK ^1.24.0 to match peer dep