Skip to content

[i18nIgnore] Transpile Starlight packages - #3572

Merged
delucis merged 69 commits into
withastro:mainfrom
HiDeoo:hd/feat-ts-to-js
Sep 2, 2026
Merged

delucis merged 69 commits into
withastro:mainfrom
HiDeoo:hd/feat-ts-to-js

Conversation

@HiDeoo

@HiDeoo HiDeoo commented Nov 26, 2025 •

Copy link
Copy Markdown
Member

Description

This PR is an early draft (not yet ready for review) that transpiles Starlight packages from TypeScript to JavaScript to avoid publishing TypeScript which is not a recommended or even supported practice.

Approach

Multiples approaches are usually available when it comes to transpiling in monorepos and keeping the flexibility of working with TypeScript source code in development.

Custom export condition was one of the first options considered, and would probably be the most long-term solution, but we cannot currently use them for Starlight. For the docs/ site to properly consume custom conditions in development, in Astro, such conditions would need to be defined in the Astro configuration using the vite property, altho Starlight itself is imported in such configuration so it's a chicken-and-egg problem right now. There is a world in the future where we would be able to run Astro using node --conditions directly, and Vite automatically picks up those conditions, but this requires some changes in Node that are not yet available.

Considering the above, this PR relies on pnpm and specifically on the fact that pnpm automatically overrides some fields in package.json files when packages are published with pnpm publish by the one defined in the package.json publishConfig property. In the case of Starlight, we maintain 2 exports fields: one for development (pointing to the TypeScript source files like it is today) and one for production (pointing to the transpiled JavaScript files).

How to test

When getting closer to a reviewable state, some pre-release packages will probably be published to test the changes in a real-world scenario.

In the meantime, you can test the changes locally using a different Starlight project outside of the monorepo, e.g. one setup using pnpm create astro --template starlight.

# Move to the Starlight package
$ cd packages/starlight
# Build the package
$ pnpm build
# Pack the package to a temporary location like it would be published
$ pnpm pack --pack-destination ~

# Move to your test Starlight project
$ cd ~/path/to/your/test/starlight/project/that/is/outside/of/the/monorepo
# Remove existing Starlight package
$ pnpm remove @astrojs/starlight && pnpm add ~/astrojs-starlight-0.41.7.tgz

Remaining tasks

  • Transpile Starlight packages
    • Starlight
    • DocSearch plugin
    • Markdoc preset (nothing to do)
    • Tailwind CSS (nothing to do)
  • Male sure our release workflow, specifically pnpm changeset publish uses pnpm publish under the hood (it probably does, as package-manager-detector is used when actually publishing to figure out the package manager but need to double check) (explained here: If you are using pnpm as a package manager, this automatically detects it and uses pnpm publish instead.)
  • Changesets

@changeset-bot

changeset-bot Bot commented Nov 26, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 491b69c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@astrojs/starlight Minor
@astrojs/starlight-docsearch Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify

netlify Bot commented Nov 26, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 491b69c
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/6a97eed92438210008202823
😎 Deploy Preview https://deploy-preview-3572--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the i18n Anything to do with internationalization & translation efforts label Aug 31, 2026
@HiDeoo HiDeoo changed the title Transpile Starlight packages [i18nIgnore] Transpile Starlight packages Aug 31, 2026
delucis
delucis previously approved these changes Aug 31, 2026

@delucis delucis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ready when the time comes! 🚀

Thanks again @HiDeoo 💖

@delucis delucis added ✅ approved Pull requests that have been approved and are ready to merge when next cutting a release and removed pr-preview Trigger a preview release for this PR using pkg.pr.new labels Aug 31, 2026
@HiDeoo

HiDeoo commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Thanks for thorough review considering the amount of changes 🙌

Added a changeset for the main change, altho not sure I'm super happy with the wording but didn't find a better way to phrase it for now.

@delucis delucis mentioned this pull request Sep 1, 2026
1 task
delucis
delucis previously approved these changes Sep 1, 2026
@codspeed

