@theholocron/astro-config 7.18.1 → 7.19.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/dist/index.d.ts +7 -11
- package/dist/index.js +6 -17
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import starlight from "@astrojs/starlight";
|
|
2
2
|
import { docsTheme } from "@theholocron/docs-theme";
|
|
3
3
|
//#region index.d.ts
|
|
4
|
+
type StarlightSidebar = NonNullable<Parameters<typeof starlight>[0]["sidebar"]>;
|
|
4
5
|
interface DocsConfig {
|
|
5
|
-
slug: string;
|
|
6
6
|
name: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} & ({
|
|
10
|
-
slug: string;
|
|
11
|
-
} | {
|
|
12
|
-
items: unknown[];
|
|
13
|
-
})>;
|
|
7
|
+
github: string;
|
|
8
|
+
sidebar: StarlightSidebar;
|
|
14
9
|
}
|
|
15
10
|
interface DocsConfigInput {
|
|
16
11
|
docs: DocsConfig;
|
|
17
|
-
importMetaUrl: string;
|
|
18
12
|
starlight: typeof starlight;
|
|
19
13
|
docsTheme: typeof docsTheme;
|
|
20
|
-
|
|
14
|
+
srcDir?: string;
|
|
15
|
+
outDir?: string;
|
|
16
|
+
publicDir?: string;
|
|
21
17
|
}
|
|
22
|
-
declare function defineConfig({ docs,
|
|
18
|
+
declare function defineConfig({ docs, starlight, docsTheme, srcDir, outDir, publicDir }: DocsConfigInput): import("astro").AstroUserConfig<never, never, never>;
|
|
23
19
|
//#endregion
|
|
24
20
|
export { DocsConfig, DocsConfigInput, defineConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,30 +1,19 @@
|
|
|
1
|
-
import { relative } from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
1
|
import { defineConfig as defineConfig$1 } from "astro/config";
|
|
4
2
|
//#region index.ts
|
|
5
|
-
function defineConfig({ docs,
|
|
6
|
-
const contentRelDir = relative(fileURLToPath(new URL(".", importMetaUrl)), fileURLToPath(new URL(`../packages/${docs.slug}-docs/content`, importMetaUrl)));
|
|
7
|
-
const secondItem = docs.sidebar[1];
|
|
8
|
-
const defaultLabel = secondItem !== void 0 && "items" in secondItem ? secondItem.label : "Contents";
|
|
9
|
-
const label = sidebarLabel ?? defaultLabel;
|
|
3
|
+
function defineConfig({ docs, starlight, docsTheme, srcDir, outDir, publicDir }) {
|
|
10
4
|
return defineConfig$1({
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
...srcDir && { srcDir },
|
|
6
|
+
...outDir && { outDir },
|
|
7
|
+
...publicDir && { publicDir },
|
|
13
8
|
integrations: [starlight({
|
|
14
9
|
title: docs.name,
|
|
15
10
|
plugins: [docsTheme()],
|
|
16
11
|
social: [{
|
|
17
12
|
icon: "github",
|
|
18
13
|
label: "GitHub",
|
|
19
|
-
href: `https://github.com/theholocron/${docs.
|
|
14
|
+
href: `https://github.com/theholocron/${docs.github}`
|
|
20
15
|
}],
|
|
21
|
-
sidebar:
|
|
22
|
-
label: "Overview",
|
|
23
|
-
slug: ""
|
|
24
|
-
}, {
|
|
25
|
-
label,
|
|
26
|
-
items: [{ autogenerate: { directory: contentRelDir } }]
|
|
27
|
-
}]
|
|
16
|
+
sidebar: docs.sidebar
|
|
28
17
|
})]
|
|
29
18
|
});
|
|
30
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/astro-config",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.19.0",
|
|
4
4
|
"description": "Astro configuration factory for theholocron docs sites.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro",
|
|
@@ -38,7 +38,7 @@
|
|
|
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.19.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"astro": ">=5.0.0"
|