From bd938c995b50a05a9c806f6e1529601dcf9f78c0 Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Fri, 13 Aug 2021 13:48:08 +0100 Subject: [PATCH] cleans up tsconfigs --- package.json | 3 ++- packages/core/package.json | 5 +++-- packages/core/tsconfig.json | 30 ++---------------------------- packages/dev/package.json | 3 ++- packages/dev/tsconfig.json | 11 +++++------ packages/tldraw/package.json | 7 ++++--- packages/tldraw/tsconfig.json | 28 +--------------------------- packages/www/package.json | 2 +- packages/www/tsconfig.json | 28 +++++++++++----------------- tsconfig.base.json | 30 ++++++++++++++++++++++++++++++ tsconfig.json | 29 ++--------------------------- 11 files changed, 63 insertions(+), 113 deletions(-) create mode 100644 tsconfig.base.json diff --git a/package.json b/package.json index 8668d50aa..e06fc5c05 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "start": "lerna run start --stream --parallel", "start:www": "lerna run start --stream --parallel & cd packages/www && yarn build", "build": "yarn build:packages && cd packages/www && yarn build", - "build:packages": "cd packages/core && yarn build && cd ../tldraw && yarn build" + "build:packages": "cd packages/core && yarn build && cd ../tldraw && yarn build", + "publish:patch": "yarn build:packages && lerna publish patch" }, "devDependencies": { "@babel/plugin-syntax-import-meta": "^7.10.4", diff --git a/packages/core/package.json b/packages/core/package.json index b5b7ac1f1..e7e286afb 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -51,5 +51,6 @@ "ismobilejs": "^1.1.1", "react-error-boundary": "^3.1.3", "react-use-gesture": "^9.1.3" - } -} + }, + "gitHead": "4a7439ddf81b615ee49fddbe00802699975f9375" +} \ No newline at end of file diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 87acb4547..acf762cc5 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,35 +1,9 @@ { + "extends": "../../tsconfig.base.json", "include": ["src"], - "exclude": ["node_modules", "**/*.test.ts", "dist"], + "exclude": ["node_modules", "**/*.test.ts", "**/*.spec.ts", "dist"], "compilerOptions": { - "allowSyntheticDefaultImports": true, - "declaration": true, - "esModuleInterop": true, - "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true, - "importsNotUsedAsValues": "error", - "incremental": true, - "importHelpers": true, - "moduleResolution": "node", - "noEmit": false, - "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, - "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, - "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, - "noUnusedLocals": false /* Report errors on unused locals. */, - "noUnusedParameters": false /* Report errors on unused parameters. */, - "skipLibCheck": true, - "sourceMap": true, - "strict": false, - "strictFunctionTypes": true /* Enable strict checking of function types. */, - "strictNullChecks": true /* Enable strict null checks. */, - "target": "es5", - "typeRoots": ["node_modules/@types", "node_modules/jest"], - "types": ["node", "jest"], - // "rootDir": "src", - "jsx": "preserve", - "lib": ["dom", "esnext"], - "module": "esnext", "outDir": "./dist/types", "baseUrl": "src", "paths": { diff --git a/packages/dev/package.json b/packages/dev/package.json index cca206de6..b83cfe2a9 100644 --- a/packages/dev/package.json +++ b/packages/dev/package.json @@ -32,5 +32,6 @@ "esbuild": "0.11.5", "rimraf": "3.0.2", "typescript": "4.2.3" - } + }, + "gitHead": "4a7439ddf81b615ee49fddbe00802699975f9375" } diff --git a/packages/dev/tsconfig.json b/packages/dev/tsconfig.json index 5f180a19e..cf9a3b892 100644 --- a/packages/dev/tsconfig.json +++ b/packages/dev/tsconfig.json @@ -1,11 +1,10 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "include": ["src"], - "exclude": ["node_modules", "**/*.test.ts", "dist"], + "exclude": ["node_modules", "**/*.test.ts", "**/*.spec.ts", "dist"], "compilerOptions": { - "jsx": "preserve", - "lib": ["dom", "esnext"], - "module": "esnext", - "outDir": "./dist/types" + "rootDir": "src", + "outDir": "./dist/types", + "baseUrl": "src" } } diff --git a/packages/tldraw/package.json b/packages/tldraw/package.json index c231069f3..54efa3d35 100644 --- a/packages/tldraw/package.json +++ b/packages/tldraw/package.json @@ -1,7 +1,7 @@ { "name": "@tldraw/tldraw", "version": "0.0.42", - "private": false, + "private": true, "description": "A tiny little drawing app (editor).", "author": "@steveruizok", "repository": { @@ -61,5 +61,6 @@ "perfect-freehand": "^0.4.10", "react-hotkeys-hook": "^3.4.0", "zustand": "^3.5.7" - } -} + }, + "gitHead": "4a7439ddf81b615ee49fddbe00802699975f9375" +} \ No newline at end of file diff --git a/packages/tldraw/tsconfig.json b/packages/tldraw/tsconfig.json index 0ff203838..9557374c7 100644 --- a/packages/tldraw/tsconfig.json +++ b/packages/tldraw/tsconfig.json @@ -1,35 +1,9 @@ { + "extends": "../../tsconfig.base.json", "include": ["src"], "exclude": ["node_modules", "**/*.test.ts", "dist"], "compilerOptions": { - "allowSyntheticDefaultImports": true, - "declaration": true, - "esModuleInterop": true, - "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true, - "importsNotUsedAsValues": "error", - "incremental": true, - "importHelpers": true, - "moduleResolution": "node", - "noEmit": false, - "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, - "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, - "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, - "noUnusedLocals": false /* Report errors on unused locals. */, - "noUnusedParameters": false /* Report errors on unused parameters. */, - "skipLibCheck": true, - "sourceMap": true, - "strict": false, - "strictFunctionTypes": true /* Enable strict checking of function types. */, - "strictNullChecks": true /* Enable strict null checks. */, - "target": "es5", - "typeRoots": ["node_modules/@types", "node_modules/jest"], - "types": ["node", "jest"], - // "rootDir": "src", - "jsx": "preserve", - "lib": ["dom", "esnext"], - "module": "esnext", "outDir": "./dist/types", "baseUrl": "src", "paths": { diff --git a/packages/www/package.json b/packages/www/package.json index 7ceca420a..892a6adf9 100644 --- a/packages/www/package.json +++ b/packages/www/package.json @@ -36,4 +36,4 @@ "eslint-config-next": "11.0.1", "typescript": "^4.3.5" } -} +} \ No newline at end of file diff --git a/packages/www/tsconfig.json b/packages/www/tsconfig.json index 42e6a74df..83f23b34d 100644 --- a/packages/www/tsconfig.json +++ b/packages/www/tsconfig.json @@ -1,20 +1,14 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": false, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "module": "esnext", - "esModuleInterop": true, - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve" - }, + "extends": "../../tsconfig.base.json", "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] + "exclude": ["node_modules", "**/*.test.ts", "**/*.spec.ts", "dist"], + "compilerOptions": { + "lib": ["dom", "dom.iterable", "esnext"], + "rootDir": ".", + "outDir": "./dist/types", + "baseUrl": "src", + "allowJs": true, + "resolveJsonModule": true, + "isolatedModules": true + } } diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 000000000..e28a91e0a --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "forceConsistentCasingInFileNames": true, + "importsNotUsedAsValues": "error", + "incremental": true, + "importHelpers": true, + "moduleResolution": "node", + "noEmit": false, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noUnusedLocals": false /* Report errors on unused locals. */, + "noUnusedParameters": false /* Report errors on unused parameters. */, + "skipLibCheck": true, + "sourceMap": true, + "strict": false, + "strictFunctionTypes": true /* Enable strict checking of function types. */, + "strictNullChecks": true /* Enable strict null checks. */, + "target": "es5", + "typeRoots": ["node_modules/@types", "node_modules/jest"], + "types": ["node", "jest"], + "jsx": "preserve", + "lib": ["dom", "esnext"], + "module": "esnext" + } +} diff --git a/tsconfig.json b/tsconfig.json index 7508688fb..5ccda92a6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,33 +1,8 @@ { + "extends": "./tsconfig.base.json", + "exclude": ["node_modules", "**/*.test.ts", "**/*.spec.ts"], "compilerOptions": { - "allowSyntheticDefaultImports": true, "baseUrl": ".", - "declaration": true, - "esModuleInterop": true, - "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true, - "importsNotUsedAsValues": "error", - "incremental": true, - "importHelpers": true, - "jsx": "react", - "lib": ["dom", "esnext"], - "module": "esnext", - "moduleResolution": "node", - "noEmit": false, - "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, - "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, - "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, - "noUnusedLocals": false /* Report errors on unused locals. */, - "noUnusedParameters": false /* Report errors on unused parameters. */, - "outDir": "dist", - "skipLibCheck": true, - "sourceMap": true, - "strict": false, - "strictFunctionTypes": true /* Enable strict checking of function types. */, - "strictNullChecks": true /* Enable strict null checks. */, - "target": "es5", - "typeRoots": ["node_modules/@types", "node_modules/jest"], - "types": ["node", "jest"], "paths": { "@tldraw/tldraw": ["./packages/tldraw/dist"], "@tldraw/core": ["./packages/core/dist"],