-
-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix usage of <StarlightPage>
with a custom srcDir
configuration
#2054
Fix usage of <StarlightPage>
with a custom srcDir
configuration
#2054
Conversation
…onent in a custom page
🦋 Changeset detectedLatest commit: 790a62c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! End-to-end test here is actually not a bad idea in general as a basic sanity check for srcDir
support.
The only thing I’m wondering is if we should also be running E2E tests on Windows? I never remember with file path stuff what we’re supposed to do, so for something like this change, Windows E2E might add some confidence if they weren’t too slow.
Yeah, I'll enable them. This is also the approach we would have ended up with very soon anyway as the SSR PR includes atm some "functional" tests but it's just a few tests which do not really justify a new kind of tests. The idea will be to improve our E2E setup and refactor them as E2E tests, using |
Will merge this without the extra E2E tests — at worst it fixes stuff for users on some platforms and we can add the Windows E2E later. Thanks again @HiDeoo! |
Description
srcDir
seems to be not supported HiDeoo/starlight-blog#60When using a custom page with the
<StarlightPage>
component, the user docs schema is retrived using the virtual modulevirtual:starlight/collection-config
which attempts to import/src/content/config.ts
. Altho, this does not consider the user having a customsrcDir
.In such cases, trying to build the project would result in the following error:
This PR fixes the issue by taking the
srcDir
into account when importing the user docs schema.I could not imagine a proper way to test this using a unit test so I ended up adding an e2e one instead which would fail to even build the fixture project before the fix.