-
-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@astrojs/starlight': patch | ||
--- | ||
|
||
Fixes an issue when using the `<StarlightPage>` component in a custom page with a user-defined `srcDir` configuration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { expect, testFactory } from './test-utils'; | ||
|
||
const test = await testFactory('./fixtures/custom-src-dir/'); | ||
|
||
test('builds a custom page using the `<StarlightPage>` component and a custom `srcDir`', async ({ | ||
page, | ||
starlight, | ||
}) => { | ||
await starlight.goto('/custom'); | ||
|
||
await expect(page.getByText('Hello')).toBeVisible(); | ||
}); |
11 changes: 11 additions & 0 deletions
11
packages/starlight/__e2e__/fixtures/custom-src-dir/astro.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import starlight from '@astrojs/starlight'; | ||
import { defineConfig } from 'astro/config'; | ||
|
||
export default defineConfig({ | ||
srcDir: './www', | ||
integrations: [ | ||
starlight({ | ||
title: 'Custom src directory', | ||
}), | ||
], | ||
}); |
9 changes: 9 additions & 0 deletions
9
packages/starlight/__e2e__/fixtures/custom-src-dir/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@e2e/custom-src-dir", | ||
"version": "0.0.0", | ||
"private": true, | ||
"dependencies": { | ||
"@astrojs/starlight": "workspace:*", | ||
"astro": "^4.10.2" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/starlight/__e2e__/fixtures/custom-src-dir/www/content/config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { defineCollection } from 'astro:content'; | ||
import { docsSchema } from '@astrojs/starlight/schema'; | ||
|
||
export const collections = { | ||
docs: defineCollection({ schema: docsSchema() }), | ||
}; |
2 changes: 2 additions & 0 deletions
2
packages/starlight/__e2e__/fixtures/custom-src-dir/www/env.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// <reference path="../.astro/types.d.ts" /> | ||
/// <reference types="astro/client" /> |
7 changes: 7 additions & 0 deletions
7
packages/starlight/__e2e__/fixtures/custom-src-dir/www/pages/custom.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; | ||
--- | ||
|
||
<StarlightPage frontmatter={{ title: 'A custom page' }}> | ||
<p>Hello</p> | ||
</StarlightPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ export default defineConfig({ | |
}, | ||
], | ||
testMatch: '__e2e__/*.test.ts', | ||
workers: 1, | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.