summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/pre.json5
-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/container-with-vitest/package.json2
-rw-r--r--examples/framework-alpine/package.json2
-rw-r--r--examples/framework-multiple/package.json8
-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.json4
-rw-r--r--examples/framework-vue/package.json4
-rw-r--r--examples/hackernews/package.json2
-rw-r--r--examples/integration/package.json2
-rw-r--r--examples/middleware/package.json2
-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/server-islands/package.json2
-rw-r--r--examples/ssr/package.json4
-rw-r--r--examples/starlog/package.json2
-rw-r--r--examples/toolbar-app/package.json2
-rw-r--r--examples/view-transitions/package.json2
-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-vitest/package.json2
-rw-r--r--packages/astro/CHANGELOG.md14
-rw-r--r--packages/astro/e2e/actions-blog.test.js12
-rw-r--r--packages/astro/package.json2
-rw-r--r--packages/astro/src/actions/runtime/middleware.ts16
-rw-r--r--packages/astro/src/actions/runtime/virtual/shared.ts7
-rw-r--r--packages/astro/src/assets/services/service.ts5
-rw-r--r--packages/astro/src/core/app/types.ts7
-rw-r--r--packages/astro/src/core/base-pipeline.ts173
-rw-r--r--packages/astro/src/core/config/schema.ts8
-rw-r--r--packages/astro/src/core/middleware/noop-middleware.ts2
-rw-r--r--packages/astro/src/core/routing/manifest/generator.ts4
-rw-r--r--packages/astro/test/core-image.test.js6
-rw-r--r--packages/integrations/svelte/CHANGELOG.md6
-rw-r--r--packages/integrations/svelte/package.json2
-rw-r--r--packages/integrations/vue/CHANGELOG.md6
-rw-r--r--packages/integrations/vue/package.json2
-rw-r--r--pnpm-lock.yaml70
47 files changed, 226 insertions, 191 deletions
diff --git a/.changeset/pre.json b/.changeset/pre.json
index e7eabee7b..34bd34347 100644
--- a/.changeset/pre.json
+++ b/.changeset/pre.json
@@ -40,6 +40,7 @@
"chilly-terms-know",
"clean-camels-drive",
"clean-donuts-walk",
+ "cold-bananas-hear",
"cool-mangos-shop",
"cuddly-shoes-press",
"curvy-walls-kneel",
@@ -54,9 +55,11 @@
"fuzzy-pugs-live",
"giant-rocks-thank",
"healthy-ads-scream",
+ "heavy-peas-sneeze",
"heavy-seahorses-poke",
"hip-wombats-exercise",
"honest-dingos-add",
+ "hot-camels-move",
"hungry-jokes-try",
"itchy-toys-march",
"large-zebras-sniff",
@@ -75,9 +78,11 @@
"poor-dots-add",
"poor-frogs-dream",
"quick-ads-exercise",
+ "rotten-phones-scream",
"selfish-cats-crash",
"selfish-impalas-grin",
"sharp-worms-sniff",
+ "sixty-oranges-walk",
"slimy-mice-dance",
"slimy-queens-hang",
"small-ties-sort",
diff --git a/examples/basics/package.json b/examples/basics/package.json
index 1390afbc7..ad9839584 100644
--- a/examples/basics/package.json
+++ b/examples/basics/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
}
}
diff --git a/examples/blog/package.json b/examples/blog/package.json
index 7673e67be..5cf7be6b0 100644
--- a/examples/blog/package.json
+++ b/examples/blog/package.json
@@ -14,6 +14,6 @@
"@astrojs/mdx": "^4.0.0-beta.1",
"@astrojs/rss": "^4.0.7",
"@astrojs/sitemap": "^3.1.6",
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
}
}
diff --git a/examples/component/package.json b/examples/component/package.json
index 660700e48..c704256c1 100644
--- a/examples/component/package.json
+++ b/examples/component/package.json
@@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
},
"peerDependencies": {
"astro": "^4.0.0 || ^5.0.0"
diff --git a/examples/container-with-vitest/package.json b/examples/container-with-vitest/package.json
index d9cd96f5d..fb0830622 100644
--- a/examples/container-with-vitest/package.json
+++ b/examples/container-with-vitest/package.json
@@ -12,7 +12,7 @@
"test": "vitest run"
},
"dependencies": {
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.0.0-beta.2",
"@astrojs/react": "^3.6.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json
index 016131854..371b5a8f2 100644
--- a/examples/framework-alpine/package.json
+++ b/examples/framework-alpine/package.json
@@ -14,6 +14,6 @@
"@astrojs/alpinejs": "^0.4.0",
"@types/alpinejs": "^3.13.10",
"alpinejs": "^3.14.1",
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
}
}
diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json
index 43d2b9138..f3ee19e0c 100644
--- a/examples/framework-multiple/package.json
+++ b/examples/framework-multiple/package.json
@@ -13,12 +13,12 @@
"dependencies": {
"@astrojs/preact": "^3.5.3",
"@astrojs/react": "^3.6.2",
- "@astrojs/solid-js": "^4.4.1",
- "@astrojs/svelte": "^5.7.0",
- "@astrojs/vue": "^4.5.0",
+ "@astrojs/solid-js": "^4.4.2",
+ "@astrojs/svelte": "^6.0.0-beta.0",
+ "@astrojs/vue": "^5.0.0-beta.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.0.0-beta.2",
"preact": "^10.23.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json
index 5aae221db..4838579bb 100644
--- a/examples/framework-preact/package.json
+++ b/examples/framework-preact/package.json
@@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.5.3",
"@preact/signals": "^1.3.0",
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.0.0-beta.2",
"preact": "^10.23.2"
}
}
diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json
index cac25816f..c54acaeb4 100644
--- a/examples/framework-react/package.json
+++ b/examples/framework-react/package.json
@@ -14,7 +14,7 @@
"@astrojs/react": "^3.6.2",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.0.0-beta.2",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json
index c69f67781..93b519f03 100644
--- a/examples/framework-solid/package.json
+++ b/examples/framework-solid/package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^4.4.2",
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.0.0-beta.2",
"solid-js": "^1.8.22"
}
}
diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json
index 5ac9a2a90..e709e95de 100644
--- a/examples/framework-svelte/package.json
+++ b/examples/framework-svelte/package.json
@@ -11,8 +11,8 @@
"astro": "astro"
},
"dependencies": {
- "@astrojs/svelte": "^5.7.1",
- "astro": "^5.0.0-beta.1",
+ "@astrojs/svelte": "^6.0.0-beta.0",
+ "astro": "^5.0.0-beta.2",
"svelte": "^4.2.19"
}
}
diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json
index 8214c6316..2976c90fb 100644
--- a/examples/framework-vue/package.json
+++ b/examples/framework-vue/package.json
@@ -11,8 +11,8 @@
"astro": "astro"
},
"dependencies": {
- "@astrojs/vue": "^4.5.1",
- "astro": "^5.0.0-beta.1",
+ "@astrojs/vue": "^5.0.0-beta.0",
+ "astro": "^5.0.0-beta.2",
"vue": "^3.5.3"
}
}
diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json
index 0d774329d..79d3014cd 100644
--- a/examples/hackernews/package.json
+++ b/examples/hackernews/package.json
@@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/node": "^9.0.0-alpha.1",
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
}
}
diff --git a/examples/integration/package.json b/examples/integration/package.json
index 163dd59fc..662738404 100644
--- a/examples/integration/package.json
+++ b/examples/integration/package.json
@@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
},
"peerDependencies": {
"astro": "^4.0.0"
diff --git a/examples/middleware/package.json b/examples/middleware/package.json
index e3f0d89d4..025dbd340 100644
--- a/examples/middleware/package.json
+++ b/examples/middleware/package.json
@@ -13,7 +13,7 @@
},
"dependencies": {
"@astrojs/node": "^9.0.0-alpha.1",
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.0.0-beta.2",
"html-minifier": "^4.0.0"
},
"devDependencies": {
diff --git a/examples/minimal/package.json b/examples/minimal/package.json
index 1c32aa2a6..dc5d5c3a5 100644
--- a/examples/minimal/package.json
+++ b/examples/minimal/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
}
}
diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json
index 5914a1e13..d4c71e7be 100644
--- a/examples/non-html-pages/package.json
+++ b/examples/non-html-pages/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
}
}
diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json
index 28b4fa68f..e9b712675 100644
--- a/examples/portfolio/package.json
+++ b/examples/portfolio/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
}
}
diff --git a/examples/server-islands/package.json b/examples/server-islands/package.json
index 6e1379256..a669dcc74 100644
--- a/examples/server-islands/package.json
+++ b/examples/server-islands/package.json
@@ -17,7 +17,7 @@
"@tailwindcss/forms": "^0.5.9",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.0.0-beta.2",
"postcss": "^8.4.45",
"react": "^18.3.1",
"react-dom": "^18.3.1",
diff --git a/examples/ssr/package.json b/examples/ssr/package.json
index 98a715f0c..4142f3f9b 100644
--- a/examples/ssr/package.json
+++ b/examples/ssr/package.json
@@ -13,8 +13,8 @@
},
"dependencies": {
"@astrojs/node": "^9.0.0-alpha.1",
- "@astrojs/svelte": "^5.7.0",
- "astro": "^5.0.0-beta.1",
+ "@astrojs/svelte": "^6.0.0-beta.0",
+ "astro": "^5.0.0-beta.2",
"svelte": "^4.2.19"
}
}
diff --git a/examples/starlog/package.json b/examples/starlog/package.json
index 6658e43a8..71c779dcd 100644
--- a/examples/starlog/package.json
+++ b/examples/starlog/package.json
@@ -10,7 +10,7 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.0.0-beta.2",
"sass": "^1.78.0",
"sharp": "^0.33.3"
}
diff --git a/examples/toolbar-app/package.json b/examples/toolbar-app/package.json
index bb284a89c..b697261a1 100644
--- a/examples/toolbar-app/package.json
+++ b/examples/toolbar-app/package.json
@@ -15,6 +15,6 @@
"./app": "./dist/app.js"
},
"devDependencies": {
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
}
}
diff --git a/examples/view-transitions/package.json b/examples/view-transitions/package.json
index aff845df1..b1cc57b10 100644
--- a/examples/view-transitions/package.json
+++ b/examples/view-transitions/package.json
@@ -12,6 +12,6 @@
"devDependencies": {
"@astrojs/tailwind": "^5.1.1",
"@astrojs/node": "^9.0.0-alpha.1",
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
}
}
diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json
index 26af28266..65a26dd20 100644
--- a/examples/with-markdoc/package.json
+++ b/examples/with-markdoc/package.json
@@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.11.5-beta.0",
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
}
}
diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json
index 622a6a7ab..4ab25fc2c 100644
--- a/examples/with-markdown-plugins/package.json
+++ b/examples/with-markdown-plugins/package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/markdown-remark": "^6.0.0-beta.1",
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.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 208dfb46a..b7bc63660 100644
--- a/examples/with-markdown-shiki/package.json
+++ b/examples/with-markdown-shiki/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^5.0.0-beta.1"
+ "astro": "^5.0.0-beta.2"
}
}
diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json
index 093c43e20..b90445eab 100644
--- a/examples/with-mdx/package.json
+++ b/examples/with-mdx/package.json
@@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/mdx": "^4.0.0-beta.1",
"@astrojs/preact": "^3.5.3",
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.0.0-beta.2",
"preact": "^10.23.2"
}
}
diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json
index 40fcd204a..210046282 100644
--- a/examples/with-nanostores/package.json
+++ b/examples/with-nanostores/package.json
@@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.5.3",
"@nanostores/preact": "^0.5.2",
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.0.0-beta.2",
"nanostores": "^0.11.3",
"preact": "^10.23.2"
}
diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json
index 356a9c93b..d20c28706 100644
--- a/examples/with-tailwindcss/package.json
+++ b/examples/with-tailwindcss/package.json
@@ -14,7 +14,7 @@
"@astrojs/mdx": "^4.0.0-beta.1",
"@astrojs/tailwind": "^5.1.1",
"@types/canvas-confetti": "^1.6.4",
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.0.0-beta.2",
"autoprefixer": "^10.4.20",
"canvas-confetti": "^1.9.3",
"postcss": "^8.4.45",
diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json
index 1473094f9..d36841ca8 100644
--- a/examples/with-vitest/package.json
+++ b/examples/with-vitest/package.json
@@ -12,7 +12,7 @@
"test": "vitest"
},
"dependencies": {
- "astro": "^5.0.0-beta.1",
+ "astro": "^5.0.0-beta.2",
"vitest": "^2.0.5"
}
}
diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md
index 543473131..4094e4731 100644
--- a/packages/astro/CHANGELOG.md
+++ b/packages/astro/CHANGELOG.md
@@ -1,5 +1,19 @@
# astro
+## 5.0.0-beta.2
+
+### Patch Changes
+
+- [#12035](https://github.com/withastro/astro/pull/12035) [`325a57c`](https://github.com/withastro/astro/commit/325a57c543d88eab5e3ab32ee1bbfb534aed9c7c) Thanks [@ascorbic](https://github.com/ascorbic)! - Correctly parse values returned from inline loader
+
+- [#12022](https://github.com/withastro/astro/pull/12022) [`ddc3a08`](https://github.com/withastro/astro/commit/ddc3a08e8facdaf0b0298ee5a7adb73a53e1575e) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Properly handle including trailing slash on the image endpoint route based on the trailingSlash config
+
+- [#12016](https://github.com/withastro/astro/pull/12016) [`837ee3a`](https://github.com/withastro/astro/commit/837ee3a4aa6b33362bd680d4a7fc786ed8639444) Thanks [@matthewp](https://github.com/matthewp)! - Fixes actions with large amount of validation errors
+
+- [#12030](https://github.com/withastro/astro/pull/12030) [`10a756a`](https://github.com/withastro/astro/commit/10a756ad872ab0311524fca5438bff13d4df25c1) Thanks [@ascorbic](https://github.com/ascorbic)! - Resolves image paths in content layer with initial slash as project-relative
+
+ When using the `image()` schema helper, previously paths with an initial slash were treated as public URLs. This was to match the behavior of markdown images. However this is a change from before, where paths with an initial slash were treated as project-relative. This change restores the previous behavior, so that paths with an initial slash are treated as project-relative.
+
## 5.0.0-beta.1
### Major Changes
diff --git a/packages/astro/e2e/actions-blog.test.js b/packages/astro/e2e/actions-blog.test.js
index e1f5907e0..a6464a957 100644
--- a/packages/astro/e2e/actions-blog.test.js
+++ b/packages/astro/e2e/actions-blog.test.js
@@ -72,7 +72,10 @@ test.describe('Astro Actions - Blog', () => {
await expect(form.locator('p[data-error="body"]')).toBeVisible();
});
- test('Comment action - progressive fallback lots of validation errors', async ({ page, astro }) => {
+ test('Comment action - progressive fallback lots of validation errors', async ({
+ page,
+ astro,
+ }) => {
await page.goto(astro.resolveUrl('/lots-of-fields/'));
const form = page.getByTestId('lots');
@@ -81,12 +84,9 @@ test.describe('Astro Actions - Blog', () => {
const expectedText = 'Expected string, received null';
- const fields = [
- 'one', 'two', 'three', 'four', 'five',
- 'six', 'seven', 'eight', 'nine', 'ten'
- ];
+ const fields = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'];
- for await(const field of fields) {
+ for await (const field of fields) {
await expect(form.locator(`.${field}.error`)).toHaveText(expectedText);
}
});
diff --git a/packages/astro/package.json b/packages/astro/package.json
index 4ef5a0d79..31bb6bcf5 100644
--- a/packages/astro/package.json
+++ b/packages/astro/package.json
@@ -1,6 +1,6 @@
{
"name": "astro",
- "version": "5.0.0-beta.1",
+ "version": "5.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/actions/runtime/middleware.ts b/packages/astro/src/actions/runtime/middleware.ts
index dae0a3811..22d4f9c7d 100644
--- a/packages/astro/src/actions/runtime/middleware.ts
+++ b/packages/astro/src/actions/runtime/middleware.ts
@@ -1,3 +1,4 @@
+import { decodeBase64, encodeBase64 } from '@oslojs/encoding';
import { yellow } from 'kleur/colors';
import { defineMiddleware } from '../../core/middleware/index.js';
import type { MiddlewareNext } from '../../types/public/common.js';
@@ -10,7 +11,6 @@ import {
type SerializedActionResult,
serializeActionResult,
} from './virtual/shared.js';
-import { encodeBase64, decodeBase64 } from '@oslojs/encoding';
export type ActionPayload = {
actionResult: SerializedActionResult;
@@ -46,7 +46,7 @@ export const onRequest = defineMiddleware(async (context, next) => {
const actionPayloadCookie = context.cookies.get(ACTION_QUERY_PARAMS.actionPayload)?.value;
if (actionPayloadCookie) {
const actionPayload = JSON.parse(decoder.decode(decodeBase64(actionPayloadCookie)));
-
+
if (!isActionPayload(actionPayload)) {
throw new Error('Internal: Invalid action payload in cookie.');
}
@@ -130,10 +130,14 @@ async function redirectWithResult({
actionName: string;
actionResult: SafeResult<any, any>;
}) {
- const cookieValue = encodeBase64(encoder.encode(JSON.stringify({
- actionName: actionName,
- actionResult: serializeActionResult(actionResult),
- })));
+ const cookieValue = encodeBase64(
+ encoder.encode(
+ JSON.stringify({
+ actionName: actionName,
+ actionResult: serializeActionResult(actionResult),
+ }),
+ ),
+ );
context.cookies.set(ACTION_QUERY_PARAMS.actionPayload, cookieValue);
if (actionResult.error) {
diff --git a/packages/astro/src/actions/runtime/virtual/shared.ts b/packages/astro/src/actions/runtime/virtual/shared.ts
index 2171dabe7..f250b0a1a 100644
--- a/packages/astro/src/actions/runtime/virtual/shared.ts
+++ b/packages/astro/src/actions/runtime/virtual/shared.ts
@@ -206,16 +206,16 @@ export function serializeActionResult(res: SafeResult<any, any>): SerializedActi
}
let body: Record<string, any>;
- if(res.error instanceof ActionInputError) {
+ if (res.error instanceof ActionInputError) {
body = {
type: res.error.type,
issues: res.error.issues,
- fields: res.error.fields
+ fields: res.error.fields,
};
} else {
body = {
...res.error,
- message: res.error.message
+ message: res.error.message,
};
}
@@ -264,7 +264,6 @@ export function deserializeActionResult(res: SerializedActionResult): SafeResult
let json;
try {
json = JSON.parse(res.body);
-
} catch {
return {
data: undefined,
diff --git a/packages/astro/src/assets/services/service.ts b/packages/astro/src/assets/services/service.ts
index 4662963dc..e22bada89 100644
--- a/packages/astro/src/assets/services/service.ts
+++ b/packages/astro/src/assets/services/service.ts
@@ -343,10 +343,7 @@ export const baseService: Omit<LocalImageService, 'transform'> = {
options[key] && searchParams.append(param, options[key].toString());
});
- const imageEndpoint = joinPaths(
- import.meta.env.BASE_URL,
- imageConfig.endpoint.route
- );
+ const imageEndpoint = joinPaths(import.meta.env.BASE_URL, imageConfig.endpoint.route);
return `${imageEndpoint}?${searchParams}`;
},
parseURL(url) {
diff --git a/packages/astro/src/core/app/types.ts b/packages/astro/src/core/app/types.ts
index 50ef7901c..e6b5a2257 100644
--- a/packages/astro/src/core/app/types.ts
+++ b/packages/astro/src/core/app/types.ts
@@ -2,7 +2,12 @@ import type { RoutingStrategies } from '../../i18n/utils.js';
import type { ComponentInstance, SerializedRouteData } from '../../types/astro.js';
import type { AstroMiddlewareInstance } from '../../types/public/common.js';
import type { Locales } from '../../types/public/config.js';
-import type { RouteData, SSRComponentMetadata, SSRLoadedRenderer, SSRResult } from '../../types/public/internal.js';
+import type {
+ RouteData,
+ SSRComponentMetadata,
+ SSRLoadedRenderer,
+ SSRResult,
+} from '../../types/public/internal.js';
import type { SinglePageBuiltModule } from '../build/types.js';
export type ComponentPath = string;
diff --git a/packages/astro/src/core/base-pipeline.ts b/packages/astro/src/core/base-pipeline.ts
index 4f87112c1..5976c59b5 100644
--- a/packages/astro/src/core/base-pipeline.ts
+++ b/packages/astro/src/core/base-pipeline.ts
@@ -25,106 +25,101 @@ import { createDefaultRoutes } from './routing/default.js';
* Thus, a `Pipeline` is created once at process start and then used by every `RenderContext`.
*/
export abstract class Pipeline {
- readonly internalMiddleware: MiddlewareHandler[];
- resolvedMiddleware: MiddlewareHandler | undefined = undefined;
-
- constructor(
- readonly logger: Logger,
- readonly manifest: SSRManifest,
- /**
- * "development" or "production"
- */
- readonly mode: RuntimeMode,
- readonly renderers: SSRLoadedRenderer[],
- readonly resolve: (s: string) => Promise<string>,
- /**
- * Based on Astro config's `output` option, `true` if "server" or "hybrid".
- */
- readonly serverLike: boolean,
- readonly streaming: boolean,
- /**
- * Used to provide better error messages for `Astro.clientAddress`
- */
- readonly adapterName = manifest.adapterName,
- readonly clientDirectives = manifest.clientDirectives,
- readonly inlinedScripts = manifest.inlinedScripts,
- readonly compressHTML = manifest.compressHTML,
- readonly i18n = manifest.i18n,
- readonly middleware = manifest.middleware,
- readonly routeCache = new RouteCache(logger, mode),
- /**
- * Used for `Astro.site`.
- */
- readonly site = manifest.site ? new URL(manifest.site) : undefined,
- readonly callSetGetEnv = true,
- /**
- * Array of built-in, internal, routes.
- * Used to find the route module
- */
- readonly defaultRoutes = createDefaultRoutes(manifest),
- ) {
- this.internalMiddleware = [];
- // We do use our middleware only if the user isn't using the manual setup
- if (i18n?.strategy !== 'manual') {
- this.internalMiddleware.push(
- createI18nMiddleware(i18n, manifest.base, manifest.trailingSlash, manifest.buildFormat),
- );
- }
- // In SSR, getSecret should fail by default. Setting it here will run before the
- // adapter override.
- if (callSetGetEnv && manifest.envGetSecretEnabled) {
- setGetEnv(() => {
- throw new AstroError(AstroErrorData.EnvUnsupportedGetSecret);
- }, true);
- }
- }
-
- abstract headElements(routeData: RouteData): Promise<HeadElements> | HeadElements;
-
- abstract componentMetadata(
- routeData: RouteData,
- ): Promise<SSRResult['componentMetadata']> | void;
+ readonly internalMiddleware: MiddlewareHandler[];
+ resolvedMiddleware: MiddlewareHandler | undefined = undefined;
+ constructor(
+ readonly logger: Logger,
+ readonly manifest: SSRManifest,
/**
- * It attempts to retrieve the `RouteData` that matches the input `url`, and the component that belongs to the `RouteData`.
- *
- * ## Errors
- *
- * - if not `RouteData` is found
- *
- * @param {RewritePayload} rewritePayload The payload provided by the user
- * @param {Request} request The original request
+ * "development" or "production"
*/
- abstract tryRewrite(
- rewritePayload: RewritePayload,
- request: Request,
- ): Promise<TryRewriteResult>;
-
+ readonly mode: RuntimeMode,
+ readonly renderers: SSRLoadedRenderer[],
+ readonly resolve: (s: string) => Promise<string>,
/**
- * Tells the pipeline how to retrieve a component give a `RouteData`
- * @param routeData
+ * Based on Astro config's `output` option, `true` if "server" or "hybrid".
*/
- abstract getComponentByRoute(routeData: RouteData): Promise<ComponentInstance>;
-
+ readonly serverLike: boolean,
+ readonly streaming: boolean,
+ /**
+ * Used to provide better error messages for `Astro.clientAddress`
+ */
+ readonly adapterName = manifest.adapterName,
+ readonly clientDirectives = manifest.clientDirectives,
+ readonly inlinedScripts = manifest.inlinedScripts,
+ readonly compressHTML = manifest.compressHTML,
+ readonly i18n = manifest.i18n,
+ readonly middleware = manifest.middleware,
+ readonly routeCache = new RouteCache(logger, mode),
+ /**
+ * Used for `Astro.site`.
+ */
+ readonly site = manifest.site ? new URL(manifest.site) : undefined,
+ readonly callSetGetEnv = true,
/**
- * Resolves the middleware from the manifest, and returns the `onRequest` function. If `onRequest` isn't there,
- * it returns a no-op function
+ * Array of built-in, internal, routes.
+ * Used to find the route module
*/
- async getMiddleware(): Promise<MiddlewareHandler> {
- if (this.resolvedMiddleware) {
- return this.resolvedMiddleware;
+ readonly defaultRoutes = createDefaultRoutes(manifest),
+ ) {
+ this.internalMiddleware = [];
+ // We do use our middleware only if the user isn't using the manual setup
+ if (i18n?.strategy !== 'manual') {
+ this.internalMiddleware.push(
+ createI18nMiddleware(i18n, manifest.base, manifest.trailingSlash, manifest.buildFormat),
+ );
+ }
+ // In SSR, getSecret should fail by default. Setting it here will run before the
+ // adapter override.
+ if (callSetGetEnv && manifest.envGetSecretEnabled) {
+ setGetEnv(() => {
+ throw new AstroError(AstroErrorData.EnvUnsupportedGetSecret);
+ }, true);
+ }
+ }
+
+ abstract headElements(routeData: RouteData): Promise<HeadElements> | HeadElements;
+
+ abstract componentMetadata(routeData: RouteData): Promise<SSRResult['componentMetadata']> | void;
+
+ /**
+ * It attempts to retrieve the `RouteData` that matches the input `url`, and the component that belongs to the `RouteData`.
+ *
+ * ## Errors
+ *
+ * - if not `RouteData` is found
+ *
+ * @param {RewritePayload} rewritePayload The payload provided by the user
+ * @param {Request} request The original request
+ */
+ abstract tryRewrite(rewritePayload: RewritePayload, request: Request): Promise<TryRewriteResult>;
+
+ /**
+ * Tells the pipeline how to retrieve a component give a `RouteData`
+ * @param routeData
+ */
+ abstract getComponentByRoute(routeData: RouteData): Promise<ComponentInstance>;
+
+ /**
+ * Resolves the middleware from the manifest, and returns the `onRequest` function. If `onRequest` isn't there,
+ * it returns a no-op function
+ */
+ async getMiddleware(): Promise<MiddlewareHandler> {
+ if (this.resolvedMiddleware) {
+ return this.resolvedMiddleware;
+ } else {
+ const middlewareInstance = await this.middleware();
+ const onRequest = middlewareInstance.onRequest ?? NOOP_MIDDLEWARE_FN;
+ if (this.manifest.checkOrigin) {
+ this.resolvedMiddleware = sequence(createOriginCheckMiddleware(), onRequest);
} else {
- const middlewareInstance = await this.middleware();
- const onRequest = middlewareInstance.onRequest ?? NOOP_MIDDLEWARE_FN;
- if (this.manifest.checkOrigin) {
- this.resolvedMiddleware = sequence(createOriginCheckMiddleware(), onRequest);
- } else {
- this.resolvedMiddleware = onRequest;
- }
- return this.resolvedMiddleware;
+ this.resolvedMiddleware = onRequest;
}
+ return this.resolvedMiddleware;
}
}
+}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface HeadElements extends Pick<SSRResult, 'scripts' | 'styles' | 'links'> {}
diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts
index 1c80f6abe..ec2ac3805 100644
--- a/packages/astro/src/core/config/schema.ts
+++ b/packages/astro/src/core/config/schema.ts
@@ -660,10 +660,14 @@ export function createRelativeSchema(cmd: string, fileProtocolRoot: string) {
// Handle `base` and `image.endpoint.route` trailing slash based on `trailingSlash` config
if (config.trailingSlash === 'never') {
config.base = prependForwardSlash(removeTrailingForwardSlash(config.base));
- config.image.endpoint.route = prependForwardSlash(removeTrailingForwardSlash(config.image.endpoint.route));
+ config.image.endpoint.route = prependForwardSlash(
+ removeTrailingForwardSlash(config.image.endpoint.route),
+ );
} else if (config.trailingSlash === 'always') {
config.base = prependForwardSlash(appendForwardSlash(config.base));
- config.image.endpoint.route = prependForwardSlash(appendForwardSlash(config.image.endpoint.route));
+ config.image.endpoint.route = prependForwardSlash(
+ appendForwardSlash(config.image.endpoint.route),
+ );
} else {
config.base = prependForwardSlash(config.base);
config.image.endpoint.route = prependForwardSlash(config.image.endpoint.route);
diff --git a/packages/astro/src/core/middleware/noop-middleware.ts b/packages/astro/src/core/middleware/noop-middleware.ts
index 2f55962d1..ebb7c1b34 100644
--- a/packages/astro/src/core/middleware/noop-middleware.ts
+++ b/packages/astro/src/core/middleware/noop-middleware.ts
@@ -1,3 +1,3 @@
-import type { MiddlewareHandler } from "../../types/public/common.js";
+import type { MiddlewareHandler } from '../../types/public/common.js';
export const NOOP_MIDDLEWARE_FN: MiddlewareHandler = (_, next) => next();
diff --git a/packages/astro/src/core/routing/manifest/generator.ts b/packages/astro/src/core/routing/manifest/generator.ts
index d6ed25b44..9674a862e 100644
--- a/packages/astro/src/core/routing/manifest/generator.ts
+++ b/packages/astro/src/core/routing/manifest/generator.ts
@@ -1,5 +1,5 @@
-import type { AstroConfig } from "../../../types/public/config.js";
-import type { RoutePart } from "../../../types/public/internal.js";
+import type { AstroConfig } from '../../../types/public/config.js';
+import type { RoutePart } from '../../../types/public/internal.js';
/**
* Sanitizes the parameters object by normalizing string values and replacing certain characters with their URL-encoded equivalents.
diff --git a/packages/astro/test/core-image.test.js b/packages/astro/test/core-image.test.js
index 379b18b73..d0fa7775e 100644
--- a/packages/astro/test/core-image.test.js
+++ b/packages/astro/test/core-image.test.js
@@ -1273,7 +1273,7 @@ describe('astro:image', () => {
const src = $('#local img').attr('src');
assert.equal(src.startsWith('/_image/?'), true);
- })
+ });
it('does not includes a trailing slash if trailing slash is set to never', async () => {
fixture = await loadFixture({
@@ -1292,10 +1292,10 @@ describe('astro:image', () => {
const src = $('#local img').attr('src');
assert.equal(src.startsWith('/_image?'), true);
- })
+ });
afterEach(async () => {
await devServer.stop();
});
- })
+ });
});
diff --git a/packages/integrations/svelte/CHANGELOG.md b/packages/integrations/svelte/CHANGELOG.md
index 528b7363c..5c0b4c515 100644
--- a/packages/integrations/svelte/CHANGELOG.md
+++ b/packages/integrations/svelte/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/svelte
+## 6.0.0-beta.0
+
+### Major Changes
+
+- [#12060](https://github.com/withastro/astro/pull/12060) [`cb5d3ae`](https://github.com/withastro/astro/commit/cb5d3ae6ee6af646c9d7d46a9d8f551edac3092e) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates peer dependency range to support Astro 5
+
## 6.0.0-alpha.0
### Patch Changes
diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json
index 7241dbc6a..8a194d9e3 100644
--- a/packages/integrations/svelte/package.json
+++ b/packages/integrations/svelte/package.json
@@ -1,6 +1,6 @@
{
"name": "@astrojs/svelte",
- "version": "5.7.1",
+ "version": "6.0.0-beta.0",
"description": "Use Svelte components within Astro",
"type": "module",
"types": "./dist/index.d.ts",
diff --git a/packages/integrations/vue/CHANGELOG.md b/packages/integrations/vue/CHANGELOG.md
index a6fbc1ca6..453aa2ecc 100644
--- a/packages/integrations/vue/CHANGELOG.md
+++ b/packages/integrations/vue/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/vue
+## 5.0.0-beta.0
+
+### Major Changes
+
+- [#12060](https://github.com/withastro/astro/pull/12060) [`cb5d3ae`](https://github.com/withastro/astro/commit/cb5d3ae6ee6af646c9d7d46a9d8f551edac3092e) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates peer dependency range to support Astro 5
+
## 5.0.0-alpha.0
### Patch Changes
diff --git a/packages/integrations/vue/package.json b/packages/integrations/vue/package.json
index eb723f8fb..8b78c2a98 100644
--- a/packages/integrations/vue/package.json
+++ b/packages/integrations/vue/package.json
@@ -1,6 +1,6 @@
{
"name": "@astrojs/vue",
- "version": "4.5.1",
+ "version": "5.0.0-beta.0",
"description": "Use Vue components within Astro",
"type": "module",
"types": "./dist/index.d.ts",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7096c4ff5..1eabbc7f7 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -113,7 +113,7 @@ importers:
examples/basics:
dependencies:
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/blog:
@@ -128,13 +128,13 @@ importers:
specifier: ^3.1.6
version: link:../../packages/integrations/sitemap
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/component:
devDependencies:
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/container-with-vitest:
@@ -143,7 +143,7 @@ importers:
specifier: ^3.6.2
version: link:../../packages/integrations/react
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
react:
specifier: ^18.3.1
@@ -174,7 +174,7 @@ importers:
specifier: ^3.14.1
version: 3.14.1
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/framework-multiple:
@@ -186,13 +186,13 @@ importers:
specifier: ^3.6.2
version: link:../../packages/integrations/react
'@astrojs/solid-js':
- specifier: ^4.4.1
+ specifier: ^4.4.2
version: link:../../packages/integrations/solid
'@astrojs/svelte':
- specifier: ^5.7.0
+ specifier: ^6.0.0-beta.0
version: link:../../packages/integrations/svelte
'@astrojs/vue':
- specifier: ^4.5.0
+ specifier: ^5.0.0-beta.0
version: link:../../packages/integrations/vue
'@types/react':
specifier: ^18.3.3
@@ -201,7 +201,7 @@ importers:
specifier: ^18.3.0
version: 18.3.0
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
preact:
specifier: ^10.23.2
@@ -231,7 +231,7 @@ importers:
specifier: ^1.3.0
version: 1.3.0(preact@10.23.2)
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
preact:
specifier: ^10.23.2
@@ -249,7 +249,7 @@ importers:
specifier: ^18.3.0
version: 18.3.0
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
react:
specifier: ^18.3.1
@@ -264,7 +264,7 @@ importers:
specifier: ^4.4.2
version: link:../../packages/integrations/solid
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
solid-js:
specifier: ^1.8.22
@@ -273,10 +273,10 @@ importers:
examples/framework-svelte:
dependencies:
'@astrojs/svelte':
- specifier: ^5.7.1
+ specifier: ^6.0.0-beta.0
version: link:../../packages/integrations/svelte
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
svelte:
specifier: ^4.2.19
@@ -285,10 +285,10 @@ importers:
examples/framework-vue:
dependencies:
'@astrojs/vue':
- specifier: ^4.5.1
+ specifier: ^5.0.0-beta.0
version: link:../../packages/integrations/vue
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
vue:
specifier: ^3.5.3
@@ -300,13 +300,13 @@ importers:
specifier: ^9.0.0-alpha.1
version: 9.0.0-alpha.1(astro@packages+astro)
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/integration:
devDependencies:
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/middleware:
@@ -315,7 +315,7 @@ importers:
specifier: ^9.0.0-alpha.1
version: 9.0.0-alpha.1(astro@packages+astro)
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
html-minifier:
specifier: ^4.0.0
@@ -328,19 +328,19 @@ importers:
examples/minimal:
dependencies:
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/non-html-pages:
dependencies:
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/portfolio:
dependencies:
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/server-islands:
@@ -367,7 +367,7 @@ importers:
specifier: ^18.3.0
version: 18.3.0
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
postcss:
specifier: ^8.4.45
@@ -388,10 +388,10 @@ importers:
specifier: ^9.0.0-alpha.1
version: 9.0.0-alpha.1(astro@packages+astro)
'@astrojs/svelte':
- specifier: ^5.7.0
+ specifier: ^6.0.0-beta.0
version: link:../../packages/integrations/svelte
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
svelte:
specifier: ^4.2.19
@@ -400,7 +400,7 @@ importers:
examples/starlog:
dependencies:
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
sass:
specifier: ^1.78.0
@@ -412,7 +412,7 @@ importers:
examples/toolbar-app:
devDependencies:
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/view-transitions:
@@ -424,7 +424,7 @@ importers:
specifier: ^5.1.1
version: link:../../packages/integrations/tailwind
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/with-markdoc:
@@ -433,7 +433,7 @@ importers:
specifier: ^0.11.5-beta.0
version: link:../../packages/integrations/markdoc
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/with-markdown-plugins:
@@ -442,7 +442,7 @@ importers:
specifier: ^6.0.0-beta.1
version: link:../../packages/markdown/remark
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
hast-util-select:
specifier: ^6.0.2
@@ -463,7 +463,7 @@ importers:
examples/with-markdown-shiki:
dependencies:
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
examples/with-mdx:
@@ -475,7 +475,7 @@ importers:
specifier: ^3.5.3
version: link:../../packages/integrations/preact
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
preact:
specifier: ^10.23.2
@@ -490,7 +490,7 @@ importers:
specifier: ^0.5.2
version: 0.5.2(nanostores@0.11.3)(preact@10.23.2)
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
nanostores:
specifier: ^0.11.3
@@ -511,7 +511,7 @@ importers:
specifier: ^1.6.4
version: 1.6.4
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
autoprefixer:
specifier: ^10.4.20
@@ -529,7 +529,7 @@ importers:
examples/with-vitest:
dependencies:
astro:
- specifier: ^5.0.0-beta.1
+ specifier: ^5.0.0-beta.2
version: link:../../packages/astro
vitest:
specifier: ^2.0.5