0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

Merge branch 'main' into main

This commit is contained in:
Jahir Vidrio 2024-10-15 11:29:27 -06:00 committed by GitHub
commit e1c664da93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
165 changed files with 2110 additions and 2565 deletions

View file

@ -1,5 +0,0 @@
---
'@astrojs/sitemap': patch
---
Adds missing `xslURL` property to `SitemapOptions` type.

View file

@ -1,7 +0,0 @@
---
'astro': patch
---
Fixes a false positive reported by the dev toolbar Audit app where a label was considered missing when associated with a button
The `button` element can be [used with a label](https://www.w3.org/TR/2011/WD-html5-author-20110809/forms.html#category-label) (e.g. to create a switch) and should not be reported as an accessibility issue when used as a child of a `label`.

View file

@ -1,5 +0,0 @@
---
'astro': patch
---
Fixes a regression in the computation of `Astro.currentLocale`

View file

@ -1,5 +0,0 @@
---
'astro': patch
---
Fixes an issue where the edge middleware couldn't correctly compute the client IP address when calling `ctx.clientAddress()`

3
.gitignore vendored
View file

@ -21,7 +21,8 @@ package-lock.json
packages/astro/src/**/*.prebuilt.ts
packages/astro/src/**/*.prebuilt-dev.ts
!packages/astro/vendor/vite/dist
packages/astro/test/units/_temp-fixtures/*
!packages/astro/test/units/_temp-fixtures/package.json
packages/integrations/**/.netlify/
# exclude IntelliJ/WebStorm stuff

View file

@ -12,7 +12,7 @@ We welcome contributions of any size and skill level. As an open source project,
```shell
node: "^>=18.17.1"
pnpm: "^9.3.0"
pnpm: "^9.12.1"
# otherwise, your build will fail
```

View file

@ -6,6 +6,7 @@
"**/dist/**",
"**/smoke/**",
"**/fixtures/**",
"**/_temp-fixtures/**",
"**/vendor/**",
"**/.vercel/**",
],

View file

@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.16.3"
"astro": "^4.16.5"
}
}

View file

@ -12,8 +12,8 @@
},
"dependencies": {
"@astrojs/mdx": "^3.1.8",
"@astrojs/rss": "^4.0.8",
"@astrojs/sitemap": "^3.2.0",
"astro": "^4.16.3"
"@astrojs/rss": "^4.0.9",
"@astrojs/sitemap": "^3.2.1",
"astro": "^4.16.5"
}
}

View file

@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.16.3"
"astro": "^4.16.5"
},
"peerDependencies": {
"astro": "^4.0.0"

View file

@ -12,14 +12,14 @@
"test": "vitest run"
},
"dependencies": {
"astro": "^4.16.3",
"astro": "^4.16.5",
"@astrojs/react": "^3.6.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vitest": "^2.1.2"
"vitest": "^2.1.3"
},
"devDependencies": {
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0"
"@types/react-dom": "^18.3.1"
}
}

View file

@ -14,6 +14,6 @@
"@astrojs/alpinejs": "^0.4.0",
"@types/alpinejs": "^3.13.10",
"alpinejs": "^3.14.1",
"astro": "^4.16.3"
"astro": "^4.16.5"
}
}

View file

@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/lit": "^4.3.0",
"@webcomponents/template-shadowroot": "^0.2.1",
"astro": "^4.16.3",
"lit": "^3.2.0"
"astro": "^4.16.5",
"lit": "^3.2.1"
}
}

View file

@ -17,13 +17,13 @@
"@astrojs/svelte": "^5.7.2",
"@astrojs/vue": "^4.5.2",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"astro": "^4.16.3",
"preact": "^10.24.2",
"@types/react-dom": "^18.3.1",
"astro": "^4.16.5",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"solid-js": "^1.9.1",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.5.3",
"@preact/signals": "^1.3.0",
"astro": "^4.16.3",
"preact": "^10.24.2"
"astro": "^4.16.5",
"preact": "^10.24.3"
}
}

View file

@ -13,8 +13,8 @@
"dependencies": {
"@astrojs/react": "^3.6.2",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"astro": "^4.16.3",
"@types/react-dom": "^18.3.1",
"astro": "^4.16.5",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}

View file

@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^4.4.2",
"astro": "^4.16.3",
"solid-js": "^1.9.1"
"astro": "^4.16.5",
"solid-js": "^1.9.2"
}
}

View file

@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/svelte": "^5.7.2",
"astro": "^4.16.3",
"astro": "^4.16.5",
"svelte": "^4.2.19"
}
}

View file

@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/vue": "^4.5.2",
"astro": "^4.16.3",
"vue": "^3.5.11"
"astro": "^4.16.5",
"vue": "^3.5.12"
}
}

