diff --git a/.changeset/eleven-pens-glow.md b/.changeset/eleven-pens-glow.md
deleted file mode 100644
index d031fba49c..0000000000
--- a/.changeset/eleven-pens-glow.md
+++ /dev/null
@@ -1,41 +0,0 @@
----
-'astro': minor
----
-
-Deprecates the option for route-generating files to export a dynamic value for `prerender`. Only static values are now supported (e.g. `export const prerender = true` or `= false`). This allows for better treeshaking and bundling configuration in the future.
-
-Adds a new [`"astro:route:setup"` hook](https://docs.astro.build/en/reference/integrations-reference/#astroroutesetup) to the Integrations API to allow you to dynamically set options for a route at build or request time through an integration, such as enabling [on-demand server rendering](https://docs.astro.build/en/guides/server-side-rendering/#opting-in-to-pre-rendering-in-server-mode).
-
-To migrate from a dynamic export to the new hook, update or remove any dynamic `prerender` exports from individual routing files:
-
-```diff
-// src/pages/blog/[slug].astro
-- export const prerender = import.meta.env.PRERENDER
-```
-
-Instead, create an integration with the `"astro:route:setup"` hook and update the route's `prerender` option:
-
-```js
-// astro.config.mjs
-import { defineConfig } from 'astro/config';
-import { loadEnv } from 'vite';
-
-export default defineConfig({
- integrations: [setPrerender()],
-});
-
-function setPrerender() {
- const { PRERENDER } = loadEnv(process.env.NODE_ENV, process.cwd(), '');
-
- return {
- name: 'set-prerender',
- hooks: {
- 'astro:route:setup': ({ route }) => {
- if (route.component.endsWith('/blog/[slug].astro')) {
- route.prerender = PRERENDER;
- }
- },
- },
- };
-}
-```
diff --git a/.changeset/fifty-stingrays-flow.md b/.changeset/fifty-stingrays-flow.md
deleted file mode 100644
index 3f4b96b049..0000000000
--- a/.changeset/fifty-stingrays-flow.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-'astro': patch
-'@astrojs/db': patch
----
-
-Refactors internally to use `node:util` `parseArgs` instead of `yargs-parser`
diff --git a/.changeset/fresh-fans-study.md b/.changeset/fresh-fans-study.md
deleted file mode 100644
index 9a837b1fd7..0000000000
--- a/.changeset/fresh-fans-study.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-'@astrojs/db': minor
----
-
-Changes how type generation works
-
-The generated `.d.ts` file is now at a new location:
-
-```diff
-- .astro/db-types.d.ts
-+ .astro/integrations/astro_db/db.d.ts
-```
-
-The following line can now be removed from `src/env.d.ts`:
-
-```diff
-- ///
-```
diff --git a/.changeset/mean-horses-kiss.md b/.changeset/mean-horses-kiss.md
deleted file mode 100644
index 7d211e6267..0000000000
--- a/.changeset/mean-horses-kiss.md
+++ /dev/null
@@ -1,35 +0,0 @@
----
-'astro': minor
----
-
-Adds a new [`injectTypes()` utility](https://docs.astro.build/en/reference/integrations-reference/#injecttypes-options) to the Integration API and refactors how type generation works
-
-Use `injectTypes()` in the `astro:config:done` hook to inject types into your user's project by adding a new a `*.d.ts` file.
-
-The `filename` property will be used to generate a file at `/.astro/integrations//.d.ts` and must end with `".d.ts"`.
-
-The `content` property will create the body of the file, and must be valid TypeScript.
-
-Additionally, `injectTypes()` returns a URL to the normalized path so you can overwrite its content later on, or manipulate it in any way you want.
-
-```js
-// my-integration/index.js
-export default {
- name: 'my-integration',
- 'astro:config:done': ({ injectTypes }) => {
- injectTypes({
- filename: "types.d.ts",
- content: "declare module 'virtual:my-integration' {}"
- })
- }
-};
-```
-
-Codegen has been refactored. Although `src/env.d.ts` will continue to work as is, we recommend you update it:
-
-```diff
-- ///
-+ ///
-- ///
-- ///
-```
\ No newline at end of file
diff --git a/.changeset/mighty-trees-teach.md b/.changeset/mighty-trees-teach.md
new file mode 100644
index 0000000000..289a418161
--- /dev/null
+++ b/.changeset/mighty-trees-teach.md
@@ -0,0 +1,5 @@
+---
+'@astrojs/mdx': patch
+---
+
+Fixes stack trace location when failed to parse an MDX file with frontmatter
diff --git a/.changeset/odd-buttons-pay.md b/.changeset/odd-buttons-pay.md
deleted file mode 100644
index 728068ef2a..0000000000
--- a/.changeset/odd-buttons-pay.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-"astro": minor
----
-
-Adds a new property `meta` to Astro's [built-in `
` component](https://docs.astro.build/en/reference/api-reference/#code-).
-
-This allows you to provide a value for [Shiki's `meta` attribute](https://shiki.style/guide/transformers#meta) to pass options to transformers.
-
-The following example passes an option to highlight lines 1 and 3 to Shiki's `tranformerMetaHighlight`:
-
-```astro
----
-// src/components/Card.astro
-import { Code } from "astro:components";
-import { transformerMetaHighlight } from '@shikijs/transformers';
----
-
-```
diff --git a/.changeset/rude-queens-shop.md b/.changeset/rude-queens-shop.md
deleted file mode 100644
index 6610b16a53..0000000000
--- a/.changeset/rude-queens-shop.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-'create-astro': patch
-'@astrojs/upgrade': patch
----
-
-Refactors internally to use `node:util` `parseArgs` instead of `arg`
-
diff --git a/.changeset/serious-pumas-run.md b/.changeset/serious-pumas-run.md
deleted file mode 100644
index e6f7c9af1a..0000000000
--- a/.changeset/serious-pumas-run.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-'astro': minor
----
-
-Adds support for Intellisense features (e.g. code completion, quick hints) for your content collection entries in compatible editors under the `experimental.contentIntellisense` flag.
-
-```js
-import { defineConfig } from 'astro';
-
-export default defineConfig({
- experimental: {
- contentIntellisense: true
- }
-})
-```
-
-When enabled, this feature will generate and add JSON schemas to the `.astro` directory in your project. These files can be used by the Astro language server to provide Intellisense inside content files (`.md`, `.mdx`, `.mdoc`).
-
-Note that at this time, this also require enabling the `astro.content-intellisense` option in your editor, or passing the `contentIntellisense: true` initialization parameter to the Astro language server for editors using it directly.
-
-See the [experimental content Intellisense docs](https://docs.astro.build/en/reference/configuration-reference/#experimentalcontentintellisense) for more information updates as this feature develops.
diff --git a/.changeset/smooth-chicken-wash.md b/.changeset/smooth-chicken-wash.md
deleted file mode 100644
index 3ced01f52f..0000000000
--- a/.changeset/smooth-chicken-wash.md
+++ /dev/null
@@ -1,107 +0,0 @@
----
-'astro': minor
----
-
-Adds experimental support for the Content Layer API.
-
-The new Content Layer API builds upon content collections, taking them beyond local files in `src/content/` and allowing you to fetch content from anywhere, including remote APIs. These new collections work alongside your existing content collections, and you can migrate them to the new API at your own pace. There are significant improvements to performance with large collections of local files.
-
-### Getting started
-
-To try out the new Content Layer API, enable it in your Astro config:
-
-```js
-import { defineConfig } from 'astro';
-
-export default defineConfig({
- experimental: {
- contentLayer: true
- }
-})
-```
-
-You can then create collections in your `src/content/config.ts` using the Content Layer API.
-
-### Loading your content
-
-The core of the new Content Layer API is the loader, a function that fetches content from a source and caches it in a local data store. Astro 4.14 ships with built-in `glob()` and `file()` loaders to handle your local Markdown, MDX, Markdoc, and JSON files:
-
-```ts {3,7}
-// src/content/config.ts
-import { defineCollection, z } from 'astro:content';
-import { glob } from 'astro/loaders';
-
-const blog = defineCollection({
- // The ID is a slug generated from the path of the file relative to `base`
- loader: glob({ pattern: "**/*.md", base: "./src/data/blog" }),
- schema: z.object({
- title: z.string(),
- description: z.string(),
- publishDate: z.coerce.date(),
- })
-});
-
-export const collections = { blog };
-```
-
-You can then query using the existing content collections functions, and enjoy a simplified `render()` function to display your content:
-
-```astro
----
-import { getEntry, render } from 'astro:content';
-
-const post = await getEntry('blog', Astro.params.slug);
-
-const { Content } = await render(entry);
----
-
-
-```
-
-### Creating a loader
-
-You're not restricted to the built-in loaders – we hope you'll try building your own. You can fetch content from anywhere and return an array of entries:
-
-```ts
-// src/content/config.ts
-const countries = defineCollection({
- loader: async () => {
- const response = await fetch("https://restcountries.com/v3.1/all");
- const data = await response.json();
- // Must return an array of entries with an id property,
- // or an object with IDs as keys and entries as values
- return data.map((country) => ({
- id: country.cca3,
- ...country,
- }));
- },
- // optionally add a schema to validate the data and make it type-safe for users
- // schema: z.object...
-});
-
-export const collections = { countries };
-```
-
-For more advanced loading logic, you can define an object loader. This allows incremental updates and conditional loading, and gives full access to the data store. It also allows a loader to define its own schema, including generating it dynamically based on the source API. See the [the Content Layer API RFC](https://github.com/withastro/roadmap/blob/content-layer/proposals/0047-content-layer.md#loaders) for more details.
-
-### Sharing your loaders
-
-Loaders are better when they're shared. You can create a package that exports a loader and publish it to npm, and then anyone can use it on their site. We're excited to see what the community comes up with! To get started, [take a look at some examples](https://github.com/ascorbic/astro-loaders/). Here's how to load content using an RSS/Atom feed loader:
-
-```ts
-// src/content/config.ts
-import { defineCollection } from "astro:content";
-import { feedLoader } from "@ascorbic/feed-loader";
-
-const podcasts = defineCollection({
- loader: feedLoader({
- url: "https://feeds.99percentinvisible.org/99percentinvisible",
- }),
-});
-
-export const collections = { podcasts };
-```
-
-### Learn more
-
-To find out more about using the Content Layer API, check out [the Content Layer RFC](https://github.com/withastro/roadmap/blob/content-layer/proposals/0047-content-layer.md) and [share your feedback](https://github.com/withastro/roadmap/pull/982).
diff --git a/.changeset/spicy-houses-fry.md b/.changeset/spicy-houses-fry.md
new file mode 100644
index 0000000000..41f376a354
--- /dev/null
+++ b/.changeset/spicy-houses-fry.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Simplifies path operations of `astro sync`
diff --git a/README.md b/README.md
index 9b5e734aa8..62589bac80 100644
--- a/README.md
+++ b/README.md
@@ -70,6 +70,7 @@ Join us on [Discord](https://astro.build/chat) to meet other maintainers. We'll
| [@astrojs/mdx](packages/integrations/mdx) | [![@astrojs/mdx version](https://img.shields.io/npm/v/@astrojs/mdx.svg?label=%20)](packages/integrations/mdx/CHANGELOG.md) |
| [@astrojs/db](packages/db) | [![@astrojs/db version](https://img.shields.io/npm/v/@astrojs/db.svg?label=%20)](packages/db/CHANGELOG.md) |
| [@astrojs/rss](packages/astro-rss) | [![@astrojs/rss version](https://img.shields.io/npm/v/@astrojs/rss.svg?label=%20)](packages/astro-rss/CHANGELOG.md) |
+| [@astrojs/netlify](https://github.com/withastro/adapters/blob/main/packages/netlify) | [![@astrojs/netlify version](https://img.shields.io/npm/v/@astrojs/netlify.svg?label=%20)](https://github.com/withastro/adapters/blob/main/packages/netlify/CHANGELOG.md) |
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6178/badge)](https://bestpractices.coreinfrastructure.org/projects/6178)
diff --git a/biome.json b/biome.json
index 2928e8f4fe..67e2a4620e 100644
--- a/biome.json
+++ b/biome.json
@@ -26,7 +26,15 @@
"organizeImports": {
"enabled": true
},
- "linter": { "enabled": false },
+ "linter": {
+ "enabled": true,
+ "rules": {
+ "recommended": false,
+ "style": {
+ "useNodejsImportProtocol": "error"
+ }
+ }
+ },
"javascript": {
"formatter": {
"trailingCommas": "all",
diff --git a/examples/basics/package.json b/examples/basics/package.json
index 02e40cb4ce..be4bf81ad1 100644
--- a/examples/basics/package.json
+++ b/examples/basics/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
}
}
diff --git a/examples/blog/package.json b/examples/blog/package.json
index 667fceb416..2b248d3a8d 100644
--- a/examples/blog/package.json
+++ b/examples/blog/package.json
@@ -14,6 +14,6 @@
"@astrojs/mdx": "^3.1.3",
"@astrojs/rss": "^4.0.7",
"@astrojs/sitemap": "^3.1.6",
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
}
}
diff --git a/examples/component/package.json b/examples/component/package.json
index 6e4ce727e4..3d2e2bead4 100644
--- a/examples/component/package.json
+++ b/examples/component/package.json
@@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
},
"peerDependencies": {
"astro": "^4.0.0"
diff --git a/examples/container-with-vitest/package.json b/examples/container-with-vitest/package.json
index 7bddf6df4c..1c67323405 100644
--- a/examples/container-with-vitest/package.json
+++ b/examples/container-with-vitest/package.json
@@ -12,7 +12,7 @@
"test": "vitest run"
},
"dependencies": {
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"@astrojs/react": "^3.6.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json
index 0de84cbbec..03cfff656d 100644
--- a/examples/framework-alpine/package.json
+++ b/examples/framework-alpine/package.json
@@ -14,6 +14,6 @@
"@astrojs/alpinejs": "^0.4.0",
"@types/alpinejs": "^3.13.10",
"alpinejs": "^3.14.1",
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
}
}
diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json
index 638a28be09..cdb7d272a4 100644
--- a/examples/framework-lit/package.json
+++ b/examples/framework-lit/package.json
@@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/lit": "^4.3.0",
"@webcomponents/template-shadowroot": "^0.2.1",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"lit": "^3.2.0"
}
}
diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json
index 800f0b0b68..626962d02e 100644
--- a/examples/framework-multiple/package.json
+++ b/examples/framework-multiple/package.json
@@ -18,7 +18,7 @@
"@astrojs/vue": "^4.5.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"preact": "^10.23.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json
index 42cf975fc5..d7169d6cc2 100644
--- a/examples/framework-preact/package.json
+++ b/examples/framework-preact/package.json
@@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.5.1",
"@preact/signals": "^1.3.0",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"preact": "^10.23.1"
}
}
diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json
index 8228bf5569..4fbde09c64 100644
--- a/examples/framework-react/package.json
+++ b/examples/framework-react/package.json
@@ -14,7 +14,7 @@
"@astrojs/react": "^3.6.2",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json
index 5152ce823a..cc583f052e 100644
--- a/examples/framework-solid/package.json
+++ b/examples/framework-solid/package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^4.4.1",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"solid-js": "^1.8.20"
}
}
diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json
index cc89304bb7..42a99cd247 100644
--- a/examples/framework-svelte/package.json
+++ b/examples/framework-svelte/package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/svelte": "^5.7.0",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"svelte": "^4.2.18"
}
}
diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json
index 3cd8d2325a..1bff3df25d 100644
--- a/examples/framework-vue/package.json
+++ b/examples/framework-vue/package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/vue": "^4.5.0",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"vue": "^3.4.37"
}
}
diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json
index 836cb84864..bc5ee46b2c 100644
--- a/examples/hackernews/package.json
+++ b/examples/hackernews/package.json
@@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/node": "^8.3.3",
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
}
}
diff --git a/examples/integration/package.json b/examples/integration/package.json
index 0445107121..d8225462a8 100644
--- a/examples/integration/package.json
+++ b/examples/integration/package.json
@@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
},
"peerDependencies": {
"astro": "^4.0.0"
diff --git a/examples/middleware/package.json b/examples/middleware/package.json
index b86e1b3115..db80ba2fe2 100644
--- a/examples/middleware/package.json
+++ b/examples/middleware/package.json
@@ -13,7 +13,7 @@
},
"dependencies": {
"@astrojs/node": "^8.3.3",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"html-minifier": "^4.0.0"
},
"devDependencies": {
diff --git a/examples/minimal/package.json b/examples/minimal/package.json
index a2892c7e46..129a0e1c68 100644
--- a/examples/minimal/package.json
+++ b/examples/minimal/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
}
}
diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json
index a6dc53a808..14750d8411 100644
--- a/examples/non-html-pages/package.json
+++ b/examples/non-html-pages/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
}
}
diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json
index 1e2b79ea03..22e75e1419 100644
--- a/examples/portfolio/package.json
+++ b/examples/portfolio/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
}
}
diff --git a/examples/server-islands/package.json b/examples/server-islands/package.json
index 3a1ae97fbe..a3bf732943 100644
--- a/examples/server-islands/package.json
+++ b/examples/server-islands/package.json
@@ -17,7 +17,7 @@
"@tailwindcss/forms": "^0.5.7",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"postcss": "^8.4.41",
"react": "^18.3.1",
"react-dom": "^18.3.1",
diff --git a/examples/ssr/package.json b/examples/ssr/package.json
index 10703eb9df..d35df0ec4c 100644
--- a/examples/ssr/package.json
+++ b/examples/ssr/package.json
@@ -14,7 +14,7 @@
"dependencies": {
"@astrojs/node": "^8.3.3",
"@astrojs/svelte": "^5.7.0",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"svelte": "^4.2.18"
}
}
diff --git a/examples/starlog/package.json b/examples/starlog/package.json
index 33e546e77c..905df4a69d 100644
--- a/examples/starlog/package.json
+++ b/examples/starlog/package.json
@@ -10,7 +10,7 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"sass": "^1.77.8",
"sharp": "^0.33.3"
}
diff --git a/examples/toolbar-app/package.json b/examples/toolbar-app/package.json
index 6f147be74c..d08c29bca2 100644
--- a/examples/toolbar-app/package.json
+++ b/examples/toolbar-app/package.json
@@ -15,6 +15,6 @@
"./app": "./dist/app.js"
},
"devDependencies": {
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
}
}
diff --git a/examples/view-transitions/package.json b/examples/view-transitions/package.json
index 6328e7665e..7448b9ec0a 100644
--- a/examples/view-transitions/package.json
+++ b/examples/view-transitions/package.json
@@ -12,6 +12,6 @@
"devDependencies": {
"@astrojs/tailwind": "^5.1.0",
"@astrojs/node": "^8.3.3",
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
}
}
diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json
index dcf8596bd6..1af3bc63c1 100644
--- a/examples/with-markdoc/package.json
+++ b/examples/with-markdoc/package.json
@@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.11.3",
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
}
}
diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json
index 407130b83b..61f1253458 100644
--- a/examples/with-markdown-plugins/package.json
+++ b/examples/with-markdown-plugins/package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/markdown-remark": "^5.2.0",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"hast-util-select": "^6.0.2",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json
index 8a32a5f368..e1486a376a 100644
--- a/examples/with-markdown-shiki/package.json
+++ b/examples/with-markdown-shiki/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^4.13.4"
+ "astro": "^4.14.2"
}
}
diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json
index 8782c588ce..934959975c 100644
--- a/examples/with-mdx/package.json
+++ b/examples/with-mdx/package.json
@@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/mdx": "^3.1.3",
"@astrojs/preact": "^3.5.1",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"preact": "^10.23.1"
}
}
diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json
index 2c73ab7344..b8db777b42 100644
--- a/examples/with-nanostores/package.json
+++ b/examples/with-nanostores/package.json
@@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.5.1",
"@nanostores/preact": "^0.5.2",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"nanostores": "^0.11.2",
"preact": "^10.23.1"
}
diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json
index 16cb073c72..80ba691d86 100644
--- a/examples/with-tailwindcss/package.json
+++ b/examples/with-tailwindcss/package.json
@@ -14,7 +14,7 @@
"@astrojs/mdx": "^3.1.3",
"@astrojs/tailwind": "^5.1.0",
"@types/canvas-confetti": "^1.6.4",
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"autoprefixer": "^10.4.20",
"canvas-confetti": "^1.9.3",
"postcss": "^8.4.41",
diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json
index 2bc1e2d033..88956a94eb 100644
--- a/examples/with-vitest/package.json
+++ b/examples/with-vitest/package.json
@@ -12,7 +12,7 @@
"test": "vitest"
},
"dependencies": {
- "astro": "^4.13.4",
+ "astro": "^4.14.2",
"vitest": "^2.0.5"
}
}
diff --git a/package.json b/package.json
index 5f2eb056c9..850816b5e1 100644
--- a/package.json
+++ b/package.json
@@ -35,7 +35,7 @@
"test:e2e:match": "cd packages/astro && pnpm playwright install chromium firefox && pnpm run test:e2e:match",
"test:e2e:hosts": "turbo run test:hosted",
"benchmark": "astro-benchmark",
- "lint": "eslint . --report-unused-disable-directives",
+ "lint": "biome lint && eslint . --report-unused-disable-directives",
"version": "changeset version && node ./scripts/deps/update-example-versions.js && pnpm install --no-frozen-lockfile && pnpm run format",
"preinstall": "npx only-allow pnpm"
},
@@ -65,7 +65,7 @@
"only-allow": "^1.2.1",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
- "turbo": "^1.13.4",
+ "turbo": "^2.0.12",
"typescript": "~5.5.4",
"typescript-eslint": "^8.0.1"
},
diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md
index 9db8916b24..5c93709a4b 100644
--- a/packages/astro/CHANGELOG.md
+++ b/packages/astro/CHANGELOG.md
@@ -1,5 +1,245 @@
# astro
+## 4.14.2
+
+### Patch Changes
+
+- [#11733](https://github.com/withastro/astro/pull/11733) [`391324d`](https://github.com/withastro/astro/commit/391324df969db71d1c7ca25c2ed14c9eb6eea5ee) Thanks [@bluwy](https://github.com/bluwy)! - Reverts back to `yargs-parser` package for CLI argument parsing
+
+## 4.14.1
+
+### Patch Changes
+
+- [#11725](https://github.com/withastro/astro/pull/11725) [`6c1560f`](https://github.com/withastro/astro/commit/6c1560fb0d19ce659bc9f9090f8050254d5c03f3) Thanks [@ascorbic](https://github.com/ascorbic)! - Prevents content layer importing node builtins in runtime
+
+- [#11692](https://github.com/withastro/astro/pull/11692) [`35af73a`](https://github.com/withastro/astro/commit/35af73aace97a7cc898b9aa5040db8bc2ac62687) Thanks [@matthewp](https://github.com/matthewp)! - Prevent errant HTML from crashing server islands
+
+ When an HTML minifier strips away the server island comment, the script can't correctly know where the end of the fallback content is. This makes it so that it simply doesn't remove any DOM in that scenario. This means the fallback isn't removed, but it also doesn't crash the browser.
+
+- [#11727](https://github.com/withastro/astro/pull/11727) [`3c2f93b`](https://github.com/withastro/astro/commit/3c2f93b66c6b8e9d2ab58e2cbe941c14ffab89b5) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a type issue when using the Content Layer in dev
+
+## 4.14.0
+
+### Minor Changes
+
+- [#11657](https://github.com/withastro/astro/pull/11657) [`a23c69d`](https://github.com/withastro/astro/commit/a23c69d0d0bed229bee52a32e61f135f9ebf9122) Thanks [@bluwy](https://github.com/bluwy)! - Deprecates the option for route-generating files to export a dynamic value for `prerender`. Only static values are now supported (e.g. `export const prerender = true` or `= false`). This allows for better treeshaking and bundling configuration in the future.
+
+ Adds a new [`"astro:route:setup"` hook](https://docs.astro.build/en/reference/integrations-reference/#astroroutesetup) to the Integrations API to allow you to dynamically set options for a route at build or request time through an integration, such as enabling [on-demand server rendering](https://docs.astro.build/en/guides/server-side-rendering/#opting-in-to-pre-rendering-in-server-mode).
+
+ To migrate from a dynamic export to the new hook, update or remove any dynamic `prerender` exports from individual routing files:
+
+ ```diff
+ // src/pages/blog/[slug].astro
+ - export const prerender = import.meta.env.PRERENDER
+ ```
+
+ Instead, create an integration with the `"astro:route:setup"` hook and update the route's `prerender` option:
+
+ ```js
+ // astro.config.mjs
+ import { defineConfig } from 'astro/config';
+ import { loadEnv } from 'vite';
+
+ export default defineConfig({
+ integrations: [setPrerender()],
+ });
+
+ function setPrerender() {
+ const { PRERENDER } = loadEnv(process.env.NODE_ENV, process.cwd(), '');
+
+ return {
+ name: 'set-prerender',
+ hooks: {
+ 'astro:route:setup': ({ route }) => {
+ if (route.component.endsWith('/blog/[slug].astro')) {
+ route.prerender = PRERENDER;
+ }
+ },
+ },
+ };
+ }
+ ```
+
+- [#11360](https://github.com/withastro/astro/pull/11360) [`a79a8b0`](https://github.com/withastro/astro/commit/a79a8b0230b06ed32ce1802f2a5f84a6cf92dbe7) Thanks [@ascorbic](https://github.com/ascorbic)! - Adds a new [`injectTypes()` utility](https://docs.astro.build/en/reference/integrations-reference/#injecttypes-options) to the Integration API and refactors how type generation works
+
+ Use `injectTypes()` in the `astro:config:done` hook to inject types into your user's project by adding a new a `*.d.ts` file.
+
+ The `filename` property will be used to generate a file at `/.astro/integrations//.d.ts` and must end with `".d.ts"`.
+
+ The `content` property will create the body of the file, and must be valid TypeScript.
+
+ Additionally, `injectTypes()` returns a URL to the normalized path so you can overwrite its content later on, or manipulate it in any way you want.
+
+ ```js
+ // my-integration/index.js
+ export default {
+ name: 'my-integration',
+ 'astro:config:done': ({ injectTypes }) => {
+ injectTypes({
+ filename: 'types.d.ts',
+ content: "declare module 'virtual:my-integration' {}",
+ });
+ },
+ };
+ ```
+
+ Codegen has been refactored. Although `src/env.d.ts` will continue to work as is, we recommend you update it:
+
+ ```diff
+ - ///
+ + ///
+ - ///
+ - ///
+ ```
+
+- [#11605](https://github.com/withastro/astro/pull/11605) [`d3d99fb`](https://github.com/withastro/astro/commit/d3d99fba269da9e812e748539a11dfed785ef8a4) Thanks [@jcayzac](https://github.com/jcayzac)! - Adds a new property `meta` to Astro's [built-in `
` component](https://docs.astro.build/en/reference/api-reference/#code-).
+
+ This allows you to provide a value for [Shiki's `meta` attribute](https://shiki.style/guide/transformers#meta) to pass options to transformers.
+
+ The following example passes an option to highlight lines 1 and 3 to Shiki's `tranformerMetaHighlight`:
+
+ ```astro
+ ---
+ // src/components/Card.astro
+ import { Code } from 'astro:components';
+ import { transformerMetaHighlight } from '@shikijs/transformers';
+ ---
+
+
+ ```
+
+- [#11360](https://github.com/withastro/astro/pull/11360) [`a79a8b0`](https://github.com/withastro/astro/commit/a79a8b0230b06ed32ce1802f2a5f84a6cf92dbe7) Thanks [@ascorbic](https://github.com/ascorbic)! - Adds support for Intellisense features (e.g. code completion, quick hints) for your content collection entries in compatible editors under the `experimental.contentIntellisense` flag.
+
+ ```js
+ import { defineConfig } from 'astro';
+
+ export default defineConfig({
+ experimental: {
+ contentIntellisense: true,
+ },
+ });
+ ```
+
+ When enabled, this feature will generate and add JSON schemas to the `.astro` directory in your project. These files can be used by the Astro language server to provide Intellisense inside content files (`.md`, `.mdx`, `.mdoc`).
+
+ Note that at this time, this also require enabling the `astro.content-intellisense` option in your editor, or passing the `contentIntellisense: true` initialization parameter to the Astro language server for editors using it directly.
+
+ See the [experimental content Intellisense docs](https://docs.astro.build/en/reference/configuration-reference/#experimentalcontentintellisense) for more information updates as this feature develops.
+
+- [#11360](https://github.com/withastro/astro/pull/11360) [`a79a8b0`](https://github.com/withastro/astro/commit/a79a8b0230b06ed32ce1802f2a5f84a6cf92dbe7) Thanks [@ascorbic](https://github.com/ascorbic)! - Adds experimental support for the Content Layer API.
+
+ The new Content Layer API builds upon content collections, taking them beyond local files in `src/content/` and allowing you to fetch content from anywhere, including remote APIs. These new collections work alongside your existing content collections, and you can migrate them to the new API at your own pace. There are significant improvements to performance with large collections of local files.
+
+ ### Getting started
+
+ To try out the new Content Layer API, enable it in your Astro config:
+
+ ```js
+ import { defineConfig } from 'astro';
+
+ export default defineConfig({
+ experimental: {
+ contentLayer: true,
+ },
+ });
+ ```
+
+ You can then create collections in your `src/content/config.ts` using the Content Layer API.
+
+ ### Loading your content
+
+ The core of the new Content Layer API is the loader, a function that fetches content from a source and caches it in a local data store. Astro 4.14 ships with built-in `glob()` and `file()` loaders to handle your local Markdown, MDX, Markdoc, and JSON files:
+
+ ```ts {3,7}
+ // src/content/config.ts
+ import { defineCollection, z } from 'astro:content';
+ import { glob } from 'astro/loaders';
+
+ const blog = defineCollection({
+ // The ID is a slug generated from the path of the file relative to `base`
+ loader: glob({ pattern: '**/*.md', base: './src/data/blog' }),
+ schema: z.object({
+ title: z.string(),
+ description: z.string(),
+ publishDate: z.coerce.date(),
+ }),
+ });
+
+ export const collections = { blog };
+ ```
+
+ You can then query using the existing content collections functions, and enjoy a simplified `render()` function to display your content:
+
+ ```astro
+ ---
+ import { getEntry, render } from 'astro:content';
+
+ const post = await getEntry('blog', Astro.params.slug);
+
+ const { Content } = await render(entry);
+ ---
+
+
+ ```
+
+ ### Creating a loader
+
+ You're not restricted to the built-in loaders – we hope you'll try building your own. You can fetch content from anywhere and return an array of entries:
+
+ ```ts
+ // src/content/config.ts
+ const countries = defineCollection({
+ loader: async () => {
+ const response = await fetch('https://restcountries.com/v3.1/all');
+ const data = await response.json();
+ // Must return an array of entries with an id property,
+ // or an object with IDs as keys and entries as values
+ return data.map((country) => ({
+ id: country.cca3,
+ ...country,
+ }));
+ },
+ // optionally add a schema to validate the data and make it type-safe for users
+ // schema: z.object...
+ });
+
+ export const collections = { countries };
+ ```
+
+ For more advanced loading logic, you can define an object loader. This allows incremental updates and conditional loading, and gives full access to the data store. It also allows a loader to define its own schema, including generating it dynamically based on the source API. See the [the Content Layer API RFC](https://github.com/withastro/roadmap/blob/content-layer/proposals/0047-content-layer.md#loaders) for more details.
+
+ ### Sharing your loaders
+
+ Loaders are better when they're shared. You can create a package that exports a loader and publish it to npm, and then anyone can use it on their site. We're excited to see what the community comes up with! To get started, [take a look at some examples](https://github.com/ascorbic/astro-loaders/). Here's how to load content using an RSS/Atom feed loader:
+
+ ```ts
+ // src/content/config.ts
+ import { defineCollection } from 'astro:content';
+ import { feedLoader } from '@ascorbic/feed-loader';
+
+ const podcasts = defineCollection({
+ loader: feedLoader({
+ url: 'https://feeds.99percentinvisible.org/99percentinvisible',
+ }),
+ });
+
+ export const collections = { podcasts };
+ ```
+
+ ### Learn more
+
+ To find out more about using the Content Layer API, check out [the Content Layer RFC](https://github.com/withastro/roadmap/blob/content-layer/proposals/0047-content-layer.md) and [share your feedback](https://github.com/withastro/roadmap/pull/982).
+
+### Patch Changes
+
+- [#11716](https://github.com/withastro/astro/pull/11716) [`f4057c1`](https://github.com/withastro/astro/commit/f4057c18c91f969e3e508545fb988aff94c3ff08) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes content types sync in dev
+
+- [#11645](https://github.com/withastro/astro/pull/11645) [`849e4c6`](https://github.com/withastro/astro/commit/849e4c6c23e61f7fa59f583419048b998bef2475) Thanks [@bluwy](https://github.com/bluwy)! - Refactors internally to use `node:util` `parseArgs` instead of `yargs-parser`
+
+- [#11712](https://github.com/withastro/astro/pull/11712) [`791d809`](https://github.com/withastro/astro/commit/791d809cbc22ed30dda1195ca026daa46a54b551) Thanks [@matthewp](https://github.com/matthewp)! - Fix mixed use of base + trailingSlash in Server Islands
+
+- [#11709](https://github.com/withastro/astro/pull/11709) [`3d8ae76`](https://github.com/withastro/astro/commit/3d8ae767fd4952af7332542b58fe98886eb2e99e) Thanks [@matthewp](https://github.com/matthewp)! - Fix adapter causing Netlify to break
+
## 4.13.4
### Patch Changes
diff --git a/packages/astro/e2e/fixtures/server-islands/astro.config.mjs b/packages/astro/e2e/fixtures/server-islands/astro.config.mjs
index 4bec97b9e1..2175a1bf8f 100644
--- a/packages/astro/e2e/fixtures/server-islands/astro.config.mjs
+++ b/packages/astro/e2e/fixtures/server-islands/astro.config.mjs
@@ -9,7 +9,7 @@ export default defineConfig({
output: 'hybrid',
adapter: nodejs({ mode: 'standalone' }),
integrations: [react(), mdx()],
- trailingSlash: 'always',
+ trailingSlash: process.env.TRAILING_SLASH ?? 'always',
experimental: {
serverIslands: true,
}
diff --git a/packages/astro/e2e/fixtures/server-islands/src/components/HTMLError.astro b/packages/astro/e2e/fixtures/server-islands/src/components/HTMLError.astro
new file mode 100644
index 0000000000..91b1946539
--- /dev/null
+++ b/packages/astro/e2e/fixtures/server-islands/src/components/HTMLError.astro
@@ -0,0 +1 @@
+
diff --git a/packages/astro/e2e/fixtures/server-islands/src/pages/index.astro b/packages/astro/e2e/fixtures/server-islands/src/pages/index.astro
index de9a6c456f..eff5df25e9 100644
--- a/packages/astro/e2e/fixtures/server-islands/src/pages/index.astro
+++ b/packages/astro/e2e/fixtures/server-islands/src/pages/index.astro
@@ -1,6 +1,7 @@
---
import Island from '../components/Island.astro';
import Self from '../components/Self.astro';
+import HTMLError from '../components/HTMLError.astro';
---
@@ -12,5 +13,16 @@ import Self from '../components/Self.astro';
children
+
+
+
+
+
+