summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com> 2023-11-29 10:50:18 -0800
committerGravatar GitHub <noreply@github.com> 2023-11-29 13:50:18 -0500
commitc495f1ac17285cfda78363b98cd2802b543f441e (patch)
tree9e720a45389b24172449eb818ebe6b0b01bd7315
parent3b77889b47750ed6e17c7858780dc4aae9201b58 (diff)
downloadastro-c495f1ac17285cfda78363b98cd2802b543f441e.tar.gz
astro-c495f1ac17285cfda78363b98cd2802b543f441e.tar.zst
astro-c495f1ac17285cfda78363b98cd2802b543f441e.zip
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
-rw-r--r--.changeset/pre.json10
-rw-r--r--examples/basics/package.json2
-rw-r--r--examples/blog/package.json2
-rw-r--r--examples/component/package.json2
-rw-r--r--examples/framework-alpine/package.json2
-rw-r--r--examples/framework-lit/package.json2
-rw-r--r--examples/framework-multiple/package.json2
-rw-r--r--examples/framework-preact/package.json2
-rw-r--r--examples/framework-react/package.json2
-rw-r--r--examples/framework-solid/package.json2
-rw-r--r--examples/framework-svelte/package.json2
-rw-r--r--examples/framework-vue/package.json2
-rw-r--r--examples/hackernews/package.json4
-rw-r--r--examples/integration/package.json2
-rw-r--r--examples/middleware/package.json4
-rw-r--r--examples/minimal/package.json2
-rw-r--r--examples/non-html-pages/package.json2
-rw-r--r--examples/portfolio/package.json2
-rw-r--r--examples/ssr/package.json4
-rw-r--r--examples/view-transitions/package.json4
-rw-r--r--examples/with-markdoc/package.json2
-rw-r--r--examples/with-markdown-plugins/package.json2
-rw-r--r--examples/with-markdown-shiki/package.json2
-rw-r--r--examples/with-mdx/package.json2
-rw-r--r--examples/with-nanostores/package.json2
-rw-r--r--examples/with-tailwindcss/package.json2
-rw-r--r--examples/with-vite-plugin-pwa/package.json2
-rw-r--r--examples/with-vitest/package.json2
-rw-r--r--packages/astro/CHANGELOG.md55
-rw-r--r--packages/astro/e2e/astro-envs.test.js2
-rw-r--r--packages/astro/package.json2
-rw-r--r--packages/astro/src/cli/index.ts2
-rw-r--r--packages/astro/src/cli/preferences/index.ts122
-rw-r--r--packages/astro/src/core/app/index.ts25
-rw-r--r--packages/astro/src/core/app/node.ts14
-rw-r--r--packages/astro/src/core/dev/restart.ts9
-rw-r--r--packages/astro/src/core/messages.ts33
-rw-r--r--packages/astro/src/preferences/defaults.ts2
-rw-r--r--packages/astro/src/preferences/index.ts39
-rw-r--r--packages/astro/src/preferences/store.ts5
-rw-r--r--packages/astro/src/runtime/client/dev-overlay/plugins/utils/highlight.ts4
-rw-r--r--packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts9
-rw-r--r--packages/astro/src/runtime/client/dev-overlay/ui-library/icon.ts4
-rw-r--r--packages/astro/src/vite-plugin-astro-server/request.ts7
-rw-r--r--packages/astro/src/vite-plugin-astro-server/route.ts5
-rw-r--r--packages/integrations/node/CHANGELOG.md6
-rw-r--r--packages/integrations/node/package.json2
-rw-r--r--packages/integrations/vercel/CHANGELOG.md6
-rw-r--r--packages/integrations/vercel/package.json2
-rw-r--r--pnpm-lock.yaml62
50 files changed, 341 insertions, 148 deletions
diff --git a/.changeset/pre.json b/.changeset/pre.json
index 08a455c2f..da91f9c8c 100644
--- a/.changeset/pre.json
+++ b/.changeset/pre.json
@@ -32,20 +32,30 @@
"changesets": [
"angry-swans-fry",
"beige-jokes-report",
+ "big-cooks-notice",
"brown-jars-lick",
"calm-baboons-watch",
"clever-beds-notice",
+ "famous-eels-trade",
+ "gentle-cobras-wash",
"giant-snails-perform",
+ "grumpy-seas-switch",
"khaki-fans-sell",
"light-ties-poke",
"modern-candles-sip",
+ "odd-rivers-happen",
"plenty-candles-help",
"rude-hairs-whisper",
+ "sharp-starfishes-compete",
"shiny-trees-sip",
"short-deers-whisper",
"slow-hornets-try",
"sour-games-burn",
+ "spicy-starfishes-shake",
"tasty-dryers-bathe",
+ "three-chairs-sip",
+ "tricky-dragons-explain",
+ "weak-wolves-bow",
"wicked-sloths-develop",
"wild-apricots-rescue"
]
diff --git a/examples/basics/package.json b/examples/basics/package.json
index 37e88b2ea..eb6a54f5d 100644
--- a/examples/basics/package.json
+++ b/examples/basics/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^4.0.0-beta.1"
+ "astro": "^4.0.0-beta.2"
}
}
diff --git a/examples/blog/package.json b/examples/blog/package.json
index de7cadfaf..e57609d87 100644
--- a/examples/blog/package.json
+++ b/examples/blog/package.json
@@ -14,6 +14,6 @@
"@astrojs/mdx": "^2.0.0-beta.0",
"@astrojs/rss": "^4.0.0-beta.0",
"@astrojs/sitemap": "^3.0.3",
- "astro": "^4.0.0-beta.1"
+ "astro": "^4.0.0-beta.2"
}
}
diff --git a/examples/component/package.json b/examples/component/package.json
index 2a0a0f28d..a69680c6e 100644
--- a/examples/component/package.json
+++ b/examples/component/package.json
@@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
- "astro": "^4.0.0-beta.1"
+ "astro": "^4.0.0-beta.2"
},
"peerDependencies": {
"astro": "^3.0.0"
diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json
index fb949bba7..6604e5712 100644
--- a/examples/framework-alpine/package.json
+++ b/examples/framework-alpine/package.json
@@ -14,6 +14,6 @@
"@astrojs/alpinejs": "^0.3.1",
"@types/alpinejs": "^3.13.5",
"alpinejs": "^3.13.3",
- "astro": "^4.0.0-beta.1"
+ "astro": "^4.0.0-beta.2"
}
}
diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json
index 1b40e8734..3ca13d28d 100644
--- a/examples/framework-lit/package.json
+++ b/examples/framework-lit/package.json
@@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/lit": "^3.0.3",
"@webcomponents/template-shadowroot": "^0.2.1",
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"lit": "^2.8.0"
}
}
diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json
index 0e26aeec0..b8b21e168 100644
--- a/examples/framework-multiple/package.json
+++ b/examples/framework-multiple/package.json
@@ -16,7 +16,7 @@
"@astrojs/solid-js": "^3.0.2",
"@astrojs/svelte": "^5.0.0-beta.0",
"@astrojs/vue": "^4.0.0-beta.0",
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"preact": "^10.19.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json
index ce44cfaad..e7f873c60 100644
--- a/examples/framework-preact/package.json
+++ b/examples/framework-preact/package.json
@@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.0.1",
"@preact/signals": "^1.2.1",
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"preact": "^10.19.2"
}
}
diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json
index 7f5102910..e04ed362c 100644
--- a/examples/framework-react/package.json
+++ b/examples/framework-react/package.json
@@ -14,7 +14,7 @@
"@astrojs/react": "^3.0.7-beta.0",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json
index ea5bd5f11..3d4931c52 100644
--- a/examples/framework-solid/package.json
+++ b/examples/framework-solid/package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^3.0.2",
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"solid-js": "^1.8.5"
}
}
diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json
index 68e6d2078..7d2d1611f 100644
--- a/examples/framework-svelte/package.json
+++ b/examples/framework-svelte/package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/svelte": "^5.0.0-beta.0",
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"svelte": "^4.2.5"
}
}
diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json
index d279a3644..541ce1203 100644
--- a/examples/framework-vue/package.json
+++ b/examples/framework-vue/package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/vue": "^4.0.0-beta.0",
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"vue": "^3.3.8"
}
}
diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json
index 5c1ad557f..967471ad4 100644
--- a/examples/hackernews/package.json
+++ b/examples/hackernews/package.json
@@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
- "@astrojs/node": "^7.0.0-beta.0",
- "astro": "^4.0.0-beta.1"
+ "@astrojs/node": "^7.0.0-beta.1",
+ "astro": "^4.0.0-beta.2"
}
}
diff --git a/examples/integration/package.json b/examples/integration/package.json
index c9034bcae..de9311748 100644
--- a/examples/integration/package.json
+++ b/examples/integration/package.json
@@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
- "astro": "^4.0.0-beta.1"
+ "astro": "^4.0.0-beta.2"
},
"peerDependencies": {
"astro": "^3.0.0"
diff --git a/examples/middleware/package.json b/examples/middleware/package.json
index a0dafd569..6edecf1a4 100644
--- a/examples/middleware/package.json
+++ b/examples/middleware/package.json
@@ -12,8 +12,8 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
- "@astrojs/node": "^7.0.0-beta.0",
- "astro": "^4.0.0-beta.1",
+ "@astrojs/node": "^7.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"html-minifier": "^4.0.0"
}
}
diff --git a/examples/minimal/package.json b/examples/minimal/package.json
index 2b02ba774..932767551 100644
--- a/examples/minimal/package.json
+++ b/examples/minimal/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^4.0.0-beta.1"
+ "astro": "^4.0.0-beta.2"
}
}
diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json
index b6d645bbe..b9250d1dc 100644
--- a/examples/non-html-pages/package.json
+++ b/examples/non-html-pages/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^4.0.0-beta.1"
+ "astro": "^4.0.0-beta.2"
}
}
diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json
index 2030139bb..a3413392b 100644
--- a/examples/portfolio/package.json
+++ b/examples/portfolio/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^4.0.0-beta.1"
+ "astro": "^4.0.0-beta.2"
}
}
diff --git a/examples/ssr/package.json b/examples/ssr/package.json
index bccc89562..999956e21 100644
--- a/examples/ssr/package.json
+++ b/examples/ssr/package.json
@@ -12,9 +12,9 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
- "@astrojs/node": "^7.0.0-beta.0",
+ "@astrojs/node": "^7.0.0-beta.1",
"@astrojs/svelte": "^5.0.0-beta.0",
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"svelte": "^4.2.5"
}
}
diff --git a/examples/view-transitions/package.json b/examples/view-transitions/package.json
index 2be6d3945..2fc5d3d54 100644
--- a/examples/view-transitions/package.json
+++ b/examples/view-transitions/package.json
@@ -11,7 +11,7 @@
},
"devDependencies": {
"@astrojs/tailwind": "^6.0.0-beta.0",
- "@astrojs/node": "^7.0.0-beta.0",
- "astro": "^4.0.0-beta.1"
+ "@astrojs/node": "^7.0.0-beta.1",
+ "astro": "^4.0.0-beta.2"
}
}
diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json
index b1e18647a..f736a1cb3 100644
--- a/examples/with-markdoc/package.json
+++ b/examples/with-markdoc/package.json
@@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^1.0.0-beta.0",
- "astro": "^4.0.0-beta.1"
+ "astro": "^4.0.0-beta.2"
}
}
diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json
index efb99a814..4e928c546 100644
--- a/examples/with-markdown-plugins/package.json
+++ b/examples/with-markdown-plugins/package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/markdown-remark": "^4.0.0-beta.0",
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"hast-util-select": "^6.0.2",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json
index ae0983a0e..32675804a 100644
--- a/examples/with-markdown-shiki/package.json
+++ b/examples/with-markdown-shiki/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^4.0.0-beta.1"
+ "astro": "^4.0.0-beta.2"
}
}
diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json
index 882caf042..76ec4932e 100644
--- a/examples/with-mdx/package.json
+++ b/examples/with-mdx/package.json
@@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/mdx": "^2.0.0-beta.0",
"@astrojs/preact": "^3.0.1",
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"preact": "^10.19.2"
}
}
diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json
index 43a406b4d..3ada3b75c 100644
--- a/examples/with-nanostores/package.json
+++ b/examples/with-nanostores/package.json
@@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.0.1",
"@nanostores/preact": "^0.5.0",
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"nanostores": "^0.9.5",
"preact": "^10.19.2"
}
diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json
index 8a7652b8d..f03a1ac11 100644
--- a/examples/with-tailwindcss/package.json
+++ b/examples/with-tailwindcss/package.json
@@ -14,7 +14,7 @@
"@astrojs/mdx": "^2.0.0-beta.0",
"@astrojs/tailwind": "^6.0.0-beta.0",
"@types/canvas-confetti": "^1.6.3",
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"autoprefixer": "^10.4.15",
"canvas-confetti": "^1.9.1",
"postcss": "^8.4.28",
diff --git a/examples/with-vite-plugin-pwa/package.json b/examples/with-vite-plugin-pwa/package.json
index 939357b79..454b8d8ff 100644
--- a/examples/with-vite-plugin-pwa/package.json
+++ b/examples/with-vite-plugin-pwa/package.json
@@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"vite-plugin-pwa": "0.17.0",
"workbox-window": "^7.0.0"
}
diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json
index 950f19282..41161087b 100644
--- a/examples/with-vitest/package.json
+++ b/examples/with-vitest/package.json
@@ -12,7 +12,7 @@
"test": "vitest"
},
"dependencies": {
- "astro": "^4.0.0-beta.1",
+ "astro": "^4.0.0-beta.2",
"vitest": "^0.34.2"
}
}
diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md
index d698935e2..f5e1280f8 100644
--- a/packages/astro/CHANGELOG.md
+++ b/packages/astro/CHANGELOG.md
@@ -1,5 +1,60 @@
# astro
+## 4.0.0-beta.2
+
+### Major Changes
+
+- [#9225](https://github.com/withastro/astro/pull/9225) [`c421a3d17`](https://github.com/withastro/astro/commit/c421a3d17911aeda29b5204f6d568ae87e329eaf) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Removes the opt-in `handleForms` property for `<ViewTransitions />`. Form submissions are now handled by default and can be disabled by setting `data-astro-reload` on relevant `<form />` elements.
+
+- [#9199](https://github.com/withastro/astro/pull/9199) [`49aa215a0`](https://github.com/withastro/astro/commit/49aa215a01ee1c4805316c85bb0aea6cfbc25a31) Thanks [@lilnasy](https://github.com/lilnasy)! - This change only affects maintainers of third-party adapters. In the Integration API, the `app.render()` method of the `App` class has been simplified.
+
+ Instead of two optional arguments, it now takes a single optional argument that is an object with two optional properties: `routeData` and `locals`.
+
+ ```diff
+ app.render(request)
+
+ - app.render(request, routeData)
+ + app.render(request, { routeData })
+
+ - app.render(request, routeData, locals)
+ + app.render(request, { routeData, locals })
+
+ - app.render(request, undefined, locals)
+ + app.render(request, { locals })
+ ```
+
+ The current signature is deprecated but will continue to function until next major version.
+
+- [#9212](https://github.com/withastro/astro/pull/9212) [`c0383ea0c`](https://github.com/withastro/astro/commit/c0383ea0c102cb62b7235823c706a090ba08715f) Thanks [@alexanderniebuhr](https://github.com/alexanderniebuhr)! - Removes deprecated `app.match()` option, `matchNotFound`
+
+### Minor Changes
+
+- [#9115](https://github.com/withastro/astro/pull/9115) [`3b77889b4`](https://github.com/withastro/astro/commit/3b77889b47750ed6e17c7858780dc4aae9201b58) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Adds the `astro preferences` command to manage user preferences. User preferences are specific to individual Astro users, unlike the `astro.config.mjs` file which changes behavior for everyone working on a project.
+
+ User preferences are scoped to the current project by default, stored in a local `.astro/settings.json` file. Using the `--global` flag, user preferences can also be applied to every Astro project on the current machine. Global user preferences are stored in an operating system-specific location.
+
+ ```sh
+ # Disable the dev overlay for the current user in the current project
+ npm run astro preferences disable devOverlay
+ # Disable the dev overlay for the current user in all Astro projects on this machine
+ npm run astro preferences --global disable devOverlay
+
+ # Check if the dev overlay is enabled for the current user
+ npm run astro preferences list devOverlay
+ ```
+
+- [#9129](https://github.com/withastro/astro/pull/9129) [`8bfc20511`](https://github.com/withastro/astro/commit/8bfc20511918d675202cdc100d4efab293e5cbac) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Update error log formatting
+
+### Patch Changes
+
+- [#9222](https://github.com/withastro/astro/pull/9222) [`279e3c1b3`](https://github.com/withastro/astro/commit/279e3c1b3d06e7b48f01c0ef8285c3719ac74ace) Thanks [@matthewp](https://github.com/matthewp)! - Ensure the dev-overlay-window is anchored to the bottom
+
+- [#9218](https://github.com/withastro/astro/pull/9218) [`f4401c8c1`](https://github.com/withastro/astro/commit/f4401c8c1fa203431b4e7b2e89381a91b4ef1ac6) Thanks [@matthewp](https://github.com/matthewp)! - Improve high contrast mode with the Dev Overlay
+
+- [#9227](https://github.com/withastro/astro/pull/9227) [`4b8a42406`](https://github.com/withastro/astro/commit/4b8a42406bbdcc68604ea4ecc2a926721fbc4d52) Thanks [@matthewp](https://github.com/matthewp)! - Ensure overlay x-ray z-index is higher than the island
+
+- [#9214](https://github.com/withastro/astro/pull/9214) [`4fe523b00`](https://github.com/withastro/astro/commit/4fe523b0064b323ee46b2574339d96ea8bdb7b2d) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fixes a number of small user experience bugs with the dev overlay
+
## 4.0.0-beta.1
### Patch Changes
diff --git a/packages/astro/e2e/astro-envs.test.js b/packages/astro/e2e/astro-envs.test.js
index 2ebff460a..6cffc2d82 100644
--- a/packages/astro/e2e/astro-envs.test.js
+++ b/packages/astro/e2e/astro-envs.test.js
@@ -5,7 +5,7 @@ const test = testFactory({
root: './fixtures/astro-envs/',
devOverlay: {
enabled: false,
- }
+ },
});
let devServer;
diff --git a/packages/astro/package.json b/packages/astro/package.json
index ee0ac59ba..b0f95ac83 100644
--- a/packages/astro/package.json
+++ b/packages/astro/package.json
@@ -1,6 +1,6 @@
{
"name": "astro",
- "version": "4.0.0-beta.1",
+ "version": "4.0.0-beta.2",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
diff --git a/packages/astro/src/cli/index.ts b/packages/astro/src/cli/index.ts
index 83dd960c6..7ca4d21a9 100644
--- a/packages/astro/src/cli/index.ts
+++ b/packages/astro/src/cli/index.ts
@@ -119,7 +119,7 @@ async function runCommand(cmd: string, flags: yargs.Arguments) {
}
case 'preferences': {
const { preferences } = await import('./preferences/index.js');
- const [subcommand, key, value] = flags._.slice(3).map(v => v.toString());
+ const [subcommand, key, value] = flags._.slice(3).map((v) => v.toString());
const exitCode = await preferences(subcommand, key, value, { flags });
return process.exit(exitCode);
}
diff --git a/packages/astro/src/cli/preferences/index.ts b/packages/astro/src/cli/preferences/index.ts
index 2a01bbae2..48d6a298d 100644
--- a/packages/astro/src/cli/preferences/index.ts
+++ b/packages/astro/src/cli/preferences/index.ts
@@ -21,14 +21,27 @@ interface PreferencesOptions {
flags: yargs.Arguments;
}
-const PREFERENCES_SUBCOMMANDS = ['get', 'set', 'enable', 'disable', 'delete', 'reset', 'list'] as const;
-export type Subcommand = typeof PREFERENCES_SUBCOMMANDS[number];
+const PREFERENCES_SUBCOMMANDS = [
+ 'get',
+ 'set',
+ 'enable',
+ 'disable',
+ 'delete',
+ 'reset',
+ 'list',
+] as const;
+export type Subcommand = (typeof PREFERENCES_SUBCOMMANDS)[number];
function isValidSubcommand(subcommand: string): subcommand is Subcommand {
return PREFERENCES_SUBCOMMANDS.includes(subcommand as Subcommand);
}
-export async function preferences(subcommand: string, key: string, value: string | undefined, { flags }: PreferencesOptions): Promise<number> {
+export async function preferences(
+ subcommand: string,
+ key: string,
+ value: string | undefined,
+ { flags }: PreferencesOptions
+): Promise<number> {
if (!isValidSubcommand(subcommand) || flags?.help || flags?.h) {
msg.printHelp({
commandName: 'astro preferences',
@@ -44,7 +57,10 @@ export async function preferences(subcommand: string, key: string, value: string
['disable [key]', 'Set a boolean preference to false'],
],
Flags: [
- ['--global', 'Scope command to global preferences (all Astro projects) rather than the current project'],
+ [
+ '--global',
+ 'Scope command to global preferences (all Astro projects) rather than the current project',
+ ],
],
},
});
@@ -57,8 +73,8 @@ export async function preferences(subcommand: string, key: string, value: string
const settings = await createSettings(astroConfig, fileURLToPath(astroConfig.root));
const opts: SubcommandOptions = {
location: flags.global ? 'global' : undefined,
- json: flags.json
- }
+ json: flags.json,
+ };
if (subcommand === 'list') {
return listPreferences(settings, opts);
@@ -75,17 +91,27 @@ export async function preferences(subcommand: string, key: string, value: string
if (subcommand === 'set' && value === undefined) {
const type = typeof dlv(DEFAULT_PREFERENCES, key);
- console.error(msg.formatErrorMessage(collectErrorMetadata(new Error(`Please provide a ${type} value for "${key}"`)), true));
+ console.error(
+ msg.formatErrorMessage(
+ collectErrorMetadata(new Error(`Please provide a ${type} value for "${key}"`)),
+ true
+ )
+ );
return 1;
}
switch (subcommand) {
- case 'get': return getPreference(settings, key, opts);
- case 'set': return setPreference(settings, key, value, opts);
+ case 'get':
+ return getPreference(settings, key, opts);
+ case 'set':
+ return setPreference(settings, key, value, opts);
case 'reset':
- case 'delete': return resetPreference(settings, key, opts);
- case 'enable': return enablePreference(settings, key, opts);
- case 'disable': return disablePreference(settings, key, opts);
+ case 'delete':
+ return resetPreference(settings, key, opts);
+ case 'enable':
+ return enablePreference(settings, key, opts);
+ case 'disable':
+ return disablePreference(settings, key, opts);
}
}
@@ -95,7 +121,11 @@ interface SubcommandOptions {
}
// Default `location` to "project" to avoid reading default preferencesa
-async function getPreference(settings: AstroSettings, key: PreferenceKey, { location = 'project' }: SubcommandOptions) {
+async function getPreference(
+ settings: AstroSettings,
+ key: PreferenceKey,
+ { location = 'project' }: SubcommandOptions
+) {
try {
let value = await settings.preferences.get(key, { location });
if (value && typeof value === 'object' && !Array.isArray(value)) {
@@ -117,15 +147,20 @@ async function getPreference(settings: AstroSettings, key: PreferenceKey, { loca
return 1;
}
-async function setPreference(settings: AstroSettings, key: PreferenceKey, value: unknown, { location }: SubcommandOptions) {
+async function setPreference(
+ settings: AstroSettings,
+ key: PreferenceKey,
+ value: unknown,
+ { location }: SubcommandOptions
+) {
try {
const defaultType = typeof dlv(DEFAULT_PREFERENCES, key);
if (typeof coerce(key, value) !== defaultType) {
- throw new Error(`${key} expects a "${defaultType}" value!`)
+ throw new Error(`${key} expects a "${defaultType}" value!`);
}
await settings.preferences.set(key, coerce(key, value), { location });
- console.log(msg.preferenceSet(key, value))
+ console.log(msg.preferenceSet(key, value));
return 0;
} catch (e) {
if (e instanceof Error) {
@@ -136,34 +171,45 @@ async function setPreference(settings: AstroSettings, key: PreferenceKey, value:
}
}
-async function enablePreference(settings: AstroSettings, key: PreferenceKey, { location }: SubcommandOptions) {
+async function enablePreference(
+ settings: AstroSettings,
+ key: PreferenceKey,
+ { location }: SubcommandOptions
+) {
try {
await settings.preferences.set(key, true, { location });
- console.log(msg.preferenceEnabled(key.replace('.enabled', '')))
+ console.log(msg.preferenceEnabled(key.replace('.enabled', '')));
return 0;
} catch {}
return 1;
}
-async function disablePreference(settings: AstroSettings, key: PreferenceKey, { location }: SubcommandOptions) {
+async function disablePreference(
+ settings: AstroSettings,
+ key: PreferenceKey,
+ { location }: SubcommandOptions
+) {
try {
await settings.preferences.set(key, false, { location });
- console.log(msg.preferenceDisabled(key.replace('.enabled', '')))
+ console.log(msg.preferenceDisabled(key.replace('.enabled', '')));
return 0;
} catch {}
return 1;
}
-async function resetPreference(settings: AstroSettings, key: PreferenceKey, { location }: SubcommandOptions) {
+async function resetPreference(
+ settings: AstroSettings,
+ key: PreferenceKey,
+ { location }: SubcommandOptions
+) {
try {
await settings.preferences.set(key, undefined as any, { location });
- console.log(msg.preferenceReset(key))
+ console.log(msg.preferenceReset(key));
return 0;
} catch {}
return 1;
}
-
async function listPreferences(settings: AstroSettings, { location, json }: SubcommandOptions) {
const store = await settings.preferences.getAll({ location });
if (json) {
@@ -195,18 +241,34 @@ const chars = {
topRight: '╮',
bottomLeft: '╰',
bottomRight: '╯',
-}
+};
-function formatTable(object: Record<string, string | number | boolean>, columnLabels: [string, string]) {
+function formatTable(
+ object: Record<string, string | number | boolean>,
+ columnLabels: [string, string]
+) {
const [colA, colB] = columnLabels;
const colALength = [colA, ...Object.keys(object)].reduce(longest, 0) + 3;
const colBLength = [colB, ...Object.values(object)].reduce(longest, 0) + 3;
- function formatRow(i: number, a: string, b: string | number | boolean, style: (value: string | number | boolean) => string = (v) => v.toString()): string {
- return `${chars.v} ${style(a)} ${space(colALength - a.length - 2)} ${chars.v} ${style(b)} ${space(colBLength - b.toString().length - 3)} ${chars.v}`
+ function formatRow(
+ i: number,
+ a: string,
+ b: string | number | boolean,
+ style: (value: string | number | boolean) => string = (v) => v.toString()
+ ): string {
+ return `${chars.v} ${style(a)} ${space(colALength - a.length - 2)} ${chars.v} ${style(
+ b
+ )} ${space(colBLength - b.toString().length - 3)} ${chars.v}`;
}
- const top = `${chars.topLeft}${chars.h.repeat(colALength + 1)}${chars.hBottom}${chars.h.repeat(colBLength)}${chars.topRight}`
- const bottom = `${chars.bottomLeft}${chars.h.repeat(colALength + 1)}${chars.hTop}${chars.h.repeat(colBLength)}${chars.bottomRight}`
- const divider = `${chars.vRightThick}${chars.hThick.repeat(colALength + 1)}${chars.hThickCross}${chars.hThick.repeat(colBLength)}${chars.vLeftThick}`
+ const top = `${chars.topLeft}${chars.h.repeat(colALength + 1)}${chars.hBottom}${chars.h.repeat(
+ colBLength
+ )}${chars.topRight}`;
+ const bottom = `${chars.bottomLeft}${chars.h.repeat(colALength + 1)}${chars.hTop}${chars.h.repeat(
+ colBLength
+ )}${chars.bottomRight}`;
+ const divider = `${chars.vRightThick}${chars.hThick.repeat(colALength + 1)}${
+ chars.hThickCross
+ }${chars.hThick.repeat(colBLength)}${chars.vLeftThick}`;
const rows: string[] = [top, formatRow(-1, colA, colB, bold), divider];
let i = 0;
for (const [key, value] of Object.entries(object)) {
diff --git a/packages/astro/src/core/app/index.ts b/packages/astro/src/core/app/index.ts
index ee50fc343..f3fa3fa7b 100644
--- a/packages/astro/src/core/app/index.ts
+++ b/packages/astro/src/core/app/index.ts
@@ -147,25 +147,31 @@ export class App {
return routeData;
}
- async render(request: Request, options?: RenderOptions): Promise<Response>
+ async render(request: Request, options?: RenderOptions): Promise<Response>;
/**
* @deprecated Instead of passing `RouteData` and locals individually, pass an object with `routeData` and `locals` properties.
* See https://github.com/withastro/astro/pull/9199 for more information.
*/
- async render(request: Request, routeData?: RouteData, locals?: object): Promise<Response>
- async render(request: Request, routeDataOrOptions?: RouteData | RenderOptions, maybeLocals?: object): Promise<Response> {
+ async render(request: Request, routeData?: RouteData, locals?: object): Promise<Response>;
+ async render(
+ request: Request,
+ routeDataOrOptions?: RouteData | RenderOptions,
+ maybeLocals?: object
+ ): Promise<Response> {
let routeData: RouteData | undefined;
let locals: object | undefined;
-
- if (routeDataOrOptions && ('routeData' in routeDataOrOptions || 'locals' in routeDataOrOptions)) {
+
+ if (
+ routeDataOrOptions &&
+ ('routeData' in routeDataOrOptions || 'locals' in routeDataOrOptions)
+ ) {
if ('routeData' in routeDataOrOptions) {
routeData = routeDataOrOptions.routeData;
}
if ('locals' in routeDataOrOptions) {
locals = routeDataOrOptions.locals;
}
- }
- else {
+ } else {
routeData = routeDataOrOptions as RouteData | undefined;
locals = maybeLocals;
if (routeDataOrOptions || locals) {
@@ -242,7 +248,10 @@ export class App {
#logRenderOptionsDeprecationWarning() {
if (this.#renderOptionsDeprecationWarningShown) return;
- this.#logger.warn("deprecated", `The adapter ${this.#manifest.adapterName} is using a deprecated signature of the 'app.render()' method. From Astro 4.0, locals and routeData are provided as properties on an optional object to this method. Using the old signature will cause an error in Astro 5.0. See https://github.com/withastro/astro/pull/9199 for more information.`)
+ this.#logger.warn(
+ 'deprecated',
+ `The adapter ${this.#manifest.adapterName} is using a deprecated signature of the 'app.render()' method. From Astro 4.0, locals and routeData are provided as properties on an optional object to this method. Using the old signature will cause an error in Astro 5.0. See https://github.com/withastro/astro/pull/9199 for more information.`
+ );
this.#renderOptionsDeprecationWarningShown = true;
}
diff --git a/packages/astro/src/core/app/node.ts b/packages/astro/src/core/app/node.ts
index 1c4ced2b4..46882f58e 100644
--- a/packages/astro/src/core/app/node.ts
+++ b/packages/astro/src/core/app/node.ts
@@ -117,13 +117,21 @@ export class NodeApp extends App {
}
return super.match(req);
}
- render(request: NodeIncomingMessage | Request, options?: RenderOptions): Promise<Response>
+ render(request: NodeIncomingMessage | Request, options?: RenderOptions): Promise<Response>;
/**
* @deprecated Instead of passing `RouteData` and locals individually, pass an object with `routeData` and `locals` properties.
* See https://github.com/withastro/astro/pull/9199 for more information.
*/
- render(request: NodeIncomingMessage | Request, routeData?: RouteData, locals?: object): Promise<Response>
- render(req: NodeIncomingMessage | Request, routeDataOrOptions?: RouteData | RenderOptions, maybeLocals?: object) {
+ render(
+ request: NodeIncomingMessage | Request,
+ routeData?: RouteData,
+ locals?: object
+ ): Promise<Response>;
+ render(
+ req: NodeIncomingMessage | Request,
+ routeDataOrOptions?: RouteData | RenderOptions,
+ maybeLocals?: object
+ ) {
if (!(req instanceof Request)) {
req = createRequestFromNodeRequest(req);
}
diff --git a/packages/astro/src/core/dev/restart.ts b/packages/astro/src/core/dev/restart.ts
index 49cd185d8..b19eae4ac 100644
--- a/packages/astro/src/core/dev/restart.ts
+++ b/packages/astro/src/core/dev/restart.ts
@@ -47,8 +47,8 @@ export function shouldRestartContainer(
// Otherwise, watch for any astro.config.* file changes in project root
else {
const normalizedChangedFile = vite.normalizePath(changedFile);
- shouldRestart = configRE.test(normalizedChangedFile) || preferencesRE.test(normalizedChangedFile);
-
+ shouldRestart =
+ configRE.test(normalizedChangedFile) || preferencesRE.test(normalizedChangedFile);
}
if (!shouldRestart && settings.watchFiles.length > 0) {
@@ -74,7 +74,10 @@ export async function restartContainer(container: Container): Promise<Container
const error = createSafeError(_err);
// Print all error messages except ZodErrors from AstroConfig as the pre-logged error is sufficient
if (!isAstroConfigZodError(_err)) {
- logger.error('config', formatErrorMessage(collectErrorMetadata(error), logger.level() === 'debug') + '\n');
+ logger.error(
+ 'config',
+ formatErrorMessage(collectErrorMetadata(error), logger.level() === 'debug') + '\n'
+ );
}
// Inform connected clients of the config error
container.viteServer.ws.send({
diff --git a/packages/astro/src/core/messages.ts b/packages/astro/src/core/messages.ts
index 935ed1bdc..135aa5813 100644
--- a/packages/astro/src/core/messages.ts
+++ b/packages/astro/src/core/messages.ts
@@ -128,7 +128,9 @@ export function preferenceDefaultIntro(name: string) {
}
export function preferenceDefault(name: string, value: any) {
- return `${yellow('◯')} ${name} has not been set. It defaults to ${bgYellow(black(` ${JSON.stringify(value)} `))}\n`;
+ return `${yellow('◯')} ${name} has not been set. It defaults to ${bgYellow(
+ black(` ${JSON.stringify(value)} `)
+ )}\n`;
}
export function preferenceDisabled(name: string) {
@@ -219,7 +221,10 @@ export function formatConfigErrorMessage(err: ZodError) {
// a regex to match the first line of a stack trace
const STACK_LINE_REGEXP = /^\s+at /g;
const IRRELEVANT_STACK_REGEXP = /(node_modules|astro[\/\\]dist)/g;
-function formatErrorStackTrace(err: Error | ErrorWithMetadata, showFullStacktrace: boolean): string {
+function formatErrorStackTrace(
+ err: Error | ErrorWithMetadata,
+ showFullStacktrace: boolean
+): string {
const stackLines = (err.stack || '').split('\n').filter((line) => STACK_LINE_REGEXP.test(line));
// If full details are required, just return the entire stack trace.
if (showFullStacktrace) {
@@ -230,18 +235,23 @@ function formatErrorStackTrace(err: Error | ErrorWithMetadata, showFullStacktrac
if (irrelevantStackIndex <= 0) {
const errorId = (err as ErrorWithMetadata).id;
const errorLoc = (err as ErrorWithMetadata).loc;
- if (errorId|| errorLoc?.file) {
- const prettyLocation = ` at ${errorId?? errorLoc?.file}${
+ if (errorId || errorLoc?.file) {
+ const prettyLocation = ` at ${errorId ?? errorLoc?.file}${
errorLoc?.line && errorLoc.column ? `:${errorLoc.line}:${errorLoc.column}` : ''
}`;
- return prettyLocation + '\n [...] See full stack trace in the browser, or rerun with --verbose.';
+ return (
+ prettyLocation + '\n [...] See full stack trace in the browser, or rerun with --verbose.'
+ );
} else {
return stackLines.join('\n');
}
}
// If the error occurred inside of a dependency, grab the entire stack.
// Otherwise, only grab the part of the stack that is relevant to the user's codebase.
- return stackLines.splice(0, irrelevantStackIndex).join('\n') + '\n [...] See full stack trace in the browser, or rerun with --verbose.';
+ return (
+ stackLines.splice(0, irrelevantStackIndex).join('\n') +
+ '\n [...] See full stack trace in the browser, or rerun with --verbose.'
+ );
}
export function formatErrorMessage(err: ErrorWithMetadata, showFullStacktrace: boolean): string {
@@ -256,9 +266,7 @@ export function formatErrorMessage(err: ErrorWithMetadata, showFullStacktrace: b
if (err.hint) {
output.push(` ${bold('Hint:')}`);
- output.push(
- yellow(padMultilineString(renderErrorMarkdown(err.hint, 'cli'), 4))
- );
+ output.push(yellow(padMultilineString(renderErrorMarkdown(err.hint, 'cli'), 4)));
}
const docsLink = getDocsForError(err);
@@ -276,13 +284,14 @@ export function formatErrorMessage(err: ErrorWithMetadata, showFullStacktrace: b
output.push(` ${bold('Caused by:')}`);
let causeMessage = ' ';
if (err.cause instanceof Error) {
- causeMessage += err.cause.message + '\n' + formatErrorStackTrace(err.cause, showFullStacktrace);
+ causeMessage +=
+ err.cause.message + '\n' + formatErrorStackTrace(err.cause, showFullStacktrace);
} else {
- causeMessage += (JSON.stringify(err.cause));
+ causeMessage += JSON.stringify(err.cause);
}
output.push(dim(causeMessage));
}
-
+
return output.join('\n');
}
diff --git a/packages/astro/src/preferences/defaults.ts b/packages/astro/src/preferences/defaults.ts
index 74ae7b2dc..db9cfde87 100644
--- a/packages/astro/src/preferences/defaults.ts
+++ b/packages/astro/src/preferences/defaults.ts
@@ -3,6 +3,6 @@ export const DEFAULT_PREFERENCES = {
/** Specifies whether the user has the Dev Overlay enabled */
enabled: true,
},
-}
+};
export type Preferences = typeof DEFAULT_PREFERENCES;
diff --git a/packages/astro/src/preferences/index.ts b/packages/astro/src/preferences/index.ts
index 86faf1cc8..91b942101 100644
--- a/packages/astro/src/preferences/index.ts
+++ b/packages/astro/src/preferences/index.ts
@@ -9,14 +9,18 @@ import dget from 'dlv';
import { DEFAULT_PREFERENCES, type Preferences } from './defaults.js';
import { PreferenceStore } from './store.js';
-type DotKeys<T> = T extends object ? { [K in keyof T]:
- `${Exclude<K, symbol>}${DotKeys<T[K]> extends never ? "" : `.${DotKeys<T[K]>}`}`
-}[keyof T] : never
+type DotKeys<T> = T extends object
+ ? {
+ [K in keyof T]: `${Exclude<K, symbol>}${DotKeys<T[K]> extends never
+ ? ''
+ : `.${DotKeys<T[K]>}`}`;
+ }[keyof T]
+ : never;
export type GetDotKey<
- T extends Record<string | number, any>,
- K extends string
-> = K extends `${infer U}.${infer Rest}` ? GetDotKey<T[U], Rest> : T[K]
+ T extends Record<string | number, any>,
+ K extends string,
+> = K extends `${infer U}.${infer Rest}` ? GetDotKey<T[U], Rest> : T[K];
export interface PreferenceOptions {
location?: 'global' | 'project';
@@ -25,8 +29,15 @@ export interface PreferenceOptions {
export type PreferenceKey = DotKeys<Preferences>;
export interface AstroPreferences {
- get<Key extends PreferenceKey>(key: Key, opts?: PreferenceOptions): Promise<GetDotKey<Preferences, Key>>;
- set<Key extends PreferenceKey>(key: Key, value: GetDotKey<Preferences, Key>, opts?: PreferenceOptions): Promise<void>;
+ get<Key extends PreferenceKey>(
+ key: Key,
+ opts?: PreferenceOptions
+ ): Promise<GetDotKey<Preferences, Key>>;
+ set<Key extends PreferenceKey>(
+ key: Key,
+ value: GetDotKey<Preferences, Key>,
+ opts?: PreferenceOptions
+ ): Promise<void>;
getAll(opts?: PreferenceOptions): Promise<Record<string, any>>;
}
@@ -36,8 +47,10 @@ export function isValidKey(key: string): key is PreferenceKey {
export function coerce(key: string, value: unknown) {
const type = typeof dget(DEFAULT_PREFERENCES, key);
switch (type) {
- case 'string': return value;
- case 'number': return Number(value);
+ case 'string':
+ return value;
+ case 'number':
+ return Number(value);
case 'boolean': {
if (value === 'true' || value === 1) return true;
if (value === 'false' || value === 0) return false;
@@ -60,13 +73,13 @@ export default function createPreferences(config: AstroConfig): AstroPreferences
stores[location].set(key, value);
},
async getAll({ location } = {}) {
- if (!location) return Object.assign({}, stores['global'].getAll(), stores['project'].getAll());
+ if (!location)
+ return Object.assign({}, stores['global'].getAll(), stores['project'].getAll());
return stores[location].getAll();
},
- }
+ };
}
-
// Adapted from https://github.com/sindresorhus/env-paths
export function getGlobalPreferenceDir() {
const name = 'astro';
diff --git a/packages/astro/src/preferences/store.ts b/packages/astro/src/preferences/store.ts
index 4dabbba1c..1bf9c46c7 100644
--- a/packages/astro/src/preferences/store.ts
+++ b/packages/astro/src/preferences/store.ts
@@ -6,7 +6,10 @@ import path from 'node:path';
export class PreferenceStore {
private file: string;
- constructor(private dir: string, filename = 'settings.json') {
+ constructor(
+ private dir: string,
+ filename = 'settings.json'
+ ) {
this.file = path.join(this.dir, filename);
}
diff --git a/packages/astro/src/runtime/client/dev-overlay/plugins/utils/highlight.ts b/packages/astro/src/runtime/client/dev-overlay/plugins/utils/highlight.ts
index 31c70b724..e2d74c0ff 100644
--- a/packages/astro/src/runtime/client/dev-overlay/plugins/utils/highlight.ts
+++ b/packages/astro/src/runtime/client/dev-overlay/plugins/utils/highlight.ts
@@ -18,9 +18,9 @@ export function createHighlight(rect: DOMRect, icon?: Icon) {
export function getHighlightZIndex(el: Element) {
let highestZIndex = 0;
let current: Element | ParentNode | null = el;
- while(current instanceof Element) {
+ while (current instanceof Element) {
let zIndex = Number(getComputedStyle(current).zIndex);
- if(!Number.isNaN(zIndex) && zIndex > highestZIndex) {
+ if (!Number.isNaN(zIndex) && zIndex > highestZIndex) {
highestZIndex = zIndex;
}
current = current.parentNode;
diff --git a/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts b/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts
index aff02fc9c..08a510d98 100644
--- a/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts
+++ b/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts
@@ -1,6 +1,11 @@
import type { DevOverlayMetadata, DevOverlayPlugin } from '../../../../@types/astro.js';
import type { DevOverlayHighlight } from '../ui-library/highlight.js';
-import { attachTooltipToHighlight, createHighlight, getHighlightZIndex, positionHighlight } from './utils/highlight.js';
+import {
+ attachTooltipToHighlight,
+ createHighlight,
+ getHighlightZIndex,
+ positionHighlight,
+} from './utils/highlight.js';
const icon =
'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#fff" d="M7.9 1.5v-.4a1.1 1.1 0 0 1 2.2 0v.4a1.1 1.1 0 1 1-2.2 0Zm-6.4 8.6a1.1 1.1 0 1 0 0-2.2h-.4a1.1 1.1 0 0 0 0 2.2h.4ZM12 3.7a1.1 1.1 0 0 0 1.4-.7l.4-1.1a1.1 1.1 0 0 0-2.1-.8l-.4 1.2a1.1 1.1 0 0 0 .7 1.4Zm-9.7 7.6-1.2.4a1.1 1.1 0 1 0 .8 2.1l1-.4a1.1 1.1 0 1 0-.6-2ZM20.8 17a1.9 1.9 0 0 1 0 2.6l-1.2 1.2a1.9 1.9 0 0 1-2.6 0l-4.3-4.2-1.6 3.6a1.9 1.9 0 0 1-1.7 1.2A1.9 1.9 0 0 1 7.5 20L2.7 5a1.9 1.9 0 0 1 2.4-2.4l15 5a1.9 1.9 0 0 1 .2 3.4l-3.7 1.6 4.2 4.3ZM19 18.3 14.6 14a1.9 1.9 0 0 1 .6-3l3.2-1.5L5.1 5.1l4.3 13.3 1.5-3.2a1.9 1.9 0 0 1 3-.6l4.4 4.4.7-.7Z"/></svg>';
@@ -43,7 +48,7 @@ export default {
// Set the z-index to be 1 higher than the greatest z-index in the stack.
const zIndex = getHighlightZIndex(islandElement);
- tooltip.style.zIndex = highlight.style.zIndex = zIndex+'';
+ tooltip.style.zIndex = highlight.style.zIndex = zIndex + '';
canvas.append(highlight);
islandsOverlays.push({ highlightElement: highlight, island: islandElement });
diff --git a/packages/astro/src/runtime/client/dev-overlay/ui-library/icon.ts b/packages/astro/src/runtime/client/dev-overlay/ui-library/icon.ts
index 34cf3150d..3211e1857 100644
--- a/packages/astro/src/runtime/client/dev-overlay/ui-library/icon.ts
+++ b/packages/astro/src/runtime/client/dev-overlay/ui-library/icon.ts
@@ -46,8 +46,6 @@ export class DevOverlayIcon extends HTMLElement {
fill: black;
}
}
- </style>\n${this.getIconHTML(
- this._icon
- )}`;
+ </style>\n${this.getIconHTML(this._icon)}`;
}
}
diff --git a/packages/astro/src/vite-plugin-astro-server/request.ts b/packages/astro/src/vite-plugin-astro-server/request.ts
index dea514c28..aa9124fb4 100644
--- a/packages/astro/src/vite-plugin-astro-server/request.ts
+++ b/packages/astro/src/vite-plugin-astro-server/request.ts
@@ -2,7 +2,7 @@ import type http from 'node:http';
import type { ManifestData, SSRManifest } from '../@types/astro.js';
import { collectErrorMetadata } from '../core/errors/dev/index.js';
import { createSafeError } from '../core/errors/index.js';
-import {formatErrorMessage} from '../core/messages.js';
+import { formatErrorMessage } from '../core/messages.js';
import { collapseDuplicateSlashes, removeTrailingForwardSlash } from '../core/path.js';
import { eventError, telemetry } from '../events/index.js';
import { isServerLikeOutput } from '../prerender/utils.js';
@@ -102,7 +102,10 @@ export async function handleRequest({
telemetry.record(eventError({ cmd: 'dev', err: errorWithMetadata, isFatal: false }));
- pipeline.logger.error(null, formatErrorMessage(errorWithMetadata, pipeline.logger.level() === 'debug'));
+ pipeline.logger.error(
+ null,
+ formatErrorMessage(errorWithMetadata, pipeline.logger.level() === 'debug')
+ );
handle500Response(moduleLoader, incomingResponse, errorWithMetadata);
return err;
diff --git a/packages/astro/src/vite-plugin-astro-server/route.ts b/packages/astro/src/vite-plugin-astro-server/route.ts
index a8f9efa04..aa9036810 100644
--- a/packages/astro/src/vite-plugin-astro-server/route.ts
+++ b/packages/astro/src/vite-plugin-astro-server/route.ts
@@ -384,7 +384,10 @@ async function getScriptsAndStyles({ pipeline, filePath }: GetScriptsAndStylesPa
children: '',
});
- if (settings.config.devOverlay.enabled && await settings.preferences.get('devOverlay.enabled')) {
+ if (
+ settings.config.devOverlay.enabled &&
+ (await settings.preferences.get('devOverlay.enabled'))
+ ) {
scripts.add({
props: {
type: 'module',
diff --git a/packages/integrations/node/CHANGELOG.md b/packages/integrations/node/CHANGELOG.md
index 87a115fcd..732122ecf 100644
--- a/packages/integrations/node/CHANGELOG.md
+++ b/packages/integrations/node/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/node
+## 7.0.0-beta.1
+
+### Major Changes
+
+- [#9199](https://github.com/withastro/astro/pull/9199) [`49aa215a0`](https://github.com/withastro/astro/commit/49aa215a01ee1c4805316c85bb0aea6cfbc25a31) Thanks [@lilnasy](https://github.com/lilnasy)! - The internals of the integration have been updated to support Astro 4.0. Make sure to upgrade your Astro version as Astro 3.0 is no longer supported.
+
## 7.0.0-beta.0
### Patch Changes
diff --git a/packages/integrations/node/package.json b/packages/integrations/node/package.json
index babc33a8a..9981db3c5 100644
--- a/packages/integrations/node/package.json
+++ b/packages/integrations/node/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/node",
"description": "Deploy your site to a Node.js server",
- "version": "7.0.0-beta.0",
+ "version": "7.0.0-beta.1",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
diff --git a/packages/integrations/vercel/CHANGELOG.md b/packages/integrations/vercel/CHANGELOG.md
index 6d26f2c11..1cb378ee3 100644
--- a/packages/integrations/vercel/CHANGELOG.md
+++ b/packages/integrations/vercel/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/vercel
+## 6.0.0-beta.1
+
+### Major Changes
+
+- [#9199](https://github.com/withastro/astro/pull/9199) [`49aa215a0`](https://github.com/withastro/astro/commit/49aa215a01ee1c4805316c85bb0aea6cfbc25a31) Thanks [@lilnasy](https://github.com/lilnasy)! - The internals of the integration have been updated to support Astro 4.0. Make sure to upgrade your Astro version as Astro 3.0 is no longer supported.
+
## 6.0.0-beta.0
### Major Changes
diff --git a/packages/integrations/vercel/package.json b/packages/integrations/vercel/package.json
index c398bee25..8e770376c 100644
--- a/packages/integrations/vercel/package.json
+++ b/packages/integrations/vercel/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/vercel",
"description": "Deploy your site to Vercel",
- "version": "6.0.0-beta.0",
+ "version": "6.0.0-beta.1",
"type": "module",
"author": "withastro",
"license": "MIT",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 214bf4b33..0fd4633ea 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -125,7 +125,7 @@ importers:
examples/basics:
dependencies:
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
examples/blog:
@@ -140,13 +140,13 @@ importers:
specifier: ^3.0.3
version: link:../../packages/integrations/sitemap
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
examples/component:
devDependencies:
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
examples/framework-alpine:
@@ -161,7 +161,7 @@ importers:
specifier: ^3.13.3
version: 3.13.3
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
examples/framework-lit:
@@ -173,7 +173,7 @@ importers:
specifier: ^0.2.1
version: 0.2.1
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
lit:
specifier: ^2.8.0
@@ -197,7 +197,7 @@ importers:
specifier: ^4.0.0-beta.0
version: link:../../packages/integrations/vue
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
preact:
specifier: ^10.19.2
@@ -227,7 +227,7 @@ importers:
specifier: ^1.2.1
version: 1.2.1(preact@10.19.2)
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
preact:
specifier: ^10.19.2
@@ -245,7 +245,7 @@ importers:
specifier: ^18.2.15
version: 18.2.15
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
react:
specifier: ^18.2.0
@@ -260,7 +260,7 @@ importers:
specifier: ^3.0.2
version: link:../../packages/integrations/solid
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
solid-js:
specifier: ^1.8.5
@@ -272,7 +272,7 @@ importers:
specifier: ^5.0.0-beta.0
version: link:../../packages/integrations/svelte
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
svelte:
specifier: ^4.2.5
@@ -284,7 +284,7 @@ importers:
specifier: ^4.0.0-beta.0
version: link:../../packages/integrations/vue
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
vue:
specifier: ^3.3.8
@@ -293,25 +293,25 @@ importers:
examples/hackernews:
dependencies:
'@astrojs/node':
- specifier: ^7.0.0-beta.0
+ specifier: ^7.0.0-beta.1
version: link:../../packages/integrations/node
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
examples/integration:
devDependencies:
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
examples/middleware:
dependencies:
'@astrojs/node':
- specifier: ^7.0.0-beta.0
+ specifier: ^7.0.0-beta.1
version: link:../../packages/integrations/node
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
html-minifier:
specifier: ^4.0.0
@@ -320,31 +320,31 @@ importers:
examples/minimal:
dependencies:
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
examples/non-html-pages:
dependencies:
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
examples/portfolio:
dependencies:
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
examples/ssr:
dependencies:
'@astrojs/node':
- specifier: ^7.0.0-beta.0
+ specifier: ^7.0.0-beta.1
version: link:../../packages/integrations/node
'@astrojs/svelte':
specifier: ^5.0.0-beta.0
version: link:../../packages/integrations/svelte
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
svelte:
specifier: ^4.2.5
@@ -353,13 +353,13 @@ importers:
examples/view-transitions:
devDependencies:
'@astrojs/node':
- specifier: ^7.0.0-beta.0
+ specifier: ^7.0.0-beta.1
version: link:../../packages/integrations/node
'@astrojs/tailwind':
specifier: ^6.0.0-beta.0
version: link:../../packages/integrations/tailwind
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
examples/with-markdoc:
@@ -368,7 +368,7 @@ importers:
specifier: ^1.0.0-beta.0
version: link:../../packages/integrations/markdoc
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
examples/with-markdown-plugins:
@@ -377,7 +377,7 @@ importers:
specifier: ^4.0.0-beta.0
version: link:../../packages/markdown/remark
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
hast-util-select:
specifier: ^6.0.2
@@ -398,7 +398,7 @@ importers:
examples/with-markdown-shiki:
dependencies:
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
examples/with-mdx:
@@ -410,7 +410,7 @@ importers:
specifier: ^3.0.1
version: link:../../packages/integrations/preact
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
preact:
specifier: ^10.19.2
@@ -425,7 +425,7 @@ importers:
specifier: ^0.5.0
version: 0.5.0(nanostores@0.9.5)(preact@10.19.2)
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
nanostores:
specifier: ^0.9.5
@@ -446,7 +446,7 @@ importers:
specifier: ^1.6.3
version: 1.6.3
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
autoprefixer:
specifier: ^10.4.15
@@ -464,7 +464,7 @@ importers:
examples/with-vite-plugin-pwa:
dependencies:
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
vite-plugin-pwa:
specifier: 0.17.0
@@ -476,7 +476,7 @@ importers:
examples/with-vitest:
dependencies:
astro:
- specifier: ^4.0.0-beta.1
+ specifier: ^4.0.0-beta.2
version: link:../../packages/astro
vitest:
specifier: ^0.34.2