@theholocron/astro-config 7.8.0 → 7.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -8
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1 -3
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -5,36 +5,44 @@ An [Astro configuration](https://docs.astro.build/en/reference/configuration-ref
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
pnpm add -D @theholocron/astro-config
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Pass `starlight` and `docsTheme` from your own imports alongside the docs config. This keeps Astro's module loader in control of those framework imports:
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
16
|
// astro.config.ts
|
|
17
|
+
import starlight from "@astrojs/starlight";
|
|
18
|
+
import { docsTheme } from "@theholocron/docs-theme";
|
|
17
19
|
import { defineConfig } from "@theholocron/astro-config";
|
|
18
20
|
import clientsConfig from "@theholocron/clients-docs";
|
|
19
21
|
|
|
20
22
|
export default defineConfig({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
docs: clientsConfig,
|
|
24
|
+
importMetaUrl: import.meta.url,
|
|
25
|
+
starlight,
|
|
26
|
+
docsTheme,
|
|
23
27
|
});
|
|
24
28
|
```
|
|
25
29
|
|
|
26
30
|
### Custom sidebar label
|
|
27
31
|
|
|
28
|
-
By default the sidebar group label is derived from `docs.sidebar[1].label`. Override it when the
|
|
32
|
+
By default the sidebar group label is derived from `docs.sidebar[1].label`. Override it when the label differs:
|
|
29
33
|
|
|
30
34
|
```ts
|
|
35
|
+
import starlight from "@astrojs/starlight";
|
|
36
|
+
import { docsTheme } from "@theholocron/docs-theme";
|
|
31
37
|
import { defineConfig } from "@theholocron/astro-config";
|
|
32
38
|
import holocronConfig from "@theholocron/holocron-docs";
|
|
33
39
|
|
|
34
40
|
export default defineConfig({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
docs: holocronConfig,
|
|
42
|
+
importMetaUrl: import.meta.url,
|
|
43
|
+
starlight,
|
|
44
|
+
docsTheme,
|
|
45
|
+
sidebarLabel: "Reference",
|
|
38
46
|
});
|
|
39
47
|
```
|
|
40
48
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import starlight from "@astrojs/starlight";
|
|
2
|
+
import { docsTheme } from "@theholocron/docs-theme";
|
|
1
3
|
//#region index.d.ts
|
|
2
4
|
interface DocsConfig {
|
|
3
5
|
slug: string;
|
|
@@ -13,8 +15,10 @@ interface DocsConfig {
|
|
|
13
15
|
interface DocsConfigInput {
|
|
14
16
|
docs: DocsConfig;
|
|
15
17
|
importMetaUrl: string;
|
|
18
|
+
starlight: typeof starlight;
|
|
19
|
+
docsTheme: typeof docsTheme;
|
|
16
20
|
sidebarLabel?: string;
|
|
17
21
|
}
|
|
18
|
-
declare function defineConfig({ docs, importMetaUrl, sidebarLabel }: DocsConfigInput): import("astro").AstroUserConfig<never, never, never>;
|
|
22
|
+
declare function defineConfig({ docs, importMetaUrl, starlight, docsTheme, sidebarLabel }: DocsConfigInput): import("astro").AstroUserConfig<never, never, never>;
|
|
19
23
|
//#endregion
|
|
20
24
|
export { DocsConfig, DocsConfigInput, defineConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { relative } from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import starlight from "@astrojs/starlight";
|
|
4
|
-
import { docsTheme } from "@theholocron/docs-theme";
|
|
5
3
|
import { defineConfig as defineConfig$1 } from "astro/config";
|
|
6
4
|
//#region index.ts
|
|
7
|
-
function defineConfig({ docs, importMetaUrl, sidebarLabel }) {
|
|
5
|
+
function defineConfig({ docs, importMetaUrl, starlight, docsTheme, sidebarLabel }) {
|
|
8
6
|
const contentRelDir = relative(fileURLToPath(new URL(".", importMetaUrl)), fileURLToPath(new URL(`../packages/${docs.slug}-docs/content`, importMetaUrl)));
|
|
9
7
|
const secondItem = docs.sidebar[1];
|
|
10
8
|
const defaultLabel = secondItem !== void 0 && "items" in secondItem ? secondItem.label : "Contents";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/astro-config",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.9.0",
|
|
4
4
|
"description": "Astro configuration factory for theholocron docs sites.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro",
|
|
@@ -31,18 +31,16 @@
|
|
|
31
31
|
"dist/"
|
|
32
32
|
],
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@astrojs/starlight": "^0.41.
|
|
34
|
+
"@astrojs/starlight": "^0.41.6",
|
|
35
35
|
"@theholocron/docs-theme": "^1.2.2",
|
|
36
36
|
"@vitest/coverage-v8": "^4.1.10",
|
|
37
37
|
"astro": "^7.1.5",
|
|
38
38
|
"tsdown": "^0.22.14",
|
|
39
39
|
"typescript": "^5.9.3",
|
|
40
40
|
"vitest": "^4.1.10",
|
|
41
|
-
"@theholocron/tsconfig": "7.
|
|
41
|
+
"@theholocron/tsconfig": "7.9.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@astrojs/starlight": ">=0.30.0",
|
|
45
|
-
"@theholocron/docs-theme": ">=1.2.2",
|
|
46
44
|
"astro": ">=5.0.0"
|
|
47
45
|
},
|
|
48
46
|
"engines": {
|
|
@@ -56,6 +54,7 @@
|
|
|
56
54
|
"scripts": {
|
|
57
55
|
"build": "tsdown",
|
|
58
56
|
"test": "vitest run",
|
|
59
|
-
"typecheck": "tsc --noEmit"
|
|
57
|
+
"typecheck": "tsc --noEmit",
|
|
58
|
+
"test:coverage": "vitest run --coverage"
|
|
60
59
|
}
|
|
61
60
|
}
|