@theholocron/astro-config 7.8.0 → 7.8.1

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 CHANGED
@@ -10,30 +10,38 @@ npm install --save-dev @theholocron/astro-config
10
10
 
11
11
  ## Usage
12
12
 
13
- Replace `astro/config`'s `defineConfig` with this package's `defineConfig` and pass a `docs` config object and `importMetaUrl`:
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
23
  docs: clientsConfig,
22
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 group label in the docs config differs from what the site should show:
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
41
  docs: holocronConfig,
36
42
  importMetaUrl: import.meta.url,
43
+ starlight,
44
+ docsTheme,
37
45
  sidebarLabel: "Reference",
38
46
  });
39
47
  ```
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.8.0",
3
+ "version": "7.8.1",
4
4
  "description": "Astro configuration factory for theholocron docs sites.",
5
5
  "keywords": [
6
6
  "astro",
@@ -38,11 +38,9 @@
38
38
  "tsdown": "^0.22.14",
39
39
  "typescript": "^5.9.3",
40
40
  "vitest": "^4.1.10",
41
- "@theholocron/tsconfig": "7.8.0"
41
+ "@theholocron/tsconfig": "7.8.1"
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": {