@tenphi/docs 0.1.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/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/config/index.d.ts +12 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +143 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/schema.json +44 -0
- package/dist/content/index.d.ts +28 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +2 -0
- package/dist/content-DStZeziu.js +736 -0
- package/dist/content-DStZeziu.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/markdown/index.d.ts +19 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +88 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +17 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/types-rjENJzWH.d.ts +1293 -0
- package/dist/types-rjENJzWH.d.ts.map +1 -0
- package/package.json +80 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Andrey Yamanov
|
|
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
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @tenphi/docs
|
|
2
|
+
|
|
3
|
+
Renderer-neutral configuration, source discovery, npm artifact locking, content
|
|
4
|
+
graph construction, Markdown reference rewriting, and diagnostics for Tasty
|
|
5
|
+
Docs.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createDocsGraph, defineDocsConfig } from "@tenphi/docs";
|
|
9
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { E as SiteConfig, O as ThemeConfig, T as SearchConfig, _ as MarkdownConfig, c as DocsConfig, g as DocsSource, i as ContentConfig, l as DocsDiagnostic, n as BuildConfig, r as ComponentsConfig, t as BrandConfig, v as NavigationConfig, x as NormalizedDocsConfig, y as NavigationItem } from "../types-rjENJzWH.js";
|
|
2
|
+
//#region src/config/index.d.ts
|
|
3
|
+
declare class DocsConfigError extends Error {
|
|
4
|
+
readonly diagnostics: DocsDiagnostic[];
|
|
5
|
+
constructor(diagnostics: DocsDiagnostic[]);
|
|
6
|
+
}
|
|
7
|
+
declare function validateConfig(config: DocsConfig): DocsDiagnostic[];
|
|
8
|
+
declare function normalizeDocsConfig(config?: DocsConfig): NormalizedDocsConfig;
|
|
9
|
+
declare function defineDocsConfig<const T extends DocsConfig>(config: T): T;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { type BrandConfig, type BuildConfig, type ComponentsConfig, type ContentConfig, type DocsConfig, DocsConfigError, type DocsSource, type MarkdownConfig, type NavigationConfig, type NavigationItem, type NormalizedDocsConfig, type SearchConfig, type SiteConfig, type ThemeConfig, defineDocsConfig, normalizeDocsConfig, validateConfig };
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/config/index.ts"],"mappings":";;cA4Ca,wBAAwB;WAC1B,aAAa;EAEtB,YAAY,aAAa;;iBAOX,eAAe,QAAQ,aAAa;iBA6DpC,oBACd,SAAQ,aACP;iBAwCa,uBAAuB,UAAU,YAAY,QAAQ,IAAI"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
//#region src/config/index.ts
|
|
2
|
+
const DEFAULT_BRAND = "#315efb";
|
|
3
|
+
const ROOT_KEYS = /* @__PURE__ */ new Set([
|
|
4
|
+
"site",
|
|
5
|
+
"content",
|
|
6
|
+
"navigation",
|
|
7
|
+
"theme",
|
|
8
|
+
"markdown",
|
|
9
|
+
"search",
|
|
10
|
+
"components",
|
|
11
|
+
"build"
|
|
12
|
+
]);
|
|
13
|
+
const OBJECT_KEYS = {
|
|
14
|
+
site: /* @__PURE__ */ new Set([
|
|
15
|
+
"title",
|
|
16
|
+
"description",
|
|
17
|
+
"url",
|
|
18
|
+
"repository"
|
|
19
|
+
]),
|
|
20
|
+
content: /* @__PURE__ */ new Set([
|
|
21
|
+
"sources",
|
|
22
|
+
"allowOutsideRoot",
|
|
23
|
+
"localizeRepositoryLinks"
|
|
24
|
+
]),
|
|
25
|
+
markdown: /* @__PURE__ */ new Set([
|
|
26
|
+
"stripLeadingBadges",
|
|
27
|
+
"rawHtml",
|
|
28
|
+
"strictLanguages",
|
|
29
|
+
"executablePreviews",
|
|
30
|
+
"remarkPlugins",
|
|
31
|
+
"rehypePlugins"
|
|
32
|
+
]),
|
|
33
|
+
search: /* @__PURE__ */ new Set(["enabled"]),
|
|
34
|
+
components: /* @__PURE__ */ new Set(["overrides"]),
|
|
35
|
+
build: /* @__PURE__ */ new Set([
|
|
36
|
+
"strict",
|
|
37
|
+
"ci",
|
|
38
|
+
"base",
|
|
39
|
+
"cacheDir",
|
|
40
|
+
"maxArtifactBytes",
|
|
41
|
+
"maxUnpackedBytes",
|
|
42
|
+
"maxFiles",
|
|
43
|
+
"maxPathDepth",
|
|
44
|
+
"maxAssetBytes"
|
|
45
|
+
])
|
|
46
|
+
};
|
|
47
|
+
var DocsConfigError = class extends Error {
|
|
48
|
+
diagnostics;
|
|
49
|
+
constructor(diagnostics) {
|
|
50
|
+
super(diagnostics.map((diagnostic) => diagnostic.message).join("\n"));
|
|
51
|
+
this.name = "DocsConfigError";
|
|
52
|
+
this.diagnostics = diagnostics;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
function validateConfig(config) {
|
|
56
|
+
const diagnostics = [];
|
|
57
|
+
for (const key of Object.keys(config)) if (!ROOT_KEYS.has(key)) unknown(diagnostics, key);
|
|
58
|
+
for (const [section, keys] of Object.entries(OBJECT_KEYS)) {
|
|
59
|
+
const value = config[section];
|
|
60
|
+
if (value === void 0 || Array.isArray(value) || typeof value !== "object") continue;
|
|
61
|
+
for (const key of Object.keys(value)) if (!keys.has(key)) unknown(diagnostics, `${section}.${key}`);
|
|
62
|
+
}
|
|
63
|
+
const sources = config.content?.sources ?? [];
|
|
64
|
+
for (const [index, source] of sources.entries()) if ([
|
|
65
|
+
"file",
|
|
66
|
+
"glob",
|
|
67
|
+
"package"
|
|
68
|
+
].filter((key) => key in source).length !== 1) diagnostics.push({
|
|
69
|
+
code: "DOCS_CONFIG_INVALID",
|
|
70
|
+
severity: "error",
|
|
71
|
+
message: `content.sources[${index}] must select exactly one of file, glob, or package.`
|
|
72
|
+
});
|
|
73
|
+
const brand = config.theme?.brand;
|
|
74
|
+
if (typeof brand === "object" && brand !== null && "contrast" in brand && !brand.unsafeContrast) {
|
|
75
|
+
const target = brand.contrast?.apca;
|
|
76
|
+
const normal = Array.isArray(target) ? target[0] : target;
|
|
77
|
+
if (typeof normal === "number" && normal < 45) diagnostics.push({
|
|
78
|
+
code: "DOCS_CONFIG_INVALID",
|
|
79
|
+
severity: "error",
|
|
80
|
+
message: "theme.brand.contrast.apca cannot be below 45 without unsafeContrast.",
|
|
81
|
+
hint: "Remove the override, use 45 or higher, or explicitly set unsafeContrast: true."
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return diagnostics;
|
|
85
|
+
}
|
|
86
|
+
function unknown(diagnostics, path) {
|
|
87
|
+
diagnostics.push({
|
|
88
|
+
code: "DOCS_CONFIG_UNKNOWN_KEY",
|
|
89
|
+
severity: "error",
|
|
90
|
+
message: `Unknown configuration key "${path}".`
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function normalizeDocsConfig(config = {}) {
|
|
94
|
+
const diagnostics = validateConfig(config);
|
|
95
|
+
if (diagnostics.length > 0) throw new DocsConfigError(diagnostics);
|
|
96
|
+
const navigation = Array.isArray(config.navigation) ? { items: config.navigation } : config.navigation ?? {};
|
|
97
|
+
return {
|
|
98
|
+
site: { ...config.site },
|
|
99
|
+
content: {
|
|
100
|
+
allowOutsideRoot: false,
|
|
101
|
+
localizeRepositoryLinks: false,
|
|
102
|
+
...config.content
|
|
103
|
+
},
|
|
104
|
+
navigation,
|
|
105
|
+
theme: {
|
|
106
|
+
...config.theme,
|
|
107
|
+
brand: config.theme?.brand ?? DEFAULT_BRAND
|
|
108
|
+
},
|
|
109
|
+
markdown: {
|
|
110
|
+
stripLeadingBadges: true,
|
|
111
|
+
rawHtml: "sanitize",
|
|
112
|
+
strictLanguages: false,
|
|
113
|
+
executablePreviews: true,
|
|
114
|
+
...config.markdown
|
|
115
|
+
},
|
|
116
|
+
search: {
|
|
117
|
+
enabled: true,
|
|
118
|
+
...config.search
|
|
119
|
+
},
|
|
120
|
+
components: { ...config.components },
|
|
121
|
+
build: {
|
|
122
|
+
strict: true,
|
|
123
|
+
ci: process.env.CI === "true",
|
|
124
|
+
base: "/",
|
|
125
|
+
cacheDir: "",
|
|
126
|
+
maxArtifactBytes: 26214400,
|
|
127
|
+
maxUnpackedBytes: 104857600,
|
|
128
|
+
maxFiles: 1e4,
|
|
129
|
+
maxPathDepth: 24,
|
|
130
|
+
maxAssetBytes: 20971520,
|
|
131
|
+
...config.build
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function defineDocsConfig(config) {
|
|
136
|
+
const diagnostics = validateConfig(config);
|
|
137
|
+
if (diagnostics.length > 0) throw new DocsConfigError(diagnostics);
|
|
138
|
+
return config;
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
141
|
+
export { DocsConfigError, defineDocsConfig, normalizeDocsConfig, validateConfig };
|
|
142
|
+
|
|
143
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/config/index.ts"],"sourcesContent":["import type {\n DocsConfig,\n DocsDiagnostic,\n NormalizedDocsConfig,\n} from \"../types.js\";\n\nconst DEFAULT_BRAND = \"#315efb\";\nconst ROOT_KEYS = new Set([\n \"site\",\n \"content\",\n \"navigation\",\n \"theme\",\n \"markdown\",\n \"search\",\n \"components\",\n \"build\",\n]);\n\nconst OBJECT_KEYS: Record<string, Set<string>> = {\n site: new Set([\"title\", \"description\", \"url\", \"repository\"]),\n content: new Set([\"sources\", \"allowOutsideRoot\", \"localizeRepositoryLinks\"]),\n markdown: new Set([\n \"stripLeadingBadges\",\n \"rawHtml\",\n \"strictLanguages\",\n \"executablePreviews\",\n \"remarkPlugins\",\n \"rehypePlugins\",\n ]),\n search: new Set([\"enabled\"]),\n components: new Set([\"overrides\"]),\n build: new Set([\n \"strict\",\n \"ci\",\n \"base\",\n \"cacheDir\",\n \"maxArtifactBytes\",\n \"maxUnpackedBytes\",\n \"maxFiles\",\n \"maxPathDepth\",\n \"maxAssetBytes\",\n ]),\n};\n\nexport class DocsConfigError extends Error {\n readonly diagnostics: DocsDiagnostic[];\n\n constructor(diagnostics: DocsDiagnostic[]) {\n super(diagnostics.map((diagnostic) => diagnostic.message).join(\"\\n\"));\n this.name = \"DocsConfigError\";\n this.diagnostics = diagnostics;\n }\n}\n\nexport function validateConfig(config: DocsConfig): DocsDiagnostic[] {\n const diagnostics: DocsDiagnostic[] = [];\n for (const key of Object.keys(config)) {\n if (!ROOT_KEYS.has(key)) unknown(diagnostics, key);\n }\n for (const [section, keys] of Object.entries(OBJECT_KEYS)) {\n const value = config[section as keyof DocsConfig];\n if (\n value === undefined ||\n Array.isArray(value) ||\n typeof value !== \"object\"\n ) {\n continue;\n }\n for (const key of Object.keys(value)) {\n if (!keys.has(key)) unknown(diagnostics, `${section}.${key}`);\n }\n }\n\n const sources = config.content?.sources ?? [];\n for (const [index, source] of sources.entries()) {\n const variants = [\"file\", \"glob\", \"package\"].filter((key) => key in source);\n if (variants.length !== 1) {\n diagnostics.push({\n code: \"DOCS_CONFIG_INVALID\",\n severity: \"error\",\n message: `content.sources[${index}] must select exactly one of file, glob, or package.`,\n });\n }\n }\n\n const brand = config.theme?.brand;\n if (\n typeof brand === \"object\" &&\n brand !== null &&\n \"contrast\" in brand &&\n !brand.unsafeContrast\n ) {\n const target = brand.contrast?.apca;\n const normal = Array.isArray(target) ? target[0] : target;\n if (typeof normal === \"number\" && normal < 45) {\n diagnostics.push({\n code: \"DOCS_CONFIG_INVALID\",\n severity: \"error\",\n message:\n \"theme.brand.contrast.apca cannot be below 45 without unsafeContrast.\",\n hint: \"Remove the override, use 45 or higher, or explicitly set unsafeContrast: true.\",\n });\n }\n }\n return diagnostics;\n}\n\nfunction unknown(diagnostics: DocsDiagnostic[], path: string): void {\n diagnostics.push({\n code: \"DOCS_CONFIG_UNKNOWN_KEY\",\n severity: \"error\",\n message: `Unknown configuration key \"${path}\".`,\n });\n}\n\nexport function normalizeDocsConfig(\n config: DocsConfig = {},\n): NormalizedDocsConfig {\n const diagnostics = validateConfig(config);\n if (diagnostics.length > 0) throw new DocsConfigError(diagnostics);\n const navigation = Array.isArray(config.navigation)\n ? { items: config.navigation }\n : (config.navigation ?? {});\n\n return {\n site: { ...config.site },\n content: {\n allowOutsideRoot: false,\n localizeRepositoryLinks: false,\n ...config.content,\n },\n navigation,\n theme: { ...config.theme, brand: config.theme?.brand ?? DEFAULT_BRAND },\n markdown: {\n stripLeadingBadges: true,\n rawHtml: \"sanitize\",\n strictLanguages: false,\n executablePreviews: true,\n ...config.markdown,\n },\n search: { enabled: true, ...config.search },\n components: { ...config.components },\n build: {\n strict: true,\n ci: process.env.CI === \"true\",\n base: \"/\",\n cacheDir: \"\",\n maxArtifactBytes: 25 * 1024 * 1024,\n maxUnpackedBytes: 100 * 1024 * 1024,\n maxFiles: 10_000,\n maxPathDepth: 24,\n maxAssetBytes: 20 * 1024 * 1024,\n ...config.build,\n },\n };\n}\n\nexport function defineDocsConfig<const T extends DocsConfig>(config: T): T {\n const diagnostics = validateConfig(config);\n if (diagnostics.length > 0) throw new DocsConfigError(diagnostics);\n return config;\n}\n\nexport type {\n BrandConfig,\n BuildConfig,\n ComponentsConfig,\n ContentConfig,\n DocsConfig,\n DocsSource,\n MarkdownConfig,\n NavigationConfig,\n NavigationItem,\n NormalizedDocsConfig,\n SearchConfig,\n SiteConfig,\n ThemeConfig,\n} from \"../types.js\";\n"],"mappings":";AAMA,MAAM,gBAAgB;AACtB,MAAM,4BAAY,IAAI,IAAI;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,cAA2C;CAC/C,sBAAM,IAAI,IAAI;EAAC;EAAS;EAAe;EAAO;CAAY,CAAC;CAC3D,yBAAS,IAAI,IAAI;EAAC;EAAW;EAAoB;CAAyB,CAAC;CAC3E,0BAAU,IAAI,IAAI;EAChB;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,wBAAQ,IAAI,IAAI,CAAC,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tasty-docs.schema.json",
|
|
4
|
+
"title": "Tasty Docs configuration",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"site": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"additionalProperties": false,
|
|
11
|
+
"properties": {
|
|
12
|
+
"title": { "type": "string" },
|
|
13
|
+
"description": { "type": "string" },
|
|
14
|
+
"url": { "type": "string", "format": "uri" },
|
|
15
|
+
"repository": { "type": "string", "format": "uri" }
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"content": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"properties": {
|
|
22
|
+
"allowOutsideRoot": { "type": "boolean", "default": false },
|
|
23
|
+
"localizeRepositoryLinks": { "type": "boolean", "default": false },
|
|
24
|
+
"sources": { "type": "array", "items": { "$ref": "#/$defs/source" } }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"navigation": { "type": ["object", "array"] },
|
|
28
|
+
"theme": { "type": "object" },
|
|
29
|
+
"markdown": { "type": "object" },
|
|
30
|
+
"search": { "type": "object" },
|
|
31
|
+
"components": { "type": "object" },
|
|
32
|
+
"build": { "type": "object" }
|
|
33
|
+
},
|
|
34
|
+
"$defs": {
|
|
35
|
+
"source": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"oneOf": [
|
|
38
|
+
{ "required": ["file"] },
|
|
39
|
+
{ "required": ["glob"] },
|
|
40
|
+
{ "required": ["package"] }
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { a as CreateDocsGraphOptions, c as DocsConfig, f as DocsGraph, h as DocsRoute, s as DocsAsset, u as DocsEntry } from "../types-rjENJzWH.js";
|
|
2
|
+
//#region src/content/index.d.ts
|
|
3
|
+
interface DocsLoaderContext {
|
|
4
|
+
store: {
|
|
5
|
+
clear(): void;
|
|
6
|
+
set(entry: {
|
|
7
|
+
id: string;
|
|
8
|
+
data: Record<string, unknown>;
|
|
9
|
+
body: string;
|
|
10
|
+
filePath?: string;
|
|
11
|
+
}): void;
|
|
12
|
+
};
|
|
13
|
+
logger?: {
|
|
14
|
+
info(message: string): void;
|
|
15
|
+
};
|
|
16
|
+
parseData?: (input: {
|
|
17
|
+
id: string;
|
|
18
|
+
data: Record<string, unknown>;
|
|
19
|
+
filePath?: string;
|
|
20
|
+
}) => Promise<Record<string, unknown>>;
|
|
21
|
+
}
|
|
22
|
+
declare function createDocsLoader(config?: DocsConfig, options?: Omit<CreateDocsGraphOptions, "config">): {
|
|
23
|
+
name: string;
|
|
24
|
+
load(context: DocsLoaderContext): Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { type DocsAsset, type DocsEntry, type DocsGraph, DocsLoaderContext, type DocsRoute, createDocsLoader };
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/content/index.ts"],"mappings":";;UAQiB;EACf;IACE;IACA,IAAI;MACF;MACA,MAAM;MACN;MACA;;;EAGJ;IAAW,KAAK;;EAChB,aAAa;IACX;IACA,MAAM;IACN;QACI,QAAQ;;iBAGA,iBACd,SAAS,YACT,UAAS,KAAK;EAGZ;EACM,KAAI,SAAU,oBAAoB"}
|