3cd66ce08f
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [astro](https://astro.build) ([source](https://redirect.github.com/withastro/astro/tree/HEAD/packages/astro)) | dependencies | minor | [`5.3.1` -> `5.4.0`](https://renovatebot.com/diffs/npm/astro/5.2.6/5.4.0) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. Add the preset `:preserveSemverRanges` to your config if you don't want to pin your dependencies. --- ### Release Notes <details> <summary>withastro/astro (astro)</summary> ### [`v5.4.0`](https://redirect.github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#540) [Compare Source](https://redirect.github.com/withastro/astro/compare/astro@5.3.1...astro@5.4.0) ##### Minor Changes - [#​12052](https://redirect.github.com/withastro/astro/pull/12052) [`5be12b2`](https://redirect.github.com/withastro/astro/commit/5be12b2bc9f359d3ecfa29b766f13ed2aabd119f) Thanks [@​Fryuni](https://redirect.github.com/Fryuni)! - Exposes extra APIs for scripting and testing. ##### Config helpers Two new helper functions exported from `astro/config`: - `mergeConfig()` allows users to merge partially defined Astro configurations on top of a base config while following the merge rules of `updateConfig()` available for integrations. - `validateConfig()` allows users to validate that a given value is a valid Astro configuration and fills in default values as necessary. These helpers are particularly useful for integration authors and for developers writing scripts that need to manipulate Astro configurations programmatically. ##### Programmatic build The `build` API now receives a second optional `BuildOptions` argument where users can specify: - `devOutput` (default `false`): output a development-based build similar to code transformed in `astro dev`. - `teardownCompiler` (default `true`): teardown the compiler WASM instance after build. These options provide more control when running Astro builds programmatically, especially for testing scenarios or custom build pipelines. - [#​13278](https://redirect.github.com/withastro/astro/pull/13278) [`4a43c4b`](https://redirect.github.com/withastro/astro/commit/4a43c4b743affb78b1502801c797157b626c77a1) Thanks [@​ematipico](https://redirect.github.com/ematipico)! - Adds a new configuration option `server.allowedHosts` and CLI option `--allowed-hosts`. Now you can specify the hostnames that the dev and preview servers are allowed to respond to. This is useful for allowing additional subdomains, or running the dev server in a web container. `allowedHosts` checks the Host header on HTTP requests from browsers and if it doesn't match, it will reject the request to prevent CSRF and XSS attacks. ```shell astro dev --allowed-hosts=foo.bar.example.com,bar.example.com ``` ```shell astro preview --allowed-hosts=foo.bar.example.com,bar.example.com ``` ```js // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ server: { allowedHosts: ['foo.bar.example.com', 'bar.example.com'], }, }); ``` This feature is the same as [Vite's `server.allowHosts` configuration](https://vite.dev/config/server-options.html#server-allowedhosts). - [#​13254](https://redirect.github.com/withastro/astro/pull/13254) [`1e11f5e`](https://redirect.github.com/withastro/astro/commit/1e11f5e8b722b179e382f3c792cd961b2b51f61b) Thanks [@​p0lyw0lf](https://redirect.github.com/p0lyw0lf)! - Adds the ability to process and optimize remote images in Markdown files Previously, Astro only allowed local images to be optimized when included using `![]()` syntax in plain Markdown files. Astro's image service could only display remote images without any processing. Now, Astro's image service can also optimize remote images written in standard Markdown syntax. This allows you to enjoy the benefits of Astro's image processing when your images are stored externally, for example in a CMS or digital asset manager. No additional configuration is required to use this feature! Any existing remote images written in Markdown will now automatically be optimized. To opt-out of this processing, write your images in Markdown using the HTML `<img>` tag instead. Note that images located in your `public/` folder are still never processed. ##### Patch Changes - [#​13256](https://redirect.github.com/withastro/astro/pull/13256) [`509fa67`](https://redirect.github.com/withastro/astro/commit/509fa671a137515bd1818c81ee78de439a27e5dc) Thanks [@​p0lyw0lf](https://redirect.github.com/p0lyw0lf)! - Adds experimental responsive image support in Markdown Previously, the `experimental.responsiveImages` feature could only provide responsive images when using the `<Image />` and `<Picture />` components. Now, images written with the `![]()` Markdown syntax in Markdown and MDX files will generate responsive images by default when using this experimental feature. To try this experimental feature, set `experimental.responsiveImages` to true in your `astro.config.mjs` file: ```js { experimental: { responsiveImages: true, }, } ``` Learn more about using this feature in the [experimental responsive images feature reference](https://docs.astro.build/en/reference/experimental-flags/responsive-images/). For a complete overview, and to give feedback on this experimental API, see the [Responsive Images RFC](https://redirect.github.com/withastro/roadmap/blob/responsive-images/proposals/0053-responsive-images.md). - [#​13323](https://redirect.github.com/withastro/astro/pull/13323) [`80926fa`](https://redirect.github.com/withastro/astro/commit/80926fadc06492fcae55f105582b9dc8279da6b3) Thanks [@​ematipico](https://redirect.github.com/ematipico)! - Updates `esbuild` and `vite` to the latest to avoid false positives audits warnings caused by `esbuild`. - [#​13313](https://redirect.github.com/withastro/astro/pull/13313) [`9e7c71d`](https://redirect.github.com/withastro/astro/commit/9e7c71d19c89407d9b27ded85d8c0fde238ce16c) Thanks [@​martrapp](https://redirect.github.com/martrapp)! - Fixes an issue where a form field named "attributes" shadows the form.attributes property. - [#​12052](https://redirect.github.com/withastro/astro/pull/12052) [`5be12b2`](https://redirect.github.com/withastro/astro/commit/5be12b2bc9f359d3ecfa29b766f13ed2aabd119f) Thanks [@​Fryuni](https://redirect.github.com/Fryuni)! - Fixes incorrect config update when calling `updateConfig` from `astro:build:setup` hook. The function previously called a custom update config function made for merging an Astro config. Now it calls the appropriate `mergeConfig()` utility exported by Vite that updates functional options correctly. - [#​13303](https://redirect.github.com/withastro/astro/pull/13303) [`5f72a58`](https://redirect.github.com/withastro/astro/commit/5f72a58935d9bdd5237bdf86d2e94bcdc544c7b3) Thanks [@​ematipico](https://redirect.github.com/ematipico)! - Fixes an issue where the dev server was applying second decoding of the URL of the incoming request, causing issues for certain URLs. - Updated dependencies \[[`1e11f5e`](https://redirect.github.com/withastro/astro/commit/1e11f5e8b722b179e382f3c792cd961b2b51f61b), [`1e11f5e`](https://redirect.github.com/withastro/astro/commit/1e11f5e8b722b179e382f3c792cd961b2b51f61b)]: - [@​astrojs/internal-helpers](https://redirect.github.com/astrojs/internal-helpers)[@​0](https://redirect.github.com/0).6.0 - [@​astrojs/markdown-remark](https://redirect.github.com/astrojs/markdown-remark)[@​6](https://redirect.github.com/6).2.0 ### [`v5.3.1`](https://redirect.github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#531) [Compare Source](https://redirect.github.com/withastro/astro/compare/astro@5.3.0...astro@5.3.1) ##### Patch Changes - [#​13233](https://redirect.github.com/withastro/astro/pull/13233) [`32fafeb`](https://redirect.github.com/withastro/astro/commit/32fafeb874cc4b6312eb50d54d9f0ca6b83aedbc) Thanks [@​joshmkennedy](https://redirect.github.com/joshmkennedy)! - Ensures consistent behaviour of `Astro.rewrite`/`ctx.rewrite` when using `base` and `trailingSlash` options. - [#​13003](https://redirect.github.com/withastro/astro/pull/13003) [`ea79054`](https://redirect.github.com/withastro/astro/commit/ea790542e186b0d2d2e828cb3ebd23bde4d04879) Thanks [@​chaegumi](https://redirect.github.com/chaegumi)! - Fixes a bug that caused the `vite.base` value to be ignored when running `astro dev` - [#​13299](https://redirect.github.com/withastro/astro/pull/13299) [`2e1321e`](https://redirect.github.com/withastro/astro/commit/2e1321e9d5b27da3e86bc4021e4136661a8055aa) Thanks [@​bluwy](https://redirect.github.com/bluwy)! - Uses `tinyglobby` for globbing files - [#​13233](https://redirect.github.com/withastro/astro/pull/13233) [`32fafeb`](https://redirect.github.com/withastro/astro/commit/32fafeb874cc4b6312eb50d54d9f0ca6b83aedbc) Thanks [@​joshmkennedy](https://redirect.github.com/joshmkennedy)! - Ensures that `Astro.url`/`ctx.url` is correctly updated with the `base` path after rewrites. This change fixes an issue where `Astro.url`/`ctx.url` did not include the configured base path after Astro.rewrite was called. Now, the base path is correctly reflected in Astro.url. Previously, any rewrites performed through `Astro.rewrite`/`ctx.rewrite` failed to append the base path to `Astro.url`/`ctx.rewrite`, which could lead to incorrect URL handling in downstream logic. By fixing this, we ensure that all routes remain consistent and predictable after a rewrite. If you were relying on the work around of including the base path in astro.rewrite you can now remove it from the path. ### [`v5.3.0`](https://redirect.github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#530) [Compare Source](https://redirect.github.com/withastro/astro/compare/astro@5.2.6...astro@5.3.0) ##### Minor Changes - [#​13210](https://redirect.github.com/withastro/astro/pull/13210) [`344e9bc`](https://redirect.github.com/withastro/astro/commit/344e9bc480a075161a7811b7733593556e7560da) Thanks [@​VitaliyR](https://redirect.github.com/VitaliyR)! - Handle `HEAD` requests to an endpoint when a handler is not defined. If an endpoint defines a handler for `GET`, but does not define a handler for `HEAD`, Astro will call the `GET` handler and return the headers and status but an empty body. - [#​13195](https://redirect.github.com/withastro/astro/pull/13195) [`3b66955`](https://redirect.github.com/withastro/astro/commit/3b669555d7ab9da5427e7b7037699d4f905d3536) Thanks [@​MatthewLymer](https://redirect.github.com/MatthewLymer)! - Improves SSR performance for synchronous components by avoiding the use of Promises. With this change, SSR rendering of on-demand pages can be up to 4x faster. - [#​13145](https://redirect.github.com/withastro/astro/pull/13145) [`8d4e566`](https://redirect.github.com/withastro/astro/commit/8d4e566f5420c8a5406e1e40e8bae1c1f87cbe37) Thanks [@​ascorbic](https://redirect.github.com/ascorbic)! - Adds support for adapters auto-configuring experimental session storage drivers. Adapters can now configure a default session storage driver when the `experimental.session` flag is enabled. If a hosting platform has a storage primitive that can be used for session storage, the adapter can automatically configure the session storage using that driver. This allows Astro to provide a more seamless experience for users who want to use sessions without needing to manually configure the session storage. ##### Patch Changes - [#​13145](https://redirect.github.com/withastro/astro/pull/13145) [`8d4e566`](https://redirect.github.com/withastro/astro/commit/8d4e566f5420c8a5406e1e40e8bae1c1f87cbe37) Thanks [@​ascorbic](https://redirect.github.com/ascorbic)! - ⚠️ **BREAKING CHANGE FOR EXPERIMENTAL SESSIONS ONLY** ⚠️ Changes the `experimental.session` option to a boolean flag and moves session config to a top-level value. This change is to allow the new automatic session driver support. You now need to separately enable the `experimental.session` flag, and then configure the session driver using the top-level `session` key if providing manual configuration. ```diff defineConfig({ // ... experimental: { - session: { - driver: 'upstash', - }, + session: true, }, + session: { + driver: 'upstash', + }, }); ``` You no longer need to configure a session driver if you are using an adapter that supports automatic session driver configuration and wish to use its default settings. ```diff defineConfig({ adapter: node({ mode: "standalone", }), experimental: { - session: { - driver: 'fs', - cookie: 'astro-cookie', - }, + session: true, }, + session: { + cookie: 'astro-cookie', + }, }); ``` However, you can still manually configure additional driver options or choose a non-default driver to use with your adapter with the new top-level `session` config option. For more information, see the [experimental session docs](https://docs.astro.build/en/reference/experimental-flags/sessions/). - [#​13101](https://redirect.github.com/withastro/astro/pull/13101) [`2ed67d5`](https://redirect.github.com/withastro/astro/commit/2ed67d5dc5c8056f9ab1e29e539bf086b93c60c2) Thanks [@​corneliusroemer](https://redirect.github.com/corneliusroemer)! - Fixes a bug where `HEAD` and `OPTIONS` requests for non-prerendered pages were incorrectly rejected with 403 FORBIDDEN </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNzkuMSIsInVwZGF0ZWRJblZlciI6IjM5LjE3OS4xIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbImF1dG9tZXJnZSIsInJlbm92YXRlL2NvbnRhaW5lciIsInR5cGUvbWlub3IiXX0=-->
Chart Docs
News
- To add new authors, add their username in the
authors.tsfile insrc/content/docs/news/authors.ts. - News Posts must have these fields in the
frontmatter:titleslug(must start withnews/)dateauthors(The key in theauthorsobject insrc/content/docs/news/authors.ts)
Supported Code Block Languages
Check upstream docs
🧞 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 dev-windows |
Starts local dev server on windows machines |
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 |
Starlight looks for .md or .mdx files in the src/content/docs/ directory. Each file is exposed as a route based on its file name.
Images can be added to src/assets/ and embedded in Markdown with a relative link.
Static assets, like favicons, can be placed in the public/ directory.
👀 Want to learn more?
Check out Starlight’s docs, read the Astro documentation, or jump into the Astro Discord server.