fix(devkit): scaffold zod@^4 — fresh apps fail npm install against published sdk - #293
Conversation
…published sdk Production smoke found every fresh `npm create dawn-ai-app` broken at `npm install`: the templates pin zod@^3.24.0 but the published @dawn-ai/sdk declares peerOptional zod@^4, which npm's strict peer resolution rejects (ERESOLVE). Invisible to CI because the harness installs with pnpm, which tolerates unmet optional peers. Verified against the real registry: with zod@^4 the strict install succeeds (@langchain/core accepts ^3.25.76 || ^4; template code uses only z.object/z.string, present in both majors). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @blove's task in 1m 17s —— View job Code Review
This PR looks correct and the fix is well-scoped. A few notes: Root cause confirmed. Zod API usage is safe across majors. Template source files use only Fixture coverage is complete. All four locations that pinned Changeset is correct. Both One gap to be aware of (not a blocker): the PR only covers new scaffolds. Existing apps that were generated with No correctness bugs, no security issues, no type-safety problems. The test assertions match the template changes. Good to merge. |
What
P0 found by production smoke: every fresh `npm create dawn-ai-app` + `npm install` fails with ERESOLVE. The app templates pin `zod@^3.24.0`, but published `@dawn-ai/sdk` (0.8.5) declares `peerOptional zod@^4.0.0` — npm's strict peer resolution rejects the tree. `--legacy-peer-deps` is not an escape hatch (it skips peer installs → `@langchain/core` unresolvable at runtime).
Why CI never saw it: the generated-app harness installs with pnpm, which tolerates unmet optional peers. The break only manifests with npm against the real registry — exactly the new-user path.
Fix: templates scaffold `zod@^4.0.0` (research + basic), harness fixtures updated. Template code uses only `z.object`/`z.string` (both majors); `@langchain/core` accepts `^3.25.76 || ^4`. Validated manually against the real registry: with `^4` the strict npm install succeeds and `dawn check`/`dev` run.
Tests
Follow-up (separate)
Consider widening sdk's peer to `^3.25.76 || ^4` for existing zod-3 apps — this PR fixes the broken new-user funnel without touching published semantics.
🤖 Generated with Claude Code