fix(shared): Add typesVersions fallback for moduleResolution node#7998
fix(shared): Add typesVersions fallback for moduleResolution node#7998jacekradko merged 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 75fd7ee The changes in this PR will be included in the next version bump. This PR includes changesets to release 21 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe pull request adds a TypeScript type-resolution fallback by introducing a top-level 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
What
Adds a
typesVersionsfield to@clerk/shared/package.jsonto support TypeScript resolution of@clerk/shared/typesundermoduleResolution: "node".Why
@clerk/shared/typesis a subpath export that relies on theexportsfield inpackage.json. TypeScript only readsexportswhenmoduleResolutionis set to"bundler","node16", or"nodenext". Under the legacy"node"setting, TypeScript ignoresexportsentirely and fails with:This wasn't an issue when types lived in the standalone
@clerk/typespackage, since that was a top-level import resolved via thetypesfield — which works under allmoduleResolutionsettings.How
typesVersionsacts as a fallback that TypeScript respects under legacy module resolution. By mapping"types"to"dist/types/index.d.ts", TypeScript can resolve@clerk/shared/typesregardless of the user'smoduleResolutionsetting.Testing
Verified locally with a minimal project:
moduleResolution: "node"— fails withouttypesVersions, succeeds with itmoduleResolution: "bundler"— succeeds in both cases (usesexports)pnpm buildandpnpm testpass for@clerk/sharedSummary by CodeRabbit