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 @@ -10,6 +10,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.16.14"
"astro": "^5.16.15"
}
}
2 changes: 1 addition & 1 deletion examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@astrojs/mdx": "^4.3.13",
"@astrojs/rss": "^4.0.15",
"@astrojs/sitemap": "^3.7.0",
"astro": "^5.16.14",
"astro": "^5.16.15",
"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 @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^5.16.14"
"astro": "^5.16.15"
},
"peerDependencies": {
"astro": "^4.0.0 || ^5.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 @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/react": "^4.4.2",
"astro": "^5.16.14",
"astro": "^5.16.15",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vitest": "^3.2.4"
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 @@ -13,6 +13,6 @@
"@astrojs/alpinejs": "^0.4.9",
"@types/alpinejs": "^3.13.11",
"alpinejs": "^3.15.4",
"astro": "^5.16.14"
"astro": "^5.16.15"
}
}
2 changes: 1 addition & 1 deletion examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@astrojs/vue": "^5.1.4",
"@types/react": "^18.3.27",
"@types/react-dom": "^18.3.7",
"astro": "^5.16.14",
"astro": "^5.16.15",
"preact": "^10.28.2",
"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 @@ -12,7 +12,7 @@
"dependencies": {
"@astrojs/preact": "^4.1.3",
"@preact/signals": "^2.5.1",
"astro": "^5.16.14",
"astro": "^5.16.15",
"preact": "^10.28.2"
}
}
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@astrojs/react": "^4.4.2",
"@types/react": "^18.3.27",
"@types/react-dom": "^18.3.7",
"astro": "^5.16.14",
"astro": "^5.16.15",
"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 @@ -11,7 +11,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^5.1.3",
"astro": "^5.16.14",
"astro": "^5.16.15",
"solid-js": "^1.9.10"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@astrojs/svelte": "^7.2.5",
"astro": "^5.16.14",
"astro": "^5.16.15",
"svelte": "^5.46.1"
}
}
2 changes: 1 addition & 1 deletion examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@astrojs/vue": "^5.1.4",
"astro": "^5.16.14",
"astro": "^5.16.15",
"vue": "^3.5.26"
}
}
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
},
"dependencies": {
"@astrojs/node": "^9.5.2",
"astro": "^5.16.14"
"astro": "^5.16.15"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^5.16.14"
"astro": "^5.16.15"
},
"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 @@ -10,6 +10,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.16.14"
"astro": "^5.16.15"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.16.14"
"astro": "^5.16.15"
}
}
2 changes: 1 addition & 1 deletion examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/node": "^9.5.2",
"@astrojs/svelte": "^7.2.5",
"astro": "^5.16.14",
"astro": "^5.16.15",
"svelte": "^5.46.1"
}
}
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": "^5.16.14",
"astro": "^5.16.15",
"sass": "^1.97.2",
"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,6 +16,6 @@
},
"devDependencies": {
"@types/node": "^18.17.8",
"astro": "^5.16.14"
"astro": "^5.16.15"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.15.10",
"astro": "^5.16.14"
"astro": "^5.16.15"
}
}
2 changes: 1 addition & 1 deletion examples/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@astrojs/mdx": "^4.3.13",
"@astrojs/preact": "^4.1.3",
"astro": "^5.16.14",
"astro": "^5.16.15",
"preact": "^10.28.2"
}
}
2 changes: 1 addition & 1 deletion examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@astrojs/preact": "^4.1.3",
"@nanostores/preact": "^0.5.2",
"astro": "^5.16.14",
"astro": "^5.16.15",
"nanostores": "^0.11.4",
"preact": "^10.28.2"
}
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 @@ -13,7 +13,7 @@
"@astrojs/mdx": "^4.3.13",
"@tailwindcss/vite": "^4.1.18",
"@types/canvas-confetti": "^1.9.0",
"astro": "^5.16.14",
"astro": "^5.16.15",
"canvas-confetti": "^1.9.4",
"tailwindcss": "^4.1.18"
}
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 @@ -11,7 +11,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^5.16.14",
"astro": "^5.16.15",
"vitest": "^3.2.4"
}
}
6 changes: 6 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# astro

## 5.16.15

### Patch Changes

- [#15286](https://github.com/withastro/astro/pull/15286) [`0aafc83`](https://github.com/withastro/astro/commit/0aafc8342a47f5c96cd13bfc02539d89c3c358a7) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where font providers provided as class instances may not work when using the experimental Fonts API. It affected the local provider

## 5.16.14

### Patch Changes
Expand Down
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": "5.16.14",
"version": "5.16.15",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
Expand Down
9 changes: 8 additions & 1 deletion packages/astro/src/assets/fonts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const requiredFamilyAttributesSchema = z.object({
cssVariable: z.string(),
});

export const fontProviderSchema = z
const _fontProviderSchema = z
.object({
name: z.string(),
config: z.record(z.string(), z.any()).optional(),
Expand All @@ -36,6 +36,13 @@ export const fontProviderSchema = z
})
.strict();

// Using z.object directly makes zod remap the input, preventing
// the usage of class instances. Instead, we check if it matches
// the right shape and pass the original
export const fontProviderSchema = z.custom<FontProvider>((v) => {
return _fontProviderSchema.safeParse(v).success;
}, 'Invalid FontProvider object');

export const fontFamilySchema = z
.object({
...requiredFamilyAttributesSchema.shape,
Expand Down
17 changes: 17 additions & 0 deletions packages/astro/test/units/config/config-validate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { describe, it } from 'node:test';
import { stripVTControlCharacters } from 'node:util';
import { z } from 'zod';
import { fontProviders } from '../../../dist/assets/fonts/providers/index.js';
import { LocalFontProvider } from '../../../dist/assets/fonts/providers/local.js';
import { validateConfig as _validateConfig } from '../../../dist/core/config/validate.js';
import { formatConfigErrorMessage } from '../../../dist/core/messages.js';
import { envField } from '../../../dist/env/config.js';
Expand Down Expand Up @@ -534,6 +535,22 @@ describe('Config Validation', () => {
}),
);
});

it('should preserve FontProvider as a class instance', async () => {
const config = await validateConfig({
experimental: {
fonts: [
{
provider: fontProviders.local(),
name: 'Roboto',
cssVariable: '--font-roboto',
options: {},
},
],
},
});
assert.equal(config.experimental.fonts?.[0].provider instanceof LocalFontProvider, true);
});
});

describe('csp', () => {
Expand Down
Loading
Loading