[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
This commit is contained in:
Mofei Zhang
2023-08-16 15:38:30 -04:00
parent d6dea6b9b9
commit 5448b33eb0
6 changed files with 32 additions and 10 deletions
@@ -2,7 +2,10 @@
"extends": "@tsconfig/node16-strictest/tsconfig.json",
"compilerOptions": {
"declaration": true,
"rootDir": "src",
"outDir": "dist",
// https://github.com/microsoft/TypeScript/issues/30925
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo",
"jsx": "react-jsxdev",
// weaken strictness from preset
@@ -13,7 +16,8 @@
"target": "ES2015",
// ideally turn off only during dev, or on a per-file basis
"noUnusedLocals": false,
"sourceMap": true
"sourceMap": true,
"composite": true
},
"exclude": ["node_modules"],
"include": ["src/**/*.ts"]
@@ -2,7 +2,10 @@
"extends": "@tsconfig/node16-strictest/tsconfig.json",
"compilerOptions": {
"declaration": true,
"rootDir": "src",
"outDir": "dist",
// https://github.com/microsoft/TypeScript/issues/30925
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo",
"jsx": "react-jsxdev",
// weaken strictness from preset
@@ -13,7 +16,8 @@
"target": "ES2015",
// ideally turn off only during dev, or on a per-file basis
"noUnusedLocals": false,
"sourceMap": true
"sourceMap": true,
"composite": true
},
"exclude": ["node_modules"],
"include": ["src/**/*.ts"]
+1 -1
View File
@@ -9,7 +9,7 @@
"src"
],
"scripts": {
"build": "yarn workspace fixture-test-utils run build && rimraf dist && tsc",
"build": "rimraf dist && tsc --build",
"test": "echo 'no tests'",
"lint": "yarn eslint src"
},
+9 -1
View File
@@ -16,5 +16,13 @@
"sourceMap": true
},
"exclude": ["node_modules"],
"include": ["src/**/*.ts"]
"include": ["src/**/*.ts"],
"references": [
{
"path": "../fixture-test-utils"
},
{
"path": "../babel-plugin-react-forget"
}
]
}
+2 -1
View File
@@ -8,7 +8,7 @@
"src"
],
"scripts": {
"build": "yarn workspace babel-plugin-react-forget run build && yarn workspace fixture-test-utils run build && rimraf dist && tsc",
"build": "rimraf dist && tsc --build",
"prettier": "prettier --write src",
"test": "echo 'no tests'"
},
@@ -22,6 +22,7 @@
"@babel/types": "^7.19.0",
"@parcel/watcher": "^2.1.0",
"@testing-library/react": "^13.4.0",
"babel-plugin-react-forget": "*",
"chalk": "4",
"fixture-test-utils": "*",
"jsdom": "^22.1.0",
+10 -5
View File
@@ -14,11 +14,16 @@
// ideally turn off only during dev, or on a per-file basis
"noUnusedLocals": false,
"sourceMap": true,
"baseUrl": ".",
"paths": {
"fixture-test-utils": ["../packages/fixture-test-utils"]
}
"baseUrl": "."
},
"exclude": ["node_modules"],
"include": ["src/**/*.ts"]
"include": ["src/**/*.ts"],
"references": [
{
"path": "../fixture-test-utils"
},
{
"path": "../babel-plugin-react-forget"
}
]
}