Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(next): better tsconfig #11859

Merged
merged 12 commits into from
Sep 3, 2024
15 changes: 15 additions & 0 deletions .changeset/old-zebras-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'astro': major
---

Updates `astro sync` behavior
florian-lefebvre marked this conversation as resolved.
Show resolved Hide resolved

`astro sync` will no longer create nor update `src/env.dts`. You can keep using it but we recommend you update your root `tsconfig.json` instead:
florian-lefebvre marked this conversation as resolved.
Show resolved Hide resolved

```diff
{
"extends": "astro/tsconfigs/base",
+ "include": ["**/*", ".astro/types.d.ts"],
+ "exclude": ["dist"]
}
```
4 changes: 3 additions & 1 deletion examples/basics/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion examples/blog/src/env.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions examples/blog/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"],
"compilerOptions": {
"strictNullChecks": true
}
Expand Down
2 changes: 2 additions & 0 deletions examples/component/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"],
"compilerOptions": {
"jsx": "preserve"
}
Expand Down
4 changes: 3 additions & 1 deletion examples/container-with-vitest/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion examples/framework-alpine/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion examples/framework-alpine/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion examples/framework-multiple/src/env.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions examples/framework-multiple/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 0 additions & 1 deletion examples/framework-preact/src/env.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions examples/framework-preact/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"],
"compilerOptions": {
// Preact specific settings
"jsx": "react-jsx",
Expand Down
1 change: 0 additions & 1 deletion examples/framework-react/src/env.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions examples/framework-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"],
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react"
Expand Down
1 change: 0 additions & 1 deletion examples/framework-solid/src/env.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions examples/framework-solid/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"],
"compilerOptions": {
// Solid specific settings
"jsx": "preserve",
Expand Down
1 change: 0 additions & 1 deletion examples/framework-svelte/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion examples/framework-svelte/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion examples/framework-vue/src/env.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions examples/framework-vue/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 0 additions & 1 deletion examples/hackernews/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion examples/hackernews/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
4 changes: 3 additions & 1 deletion examples/integration/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion examples/middleware/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference path="../.astro/types.d.ts" />
declare namespace App {
interface Locals {
user: {
Expand Down
4 changes: 3 additions & 1 deletion examples/middleware/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion examples/minimal/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion examples/minimal/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion examples/non-html-pages/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion examples/non-html-pages/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion examples/portfolio/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion examples/portfolio/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion examples/ssr/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion examples/ssr/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
2 changes: 2 additions & 0 deletions examples/toolbar-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"],
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
Expand Down
2 changes: 2 additions & 0 deletions examples/view-transitions/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"],
"compilerOptions": {
"resolveJsonModule": true
}
Expand Down
1 change: 0 additions & 1 deletion examples/with-markdoc/src/env.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions examples/with-markdoc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"],
"compilerOptions": {
"strictNullChecks": true
}
Expand Down
1 change: 0 additions & 1 deletion examples/with-markdown-plugins/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion examples/with-markdown-plugins/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion examples/with-markdown-shiki/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion examples/with-markdown-shiki/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion examples/with-mdx/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion examples/with-mdx/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion examples/with-nanostores/src/env.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions examples/with-nanostores/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"],
"compilerOptions": {
// Preact specific settings
"jsx": "react-jsx",
Expand Down
1 change: 0 additions & 1 deletion examples/with-tailwindcss/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion examples/with-tailwindcss/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
4 changes: 3 additions & 1 deletion examples/with-vitest/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
4 changes: 3 additions & 1 deletion packages/astro/e2e/fixtures/actions-blog/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"strictNullChecks": true,
"jsx": "react-jsx",
"jsxImportSource": "react"
}
},
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
4 changes: 3 additions & 1 deletion packages/astro/e2e/fixtures/actions-react-19/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"strictNullChecks": true,
"jsx": "react-jsx",
"jsxImportSource": "react"
}
},
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
4 changes: 3 additions & 1 deletion packages/astro/e2e/fixtures/client-only/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"compilerOptions": {
"importsNotUsedAsValues": "error"
}
},
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
3 changes: 0 additions & 3 deletions packages/astro/performance/fixtures/md/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion packages/astro/performance/fixtures/md/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react"
}
},
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
2 changes: 0 additions & 2 deletions packages/astro/performance/fixtures/mdoc/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion packages/astro/performance/fixtures/mdoc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react"
}
},
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
2 changes: 0 additions & 2 deletions packages/astro/performance/fixtures/mdx/src/env.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion packages/astro/performance/fixtures/mdx/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react"
}
},
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
4 changes: 3 additions & 1 deletion packages/astro/performance/fixtures/utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react"
}
} ,
florian-lefebvre marked this conversation as resolved.
Show resolved Hide resolved
"include": ["**/*", ".astro/types.d.ts"],
"exclude": ["dist"]
}
2 changes: 0 additions & 2 deletions packages/astro/src/core/sync/constants.ts

This file was deleted.

Loading
Loading