@theholocron/docs-theme 1.10.3 → 1.10.5-alpha.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/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/content.d.mts +2 -5
- package/dist/content.mjs +1 -2
- package/dist/index.d.mts +2 -4
- package/dist/index.mjs +1 -2
- package/dist/loader.d.mts +3 -6
- package/dist/loader.mjs +2 -3
- package/package.json +20 -24
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
|
package/dist/content.d.mts
CHANGED
package/dist/content.mjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { docsLoader } from "@astrojs/starlight/loaders";
|
|
2
2
|
import { docsSchema } from "@astrojs/starlight/schema";
|
|
3
3
|
import { defineCollection } from "astro:content";
|
|
4
|
-
|
|
4
|
+
// src/content.ts
|
|
5
5
|
function createDocsCollections() {
|
|
6
6
|
return { docs: defineCollection({
|
|
7
7
|
loader: docsLoader(),
|
|
8
8
|
schema: docsSchema()
|
|
9
9
|
}) };
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
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,5 @@ interface StarlightPlugin {
|
|
|
14
13
|
setup(options: SetupOptions): void | Promise<void>;
|
|
15
14
|
};
|
|
16
15
|
}
|
|
17
|
-
declare function docsTheme(): StarlightPlugin;
|
|
18
|
-
|
|
19
|
-
export { docsTheme };
|
|
16
|
+
export declare function docsTheme(): StarlightPlugin;
|
|
17
|
+
export {};
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
|
-
|
|
2
|
+
// src/index.ts
|
|
3
3
|
const styles = fileURLToPath(new URL("./styles.css", import.meta.url));
|
|
4
4
|
function docsTheme() {
|
|
5
5
|
return {
|
|
@@ -9,5 +9,4 @@ function docsTheme() {
|
|
|
9
9
|
} }
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
12
|
export { docsTheme };
|
package/dist/loader.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Loader } from "astro/loaders";
|
|
2
|
-
|
|
3
|
-
type DocsSource = {
|
|
2
|
+
export type DocsSource = {
|
|
4
3
|
dir: string;
|
|
5
4
|
slug: string;
|
|
6
5
|
} | {
|
|
@@ -23,12 +22,10 @@ type DocsSource = {
|
|
|
23
22
|
* docs: defineCollection({
|
|
24
23
|
* loader: createDocsLoader([
|
|
25
24
|
* { dir: fileURLToPath(new URL("content/docs", import.meta.url)), slug: "" },
|
|
26
|
-
* { package: "@
|
|
25
|
+
* { package: "@example/content-package", slug: "projects/example" },
|
|
27
26
|
* ]),
|
|
28
27
|
* schema: docsSchema(),
|
|
29
28
|
* }),
|
|
30
29
|
* };
|
|
31
30
|
*/
|
|
32
|
-
declare function createDocsLoader(sources: DocsSource[]): Loader;
|
|
33
|
-
//#endregion
|
|
34
|
-
export { DocsSource, createDocsLoader };
|
|
31
|
+
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
|
-
|
|
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: "@
|
|
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
|
+
"version": "1.10.5-alpha.1",
|
|
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://
|
|
15
|
-
"bugs": "https://github.com/theholocron/
|
|
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/
|
|
19
|
-
"directory": "
|
|
18
|
+
"url": "git+https://github.com/theholocron/holocron.git",
|
|
19
|
+
"directory": "themes/docs-theme"
|
|
20
20
|
},
|
|
21
|
-
"license": "
|
|
21
|
+
"license": "MIT",
|
|
22
22
|
"author": "Newton Koumantzelis",
|
|
23
23
|
"sideEffects": [
|
|
24
24
|
"*.css"
|
|
@@ -50,21 +50,20 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@astrojs/starlight": "^0.41.7",
|
|
53
|
-
"@theholocron/eslint-config": "^8.2
|
|
54
|
-
"@theholocron/
|
|
55
|
-
"@theholocron/
|
|
56
|
-
"@
|
|
57
|
-
"@types/node": "^26
|
|
58
|
-
"@vitest/coverage-v8": "^
|
|
59
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
53
|
+
"@theholocron/eslint-config": "^8.8.2",
|
|
54
|
+
"@theholocron/tsdown-config": "^8.8.2",
|
|
55
|
+
"@theholocron/vitest-config": "^8.8.2",
|
|
56
|
+
"@tsconfig/node-lts": "^24.0.1",
|
|
57
|
+
"@types/node": "^26",
|
|
58
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
59
|
+
"@vitest/eslint-plugin": "^1.6.27",
|
|
60
60
|
"astro": "^7.2.2",
|
|
61
61
|
"eslint": "^10.8.1",
|
|
62
62
|
"eslint-plugin-n": "^18.3.0",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"tsdown": "^0.22.13",
|
|
63
|
+
"globals": "^17.11.0",
|
|
64
|
+
"tsdown": "^0.23.3",
|
|
66
65
|
"typescript": "^5.9.3",
|
|
67
|
-
"vitest": "^
|
|
66
|
+
"vitest": "^5.0.5"
|
|
68
67
|
},
|
|
69
68
|
"peerDependencies": {
|
|
70
69
|
"@astrojs/starlight": ">=0.30.0",
|
|
@@ -76,14 +75,11 @@
|
|
|
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
|
-
"build": "tsdown && cp src/styles.css dist/",
|
|
83
|
-
"
|
|
84
|
-
"test": "vitest run",
|
|
85
|
-
"test:coverage": "vitest run --coverage",
|
|
79
|
+
"delivery.build": "tsdown && cp src/styles.css dist/",
|
|
80
|
+
"sourceQuality.staticAnalysis": "eslint .",
|
|
86
81
|
"test:watch": "vitest",
|
|
87
|
-
"
|
|
82
|
+
"verification.typeSafety": "tsc --noEmit",
|
|
83
|
+
"verification.unitTests": "vitest run"
|
|
88
84
|
}
|
|
89
85
|
}
|