codspeed Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing HiDeoo:hd/feat-ts-to-js (491b69c) with main (0138f22)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (f765c81) during the generation of this report, so 0138f22 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@delucis
delucis merged commit 292fb17 into withastro:main Sep 2, 2026
19 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Sep 2, 2026
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request Sep 2, 2026
* main:
  [i18nIgnore] Transpile Starlight packages (withastro#3572)
  i18n(ru): update translations (withastro#4170)
  [ci] release (withastro#4169)
  Fix hidden heading anchor links (withastro#4167)
  perf: optimize route and sidebar lookups (withastro#4148)
  chore: add benchmarks (withastro#4157)
@michaelfaith

Copy link
Copy Markdown

Woohoo! Thanks for all the work on this 🙌

dadezzz pushed a commit to dadezzz/university_notes that referenced this pull request Sep 6, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [@astrojs/starlight](https://starlight.astro.build) ([source](https://github.com/withastro/starlight/tree/HEAD/packages/starlight)) | [`0.41.11` → `0.42.0`](https://renovatebot.com/diffs/npm/@astrojs%2fstarlight/0.41.11/0.42.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@astrojs%2fstarlight/0.42.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@astrojs%2fstarlight/0.41.11/0.42.0?slim=true) |

---

### Release Notes

<details>
<summary>withastro/starlight (@&#8203;astrojs/starlight)</summary>

### [`v0.42.0`](https://github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#0420)

[Compare Source](https://github.com/withastro/starlight/compare/@astrojs/starlight@0.41.11...@astrojs/starlight@0.42.0)

##### Minor Changes

- [#&#8203;3572](withastro/starlight#3572) [`292fb17`](withastro/starlight@292fb17) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Distributes package as JavaScript files with dedicated type declaration files instead of TypeScript source files.

- [#&#8203;4121](withastro/starlight#4121) [`2623ae6`](withastro/starlight@2623ae6) Thanks [@&#8203;delucis](https://github.com/delucis)! - Simplifies markup for Starlight’s mobile menu toggle

  **⚠️ Potentially breaking change:** If you use a theme plugin, custom styles, or component overrides targeting the `MobileMenuToggle` button or `PageFrame` components, you may need to adjust these for the new markup. The button is no longer wrapped in a `<starlight-menu-button>` custom element and no longer uses the `aria-expanded` attribute. Instead, you can use the `.sl-menu-button` class name to target the button and the `:popover-open` pseudo-class to style the menu open state specifically.

  In the following example, custom styles for the menu button are updated for the new approach:

  ```diff
  - starlight-menu-button button {
  + .sl-menu-button {
    color: var(--sl-color-text);
  }

  - starlight-menu-button[aria-expanded='true'] button {
  + .sl-menu-button:has(~ :popover-open) {
    color: var(--sl-color-text-accent-high);
  }
  ```

  See [`MobileMenuToggle.astro`](https://github.com/withastro/starlight/blob/main/packages/starlight/components/MobileMenuToggle.astro) and [`PageFrame.astro`](https://github.com/withastro/starlight/blob/main/packages/starlight/components/PageFrame.astro) on GitHub for the full source code of the updated components.

- [#&#8203;3572](withastro/starlight#3572) [`292fb17`](withastro/starlight@292fb17) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Removes the `tagline` configuration option, which was never used.

  If your configuration included a `tagline` option, you can safely remove it without any replacement.

- [#&#8203;4134](withastro/starlight#4134) [`6135f01`](withastro/starlight@6135f01) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Updates internal `@astrojs/mdx`, `@astrojs/markdown-satteri`, and `satteri` dependencies.

  ⚠️ **BREAKING CHANGE:** The following minimum versions are now required:

  - `astro` v7.2.10 or later
  - `@astrojs/markdown-satteri` 0.4.0 or later (if you use it)
  - `@astrojs/markdown-remark` 7.3.0 or later (if you use it)

  Please update Starlight and Astro together:

  ```sh
  npx @astrojs/upgrade
  ```

- [#&#8203;4121](withastro/starlight#4121) [`2623ae6`](withastro/starlight@2623ae6) Thanks [@&#8203;delucis](https://github.com/delucis)! - Refactors Starlight’s mobile menu toggle to work when JavaScript fails or is disabled

  ⚠️ **BREAKING CHANGE:** This release drops official support for Chromium-based browsers prior to version 116 (released August 2023), Safari-based browsers prior to version 17.0 (released September 2023), and Firefox prior to version 125 (released April 2024). You can find a list of currently supported browsers and their versions using this [browserslist query](https://browsersl.ist/#q=%3E+0.5%25%2C+not+dead%2C+Chrome+%3E%3D+116%2C+Edge+%3E%3D+116%2C+Firefox+%3E%3D+125%2C+Safari+%3E%3D+17.0%2C+iOS+%3E%3D+17.0%2C+not+op_mini+all).

  This change also removes the `data-mobile-menu-expanded` attribute, which was previously added to `<body>` while the mobile menu is open. If you have custom code that was depending on this attribute, you will need to update it to use a new selector to check if the mobile menu is open.

  In the following example, a custom background colour for the site header while the menu is open is updated for the new approach:

  ```diff
  - [data-mobile-menu-expanded] header {
  + body:has(sl-sidebar-pane:popover-open) header {
    background-color: var(--sl-color-bg);
  }
  ```

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **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 [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC42NS4yIiwidXBkYXRlZEluVmVyIjoiNDQuNjUuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
keyurgolani added a commit to PersonalClaw/personalclaw.dev that referenced this pull request Sep 8, 2026
…t stops the build

Dependabot's grouped npm bump (#61) carries `@astrojs/starlight` 0.41.10 -> 0.42.0, and 0.42.0
removes the top-level `tagline` option outright. Starlight validates its config strictly, so an
unrecognised key is a hard error rather than a warning: `astro sync` — the first thing all three
site jobs run — dies with

    [AstroUserError] Invalid config passed to starlight integration
      Hint: Unrecognized key: "tagline"

which reds "Static build and publication contract", "Lighthouse performance budgets" and
"Browser, accessibility, privacy, and visual regression" together, plus the Vercel deployment.
Three red jobs and one failed deploy, all one unrecognised key.

The upstream entry (withastro/starlight#3572) is explicit about the migration: "Removes the
`tagline` configuration option, which was never used" — no replacement, safe to delete. So the
sentence this repo had been setting there ("Generated from the tagged source this site was built
from.") rendered NOWHERE on 0.41 either. Deleting the key changes no pixel, and the comment in
its place says that, plus where the fact belongs if it is worth surfacing: page content, not a
key the framework ignored.

Verified in the order that makes it evidence rather than hope: reproduced the CI failure locally
FIRST (`astro sync` exit 1, same "Unrecognized key" hint) against the bumped lockfile, then
applied the deletion and re-ran.

- `astro sync` exit 0; `npm run build` 43 pages, exit 0.
- `npm run test:static` exit 0 — 5 marketing routes + 33 docs pages + registry index + 2 blog +
  1 compare validated, 117 research cross-links resolved, registry render contract verified.
- `npx playwright test` **139 passed** — including the visual-regression suite against the
  committed darwin baselines, so the `lucide-react` 1.37 -> 1.41 and astro/react bumps riding
  along change no rendered pixel. That was the live risk in taking this group.
- `node scripts/lighthouse-audit.mjs` exit 0 — performance/accessibility/best-practices/seo 100
  on every audited route.

`npm audit --audit-level=moderate` exits 1 with 6 vulnerabilities (1 moderate, 5 high:
browserslist, fast-uri, js-yaml, nanoid, postcss, undici). Measured against main's lockfile
under the same command: byte-for-byte the same six. This bump introduces none of them — they are
pre-existing transitive debt and want their own change, so they are reported here rather than
folded in silently or used as a reason to hold the fix.

<!-- no-visual-delta -->
**Why no screenshot:** the deleted key rendered nothing on either version — upstream removed it
as "never used" — and the visual-regression suite passing against unchanged baselines is the
stronger evidence that the page is identical.

Closes #61

Signed-off-by: Keyur Golani <keyurrgolani@gmail.com>
keyurgolani added a commit to PersonalClaw/personalclaw.dev that referenced this pull request Sep 22, 2026
…t stops the build

Dependabot's grouped npm bump (#61) carries `@astrojs/starlight` 0.41.10 -> 0.42.0, and 0.42.0
removes the top-level `tagline` option outright. Starlight validates its config strictly, so an
unrecognised key is a hard error rather than a warning: `astro sync` — the first thing all three
site jobs run — dies with

    [AstroUserError] Invalid config passed to starlight integration
      Hint: Unrecognized key: "tagline"

which reds "Static build and publication contract", "Lighthouse performance budgets" and
"Browser, accessibility, privacy, and visual regression" together, plus the Vercel deployment.
Three red jobs and one failed deploy, all one unrecognised key.

The upstream entry (withastro/starlight#3572) is explicit about the migration: "Removes the
`tagline` configuration option, which was never used" — no replacement, safe to delete. So the
sentence this repo had been setting there ("Generated from the tagged source this site was built
from.") rendered NOWHERE on 0.41 either. Deleting the key changes no pixel, and the comment in
its place says that, plus where the fact belongs if it is worth surfacing: page content, not a
key the framework ignored.

Verified in the order that makes it evidence rather than hope: reproduced the CI failure locally
FIRST (`astro sync` exit 1, same "Unrecognized key" hint) against the bumped lockfile, then
applied the deletion and re-ran.

- `astro sync` exit 0; `npm run build` 43 pages, exit 0.
- `npm run test:static` exit 0 — 5 marketing routes + 33 docs pages + registry index + 2 blog +
  1 compare validated, 117 research cross-links resolved, registry render contract verified.
- `npx playwright test` **139 passed** — including the visual-regression suite against the
  committed darwin baselines, so the `lucide-react` 1.37 -> 1.41 and astro/react bumps riding
  along change no rendered pixel. That was the live risk in taking this group.
- `node scripts/lighthouse-audit.mjs` exit 0 — performance/accessibility/best-practices/seo 100
  on every audited route.

`npm audit --audit-level=moderate` exits 1 with 6 vulnerabilities (1 moderate, 5 high:
browserslist, fast-uri, js-yaml, nanoid, postcss, undici). Measured against main's lockfile
under the same command: byte-for-byte the same six. This bump introduces none of them — they are
pre-existing transitive debt and want their own change, so they are reported here rather than
folded in silently or used as a reason to hold the fix.

<!-- no-visual-delta -->
**Why no screenshot:** the deleted key rendered nothing on either version — upstream removed it
as "never used" — and the visual-regression suite passing against unchanged baselines is the
stronger evidence that the page is identical.

Closes #61

Signed-off-by: Keyur Golani <keyurrgolani@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚨 action Changes to GitHub Action workflows ✅ approved Pull requests that have been approved and are ready to merge when next cutting a release 🌟 core Changes to Starlight’s main package 📚 docs Documentation website changes 🌟 docsearch Changes to Starlight’s DocSearch plugin i18n Anything to do with internationalization & translation efforts 🌟 minor Change that triggers a minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish Modern Javascript instead of Typescript

4 participants