Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^6.1.0"
"astro": "^6.1.1"
}
}
2 changes: 1 addition & 1 deletion examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@astrojs/mdx": "^5.0.3",
"@astrojs/rss": "^4.0.18",
"@astrojs/sitemap": "^3.7.2",
"astro": "^6.1.0",
"astro": "^6.1.1",
"sharp": "^0.34.3"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^6.1.0"
"astro": "^6.1.1"
},
"peerDependencies": {
"astro": "^5.0.0 || ^6.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/container-with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"dependencies": {
"@astrojs/react": "^5.0.2",
"astro": "^6.1.0",
"astro": "^6.1.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vitest": "^4.1.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"@astrojs/alpinejs": "^0.5.0",
"@types/alpinejs": "^3.13.11",
"alpinejs": "^3.15.8",
"astro": "^6.1.0"
"astro": "^6.1.1"
}
}
2 changes: 1 addition & 1 deletion examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@astrojs/vue": "^6.0.1",
"@types/react": "^18.3.28",
"@types/react-dom": "^18.3.7",
"astro": "^6.1.0",
"astro": "^6.1.1",
"preact": "^10.28.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@astrojs/preact": "^5.1.0",
"@preact/signals": "^2.8.1",
"astro": "^6.1.0",
"astro": "^6.1.1",
"preact": "^10.28.4"
}
}
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@astrojs/react": "^5.0.2",
"@types/react": "^18.3.28",
"@types/react-dom": "^18.3.7",
"astro": "^6.1.0",
"astro": "^6.1.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^6.0.1",
"astro": "^6.1.0",
"astro": "^6.1.1",
"solid-js": "^1.9.11"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@astrojs/svelte": "^8.0.4",
"astro": "^6.1.0",
"astro": "^6.1.1",
"svelte": "^5.53.5"
}
}
2 changes: 1 addition & 1 deletion examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@astrojs/vue": "^6.0.1",
"astro": "^6.1.0",
"astro": "^6.1.1",
"vue": "^3.5.29"
}
}
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
},
"dependencies": {
"@astrojs/node": "^10.0.4",
"astro": "^6.1.0"
"astro": "^6.1.1"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^6.1.0"
"astro": "^6.1.1"
},
"peerDependencies": {
"astro": "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^6.1.0"
"astro": "^6.1.1"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^6.1.0"
"astro": "^6.1.1"
}
}
2 changes: 1 addition & 1 deletion examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dependencies": {
"@astrojs/node": "^10.0.4",
"@astrojs/svelte": "^8.0.4",
"astro": "^6.1.0",
"astro": "^6.1.1",
"svelte": "^5.53.5"
}
}
2 changes: 1 addition & 1 deletion examples/starlog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^6.1.0",
"astro": "^6.1.1",
"sass": "^1.97.3",
"sharp": "^0.34.3"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/toolbar-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@types/node": "^18.17.8",
"astro": "^6.1.0"
"astro": "^6.1.1"
},
"engines": {
"node": ">=22.12.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^1.0.3",
"astro": "^6.1.0"
"astro": "^6.1.1"
}
}
2 changes: 1 addition & 1 deletion examples/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@astrojs/mdx": "^5.0.3",
"@astrojs/preact": "^5.1.0",
"astro": "^6.1.0",
"astro": "^6.1.1",
"preact": "^10.28.4"
}
}
2 changes: 1 addition & 1 deletion examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@astrojs/preact": "^5.1.0",
"@nanostores/preact": "^1.0.0",
"astro": "^6.1.0",
"astro": "^6.1.1",
"nanostores": "^1.1.1",
"preact": "^10.28.4"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@astrojs/mdx": "^5.0.3",
"@tailwindcss/vite": "^4.2.1",
"@types/canvas-confetti": "^1.9.0",
"astro": "^6.1.0",
"astro": "^6.1.1",
"canvas-confetti": "^1.9.4",
"tailwindcss": "^4.2.1"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^6.1.0",
"astro": "^6.1.1",
"vitest": "^4.1.0"
}
}
8 changes: 8 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# astro

## 6.1.1

### Patch Changes

