mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
feat(next): reference astro/client from astro/config (#11925)
This commit is contained in:
parent
518433e433
commit
74722cb81c
59 changed files with 64 additions and 57 deletions
|
@ -13,7 +13,7 @@ To update your project to Astro's recommended TypeScript settings, please add th
|
|||
```diff
|
||||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
+ "include": ["**/*", ".astro/types.d.ts"],
|
||||
+ "include": [".astro/types.d.ts", "**/*"],
|
||||
+ "exclude": ["dist"]
|
||||
}
|
||||
```
|
7
.changeset/violet-goats-grab.md
Normal file
7
.changeset/violet-goats-grab.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
'astro': minor
|
||||
---
|
||||
|
||||
Updates `astro/config` import to reference `astro/client` types
|
||||
|
||||
When importing `astro/config`, types from `astro/client` will be made automatically available to your project. If your project `tsconfig.json` changes how references behave, you'll still have access to these types after running `astro sync`.
|
1
examples/basics/src/env.d.ts
vendored
1
examples/basics/src/env.d.ts
vendored
|
@ -1 +0,0 @@
|
|||
/// <reference path="../.astro/types.d.ts" />
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
"strictNullChecks": true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
"jsx": "preserve"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
// Needed for TypeScript intellisense in the template inside Vue files
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
// Preact specific settings
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
// Solid specific settings
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
// Needed for TypeScript intellisense in the template inside Vue files
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/strict",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
"resolveJsonModule": true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
"strictNullChecks": true
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
// Preact specific settings
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@
|
|||
```diff
|
||||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
+ "include": ["**/*", ".astro/types.d.ts"],
|
||||
+ "include": [".astro/types.d.ts", "**/*"],
|
||||
+ "exclude": ["dist"]
|
||||
}
|
||||
```
|
||||
|
|
1
packages/astro/config.d.ts
vendored
1
packages/astro/config.d.ts
vendored
|
@ -1,3 +1,4 @@
|
|||
/// <reference path='./client.d.ts' />
|
||||
type ViteUserConfig = import('vite').UserConfig;
|
||||
type ViteUserConfigFn = import('vite').UserConfigFn;
|
||||
type AstroUserConfig = import('./dist/types/public/config.js').AstroUserConfig;
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react"
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
|
@ -5,6 +5,6 @@
|
|||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react"
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
|
@ -2,6 +2,6 @@
|
|||
"compilerOptions": {
|
||||
"importsNotUsedAsValues": "error"
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
|
@ -4,6 +4,6 @@
|
|||
// This is only needed because we link Astro locally.
|
||||
"preserveSymlinks": true
|
||||
},
|
||||
"include": ["./src/**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "./src/**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
|
@ -4,6 +4,6 @@
|
|||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react"
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
|
@ -4,6 +4,6 @@
|
|||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react"
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
|
@ -4,6 +4,6 @@
|
|||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react"
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
|
@ -3,6 +3,6 @@
|
|||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react"
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
"compilerOptions": {
|
||||
"baseUrl": "./src"
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -8,6 +8,6 @@
|
|||
]
|
||||
},
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
"~/assets/*": ["src/assets/*"]
|
||||
},
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
"~/assets/*": ["src/assets/*"]
|
||||
},
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
"~/assets/*": ["src/assets/*"]
|
||||
},
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -8,6 +8,6 @@
|
|||
]
|
||||
},
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"jsxImportSource": "solid-js",
|
||||
"types": ["astro/client"]
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react"
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
|
@ -4,6 +4,6 @@
|
|||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react"
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
"~/assets/*": ["src/assets/*"]
|
||||
},
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "preact"
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
|
@ -6,6 +6,6 @@
|
|||
"~/assets/*": ["src/assets/*"]
|
||||
},
|
||||
},
|
||||
"include": ["**/*", ".astro/types.d.ts"],
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue