diff --git a/benchmarks/basic/tsconfig.json b/benchmarks/basic/tsconfig.json index 546bce5..e116aae 100644 --- a/benchmarks/basic/tsconfig.json +++ b/benchmarks/basic/tsconfig.json @@ -1,7 +1,6 @@ { - "extends": ["../../tsconfig.json"], + "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", "outDir": "dist" }, "include": ["**/*.ts"], diff --git a/examples/basic/tsconfig.json b/examples/basic/tsconfig.json index 546bce5..e116aae 100644 --- a/examples/basic/tsconfig.json +++ b/examples/basic/tsconfig.json @@ -1,7 +1,6 @@ { - "extends": ["../../tsconfig.json"], + "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", "outDir": "dist" }, "include": ["**/*.ts"], diff --git a/examples/declare-workflow/tsconfig.json b/examples/declare-workflow/tsconfig.json index 546bce5..e116aae 100644 --- a/examples/declare-workflow/tsconfig.json +++ b/examples/declare-workflow/tsconfig.json @@ -1,7 +1,6 @@ { - "extends": ["../../tsconfig.json"], + "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", "outDir": "dist" }, "include": ["**/*.ts"], diff --git a/examples/with-schema-validation/tsconfig.json b/examples/with-schema-validation/tsconfig.json index 546bce5..e116aae 100644 --- a/examples/with-schema-validation/tsconfig.json +++ b/examples/with-schema-validation/tsconfig.json @@ -1,7 +1,6 @@ { - "extends": ["../../tsconfig.json"], + "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", "outDir": "dist" }, "include": ["**/*.ts"], diff --git a/examples/workflow-discovery/tsconfig.json b/examples/workflow-discovery/tsconfig.json index 9950aca..e116aae 100644 --- a/examples/workflow-discovery/tsconfig.json +++ b/examples/workflow-discovery/tsconfig.json @@ -1,7 +1,7 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "noEmit": true + "outDir": "dist" }, "include": ["**/*.ts"], "exclude": ["dist"] diff --git a/package.json b/package.json index 9b596d0..3e7a61a 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ ], "scripts": { "build": "turbo build", - "ci": "npm run format && npm run lint && npm run typecheck && npm run build && npm run test:coverage", + "ci": "npm run format && npm run build && npm run lint && npm run typecheck && npm run test:coverage", "format": "prettier --check . --ignore-path .gitignore --ignore-path .prettierignore", "format:fix": "prettier --write . --ignore-path .gitignore --ignore-path .prettierignore", "knip": "knip", diff --git a/packages/backend-postgres/package.json b/packages/backend-postgres/package.json index b814094..b42e762 100644 --- a/packages/backend-postgres/package.json +++ b/packages/backend-postgres/package.json @@ -5,7 +5,6 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "development": "./index.ts", "default": "./dist/index.js" } }, diff --git a/packages/backend-postgres/tsconfig.json b/packages/backend-postgres/tsconfig.json index 546bce5..b3db5ed 100644 --- a/packages/backend-postgres/tsconfig.json +++ b/packages/backend-postgres/tsconfig.json @@ -1,9 +1,9 @@ { - "extends": ["../../tsconfig.json"], + "extends": ["../../tsconfig.base.json"], "compilerOptions": { - "rootDir": ".", "outDir": "dist" }, + "references": [{ "path": "../openworkflow" }], "include": ["**/*.ts"], "exclude": ["dist"] } diff --git a/packages/backend-sqlite/package.json b/packages/backend-sqlite/package.json index 35fc7ce..c028fe0 100644 --- a/packages/backend-sqlite/package.json +++ b/packages/backend-sqlite/package.json @@ -5,7 +5,6 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "development": "./index.ts", "default": "./dist/index.js" } }, diff --git a/packages/backend-sqlite/tsconfig.json b/packages/backend-sqlite/tsconfig.json index 546bce5..1f06722 100644 --- a/packages/backend-sqlite/tsconfig.json +++ b/packages/backend-sqlite/tsconfig.json @@ -1,9 +1,9 @@ { - "extends": ["../../tsconfig.json"], + "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", "outDir": "dist" }, + "references": [{ "path": "../openworkflow" }], "include": ["**/*.ts"], "exclude": ["dist"] } diff --git a/packages/backend-test/package.json b/packages/backend-test/package.json index e840b83..379dd0e 100644 --- a/packages/backend-test/package.json +++ b/packages/backend-test/package.json @@ -5,7 +5,6 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "development": "./index.ts", "default": "./dist/index.js" } }, diff --git a/packages/backend-test/tsconfig.json b/packages/backend-test/tsconfig.json index 546bce5..1f06722 100644 --- a/packages/backend-test/tsconfig.json +++ b/packages/backend-test/tsconfig.json @@ -1,9 +1,9 @@ { - "extends": ["../../tsconfig.json"], + "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", "outDir": "dist" }, + "references": [{ "path": "../openworkflow" }], "include": ["**/*.ts"], "exclude": ["dist"] } diff --git a/packages/cli/package.json b/packages/cli/package.json index 538d132..653e393 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -5,12 +5,10 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "development": "./index.ts", "default": "./dist/index.js" }, "./internal": { "types": "./dist/internal.d.ts", - "development": "./internal.ts", "default": "./dist/internal.js" } }, diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 546bce5..1f06722 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -1,9 +1,9 @@ { - "extends": ["../../tsconfig.json"], + "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", "outDir": "dist" }, + "references": [{ "path": "../openworkflow" }], "include": ["**/*.ts"], "exclude": ["dist"] } diff --git a/packages/dashboard/tsconfig.json b/packages/dashboard/tsconfig.json index d7a8b1f..682e11d 100644 --- a/packages/dashboard/tsconfig.json +++ b/packages/dashboard/tsconfig.json @@ -1,14 +1,17 @@ { "extends": [ - "../../tsconfig.json", + "../../tsconfig.base.json", "@tsconfig/vite-react/tsconfig.json" // https://www.npmjs.com/package/@tsconfig/vite-react ], "compilerOptions": { + "noEmit": false, // TS6310 + "allowImportingTsExtensions": false, // TS5096, caused by disabling noEmit "types": ["vite/client"], "paths": { "@/*": ["./src/*"] } }, + "references": [{ "path": "../cli" }, { "path": "../openworkflow" }], "include": ["**/*.ts", "**/*.tsx"], "exclude": ["dist"] } diff --git a/packages/openworkflow/package.json b/packages/openworkflow/package.json index d24634a..a73617a 100644 --- a/packages/openworkflow/package.json +++ b/packages/openworkflow/package.json @@ -28,12 +28,10 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "development": "./index.ts", "default": "./dist/index.js" }, "./internal": { "types": "./dist/internal.d.ts", - "development": "./internal.ts", "default": "./dist/internal.js" } }, diff --git a/packages/openworkflow/tsconfig.json b/packages/openworkflow/tsconfig.json index 4e97c9a..4219e97 100644 --- a/packages/openworkflow/tsconfig.json +++ b/packages/openworkflow/tsconfig.json @@ -1,9 +1,11 @@ { - "extends": ["../../tsconfig.json"], + "extends": ["../../tsconfig.base.json"], "compilerOptions": { - "rootDir": ".", "outDir": "dist" }, "include": ["**/*.ts"], - "exclude": ["**/*.test.ts", "dist"] + "exclude": [ + "dist", + "**/*.test.ts" // see note in ./tsconfig.test.json + ] } diff --git a/packages/openworkflow/tsconfig.test.json b/packages/openworkflow/tsconfig.test.json new file mode 100644 index 0000000..ae2805c --- /dev/null +++ b/packages/openworkflow/tsconfig.test.json @@ -0,0 +1,11 @@ +// this config is a workaround to add backend-postgres as a reference for our +// test files without a circular reference in the main tsconfig.json +{ + "extends": ["./tsconfig.json"], + "compilerOptions": { + "outDir": "dist" + }, + "references": [{ "path": "." }, { "path": "../backend-postgres" }], + "include": ["**/*.test.ts"], + "exclude": ["dist"] +} diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..eb5c04e --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,12 @@ +{ + "extends": [ + "@tsconfig/strictest/tsconfig.json", // https://www.npmjs.com/package/@tsconfig/strictest + "@tsconfig/node22/tsconfig.json" // https://www.npmjs.com/package/@tsconfig/node22 + ], + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "declarationMap": true + } +} diff --git a/tsconfig.json b/tsconfig.json index 53b9727..6f7a6af 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,21 +1,29 @@ { - "extends": [ - "@tsconfig/strictest/tsconfig.json", // https://www.npmjs.com/package/@tsconfig/strictest - "@tsconfig/node22/tsconfig.json" // https://www.npmjs.com/package/@tsconfig/node22 + // https://www.typescriptlang.org/docs/handbook/project-references.html#overall-structure + "files": [], + "references": [ + { "path": "./benchmarks/basic" }, + { "path": "./examples/basic" }, + { "path": "./examples/declare-workflow" }, + { "path": "./examples/with-schema-validation" }, + { "path": "./examples/workflow-discovery" }, + { "path": "./packages/openworkflow" }, + { "path": "./packages/backend-postgres" }, + { "path": "./packages/backend-sqlite" }, + { "path": "./packages/backend-test" }, + { "path": "./packages/cli" }, + { "path": "./packages/dashboard" } ], - "compilerOptions": { - "rootDir": ".", - "outDir": "dist", - "customConditions": ["development"], - "composite": true, - "declaration": true, - "sourceMap": true, - "declarationMap": true + // project-wide settings for configs, workflows, etc. + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "dist" }, - "include": ["**/*.ts"], - - // temporary - run `npm run typecheck` from the package root until we migrate - // our typechecks over to turbo - "exclude": ["packages/dashboard", "dist"] + "include": [ + "openworkflow/**/*.ts", + "*.config.ts", + "packages/openworkflow/**/*.test.ts" // needed to work with packages/openworkflow/tsconfig.test.json + ], + "exclude": ["dist"] } diff --git a/vitest.config.ts b/vitest.config.ts index 52be040..f1ae95b 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -7,6 +7,7 @@ export default defineConfig({ coverage: { include: ["packages/**/*.ts"], exclude: [ + "**/*.testsuite.ts", "**/dist/**", "**/scripts/*.ts", "vitest.global-setup.ts",