View file

@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/node": "^8.3.4",
"astro": "^4.16.3"
"astro": "^4.16.5"
}
}

View file

@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.16.3"
"astro": "^4.16.5"
},
"peerDependencies": {
"astro": "^4.0.0"

View file

@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.16.3"
"astro": "^4.16.5"
}
}

View file

@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.16.3"
"astro": "^4.16.5"
}
}

View file

@ -14,7 +14,7 @@
"dependencies": {
"@astrojs/node": "^8.3.4",
"@astrojs/svelte": "^5.7.2",
"astro": "^4.16.3",
"astro": "^4.16.5",
"svelte": "^4.2.19"
}
}

View file

@ -10,8 +10,8 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.16.3",
"sass": "^1.79.4",
"astro": "^4.16.5",
"sass": "^1.79.5",
"sharp": "^0.33.3"
}
}

View file

@ -15,6 +15,6 @@
"./app": "./dist/app.js"
},
"devDependencies": {
"astro": "^4.16.3"
"astro": "^4.16.5"
}
}

View file

@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.11.5",
"astro": "^4.16.3"
"astro": "^4.16.5"
}
}

View file

@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/mdx": "^3.1.8",
"@astrojs/preact": "^3.5.3",
"astro": "^4.16.3",
"preact": "^10.24.2"
"astro": "^4.16.5",
"preact": "^10.24.3"
}
}

View file

@ -13,8 +13,8 @@
"dependencies": {
"@astrojs/preact": "^3.5.3",
"@nanostores/preact": "^0.5.2",
"astro": "^4.16.3",
"astro": "^4.16.5",
"nanostores": "^0.11.3",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -14,7 +14,7 @@
"@astrojs/mdx": "^3.1.8",
"@astrojs/tailwind": "^5.1.2",
"@types/canvas-confetti": "^1.6.4",
"astro": "^4.16.3",
"astro": "^4.16.5",
"autoprefixer": "^10.4.20",
"canvas-confetti": "^1.9.3",
"postcss": "^8.4.47",

View file

@ -12,7 +12,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^4.16.3",
"vitest": "^2.1.2"
"astro": "^4.16.5",
"vitest": "^2.1.3"
}
}

View file

@ -49,7 +49,7 @@
"engines": {
"node": "^18.17.1 || ^20.3.0 || >=21.0.0"
},
"packageManager": "pnpm@9.6.0",
"packageManager": "pnpm@9.12.1",
"dependencies": {
"astro-benchmark": "workspace:*"
},
@ -67,8 +67,8 @@
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"turbo": "^2.1.3",
"typescript": "~5.6.2",
"typescript-eslint": "^8.8.0"
"typescript": "~5.6.3",
"typescript-eslint": "^8.9.0"
},
"pnpm": {
"peerDependencyRules": {
@ -87,6 +87,9 @@
"allowAny": [
"astro"
]
},
"patchedDependencies": {
"fs-fixture@2.4.0": "patches/fs-fixture@2.4.0.patch"
}
}
}

View file

