From 38047119ff454e80cddd115bff53e33b32cd9930 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Tue, 3 Sep 2024 17:49:09 +0200 Subject: [PATCH] feat(next): better tsconfig (#11859) Co-authored-by: Sarah Rainsberger Co-authored-by: Bjorn Lu --- .changeset/old-zebras-teach.md | 19 +++++ examples/basics/tsconfig.json | 4 +- examples/blog/src/env.d.ts | 1 - examples/blog/tsconfig.json | 2 + examples/component/tsconfig.json | 2 + examples/container-with-vitest/tsconfig.json | 4 +- examples/framework-alpine/src/env.d.ts | 1 - examples/framework-alpine/tsconfig.json | 4 +- examples/framework-multiple/src/env.d.ts | 1 - examples/framework-multiple/tsconfig.json | 2 + examples/framework-preact/src/env.d.ts | 1 - examples/framework-preact/tsconfig.json | 2 + examples/framework-react/src/env.d.ts | 1 - examples/framework-react/tsconfig.json | 2 + examples/framework-solid/src/env.d.ts | 1 - examples/framework-solid/tsconfig.json | 2 + examples/framework-svelte/src/env.d.ts | 1 - examples/framework-svelte/tsconfig.json | 4 +- examples/framework-vue/src/env.d.ts | 1 - examples/framework-vue/tsconfig.json | 2 + examples/hackernews/src/env.d.ts | 1 - examples/hackernews/tsconfig.json | 4 +- examples/middleware/src/env.d.ts | 1 - examples/middleware/tsconfig.json | 4 +- examples/minimal/src/env.d.ts | 1 - examples/minimal/tsconfig.json | 4 +- examples/non-html-pages/src/env.d.ts | 1 - examples/non-html-pages/tsconfig.json | 4 +- examples/portfolio/src/env.d.ts | 1 - examples/portfolio/tsconfig.json | 4 +- examples/ssr/src/env.d.ts | 1 - examples/ssr/tsconfig.json | 4 +- examples/starlog/tsconfig.json | 1 + examples/view-transitions/tsconfig.json | 2 + examples/with-markdoc/src/env.d.ts | 1 - examples/with-markdoc/tsconfig.json | 2 + examples/with-markdown-plugins/src/env.d.ts | 1 - examples/with-markdown-plugins/tsconfig.json | 4 +- examples/with-markdown-shiki/src/env.d.ts | 1 - examples/with-markdown-shiki/tsconfig.json | 4 +- examples/with-mdx/src/env.d.ts | 1 - examples/with-mdx/tsconfig.json | 4 +- examples/with-nanostores/src/env.d.ts | 1 - examples/with-nanostores/tsconfig.json | 2 + examples/with-tailwindcss/src/env.d.ts | 1 - examples/with-tailwindcss/tsconfig.json | 4 +- examples/with-vitest/tsconfig.json | 4 +- .../e2e/fixtures/actions-blog/tsconfig.json | 4 +- .../fixtures/actions-react-19/tsconfig.json | 4 +- .../e2e/fixtures/client-only/tsconfig.json | 4 +- .../custom-client-directives/tsconfig.json | 3 +- .../performance/fixtures/md/src/env.d.ts | 3 - .../performance/fixtures/md/tsconfig.json | 4 +- .../performance/fixtures/mdoc/tsconfig.json | 4 +- .../performance/fixtures/mdx/tsconfig.json | 4 +- .../performance/fixtures/utils/tsconfig.json | 4 +- packages/astro/src/core/sync/constants.ts | 2 - packages/astro/src/core/sync/index.ts | 32 +++++++- packages/astro/src/core/sync/write-files.ts | 76 ------------------- packages/astro/test/astro-sync.test.js | 47 +++--------- .../alias-tsconfig-baseurl-only/tsconfig.json | 4 +- .../fixtures/alias-tsconfig/tsconfig.json | 4 +- .../tsconfig.json | 4 +- .../astro-env-required-public/tsconfig.json | 4 +- .../astro-env-server-fail/tsconfig.json | 4 +- .../astro-env-server-secret/tsconfig.json | 4 +- .../test/fixtures/astro-env/tsconfig.json | 4 +- .../fixtures/core-image-base/tsconfig.json | 4 +- .../core-image-deletion/tsconfig.json | 4 +- .../core-image-infersize/tsconfig.json | 4 +- .../core-image-remark-imgattr/tsconfig.json | 4 +- .../fixtures/core-image-ssg/tsconfig.json | 4 +- .../tsconfig.json | 4 +- .../test/fixtures/core-image/tsconfig.json | 4 +- .../fixtures/react-and-solid/tsconfig.json | 4 +- .../ssr-prerender-chunks/tsconfig.json | 4 +- .../fixtures/ticketing-example/tsconfig.json | 4 +- .../test/fixtures/image-assets/tsconfig.json | 4 +- .../render-with-components/tsconfig.json | 4 +- .../test/fixtures/mdx-images/tsconfig.json | 4 +- 80 files changed, 207 insertions(+), 184 deletions(-) create mode 100644 .changeset/old-zebras-teach.md delete mode 100644 examples/blog/src/env.d.ts delete mode 100644 examples/framework-alpine/src/env.d.ts delete mode 100644 examples/framework-multiple/src/env.d.ts delete mode 100644 examples/framework-preact/src/env.d.ts delete mode 100644 examples/framework-react/src/env.d.ts delete mode 100644 examples/framework-solid/src/env.d.ts delete mode 100644 examples/framework-svelte/src/env.d.ts delete mode 100644 examples/framework-vue/src/env.d.ts delete mode 100644 examples/hackernews/src/env.d.ts delete mode 100644 examples/minimal/src/env.d.ts delete mode 100644 examples/non-html-pages/src/env.d.ts delete mode 100644 examples/portfolio/src/env.d.ts delete mode 100644 examples/ssr/src/env.d.ts delete mode 100644 examples/with-markdoc/src/env.d.ts delete mode 100644 examples/with-markdown-plugins/src/env.d.ts delete mode 100644 examples/with-markdown-shiki/src/env.d.ts delete mode 100644 examples/with-mdx/src/env.d.ts delete mode 100644 examples/with-nanostores/src/env.d.ts delete mode 100644 examples/with-tailwindcss/src/env.d.ts delete mode 100644 packages/astro/performance/fixtures/md/src/env.d.ts delete mode 100644 packages/astro/src/core/sync/constants.ts delete mode 100644 packages/astro/src/core/sync/write-files.ts diff --git a/.changeset/old-zebras-teach.md b/.changeset/old-zebras-teach.md new file mode 100644 index 0000000000..1b22948949 --- /dev/null +++ b/.changeset/old-zebras-teach.md @@ -0,0 +1,19 @@ +--- +'astro': major +--- + +Changes the default `tsconfig.json` with better defaults, and makes `src/env.d.ts` optional + +Astro's default `tsconfig.json` in starter examples has been updated to include generated types and exclude your build output. This means that `src/env.d.ts` is only necessary if you have added custom type declarations or if you're not using a `tsconfig.json` file. + +Additionally, running `astro sync` no longer creates, nor updates, `src/env.d.ts` as it is not required for type-checking standard Astro projects. + +To update your project to Astro's recommended TypeScript settings, please add the following `include` and `exclude` properties to `tsconfig.json`: + +```diff +{ + "extends": "astro/tsconfigs/base", ++ "include": ["**/*", ".astro/types.d.ts"], ++ "exclude": ["dist"] +} +``` \ No newline at end of file diff --git a/examples/basics/tsconfig.json b/examples/basics/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/basics/tsconfig.json +++ b/examples/basics/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/blog/src/env.d.ts b/examples/blog/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/blog/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/blog/tsconfig.json b/examples/blog/tsconfig.json index e51e062706..c2e5e77cdc 100644 --- a/examples/blog/tsconfig.json +++ b/examples/blog/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"], "compilerOptions": { "strictNullChecks": true } diff --git a/examples/component/tsconfig.json b/examples/component/tsconfig.json index 26f2fc53dd..3e4a08650b 100644 --- a/examples/component/tsconfig.json +++ b/examples/component/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"], "compilerOptions": { "jsx": "preserve" } diff --git a/examples/container-with-vitest/tsconfig.json b/examples/container-with-vitest/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/container-with-vitest/tsconfig.json +++ b/examples/container-with-vitest/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/framework-alpine/src/env.d.ts b/examples/framework-alpine/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/framework-alpine/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/framework-alpine/tsconfig.json b/examples/framework-alpine/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/framework-alpine/tsconfig.json +++ b/examples/framework-alpine/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/framework-multiple/src/env.d.ts b/examples/framework-multiple/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/framework-multiple/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/framework-multiple/tsconfig.json b/examples/framework-multiple/tsconfig.json index 2d48ed5fd9..38d2e052b5 100644 --- a/examples/framework-multiple/tsconfig.json +++ b/examples/framework-multiple/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"], "compilerOptions": { // Needed for TypeScript intellisense in the template inside Vue files "jsx": "preserve" diff --git a/examples/framework-preact/src/env.d.ts b/examples/framework-preact/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/framework-preact/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/framework-preact/tsconfig.json b/examples/framework-preact/tsconfig.json index bdd1b5a88e..8faaad1f89 100644 --- a/examples/framework-preact/tsconfig.json +++ b/examples/framework-preact/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"], "compilerOptions": { // Preact specific settings "jsx": "react-jsx", diff --git a/examples/framework-react/src/env.d.ts b/examples/framework-react/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/framework-react/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/framework-react/tsconfig.json b/examples/framework-react/tsconfig.json index e726bd0b9a..1bb17eb064 100644 --- a/examples/framework-react/tsconfig.json +++ b/examples/framework-react/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"], "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "react" diff --git a/examples/framework-solid/src/env.d.ts b/examples/framework-solid/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/framework-solid/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/framework-solid/tsconfig.json b/examples/framework-solid/tsconfig.json index 6e107fd322..c1ca2dae5f 100644 --- a/examples/framework-solid/tsconfig.json +++ b/examples/framework-solid/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"], "compilerOptions": { // Solid specific settings "jsx": "preserve", diff --git a/examples/framework-svelte/src/env.d.ts b/examples/framework-svelte/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/framework-svelte/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/framework-svelte/tsconfig.json b/examples/framework-svelte/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/framework-svelte/tsconfig.json +++ b/examples/framework-svelte/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/framework-vue/src/env.d.ts b/examples/framework-vue/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/framework-vue/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/framework-vue/tsconfig.json b/examples/framework-vue/tsconfig.json index 2d48ed5fd9..38d2e052b5 100644 --- a/examples/framework-vue/tsconfig.json +++ b/examples/framework-vue/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"], "compilerOptions": { // Needed for TypeScript intellisense in the template inside Vue files "jsx": "preserve" diff --git a/examples/hackernews/src/env.d.ts b/examples/hackernews/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/hackernews/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/hackernews/tsconfig.json b/examples/hackernews/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/hackernews/tsconfig.json +++ b/examples/hackernews/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/middleware/src/env.d.ts b/examples/middleware/src/env.d.ts index 74b9019e57..e992c53151 100644 --- a/examples/middleware/src/env.d.ts +++ b/examples/middleware/src/env.d.ts @@ -1,4 +1,3 @@ -/// declare namespace App { interface Locals { user: { diff --git a/examples/middleware/tsconfig.json b/examples/middleware/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/middleware/tsconfig.json +++ b/examples/middleware/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/minimal/src/env.d.ts b/examples/minimal/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/minimal/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/minimal/tsconfig.json b/examples/minimal/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/minimal/tsconfig.json +++ b/examples/minimal/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/non-html-pages/src/env.d.ts b/examples/non-html-pages/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/non-html-pages/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/non-html-pages/tsconfig.json b/examples/non-html-pages/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/non-html-pages/tsconfig.json +++ b/examples/non-html-pages/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/portfolio/src/env.d.ts b/examples/portfolio/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/portfolio/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/portfolio/tsconfig.json b/examples/portfolio/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/portfolio/tsconfig.json +++ b/examples/portfolio/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/ssr/src/env.d.ts b/examples/ssr/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/ssr/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/ssr/tsconfig.json b/examples/ssr/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/ssr/tsconfig.json +++ b/examples/ssr/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/starlog/tsconfig.json b/examples/starlog/tsconfig.json index da42df94e0..08454317ed 100644 --- a/examples/starlog/tsconfig.json +++ b/examples/starlog/tsconfig.json @@ -1,4 +1,5 @@ { "extends": "astro/tsconfigs/strict", + "include": ["**/*", ".astro/types.d.ts"], "exclude": ["dist"] } diff --git a/examples/view-transitions/tsconfig.json b/examples/view-transitions/tsconfig.json index d9bbfacf87..60762da04d 100644 --- a/examples/view-transitions/tsconfig.json +++ b/examples/view-transitions/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"], "compilerOptions": { "resolveJsonModule": true } diff --git a/examples/with-markdoc/src/env.d.ts b/examples/with-markdoc/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/with-markdoc/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/with-markdoc/tsconfig.json b/examples/with-markdoc/tsconfig.json index e51e062706..c2e5e77cdc 100644 --- a/examples/with-markdoc/tsconfig.json +++ b/examples/with-markdoc/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"], "compilerOptions": { "strictNullChecks": true } diff --git a/examples/with-markdown-plugins/src/env.d.ts b/examples/with-markdown-plugins/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/with-markdown-plugins/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/with-markdown-plugins/tsconfig.json b/examples/with-markdown-plugins/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/with-markdown-plugins/tsconfig.json +++ b/examples/with-markdown-plugins/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/with-markdown-shiki/src/env.d.ts b/examples/with-markdown-shiki/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/with-markdown-shiki/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/with-markdown-shiki/tsconfig.json b/examples/with-markdown-shiki/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/with-markdown-shiki/tsconfig.json +++ b/examples/with-markdown-shiki/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/with-mdx/src/env.d.ts b/examples/with-mdx/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/with-mdx/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/with-mdx/tsconfig.json b/examples/with-mdx/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/with-mdx/tsconfig.json +++ b/examples/with-mdx/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/with-nanostores/src/env.d.ts b/examples/with-nanostores/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/with-nanostores/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/with-nanostores/tsconfig.json b/examples/with-nanostores/tsconfig.json index bdd1b5a88e..8faaad1f89 100644 --- a/examples/with-nanostores/tsconfig.json +++ b/examples/with-nanostores/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"], "compilerOptions": { // Preact specific settings "jsx": "react-jsx", diff --git a/examples/with-tailwindcss/src/env.d.ts b/examples/with-tailwindcss/src/env.d.ts deleted file mode 100644 index e16c13c695..0000000000 --- a/examples/with-tailwindcss/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/with-tailwindcss/tsconfig.json b/examples/with-tailwindcss/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/with-tailwindcss/tsconfig.json +++ b/examples/with-tailwindcss/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/examples/with-vitest/tsconfig.json b/examples/with-vitest/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/examples/with-vitest/tsconfig.json +++ b/examples/with-vitest/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/e2e/fixtures/actions-blog/tsconfig.json b/packages/astro/e2e/fixtures/actions-blog/tsconfig.json index 6bed1f7a51..0d8f554cc0 100644 --- a/packages/astro/e2e/fixtures/actions-blog/tsconfig.json +++ b/packages/astro/e2e/fixtures/actions-blog/tsconfig.json @@ -4,5 +4,7 @@ "strictNullChecks": true, "jsx": "react-jsx", "jsxImportSource": "react" - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } \ No newline at end of file diff --git a/packages/astro/e2e/fixtures/actions-react-19/tsconfig.json b/packages/astro/e2e/fixtures/actions-react-19/tsconfig.json index 6bed1f7a51..0d8f554cc0 100644 --- a/packages/astro/e2e/fixtures/actions-react-19/tsconfig.json +++ b/packages/astro/e2e/fixtures/actions-react-19/tsconfig.json @@ -4,5 +4,7 @@ "strictNullChecks": true, "jsx": "react-jsx", "jsxImportSource": "react" - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } \ No newline at end of file diff --git a/packages/astro/e2e/fixtures/client-only/tsconfig.json b/packages/astro/e2e/fixtures/client-only/tsconfig.json index 9e4ac60568..ea5145d309 100644 --- a/packages/astro/e2e/fixtures/client-only/tsconfig.json +++ b/packages/astro/e2e/fixtures/client-only/tsconfig.json @@ -1,5 +1,7 @@ { "compilerOptions": { "importsNotUsedAsValues": "error" - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } \ No newline at end of file diff --git a/packages/astro/e2e/fixtures/custom-client-directives/tsconfig.json b/packages/astro/e2e/fixtures/custom-client-directives/tsconfig.json index 59a562e0e5..97a67903ae 100644 --- a/packages/astro/e2e/fixtures/custom-client-directives/tsconfig.json +++ b/packages/astro/e2e/fixtures/custom-client-directives/tsconfig.json @@ -4,5 +4,6 @@ // This is only needed because we link Astro locally. "preserveSymlinks": true }, - "include": ["./src/**/*"] + "include": ["./src/**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } \ No newline at end of file diff --git a/packages/astro/performance/fixtures/md/src/env.d.ts b/packages/astro/performance/fixtures/md/src/env.d.ts deleted file mode 100644 index 4b38f4e5c6..0000000000 --- a/packages/astro/performance/fixtures/md/src/env.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -/// -/// \ No newline at end of file diff --git a/packages/astro/performance/fixtures/md/tsconfig.json b/packages/astro/performance/fixtures/md/tsconfig.json index 7fb90fafc0..98ab98bc4c 100644 --- a/packages/astro/performance/fixtures/md/tsconfig.json +++ b/packages/astro/performance/fixtures/md/tsconfig.json @@ -3,5 +3,7 @@ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "react" - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } \ No newline at end of file diff --git a/packages/astro/performance/fixtures/mdoc/tsconfig.json b/packages/astro/performance/fixtures/mdoc/tsconfig.json index 7fb90fafc0..98ab98bc4c 100644 --- a/packages/astro/performance/fixtures/mdoc/tsconfig.json +++ b/packages/astro/performance/fixtures/mdoc/tsconfig.json @@ -3,5 +3,7 @@ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "react" - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } \ No newline at end of file diff --git a/packages/astro/performance/fixtures/mdx/tsconfig.json b/packages/astro/performance/fixtures/mdx/tsconfig.json index 7fb90fafc0..98ab98bc4c 100644 --- a/packages/astro/performance/fixtures/mdx/tsconfig.json +++ b/packages/astro/performance/fixtures/mdx/tsconfig.json @@ -3,5 +3,7 @@ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "react" - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } \ No newline at end of file diff --git a/packages/astro/performance/fixtures/utils/tsconfig.json b/packages/astro/performance/fixtures/utils/tsconfig.json index 33fcab125a..5851e5189a 100644 --- a/packages/astro/performance/fixtures/utils/tsconfig.json +++ b/packages/astro/performance/fixtures/utils/tsconfig.json @@ -2,5 +2,7 @@ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "react" - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/src/core/sync/constants.ts b/packages/astro/src/core/sync/constants.ts deleted file mode 100644 index 7ff603105a..0000000000 --- a/packages/astro/src/core/sync/constants.ts +++ /dev/null @@ -1,2 +0,0 @@ -// TODO: use types.d.ts for backward compatibility. Use astro.d.ts in Astro 5.0 -export const REFERENCE_FILE = './types.d.ts'; diff --git a/packages/astro/src/core/sync/index.ts b/packages/astro/src/core/sync/index.ts index 88c37fa882..236ab63a0c 100644 --- a/packages/astro/src/core/sync/index.ts +++ b/packages/astro/src/core/sync/index.ts @@ -30,7 +30,8 @@ import { import type { Logger } from '../logger/core.js'; import { formatErrorMessage } from '../messages.js'; import { ensureProcessNodeEnv } from '../util.js'; -import { writeFiles } from './write-files.js'; +import { dirname, relative } from 'node:path'; +import { normalizePath } from 'vite'; export type SyncOptions = { /** @@ -135,7 +136,7 @@ export async function syncInternal({ } syncAstroEnv(settings); - await writeFiles(settings, fs, logger); + writeInjectedTypes(settings, fs); logger.info('types', `Generated ${dim(getTimeStat(timerStart, performance.now()))}`); } catch (err) { const error = createSafeError(err); @@ -148,6 +149,33 @@ export async function syncInternal({ } } +function getTsReference(type: 'path' | 'types', value: string) { + return `/// `; +} + +const CLIENT_TYPES_REFERENCE = getTsReference('types', 'astro/client'); + +function writeInjectedTypes(settings: AstroSettings, fs: typeof fsMod) { + const references: Array = []; + + for (const { filename, content } of settings.injectedTypes) { + const filepath = fileURLToPath(new URL(filename, settings.dotAstroDir)); + fs.mkdirSync(dirname(filepath), { recursive: true }); + fs.writeFileSync(filepath, content, 'utf-8'); + references.push(normalizePath(relative(fileURLToPath(settings.dotAstroDir), filepath))); + } + + const astroDtsContent = `${CLIENT_TYPES_REFERENCE}\n${references.map((reference) => getTsReference('path', reference)).join('\n')}`; + if (references.length === 0) { + fs.mkdirSync(settings.dotAstroDir, { recursive: true }); + } + fs.writeFileSync( + fileURLToPath(new URL('./types.d.ts', settings.dotAstroDir)), + astroDtsContent, + 'utf-8', + ); +} + /** * Generate content collection types, and then returns the process exit signal. * diff --git a/packages/astro/src/core/sync/write-files.ts b/packages/astro/src/core/sync/write-files.ts deleted file mode 100644 index 1f7d1d3046..0000000000 --- a/packages/astro/src/core/sync/write-files.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type fsMod from 'node:fs'; -import { dirname, relative } from 'node:path'; -import { fileURLToPath } from 'node:url'; -import { bold } from 'kleur/colors'; -import { normalizePath } from 'vite'; -import type { AstroSettings } from '../../types/astro.js'; -import { AstroError, AstroErrorData } from '../errors/index.js'; -import type { Logger } from '../logger/core.js'; -import { REFERENCE_FILE } from './constants.js'; - -export async function writeFiles(settings: AstroSettings, fs: typeof fsMod, logger: Logger) { - try { - writeInjectedTypes(settings, fs); - await setUpEnvTs(settings, fs, logger); - } catch (e) { - throw new AstroError(AstroErrorData.UnknownFilesystemError, { cause: e }); - } -} - -function getTsReference(type: 'path' | 'types', value: string) { - return `/// `; -} - -const CLIENT_TYPES_REFERENCE = getTsReference('types', 'astro/client'); - -function writeInjectedTypes(settings: AstroSettings, fs: typeof fsMod) { - const references: Array = []; - - for (const { filename, content } of settings.injectedTypes) { - const filepath = fileURLToPath(new URL(filename, settings.dotAstroDir)); - fs.mkdirSync(dirname(filepath), { recursive: true }); - fs.writeFileSync(filepath, content, 'utf-8'); - references.push(normalizePath(relative(fileURLToPath(settings.dotAstroDir), filepath))); - } - - const astroDtsContent = `${CLIENT_TYPES_REFERENCE}\n${references.map((reference) => getTsReference('path', reference)).join('\n')}`; - if (references.length === 0) { - fs.mkdirSync(settings.dotAstroDir, { recursive: true }); - } - fs.writeFileSync( - fileURLToPath(new URL(REFERENCE_FILE, settings.dotAstroDir)), - astroDtsContent, - 'utf-8', - ); -} - -async function setUpEnvTs(settings: AstroSettings, fs: typeof fsMod, logger: Logger) { - const envTsPath = fileURLToPath(new URL('env.d.ts', settings.config.srcDir)); - const envTsPathRelativetoRoot = relative(fileURLToPath(settings.config.root), envTsPath); - const relativePath = normalizePath( - relative( - fileURLToPath(settings.config.srcDir), - fileURLToPath(new URL(REFERENCE_FILE, settings.dotAstroDir)), - ), - ); - const expectedTypeReference = getTsReference('path', relativePath); - - if (fs.existsSync(envTsPath)) { - const initialEnvContents = await fs.promises.readFile(envTsPath, 'utf-8'); - let typesEnvContents = initialEnvContents; - - if (!typesEnvContents.includes(expectedTypeReference)) { - typesEnvContents = `${expectedTypeReference}\n${typesEnvContents}`; - } - - if (initialEnvContents !== typesEnvContents) { - logger.info('types', `Updated ${bold(envTsPathRelativetoRoot)} type declarations.`); - await fs.promises.writeFile(envTsPath, typesEnvContents, 'utf-8'); - } - } else { - // Otherwise, inject the `env.d.ts` file - await fs.promises.mkdir(settings.config.srcDir, { recursive: true }); - await fs.promises.writeFile(envTsPath, expectedTypeReference, 'utf-8'); - logger.info('types', `Added ${bold(envTsPathRelativetoRoot)} type declarations`); - } -} diff --git a/packages/astro/test/astro-sync.test.js b/packages/astro/test/astro-sync.test.js index ce13453222..f12fb5bc42 100644 --- a/packages/astro/test/astro-sync.test.js +++ b/packages/astro/test/astro-sync.test.js @@ -24,10 +24,6 @@ const createFixture = () => { return astroFixture.config; }, clean() { - const envPath = new URL('env.d.ts', astroFixture.config.srcDir); - if (fs.existsSync(envPath)) { - fs.unlinkSync(new URL('env.d.ts', astroFixture.config.srcDir)); - } fs.rmSync(new URL('./.astro/', astroFixture.config.root), { force: true, recursive: true }); }, async whenSyncing() { @@ -108,40 +104,15 @@ describe('astro sync', () => { fixture = createFixture(); }); - describe('References', () => { - it('Writes `src/env.d.ts` if none exists', async () => { - await fixture.load('./fixtures/astro-basic/'); - fixture.clean(); - await fixture.whenSyncing(); - fixture.thenFileShouldExist('src/env.d.ts'); - fixture.thenFileContentShouldInclude( - 'src/env.d.ts', - `/// `, - ); - }); - - it('Updates `src/env.d.ts` if one exists', async () => { - const config = await fixture.load('./fixtures/astro-basic/'); - fixture.clean(); - fs.writeFileSync(new URL('./env.d.ts', config.srcDir), '// whatever', 'utf-8'); - await fixture.whenSyncing(); - fixture.thenFileShouldExist('src/env.d.ts'); - fixture.thenFileContentShouldInclude( - 'src/env.d.ts', - `/// `, - ); - }); - - it('Writes `src/types.d.ts`', async () => { - await fixture.load('./fixtures/astro-basic/'); - fixture.clean(); - await fixture.whenSyncing(); - fixture.thenFileShouldExist('.astro/types.d.ts'); - fixture.thenFileContentShouldInclude( - '.astro/types.d.ts', - `/// `, - ); - }); + it('Writes `.astro/types.d.ts`', async () => { + await fixture.load('./fixtures/astro-basic/'); + fixture.clean(); + await fixture.whenSyncing(); + fixture.thenFileShouldExist('.astro/types.d.ts'); + fixture.thenFileContentShouldInclude( + '.astro/types.d.ts', + `/// `, + ); }); describe('Content collections', () => { diff --git a/packages/astro/test/fixtures/alias-tsconfig-baseurl-only/tsconfig.json b/packages/astro/test/fixtures/alias-tsconfig-baseurl-only/tsconfig.json index 738e8a4650..0c7d303e8e 100644 --- a/packages/astro/test/fixtures/alias-tsconfig-baseurl-only/tsconfig.json +++ b/packages/astro/test/fixtures/alias-tsconfig-baseurl-only/tsconfig.json @@ -1,5 +1,7 @@ { "compilerOptions": { "baseUrl": "./src" - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/alias-tsconfig/tsconfig.json b/packages/astro/test/fixtures/alias-tsconfig/tsconfig.json index 52553e7d30..1598f5fa31 100644 --- a/packages/astro/test/fixtures/alias-tsconfig/tsconfig.json +++ b/packages/astro/test/fixtures/alias-tsconfig/tsconfig.json @@ -13,5 +13,7 @@ "src/*" ] } - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/astro-env-content-collections/tsconfig.json b/packages/astro/test/fixtures/astro-env-content-collections/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/packages/astro/test/fixtures/astro-env-content-collections/tsconfig.json +++ b/packages/astro/test/fixtures/astro-env-content-collections/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/astro-env-required-public/tsconfig.json b/packages/astro/test/fixtures/astro-env-required-public/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/packages/astro/test/fixtures/astro-env-required-public/tsconfig.json +++ b/packages/astro/test/fixtures/astro-env-required-public/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/astro-env-server-fail/tsconfig.json b/packages/astro/test/fixtures/astro-env-server-fail/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/packages/astro/test/fixtures/astro-env-server-fail/tsconfig.json +++ b/packages/astro/test/fixtures/astro-env-server-fail/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/astro-env-server-secret/tsconfig.json b/packages/astro/test/fixtures/astro-env-server-secret/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/packages/astro/test/fixtures/astro-env-server-secret/tsconfig.json +++ b/packages/astro/test/fixtures/astro-env-server-secret/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/astro-env/tsconfig.json b/packages/astro/test/fixtures/astro-env/tsconfig.json index d78f81ec4e..d2e51fb463 100644 --- a/packages/astro/test/fixtures/astro-env/tsconfig.json +++ b/packages/astro/test/fixtures/astro-env/tsconfig.json @@ -1,3 +1,5 @@ { - "extends": "astro/tsconfigs/base" + "extends": "astro/tsconfigs/base", + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/core-image-base/tsconfig.json b/packages/astro/test/fixtures/core-image-base/tsconfig.json index 923ed4e24f..b47976e21c 100644 --- a/packages/astro/test/fixtures/core-image-base/tsconfig.json +++ b/packages/astro/test/fixtures/core-image-base/tsconfig.json @@ -7,5 +7,7 @@ "src/assets/*" ] }, - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/core-image-deletion/tsconfig.json b/packages/astro/test/fixtures/core-image-deletion/tsconfig.json index b5bf6a715e..074b459078 100644 --- a/packages/astro/test/fixtures/core-image-deletion/tsconfig.json +++ b/packages/astro/test/fixtures/core-image-deletion/tsconfig.json @@ -5,5 +5,7 @@ "paths": { "~/assets/*": ["src/assets/*"] }, - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/core-image-infersize/tsconfig.json b/packages/astro/test/fixtures/core-image-infersize/tsconfig.json index 72b184b171..1e6aa1b676 100644 --- a/packages/astro/test/fixtures/core-image-infersize/tsconfig.json +++ b/packages/astro/test/fixtures/core-image-infersize/tsconfig.json @@ -2,5 +2,7 @@ "extends": "astro/tsconfigs/base", "compilerOptions": { "baseUrl": ".", - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/core-image-remark-imgattr/tsconfig.json b/packages/astro/test/fixtures/core-image-remark-imgattr/tsconfig.json index 72b184b171..1e6aa1b676 100644 --- a/packages/astro/test/fixtures/core-image-remark-imgattr/tsconfig.json +++ b/packages/astro/test/fixtures/core-image-remark-imgattr/tsconfig.json @@ -2,5 +2,7 @@ "extends": "astro/tsconfigs/base", "compilerOptions": { "baseUrl": ".", - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/core-image-ssg/tsconfig.json b/packages/astro/test/fixtures/core-image-ssg/tsconfig.json index b5bf6a715e..074b459078 100644 --- a/packages/astro/test/fixtures/core-image-ssg/tsconfig.json +++ b/packages/astro/test/fixtures/core-image-ssg/tsconfig.json @@ -5,5 +5,7 @@ "paths": { "~/assets/*": ["src/assets/*"] }, - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/core-image-unconventional-settings/tsconfig.json b/packages/astro/test/fixtures/core-image-unconventional-settings/tsconfig.json index b5bf6a715e..074b459078 100644 --- a/packages/astro/test/fixtures/core-image-unconventional-settings/tsconfig.json +++ b/packages/astro/test/fixtures/core-image-unconventional-settings/tsconfig.json @@ -5,5 +5,7 @@ "paths": { "~/assets/*": ["src/assets/*"] }, - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/core-image/tsconfig.json b/packages/astro/test/fixtures/core-image/tsconfig.json index 923ed4e24f..b47976e21c 100644 --- a/packages/astro/test/fixtures/core-image/tsconfig.json +++ b/packages/astro/test/fixtures/core-image/tsconfig.json @@ -7,5 +7,7 @@ "src/assets/*" ] }, - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/react-and-solid/tsconfig.json b/packages/astro/test/fixtures/react-and-solid/tsconfig.json index 0b4b89bbce..d5f1fa6e4c 100644 --- a/packages/astro/test/fixtures/react-and-solid/tsconfig.json +++ b/packages/astro/test/fixtures/react-and-solid/tsconfig.json @@ -3,5 +3,7 @@ "strict": true, "jsxImportSource": "solid-js", "types": ["astro/client"] - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/astro/test/fixtures/ssr-prerender-chunks/tsconfig.json b/packages/astro/test/fixtures/ssr-prerender-chunks/tsconfig.json index 7fb90fafc0..98ab98bc4c 100644 --- a/packages/astro/test/fixtures/ssr-prerender-chunks/tsconfig.json +++ b/packages/astro/test/fixtures/ssr-prerender-chunks/tsconfig.json @@ -3,5 +3,7 @@ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "react" - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } \ No newline at end of file diff --git a/packages/db/test/fixtures/ticketing-example/tsconfig.json b/packages/db/test/fixtures/ticketing-example/tsconfig.json index b7243b92cc..9d7495d5ba 100644 --- a/packages/db/test/fixtures/ticketing-example/tsconfig.json +++ b/packages/db/test/fixtures/ticketing-example/tsconfig.json @@ -3,5 +3,7 @@ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "react" - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/integrations/markdoc/test/fixtures/image-assets/tsconfig.json b/packages/integrations/markdoc/test/fixtures/image-assets/tsconfig.json index b5bf6a715e..074b459078 100644 --- a/packages/integrations/markdoc/test/fixtures/image-assets/tsconfig.json +++ b/packages/integrations/markdoc/test/fixtures/image-assets/tsconfig.json @@ -5,5 +5,7 @@ "paths": { "~/assets/*": ["src/assets/*"] }, - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } diff --git a/packages/integrations/markdoc/test/fixtures/render-with-components/tsconfig.json b/packages/integrations/markdoc/test/fixtures/render-with-components/tsconfig.json index 99df2e61a1..7c03d38d1f 100644 --- a/packages/integrations/markdoc/test/fixtures/render-with-components/tsconfig.json +++ b/packages/integrations/markdoc/test/fixtures/render-with-components/tsconfig.json @@ -3,5 +3,7 @@ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] } \ No newline at end of file diff --git a/packages/integrations/mdx/test/fixtures/mdx-images/tsconfig.json b/packages/integrations/mdx/test/fixtures/mdx-images/tsconfig.json index b5bf6a715e..074b459078 100644 --- a/packages/integrations/mdx/test/fixtures/mdx-images/tsconfig.json +++ b/packages/integrations/mdx/test/fixtures/mdx-images/tsconfig.json @@ -5,5 +5,7 @@ "paths": { "~/assets/*": ["src/assets/*"] }, - } + }, + "include": ["**/*", ".astro/types.d.ts"], + "exclude": ["dist"] }