diff --git a/package.json b/package.json index 7fb7e841a..314205503 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "docs:start": "cd website && yarn start", "postinstall": "yarn monorepo:check", "build": "yarn build:pkgs && yarn build:community", - "build:pkgs": "yarn clean && tsc --build tsconfig.packages.json", + "build:pkgs": "tsc --build tsconfig.packages.json", "build:pkgs:watch": "tsc --build --watch tsconfig.packages.json", "build:community": "parcel build community/*", "build:community:watch": "parcel watch community/*", diff --git a/packages/cli-alias/tsconfig.json b/packages/cli-alias/tsconfig.json index 6c7a584ef..d8ebadead 100644 --- a/packages/cli-alias/tsconfig.json +++ b/packages/cli-alias/tsconfig.json @@ -2,8 +2,10 @@ "extends": "../../tsconfig.packages.json", "compilerOptions": { "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "baseUrl": "." }, + "include": ["src"], "references": [ { "path": "../types" }, { "path": "../core" }, diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 6c7a584ef..d8ebadead 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -2,8 +2,10 @@ "extends": "../../tsconfig.packages.json", "compilerOptions": { "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "baseUrl": "." }, + "include": ["src"], "references": [ { "path": "../types" }, { "path": "../core" }, diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index e6694a48e..612aa2303 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -2,7 +2,9 @@ "extends": "../../tsconfig.packages.json", "compilerOptions": { "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "baseUrl": "." }, + "include": ["src"], "references": [{ "path": "../types" }] } diff --git a/packages/fetcher/tsconfig.json b/packages/fetcher/tsconfig.json index e6694a48e..612aa2303 100644 --- a/packages/fetcher/tsconfig.json +++ b/packages/fetcher/tsconfig.json @@ -2,7 +2,9 @@ "extends": "../../tsconfig.packages.json", "compilerOptions": { "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "baseUrl": "." }, + "include": ["src"], "references": [{ "path": "../types" }] } diff --git a/packages/initializer/tsconfig.json b/packages/initializer/tsconfig.json index 941321b90..78401cd56 100644 --- a/packages/initializer/tsconfig.json +++ b/packages/initializer/tsconfig.json @@ -2,8 +2,10 @@ "extends": "../../tsconfig.packages.json", "compilerOptions": { "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "baseUrl": "." }, - "exclude": ["./template"], + "include": ["src"], + "exclude": ["./template/*"], "references": [{ "path": "../types" }, { "path": "../utils" }] } diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index 3af81cfe9..f1d9f4478 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -2,6 +2,8 @@ "extends": "../../tsconfig.packages.json", "compilerOptions": { "rootDir": "src", - "outDir": "dist" - } + "outDir": "dist", + "baseUrl": "." + }, + "include": ["src"] } diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index 3af81cfe9..f1d9f4478 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -2,6 +2,8 @@ "extends": "../../tsconfig.packages.json", "compilerOptions": { "rootDir": "src", - "outDir": "dist" - } + "outDir": "dist", + "baseUrl": "." + }, + "include": ["src"] } diff --git a/packages/validator/tsconfig.json b/packages/validator/tsconfig.json index 66126f1e1..25ef79028 100644 --- a/packages/validator/tsconfig.json +++ b/packages/validator/tsconfig.json @@ -2,7 +2,9 @@ "extends": "../../tsconfig.packages.json", "compilerOptions": { "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "baseUrl": "." }, + "include": ["src"], "references": [{ "path": "../fetcher" }, { "path": "../types" }] } diff --git a/scripts/configure-references.js b/scripts/configure-references.js deleted file mode 100644 index 083ddfc77..000000000 --- a/scripts/configure-references.js +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env node - -// @ts-check -/* eslint-disable */ - -const fs = require('fs'); -const util = require('util'); -const exec = util.promisify(require('child_process').exec); -const path = require('path'); -const isCI = require('is-ci'); - -const config = JSON.parse(fs.readFileSync('tsconfig.json').toString()); -config.files = []; -config.references = []; - -(async function () { - if (isCI) { - // dont run it on CI - return; - } - - const { stdout, stderr } = await exec('yarn workspaces info --json'); - - const lines = stdout.split('\n'); - const depthTree = lines.slice(1, lines.length - 2).join('\n'); - const workspaces = JSON.parse(depthTree); - - for (const name in workspaces) { - const workspace = workspaces[name]; - const location = path.resolve(process.cwd(), workspace.location); - const tsconfigPath = path.resolve(location, 'tsconfig.json'); - if (fs.existsSync(tsconfigPath)) { - config.references.push({ - path: workspace.location, - }); - const workspaceConfig = JSON.parse( - fs.readFileSync(tsconfigPath).toString(), - ); - workspaceConfig.compilerOptions.composite = true; - workspaceConfig.references = []; - for (const dependency of workspace.workspaceDependencies) { - const dependecyLocation = path.resolve( - process.cwd(), - workspaces[dependency].location, - ); - if (fs.existsSync(path.resolve(dependecyLocation, 'tsconfig.json'))) { - workspaceConfig.references.push({ - path: path.relative(location, dependecyLocation), - }); - } - } - fs.writeFileSync( - tsconfigPath, - JSON.stringify(workspaceConfig, undefined, 4), - ); - } - } - fs.writeFileSync('tsconfig.json', JSON.stringify(config, undefined, 4)); -})(); diff --git a/tsconfig.json b/tsconfig.json index c10af9169..f31e7316d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,5 +19,6 @@ "es2017" ] }, - "exclude": ["node_modules", "plugin_packages", "dist"] + "include": ["packages/**/*", "community/**/*", "scripts"], + "exclude": ["./node_modules", "./plugin_packages"] } diff --git a/tsconfig.packages.json b/tsconfig.packages.json index 9b3a81994..9260ac4d8 100644 --- a/tsconfig.packages.json +++ b/tsconfig.packages.json @@ -3,12 +3,12 @@ "compilerOptions": { "composite": true }, + // https://github.com/microsoft/TypeScript/issues/55717#issuecomment-1715003394 + "files": [], + "include": [], "exclude": [ "./community", "./scripts", - "node_modules", - "plugin_packages", - "dist", "__tests__", "**/*.test*", "**/*.spec*" diff --git a/yarn.lock b/yarn.lock index 5599717ec..17b162280 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2654,9 +2654,9 @@ integrity sha512-jD5VbvhfMhaYN4M3qPJuhMVUg3Dfc4tvPvLEAXn6GXbs/ajDFtCQahX37GIE65ipTI3I+hEvNaXS3MYAn9Ce3Q== "@types/lodash@^4.14.176": - version "4.14.195" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632" - integrity sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg== + version "4.14.198" + resolved "https://packages.atlassian.com/api/npm/npm-remote/@types/lodash/-/lodash-4.14.198.tgz#4d27465257011aedc741a809f1269941fa2c5d4c" + integrity sha512-trNJ/vtMZYMLhfN45uLq4ShQSw0/S7xCTLLVM+WM1rmFpba/VS42jVUgaO3w/NOLiWR/09lnYk0yMaA/atdIsg== "@types/minimist@^1.2.0": version "1.2.2"