From 7d37cf34c1b4cadfa1d27c28c142c3ed3dde5fec Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Mon, 6 Sep 2021 12:44:14 +0100 Subject: [PATCH] Adds references --- packages/core/tsconfig.json | 1 + packages/dev/src/components/editor.tsx | 4 ++-- packages/dev/tsconfig.json | 12 ++++++++---- packages/tldraw/tsconfig.json | 4 +++- packages/www/tsconfig.json | 9 ++++++++- tsconfig.base.json | 22 ++++++++++++---------- tsconfig.json | 3 +++ 7 files changed, 37 insertions(+), 18 deletions(-) diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 5b115bec7..929fcf50a 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -3,6 +3,7 @@ "include": ["src"], "exclude": ["node_modules", "dist", "docs"], "compilerOptions": { + "composite": true, "emitDeclarationOnly": true, "rootDir": "src", "outDir": "./dist/types", diff --git a/packages/dev/src/components/editor.tsx b/packages/dev/src/components/editor.tsx index ba0101975..aefd58713 100644 --- a/packages/dev/src/components/editor.tsx +++ b/packages/dev/src/components/editor.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { TLDraw, TLDrawState } from '@tldraw/tldraw' +import { TLDraw, TLDrawShapeType, TLDrawState } from '@tldraw/tldraw' export default function Editor(): JSX.Element { const rTLDrawState = React.useRef() @@ -13,7 +13,7 @@ export default function Editor(): JSX.Element { state.selectAll() state.createShapes({ id: 'rect1', - type: 'rectangle', + type: TLDrawShapeType.Rectangle, point: [100, 100], size: [200, 200], }) diff --git a/packages/dev/tsconfig.json b/packages/dev/tsconfig.json index cf9a3b892..984070ad1 100644 --- a/packages/dev/tsconfig.json +++ b/packages/dev/tsconfig.json @@ -3,8 +3,12 @@ "include": ["src"], "exclude": ["node_modules", "**/*.test.ts", "**/*.spec.ts", "dist"], "compilerOptions": { - "rootDir": "src", - "outDir": "./dist/types", - "baseUrl": "src" - } + "composite": true + }, + "references": [ + { + "path": "../../packages/tldraw" + }, + { "path": "../../packages/core" } + ] } diff --git a/packages/tldraw/tsconfig.json b/packages/tldraw/tsconfig.json index a4cdea555..1a1d1f104 100644 --- a/packages/tldraw/tsconfig.json +++ b/packages/tldraw/tsconfig.json @@ -3,6 +3,7 @@ "include": ["src"], "exclude": ["node_modules", "dist", "docs"], "compilerOptions": { + "composite": true, "emitDeclarationOnly": true, "rootDir": "src", "outDir": "./dist/types", @@ -10,5 +11,6 @@ "paths": { "~*": ["./*"] } - } + }, + "references": [{ "path": "../../packages/core" }] } diff --git a/packages/www/tsconfig.json b/packages/www/tsconfig.json index 0e7c7768d..efcee3e34 100644 --- a/packages/www/tsconfig.json +++ b/packages/www/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "composite": true, "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, @@ -20,5 +21,11 @@ } }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] + "exclude": ["node_modules"], + "references": [ + { + "path": "../../packages/tldraw" + }, + { "path": "../../packages/core" } + ] } diff --git a/tsconfig.base.json b/tsconfig.base.json index 97e118617..1bc6217fa 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,31 +1,33 @@ { "compilerOptions": { - "allowSyntheticDefaultImports": true, + // For references "declaration": true, + "declarationMap": true, + "sourceMap": true, + // Other + "allowSyntheticDefaultImports": true, "esModuleInterop": true, "experimentalDecorators": true, "forceConsistentCasingInFileNames": true, - "importsNotUsedAsValues": "error", - "stripInternal": true, - "incremental": true, "importHelpers": true, + "importsNotUsedAsValues": "error", + "incremental": true, + "jsx": "preserve", + "lib": ["dom", "esnext"], + "module": "esnext", "moduleResolution": "node", - "declarationMap": true, "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. */, + "stripInternal": true, "target": "es6", "typeRoots": ["node_modules/@types", "node_modules/jest"], - "types": ["node", "jest"], - "jsx": "preserve", - "lib": ["dom", "esnext"], - "module": "esnext" + "types": ["node", "jest"] } } diff --git a/tsconfig.json b/tsconfig.json index 5ccda92a6..b0219f154 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,9 @@ { + "composite": true, "extends": "./tsconfig.base.json", "exclude": ["node_modules", "**/*.test.ts", "**/*.spec.ts"], + "files": [], + "references": [{ "path": "./packages/tldraw" }, { "path": "./packages/core" }], "compilerOptions": { "baseUrl": ".", "paths": {