Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/kind-hairs-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': major
---

Changes TypeScript configuration - ([v6 upgrade guidance](https://v6.docs.astro.build/en/guides/upgrade-to/v6/#changed-typescript-configuration))
2 changes: 1 addition & 1 deletion .github/scripts/bundle-size.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async function bundle(files) {
bundle: true,
minify: true,
sourcemap: false,
target: ['es2018'],
target: ['esnext'],
outdir: 'out',
external: ['astro:*', 'aria-query', 'axobject-query'],
metafile: true,
Expand Down
1 change: 1 addition & 0 deletions benchmark/packages/adapter/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions benchmark/packages/timer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/src/components/Nav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const isCurrentPage = (href: string) => {
};

// Toggle menu visibility when the menu button is clicked.
btn.addEventListener('click', () => setExpanded(menu.hidden));
btn.addEventListener('click', () => setExpanded(menu.hidden === true));

// Hide menu button for large screens.
const handleViewports = (e: MediaQueryList | MediaQueryListEvent) => {
Expand Down
4 changes: 2 additions & 2 deletions examples/toolbar-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
"outDir": "./dist",
"rootDir": "./src"
}
}
1 change: 1 addition & 0 deletions packages/astro-prism/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/astro-rss/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
3 changes: 1 addition & 2 deletions packages/astro/src/vite-plugin-config-alias/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ Consider the following example configuration:
```
{
"compilerOptions": {
"baseUrl": "src",
"paths": {
"components:*": ["components/*.astro"]
"components:*": ["src/components/*.astro"]
}
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/astro/test/fixtures/alias-tsconfig/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
// TODO: remove when upgrading to TS 6
"baseUrl": ".",
"paths": {
"@components/*": [
Expand Down
1 change: 0 additions & 1 deletion packages/astro/test/fixtures/core-image-base/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/assets/*": [
"src/assets/*"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/assets/*": ["src/assets/*"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"baseUrl": ".",
},
"include": [".astro/types.d.ts", "**/*"],
"exclude": ["dist"]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/assets/*": ["src/assets/*"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/assets/*": [
"src/assets/*"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"baseUrl": ".",
},
"include": [".astro/types.d.ts", "**/*"],
"exclude": ["dist"]
}
1 change: 0 additions & 1 deletion packages/astro/test/fixtures/core-image-ssg/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/assets/*": ["src/assets/*"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/assets/*": [
"src/assets/*"
Expand Down
1 change: 0 additions & 1 deletion packages/astro/test/fixtures/core-image-svg/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/assets/*": [
"src/assets/*"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/assets/*": ["src/assets/*"]
},
Expand Down
1 change: 0 additions & 1 deletion packages/astro/test/fixtures/core-image/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/assets/*": [
"src/assets/*"
Expand Down
1 change: 0 additions & 1 deletion packages/astro/test/fixtures/custom-renderer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@custom-renderer/*": ["src/custom-renderer/*"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "../../../tsconfigs/strictest.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
}
Expand Down
4 changes: 3 additions & 1 deletion packages/astro/tsconfigs/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
// Allow JavaScript files to be imported
"allowJs": true,
// Allow JSX files (or files that are internally considered JSX, like Astro files) to be imported inside `.js` and `.ts` files.
"jsx": "preserve"
"jsx": "preserve",
"types": ["node"],
"libReplacement": false
},
"exclude": ["${configDir}/dist"],
"include": ["${configDir}/.astro/types.d.ts", "${configDir}/**/*"]
Expand Down
1 change: 1 addition & 0 deletions packages/create-astro/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/db/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"include": ["src"],
"exclude": ["src/runtime/virtual.ts"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/db/tsconfig.virtual.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"extends": "../../tsconfig.base.json",
"files": ["./src/runtime/virtual.ts"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist/_internal"
}
}
1 change: 1 addition & 0 deletions packages/integrations/alpinejs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/integrations/cloudflare/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src", "virtual.d.ts", "types.d.ts"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/assets/*": ["src/assets/*"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/assets/*": ["src/assets/*"]
},
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/markdoc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { getEntry, render } from 'astro:content';
import MyImage from 'src/components/MyImage.astro';
import MyImage from '../components/MyImage.astro';

const entry = await getEntry('blog', 'entry');
const { Content } = await render(entry)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import MyImage from 'src/components/MyImage.astro';
import MyImage from '../components/MyImage.astro';
import MDX from '../components/Component.mdx';
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/assets/*": ["src/assets/*"]
},
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/mdx/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/integrations/netlify/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src", "virtual.d.ts"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/integrations/node/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src", "virtual.d.ts"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/integrations/partytown/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/integrations/preact/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/integrations/react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src", "env.d.ts"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/integrations/sitemap/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/integrations/solid/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/integrations/svelte/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"verbatimModuleSyntax": false
}
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/vercel/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src", "virtual.d.ts"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions packages/integrations/vue/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"include": ["src", "env.d.ts"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"verbatimModuleSyntax": false
}
Expand Down
1 change: 1 addition & 0 deletions packages/internal-helpers/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
}
}
4 changes: 2 additions & 2 deletions packages/language-tools/astro-check/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"rootDir": "./src",
"outDir": "./dist",
"emitDeclarationOnly": false,
"sourceMap": true,
"module": "ES2022",
Expand Down
Loading