Skip to content

Commit eef9b8f

Browse files
authored
Merge branch 'main' into stack/invalid-canonical
2 parents 36e651f + 0b98ddb commit eef9b8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+402
-122
lines changed

.changeset/kind-mirrors-kneel.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/wild-poets-poke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@astrojs/starlight": patch
3+
---
4+
5+
Updates the `seti:gitlab` icon to match latest version from Seti UI Icons

.github/workflows/ci.yml

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,32 @@ jobs:
2323
pull-requests: read
2424
outputs:
2525
docs: ${{ steps.filter.outputs.docs }}
26+
docs_ja: ${{ steps.filter.outputs.docs_ja }}
27+
docs_en: ${{ steps.filter.outputs.docs_en }}
28+
docs_not_content: ${{ steps.filter.outputs.docs_not_content }}
2629
packages: ${{ steps.filter.outputs.packages }}
2730
ci: ${{ steps.filter.outputs.ci }}
2831
steps:
2932
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3033
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
3134
id: filter
35+
# When updating filters here, make sure to also add or remove them from the
36+
# outputs block above.
3237
with:
3338
filters: |
3439
docs:
3540
- 'docs/**'
41+
docs_ja:
42+
- 'docs/src/content/docs/ja/**'
43+
docs_en:
44+
- 'docs/src/content/docs/**'
45+
# Exclude languages with a two-letter code
46+
- '!docs/src/content/docs/{a..z}{a..z}/**'
47+
# Exclude languages with a region subtag
48+
- '!docs/src/content/docs/{a..z}{a..z}-{a..z}{a..z}/**'
49+
docs_not_content:
50+
- 'docs/**'
51+
- '!docs/src/content/docs/**'
3652
packages:
3753
- 'packages/**'
3854
ci:
@@ -68,14 +84,30 @@ jobs:
6884
runs-on: ${{ matrix.os }}
6985
steps:
7086
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
87+
# Uninstall man-db to prevent man page updates taking a long time after package installations
88+
# on Ubuntu 24.04.
89+
# https://github.com/actions/runner/issues/4030
90+
# https://github.com/actions/runner-images/issues/10977
91+
- name: Uninstall man-db
92+
if: matrix.os == 'ubuntu-latest'
93+
run: |
94+
sudo apt-get update
95+
sudo apt-get remove man-db
7196
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
7297
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
7398
with:
7499
node-version: ${{ env.NODE_VERSION }}
75100
cache: 'pnpm'
76101
- run: pnpm i
77-
- name: Test packages
78-
run: pnpm -r test:e2e
102+
- name: Test packages (Linux)
103+
if: matrix.os == 'ubuntu-latest'
104+
run: pnpm -r test:e2e:chrome
105+
# Firefox is used for Windows E2E tests as Chrome on Windows requires the installation of the
106+
# Server Media Foundation windows feature, which can take up to 3 minutes to install on CI.
107+
# https://github.com/microsoft/playwright/blob/e7bff526433b6dcb02801763ab5b1c6407902d47/packages/playwright-core/src/server/registry/dependencies.ts#L79-L89
108+
- name: Test packages (Windows)
109+
if: matrix.os == 'windows-latest'
110+
run: pnpm -r test:e2e:firefox
79111

80112
type-check:
81113
name: Run type checks
@@ -113,11 +145,22 @@ jobs:
113145

114146
a11y:
115147
name: Check for accessibility issues
148+
needs: changes
149+
if: ${{ needs.changes.outputs.docs_not_content == 'true' || needs.changes.outputs.docs_ja == 'true' || needs.changes.outputs.docs_en == 'true' || needs.changes.outputs.ci == 'true' || needs.changes.outputs.packages == 'true' }}
116150
runs-on: ubuntu-latest
117151
steps:
118152
- name: Checkout
119153
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
120154

155+
# Uninstall man-db to prevent man page updates taking a long time after package installations
156+
# on Ubuntu 24.04.
157+
# https://github.com/actions/runner/issues/4030
158+
# https://github.com/actions/runner-images/issues/10977
159+
- name: Uninstall man-db
160+
run: |
161+
sudo apt-get update
162+
sudo apt-get remove man-db
163+
121164
- name: Setup PNPM
122165
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
123166

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Release
2+
permissions: {}
23

