diff options
-rw-r--r-- | .changeset/chilly-tips-breathe.md | 5 | ||||
-rw-r--r-- | packages/astro/jsx-runtime.d.ts | 6 | ||||
-rw-r--r-- | packages/astro/package.json | 8 |
3 files changed, 16 insertions, 3 deletions
diff --git a/.changeset/chilly-tips-breathe.md b/.changeset/chilly-tips-breathe.md new file mode 100644 index 000000000..6e622f826 --- /dev/null +++ b/.changeset/chilly-tips-breathe.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Export JSX namespace from `astro/jsx-runtime` for language tooling to consume diff --git a/packages/astro/jsx-runtime.d.ts b/packages/astro/jsx-runtime.d.ts new file mode 100644 index 000000000..84afab482 --- /dev/null +++ b/packages/astro/jsx-runtime.d.ts @@ -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; diff --git a/packages/astro/package.json b/packages/astro/package.json index fd68d82ee..bc1426744 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -34,12 +34,14 @@ "./env": "./env.d.ts", "./types": "./types.d.ts", "./client": "./client.d.ts", - "./import-meta": "./import-meta.d.ts", "./astro-jsx": "./astro-jsx.d.ts", "./tsconfigs/*.json": "./tsconfigs/*", "./tsconfigs/*": "./tsconfigs/*.json", "./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", "./runtime/*": "./dist/runtime/*", "./config": { @@ -90,9 +92,9 @@ "zod.mjs", "env.d.ts", "client.d.ts", + "jsx-runtime.d.ts", "content-types.template.d.ts", "content-module.template.mjs", - "import-meta.d.ts", "astro-jsx.d.ts", "types.d.ts", "README.md", |