- [#16105](https://github.com/withastro/astro/pull/16105) [`23d60de`](https://github.com/withastro/astro/commit/23d60dee6eae3d7148ef87f8b44c3d7470fef0ed) Thanks [@matthewp](https://github.com/matthewp)! - Fix dev toolbar audit crash when encountering the `image` ARIA role

- [#16089](https://github.com/withastro/astro/pull/16089) [`999c875`](https://github.com/withastro/astro/commit/999c875da5914735458e0939be8a2be2e012e580) Thanks [@martrapp](https://github.com/martrapp)! - Fixes an issue with the client router where Vue's `:deep()` notation was ignored in dev mode.

## 6.1.0

### Minor Changes
Expand Down
17 changes: 17 additions & 0 deletions packages/astro/e2e/view-transitions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1821,4 +1821,21 @@ test.describe('View Transitions', () => {
await expect(page.locator('#style')).toHaveCount(1);
await expect(page.locator('#preload')).toHaveCount(1);
});

test('Styles with data-vite-dev-id persist through head swap', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/island-vue-one'));
let cnt = page.locator('.counter pre');
await expect(cnt).toHaveText('AA0');
await page
.locator('[data-vite-dev-id*="VueCounter.vue?vue&type=style"]')
.evaluate((el) => (el.dataset.marker = 'this'), undefined);
await page.click('#click-two');
const p = page.locator('#island-two');
await expect(p).toBeVisible();
cnt = page.locator('.counter pre');
await expect(cnt).toHaveText('BB0');
await expect(
page.locator('[data-vite-dev-id*="VueCounter.vue?vue&type=style"][data-marker="this"]'),
).toHaveCount(1);
});
});
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro",
"version": "6.1.0",
"version": "6.1.1",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,9 @@ export const a11y: AuditRuleWithSelector[] = [

const elementRoles = role.split(WHITESPACE_REGEX) as ARIARoleDefinitionKey[];
for (const elementRole of elementRoles) {
const { requiredProps } = roles.get(elementRole)!;
const roleData = roles.get(normalizeAriaRole(elementRole));
if (!roleData) continue;
const { requiredProps } = roleData;
const required_role_props = Object.keys(requiredProps);
const missingProps = required_role_props.filter((prop) => !element.hasAttribute(prop));
if (missingProps.length > 0) {
Expand Down Expand Up @@ -575,7 +577,9 @@ export const a11y: AuditRuleWithSelector[] = [

const elementRoles = role.split(WHITESPACE_REGEX) as ARIARoleDefinitionKey[];
for (const elementRole of elementRoles) {
const { props } = roles.get(elementRole)!;
const roleData = roles.get(normalizeAriaRole(elementRole));
if (!roleData) continue;
const { props } = roleData;
const attributes = getAttributeObject(element);
const unsupportedAttributes = aria.keys().filter((attribute) => !(attribute in props));
const invalidAttributes: string[] = Object.keys(attributes).filter(
Expand Down Expand Up @@ -654,6 +658,18 @@ function menuitem_implicit_role(attributes: Record<string, string>) {
return menuitem_type_to_implicit_role.get(type);
}

// Some ARIA role names used in the spec (and by browsers) differ from the keys
// used in aria-query's roles map. This map normalizes those mismatches so that
// roles.get() lookups succeed. For example, WAI-ARIA 1.2 uses "image" but
// aria-query only has "img".
const ariaQueryRoleAliases: Partial<Record<string, ARIARoleDefinitionKey>> = {
image: 'img',
};

function normalizeAriaRole(role: string): ARIARoleDefinitionKey {
return (ariaQueryRoleAliases[role] ?? role) as ARIARoleDefinitionKey;
}

function getRole(element: Element): ARIARoleDefinitionKey | undefined {
if (element.hasAttribute('role')) {
return element.getAttribute('role')! as ARIARoleDefinitionKey;
Expand Down
10 changes: 10 additions & 0 deletions packages/astro/src/transitions/swap-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ const persistedHeadElement = (el: HTMLElement, newDoc: Document): Element | null
const href = el.getAttribute('href');
return newDoc.head.querySelector(`link[rel=stylesheet][href="${href}"]`);
}
// In dev mode, Vite injects <style data-vite-dev-id="..."> elements whose
// textContent is later transformed by HMR (e.g. Vue's `:deep()` → `[data-v-xxx]`).
// Match these by their stable dev ID so the already-transformed style is preserved
// across ClientRouter soft navigations instead of being replaced by the raw version.
if (import.meta.env.DEV && el.tagName === 'STYLE') {
const viteDevId = el.getAttribute('data-vite-dev-id');
if (viteDevId) {
return newDoc.head.querySelector(`style[data-vite-dev-id="${viteDevId}"]`);
}
}
// Preserve inline <style> elements with identical content across navigations.
// This prevents unnecessary removal and re-insertion of styles (e.g. @font-face
// declarations from <Font>), which would cause the browser to re-evaluate them
Expand Down
6 changes: 6 additions & 0 deletions packages/create-astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# create-astro

## 5.0.4

### Patch Changes

- [#16106](https://github.com/withastro/astro/pull/16106) [`d241012`](https://github.com/withastro/astro/commit/d241012107c7df55ac46192bcb7b1fbe650f3d93) Thanks [@matthewp](https://github.com/matthewp)! - Fixes dependency installation failing on Windows when running `npm create astro@latest`. The previous fix for DEP0190 warnings incorrectly assumed `.cmd` shims could be spawned directly without a shell — on Windows, `.cmd` files require `cmd.exe` to execute. Package manager commands are now invoked via `cmd.exe /d /s /c` on Windows. Also fixes the `[object Object]` error message that appeared when installation failed, replacing it with the actual error.

## 5.0.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/create-astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-astro",
"version": "5.0.3",
"version": "5.0.4",
"type": "module",
"author": "withastro",
"license": "MIT",
Expand Down
27 changes: 19 additions & 8 deletions packages/create-astro/src/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,19 @@ interface Output {
const text = (stream: NodeJS.ReadableStream | Readable | null) =>
stream ? textFromStream(stream).then((t) => t.trimEnd()) : '';

function resolveCommand(command: string) {
if (process.platform !== 'win32') return command;
if (command.includes('/') || command.includes('\\') || command.includes('.')) return command;
return WINDOWS_CMD_SHIMS.has(command.toLowerCase()) ? `${command}.cmd` : command;
/**
* On Windows, `.cmd` and `.bat` files cannot be spawned directly without a shell.
* For known package manager shims, we invoke them via `cmd.exe /d /s /c` instead.
* Returns [resolvedCommand, resolvedFlags] to use with spawn.
*/
function resolveCommand(command: string, flags: string[]): [string, string[]] {
if (process.platform !== 'win32') return [command, flags];
if (command.includes('/') || command.includes('\\') || command.includes('.'))
return [command, flags];
if (WINDOWS_CMD_SHIMS.has(command.toLowerCase())) {
return ['cmd.exe', ['/d', '/s', '/c', `${command}.cmd`, ...flags]];
}
return [command, flags];
}

export async function shell(
Expand All @@ -35,7 +44,8 @@ export async function shell(
let stdout = '';
let stderr = '';
try {
child = spawn(resolveCommand(command), flags, {
const [resolvedCommand, resolvedFlags] = resolveCommand(command, flags);
child = spawn(resolvedCommand, resolvedFlags, {
cwd: opts.cwd,
stdio: opts.stdio,
timeout: opts.timeout,
Expand All @@ -45,15 +55,16 @@ export async function shell(
child.once('close', () => resolve());
});
[stdout, stderr] = await Promise.all([text(child.stdout), text(child.stderr), done]);
} catch {
throw { stdout, stderr, exitCode: 1 };
} catch (e) {
const message = e instanceof Error ? e.message : stderr || 'Unknown error';
throw new Error(message);
}
const { exitCode } = child;
if (exitCode === null) {
throw new Error('Timeout');
}
if (exitCode !== 0) {
throw new Error(stderr);
throw new Error(stderr || `Process exited with code ${exitCode}`);
}
return { stdout, stderr, exitCode };
}
Loading
Loading