[yarn workspaces] Add typescript dependencies to tsconfig
--- Previously, I used `yarn workspace build fixture-test-utils` and `yarn workspace build babel-plugin-react-forget` to recompile dependencies on sprout. However, tsc supports project references which was intended to solve this problem https://www.typescriptlang.org/docs/handbook/project-references.html Note that apparently this places `.tsbuildinfo` in package roots, according to https://github.com/microsoft/TypeScript/issues/30925
Mofei Zhang committed
Aug 16, 2023 at 15:38 UTC
5448b33eb01dc334bf3a1beeada77d47902683fb
6 files changed
+32
-10
compiler/forget/packages/babel-plugin-react-forget/tsconfig.json
+5
-1
@@ -2,7 +2,10 @@
2
"extends": "@tsconfig/node16-strictest/tsconfig.json",
3
"compilerOptions": {
4
"declaration": true,
5
+ "rootDir": "src",
6
"outDir": "dist",
7
+ // https://github.com/microsoft/TypeScript/issues/30925
8
+ "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo",
9
"jsx": "react-jsxdev",
10
11
// weaken strictness from preset
@@ -13,7 +16,8 @@
16
"target": "ES2015",
17
// ideally turn off only during dev, or on a per-file basis
18
"noUnusedLocals": false,
16
- "sourceMap": true
19
+ "sourceMap": true,
20
+ "composite": true
21
},
22
"exclude": ["node_modules"],
23
"include": ["src/**/*.ts"]
compiler/forget/packages/fixture-test-utils/tsconfig.json
+5
-1
@@ -2,7 +2,10 @@
2
"extends": "@tsconfig/node16-strictest/tsconfig.json",
3
"compilerOptions": {
4
"declaration": true,
5
+ "rootDir": "src",
6
"outDir": "dist",
7
+ // https://github.com/microsoft/TypeScript/issues/30925
8
+ "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo",
9
"jsx": "react-jsxdev",
10
11
// weaken strictness from preset
@@ -13,7 +16,8 @@
16
"target": "ES2015",
17
// ideally turn off only during dev, or on a per-file basis
18
"noUnusedLocals": false,
16
- "sourceMap": true
19
+ "sourceMap": true,
20
+ "composite": true
21
},
22
"exclude": ["node_modules"],
23
"include": ["src/**/*.ts"]
compiler/forget/packages/snap/package.json
+1
-1
@@ -9,7 +9,7 @@
9
"src"
10
],
11
"scripts": {
12
- "build": "yarn workspace fixture-test-utils run build && rimraf dist && tsc",
12
+ "build": "rimraf dist && tsc --build",
13
"test": "echo 'no tests'",
14
"lint": "yarn eslint src"
15
},
compiler/forget/packages/snap/tsconfig.json
+9
-1
@@ -16,5 +16,13 @@
16
"sourceMap": true
17
},
18
"exclude": ["node_modules"],
19
- "include": ["src/**/*.ts"]
19
+ "include": ["src/**/*.ts"],
20
+ "references": [
21
+ {
22
+ "path": "../fixture-test-utils"
23
+ },
24
+ {
25
+ "path": "../babel-plugin-react-forget"
26
+ }
27
+ ]
28
}
compiler/forget/packages/sprout/package.json
+2
-1
@@ -8,7 +8,7 @@
8
"src"
9
],
10
"scripts": {
11
- "build": "yarn workspace babel-plugin-react-forget run build && yarn workspace fixture-test-utils run build && rimraf dist && tsc",
11
+ "build": "rimraf dist && tsc --build",
12
"prettier": "prettier --write src",
13
"test": "echo 'no tests'"
14
},
@@ -22,6 +22,7 @@
22
"@babel/types": "^7.19.0",
23
"@parcel/watcher": "^2.1.0",
24
"@testing-library/react": "^13.4.0",
25
+ "babel-plugin-react-forget": "*",
26
"chalk": "4",
27
"fixture-test-utils": "*",
28
"jsdom": "^22.1.0",
compiler/forget/packages/sprout/tsconfig.json
+10
-5
@@ -14,11 +14,16 @@
14
// ideally turn off only during dev, or on a per-file basis
15
"noUnusedLocals": false,
16
"sourceMap": true,
17
- "baseUrl": ".",
18
- "paths": {
19
- "fixture-test-utils": ["../packages/fixture-test-utils"]
20
- }
17
+ "baseUrl": "."
18
},
19
"exclude": ["node_modules"],
23
- "include": ["src/**/*.ts"]
20
+ "include": ["src/**/*.ts"],
21
+ "references": [
22
+ {
23
+ "path": "../fixture-test-utils"
24
+ },
25
+ {
26
+ "path": "../babel-plugin-react-forget"
27
+ }
28
+ ]
29
}