@theholocron/docs-theme 1.10.3 → 1.11.0-alpha.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Newton Koumantzelis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -8,6 +8,15 @@ Starlight plugin that injects the shared `@theholocron` docs CSS theme.
8
8
  pnpm add @theholocron/docs-theme
9
9
  ```
10
10
 
11
+ ## Exports
12
+
13
+ | Export | Description |
14
+ | ------------------------------------ | ------------------------------------------------------------------------------------- |
15
+ | `@theholocron/docs-theme` | `docsTheme()`, the Starlight plugin that injects the CSS |
16
+ | `@theholocron/docs-theme/content` | `createDocsCollections()`, the `docs` collection for a site |
17
+ | `@theholocron/docs-theme/loader` | `createDocsLoader()`, an Astro loader for `.md`/`.mdx` in folders or content packages |
18
+ | `@theholocron/docs-theme/styles.css` | the theme stylesheet on its own |
19
+
11
20
  ## Usage
12
21
 
13
22
  ```ts
@@ -1,6 +1,4 @@
1
- //#region src/content.d.ts
2
- declare function createDocsCollections(): {
1
+ /** The `docs` content collection for `src/content.config.ts`: Starlight's docs loader and schema. Exported from `@theholocron/docs-theme/content`. */
2
+ export declare function createDocsCollections(): {
3
3
  docs: any;
4
- };
5
- //#endregion
6
- export { createDocsCollections };
4
+ };
package/dist/content.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import { docsLoader } from "@astrojs/starlight/loaders";
2
2
  import { docsSchema } from "@astrojs/starlight/schema";
3
3
  import { defineCollection } from "astro:content";
4
- //#region src/content.ts
4
+ // src/content.ts
5
+ /** The `docs` content collection for `src/content.config.ts`: Starlight's docs loader and schema. Exported from `@theholocron/docs-theme/content`. */
5
6
  function createDocsCollections() {
6
7
  return { docs: defineCollection({
7
8
  loader: docsLoader(),
8
9
  schema: docsSchema()
9
10
  }) };
10
11
  }
11
- //#endregion
12
12
  export { createDocsCollections };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/index.d.ts
2
1
  interface SetupOptions {
3
2
  config: {
4
3
  customCss?: string[];
@@ -14,6 +13,6 @@ interface StarlightPlugin {
14
13
  setup(options: SetupOptions): void | Promise<void>;
15
14
  };
16
15
  }
17
- declare function docsTheme(): StarlightPlugin;
18
- //#endregion
19
- export { docsTheme };
16
+ /** A Starlight plugin that puts the theme's stylesheet ahead of the site's own custom CSS. */
17
+ export declare function docsTheme(): StarlightPlugin;
18
+ export {};
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { fileURLToPath } from "node:url";
2
- //#region src/index.ts
2
+ // src/index.ts
3
3
  const styles = fileURLToPath(new URL("./styles.css", import.meta.url));
4
+ /** A Starlight plugin that puts the theme's stylesheet ahead of the site's own custom CSS. */
4
5
  function docsTheme() {
5
6
  return {
6
7
  name: "@theholocron/docs-theme",
@@ -9,5 +10,4 @@ function docsTheme() {
9
10
  } }
10
11
  };
11
12
  }
12
- //#endregion
13
13
  export { docsTheme };
package/dist/loader.d.mts CHANGED
@@ -1,6 +1,9 @@
1
1
  import { Loader } from "astro/loaders";