34
on:
45
push:
@@ -12,21 +13,23 @@ jobs:
1213
runs-on: ubuntu-latest
1314
permissions:
1415
contents: write
16+
pull-requests: write
1517
id-token: write
1618
steps:
1719
- name: Checkout Repo
1820
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1921
with:
2022
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2123
fetch-depth: 0
24+
persist-credentials: false
2225

2326
- name: Setup PNPM
2427
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
2528

2629
- name: Setup Node
2730
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2831
with:
29-
node-version: 18.20.8
32+
node-version: 24.10.0
3033
cache: 'pnpm'
3134

3235
- name: Install Dependencies
@@ -41,4 +44,4 @@ jobs:
4144
title: '[ci] release'
4245
env:
4346
GITHUB_TOKEN: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
44-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
NPM_TOKEN: "" # See https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ packages/starlight/__e2e__/fixtures/basics/src/content/docs/anchor-heading-compo
2525

2626
# Malformed YAML file used for testing
2727
packages/starlight/__tests__/i18n/malformed-yaml-src/content/i18n/*.yml
28+
29+
# GitHub Actions workflow files
30+
.github/workflows/*.yml

CONTRIBUTING.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This repo is a “monorepo,” meaning it contains several projects in one. It c
3838

3939
### Setting up a development environment
4040

41-
You can [develop locally](#developing-locally) or use an online coding development environment like [GitHub Codespaces](#developing-using-github-codespaces) or [Gitpod](#developing-using-gitpod) to get started quickly.
41+
You can [develop locally](#developing-locally) or use an online coding development environment like [GitHub Codespaces](#developing-using-github-codespaces) to get started quickly.
4242

4343
#### Developing locally
4444

@@ -64,23 +64,24 @@ You can [develop locally](#developing-locally) or use an online coding developme
6464
pnpm i
6565
```
6666

67-
#### Developing using Gitpod
68-
69-
**Prerequisites:** Developing Starlight using Gitpod requires a free [Gitpod account](https://gitpod.io).
70-
71-
1. **Open the Gitpod URL** [https://gitpod.io/#https://github.com/withastro/starlight](https://gitpod.io/#https://github.com/withastro/starlight). You can alternatively install a [Gitpod browser extension](https://www.gitpod.io/docs/configure/user-settings/browser-extension) which will add a "Gitpod" button when viewing [Starlight's repo on GitHub](https://github.com/withastro/starlight).
72-
73-
2. **Install dependencies** with `pnpm`:
67+
5. **Generate TypeScript types** for all Astro modules:
7468

7569
```sh
76-
pnpm i
70+
cd docs
71+
pnpm astro sync
7772
```
7873

7974
#### Developing using GitHub Codespaces
8075

8176
1. **Create a new codespace** via https://codespaces.new/withastro/starlight
8277

83-
2. If running the docs site, pass the `--host` flag to avoid “502 Bad Gateway” errors:
78+
2. **Generate TypeScript types** for all Astro modules:
79+
80+
```sh
81+
pnpm astro sync
82+
```
83+
84+
3. If running the docs site, pass the `--host` flag to avoid “502 Bad Gateway” errors:
8485

8586
```sh
8687
cd docs

docs/.pa11yci

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/__a11y__/test-utils.ts

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import {
77
} from 'axe-playwright';
88
import Sitemapper from 'sitemapper';
99

10+
// We use the Lunaria config to get the list of languages rather than the Astro config as importing
11+
// the latter does not play well with Playwright.
12+
import lunariaConfig from '../lunaria.config.json' assert { type: 'json' };
13+
1014
export { expect, type Locator } from '@playwright/test';
1115

1216
const config: Config = {
@@ -17,29 +21,37 @@ const config: Config = {
1721
values: ['wcag2a', 'wcag21a', 'wcag2aa', 'wcag21aa', 'wcag22aa', 'best-practice'],
1822
},
1923
},
24+
// i18n specific configuration.
25+
i18n: {
26+
// A list of slugs to exclude from the sitemap for the default locale.
27+
// By default, all slugs for the default locale are included.
28+
exclude: [
29+
'components/using-components',
30+
'getting-started',
31+
'guides/customization',
32+
'guides/i18n',
33+
'guides/overriding-components',
34+
'guides/pages',
35+
'guides/project-structure',
36+
'guides/route-data',
37+
'guides/site-search',
38+
'manual-setup',
39+
'reference/frontmatter',
40+
'reference/overrides',
41+
'reference/plugins',
42+
'reference/route-data',
43+
],
44+
// Locale-specific included slugs (non-default locale slugs are excluded by default).
45+
locales: {
46+
// N.B. If adding more locales here, also update the changed files filters in
47+
// `.github/workflows/ci.yml` to ensure tests run when files for those locales change.
48+
ja: ['guides/route-data', 'reference/frontmatter'],
49+
},
50+
},
2051
// A list of violation to ignore.
2152
ignore: [{ id: 'landmark-unique', nodeMatcher: landmarkUniqueNodeMatcher }],
2253
sitemap: {
2354
url: 'http://localhost:4321/sitemap-index.xml',
24-
exclude: {
25-
// A pattern to exclude URLs from the sitemap.
26-
pattern: /\/(de|zh-cn|fr|es|pt-br|pt-pt|it|id|ko|ru|tr|hi|da|uk)\/.*/,
27-
// A list of slugs to exclude from the sitemap after processing the pattern.
28-
slugs: [
29-
'components/using-components',
30-
'getting-started',
31-
'guides/customization',
32-
'guides/i18n',
33-
'guides/overriding-components',
34-
'guides/pages',
35-
'guides/project-structure',
36-
'guides/site-search',
37-
'manual-setup',
38-
'reference/frontmatter',
39-
'reference/overrides',
40-
'reference/plugins',
41-
],
42-
},
4355
replace: {
4456
query: 'https://starlight.astro.build',
4557
value: 'http://localhost:4321',
@@ -50,6 +62,8 @@ const config: Config = {
5062
process.env.ASTRO_TELEMETRY_DISABLED = 'true';
5163
process.env.ASTRO_DISABLE_UPDATE_CHECK = 'true';
5264

65+
const locales = lunariaConfig.locales.map((locale) => locale.lang);
66+
5367
export const test = baseTest.extend<{
5468
docsSite: DocsSite;
5569
}>({
@@ -71,9 +85,24 @@ class DocsSite {
7185
const urls: string[] = [];
7286

7387
for (const site of sites) {
74-
const url = site.replace(config.sitemap.replace.query, config.sitemap.replace.value);
75-
if (config.sitemap.exclude.pattern.test(url)) continue;
76-
if (config.sitemap.exclude.slugs.some((slug) => url.endsWith(`/${slug}/`))) continue;
88+
const slug = site.replace(config.sitemap.replace.query, '');
89+
const url = config.sitemap.replace.value + slug;
90+
91+
// Default locale
92+
if (!locales.some((locale) => slug.startsWith(`/${locale}/`))) {
93+
// Skip default locale excluded slugs
94+
if (config.i18n.exclude.some((excludedSlug) => slug.endsWith(`/${excludedSlug}/`)))
95+
continue;
96+
} else {
97+
// Get locale-specific config
98+
const locale = slug.split('/')[1]!;
99+
const localeConfig = config.i18n.locales[locale];
100+
// Skip non-configured locales
101+
if (!localeConfig) continue;
102+
// Skip locale-specific non-included slugs
103+
if (!localeConfig.some((includedSlug) => slug.endsWith(`/${includedSlug}/`))) continue;
104+
}
105+
77106
urls.push(url);
78107
}
79108

@@ -129,6 +158,7 @@ function landmarkUniqueNodeMatcher(node: ViolationNode) {
129158

130159
interface Config {
131160
axe: Parameters<typeof getViolations>[2];
161+
i18n: { exclude: string[]; locales: Record<string, string[]> };
132162
ignore: Array<
133163
| string
134164
| {
@@ -140,10 +170,6 @@ interface Config {
140170
>;
141171
sitemap: {
142172
url: string;
143-
exclude: {
144-
pattern: RegExp;
145-
slugs: string[];
146-
};
147173
replace: {
148174
query: string;
149175
value: string;
116 KB
Loading
-107 KB
Binary file not shown.

0 commit comments

Comments
 (0)