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
5 changes: 0 additions & 5 deletions .changeset/vercel-gitignore.md

This file was deleted.

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.13"
"astro": "^5.16.14"
}
}
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.13",
"astro": "^5.16.14",
"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.13"
"astro": "^5.16.14"
},
"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.13",
"astro": "^5.16.14",
"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.13"
"astro": "^5.16.14"
}
}
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.13",
"astro": "^5.16.14",
"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.13",
"astro": "^5.16.14",
"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.13",
"astro": "^5.16.14",
"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.13",
"astro": "^5.16.14",
"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.13",
"astro": "^5.16.14",
"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.13",
"astro": "^5.16.14",
"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.13"
"astro": "^5.16.14"
}
}
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.13"
"astro": "^5.16.14"
},
"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.13"
"astro": "^5.16.14"
}
}
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.13"
"astro": "^5.16.14"
}
}
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.13",
"astro": "^5.16.14",
"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.13",
"astro": "^5.16.14",
"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.13"
"astro": "^5.16.14"
}
}
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.13"
"astro": "^5.16.14"
}
}
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.13",
"astro": "^5.16.14",
"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.13",
"astro": "^5.16.14",
"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.13",
"astro": "^5.16.14",
"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.13",
"astro": "^5.16.14",
"vitest": "^3.2.4"
}
}
67 changes: 67 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,72 @@
# astro

## 5.16.14

### Patch Changes

- [#15213](https://github.com/withastro/astro/pull/15213) [`c775fce`](https://github.com/withastro/astro/commit/c775fce98f50001bc59025dceaf8ea5287675f17) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only**

Updates how the local provider must be used when using the experimental Fonts API

Previously, there were 2 kinds of font providers: remote and local.

Font providers are now unified. If you are using the local provider, the process for configuring local fonts must be updated:

```diff
-import { defineConfig } from "astro/config";
+import { defineConfig, fontProviders } from "astro/config";

export default defineConfig({
experimental: {
fonts: [{
name: "Custom",
cssVariable: "--font-custom",
- provider: "local",
+ provider: fontProviders.local(),
+ options: {
variants: [
{
weight: 400,
style: "normal",
src: ["./src/assets/fonts/custom-400.woff2"]
},
{
weight: 700,
style: "normal",
src: ["./src/assets/fonts/custom-700.woff2"]
}
// ...
]
+ }
}]
}
});
```

Once configured, there is no change to using local fonts in your project. However, you should inspect your deployed site to confirm that your new font configuration is being applied.

See [the experimental Fonts API docs](https://docs.astro.build/en/reference/experimental-flags/fonts/) for more information.

- [#15213](https://github.com/withastro/astro/pull/15213) [`c775fce`](https://github.com/withastro/astro/commit/c775fce98f50001bc59025dceaf8ea5287675f17) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Exposes `root` on `FontProvider` `init()` context

When building a custom `FontProvider` for the experimental Fonts API, the `init()` method receives a `context`. This context now exposes a `root` URL, useful for resolving local files:

```diff
import type { FontProvider } from "astro";

export function registryFontProvider(): FontProvider {
return {
// ...
- init: async ({ storage }) => {
+ init: async ({ storage, root }) => {
// ...
},
};
}
```

- [#15185](https://github.com/withastro/astro/pull/15185) [`edabeaa`](https://github.com/withastro/astro/commit/edabeaa3cd3355fa33e4eb547656033fe7b66845) Thanks [@EricGrill](https://github.com/EricGrill)! - Add `.vercel` to `.gitignore` when adding the Vercel adapter via `astro add vercel`

## 5.16.13

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions packages/astro/components/Font.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { filterPreloads } from '../dist/assets/fonts/core/filter-preloads.js';
import { AstroError, AstroErrorData } from '../dist/core/errors/index.js';

// TODO: remove check when fonts are stabilized
const { internalConsumableMap } = mod;
if (!internalConsumableMap) {
const { componentDataByCssVariable } = mod;
if (!componentDataByCssVariable) {
throw new AstroError(AstroErrorData.ExperimentalFontsNotEnabled);
}

Expand All @@ -17,15 +17,15 @@ interface Props {
}

const { cssVariable, preload = false } = Astro.props as Props;
const data = internalConsumableMap.get(cssVariable);
const data = componentDataByCssVariable.get(cssVariable);
if (!data) {
throw new AstroError({
...AstroErrorData.FontFamilyNotFound,
message: AstroErrorData.FontFamilyNotFound.message(cssVariable),
});
}

const filteredPreloadData = filterPreloads(data.preloadData, preload);
const filteredPreloadData = filterPreloads(data.preloads, preload);
---

<style set:html={data.css}></style>
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/dev-only.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ declare module 'virtual:astro:env/internal' {
}

declare module 'virtual:astro:assets/fonts/internal' {
export const internalConsumableMap: import('./src/assets/fonts/types.js').InternalConsumableMap;
export const fontData: import('./src/assets/fonts/types.js').FontDataRecord;
export const componentDataByCssVariable: import('./src/assets/fonts/types.js').ComponentDataByCssVariable;
export const fontDataByCssVariable: import('./src/assets/fonts/types.js').FontDataByCssVariable;
export const bufferImports: import('./src/assets/fonts/types.js').BufferImports;
}

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.13",
"version": "5.16.14",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/assets/fonts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Here is an overview of the architecture of the fonts in Astro:

- [`orchestrate()`](./orchestrate.ts) combines sub steps and takes care of getting useful data from the config
- It resolves font families (eg. import remote font providers)
- It resolves font families (eg. deduplication)
- It initializes the font resolver
- For each family, it resolves fonts data and normalizes them
- For each family, optimized fallbacks (and related CSS) are generated if applicable
Expand Down
32 changes: 2 additions & 30 deletions packages/astro/src/assets/fonts/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from 'zod';
import { FONT_TYPES, LOCAL_PROVIDER_NAME } from './constants.js';
import { FONT_TYPES } from './constants.js';
import type { FontProvider } from './types.js';

export const weightSchema = z.union([z.string(), z.number()]);
Expand All @@ -26,34 +26,6 @@ const requiredFamilyAttributesSchema = z.object({
cssVariable: z.string(),
});

const entrypointSchema = z.union([z.string(), z.instanceof(URL)]);

export const localFontFamilySchema = z
.object({
...requiredFamilyAttributesSchema.shape,
...fallbacksSchema.shape,
provider: z.literal(LOCAL_PROVIDER_NAME),
variants: z
.array(
z
.object({
...familyPropertiesSchema.shape,
src: z
.array(
z.union([
entrypointSchema,
z.object({ url: entrypointSchema, tech: z.string().optional() }).strict(),
]),
)
.nonempty(),
// TODO: find a way to support subsets (through fontkit?)
})
.strict(),
)
.nonempty(),
})
.strict();

export const fontProviderSchema = z
.object({
name: z.string(),
Expand All @@ -64,7 +36,7 @@ export const fontProviderSchema = z
})
.strict();

export const remoteFontFamilySchema = z
export const fontFamilySchema = z
.object({
...requiredFamilyAttributesSchema.shape,
...fallbacksSchema.shape,
Expand Down
2 changes: 0 additions & 2 deletions packages/astro/src/assets/fonts/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type { Defaults, FontType } from './types.js';

export const LOCAL_PROVIDER_NAME = 'local';

export const DEFAULTS: Defaults = {
weights: ['400'],
styles: ['normal', 'italic'],
Expand Down
Loading
Loading