2
- //#region src/loader.d.ts
3
- type DocsSource = {
2
+ /**
3
+ * Where a docs collection reads its pages from: a directory in the repo, or the docs of a package, under a URL
4
+ * `slug`.
5
+ */
6
+ export type DocsSource = {
4
7
  dir: string;
5
8
  slug: string;
6
9
  } | {
@@ -23,12 +26,10 @@ type DocsSource = {
23
26
  * docs: defineCollection({
24
27
  * loader: createDocsLoader([
25
28
  * { dir: fileURLToPath(new URL("content/docs", import.meta.url)), slug: "" },
26
- * { package: "@theholocron/clients-docs", slug: "projects/clients" },
29
+ * { package: "@example/content-package", slug: "projects/example" },
27
30
  * ]),
28
31
  * schema: docsSchema(),
29
32
  * }),
30
33
  * };
31
34
  */
32
- declare function createDocsLoader(sources: DocsSource[]): Loader;
33
- //#endregion
34
- export { DocsSource, createDocsLoader };
35
+ export declare function createDocsLoader(sources: DocsSource[]): Loader;
package/dist/loader.mjs CHANGED
@@ -4,7 +4,7 @@ import { existsSync } from "node:fs";
4
4
  import { readFile, readdir } from "node:fs/promises";
5
5
  import { dirname, extname, join, relative } from "node:path";
6
6
  import matter from "gray-matter";
7
- //#region src/loader.ts
7
+ // src/loader.ts
8
8
  const EXTENSIONS = /* @__PURE__ */ new Set([".md", ".mdx"]);
9
9
  async function* walk(dir) {
10
10
  for (const entry of await readdir(dir, { withFileTypes: true })) {
@@ -52,7 +52,7 @@ function resolvePackageContentDir(packageName, root) {
52
52
  * docs: defineCollection({
53
53
  * loader: createDocsLoader([
54
54
  * { dir: fileURLToPath(new URL("content/docs", import.meta.url)), slug: "" },
55
- * { package: "@theholocron/clients-docs", slug: "projects/clients" },
55
+ * { package: "@example/content-package", slug: "projects/example" },
56
56
  * ]),
57
57
  * schema: docsSchema(),
58
58
  * }),
@@ -103,5 +103,4 @@ function createDocsLoader(sources) {
103
103
  }
104
104
  };
105
105
  }
106
- //#endregion
107
106
  export { createDocsLoader };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/docs-theme",
3
- "version": "1.10.3",
3
+ "version": "1.11.0-alpha.3",
4
4
  "description": "Starlight plugin providing the shared docs theme.",
5
5
  "keywords": [
6
6
  "astro",
@@ -11,14 +11,14 @@
11
11
  "theme",
12
12
  "typescript"
13
13
  ],
14
- "homepage": "https://github.com/theholocron/themes/tree/main/packages/docs-theme#readme",
15
- "bugs": "https://github.com/theholocron/themes/issues",
14
+ "homepage": "https://docs.theholocron.dev/holocron/themes/docs-theme/",
15
+ "bugs": "https://github.com/theholocron/holocron/issues",
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "git+https://github.com/theholocron/themes.git",
19
- "directory": "packages/docs-theme"
18
+ "url": "git+https://github.com/theholocron/holocron.git",
19
+ "directory": "themes/docs-theme"
20
20
  },
21
- "license": "GPL-3.0",
21
+ "license": "MIT",
22
22
  "author": "Newton Koumantzelis",
23
23
  "sideEffects": [
24
24
  "*.css"
@@ -49,22 +49,21 @@
49
49
  "gray-matter": "^4.0.3"
50
50
  },
51
51
  "devDependencies": {
52
- "@astrojs/starlight": "^0.41.7",
53
- "@theholocron/eslint-config": "^8.2.0",
54
- "@theholocron/tsconfig": "^8.2.0",
55
- "@theholocron/tsdown-config": "^8.2.0",
56
- "@theholocron/vitest-config": "^8.2.0",
57
- "@types/node": "^26.4.1",
58
- "@vitest/coverage-v8": "^4.1.10",
59
- "@vitest/eslint-plugin": "^1.6.26",
60
- "astro": "^7.2.2",
61
- "eslint": "^10.8.1",
62
- "eslint-plugin-n": "^18.3.0",
63
- "eslint-plugin-simple-import-sort": "^14.0.0",
64
- "globals": "^17.12.0",
65
- "tsdown": "^0.22.13",
52
+ "@astrojs/starlight": "^0.42.11",
53
+ "@tsconfig/node-lts": "^24.0.1",
54
+ "@types/node": "^26",
55
+ "@vitest/coverage-v8": "^5.1.0",
56
+ "@vitest/eslint-plugin": "^1.6.28",
57
+ "astro": "^7.4.7",
58
+ "eslint": "^10.14.0",
59
+ "eslint-plugin-n": "^18.5.0",
60
+ "globals": "^17.14.0",
61
+ "tsdown": "^0.23.7",
66
62
  "typescript": "^5.9.3",
67
- "vitest": "^4.1.10"
63
+ "vitest": "^5.1.0",
64
+ "@theholocron/eslint-config": "^8.9.0-alpha.20",
65
+ "@theholocron/vitest-config": "^8.9.0-alpha.20",
66
+ "@theholocron/tsdown-config": "^8.9.0-alpha.20"
68
67
  },
69
68
  "peerDependencies": {
70
69
  "@astrojs/starlight": ">=0.30.0",
@@ -76,13 +75,10 @@
76
75
  "publishConfig": {
77
76
  "access": "public"
78
77
  },
79
- "releases": "https://github.com/theholocron/themes/releases",
80
- "wiki": "https://github.com/theholocron/themes/wiki",
81
78
  "scripts": {
82
79
  "build": "tsdown && cp src/styles.css dist/",
83
- "lint": "eslint .",
84
- "test": "vitest run",
85
- "test:coverage": "vitest run --coverage",
80
+ "lint:code": "eslint .",
81
+ "test:unit": "vitest run --coverage",
86
82
  "test:watch": "vitest",
87
83
  "typecheck": "tsc --noEmit"
88
84
  }