diff --git a/benchmark/package.json b/benchmark/package.json
index 13bd303b1ca4..003a9f2d2d62 100644
--- a/benchmark/package.json
+++ b/benchmark/package.json
@@ -17,6 +17,6 @@
"port-authority": "^2.0.1",
"pretty-bytes": "^6.1.1",
"sharp": "^0.33.3",
- "tinyexec": "^0.3.0"
+ "tinyexec": "^0.3.1"
}
}
diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json
index 408dabaae179..cfa39e0ac3f6 100644
--- a/examples/framework-alpine/package.json
+++ b/examples/framework-alpine/package.json
@@ -12,7 +12,7 @@
"dependencies": {
"@astrojs/alpinejs": "^0.4.0",
"@types/alpinejs": "^3.13.10",
- "alpinejs": "^3.14.1",
+ "alpinejs": "^3.14.3",
"astro": "^5.0.0-beta.5"
}
}
diff --git a/examples/starlog/package.json b/examples/starlog/package.json
index d2d01541c98d..42f8625e8d52 100644
--- a/examples/starlog/package.json
+++ b/examples/starlog/package.json
@@ -10,7 +10,7 @@
},
"dependencies": {
"astro": "^5.0.0-beta.5",
- "sass": "^1.79.5",
+ "sass": "^1.80.3",
"sharp": "^0.33.3"
}
}
diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json
index 05e8c2b4b61c..84e659cc70a1 100644
--- a/examples/with-tailwindcss/package.json
+++ b/examples/with-tailwindcss/package.json
@@ -17,6 +17,6 @@
"autoprefixer": "^10.4.20",
"canvas-confetti": "^1.9.3",
"postcss": "^8.4.47",
- "tailwindcss": "^3.4.13"
+ "tailwindcss": "^3.4.14"
}
}
diff --git a/package.json b/package.json
index d6d9bac89a37..0607c19b7181 100644
--- a/package.json
+++ b/package.json
@@ -59,15 +59,15 @@
"@changesets/cli": "^2.27.9",
"@types/node": "^18.17.8",
"esbuild": "^0.21.5",
- "eslint": "^9.12.0",
+ "eslint": "^9.13.0",
"eslint-plugin-regexp": "^2.6.0",
"globby": "^14.0.2",
"only-allow": "^1.2.1",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
- "turbo": "^2.1.3",
+ "turbo": "^2.2.3",
"typescript": "~5.6.3",
- "typescript-eslint": "^8.9.0"
+ "typescript-eslint": "^8.11.0"
},
"pnpm": {
"overrides": {
diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md
index b80e1f62106f..9091dcec4931 100644
--- a/packages/astro/CHANGELOG.md
+++ b/packages/astro/CHANGELOG.md
@@ -1062,6 +1062,22 @@
- Updated dependencies [[`83a2a64`](https://github.com/withastro/astro/commit/83a2a648418ad30f4eb781d1c1b5f2d8a8ac846e)]:
- @astrojs/markdown-remark@6.0.0-alpha.0
+## 4.16.7
+
+### Patch Changes
+
+- [#12263](https://github.com/withastro/astro/pull/12263) [`e9e8080`](https://github.com/withastro/astro/commit/e9e8080a8139f898dcfa3c030f5ddaa98413c160) Thanks [@Fryuni](https://github.com/Fryuni)! - Fixes conflict between server islands and on-demand dynamic routes in the form of `/[...rest]` or `/[paramA]/[paramB]`.
+
+- [#12279](https://github.com/withastro/astro/pull/12279) [`b781f88`](https://github.com/withastro/astro/commit/b781f8860c7d11e51fb60a0d6528bc88913ffc35) Thanks [@jsparkdev](https://github.com/jsparkdev)! - Update wrong error message
+
+- [#12273](https://github.com/withastro/astro/pull/12273) [`c2ee963`](https://github.com/withastro/astro/commit/c2ee963cb6c0a65481be505848a7272d800f2f7b) Thanks [@ascorbic](https://github.com/ascorbic)! - Fixes an issue with some package managers where sites would not build if TypeScript was not installed.
+
+- [#12235](https://github.com/withastro/astro/pull/12235) [`a75bc5e`](https://github.com/withastro/astro/commit/a75bc5e3068ed80366a03efbec78b3b0f8837516) Thanks [@ematipico](https://github.com/ematipico)! - Fixes a bug where Astro Actions couldn't redirect to the correct pathname when there was a rewrite involved.
+
+- [#11839](https://github.com/withastro/astro/pull/11839) [`ff522b9`](https://github.com/withastro/astro/commit/ff522b96a01391a29b44f820dfcc2a2176d871e7) Thanks [@icaliman](https://github.com/icaliman)! - Fixes error when returning a top-level `null` from an Astro file frontmatter
+
+- [#12272](https://github.com/withastro/astro/pull/12272) [`388d237`](https://github.com/withastro/astro/commit/388d2375b6900e6401e1c711087ee0b2176418dd) Thanks [@ascorbic](https://github.com/ascorbic)! - Correctly handles local images when using a base path in SSR
+
## 4.16.6
### Patch Changes
diff --git a/packages/astro/e2e/actions-blog.test.js b/packages/astro/e2e/actions-blog.test.js
index a39c1d24376c..a8d9a7fc67b9 100644
--- a/packages/astro/e2e/actions-blog.test.js
+++ b/packages/astro/e2e/actions-blog.test.js
@@ -155,8 +155,7 @@ test.describe('Astro Actions - Blog', () => {
await expect(page).toHaveURL(astro.resolveUrl('/blog/'));
});
- // TODO: fix regression #12201 and #12202
- test.skip('Should redirect to the origin pathname when there is a rewrite', async ({
+ test('Should redirect to the origin pathname when there is a rewrite', async ({
page,
astro,
}) => {
diff --git a/packages/astro/e2e/fixtures/error-sass/package.json b/packages/astro/e2e/fixtures/error-sass/package.json
index c65c48e5fc59..e2828c7cbffc 100644
--- a/packages/astro/e2e/fixtures/error-sass/package.json
+++ b/packages/astro/e2e/fixtures/error-sass/package.json
@@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"astro": "workspace:*",
- "sass": "^1.79.5"
+ "sass": "^1.80.3"
}
}
diff --git a/packages/astro/e2e/fixtures/errors/package.json b/packages/astro/e2e/fixtures/errors/package.json
index 5a4ccd247809..3d0545ac3933 100644
--- a/packages/astro/e2e/fixtures/errors/package.json
+++ b/packages/astro/e2e/fixtures/errors/package.json
@@ -12,7 +12,7 @@
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
- "sass": "^1.79.5",
+ "sass": "^1.80.3",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.12"
diff --git a/packages/astro/e2e/fixtures/hmr/package.json b/packages/astro/e2e/fixtures/hmr/package.json
index 8f40a00f2573..25adc06b814d 100644
--- a/packages/astro/e2e/fixtures/hmr/package.json
+++ b/packages/astro/e2e/fixtures/hmr/package.json
@@ -4,6 +4,6 @@
"private": true,
"devDependencies": {
"astro": "workspace:*",
- "sass": "^1.79.5"
+ "sass": "^1.80.3"
}
}
diff --git a/packages/astro/e2e/fixtures/server-islands/src/pages/[conflicting]/[dynamicRoute].astro b/packages/astro/e2e/fixtures/server-islands/src/pages/[conflicting]/[dynamicRoute].astro
new file mode 100644
index 000000000000..d5ac0379ec76
--- /dev/null
+++ b/packages/astro/e2e/fixtures/server-islands/src/pages/[conflicting]/[dynamicRoute].astro
@@ -0,0 +1,14 @@
+---
+export const prerender = false;
+---
+
+
+
+ Conflicting route
+
+
+ This route would conflict with the route generated for server islands.
+
+ This file is here so the tests break if that happens.
+
+
diff --git a/packages/astro/e2e/fixtures/tailwindcss/package.json b/packages/astro/e2e/fixtures/tailwindcss/package.json
index df36474dc43b..5435bbc3420d 100644
--- a/packages/astro/e2e/fixtures/tailwindcss/package.json
+++ b/packages/astro/e2e/fixtures/tailwindcss/package.json
@@ -7,6 +7,6 @@
"astro": "workspace:*",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47",
- "tailwindcss": "^3.4.13"
+ "tailwindcss": "^3.4.14"
}
}
diff --git a/packages/astro/package.json b/packages/astro/package.json
index 663b7cd38e8a..303c40ee7a9b 100644
--- a/packages/astro/package.json
+++ b/packages/astro/package.json
@@ -124,7 +124,7 @@
"@oslojs/encoding": "^1.1.0",
"@rollup/pluginutils": "^5.1.2",
"@types/cookie": "^0.6.0",
- "acorn": "^8.12.1",
+ "acorn": "^8.13.0",
"aria-query": "^5.3.2",
"axobject-query": "^4.1.0",
"boxen": "8.0.1",
@@ -161,7 +161,7 @@
"rehype": "^13.0.2",
"semver": "^7.6.3",
"shiki": "^1.22.0",
- "tinyexec": "^0.3.0",
+ "tinyexec": "^0.3.1",
"tsconfck": "^3.1.4",
"unist-util-visit": "^5.0.0",
"vfile": "^6.0.3",
@@ -180,7 +180,7 @@
},
"devDependencies": {
"@astrojs/check": "^0.9.4",
- "@playwright/test": "^1.48.0",
+ "@playwright/test": "^1.48.1",
"@types/aria-query": "^5.0.4",
"@types/common-ancestor-path": "^1.0.2",
"@types/cssesc": "^3.0.2",
@@ -210,7 +210,7 @@
"rehype-toc": "^3.0.2",
"remark-code-titles": "^0.1.2",
"rollup": "^4.24.0",
- "sass": "^1.79.5",
+ "sass": "^1.80.3",
"undici": "^6.20.1",
"unified": "^11.0.5",
"vitest": "^2.1.1"
diff --git a/packages/astro/src/actions/runtime/middleware.ts b/packages/astro/src/actions/runtime/middleware.ts
index f6a9432f77c1..6ccc40f88630 100644
--- a/packages/astro/src/actions/runtime/middleware.ts
+++ b/packages/astro/src/actions/runtime/middleware.ts
@@ -1,6 +1,7 @@
import { decodeBase64, encodeBase64 } from '@oslojs/encoding';
import { yellow } from 'kleur/colors';
import { defineMiddleware } from '../../core/middleware/index.js';
+import { getOriginPathname } from '../../core/routing/rewrite.js';
import type { MiddlewareNext } from '../../types/public/common.js';
import type { APIContext } from '../../types/public/context.js';
import { ACTION_QUERY_PARAMS } from '../consts.js';
@@ -29,7 +30,7 @@ export const onRequest = defineMiddleware(async (context, next) => {
if (context.request.method === 'POST') {
console.warn(
yellow('[astro:actions]'),
- 'POST requests should not be sent to prerendered pages. If you\'re using Actions, disable prerendering with `export const prerender = "false".',
+ "POST requests should not be sent to prerendered pages. If you're using Actions, disable prerendering with `export const prerender = false`.",
);
}
return next();
@@ -147,6 +148,11 @@ async function redirectWithResult({
return context.redirect(referer);
}
+ const referer = getOriginPathname(context.request);
+ if (referer) {
+ return context.redirect(referer);
+ }
+
return context.redirect(context.url.pathname);
}
diff --git a/packages/astro/src/assets/endpoint/node.ts b/packages/astro/src/assets/endpoint/node.ts
index 4312e28cb3e7..4b18deb38202 100644
--- a/packages/astro/src/assets/endpoint/node.ts
+++ b/packages/astro/src/assets/endpoint/node.ts
@@ -24,6 +24,12 @@ async function loadLocalImage(src: string, url: URL) {
fileUrl = pathToFileURL(removeQueryString(replaceFileSystemReferences(src)));
} else {
try {
+ // If the _image segment isn't at the start of the path, we have a base
+ const idx = url.pathname.indexOf('/_image');
+ if (idx > 0) {
+ // Remove the base path
+ src = src.slice(idx);
+ }
fileUrl = new URL('.' + src, outDir);
const filePath = fileURLToPath(fileUrl);
diff --git a/packages/astro/src/content/types-generator.ts b/packages/astro/src/content/types-generator.ts
index 9ede0ab669eb..12b54483bd58 100644
--- a/packages/astro/src/content/types-generator.ts
+++ b/packages/astro/src/content/types-generator.ts
@@ -6,7 +6,6 @@ import { bold, cyan } from 'kleur/colors';
import { type ViteDevServer, normalizePath } from 'vite';
import { type ZodSchema, z } from 'zod';
import { zodToJsonSchema } from 'zod-to-json-schema';
-import { printNode, zodToTs } from 'zod-to-ts';
import { AstroError } from '../core/errors/errors.js';
import { AstroErrorData } from '../core/errors/index.js';
import type { Logger } from '../core/logger/core.js';
@@ -402,8 +401,17 @@ async function typeForCollection(
if (collection?.type === CONTENT_LAYER_TYPE) {
const schema = await getContentLayerSchema(collection, collectionKey);
if (schema) {
- const ast = zodToTs(schema);
- return printNode(ast.node);
+ try {
+ const zodToTs = await import('zod-to-ts');
+ const ast = zodToTs.zodToTs(schema);
+ return zodToTs.printNode(ast.node);
+ } catch (err: any) {
+ // zod-to-ts is sad if we don't have TypeScript installed, but that's fine as we won't be needing types in that case
+ if (err.message.includes("Cannot find package 'typescript'")) {
+ return 'any';
+ }
+ throw err;
+ }
}
}
return 'any';
diff --git a/packages/astro/src/core/app/node.ts b/packages/astro/src/core/app/node.ts
index 1ca90ab26ac1..f7e9fd1f5a23 100644
--- a/packages/astro/src/core/app/node.ts
+++ b/packages/astro/src/core/app/node.ts
@@ -2,6 +2,7 @@ import fs from 'node:fs';
import type { IncomingMessage, ServerResponse } from 'node:http';
import { Http2ServerResponse } from 'node:http2';
import type { RouteData } from '../../types/public/internal.js';
+import { clientAddressSymbol } from '../constants.js';
import { deserializeManifest } from './common.js';
import { createOutgoingHttpHeaders } from './createOutgoingHttpHeaders.js';
import { App } from './index.js';
@@ -10,8 +11,6 @@ import type { SSRManifest, SerializedSSRManifest } from './types.js';
export { apply as applyPolyfills } from '../polyfill.js';
-const clientAddressSymbol = Symbol.for('astro.clientAddress');
-
/**
* Allow the request body to be explicitly overridden. For example, this
* is used by the Express JSON middleware.
diff --git a/packages/astro/src/core/constants.ts b/packages/astro/src/core/constants.ts
index 274f86797077..6183e155721c 100644
--- a/packages/astro/src/core/constants.ts
+++ b/packages/astro/src/core/constants.ts
@@ -28,6 +28,7 @@ export const REROUTE_DIRECTIVE_HEADER = 'X-Astro-Reroute';
* This metadata is used to determine the origin of a Response. If a rewrite has occurred, it should be prioritised over other logic.
*/
export const REWRITE_DIRECTIVE_HEADER_KEY = 'X-Astro-Rewrite';
+
export const REWRITE_DIRECTIVE_HEADER_VALUE = 'yes';
/**
@@ -68,6 +69,11 @@ export const clientAddressSymbol = Symbol.for('astro.clientAddress');
*/
export const clientLocalsSymbol = Symbol.for('astro.locals');
+/**
+ * Use this symbol to set and retrieve the original pathname of a request. This is useful when working with redirects and rewrites
+ */
+export const originPathnameSymbol = Symbol.for('astro.originPathname');
+
/**
* The symbol used as a field on the response object to keep track of streaming.
*
diff --git a/packages/astro/src/core/render-context.ts b/packages/astro/src/core/render-context.ts
index 387028c4823f..a4f2b260003a 100644
--- a/packages/astro/src/core/render-context.ts
+++ b/packages/astro/src/core/render-context.ts
@@ -28,6 +28,7 @@ import { callMiddleware } from './middleware/callMiddleware.js';
import { sequence } from './middleware/index.js';
import { renderRedirect } from './redirects/render.js';
import { type Pipeline, Slots, getParams, getProps } from './render/index.js';
+import { copyRequest, setOriginPathname } from './routing/rewrite.js';
export const apiContextRoutesSymbol = Symbol.for('context.routes');
@@ -75,6 +76,7 @@ export class RenderContext {
Pick
>): Promise {
const pipelineMiddleware = await pipeline.getMiddleware();
+ setOriginPathname(request, pathname);
return new RenderContext(
pipeline,
locals,
@@ -147,7 +149,7 @@ export class RenderContext {
if (payload instanceof Request) {
this.request = payload;
} else {
- this.request = this.#copyRequest(newUrl, this.request);
+ this.request = copyRequest(newUrl, this.request);
}
this.isRewriting = true;
this.url = new URL(this.request.url);
@@ -247,7 +249,7 @@ export class RenderContext {
if (reroutePayload instanceof Request) {
this.request = reroutePayload;
} else {
- this.request = this.#copyRequest(newUrl, this.request);
+ this.request = copyRequest(newUrl, this.request);
}
this.url = new URL(this.request.url);
this.cookies = new AstroCookies(this.request);
@@ -555,33 +557,4 @@ export class RenderContext {
if (!i18n) return;
return (this.#preferredLocaleList ??= computePreferredLocaleList(request, i18n.locales));
}
-
- /**
- * Utility function that creates a new `Request` with a new URL from an old `Request`.
- *
- * @param newUrl The new `URL`
- * @param oldRequest The old `Request`
- */
- #copyRequest(newUrl: URL, oldRequest: Request): Request {
- if (oldRequest.bodyUsed) {
- throw new AstroError(AstroErrorData.RewriteWithBodyUsed);
- }
- return new Request(newUrl, {
- method: oldRequest.method,
- headers: oldRequest.headers,
- body: oldRequest.body,
- referrer: oldRequest.referrer,
- referrerPolicy: oldRequest.referrerPolicy,
- mode: oldRequest.mode,
- credentials: oldRequest.credentials,
- cache: oldRequest.cache,
- redirect: oldRequest.redirect,
- integrity: oldRequest.integrity,
- signal: oldRequest.signal,
- keepalive: oldRequest.keepalive,
- // https://fetch.spec.whatwg.org/#dom-request-duplex
- // @ts-expect-error It isn't part of the types, but undici accepts it and it allows to carry over the body to a new request
- duplex: 'half',
- });
- }
}
diff --git a/packages/astro/src/core/routing/rewrite.ts b/packages/astro/src/core/routing/rewrite.ts
index 3ad6a9bd2f2d..cb23060374f9 100644
--- a/packages/astro/src/core/routing/rewrite.ts
+++ b/packages/astro/src/core/routing/rewrite.ts
@@ -2,6 +2,8 @@ import type { RewritePayload } from '../../types/public/common.js';
import type { AstroConfig } from '../../types/public/config.js';
import type { RouteData } from '../../types/public/internal.js';
import { shouldAppendForwardSlash } from '../build/util.js';
+import { originPathnameSymbol } from '../constants.js';
+import { AstroError, AstroErrorData } from '../errors/index.js';
import { appendForwardSlash, removeTrailingForwardSlash } from '../path.js';
import { DEFAULT_404_ROUTE } from './astro-designed-error-pages.js';
@@ -72,3 +74,44 @@ export function findRouteToRewrite({
}
}
}
+
+/**
+ * Utility function that creates a new `Request` with a new URL from an old `Request`.
+ *
+ * @param newUrl The new `URL`
+ * @param oldRequest The old `Request`
+ */
+export function copyRequest(newUrl: URL, oldRequest: Request): Request {
+ if (oldRequest.bodyUsed) {
+ throw new AstroError(AstroErrorData.RewriteWithBodyUsed);
+ }
+ return new Request(newUrl, {
+ method: oldRequest.method,
+ headers: oldRequest.headers,
+ body: oldRequest.body,
+ referrer: oldRequest.referrer,
+ referrerPolicy: oldRequest.referrerPolicy,
+ mode: oldRequest.mode,
+ credentials: oldRequest.credentials,
+ cache: oldRequest.cache,
+ redirect: oldRequest.redirect,
+ integrity: oldRequest.integrity,
+ signal: oldRequest.signal,
+ keepalive: oldRequest.keepalive,
+ // https://fetch.spec.whatwg.org/#dom-request-duplex
+ // @ts-expect-error It isn't part of the types, but undici accepts it and it allows to carry over the body to a new request
+ duplex: 'half',
+ });
+}
+
+export function setOriginPathname(request: Request, pathname: string): void {
+ Reflect.set(request, originPathnameSymbol, encodeURIComponent(pathname));
+}
+
+export function getOriginPathname(request: Request): string | undefined {
+ const origin = Reflect.get(request, originPathnameSymbol);
+ if (origin) {
+ return decodeURIComponent(origin);
+ }
+ return undefined;
+}
diff --git a/packages/astro/src/core/server-islands/endpoint.ts b/packages/astro/src/core/server-islands/endpoint.ts
index 4c04f7a6f554..540f75b843e6 100644
--- a/packages/astro/src/core/server-islands/endpoint.ts
+++ b/packages/astro/src/core/server-islands/endpoint.ts
@@ -40,7 +40,7 @@ export function ensureServerIslandRoute(config: ConfigFields, routeManifest: Man
return;
}
- routeManifest.routes.push(getServerIslandRouteData(config));
+ routeManifest.routes.unshift(getServerIslandRouteData(config));
}
type RenderOptions = {
diff --git a/packages/astro/src/runtime/server/render/astro/head-and-content.ts b/packages/astro/src/runtime/server/render/astro/head-and-content.ts
index eb32c3148e40..e0b566882304 100644
--- a/packages/astro/src/runtime/server/render/astro/head-and-content.ts
+++ b/packages/astro/src/runtime/server/render/astro/head-and-content.ts
@@ -9,7 +9,7 @@ export type HeadAndContent = {
};
export function isHeadAndContent(obj: unknown): obj is HeadAndContent {
- return typeof obj === 'object' && !!(obj as any)[headAndContentSym];
+ return typeof obj === 'object' && obj !== null && !!(obj as any)[headAndContentSym];
}
export function createHeadAndContent(head: string, content: RenderTemplateResult): HeadAndContent {
diff --git a/packages/astro/src/runtime/server/render/astro/instance.ts b/packages/astro/src/runtime/server/render/astro/instance.ts
index 5ea2d5216281..aae13ca9e2b5 100644
--- a/packages/astro/src/runtime/server/render/astro/instance.ts
+++ b/packages/astro/src/runtime/server/render/astro/instance.ts
@@ -101,5 +101,5 @@ export function createAstroComponentInstance(
}
export function isAstroComponentInstance(obj: unknown): obj is AstroComponentInstance {
- return typeof obj === 'object' && !!(obj as any)[astroComponentInstanceSym];
+ return typeof obj === 'object' && obj !== null && !!(obj as any)[astroComponentInstanceSym];
}
diff --git a/packages/astro/src/runtime/server/render/astro/render-template.ts b/packages/astro/src/runtime/server/render/astro/render-template.ts
index 68df865181fb..90d57fe01806 100644
--- a/packages/astro/src/runtime/server/render/astro/render-template.ts
+++ b/packages/astro/src/runtime/server/render/astro/render-template.ts
@@ -57,7 +57,7 @@ export class RenderTemplateResult {
// Determines if a component is an .astro component
export function isRenderTemplateResult(obj: unknown): obj is RenderTemplateResult {
- return typeof obj === 'object' && !!(obj as any)[renderTemplateResultSym];
+ return typeof obj === 'object' && obj !== null && !!(obj as any)[renderTemplateResultSym];
}
export function renderTemplate(htmlParts: TemplateStringsArray, ...expressions: any[]) {
diff --git a/packages/astro/test/core-image.test.js b/packages/astro/test/core-image.test.js
index 04b741a69469..40c405b5cd0b 100644
--- a/packages/astro/test/core-image.test.js
+++ b/packages/astro/test/core-image.test.js
@@ -816,6 +816,7 @@ describe('astro:image', () => {
outDir: './dist/server-base-path',
adapter: testAdapter(),
image: {
+ endpoint: 'astro/assets/endpoint/node',
service: testImageService(),
},
base: '/blog',
@@ -829,6 +830,8 @@ describe('astro:image', () => {
const $ = cheerio.load(html);
const src = $('#local img').attr('src');
assert.equal(src.startsWith('/blog'), true);
+ const img = await app.render(new Request(`https://example.com${src}`));
+ assert.equal(img.status, 200);
});
});
diff --git a/packages/astro/test/fixtures/solid-component/package.json b/packages/astro/test/fixtures/solid-component/package.json
index 700d8b7c8b54..5b961b2b0cd8 100644
--- a/packages/astro/test/fixtures/solid-component/package.json
+++ b/packages/astro/test/fixtures/solid-component/package.json
@@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@astrojs/solid-js": "workspace:*",
- "@solidjs/router": "^0.14.8",
+ "@solidjs/router": "^0.14.10",
"@test/solid-jsx-component": "file:./deps/solid-jsx-component",
"astro": "workspace:*",
"solid-js": "^1.9.2"
diff --git a/packages/astro/test/fixtures/tailwindcss-ts/package.json b/packages/astro/test/fixtures/tailwindcss-ts/package.json
index bf8a625271d4..25c78b3f13af 100644
--- a/packages/astro/test/fixtures/tailwindcss-ts/package.json
+++ b/packages/astro/test/fixtures/tailwindcss-ts/package.json
@@ -6,6 +6,6 @@
"@astrojs/tailwind": "workspace:*",
"astro": "workspace:*",
"postcss": "^8.4.47",
- "tailwindcss": "^3.4.13"
+ "tailwindcss": "^3.4.14"
}
}
diff --git a/packages/astro/test/fixtures/tailwindcss/package.json b/packages/astro/test/fixtures/tailwindcss/package.json
index 1184d8487041..cf1d7a985756 100644
--- a/packages/astro/test/fixtures/tailwindcss/package.json
+++ b/packages/astro/test/fixtures/tailwindcss/package.json
@@ -8,6 +8,6 @@
"astro": "workspace:*",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47",
- "tailwindcss": "^3.4.13"
+ "tailwindcss": "^3.4.14"
}
}
diff --git a/packages/astro/test/units/render/components.test.js b/packages/astro/test/units/render/components.test.js
index 991f0f105238..948adf8e3bb1 100644
--- a/packages/astro/test/units/render/components.test.js
+++ b/packages/astro/test/units/render/components.test.js
@@ -108,4 +108,43 @@ describe('core/render components', () => {
},
);
});
+
+ it('should render component with `null` response', async () => {
+ const fixture = await createFixture({
+ '/src/pages/index.astro': `
+ ---
+ import NullComponent from '../components/NullComponent.astro';
+ ---
+
+ `,
+ '/src/components/NullComponent.astro': `
+ ---
+ return null;
+ ---
+ `,
+ });
+
+ await runInContainer(
+ {
+ inlineConfig: {
+ root: fixture.path,
+ logLevel: 'silent',
+ },
+ },
+ async (container) => {
+ const { req, res, done, text } = createRequestAndResponse({
+ method: 'GET',
+ url: '/',
+ });
+ container.handle(req, res);
+
+ await done;
+ const html = await text();
+ const $ = cheerio.load(html);
+
+ assert.equal($('body').text(), '');
+ assert.equal(res.statusCode, 200);
+ },
+ );
+ });
});
diff --git a/packages/db/CHANGELOG.md b/packages/db/CHANGELOG.md
index cca0da495343..e8165782cb74 100644
--- a/packages/db/CHANGELOG.md
+++ b/packages/db/CHANGELOG.md
@@ -21,6 +21,15 @@
### Patch Changes
+- Updated dependencies []:
+ - @astrojs/studio@0.1.1
+
+## 0.14.3
+
+### Patch Changes
+
+- [#11435](https://github.com/withastro/astro/pull/11435) [`f32a7a8`](https://github.com/withastro/astro/commit/f32a7a83889dd6180b2e4cde9b30286ab6874e49) Thanks [@haivuw](https://github.com/haivuw)! - Fixes a bug where `astro:db:seed` couldn't access to the environment variable `ASTRO_DATABASE_FILE`
+
- Updated dependencies []:
- @astrojs/studio@0.1.1
@@ -34,6 +43,9 @@
- [#12089](https://github.com/withastro/astro/pull/12089) [`6e06e6e`](https://github.com/withastro/astro/commit/6e06e6ed4f1c983f842527d7e3561a45a4407777) Thanks [@Fryuni](https://github.com/Fryuni)! - Fixes relative local libSQL db URL
+- Updated dependencies []:
+ - @astrojs/studio@0.1.1
+
## 0.14.1
### Patch Changes
diff --git a/packages/db/src/core/integration/vite-plugin-db.ts b/packages/db/src/core/integration/vite-plugin-db.ts
index 29e98222ea87..7e10699df70a 100644
--- a/packages/db/src/core/integration/vite-plugin-db.ts
+++ b/packages/db/src/core/integration/vite-plugin-db.ts
@@ -124,12 +124,13 @@ export function getLocalVirtualModContents({
tables: DBTables;
root: URL;
}) {
+ const { ASTRO_DATABASE_FILE } = getAstroEnv();
const dbInfo = getRemoteDatabaseInfo();
const dbUrl = new URL(DB_PATH, root);
return `
import { asDrizzleTable, createLocalDatabaseClient, normalizeDatabaseUrl } from ${RUNTIME_IMPORT};
-const dbUrl = normalizeDatabaseUrl(import.meta.env.ASTRO_DATABASE_FILE, ${JSON.stringify(dbUrl)});
+const dbUrl = normalizeDatabaseUrl(${JSON.stringify(ASTRO_DATABASE_FILE)}, ${JSON.stringify(dbUrl)});
export const db = createLocalDatabaseClient({ dbUrl, enableTransactions: ${dbInfo.url === 'libsql'} });
export * from ${RUNTIME_VIRTUAL_IMPORT};
diff --git a/packages/integrations/alpinejs/package.json b/packages/integrations/alpinejs/package.json
index bc5782b42d00..3f4f818c76db 100644
--- a/packages/integrations/alpinejs/package.json
+++ b/packages/integrations/alpinejs/package.json
@@ -38,7 +38,7 @@
"alpinejs": "^3.0.0"
},
"devDependencies": {
- "@playwright/test": "1.48.0",
+ "@playwright/test": "1.48.1",
"astro": "workspace:*",
"astro-scripts": "workspace:*",
"vite": "6.0.0-beta.2"
diff --git a/packages/integrations/alpinejs/test/fixtures/basics/package.json b/packages/integrations/alpinejs/test/fixtures/basics/package.json
index a632b145e5c8..a7d461a1c997 100644
--- a/packages/integrations/alpinejs/test/fixtures/basics/package.json
+++ b/packages/integrations/alpinejs/test/fixtures/basics/package.json
@@ -5,7 +5,7 @@
"dependencies": {
"@astrojs/alpinejs": "workspace:*",
"@types/alpinejs": "^3.13.10",
- "alpinejs": "^3.14.1",
+ "alpinejs": "^3.14.3",
"astro": "workspace:*"
}
}
diff --git a/packages/integrations/alpinejs/test/fixtures/directive/package.json b/packages/integrations/alpinejs/test/fixtures/directive/package.json
index 7f57664bab54..3ad8aab25e05 100644
--- a/packages/integrations/alpinejs/test/fixtures/directive/package.json
+++ b/packages/integrations/alpinejs/test/fixtures/directive/package.json
@@ -5,7 +5,7 @@
"dependencies": {
"@astrojs/alpinejs": "workspace:*",
"@types/alpinejs": "^3.13.10",
- "alpinejs": "^3.14.1",
+ "alpinejs": "^3.14.3",
"astro": "workspace:*"
}
}
diff --git a/packages/integrations/alpinejs/test/fixtures/plugin-script-import/package.json b/packages/integrations/alpinejs/test/fixtures/plugin-script-import/package.json
index ccc50fc480f9..d5b4889241e6 100644
--- a/packages/integrations/alpinejs/test/fixtures/plugin-script-import/package.json
+++ b/packages/integrations/alpinejs/test/fixtures/plugin-script-import/package.json
@@ -5,7 +5,7 @@
"dependencies": {
"@astrojs/alpinejs": "workspace:*",
"@types/alpinejs": "^3.13.10",
- "alpinejs": "^3.14.1",
+ "alpinejs": "^3.14.3",
"astro": "workspace:*"
}
}
diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json
index 79f0568c1a88..c2333d7ac887 100644
--- a/packages/integrations/mdx/package.json
+++ b/packages/integrations/mdx/package.json
@@ -35,8 +35,8 @@
},
"dependencies": {
"@astrojs/markdown-remark": "workspace:*",
- "@mdx-js/mdx": "^3.0.1",
- "acorn": "^8.12.1",
+ "@mdx-js/mdx": "^3.1.0",
+ "acorn": "^8.13.0",
"es-module-lexer": "^1.5.4",
"estree-util-visit": "^2.0.0",
"hast-util-to-html": "^9.0.3",
diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json
index 0c4a56473b13..03fea9d7c839 100644
--- a/packages/integrations/react/package.json
+++ b/packages/integrations/react/package.json
@@ -55,7 +55,7 @@
"test": "astro-scripts test \"test/**/*.test.js\""
},
"dependencies": {
- "@vitejs/plugin-react": "^4.3.2",
+ "@vitejs/plugin-react": "^4.3.3",
"ultrahtml": "^1.5.3"
},
"devDependencies": {
diff --git a/packages/integrations/tailwind/package.json b/packages/integrations/tailwind/package.json
index 89fffa5ae07e..7bd4ddcf5400 100644
--- a/packages/integrations/tailwind/package.json
+++ b/packages/integrations/tailwind/package.json
@@ -42,7 +42,7 @@
"devDependencies": {
"astro": "workspace:*",
"astro-scripts": "workspace:*",
- "tailwindcss": "^3.4.13",
+ "tailwindcss": "^3.4.14",
"vite": "6.0.0-beta.2"
},
"peerDependencies": {
diff --git a/packages/integrations/vue/package.json b/packages/integrations/vue/package.json
index bc541399a631..76d7934a8f9f 100644
--- a/packages/integrations/vue/package.json
+++ b/packages/integrations/vue/package.json
@@ -48,7 +48,7 @@
"@vitejs/plugin-vue": "^5.1.4",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"@vue/compiler-sfc": "^3.5.12",
- "vite-plugin-vue-devtools": "^7.4.6"
+ "vite-plugin-vue-devtools": "^7.5.2"
},
"devDependencies": {
"astro": "workspace:*",
diff --git a/scripts/package.json b/scripts/package.json
index dfa8b7234cfe..37e10654d3ac 100644
--- a/scripts/package.json
+++ b/scripts/package.json
@@ -13,7 +13,7 @@
"fast-glob": "^3.3.2",
"kleur": "^4.1.5",
"p-limit": "^6.1.0",
- "tinyexec": "^0.3.0",
+ "tinyexec": "^0.3.1",
"tsconfck": "^3.1.4"
}
}