-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix multiple TS build and packaging issues #3672
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 25b84d0:
|
dbd5d21
to
82cfc2a
Compare
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
33864fc
to
7a292cb
Compare
7a292cb
to
869943e
Compare
This PR:
tsup
to 7.2.0, to pick up the "multiple declarations" feature from Ensure matching declaration file exists for each output bundle format egoist/tsup#934/dist/
in type imports, by re-exporting needed typesUpdates ourtsup
config to generate typedefs for ESM and CJS formats, and switches to using those typedef files instead of building individual files withtsc
Updates all package exports to list separate JS + DTS files for ESM and CJS for each entry pointare-the-types-wrong
CLI package for checking output, instead of the homegrown CLI I'd thrown togetherSomewhat surprisingly, this actually appears to fix all outstanding ATTW issues locally:**
Update
Yeah, I gave up on pre-bundling our TS typedefs for RTK. I'm also going to punt completely on fixing the "FalseCJS" warning from
attw
.We have some really complicated uses of interface merging in RTK Query, and bundling the typedefs was completely breaking that, as we no longer had paths like
"@reduxjs/toolkit/dist/query/apiTypes"
on disk. Plus, uses ofdeclare module "../../endpointDefinitions"
seemed busted too.I tried copy-pasting all the individual
.d.ts
files to.d.mts/cts
, but that seemed to result in a lot of internal resolution errors fromattw
.I did generally replace all of the remaining uses of
/dist/
, and exported a few more types publicly.