phetsims / chipper

Tools for developing and building PhET interactive simulations.
MIT License
11 stars 14 forks source link

TypeScript project references enhancements #1469

Open samreid opened 1 week ago

samreid commented 1 week ago

In https://github.com/phetsims/chipper/issues/1356 we added project references. Here is a list of next steps for improvements and enhancements. Note that some are already tracked elsewhere such as https://github.com/phetsims/chipper/issues/1468 and https://github.com/phetsims/chipper/issues/1467 and https://github.com/phetsims/chipper/issues/1466

zepumph commented 5 days ago

A starting point for build tool tsconfig files using project references:

```diff Subject: [PATCH] s --- Index: tsconfig.json IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/tsconfig.json b/tsconfig.json --- a/tsconfig.json (revision bd7e3b12ee074da1814a7faee8c27c73ffe6b9da) +++ b/tsconfig.json (date 1727116313517) @@ -1,12 +1,5 @@ { "extends": "../chipper/tsconfig-core.json", - "include": [ - "js/**/*", - "images/**/*", - "mipmaps/**/*", - "sounds/**/*", - "test/**/*" - ], "compilerOptions": { "module": "NodeNext", "esModuleInterop": true, @@ -16,6 +9,9 @@ "references": [ { "path": "../chipper/tsconfig/buildjson" + }, + { + "path": "../chipper/tsconfig/buildtools" } ] } \ No newline at end of file Index: tsconfig/all/tsconfig.json IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/tsconfig/all/tsconfig.json b/tsconfig/all/tsconfig.json --- a/tsconfig/all/tsconfig.json (revision bd7e3b12ee074da1814a7faee8c27c73ffe6b9da) +++ b/tsconfig/all/tsconfig.json (date 1727115357915) @@ -9,6 +9,9 @@ "path": "../buildjson" }, { + "path": "../buildtools" + }, + { "path": "../../../acid-base-solutions" }, { @@ -392,12 +395,12 @@ { "path": "../../../pendulum-lab" }, -// { -// "path": "../../../perennial" -// }, -// { -// "path": "../../../perennial-alias" -// }, + // { + // "path": "../../../perennial" + // }, + // { + // "path": "../../../perennial-alias" + // }, { "path": "../../../ph-scale" }, @@ -422,12 +425,12 @@ { "path": "../../../phet-io-wrappers" }, -// { -// "path": "../../../phet-lib" -// }, -// { -// "path": "../../../phet-vite-demo" -// }, + // { + // "path": "../../../phet-lib" + // }, + // { + // "path": "../../../phet-vite-demo" + // }, { "path": "../../../phetcommon" }, Index: tsconfig/buildtools/tsconfig.json IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/tsconfig/buildtools/tsconfig.json b/tsconfig/buildtools/tsconfig.json new file mode 100644 --- /dev/null (date 1727117724924) +++ b/tsconfig/buildtools/tsconfig.json (date 1727117724924) @@ -0,0 +1,19 @@ +{ + "extends": "../../tsconfig-core.json", + // Entry points from build.json, see chipper/build.json + "include": [ + + "../../../perennial-alias/js/common/**/*", + "../../../chipper/js/common/**/*", + "../../../chipper/js/grunt/**/*", + // "../../../chipper/js/phet-io/**/*", + "../../../chipper/js/scripts/**/*", + // "../../../chipper/js/sim-tests/**/*", + "../../../phet-core/js/types/**/*" + ], + "references": [ + // { + // "path": "../buildjson" + // } + ] +} \ No newline at end of file
zepumph commented 5 days ago

Working from the above patch now