chore(deps): upgrade core to zod 4 + drop uuid (requires TypeScript 6)#569
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 6f0ee31 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Upgrades @ledgerhq/wallet-api-core from zod 3 to zod 4 (resolved to 4.3.6 via the existing workspace override), replaces the single uuid.v4() usage in RpcNode with the native crypto.randomUUID(), and bumps every library package from TypeScript ^5.3.3 to ^6.0.3 (because zod 4's d.ts use NoInfer, and core re-exports zod schemas through its public API). Each library tsconfig.json gains ignoreDeprecations: "6.0" plus an explicit rootDir so the dual CJS/ESM builds keep working under TS 6.
Changes:
- Bump
zodto^4.0.0inpackages/coreand remove theuuid/@types/uuiddeps. - Bump
typescriptto^6.0.3in the 7 published library packages, and addignoreDeprecations: "6.0"+rootDirto their tsconfigs. - Add a
patchchangeset covering all 7 packages.
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.changeset/core-zod4-drop-uuid.md |
Patch changeset describing the zod 4 + TS 6 + uuid-removal bump. |
packages/core/package.json |
Adds zod ^4.0.0, drops uuid / @types/uuid, bumps TS to ^6.0.3. |
packages/core/src/JSONRPC/RpcNode.ts |
Replaces uuidv4() with crypto.randomUUID(). |
packages/core/tsconfig.json |
Adds ignoreDeprecations: "6.0" and rootDir: ".". |
packages/core/prod.tsconfig.json, prod-esm.tsconfig.json |
Add explicit rootDir: "./src" for TS 6. |
packages/client/{package.json,tsconfig.json,prod*.tsconfig.json} |
TS 6 bump + ignoreDeprecations + rootDir. |
packages/client-react/{package.json,tsconfig.json,prod*.tsconfig.json} |
TS 6 bump + ignoreDeprecations + rootDir. |
packages/server/{package.json,tsconfig.json,prod*.tsconfig.json} |
TS 6 bump + ignoreDeprecations + rootDir. |
packages/simulator/{package.json,tsconfig.json,prod*.tsconfig.json} |
TS 6 bump + ignoreDeprecations + rootDir. |
packages/manifest-validator/{package.json,tsconfig.json,prod*.tsconfig.json} |
TS 6 bump + ignoreDeprecations + rootDir. |
packages/manifest-validator-cli/{package.json,tsconfig.json,prod.tsconfig.json} |
TS 6 bump + ignoreDeprecations + rootDir. |
pnpm-lock.yaml |
Lockfile regeneration: TS 6.0.3 resolutions, zod 4.3.6, uuid/@types/uuid removed. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8c455ab to
b2bdbc6
Compare
b2bdbc6 to
e762e48
Compare
Upgrades `zod` in @ledgerhq/wallet-api-core from ^3.22.4 to ^4.0.0. The repo override `zod@>=4.4.0 -> 4.3.6` (a z.custom() regression breaks nextra-theme-docs) caps the resolved version at 4.3.6, so core now shares the single zod 4.3.6 instance already used by wallet-api-tools. zod 4's type definitions require TypeScript >= 5.4 (NoInfer), and because core re-exports zod schemas as part of its public API, every package that type-checks against core must move too. TypeScript is bumped ^5.3.3 -> ^6.0.3 in core, client, client-react, server, simulator, manifest-validator and manifest-validator-cli. TS 6 migration for the library builds: - each package tsconfig.json gets `ignoreDeprecations: "6.0"` (keeps Node10 module resolution / baseUrl from tsconfig.base.json working through TS 6) and an explicit `rootDir` (TS 6 no longer infers it when outDir is set). - the prod.tsconfig.json / prod-esm.tsconfig.json build configs set `rootDir: "./src"`. Also replaces the single uuid v4 usage in RpcNode with the native `crypto.randomUUID()`, dropping the `uuid` and `@types/uuid` dependencies (uuid v14 is ESM-only and incompatible with core's CommonJS build).
e762e48 to
b39dc98
Compare
…g zod
Removes the repo-wide zod@>=4.4.0 -> 4.3.6 override and replaces it with a
pnpm patch on nextra-theme-docs that fixes the two schema bugs zod 4.4.x
surfaced (4.3.6 happened to mask them):
- attributeSchema (z.custom) called .startsWith on a non-string when the
`attribute` config was passed as an array -> TypeError.
- LayoutPropsSchema declared `children: reactNode` as required, but <Layout>
strips children before validating, so zod 4.4.x rejected the absent key.
With these fixed, core and wallet-api-tools move to zod ^4.4.3 and the whole
monorepo dedupes to a single zod 4.4.3 (only the external @ledgerhq/cryptoassets
keeps its own hard-pinned 4.3.6).
Verified: build 10/10, test 26/26, typecheck 7/7, lint 10/10, docs prerender
(exercises the patched nextra schema), and core CJS require smoke test.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…gle TS) eslint-config-custom was the last workspace on typescript ^5.3.3, forcing a second TypeScript (5.3.3) into the tree alongside the 6.0.3 every other package uses. typescript-eslint@8's peer range (>=4.8.4 <6.1.0) supports 6.0.3, so this dedupes the repo to a single typescript 6.0.3. Note: @types/node was intentionally left at ^24.10.0 for the published library packages. Bumping them to 25 breaks `tsc` under skipLibCheck:false because @ledgerhq/hw-transport's Transport.d.ts is incompatible with @types/node 25's stricter EventMap generics. The apps stay on 25 since Next sets skipLibCheck:true. Verified: build 10/10, test 26/26, typecheck 7/7, lint 10/10. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ompat (#572) Bumps @types/node from ^24.10.0 to ^25.9.1 in the 7 published library packages, aligning them with the apps (which were already on 25). @types/node 25 made EventEmitter generic over an EventMap constraint, which exposed a latent bug in @ledgerhq/hw-transport@6.35.2: its Transport.d.ts leaks an internal `_events: EventEmitter<[never]>` field, and the bogus `[never]` tuple doesn't satisfy EventMap. Under skipLibCheck:false this fails `tsc` declaration emit for the libraries that depend on hw-transport (client, simulator). A pnpm patch retypes the field to a plain `EventEmitter`. hw-transport's only consumers here are client and simulator, and Transport.d.ts is the sole @types/node 25 incompatibility across the libs. Upstream still ships the bad line (latest stable + nightly build against @types/node 24), so the patch must be re-verified on every hw-transport bump. Stacked on #569 (zod 4 / TS 6): @types/node 25 has only been validated against TypeScript 6. devDependency + local-only patch, so no published runtime change and no changeset. Verified: build 10/10, test 26/26, typecheck 7/7, lint 10/10. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Upgrades
@ledgerhq/wallet-api-coreto zod 4 and removes theuuiddependency. zod 4 turned out to require a TypeScript bump that cascades to core's consumers, so this PR also moves the library packages to TypeScript 6.zod 3 → 4
packages/corezod^3.22.4→^4.0.0.pnpm-workspace.yamloverridezod@>=4.4.0 → 4.3.6(az.custom()regression breaksnextra-theme-docsinapps/docs) caps the resolved version at 4.3.6, so core now shares the single zod 4.3.6 instance already used bywallet-api-tools(no more dual zod 3/4 install).z.record,.flatten()/instanceof z.ZodError); no source changes were needed.Why TypeScript 6
zod 4's
.d.tsuseNoInfer(TypeScript ≥ 5.4), and since core re-exports zod schemas in its public API, every package that type-checks against core (skipLibCheck: false) must move too. Per maintainer direction we align on TS 6:typescript^5.3.3→^6.0.3in core, client, client-react, server, simulator, manifest-validator, manifest-validator-cli.tsconfig.jsongainsignoreDeprecations: "6.0"(keepsNode10resolution +baseUrlfromtsconfig.base.jsonworking through TS 6 — safest for the dual CJS/ESM builds) and an explicitrootDir.prod.tsconfig.json/prod-esm.tsconfig.jsonsetrootDir: "./src"(TS 6 no longer infers it whenoutDiris set).tsconfig.base.jsonis intentionally not changed, soclient-nextjs/eslint-config-custom(still on TS 5.3) are unaffected and this PR stays independent of chore(deps): upgrade client-nextjs example to Next 16 + TS 6 + Tailwind 4 #566.uuid removal
RpcNodeuseduuid.v4()once → replaced with nativecrypto.randomUUID(), droppinguuid+@types/uuid. uuid v14 is ESM-only and incompatible with core's CommonJS build.A changeset (
patchfor the 7 published packages) is included.Verification
pnpm build✅ 10/10pnpm test✅ 26/26 (core 131 passed, simulator 48, etc.)pnpm typecheck✅ 7/7pnpm lint✅ 10/10,pnpm format:check✅ 7/7node -e "require('packages/core/lib/index.js')"loads (confirms no ESMuuidrequire in the CJS build)zod@4.3.6resolves in the lockfile.Note
The repo override means the literal
zod@4.4.3target from the dependency checker isn't usable yet; 4.3.6 is the latest zod 4 that doesn't break docs.🤖 Generated with Claude Code