@ -1,5 +1,11 @@
# @astrojs/rss
## 4.0.9
### Patch Changes
- [#12157](https://github.com/withastro/astro/pull/12157) [`925cff3`](https://github.com/withastro/astro/commit/925cff31bc040874e73decd6a6b3a5ba84c60258) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Improves README configuration reference.
## 4.0.8
### Patch Changes

View file

@ -2,80 +2,13 @@
This package brings fast RSS feed generation to blogs and other content sites built with [Astro](https://astro.build/). For more information about RSS feeds in general, see [aboutfeeds.com](https://aboutfeeds.com/).
## Installation
## Installation and use
Install the `@astrojs/rss` package into any Astro project using your preferred package manager:
```bash
# npm
npm i @astrojs/rss
# yarn
yarn add @astrojs/rss
# pnpm
pnpm i @astrojs/rss
```
## Example usage
The `@astrojs/rss` package provides helpers for generating RSS feeds within [Astro endpoints][astro-endpoints]. This unlocks both static builds _and_ on-demand generation when using an [SSR adapter](https://docs.astro.build/en/guides/server-side-rendering/).
For instance, say you need to generate an RSS feed for all posts under `src/content/blog/` using content collections.
Start by [adding a `site` to your project's `astro.config` for link generation](https://docs.astro.build/en/reference/configuration-reference/#site). Then, create an `rss.xml.js` file under your project's `src/pages/` directory, and [use `getCollection()`](https://docs.astro.build/en/guides/content-collections/#getcollection) to generate a feed from all documents in the `blog` collection:
```js
// src/pages/rss.xml.js
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
export async function GET(context) {
const posts = await getCollection('blog');
return rss({
title: 'Buzzs Blog',
description: 'A humble Astronauts guide to the stars',
// Pull in your project "site" from the endpoint context
// https://docs.astro.build/en/reference/api-reference/#contextsite
site: context.site,
items: posts.map((post) => ({
// Assumes all RSS feed item properties are in post frontmatter
...post.data,
// Generate a `url` from each post `slug`
// This assumes all blog posts are rendered as `/blog/[slug]` routes
// https://docs.astro.build/en/guides/content-collections/#generating-pages-from-content-collections
link: `/blog/${post.slug}/`,
})),
});
}
```
Read **[Astro's RSS docs][astro-rss]** for more on using content collections, and instructions for globbing entries in `/src/pages/`.
See the [`@astrojs/rss` guide in the Astro docs][docs] for installation and usage examples.
## `rss()` configuration options
The `rss` default export offers a number of configuration options. Here's a quick reference:
```js
export function GET(context) {
return rss({
// `<title>` field in output xml
title: 'Buzzs Blog',
// `<description>` field in output xml
description: 'A humble Astronauts guide to the stars',
// provide a base URL for RSS <item> links
site: context.site,
// list of `<item>`s in output xml
items: [],
// (optional) absolute path to XSL stylesheet in your project
stylesheet: '/rss-styles.xsl',
// (optional) inject custom xml
customData: '<language>en-us</language>',
// (optional) add arbitrary metadata to opening <rss> tag
xmlns: { h: 'http://www.w3.org/TR/html4/' },
// (optional) add trailing slashes to URLs (default: true)
trailingSlash: false,
});
}
```
The `rss()` utility function offers a number of configuration options to generate your feed.
### title
@ -109,81 +42,9 @@ export const GET = (context) =>
Type: `RSSFeedItem[] (required)`
A list of formatted RSS feed items. See [Astro's RSS items documentation](https://docs.astro.build/en/guides/rss/#generating-items) for usage examples to choose the best option for you.
A list of formatted RSS feed items.
When providing a formatted RSS item list, see the [`RSSFeedItem` type reference](#rssfeeditem).
### stylesheet
Type: `string (optional)`
An absolute path to an XSL stylesheet in your project. If you dont have an RSS stylesheet in mind, we recommend the [Pretty Feed v3 default stylesheet](https://github.com/genmon/aboutfeeds/blob/main/tools/pretty-feed-v3.xsl), which you can download from GitHub and save into your project's `public/` directory.
### customData
Type: `string (optional)`
A string of valid XML to be injected between your feed's `<description>` and `<item>` tags. This is commonly used to set a language for your feed:
```js
import rss from '@astrojs/rss';
export const GET = () => rss({
...
customData: '<language>en-us</language>',
});
```
### xmlns
Type: `Record<string, string> (optional)`
An object mapping a set of `xmlns` suffixes to strings of metadata on the opening `<rss>` tag.
For example, this object:
```js
rss({
...
xmlns: { h: 'http://www.w3.org/TR/html4/' },
})
```
Will inject the following XML:
```xml
<rss xmlns:h="http://www.w3.org/TR/html4/"...
```
### content
The `content` key contains the full content of the post as HTML. This allows you to make your entire post content available to RSS feed readers.
**Note:** Whenever you're using HTML content in XML, we suggest using a package like [`sanitize-html`](https://www.npmjs.com/package/sanitize-html) in order to make sure that your content is properly sanitized, escaped, and encoded.
[See our RSS documentation](https://docs.astro.build/en/guides/rss/#including-full-post-content) for examples using content collections and glob imports.
### `trailingSlash`
Type: `boolean (optional)`
Default: `true`
By default, the library will add trailing slashes to the emitted URLs. To prevent this behavior, add `trailingSlash: false` to the `rss` function.
```js
import rss from '@astrojs/rss';
export const GET = () =>
rss({
trailingSlash: false,
});
```
## `RSSFeedItem`
An `RSSFeedItem` is a single item in the list of items in your feed. It represents a story, with `link`, `title`, and `pubDate` fields. There are further optional fields defined below. You can also check the definitions for the fields in the [RSS spec](https://validator.w3.org/feed/docs/rss2.html#ltpubdategtSubelementOfLtitemgt).
An example feed item might look like:
An `RSSFeedItem` is a single item in the list of items in your feed. An example feed item might look like:
```js
const item = {
@ -196,59 +57,59 @@ const item = {
};
```
### `title`
#### `title`
Type: `string (optional)`
The title of the item in the feed. Optional only if a description is set. Otherwise, required.
### `link`
#### `link`
Type: `string (optional)`
The URL of the item on the web.
### `pubDate`
#### `pubDate`
Type: `Date (optional)`
Indicates when the item was published.
### `description`
#### `description`
Type: `string (optional)`
A synopsis of your item when you are publishing the full content of the item in the `content` field. The `description` may alternatively be the full content of the item in the feed if you are not using the `content` field (entity-coded HTML is permitted). Optional only if a title is set. Otherwise, required.
### `content`
#### `content`
Type: `string (optional)`
The full text content of the item suitable for presentation as HTML. If used, you should also provide a short article summary in the `description` field.
See the [recommendations from the RSS spec for how to use and differentiate between `description` and `content`](https://www.rssboard.org/rss-profile#namespace-elements-content-encoded).
To render Markdown content from a glob result or from a content collection, see the [content rendering guide](https://docs.astro.build/en/guides/rss/#including-full-post-content).
### `categories`
#### `categories`
Type: `string[] (optional)`
A list of any tags or categories to categorize your content. They will be output as multiple `<category>` elements.
### `author`
#### `author`
Type: `string (optional)`
The email address of the item author. This is useful for indicating the author of a post on multi-author blogs.
### `commentsUrl`
#### `commentsUrl`
Type: `string (optional)`
The URL of a web page that contains comments on the item.
### `source`
#### `source`
Type: `object (optional)`
Type: `{ title: string, url: string } (optional)`
An object that defines the `title` and `url` of the original feed for items that have been republished from another source. Both are required properties of `source` for proper attribution.
@ -266,31 +127,15 @@ const item = {
};
```
#### `source.title`
#### `enclosure`
Type: `string (required)`
The name of the original feed in which the item was published. (Note that this is the feed's title, not the individual article title.)
#### `source.url`
Type: `string (required)`
The URL of the original feed in which the item was published.
### `enclosure`
Type: `object (optional)`
Type: `{ url: string, type: string, length: number } (optional)`
An object to specify properties for an included media source (e.g. a podcast) with three required values: `url`, `length`, and `type`.
```js
const item = {
title: 'Alpha Centauri: so close you can touch it',
link: '/blog/alpha-centuari',
pubDate: new Date('2023-06-04'),
description:
'Alpha Centauri is a triple star system, containing Proxima Centauri, the closest star to our sun at only 4.24 light-years away.',
/* ... */
enclosure: {
url: '/media/alpha-centauri.aac',
length: 124568,
@ -299,25 +144,77 @@ const item = {
};
```
#### `enclosure.url`
- `enclosure.url` is the URL where the media can be found. If the media is hosted outside of your own domain you must provide a full URL.
- `enclosure.length` is the size of the file found at the `url` in bytes.
- `enclosure.type` is the [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) for the media item found at the `url`.
Type: `string (required)`
### stylesheet
The URL where the media can be found. If the media is hosted outside of your own domain you must provide a full URL.
Type: `string (optional)`
#### `enclosure.length`
An absolute path to an XSL stylesheet in your project. If you dont have an RSS stylesheet in mind, we recommend the [Pretty Feed v3 default stylesheet](https://github.com/genmon/aboutfeeds/blob/main/tools/pretty-feed-v3.xsl), which you can download from GitHub and save into your project's `public/` directory.
Type: `number (required)`
### customData
The size of the file found at the `url` in bytes.
Type: `string (optional)`
#### `enclosure.type`
A string of valid XML to be injected between your feed's `<description>` and `<item>` tags.
Type: `string (required)`
This can be used to pass additional data outside of the standard RSS spec, and is commonly used to set a language for your feed:
The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) for the media item found at the `url`.
```js
import rss from '@astrojs/rss';
## `rssSchema`
export const GET = () => rss({
...
customData: '<language>en-us</language>',
});
```
### xmlns
Type: `Record<string, string> (optional)`
An object mapping a set of `xmlns` suffixes to strings values on the opening `<rss>` tag.
Suffixes expand the available XML tags in your RSS feed, so your content may be read by third-party sources like podcast services or blogging platforms. You'll likely combine `xmlns` with the [`customData`](#customData) attribute to insert custom tags for a given platform.
This example applies the `itunes` suffix to an RSS feed of podcasts, and uses `customData` to define tags for the author and episode details:
```js
rss({
// ...
xmlns: {
itunes: 'http://www.itunes.com/dtds/podcast-1.0.dtd',
},
customData: '<itunes:author>MF Doom</itunes:author>',
items: episodes.map((episode) => ({
// ...
customData:
`<itunes:episodeType>${episode.frontmatter.type}</itunes:episodeType>` +
`<itunes:duration>${episode.frontmatter.duration}</itunes:duration>` +
`<itunes:explicit>${episode.frontmatter.explicit || false}</itunes:explicit>`,
})),
});
```
### `trailingSlash`
Type: `boolean (optional)`
Default: `true`
By default, trailing slashes will be added to the URLs of your feed entries. To prevent this behavior, add `trailingSlash: false` to the `rss` function.
```js
import rss from '@astrojs/rss';
export const GET = () =>
rss({
trailingSlash: false,
});
```
## The `rssSchema` validator
When using content collections, you can configure your collection schema to enforce expected [`RSSFeedItem`](#items) properties. Import and apply `rssSchema` to ensure that each collection entry produces a valid RSS feed item:
@ -343,7 +240,7 @@ const blog = defineCollection({
});
```
## `pagesGlobToRssItems()`
## The `pagesGlobToRssItems()` function
To create an RSS feed from documents in `src/pages/`, use the `pagesGlobToRssItems()` helper. This accepts an `import.meta.glob` result ([see Vite documentation](https://vite.dev/guide/features.html#glob-import)) and outputs an array of valid [`RSSFeedItem`s](#items).
@ -363,7 +260,7 @@ export async function GET(context) {
}
```
## `getRssString()`
## The `getRssString()` function
As `rss()` returns a `Response`, you can also use `getRssString()` to get the RSS string directly and use it in your own response:
@ -385,7 +282,35 @@ export async function GET(context) {
}
```
For more on building with Astro, [visit the Astro docs][astro-rss].
## Support
[astro-rss]: https://docs.astro.build/en/guides/rss/#using-astrojsrss-recommended
- Get help in the [Astro Discord][discord]. Post questions in our `#support` forum, or visit our dedicated `#dev` channel to discuss current development and more!
- Check our [Astro Integration Documentation][astro-integration] for more on integrations.
- Submit bug reports and feature requests as [GitHub issues][issues].
## Contributing
This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! These links will help you get started:
- [Contributor Manual][contributing]
- [Code of Conduct][coc]
- [Community Guide][community]
## License
MIT
Copyright (c) 2023present [Astro][astro]
[docs]: https://docs.astro.build/en/guides/rss/
[astro-endpoints]: https://docs.astro.build/en/core-concepts/astro-pages/#non-html-pages
[astro]: https://astro.build/
[docs]: https://docs.astro.build/en/guides/integrations-guide/alpinejs/
[contributing]: https://github.com/withastro/astro/blob/main/CONTRIBUTING.md
[coc]: https://github.com/withastro/.github/blob/main/CODE_OF_CONDUCT.md
[community]: https://github.com/withastro/.github/blob/main/COMMUNITY_GUIDE.md
[discord]: https://astro.build/chat/
[issues]: https://github.com/withastro/astro/issues
[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/

View file

@ -1,7 +1,7 @@
{
"name": "@astrojs/rss",
"description": "Add RSS feeds to your Astro projects",
"version": "4.0.8",
"version": "4.0.9",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",

View file

@ -1,5 +1,23 @@
# astro
## 4.16.5
### Patch Changes
- [#12232](https://github.com/withastro/astro/pull/12232) [`ff68ba5`](https://github.com/withastro/astro/commit/ff68ba5e1ca00f06d1afd5fbf89acea3092bb660) Thanks [@martrapp](https://github.com/martrapp)! - Fixes an issue with cssesc in dev mode when setting `vite.ssr.noExternal: true`
## 4.16.4
### Patch Changes
- [#12223](https://github.com/withastro/astro/pull/12223) [`79ffa5d`](https://github.com/withastro/astro/commit/79ffa5d9f75c16465134aa4ed4a3d1d59908ba8b) Thanks [@ArmandPhilippot](https://github.com/ArmandPhilippot)! - Fixes a false positive reported by the dev toolbar Audit app where a label was considered missing when associated with a button
The `button` element can be [used with a label](https://www.w3.org/TR/2011/WD-html5-author-20110809/forms.html#category-label) (e.g. to create a switch) and should not be reported as an accessibility issue when used as a child of a `label`.
- [#12199](https://github.com/withastro/astro/pull/12199) [`c351352`](https://github.com/withastro/astro/commit/c3513523608f319b43c050e391be08e68b801329) Thanks [@ematipico](https://github.com/ematipico)! - Fixes a regression in the computation of `Astro.currentLocale`
- [#12222](https://github.com/withastro/astro/pull/12222) [`fb55695`](https://github.com/withastro/astro/commit/fb5569583b11ef585cd0a79e97e7e9dc653f6afa) Thanks [@ematipico](https://github.com/ematipico)! - Fixes an issue where the edge middleware couldn't correctly compute the client IP address when calling `ctx.clientAddress()`
## 4.16.3
### Patch Changes

View file

@ -15,10 +15,10 @@
"@astrojs/node": "^8.3.4",
"@astrojs/react": "workspace:*",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"@types/react-dom": "^18.3.1",
"astro": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
}
}

View file

@ -19,7 +19,7 @@
"astro": "workspace:*",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-dom": "19.0.0-rc-fb9a90fa48-20240614",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"overrides": {
"@types/react": "npm:types-react",

View file

@ -6,6 +6,6 @@
"@astrojs/preact": "workspace:*",
"@e2e/astro-linked-lib": "link:../_deps/astro-linked-lib",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -5,6 +5,6 @@
"dependencies": {
"@astrojs/vue": "workspace:*",
"astro": "workspace:*",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -11,11 +11,11 @@
"astro": "workspace:*"
},
"dependencies": {
"preact": "^10.24.2",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"solid-js": "^1.9.1",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -5,6 +5,6 @@
"dependencies": {
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -5,6 +5,6 @@
"dependencies": {
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"astro": "workspace:*",
"sass": "^1.79.4"
"sass": "^1.79.5"
}
}

View file

@ -9,12 +9,12 @@
"@astrojs/svelte": "workspace:*",
"@astrojs/vue": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sass": "^1.79.4",
"solid-js": "^1.9.1",
"sass": "^1.79.5",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -4,6 +4,6 @@
"private": true,
"devDependencies": {
"astro": "workspace:*",
"sass": "^1.79.4"
"sass": "^1.79.5"
}
}

View file

@ -9,6 +9,6 @@
"dependencies": {
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -6,6 +6,6 @@
"@astrojs/lit": "workspace:*",
"@webcomponents/template-shadowroot": "^0.2.1",
"astro": "workspace:*",
"lit": "^3.2.0"
"lit": "^3.2.1"
}
}

View file

@ -13,12 +13,12 @@
},
"dependencies": {
"@webcomponents/template-shadowroot": "^0.2.1",
"lit": "^3.2.0",
"preact": "^10.24.2",
"lit": "^3.2.1",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"solid-js": "^1.9.1",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -8,6 +8,6 @@
"astro": "workspace:*"
},
"dependencies": {
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -11,11 +11,11 @@
"astro": "workspace:*"
},
"dependencies": {
"preact": "^10.24.2",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"solid-js": "^1.9.1",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -11,11 +11,11 @@
"astro": "workspace:*"
},
"dependencies": {
"preact": "^10.24.2",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"solid-js": "^1.9.1",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -11,11 +11,11 @@
"astro": "workspace:*"
},
"dependencies": {
"preact": "^10.24.2",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"solid-js": "^1.9.1",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -11,11 +11,11 @@
"astro": "workspace:*"
},
"dependencies": {
"preact": "^10.24.2",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"solid-js": "^1.9.1",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -11,11 +11,11 @@
"astro": "workspace:*"
},
"dependencies": {
"preact": "^10.24.2",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"solid-js": "^1.9.1",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -11,12 +11,12 @@
"astro": "workspace:*"
},
"dependencies": {
"preact": "^10.24.2",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"solid-js": "^1.9.1",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
},
"scripts": {
"dev": "astro dev"

View file

@ -5,6 +5,6 @@
"dependencies": {
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -6,6 +6,6 @@
"@astrojs/mdx": "workspace:*",
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -6,6 +6,6 @@
"@astrojs/mdx": "workspace:*",
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -7,6 +7,6 @@
"astro": "workspace:*"
},
"devDependencies": {
"solid-js": "^1.9.1"
"solid-js": "^1.9.2"
}
}

View file

@ -6,6 +6,6 @@
"@astrojs/mdx": "workspace:*",
"@astrojs/solid-js": "workspace:*",
"astro": "workspace:*",
"solid-js": "^1.9.1"
"solid-js": "^1.9.2"
}
}

View file

@ -7,6 +7,6 @@
"astro": "workspace:*"
},
"devDependencies": {
"solid-js": "^1.9.1"
"solid-js": "^1.9.2"
}
}

View file

@ -12,7 +12,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"svelte": "^4.2.19",
"vue": "^3.5.11",
"solid-js": "^1.9.1"
"vue": "^3.5.12",
"solid-js": "^1.9.2"
}
}

View file

@ -6,6 +6,6 @@
"@astrojs/mdx": "workspace:*",
"@astrojs/vue": "workspace:*",
"astro": "workspace:*",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -1,6 +1,6 @@
{
"name": "astro",
"version": "4.16.3",
"version": "4.16.5",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
@ -112,23 +112,24 @@
"build": "pnpm run prebuild && astro-scripts build \"src/**/*.{ts,js}\" --copy-wasm && tsc",
"build:ci": "pnpm run prebuild && astro-scripts build \"src/**/*.{ts,js}\" --copy-wasm",
"dev": "astro-scripts dev --copy-wasm --prebuild \"src/runtime/server/astro-island.ts\" --prebuild \"src/runtime/client/{idle,load,media,only,visible}.ts\" \"src/**/*.{ts,js}\"",
"test": "pnpm run test:node && pnpm run test:types",
"test:match": "pnpm run test:node --match",
"test": "pnpm run test:unit && pnpm run test:integration && pnpm run test:types",
"test:match": "astro-scripts test \"test/**/*.test.js\" --match",
"test:e2e": "pnpm test:e2e:chrome && pnpm test:e2e:firefox",
"test:e2e:match": "playwright test -g",
"test:e2e:chrome": "playwright test",
"test:e2e:firefox": "playwright test --config playwright.firefox.config.js",
"test:types": "tsc --project tsconfig.tests.json",
"test:node": "astro-scripts test \"test/**/*.test.js\""
"test:unit": "astro-scripts test \"test/units/**/*.test.js\" --teardown ./test/units/teardown.js",
"test:integration": "astro-scripts test \"test/*.test.js\""
},
"dependencies": {
"@astrojs/compiler": "^2.10.3",
"@astrojs/internal-helpers": "workspace:*",
"@astrojs/markdown-remark": "workspace:*",
"@astrojs/telemetry": "workspace:*",
"@babel/core": "^7.25.7",
"@babel/core": "^7.25.8",
"@babel/plugin-transform-react-jsx": "^7.25.7",
"@babel/types": "^7.25.7",
"@babel/types": "^7.25.8",
"@oslojs/encoding": "^1.1.0",
"@rollup/pluginutils": "^5.1.2",
"@types/babel__core": "^7.20.5",
@ -159,7 +160,7 @@
"http-cache-semantics": "^4.1.1",
"js-yaml": "^4.1.0",
"kleur": "^4.1.5",
"magic-string": "^0.30.11",
"magic-string": "^0.30.12",
"magicast": "^0.3.5",
"micromatch": "^4.0.8",
"mrmime": "^2.0.0",
@ -173,11 +174,11 @@
"semver": "^7.6.3",
"shiki": "^1.22.0",
"tinyexec": "^0.3.0",
"tsconfck": "^3.1.3",
"tsconfck": "^3.1.4",
"unist-util-visit": "^5.0.0",
"vfile": "^6.0.3",
"vite": "^5.4.8",
"vitefu": "^1.0.2",
"vite": "^5.4.9",
"vitefu": "^1.0.3",
"which-pm": "^3.0.0",
"xxhash-wasm": "^1.0.2",
"yargs-parser": "^21.1.1",
@ -190,12 +191,12 @@
},
"devDependencies": {
"@astrojs/check": "^0.9.4",
"@playwright/test": "^1.47.2",
"@playwright/test": "^1.48.0",
"@types/aria-query": "^5.0.4",
"@types/common-ancestor-path": "^1.0.2",
"@types/cssesc": "^3.0.2",
"@types/debug": "^4.1.12",
"@types/diff": "^5.2.2",
"@types/diff": "^5.2.3",
"@types/dlv": "^1.1.4",
"@types/hast": "^3.0.4",
"@types/html-escaper": "^3.0.2",
@ -209,10 +210,10 @@
"cheerio": "1.0.0",
"eol": "^0.10.0",
"execa": "^8.0.1",
"expect-type": "^1.0.0",
"expect-type": "^1.1.0",
"fs-fixture": "^2.4.0",
"mdast-util-mdx": "^3.0.0",
"mdast-util-mdx-jsx": "^3.1.3",
"memfs": "^4.12.0",
"node-mocks-http": "^1.16.1",
"parse-srcset": "^1.0.2",
"rehype-autolink-headings": "^7.1.0",
@ -220,8 +221,8 @@
"rehype-toc": "^3.0.2",
"remark-code-titles": "^0.1.2",
"rollup": "^4.24.0",
"sass": "^1.79.4",
"undici": "^6.19.8",
"sass": "^1.79.5",
"undici": "^6.20.1",
"unified": "^11.0.5"
},
"engines": {

View file

@ -17,7 +17,7 @@
"@astrojs/react": "workspace:*",
"@performance/utils": "workspace:*",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"@types/react-dom": "^18.3.1",
"astro": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"

View file

@ -18,7 +18,7 @@
"@astrojs/react": "workspace:*",
"@performance/utils": "workspace:*",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"@types/react-dom": "^18.3.1",
"astro": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"

View file

@ -18,7 +18,7 @@
"@astrojs/react": "workspace:*",
"@performance/utils": "workspace:*",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"@types/react-dom": "^18.3.1",
"astro": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"

View file

@ -71,6 +71,8 @@ const ONLY_DEV_EXTERNAL = [
'prismjs/components/index.js',
// Imported by `astro/assets` -> `packages/astro/src/core/logger/core.ts`
'string-width',
// Imported by `astro:transitions` -> packages/astro/src/runtime/server/transition.ts
'cssesc',
];
/** Return a base vite config as a common starting point for all Vite commands. */

View file

@ -77,6 +77,9 @@ export default function createVitePluginAstroServer({
}
process.on('unhandledRejection', handleUnhandledRejection);
viteServer.httpServer?.on('close', () => {
process.off('unhandledRejection', handleUnhandledRejection);
});
return () => {
// Push this middleware to the front of the stack so that it can intercept responses.

View file

@ -10,6 +10,6 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -6,6 +6,6 @@
"@astrojs/mdx": "workspace:*",
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -7,8 +7,8 @@
"@astrojs/svelte": "workspace:*",
"@astrojs/vue": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2",
"preact": "^10.24.3",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -5,6 +5,6 @@
"dependencies": {
"@astrojs/vue": "workspace:*",
"astro": "workspace:*",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -5,6 +5,6 @@
"dependencies": {
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -5,6 +5,6 @@
"dependencies": {
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"astro": "workspace:*",
"hast-util-select": "^6.0.2",
"hast-util-select": "^6.0.3",
"rehype-slug": "^6.0.0"
}
}

View file

@ -4,6 +4,6 @@
"dependencies": {
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -9,11 +9,11 @@
"@astrojs/svelte": "workspace:*",
"@astrojs/vue": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"solid-js": "^1.9.1",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -4,6 +4,6 @@
"dependencies": {
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -4,6 +4,6 @@
"dependencies": {
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -18,7 +18,7 @@
"astro": "workspace:*"
},
"dependencies": {
"preact": "^10.24.2",
"preact": "^10.24.3",
"react": "^18.3.1"
}
}

View file

@ -8,7 +8,7 @@
"@astrojs/svelte": "workspace:*",
"@test/component-library-shared": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"svelte": "^4.2.19"

View file

@ -9,6 +9,6 @@
"astro": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -6,6 +6,6 @@
"@astrojs/markdoc": "workspace:*",
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -1,4 +0,0 @@
import { defineConfig } from 'astro/config';
// https://astro.build/config
export default defineConfig({});

View file

@ -1,16 +0,0 @@
{
"name": "@test/content-mixed-errors",
"type": "module",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"astro": "workspace:*"
}
}

View file

@ -1,3 +0,0 @@
{
"name": "Placeholder"
}

View file

@ -1,3 +0,0 @@
---
title: Placeholder post
---

View file

@ -1,10 +0,0 @@
---
import { getCollection } from 'astro:content';
try {
await getCollection('authors')
} catch (e) {
return e
}
---
<h1>Worked</h1>

View file

@ -1,7 +0,0 @@
---
import { getCollection } from 'astro:content';
await getCollection('blog')
---
<h1>Worked</h1>

View file

@ -5,6 +5,6 @@
"dependencies": {
"@astrojs/preact": "workspace:",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -7,8 +7,8 @@
"@astrojs/svelte": "workspace:*",
"@astrojs/vue": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2",
"preact": "^10.24.3",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -9,6 +9,6 @@
"dependencies": {
"@astrojs/preact": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -12,11 +12,11 @@
"astro": "workspace:*"
},
"dependencies": {
"preact": "^10.24.2",
"preact": "^10.24.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"solid-js": "^1.9.1",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

View file

@ -5,6 +5,6 @@
"dependencies": {
"@astrojs/solid-js": "workspace:*",
"astro": "workspace:*",
"solid-js": "^1.9.1"
"solid-js": "^1.9.2"
}
}

View file

@ -6,6 +6,6 @@
"@astrojs/lit": "workspace:*",
"@webcomponents/template-shadowroot": "^0.2.1",
"astro": "workspace:*",
"lit": "^3.2.0"
"lit": "^3.2.1"
}
}

View file

@ -9,11 +9,11 @@
"astro": "workspace:*",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47",
"solid-js": "^1.9.1",
"solid-js": "^1.9.2",
"svelte": "^4.2.19",
"vue": "^3.5.11"
"vue": "^3.5.12"
},
"devDependencies": {
"postcss-preset-env": "^10.0.6"
"postcss-preset-env": "^10.0.7"
}
}

View file

@ -6,6 +6,6 @@
"@astrojs/preact": "workspace:*",
"@test/react-lib": "workspace:*",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

View file

@ -6,6 +6,6 @@
"@astrojs/preact": "workspace:*",
"@preact/signals": "1.3.0",
"astro": "workspace:*",
"preact": "^10.24.2"
"preact": "^10.24.3"
}
}

Some files were not shown because too many files have changed in this diff Show more