-
Notifications
You must be signed in to change notification settings - Fork 339
chore(clerk-react,shared,types): Switch to tsc for type generation #5122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: a3e75bb The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 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 |
!snapshot |
Hey @LekoArts - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact |
@@ -2,8 +2,6 @@ | |||
"compilerOptions": { | |||
"allowSyntheticDefaultImports": true, | |||
"baseUrl": ".", | |||
"declaration": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already defined in the declarations tsconfig so I removed this duplicate
@@ -2,8 +2,6 @@ | |||
"compilerOptions": { | |||
"allowJs": true, | |||
"baseUrl": ".", | |||
"declaration": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already defined in the declarations tsconfig so I removed this duplicate
@@ -25,7 +25,7 @@ | |||
"exports": { | |||
".": { | |||
"import": { | |||
"types": "./dist/index.d.mts", | |||
"types": "./dist/index.d.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Core of the problem, tsc
can't dual emit .d.ts
as CJS and .d.mts
as ESM so it's only .d.ts
for both
Closing this in favor of a new PR where I'll only create those declaration maps locally/in CI and won't be published |
Description
TL;DR: Switch some key SDKs to use
tsc
for type compilation in order to create sourcemaps for d.ts files (.d.ts.map
) so that Typedoc can understand cross-package references.So for my Typedoc project I need to get cross-package references working. So
@clerk/clerk-react
imports from@clerk/shared
which in itself imports from@clerk/types
. In order to have the type from@clerk/types
correctly be linked in@clerk/clerk-react
Typedoc needs declaration maps.Which is a problem, because:
tsup
doesn't support generating declaration maps: How to generate .d.ts.map egoist/tsup#564tsc
doesn't support dual emit: Dual ESM/CJS emit with tsc microsoft/TypeScript#54593.mjs
and.js
with a single.d.ts
:FalseCJS
problem - severity and suggested fixes? arethetypeswrong/arethetypeswrong.github.io#21So the current state of the PR will have these problems: https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseCJS.md
The questions now is: Will this have an impact and if yes, do we tolerate it? I've created a snapshot release and will test it but I'd be super open to another approach as long as the result is right 👍
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change