summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Erika <3019731+Princesseuh@users.noreply.github.com> 2023-12-23 02:52:04 -0500
committerGravatar GitHub <noreply@github.com> 2023-12-23 02:52:04 -0500
commiteb36e95596fcdb3db4a31744e910495e22e3af84 (patch)
tree9f450c14ff307a5b31758883a99de7c8bbc899e1
parent4660aaa4051bd23fb77811968bbe56e2021161a2 (diff)
downloadastro-eb36e95596fcdb3db4a31744e910495e22e3af84.tar.gz
astro-eb36e95596fcdb3db4a31744e910495e22e3af84.tar.zst
astro-eb36e95596fcdb3db4a31744e910495e22e3af84.zip
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
-rw-r--r--.changeset/chilly-tips-breathe.md5
-rw-r--r--packages/astro/jsx-runtime.d.ts6
-rw-r--r--packages/astro/package.json8
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",