Skip to content

Commit c78f12d

Browse files
committed
fix(i18n): use @ts-ignore instead of cast for getLocaleDir fallback
Switch from `(locale as Intl.Locale).language` to a plain property access with a `@ts-ignore` directive. Per @delucis' review, the cast lints as "unnecessary" under TypeScript v5, while the property is reachable at runtime and only missing from the TypeScript v6 narrowed type. `@ts-ignore` keeps both compilers happy without lint noise. Signed-off-by: SAY-5 <[email protected]>
0 parents  commit c78f12d

1,023 files changed

Lines changed: 123731 additions & 0 deletions

File tree

Some content is hidden

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

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{ "repo": "withastro/starlight" }
6+
],
7+
"commit": false,
8+
"linked": [],
9+
"access": "public",
10+
"baseBranch": "origin/main",
11+
"updateInternalDependencies": "patch",
12+
"ignore": ["starlight-docs", "@example/*", "starlight-file-icons-generator", "@e2e/*"],
13+
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
14+
"onlyUpdatePeerDependentsWhenOutOfRange": true
15+
}
16+
}
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+
Fix a TypeScript 6 narrowing regression in `getLocaleDir`: the fallback branch that reads `(locale as Intl.Locale).language` was rejected by TS 6 because the narrowed type no longer contains the `language` property. Cast through `Intl.Locale` explicitly so the fallback still compiles.

.devcontainer/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Based on https://github.com/withastro/astro/blob/main/.devcontainer/Dockerfile
2+
FROM mcr.microsoft.com/devcontainers/javascript-node:0-22
3+
4+
# We uninstall pnpm here, since we enable the corepack version in the postCreateCommand
5+
# This ensures we respect the "packageManager" version in package.json
6+
RUN npm uninstall -g pnpm
7+
8+
COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt

.devcontainer/devcontainer.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Contribute to Starlight",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"postCreateCommand": "sudo corepack enable pnpm && pnpm config set store-dir /home/node/.pnpm-store && PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 pnpm install",
7+
"waitFor": "postCreateCommand",
8+
"customizations": {
9+
"codespaces": {
10+
"openFiles": ["CONTRIBUTING.md"]
11+
},
12+
"vscode": {
13+
"extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
14+
}
15+
}
16+
}

.devcontainer/welcome-message.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
🌟 Welcome to Starlight!
2+
3+
🛠️ Your environment is fully setup with all required software installed.
4+
5+
Next steps:
6+
7+
- Preview the docs site:
8+
cd docs && pnpm dev --host
9+
10+
- Run tests:
11+
cd packages/starlight && pnpm test

