-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update packages to use more modern moduleresolution options (#…
…1770) * refactor: rename tsconfig.cjs.json to tsconfig.esm.json * build: update packages to use more modern moduleresolution options This change updates tsconfigs across all packages to use more up to date `module` and `moduleResolution` options. For all packages that were being built as `commonjs` modules with node `moduleResolution`, they've been updated to use `nodenext`. I also took the opportunity to re-organize the tsconfigs at the packages level to make their names more accurate. Previously the main `packages/tsconfig.json`, which is what the `build:esm` command targetted, referenced all package's tsconfigs, while a `packages/tsconfig.cjs.json` only referenced the cjs tsconfig from the react package. However, all packages' tsconfigs _except_ for the react tsconfig are building cjs. So having a command that's called `build:esm` run all cjs builds and one esm build didn't really do what the name would suggest. So I reversed that construct. Now `packages/tsconfig.json` still references all of the packages tsconfig, except for the react package, it references the `tsconfig.cjs`, and I renamed the `packages/tsconfig.cjs.json` to `packages/tsconfig.esm.json` and have it only referencing the main react package tsconfig. The net / net is that `build:esm` is only building esm output and `build:cjs` is only building cjs output. Similarly, all package level tsconfigs are inheriting from packages/tsconfig.options.json, but that config had module and moduleResolution corresponding to the tsconfig in react (the ESM one), and all of the other package tsconfigs were overriding the module and moduleResolution. So I swapped that, so that the base config has the module and moduleResolution that all but on of the packages are using, and had the react tsconfig override that to what it needed to be for esm output. This means fewer tsconfigs are needing to override those options. Lastly, I've done build comparisons for all packages and target, and they all result in the same build output as they did before these changes.
- Loading branch information
1 parent
04f6280
commit 5da86c5
Showing
20 changed files
with
23 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{ | ||
"extends": "../tsconfig.options.json", | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"outDir": "dist", | ||
"rootDir": "src" | ||
"rootDir": "src", | ||
"outDir": "dist" | ||
}, | ||
"references": [{ "path": "../benchmark" }, { "path": "../css" }, { "path": "../utils" }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{ | ||
"extends": "../tsconfig.options.json", | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"outDir": "dist", | ||
"rootDir": "src" | ||
"rootDir": "src", | ||
"outDir": "dist" | ||
}, | ||
"references": [{ "path": "../jest" }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"files": [], | ||
"references": [{ "path": "react/tsconfig.json" }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters