mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[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:
@@ -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"]
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user