0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

feat: export JSX types from jsx-runtime (#9501)

* feat: export JSX types from jsx-runtime

* fix: i wont make the same mistakes three times

* chore: changeset
This commit is contained in:
Erika 2023-12-23 02:52:04 -05:00 committed by GitHub
parent 4660aaa405
commit eb36e95596
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Export JSX namespace from `astro/jsx-runtime` for language tooling to consume

6
packages/astro/jsx-runtime.d.ts vendored Normal file
View file

@ -0,0 +1,6 @@
// Q: Why this file?
// A: Our language tooling needs to access the JSX types from `astro/jsx-runtime`, due to TS limitations, however we
// can't import `astro-jsx` types inside the actual `jsx-runtime/index.js` file due to circular dependency issues.
import './astro-jsx.js';
export * from './dist/jsx-runtime/index.js';
export import JSX = astroHTML.JSX;

View file

@ -34,12 +34,14 @@
"./env": "./env.d.ts", "./env": "./env.d.ts",
"./types": "./types.d.ts", "./types": "./types.d.ts",
"./client": "./client.d.ts", "./client": "./client.d.ts",
"./import-meta": "./import-meta.d.ts",
"./astro-jsx": "./astro-jsx.d.ts", "./astro-jsx": "./astro-jsx.d.ts",
"./tsconfigs/*.json": "./tsconfigs/*", "./tsconfigs/*.json": "./tsconfigs/*",
"./tsconfigs/*": "./tsconfigs/*.json", "./tsconfigs/*": "./tsconfigs/*.json",
"./jsx/*": "./dist/jsx/*", "./jsx/*": "./dist/jsx/*",
"./jsx-runtime": "./dist/jsx-runtime/index.js", "./jsx-runtime": {
"types": "./jsx-runtime.d.ts",
"default": "./dist/jsx-runtime/index.js"
},
"./compiler-runtime": "./dist/runtime/compiler/index.js", "./compiler-runtime": "./dist/runtime/compiler/index.js",
"./runtime/*": "./dist/runtime/*", "./runtime/*": "./dist/runtime/*",
"./config": { "./config": {
@ -90,9 +92,9 @@
"zod.mjs", "zod.mjs",
"env.d.ts", "env.d.ts",
"client.d.ts", "client.d.ts",
"jsx-runtime.d.ts",
"content-types.template.d.ts", "content-types.template.d.ts",
"content-module.template.mjs", "content-module.template.mjs",
"import-meta.d.ts",
"astro-jsx.d.ts", "astro-jsx.d.ts",
"types.d.ts", "types.d.ts",
"README.md", "README.md",