diff --git a/.changeset/rare-eggs-notice.md b/.changeset/rare-eggs-notice.md
new file mode 100644
index 000000000000..eb8ba7ab03d9
--- /dev/null
+++ b/.changeset/rare-eggs-notice.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Fixes support for numeric IDs in YAML frontmatter when using content collection references
diff --git a/.changeset/shaggy-wolves-serve.md b/.changeset/shaggy-wolves-serve.md
new file mode 100644
index 000000000000..5c5e4534cc1f
--- /dev/null
+++ b/.changeset/shaggy-wolves-serve.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Adds a JSON schema to the Wrangler configuration file generated when running `astro add cloudflare`
diff --git a/AGENTS.md b/AGENTS.md
index 3a8a966fd117..c30c97b651f0 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -116,7 +116,7 @@ Use `pnpm -C
` for project-local script commands when working in
# `bgproc`
-Use `pnpm exec bgproc` to start, stop, and manage long-running `astro dev` & `astro preview` servers in the background. Do not manually start detatched servers with `&` if you can use `bgproc` instead.
+Use `pnpm exec bgproc` to start, stop, and manage long-running `astro dev` & `astro preview` servers in the background. Do not manually start detached servers with `&` if you can use `bgproc` instead.
Use `pnpm exec bgproc --help` to see all available commands.
diff --git a/examples/advanced-routing/README.md b/examples/advanced-routing/README.md
new file mode 100644
index 000000000000..50fccd164387
--- /dev/null
+++ b/examples/advanced-routing/README.md
@@ -0,0 +1,53 @@
+# Astro Advanced Routing Example
+
+```sh
+npm create astro@latest -- --template advanced-routing
+```
+
+[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/advanced-routing)
+[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/advanced-routing)
+
+This example showcases Astro's experimental advanced routing with `src/app.ts`, using [Hono](https://hono.dev/) middleware to control the request pipeline.
+
+## 🚀 Project Structure
+
+Inside of your Astro project, you'll see the following folders and files:
+
+```text
+/
+├── src/
+│ ├── actions/
+│ ├── layouts/
+│ ├── pages/
+│ │ ├── dashboard/
+│ │ └── es/
+│ └── app.ts
+├── astro.config.mjs
+├── package.json
+└── tsconfig.json
+```
+
+Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
+
+The `src/app.ts` file controls the request pipeline. This example composes Astro's middleware with custom Hono middleware to handle routing behavior like authentication, redirects, and locale-specific pages.
+
+## Server-side rendering (SSR)
+
+This project uses the [`@astrojs/node`](https://docs.astro.build/en/guides/integrations-guide/node/) adapter with `output: "server"` and enables Astro's experimental `advancedRouting` option.
+
+## 🧞 Commands
+
+All commands are run from the root of the project, from a terminal:
+
+| Command | Action |
+| :------------------------ | :----------------------------------------------- |
+| `npm install` | Installs dependencies |
+| `npm run dev` | Starts local dev server at `localhost:4321` |
+| `npm run build` | Build your production site to `./dist/` |
+| `npm run preview` | Preview your build locally, before deploying |
+| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
+| `npm run astro -- --help` | Get help using the Astro CLI |
+
+## 👀 Want to learn more?
+
+Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
diff --git a/examples/component/README.md b/examples/component/README.md
index f51958529925..808a78e9f8ec 100644
--- a/examples/component/README.md
+++ b/examples/component/README.md
@@ -6,8 +6,8 @@ This is a template for an Astro component library. Use this template for writing
npm create astro@latest -- --template component
```
-[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/non-html-pages)
-[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/non-html-pages)
+[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/component)
+[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/component)
[](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/component/devcontainer.json)
## 🚀 Project Structure
diff --git a/examples/container-with-vitest/README.md b/examples/container-with-vitest/README.md
index 116268944c55..df971256a343 100644
--- a/examples/container-with-vitest/README.md
+++ b/examples/container-with-vitest/README.md
@@ -4,8 +4,8 @@
npm create astro@latest -- --template container-with-vitest
```
-[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/with-vitest)
-[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/with-vitest)
+[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/container-with-vitest)
+[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/container-with-vitest)
[](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/with-vitest/devcontainer.json)
This example showcases Astro working with [Vitest](https://vitest.dev/) and how to test components using the Container API.
diff --git a/examples/ssr/README.md b/examples/ssr/README.md
new file mode 100644
index 000000000000..c987228f5e65
--- /dev/null
+++ b/examples/ssr/README.md
@@ -0,0 +1,62 @@
+# Astro SSR Example
+
+```sh
+npm create astro@latest -- --template ssr
+```
+
+[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/ssr)
+[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/ssr)
+[](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/ssr/devcontainer.json)
+
+This example showcases server-side rendering with Astro using the [`@astrojs/node`](https://docs.astro.build/en/guides/integrations-guide/node/) adapter and [`@astrojs/svelte`](https://docs.astro.build/en/guides/integrations-guide/svelte/) integration.
+
+## 🚀 Project Structure
+
+Inside of your Astro project, you'll see the following folders and files:
+
+```text
+/
+├── public/
+│ ├── favicon.ico
+│ ├── favicon.svg
+│ └── images/
+├── src/
+│ ├── components/
+│ ├── models/
+│ ├── pages/
+│ │ ├── api/
+│ │ └── products/
+│ ├── styles/
+│ └── api.ts
+├── astro.config.mjs
+├── package.json
+└── tsconfig.json
+```
+
+Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name. Dynamic routes like `products/[id].astro` are used to render individual product pages.
+
+There's nothing special about `src/components/`, but that's where we like to put any Astro or framework components.
+
+Any static assets, like images, can be placed in the `public/` directory.
+
+## Server-side rendering (SSR)
+
+This project uses the [`@astrojs/node`](https://docs.astro.build/en/guides/integrations-guide/node/) adapter with `output: "server"` to render pages on demand and expose API routes from `src/pages/api/`.
+
+## 🧞 Commands
+
+All commands are run from the root of the project, from a terminal:
+
+| Command | Action |
+| :------------------------ | :----------------------------------------------- |
+| `npm install` | Installs dependencies |
+| `npm run dev` | Starts local dev server at `localhost:4321` |
+| `npm run build` | Build your production site to `./dist/` |
+| `npm run preview` | Preview your build locally, before deploying |
+| `npm run server` | Run the built Node server from `./dist/server/` |
+| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
+| `npm run astro -- --help` | Get help using the Astro CLI |
+
+## 👀 Want to learn more?
+
+Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
diff --git a/packages/astro/src/cli/add/index.ts b/packages/astro/src/cli/add/index.ts
index a09c9fd90550..f53435ef8ec7 100644
--- a/packages/astro/src/cli/add/index.ts
+++ b/packages/astro/src/cli/add/index.ts
@@ -82,6 +82,7 @@ export default async function seed() {
`,
CLOUDFLARE_WRANGLER_CONFIG: (name: string, compatibilityDate: string) => `\
{
+ "$schema": "./node_modules/wrangler/config-schema.json",
"compatibility_date": ${JSON.stringify(compatibilityDate)},
"compatibility_flags": ["global_fetch_strictly_public"],
"name": ${JSON.stringify(name)},
diff --git a/packages/astro/src/container/index.ts b/packages/astro/src/container/index.ts
index 8d47c7a1630d..cec8d137705b 100644
--- a/packages/astro/src/container/index.ts
+++ b/packages/astro/src/container/index.ts
@@ -96,7 +96,7 @@ export type ContainerRenderOptions = {
routeType?: RouteType;
/**
- * Allows to pass `Astro.props` to an Astro component:
+ * Allows passing `Astro.props` to an Astro component:
*
* ```js
* container.renderToString(Endpoint, { props: { "lorem": "ipsum" } });
@@ -105,9 +105,9 @@ export type ContainerRenderOptions = {
props?: Props;
/**
- * When `false`, it forces to render the component as it was a full-fledged page.
+ * When `false`, it forces the component to render as if it were a full-fledged page.
*
- * By default, the container API render components as [partials](https://docs.astro.build/en/basics/astro-pages/#page-partials).
+ * By default, the container API renders components as [partials](https://docs.astro.build/en/basics/astro-pages/#page-partials).
*
*/
partial?: boolean;
diff --git a/packages/astro/src/content/runtime.ts b/packages/astro/src/content/runtime.ts
index ac57450b8556..7e19afc4f2f5 100644
--- a/packages/astro/src/content/runtime.ts
+++ b/packages/astro/src/content/runtime.ts
@@ -686,6 +686,7 @@ export function createReference() {
return function reference(collection: string) {
return z
.union([
+ z.number().transform((num) => num.toString(10)),
z.string(),
z.object({
id: z.string(),
diff --git a/packages/astro/test/units/content-layer/data-transforms.test.ts b/packages/astro/test/units/content-layer/data-transforms.test.ts
index 2b1e8392b51a..5aba7cf0eeb8 100644
--- a/packages/astro/test/units/content-layer/data-transforms.test.ts
+++ b/packages/astro/test/units/content-layer/data-transforms.test.ts
@@ -514,4 +514,61 @@ describe('Content Layer - Data Transforms', () => {
// The default is applied as a string, not transformed to a reference object
assert.equal(result2.data.category, 'general');
});
+
+ it('transforms numeric ids to strings', async () => {
+ const store = new MutableDataStore();
+ const settings = createMinimalSettings(root);
+ const logger = new AstroLogger({
+ destination: { write: () => true },
+ level: 'silent',
+ });
+
+ // Create a loader that returns data with reference strings
+ const dogsLoader = {
+ name: 'dogs-loader',
+ load: async (context: any) => {
+ const data = {
+ id: 'beagle',
+ name: 'Beagle Dog',
+ favoriteCat: 1,
+ };
+
+ const parsed = await context.parseData({
+ id: 'beagle',
+ data,
+ });
+
+ await context.store.set({
+ id: 'beagle',
+ data: parsed,
+ });
+ },
+ };
+
+ const collections = {
+ dogs: defineCollection({
+ loader: dogsLoader,
+ schema: z.object({
+ id: z.string(),
+ name: z.string(),
+ favoriteCat: reference('cats'),
+ }),
+ }),
+ };
+
+ const contentLayer = new ContentLayer({
+ settings,
+ logger,
+ store,
+ contentConfigObserver: createTestConfigObserver(collections),
+ });
+
+ await contentLayer.sync();
+
+ const result: any = store.get('dogs', 'beagle');
+ assert.ok(result);
+ assert.equal(result.data.id, 'beagle');
+ assert.equal(result.data.name, 'Beagle Dog');
+ assert.deepEqual(result.data.favoriteCat, { collection: 'cats', id: '1' });
+ });
});