diff --git a/.changeset/chatty-jars-flash.md b/.changeset/chatty-jars-flash.md deleted file mode 100644 index fc52d627b74..00000000000 --- a/.changeset/chatty-jars-flash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/starlight': minor ---- - -Adds a new [`HookParameters`](https://starlight.astro.build/reference/plugins/#hooks) utility type to get the type of a plugin hook’s arguments. diff --git a/.changeset/chilled-bees-pump.md b/.changeset/chilled-bees-pump.md deleted file mode 100644 index bbcf9bead99..00000000000 --- a/.changeset/chilled-bees-pump.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -'@astrojs/starlight': minor ---- - -Moves route data to `Astro.locals` instead of passing it down via component props - -⚠️ **Breaking change:** -Previously, all of Starlight’s templating components, including user or plugin overrides, had access to a data object for the current route via `Astro.props`. -This data is now available as `Astro.locals.starlightRoute` instead. - -To update, refactor any component overrides you have: - -- Remove imports of `@astrojs/starlight/props`, which is now deprecated. -- Update code that accesses `Astro.props` to use `Astro.locals.starlightRoute` instead. -- Remove any spreading of `{...Astro.props}` into child components, which is no longer required. - -In the following example, a custom override for Starlight’s `LastUpdated` component is updated for the new style: - -```diff ---- -import Default from '@astrojs/starlight/components/LastUpdated.astro'; -- import type { Props } from '@astrojs/starlight/props'; - -- const { lastUpdated } = Astro.props; -+ const { lastUpdated } = Astro.locals.starlightRoute; - -const updatedThisYear = lastUpdated?.getFullYear() === new Date().getFullYear(); ---- - -{updatedThisYear && ( -- -+ -)} -``` - -_Community Starlight plugins may also need to be manually updated to work with Starlight 0.32. If you encounter any issues, please reach out to the plugin author to see if it is a known issue or if an updated version is being worked on._ diff --git a/.changeset/dry-geese-pretend.md b/.changeset/dry-geese-pretend.md deleted file mode 100644 index e860c8ccad2..00000000000 --- a/.changeset/dry-geese-pretend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@astrojs/starlight": minor ---- - -Adds support for Pagefind’s multisite search features diff --git a/.changeset/large-balloons-compete.md b/.changeset/large-balloons-compete.md deleted file mode 100644 index d62510021e9..00000000000 --- a/.changeset/large-balloons-compete.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -'@astrojs/starlight': minor ---- - -Exposes the built-in localization system in the Starlight plugin `config:setup` hook. - -⚠️ **BREAKING CHANGE:** - -This addition changes how Starlight plugins add or update translation strings used in Starlight’s localization APIs. -Plugins previously using the [`injectTranslations()`](https://starlight.astro.build/reference/plugins/#injecttranslations) callback function from the plugin [`config:setup`](https://starlight.astro.build/reference/plugins/#configsetup) hook should now use the same function available in the [`i18n:setup`](https://starlight.astro.build/reference/plugins/#i18nsetup) hook. - -```diff -export default { - name: 'plugin-with-translations', - hooks: { -- 'config:setup'({ injectTranslations }) { -+ 'i18n:setup'({ injectTranslations }) { - injectTranslations({ - en: { - 'myPlugin.doThing': 'Do the thing', - }, - fr: { - 'myPlugin.doThing': 'Faire le truc', - }, - }); - }, - }, -}; -``` diff --git a/.changeset/loud-wolves-decide.md b/.changeset/loud-wolves-decide.md deleted file mode 100644 index 2a7d6cc6d43..00000000000 --- a/.changeset/loud-wolves-decide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/starlight': minor ---- - -Adds a new [`useTranslations()`](https://starlight.astro.build/reference/plugins/#usetranslations) callback function to the Starlight plugin `config:setup` hook to generate a utility function to access UI strings for a given language. diff --git a/.changeset/nervous-mugs-begin.md b/.changeset/nervous-mugs-begin.md deleted file mode 100644 index 2484ac9dea0..00000000000 --- a/.changeset/nervous-mugs-begin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/starlight': patch ---- - -Fixes styling of [filter](https://pagefind.app/docs/filtering/) and [metadata](https://pagefind.app/docs/metadata/) elements in Pagefind search UI. diff --git a/.changeset/polite-fishes-remain.md b/.changeset/polite-fishes-remain.md deleted file mode 100644 index f0be20ca158..00000000000 --- a/.changeset/polite-fishes-remain.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -'@astrojs/starlight': minor ---- - -Deprecates the Starlight plugin `setup` hook in favor of the new `config:setup` hook which provides the same functionality. - -⚠️ **BREAKING CHANGE:** - -The Starlight plugin `setup` hook is now deprecated and will be removed in a future release. Please update your plugins to use the new `config:setup` hook instead. - -```diff -export default { - name: 'plugin-with-translations', - hooks: { -- 'setup'({ config }) { -+ 'config:setup'({ config }) { - // Your plugin configuration setup code - }, - }, -}; -``` diff --git a/.changeset/stupid-turkeys-appear.md b/.changeset/stupid-turkeys-appear.md deleted file mode 100644 index f4dfb9878aa..00000000000 --- a/.changeset/stupid-turkeys-appear.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@astrojs/starlight-docsearch': minor ---- - -⚠️ **BREAKING CHANGE:** The minimum supported version of Starlight is now 0.32.0 - -Please use the `@astrojs/upgrade` command to upgrade your project: - -```sh -npx @astrojs/upgrade -``` diff --git a/.changeset/wet-cherries-try.md b/.changeset/wet-cherries-try.md deleted file mode 100644 index 65dce050737..00000000000 --- a/.changeset/wet-cherries-try.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/starlight': minor ---- - -Adds a new [`absolutePathToLang()`](https://starlight.astro.build/reference/plugins/#absolutepathtolang) callback function to the Starlight plugin `config:setup` to get the language for a given absolute file path. diff --git a/examples/basics/package.json b/examples/basics/package.json index 0cc20fdff31..2aace024bff 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/starlight": "^0.31.1", + "@astrojs/starlight": "^0.32.0", "astro": "^5.1.5", "sharp": "^0.32.5" } diff --git a/examples/markdoc/package.json b/examples/markdoc/package.json index e27f4a74ba3..5c1e369c7b4 100644 --- a/examples/markdoc/package.json +++ b/examples/markdoc/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/markdoc": "^0.12.4", - "@astrojs/starlight": "^0.31.1", + "@astrojs/starlight": "^0.32.0", "@astrojs/starlight-markdoc": "^0.2.0", "astro": "^5.1.5", "sharp": "^0.32.5" diff --git a/examples/tailwind/package.json b/examples/tailwind/package.json index 9ca0a9d178b..1f483462d9b 100644 --- a/examples/tailwind/package.json +++ b/examples/tailwind/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/starlight": "^0.31.1", + "@astrojs/starlight": "^0.32.0", "@astrojs/starlight-tailwind": "^3.0.0", "@astrojs/tailwind": "^5.1.4", "astro": "^5.1.5", diff --git a/packages/docsearch/CHANGELOG.md b/packages/docsearch/CHANGELOG.md index 212c3a12259..6b3e63ad870 100644 --- a/packages/docsearch/CHANGELOG.md +++ b/packages/docsearch/CHANGELOG.md @@ -1,5 +1,18 @@ # @astrojs/starlight-docsearch +## 0.6.0 + +### Minor Changes + +- [#2578](https://github.com/withastro/starlight/pull/2578) [`f895f75`](https://github.com/withastro/starlight/commit/f895f75b17f36c826cc871ba1826e5ae1dff44ca) and [#2390](https://github.com/withastro/starlight/pull/2390) [`f493361`](https://github.com/withastro/starlight/commit/f493361d7b64a3279980e0f046c3a52196ab94e0) Thanks [@HiDeoo](https://github.com/HiDeoo) and [@delucis](https://github.com/delucis)! + ⚠️ **BREAKING CHANGE:** The minimum supported version of Starlight is now 0.32.0 + + Please use the `@astrojs/upgrade` command to upgrade your project: + + ```sh + npx @astrojs/upgrade + ``` + ## 0.5.0 ### Minor Changes diff --git a/packages/docsearch/package.json b/packages/docsearch/package.json index 0d586666031..2bfc6e20a94 100644 --- a/packages/docsearch/package.json +++ b/packages/docsearch/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/starlight-docsearch", - "version": "0.5.0", + "version": "0.6.0", "description": "Algolia DocSearch plugin for the Starlight documentation theme for Astro", "author": "Chris Swithinbank ", "license": "MIT", diff --git a/packages/starlight/CHANGELOG.md b/packages/starlight/CHANGELOG.md index 7ce0dd31985..0446f26f605 100644 --- a/packages/starlight/CHANGELOG.md +++ b/packages/starlight/CHANGELOG.md @@ -1,5 +1,98 @@ # @astrojs/starlight +## 0.32.0 + +### Minor Changes + +- [#2390](https://github.com/withastro/starlight/pull/2390) [`f493361`](https://github.com/withastro/starlight/commit/f493361d7b64a3279980e0f046c3a52196ab94e0) Thanks [@delucis](https://github.com/delucis)! - Moves route data to `Astro.locals` instead of passing it down via component props + + ⚠️ **Breaking change:** + Previously, all of Starlight’s templating components, including user or plugin overrides, had access to a data object for the current route via `Astro.props`. + This data is now available as `Astro.locals.starlightRoute` instead. + + To update, refactor any component overrides you have: + + - Remove imports of `@astrojs/starlight/props`, which is now deprecated. + - Update code that accesses `Astro.props` to use `Astro.locals.starlightRoute` instead. + - Remove any spreading of `{...Astro.props}` into child components, which is no longer required. + + In the following example, a custom override for Starlight’s `LastUpdated` component is updated for the new style: + + ```diff + --- + import Default from '@astrojs/starlight/components/LastUpdated.astro'; + - import type { Props } from '@astrojs/starlight/props'; + + - const { lastUpdated } = Astro.props; + + const { lastUpdated } = Astro.locals.starlightRoute; + + const updatedThisYear = lastUpdated?.getFullYear() === new Date().getFullYear(); + --- + + {updatedThisYear && ( + - + + + )} + ``` + + _Community Starlight plugins may also need to be manually updated to work with Starlight 0.32. If you encounter any issues, please reach out to the plugin author to see if it is a known issue or if an updated version is being worked on._ + +- [#2578](https://github.com/withastro/starlight/pull/2578) [`f895f75`](https://github.com/withastro/starlight/commit/f895f75b17f36c826cc871ba1826e5ae1dff44ca) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Deprecates the Starlight plugin `setup` hook in favor of the new `config:setup` hook which provides the same functionality. + + ⚠️ **BREAKING CHANGE:** + + The Starlight plugin `setup` hook is now deprecated and will be removed in a future release. Please update your plugins to use the new `config:setup` hook instead. + + ```diff + export default { + name: 'plugin-with-translations', + hooks: { + - 'setup'({ config }) { + + 'config:setup'({ config }) { + // Your plugin configuration setup code + }, + }, + }; + ``` + +- [#2578](https://github.com/withastro/starlight/pull/2578) [`f895f75`](https://github.com/withastro/starlight/commit/f895f75b17f36c826cc871ba1826e5ae1dff44ca) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Exposes the built-in localization system in the Starlight plugin `config:setup` hook. + + ⚠️ **BREAKING CHANGE:** + + This addition changes how Starlight plugins add or update translation strings used in Starlight’s localization APIs. + Plugins previously using the [`injectTranslations()`](https://starlight.astro.build/reference/plugins/#injecttranslations) callback function from the plugin [`config:setup`](https://starlight.astro.build/reference/plugins/#configsetup) hook should now use the same function available in the [`i18n:setup`](https://starlight.astro.build/reference/plugins/#i18nsetup) hook. + + ```diff + export default { + name: 'plugin-with-translations', + hooks: { + - 'config:setup'({ injectTranslations }) { + + 'i18n:setup'({ injectTranslations }) { + injectTranslations({ + en: { + 'myPlugin.doThing': 'Do the thing', + }, + fr: { + 'myPlugin.doThing': 'Faire le truc', + }, + }); + }, + }, + }; + ``` + +- [#2858](https://github.com/withastro/starlight/pull/2858) [`2df9d05`](https://github.com/withastro/starlight/commit/2df9d05fe7b61282809aa85a1d77662fdd3b748f) Thanks [@XREvo](https://github.com/XREvo)! - Adds support for Pagefind’s multisite search features + +- [#2578](https://github.com/withastro/starlight/pull/2578) [`f895f75`](https://github.com/withastro/starlight/commit/f895f75b17f36c826cc871ba1826e5ae1dff44ca) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds a new [`HookParameters`](https://starlight.astro.build/reference/plugins/#hooks) utility type to get the type of a plugin hook’s arguments. + +- [#2578](https://github.com/withastro/starlight/pull/2578) [`f895f75`](https://github.com/withastro/starlight/commit/f895f75b17f36c826cc871ba1826e5ae1dff44ca) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds a new [`useTranslations()`](https://starlight.astro.build/reference/plugins/#usetranslations) callback function to the Starlight plugin `config:setup` hook to generate a utility function to access UI strings for a given language. + +- [#2578](https://github.com/withastro/starlight/pull/2578) [`f895f75`](https://github.com/withastro/starlight/commit/f895f75b17f36c826cc871ba1826e5ae1dff44ca) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds a new [`absolutePathToLang()`](https://starlight.astro.build/reference/plugins/#absolutepathtolang) callback function to the Starlight plugin `config:setup` to get the language for a given absolute file path. + +### Patch Changes + +- [#2848](https://github.com/withastro/starlight/pull/2848) [`9b32ba9`](https://github.com/withastro/starlight/commit/9b32ba967c5741354bc99ba0bcff3f454b8117ad) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes styling of [filter](https://pagefind.app/docs/filtering/) and [metadata](https://pagefind.app/docs/metadata/) elements in Pagefind search UI. + ## 0.31.1 ### Patch Changes diff --git a/packages/starlight/package.json b/packages/starlight/package.json index 78011e23eec..865bbb6381e 100644 --- a/packages/starlight/package.json +++ b/packages/starlight/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/starlight", - "version": "0.31.1", + "version": "0.32.0", "description": "Build beautiful, high-performance documentation websites with Astro", "scripts": { "test": "vitest", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7319ec13f92..e18443bc237 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -76,7 +76,7 @@ importers: examples/basics: dependencies: '@astrojs/starlight': - specifier: ^0.31.1 + specifier: ^0.32.0 version: link:../../packages/starlight astro: specifier: ^5.1.5 @@ -91,7 +91,7 @@ importers: specifier: ^0.12.4 version: 0.12.5(astro@5.1.5) '@astrojs/starlight': - specifier: ^0.31.1 + specifier: ^0.32.0 version: link:../../packages/starlight '@astrojs/starlight-markdoc': specifier: ^0.2.0 @@ -106,7 +106,7 @@ importers: examples/tailwind: dependencies: '@astrojs/starlight': - specifier: ^0.31.1 + specifier: ^0.32.0 version: link:../../packages/starlight '@astrojs/starlight-tailwind': specifier: ^3.0.0