diff --git a/packages/create-payload-app/tsconfig.json b/packages/create-payload-app/tsconfig.json index 566241578a7..3c0293c57e3 100644 --- a/packages/create-payload-app/tsconfig.json +++ b/packages/create-payload-app/tsconfig.json @@ -1,13 +1,6 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, "strict": true }, - "exclude": ["dist", "build", "tests", "test", "node_modules", "eslint.config.js"], - "include": ["src/**/*.ts", "src/**/*.spec.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"] } diff --git a/packages/db-mongodb/tsconfig.json b/packages/db-mongodb/tsconfig.json index d3ac9f33c6d..a181cd4bf9b 100644 --- a/packages/db-mongodb/tsconfig.json +++ b/packages/db-mongodb/tsconfig.json @@ -1,24 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */ - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }, { "path": "../translations" }] } diff --git a/packages/db-postgres/tsconfig.json b/packages/db-postgres/tsconfig.json index 470098fe449..760627a1b1f 100644 --- a/packages/db-postgres/tsconfig.json +++ b/packages/db-postgres/tsconfig.json @@ -1,32 +1,5 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - // Make sure typescript knows that this module depends on their references - "composite": true, - /* Do not emit outputs. */ - "noEmit": false, - "emitDeclarationOnly": true, - /* Specify an output folder for all emitted files. */ - "outDir": "./dist", - /* Specify the root folder within your source files. */ - "rootDir": "./src" - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": [ - "src", - "src/**/*.ts", - ], + "extends": "../../tsconfig.base.json", "references": [ { "path": "../payload" diff --git a/packages/db-sqlite/tsconfig.json b/packages/db-sqlite/tsconfig.json index 7308bb80f97..760627a1b1f 100644 --- a/packages/db-sqlite/tsconfig.json +++ b/packages/db-sqlite/tsconfig.json @@ -1,32 +1,5 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, - // Make sure typescript knows that this module depends on their references - "noEmit": false - /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" - /* Specify an output folder for all emitted files. */, - "rootDir": "./src" - /* Specify the root folder within your source files. */ - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": [ - "src", - "src/**/*.ts" - ], + "extends": "../../tsconfig.base.json", "references": [ { "path": "../payload" diff --git a/packages/db-vercel-postgres/tsconfig.json b/packages/db-vercel-postgres/tsconfig.json index dfbf561809c..760627a1b1f 100644 --- a/packages/db-vercel-postgres/tsconfig.json +++ b/packages/db-vercel-postgres/tsconfig.json @@ -1,29 +1,5 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, - "noEmit": false, - "emitDeclarationOnly": true, - "outDir": "./dist", - "rootDir": "./src", - "skipLibCheck": true, - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": [ - "src", - "src/**/*.ts", - ], + "extends": "../../tsconfig.base.json", "references": [ { "path": "../payload" diff --git a/packages/drizzle/tsconfig.json b/packages/drizzle/tsconfig.json index ddd37c9e4f3..a181cd4bf9b 100644 --- a/packages/drizzle/tsconfig.json +++ b/packages/drizzle/tsconfig.json @@ -1,28 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - // Make sure typescript knows that this module depends on their references - "composite": true, - /* Do not emit outputs. */ - "noEmit": false, - "emitDeclarationOnly": true, - /* Specify an output folder for all emitted files. */ - "outDir": "./dist", - /* Specify the root folder within your source files. */ - "rootDir": "./src" - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }, { "path": "../translations" }] } diff --git a/packages/email-nodemailer/tsconfig.json b/packages/email-nodemailer/tsconfig.json index 763126eed76..9f2129e174b 100644 --- a/packages/email-nodemailer/tsconfig.json +++ b/packages/email-nodemailer/tsconfig.json @@ -1,14 +1,7 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, "strict": true }, - "exclude": ["dist", "node_modules"], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], "references": [{ "path": "../payload" }] } diff --git a/packages/email-resend/tsconfig.json b/packages/email-resend/tsconfig.json index fd981033ae8..9f2129e174b 100644 --- a/packages/email-resend/tsconfig.json +++ b/packages/email-resend/tsconfig.json @@ -1,14 +1,7 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, "strict": true }, - "exclude": ["dist", "node_modules", "src/**/*.spec.ts"], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], "references": [{ "path": "../payload" }] } diff --git a/packages/graphql/tsconfig.json b/packages/graphql/tsconfig.json index 79d535b16e7..45209999a24 100644 --- a/packages/graphql/tsconfig.json +++ b/packages/graphql/tsconfig.json @@ -1,24 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */ - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }] } diff --git a/packages/live-preview-react/tsconfig.json b/packages/live-preview-react/tsconfig.json index 26e0a63c1e7..45209999a24 100644 --- a/packages/live-preview-react/tsconfig.json +++ b/packages/live-preview-react/tsconfig.json @@ -1,25 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, - "jsx": "react-jsx" - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }] } diff --git a/packages/live-preview-vue/tsconfig.json b/packages/live-preview-vue/tsconfig.json index 2aa83167bc3..0c88df29273 100644 --- a/packages/live-preview-vue/tsconfig.json +++ b/packages/live-preview-vue/tsconfig.json @@ -1,25 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, - "jsx": "react-jsx" - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }] // db-mongodb depends on payload } diff --git a/packages/live-preview/tsconfig.json b/packages/live-preview/tsconfig.json index 79d535b16e7..45209999a24 100644 --- a/packages/live-preview/tsconfig.json +++ b/packages/live-preview/tsconfig.json @@ -1,24 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */ - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }] } diff --git a/packages/next/tsconfig.cjs.json b/packages/next/tsconfig.cjs.json deleted file mode 100644 index 9d16e08ea65..00000000000 --- a/packages/next/tsconfig.cjs.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "module": "CommonJS", - "composite": true, // Required for references to work - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist/cjs" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, - "sourceMap": true - }, - "include": ["src/withPayload.js" /* Include the withPayload.js file in the build */] -} diff --git a/packages/next/tsconfig.json b/packages/next/tsconfig.json index 091638e1712..dd15305953f 100644 --- a/packages/next/tsconfig.json +++ b/packages/next/tsconfig.json @@ -1,25 +1,5 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Required for references to work - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, - "sourceMap": true - }, - "exclude": [ - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx", - "src/**/*.json" - ], - "include": [ - "src/**/*.ts", - "src/**/*.tsx", - "src/withPayload.js" /* Include the withPayload.js file in the build */ -, "../ui/src/utilities/renderFields.tsx" ], + "extends": "../../tsconfig.base.json", "references": [ { "path": "../payload" }, { "path": "../ui" }, diff --git a/packages/payload-cloud/tsconfig.json b/packages/payload-cloud/tsconfig.json index ed456820bf6..45209999a24 100644 --- a/packages/payload-cloud/tsconfig.json +++ b/packages/payload-cloud/tsconfig.json @@ -1,13 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */ - }, - "exclude": ["dist", "build", "tests", "test", "node_modules", "eslint.config.js"], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }] } diff --git a/packages/payload/tsconfig.json b/packages/payload/tsconfig.json index 846dbc7db27..d4811ddd5fd 100644 --- a/packages/payload/tsconfig.json +++ b/packages/payload/tsconfig.json @@ -1,38 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Required for packages/db-mongodb to build - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, - "outDir": "./dist" /* Redirect output structure to the directory. */, - "paths": { - "payload/auth": ["./src/auth/types.ts"], - "payload/config": ["./src/config/types.ts"], - "payload/generated-types": ["./src/generated-types.ts"], - "payload/types": ["./src/types/index.ts"] - }, - "types": ["jest", "node", "@types/jest"], - "lib": [ - "DOM", - "DOM.Iterable", - "ES2022" - ], - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx", - "temp" - ], - /* Like tsconfig.build.json, but includes test directory and doesnt emit anything */ - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../translations" }] } diff --git a/packages/plugin-cloud-storage/tsconfig.json b/packages/plugin-cloud-storage/tsconfig.json index 79d535b16e7..45209999a24 100644 --- a/packages/plugin-cloud-storage/tsconfig.json +++ b/packages/plugin-cloud-storage/tsconfig.json @@ -1,24 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */ - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }] } diff --git a/packages/plugin-form-builder/tsconfig.json b/packages/plugin-form-builder/tsconfig.json index e61d087344f..dd036fd84fd 100644 --- a/packages/plugin-form-builder/tsconfig.json +++ b/packages/plugin-form-builder/tsconfig.json @@ -1,25 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */ - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx", - "src/**/mocks/*" - ], - "include": ["src/**/*"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }, { "path": "../ui" }] } diff --git a/packages/plugin-nested-docs/tsconfig.json b/packages/plugin-nested-docs/tsconfig.json index 26e0a63c1e7..45209999a24 100644 --- a/packages/plugin-nested-docs/tsconfig.json +++ b/packages/plugin-nested-docs/tsconfig.json @@ -1,25 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, - "jsx": "react-jsx" - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }] } diff --git a/packages/plugin-redirects/tsconfig.json b/packages/plugin-redirects/tsconfig.json index 79d535b16e7..45209999a24 100644 --- a/packages/plugin-redirects/tsconfig.json +++ b/packages/plugin-redirects/tsconfig.json @@ -1,24 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */ - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }] } diff --git a/packages/plugin-search/tsconfig.json b/packages/plugin-search/tsconfig.json index 8296b7bf94a..fb211828647 100644 --- a/packages/plugin-search/tsconfig.json +++ b/packages/plugin-search/tsconfig.json @@ -1,24 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */ - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }, { "path": "../ui" }, { "path": "../next" }] } diff --git a/packages/plugin-sentry/tsconfig.json b/packages/plugin-sentry/tsconfig.json index 2b3fd0af7a5..45209999a24 100644 --- a/packages/plugin-sentry/tsconfig.json +++ b/packages/plugin-sentry/tsconfig.json @@ -1,25 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src", /* Specify the root folder within your source files. */ - "jsx": "react-jsx" - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }] } diff --git a/packages/plugin-seo/tsconfig.json b/packages/plugin-seo/tsconfig.json index 811d94e4843..fb211828647 100644 --- a/packages/plugin-seo/tsconfig.json +++ b/packages/plugin-seo/tsconfig.json @@ -1,25 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src", /* Specify the root folder within your source files. */ - "jsx": "react-jsx" - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }, { "path": "../ui" }, { "path": "../next" }] } diff --git a/packages/plugin-stripe/tsconfig.json b/packages/plugin-stripe/tsconfig.json index 8296b7bf94a..fb211828647 100644 --- a/packages/plugin-stripe/tsconfig.json +++ b/packages/plugin-stripe/tsconfig.json @@ -1,24 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */ - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }, { "path": "../ui" }, { "path": "../next" }] } diff --git a/packages/richtext-lexical/src/lexical/plugins/TextPlugin/index.tsx b/packages/richtext-lexical/src/lexical/plugins/TextPlugin/index.tsx index 400ccbba900..0bd032d2a67 100644 --- a/packages/richtext-lexical/src/lexical/plugins/TextPlugin/index.tsx +++ b/packages/richtext-lexical/src/lexical/plugins/TextPlugin/index.tsx @@ -3,9 +3,10 @@ import type { TextFormatType } from 'lexical' import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext' import { TEXT_TYPE_TO_FORMAT, TextNode } from 'lexical' -import { type SanitizedClientFeatures } from 'packages/richtext-lexical/src/features/typesClient.js' import { useEffect } from 'react' +import type { SanitizedClientFeatures } from '../../../features/typesClient.js' + export function TextPlugin({ features }: { features: SanitizedClientFeatures }) { const [editor] = useLexicalComposerContext() diff --git a/packages/richtext-lexical/tsconfig.json b/packages/richtext-lexical/tsconfig.json index 7a795018fd4..c2fd8ec3410 100644 --- a/packages/richtext-lexical/tsconfig.json +++ b/packages/richtext-lexical/tsconfig.json @@ -1,25 +1,10 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "esModuleInterop": true, "strictNullChecks": true, "noImplicitAny": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, "strict": true }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - ], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], "references": [ { "path": "../payload" }, { "path": "../translations" }, diff --git a/packages/storage-s3/tsconfig.json b/packages/storage-s3/tsconfig.json index ecb0fe770e5..48567c8ced9 100644 --- a/packages/storage-s3/tsconfig.json +++ b/packages/storage-s3/tsconfig.json @@ -1,14 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, - "strict": true - }, - "exclude": ["dist", "node_modules"], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }, { "path": "../plugin-cloud-storage" }] } diff --git a/packages/storage-uploadthing/tsconfig.json b/packages/storage-uploadthing/tsconfig.json index ecb0fe770e5..48567c8ced9 100644 --- a/packages/storage-uploadthing/tsconfig.json +++ b/packages/storage-uploadthing/tsconfig.json @@ -1,14 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, - "strict": true - }, - "exclude": ["dist", "node_modules"], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }, { "path": "../plugin-cloud-storage" }] } diff --git a/packages/storage-vercel-blob/tsconfig.json b/packages/storage-vercel-blob/tsconfig.json index ecb0fe770e5..48567c8ced9 100644 --- a/packages/storage-vercel-blob/tsconfig.json +++ b/packages/storage-vercel-blob/tsconfig.json @@ -1,14 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */, - "strict": true - }, - "exclude": ["dist", "node_modules"], - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }, { "path": "../plugin-cloud-storage" }] } diff --git a/packages/translations/package.json b/packages/translations/package.json index 7826af7117e..6412c1ae246 100644 --- a/packages/translations/package.json +++ b/packages/translations/package.json @@ -45,8 +45,9 @@ "dist" ], "scripts": { - "build": "pnpm build:types", - "build:types": "tsc --outDir dist", + "build": "pnpm build:types && pnpm build:swc", + "build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths", + "build:types": "tsc --emitDeclarationOnly --outDir dist", "clean": "rimraf {dist,*.tsbuildinfo}", "lint": "eslint .", "lint:fix": "eslint . --fix", diff --git a/packages/translations/tsconfig.json b/packages/translations/tsconfig.json index 152214d8806..96a27d9cc87 100644 --- a/packages/translations/tsconfig.json +++ b/packages/translations/tsconfig.json @@ -1,19 +1,3 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "esModuleInterop": true, - "resolveJsonModule": true, - "allowJs": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src", - "lib": [ - "DOM", - "DOM.Iterable", - "ES2022" - ], - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": false - }, - "include": ["src/**/*.ts", "src/**/*.js"] + "extends": "../../tsconfig.base.json", } diff --git a/packages/ui/src/fields/RadioGroup/index.tsx b/packages/ui/src/fields/RadioGroup/index.tsx index db989cb6c0b..76b3978c55f 100644 --- a/packages/ui/src/fields/RadioGroup/index.tsx +++ b/packages/ui/src/fields/RadioGroup/index.tsx @@ -138,4 +138,4 @@ const RadioGroupFieldComponent: RadioFieldClientComponent = (props) => { ) } -export const RadioGroupField = withCondition(RadioGroupFieldComponent) +export const RadioGroupField: any = withCondition(RadioGroupFieldComponent) diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index 0f1cc8f0657..a181cd4bf9b 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -1,33 +1,4 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, // Make sure typescript knows that this module depends on their references - "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true, - "esModuleInterop": true, - "outDir": "./dist" /* Specify an output folder for all emitted files. */, - "rootDir": "./src" /* Specify the root folder within your source files. */ - }, - "exclude": [ - "dist", - "build", - "tests", - "test", - "node_modules", - "eslint.config.js", - "src/**/*.spec.js", - "src/**/*.spec.jsx", - "src/**/*.spec.ts", - "src/**/*.spec.tsx" - ], - "include": [ - "src/scss/app.scss", - "src/**/*.png", - "src/**/*.svg", - "src/**/*.ts", - "src/**/*.tsx", - "src/**/*.d.ts", - "src/**/*.json" - ], + "extends": "../../tsconfig.base.json", "references": [{ "path": "../payload" }, { "path": "../translations" }] } diff --git a/scripts/reset-tsconfig.js b/scripts/reset-tsconfig.js index 5e423b1aaf0..9a75103e725 100644 --- a/scripts/reset-tsconfig.js +++ b/scripts/reset-tsconfig.js @@ -11,15 +11,20 @@ import { parse, stringify } from 'comment-json' import path from 'path' import fs from 'fs/promises' import { fileURLToPath } from 'url' +import { existsSync } from 'fs' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) -const tsConfigPath = path.resolve(dirname, '../tsconfig.json') +const tsConfigBasePath = path.resolve(dirname, '../tsconfig.base.json') +const tsConfigPath = existsSync(tsConfigBasePath) + ? tsConfigBasePath + : path.resolve(dirname, '../tsconfig.json') + + const tsConfigContent = await fs.readFile(tsConfigPath, 'utf8') const tsConfig = parse(tsConfigContent) -// @ts-expect-error tsConfig.compilerOptions.paths['@payload-config'] = ['./test/_community/config.ts'] const output = stringify(tsConfig, null, 2) + `\n` await fs.writeFile(tsConfigPath, output) diff --git a/test/next-env.d.ts b/test/next-env.d.ts index 4f11a03dc6c..40c3d68096c 100644 --- a/test/next-env.d.ts +++ b/test/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. diff --git a/test/testHooks.ts b/test/testHooks.ts index 4a99f9b3b34..4d3ef594433 100644 --- a/test/testHooks.ts +++ b/test/testHooks.ts @@ -10,7 +10,12 @@ const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) export const createTestHooks = async (testSuiteName = '_community') => { - const tsConfigPath = path.resolve(getNextRootDir().rootDir, './tsconfig.json') + const rootDir = getNextRootDir().rootDir + const tsConfigBasePath = path.resolve(rootDir, './tsconfig.base.json') + const tsConfigPath = existsSync(tsConfigBasePath) + ? tsConfigBasePath + : path.resolve(rootDir, './tsconfig.json') + const tsConfigContent = await readFile(tsConfigPath, 'utf8') const tsConfig = parse(tsConfigContent) @@ -20,7 +25,7 @@ export const createTestHooks = async (testSuiteName = '_community') => { */ beforeTest: async () => { // Delete entire .next cache folder - const nextCache = path.resolve(getNextRootDir().rootDir, './.next') + const nextCache = path.resolve(rootDir, './.next') if (existsSync(nextCache)) { await rm(nextCache, { recursive: true }) } diff --git a/test/tsconfig.json b/test/tsconfig.json index 395f8faaa36..894286362bd 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -12,12 +12,20 @@ "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "jsx": "preserve", - "lib": ["DOM", "DOM.Iterable", "ES2022"], + "lib": [ + "DOM", + "DOM.Iterable", + "ES2022" + ], "resolveJsonModule": true, "skipLibCheck": true, "sourceMap": true, "strict": false, - "types": ["jest", "node", "@types/jest"], + "types": [ + "jest", + "node", + "@types/jest" + ], "incremental": true, "isolatedModules": true, "plugins": [ @@ -27,7 +35,9 @@ ], "baseUrl": ".", "paths": { - "@payload-config": ["./fields/config.ts"] + "@payload-config": [ + "./_community/config.ts" + ] } }, "exclude": [ @@ -38,6 +48,12 @@ "dist/**/*.js", "**/dist/**/*.js" ], - "include": ["./**/*.ts", "./**/*.tsx", "next-env.d.ts", ".next/types/**/*.ts", "setup.js"], + "include": [ + "./**/*.ts", + "./**/*.tsx", + "next-env.d.ts", + ".next/types/**/*.ts", + "setup.js" + ], "references": [] } diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 00000000000..4a6b98fad29 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,107 @@ +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "target": "ES2022", + "rootDir": "${configDir}/src", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "allowJs": true, + "checkJs": false, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "jsx": "preserve", + "lib": [ + "DOM", + "DOM.Iterable", + "ES2022" + ], + "outDir": "${configDir}/dist", + "resolveJsonModule": true, + "skipLibCheck": true, + "emitDeclarationOnly": true, + "sourceMap": true, + "types": [ + "jest", + "node", + "@types/jest" + ], + "incremental": true, + "isolatedModules": true, + "strict": false, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@payload-config": [ + "./test/_community/config.ts" + ], + "@payloadcms/live-preview": [ + "./packages/live-preview/src" + ], + "@payloadcms/live-preview-react": [ + "./packages/live-preview-react/src/index.ts" + ], + "@payloadcms/live-preview-vue": [ + "./packages/live-preview-vue/src/index.ts" + ], + "@payloadcms/ui": [ + "./packages/ui/src/exports/client/index.ts" + ], + "@payloadcms/ui/shared": [ + "./packages/ui/src/exports/shared/index.ts" + ], + "@payloadcms/ui/scss": [ + "./packages/ui/src/scss.scss" + ], + "@payloadcms/ui/scss/app.scss": [ + "./packages/ui/src/scss/app.scss" + ], + "@payloadcms/next/*": [ + "./packages/next/src/exports/*.ts" + ], + "@payloadcms/richtext-lexical/client": [ + "./packages/richtext-lexical/src/exports/client/index.ts" + ], + "@payloadcms/richtext-lexical/rsc": [ + "./packages/richtext-lexical/src/exports/server/rsc.ts" + ], + "@payloadcms/richtext-slate/rsc": [ + "./packages/richtext-slate/src/exports/server/rsc.ts" + ], + "@payloadcms/richtext-slate/client": [ + "./packages/richtext-slate/src/exports/client/index.ts" + ], + "@payloadcms/plugin-seo/client": [ + "./packages/plugin-seo/src/exports/client.ts" + ], + "@payloadcms/plugin-sentry/client": [ + "./packages/plugin-sentry/src/exports/client.ts" + ], + "@payloadcms/plugin-stripe/client": [ + "./packages/plugin-stripe/src/exports/client.ts" + ], + "@payloadcms/plugin-search/client": [ + "./packages/plugin-search/src/exports/client.ts" + ], + "@payloadcms/plugin-form-builder/client": [ + "./packages/plugin-form-builder/src/exports/client.ts" + ], + "@payloadcms/next": [ + "./packages/next/src/exports/*" + ] + } + }, + "include": [ + "${configDir}/src" + ], + "exclude": [ + "${configDir}/dist", + "${configDir}/build", + "${configDir}/temp", + "**/*.spec.ts" + ] +} diff --git a/tsconfig.json b/tsconfig.json index 53226b2c423..4e940938e27 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,107 +1,11 @@ { + "extends": "./tsconfig.base.json", "compilerOptions": { - "baseUrl": ".", - "declaration": true, - "declarationMap": true, - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "allowJs": true, - "checkJs": false, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "jsx": "preserve", - "lib": [ - "DOM", - "DOM.Iterable", - "ES2022" - ], + "composite": false, "noEmit": true, - "outDir": "./dist", - "resolveJsonModule": true, - "rootDir": ".", - "skipLibCheck": true, - "sourceMap": true, - "strict": false, - "types": [ - "jest", - "node", - "@types/jest" - ], - "incremental": true, - "isolatedModules": true, - "plugins": [ - { - "name": "next" - } - ], - "paths": { - "@payload-config": [ - "./test/_community/config.ts" - ], - "@payloadcms/live-preview": [ - "./packages/live-preview/src" - ], - "@payloadcms/live-preview-react": [ - "./packages/live-preview-react/src/index.ts" - ], - "@payloadcms/live-preview-vue": [ - "./packages/live-preview-vue/src/index.ts" - ], - "@payloadcms/ui": [ - "./packages/ui/src/exports/client/index.ts" - ], - "@payloadcms/ui/shared": [ - "./packages/ui/src/exports/shared/index.ts" - ], - "@payloadcms/ui/scss": [ - "./packages/ui/src/scss.scss" - ], - "@payloadcms/ui/scss/app.scss": [ - "./packages/ui/src/scss/app.scss" - ], - "@payloadcms/next/*": [ - "./packages/next/src/exports/*.ts" - ], - "@payloadcms/richtext-lexical/client": [ - "./packages/richtext-lexical/src/exports/client/index.ts" - ], - "@payloadcms/richtext-lexical/rsc": [ - "./packages/richtext-lexical/src/exports/server/rsc.ts" - ], - "@payloadcms/richtext-slate/rsc": [ - "./packages/richtext-slate/src/exports/server/rsc.ts" - ], - "@payloadcms/richtext-slate/client": [ - "./packages/richtext-slate/src/exports/client/index.ts" - ], - "@payloadcms/plugin-seo/client": [ - "./packages/plugin-seo/src/exports/client.ts" - ], - "@payloadcms/plugin-sentry/client": [ - "./packages/plugin-sentry/src/exports/client.ts" - ], - "@payloadcms/plugin-stripe/client": [ - "./packages/plugin-stripe/src/exports/client.ts" - ], - "@payloadcms/plugin-search/client": [ - "./packages/plugin-search/src/exports/client.ts" - ], - "@payloadcms/plugin-form-builder/client": [ - "./packages/plugin-form-builder/src/exports/client.ts" - ], - "@payloadcms/next": [ - "./packages/next/src/exports/*" - ] - } + "baseUrl": ".", + }, - "exclude": [ - "dist", - "build", - "temp", - "node_modules" - ], - "composite": true, "references": [ { "path": "./packages/create-payload-app" @@ -171,11 +75,7 @@ } ], "include": [ - "app", - ".next/types/**/*.ts", - "scripts/**/*.ts", - "instrumentation.ts", - "sentry.server.config.ts", - "sentry.client.config.ts" + "${configDir}/src", + ".next/types/**/*.ts" ] }