Skip to content
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

simplify types generation using a single tsconfig #2118

Merged
merged 5 commits into from
Jun 26, 2024
Merged

Conversation

mayank99
Copy link
Contributor

@mayank99 mayank99 commented Jun 25, 2024

Changes

This is a follow-up to #2100 and precursor to #2119.

The "module" has been changed to "NodeNext" because newer TS versions require it if also using "moduleResolution": "NodeNext" (see 5.2 release notes).

The tsconfig.esm, tsconfig.cjs and tsconfig.react-table files have all been removed. A single tsconfig.build is used for generating all types.

  • tsconfig.esm and tsconfig.cjs are not necessary because the actual JS output is generated by swc. The types have always been identical between esm and cjs, so a single config can be used, with --outDir passed inline through CLI args.
  • tsconfig.react-table was only used to generate a top-level react-table.d.ts file (see original comment and related recent PR for more context). This file has now been removed, and the fallback strategy is now implemented using typesVersions, based on this SO answer and this repo.

Testing

Build passing, and verified that the build output looks fine.

Manually verified that vite-playground errors out using "moduleResolution": "Node" only when the "typesVersions" is not present in @itwin/itwinui-react/package.json.

Docs

Added changesets.

@mayank99 mayank99 self-assigned this Jun 25, 2024
@mayank99 mayank99 marked this pull request as ready for review June 25, 2024 21:04
@mayank99 mayank99 requested review from a team as code owners June 25, 2024 21:04
@mayank99 mayank99 requested review from r100-stack and Ben-Pusey-Bentley and removed request for a team June 25, 2024 21:04
@mayank99 mayank99 merged commit 6ccff1c into main Jun 26, 2024
16 checks passed
@mayank99 mayank99 deleted the mayank/simplify-types branch June 26, 2024 13:51
@imodeljs-admin imodeljs-admin mentioned this pull request Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants