Skip to content

Pagefind CLI → Pagefind API#3534

Merged
delucis merged 11 commits intowithastro:mainfrom
HiDeoo:hd/refactor-pagefind-cli-api
Jan 21, 2026
Merged

Pagefind CLI → Pagefind API#3534
delucis merged 11 commits intowithastro:mainfrom
HiDeoo:hd/refactor-pagefind-cli-api

Conversation

@HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Nov 5, 2025

Description

This PR refactors how Pagefind is run after the build process. Instead of using the CLI via npx, it now uses the Pagefind API directly.

Feature-wise, there should be no changes but one aspect which will differ is logging.

Before After
SCR-20251105-oazh SCR-20251105-ocrn

We are now directly using a fork of the Starlight ingration logger. I didn't spend too much time on tweaking the logging output so far, but one huge difference is that we don't have access to the same informations when using the API vs CLI which access them using some internal Rust code and that data is not exposed via the API.

Personally, I never found the logging output of the CLI very useful, so I think this is an overall improvement but definitely something worth mentioning and discussing if needed.

Todo

  • Add a changeset. (Chris added a temporary one to test preview releases, but we may want to revisit the wording.)

@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

🦋 Changeset detected

Latest commit: 1e79b48

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

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

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
Copy link

netlify bot commented Nov 5, 2025

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 1e79b48
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/6970f40bb1b29600086d7b06
😎 Deploy Preview https://deploy-preview-3534--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

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

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Nov 5, 2025
@delucis delucis added this to the v0.38 milestone Dec 2, 2025
@delucis delucis added pr-preview Trigger a preview release for this PR using pkg.pr.new and removed pr-preview Trigger a preview release for this PR using pkg.pr.new labels Dec 9, 2025
@delucis delucis added pr-preview Trigger a preview release for this PR using pkg.pr.new and removed pr-preview Trigger a preview release for this PR using pkg.pr.new labels Dec 10, 2025
@delucis delucis added the pr-preview Trigger a preview release for this PR using pkg.pr.new label Dec 10, 2025
@HiDeoo HiDeoo removed the pr-preview Trigger a preview release for this PR using pkg.pr.new label Dec 10, 2025
@HiDeoo HiDeoo added the pr-preview Trigger a preview release for this PR using pkg.pr.new label Dec 10, 2025
@delucis delucis removed the pr-preview Trigger a preview release for this PR using pkg.pr.new label Dec 10, 2025
@HiDeoo HiDeoo added the pr-preview Trigger a preview release for this PR using pkg.pr.new label Dec 10, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 10, 2025

pnpm add https://pkg.pr.new/@astrojs/starlight@3534

commit: 7b632ba

@Mikescops
Copy link

Hello, thanks a lot for the PR, is there a chance this goes into the next version? 😄

@delucis delucis removed the pr-preview Trigger a preview release for this PR using pkg.pr.new label Jan 14, 2026
@delucis
Copy link
Member

delucis commented Jan 14, 2026

is there a chance this goes into the next version?

Yes, planned for v0.38!

@Mikescops
Copy link

Nice, thanks a lot!

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Thanks @HiDeoo! Left a few small comments, but this looks great!

@delucis delucis marked this pull request as ready for review January 14, 2026 17:09
@delucis delucis added the 🌟 minor Change that triggers a minor release label Jan 14, 2026
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Ah, and I missed the failing coverage check. Looks like we should add some testing maybe? The new integrations/pagefind.ts file is showing many lines uncovered in tests.

HiDeoo and others added 2 commits January 15, 2026 18:54
Co-authored-by: delucis <357379+delucis@users.noreply.github.com>
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Thanks for adding the tests @HiDeoo! I think this looks good to go.

Also, realised this is technically only a patch, so no need to wait for the next minor either 🎉

@delucis delucis added 🌟 patch Change that triggers a patch release ✅ approved Pull requests that have been approved and are ready to merge when next cutting a release and removed 🌟 minor Change that triggers a minor release labels Jan 21, 2026
@delucis delucis removed this from the v0.38 milestone Jan 21, 2026
@delucis delucis merged commit 703fab0 into withastro:main Jan 21, 2026
18 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jan 21, 2026
dadezzz pushed a commit to dadezzz/ice-notes that referenced this pull request Jan 25, 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.37.3` → `0.37.4`](https://renovatebot.com/diffs/npm/@astrojs%2fstarlight/0.37.3/0.37.4) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@astrojs%2fstarlight/0.37.4?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@astrojs%2fstarlight/0.37.3/0.37.4?slim=true) |

---

### Release Notes

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

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

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

##### Patch Changes

- [#&#8203;3534](withastro/starlight#3534) [`703fab0`](withastro/starlight@703fab0) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Fixes support for running builds when `npx` is unavailable.

  Previously, Starlight would spawn a process to run the Pagefind search indexing binary using `npx`. On platforms where `npx` isn’t available, this could cause issues. Starlight now runs Pagefind using its Node.js API to avoid a separate process. As a side effect, you may notice that logging during builds is now less verbose.

- [#&#8203;3656](withastro/starlight#3656) [`a0e6368`](withastro/starlight@a0e6368) Thanks [@&#8203;delucis](https://github.com/delucis)! - Fixes several edge cases in highlighting the current page heading in Starlight’s table of contents

- [#&#8203;3663](withastro/starlight#3663) [`00cbf00`](withastro/starlight@00cbf00) Thanks [@&#8203;lines-of-codes](https://github.com/lines-of-codes)! - Adds Thai language support

- [#&#8203;3658](withastro/starlight#3658) [`ac79329`](withastro/starlight@ac79329) Thanks [@&#8203;delucis](https://github.com/delucis)! - Avoids adding redundant `aria-current="false"` attributes to sidebar entries

- [#&#8203;3382](withastro/starlight#3382) [`db295c2`](withastro/starlight@db295c2) Thanks [@&#8203;trueberryless](https://github.com/trueberryless)! - Fixes an issue where the mobile table of contents is unable to find the first heading when a page has a tall banner.

</details>

---

### Configuration

📅 **Schedule**: 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 [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Mi40IiwidXBkYXRlZEluVmVyIjoiNDIuOTIuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: Renovate Bot <renovate@zarantonello.dev>
Co-committed-by: Renovate Bot <renovate@zarantonello.dev>
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request Jan 29, 2026
* main:
  [ci] release (withastro#3659)
  fix: mobile toc issue with custom banners (withastro#3382)
  chore(deps): update actions/checkout action to v6.0.2 (withastro#3670)
  Fix table of contents intersection observer (withastro#3656)
  chore(deps): update peter-evans/create-pull-request action to v8.1.0 (withastro#3669)
  Pagefind CLI → Pagefind API (withastro#3534)
  chore(deps): update changesets/action action to v1.6.0 (withastro#3668)
  i18n(de): Fix orthographic errors in `getting-started.mdx` and `index.mdx` (withastro#3664)
  i18n(fr): update `resources/plugins.mdx` (withastro#3665)
  [ci] format
  i18n(th): Add Thai translations to Starlight UI (withastro#3663)
  i18n(de): update resources/plugins.mdx (withastro#3662)
  i18n(ko): update community plugins (withastro#3661)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✅ approved Pull requests that have been approved and are ready to merge when next cutting a release 🌟 core Changes to Starlight’s main package 🌟 patch Change that triggers a patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pagefind forces the use of npx to run which may not be available

3 participants