-
Notifications
You must be signed in to change notification settings - Fork 28
[infra] Restructured tsconfig files #666
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
base: master
Are you sure you want to change the base?
Conversation
Bundle size report
Check out the code infra dashboard for more information about this PR. |
f475fa8
to
2a3e603
Compare
2a3e603
to
535df9c
Compare
535df9c
to
0787bb8
Compare
0787bb8
to
8040b59
Compare
8040b59
to
eda5add
Compare
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.
Pull Request Overview
This PR restructures the TypeScript configuration files to follow a hierarchical approach. A new base configuration file tsconfig.options.json
is introduced that contains common TypeScript compiler options, which is then extended by other configuration files to avoid duplication.
- Created a new base configuration file (
tsconfig.options.json
) with common TypeScript compiler options - Replaced duplicated configurations across packages and apps with extends patterns
- Removed the redundant
tsconfig.build.json
file from the code-infra package
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tsconfig.options.json | New base configuration file with common TypeScript compiler options |
tsconfig.js.json | New configuration extending base options for JavaScript-enabled projects |
tsconfig.node.json | Simplified to extend tsconfig.js.json and added babel.config.* to includes |
packages/docs-infra/tsconfig.json | Updated to extend tsconfig.options.json and removed redundant options |
packages/code-infra/tsconfig.json | Simplified to extend tsconfig.js.json and updated includes |
packages/code-infra/tsconfig.build.json | Removed as mentioned in PR description |
packages/code-infra/src/cli/typescript.mjs | Added --declarationMap false flag to TypeScript command |
packages/bundle-size-checker/tsconfig.json | Simplified to extend tsconfig.js.json |
packages/babel-plugin-resolve-imports/tsconfig.json | Simplified to extend tsconfig.js.json |
packages/babel-plugin-minify-errors/tsconfig.json | Simplified to extend tsconfig.js.json with updated includes |
package.json | Added @types/babel__core dependency |
apps/code-infra-dashboard/tsconfig.json | Simplified to extend tsconfig.options.json |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
eda5add
to
8c940ce
Compare
@Janpot Can I get a review on this ? |
When it comes to modularizing tsconfig, I'm not 100% convinced a deep hierarchy is the best solution. See this comment as a reason for allowing arrays in extends. The idea being that you create multiple base configs, each describing an aspect of the environment which you then can freely compose in your app/package configurations. I don't know how that should look exactly, but I'm thinking like e.g. our build tool can export its tsconfig that sets module resolution rules. Maybe we can make a config for when the target is node, and one for when it is browsers. Such that e.g. our node tools extend from |
8c940ce
to
a783068
Compare
I am not sure I get what you are saying. Is it that there is |
a783068
to
65f26cd
Compare
65f26cd
to
f61ab05
Compare
This is done in a way so that we could potentially remove/replace tsdown in future with a new bundler (if required). Also, this doesn't change our current `code-infra build` command with flags.
f61ab05
to
6c4fbcc
Compare
6c4fbcc
to
6ce3952
Compare
All apps/packages now extend a common tsconfig.options.json and only add project specific changes in their own configs. Removed tsconfig.build.json in code-infra since there is no build step tehre.
6ce3952
to
82ed41d
Compare
All apps/packages now extend a common tsconfig.options.json and only add project specific changes in their own configs.
Removed tsconfig.build.json in code-infra since there is no build step there.