.git-blame-ignore-revs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Apply with:
2+
# `git config --local blame.ignoreRevsFile .git-blame-ignore-revs`
3+
4+
# [Add Prettier and format files](https://github.com/withastro/starlight/pull/393)
5+
9b172f5ee09697d80f301e9b70aca1946419ce24
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
body:
2+
- type: markdown
3+
attributes:
4+
value: |
5+
Thank you for getting in touch! Please fill out this form as completely as possible.
6+
7+
Want to report a problem with the Starlight docs? [Open a new issue](https://github.com/withastro/starlight/issues/new?assignees=&labels=&projects=&template=---02-docs-issue.yml)
8+
Want to chat before posting? [Join us in the `#starlight` channel on Discord](https://astro.build/chat)
9+
- type: textarea
10+
id: summary
11+
attributes:
12+
label: What is your idea?
13+
description: A brief, one or two sentence description of your idea for how to improve the Starlight docs.
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: background
18+
attributes:
19+
label: Why is this important?
20+
description: Explain why this idea is valuable. What problems would it solve? Which users would it help?
21+
validations:
22+
required: true
23+
- type: textarea
24+
id: prior-art
25+
attributes:
26+
label: How does your idea relate to existing docs content?
27+
description: Are there specific pages you would like to change? Or existing pages that are related to your proposal?
28+
placeholder: |
29+
- Example
30+
- Example
31+
- Example
32+
- type: checkboxes
33+
id: will-pr
34+
attributes:
35+
label: Participation
36+
description: Let us know if your interested in contributing this feature yourself.
37+
options:
38+
- label: I am willing to submit a pull request for this feature.
39+
required: false
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
body:
2+
- type: markdown
3+
attributes:
4+
value: |
5+
Thank you for getting in touch! Please fill out this form as completely as possible.
6+
7+
Want to report a bug instead? [Use our bug report form](https://github.com/withastro/starlight/issues/new?assignees=&labels=&projects=&template=---01-bug-report.yml)
8+
Want to chat before posting? [Join us in the `#starlight` channel on Discord](https://astro.build/chat)
9+
- type: input
10+
id: starlight-version
11+
attributes:
12+
label: What version of `starlight` are you using?
13+
placeholder: 0.0.0
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: summary
18+
attributes:
19+
label: What is your idea?
20+
description: A brief, one or two sentence description of your idea for a new feature.
21+
validations:
22+
required: true
23+
- type: textarea
24+
id: background
25+
attributes:
26+
label: Why is this feature necessary?
27+
description: Explain why this feature is important. What problems would it solve? Which users would it help?
28+
validations:
29+
required: true
30+
- type: textarea
31+
id: prior-art
32+
attributes:
33+
label: Do you have examples of this feature in other projects?
34+
description: Help us understand your idea by sharing links to example implementations we can compare against.
35+
placeholder: |
36+
- Example
37+
- Example
38+
- Example
39+
- type: checkboxes
40+
id: will-pr
41+
attributes:
42+
label: Participation
43+
description: Let us know if your interested in contributing this feature yourself.
44+
options:
45+
- label: I am willing to submit a pull request for this feature.
46+
required: false
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "\U0001F41B Bug Report"
2+
description: Report an issue or possible bug
3+
labels: []
4+
assignees: []
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thank you for taking the time to file a bug report! Please fill out this form as completely as possible.
10+
11+
✅ I am using the **latest versions of Starlight and Astro**.
12+
✅ I am using a compatible version of Node.js (`v22.12.0+`).
13+
- type: input
14+
id: starlight-version
15+
attributes:
16+
label: What version of `starlight` are you using?
17+
placeholder: 0.0.0
18+
validations:
19+
required: true
20+
- type: input
21+
id: astro-version
22+
attributes:
23+
label: What version of `astro` are you using?
24+
placeholder: 0.0.0
25+
validations:
26+
required: true
27+
- type: input
28+
id: package-manager
29+
attributes:
30+
label: What package manager are you using?
31+
placeholder: npm, yarn, pnpm
32+
validations:
33+
required: true
34+
- type: input
35+
id: os
36+
attributes:
37+
label: What operating system are you using?
38+
placeholder: Mac, Windows, Linux
39+
validations:
40+
required: true
41+
- type: input
42+
id: browser
43+
attributes:
44+
label: What browser are you using?
45+
placeholder: Chrome, Firefox, Safari
46+
validations:
47+
required: true
48+
- type: textarea
49+
id: bug-description
50+
attributes:
51+
label: Describe the Bug
52+
description: A clear and concise description of what the bug is.
53+
validations:
54+
required: true
55+
- type: input
56+
id: bug-reproduction
57+
attributes:
58+
label: Link to Minimal Reproducible Example
59+
description: 'Use [astro.new](https://astro.new) to create a minimal reproduction of the problem. **A minimal reproduction is required** so that others can help debug your issue. If a report is vague (e.g. just a generic error message) and has no reproduction, it may be auto-closed. Not sure how to create a minimal example? [Read our guide](https://docs.astro.build/en/guides/troubleshooting/#creating-minimal-reproductions)'
60+
placeholder: 'https://stackblitz.com/abcd1234'
61+
validations:
62+
required: true
63+
- type: checkboxes
64+
id: will-pr
65+
attributes:
66+
label: Participation
67+
options:
68+
- label: I am willing to submit a pull request for this issue.
69+
required: false

0 commit comments

Comments
 (0)