@tenphi/docs 0.1.0 → 0.4.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.
@@ -1,4 +1,4 @@
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";
1
+ import { A as ThemePaletteConfig, C as NormalizedDocsConfig, D as SearchConfig, M as ThemeTokens, N as TypographyPreset, O as SiteConfig, P as TypographyPresets, S as NavigationTab, _ as DocsSource, b as NavigationItem, i as ContentConfig, j as ThemeTokenValue, k as ThemeConfig, l as DocsConfig, n as BuildConfig, r as ComponentsConfig, t as BrandConfig, u as DocsDiagnostic, v as MarkdownConfig, y as NavigationConfig } from "../types-BinP19sy.js";
2
2
  //#region src/config/index.d.ts
3
3
  declare class DocsConfigError extends Error {
4
4
  readonly diagnostics: DocsDiagnostic[];
@@ -8,5 +8,5 @@ declare function validateConfig(config: DocsConfig): DocsDiagnostic[];
8
8
  declare function normalizeDocsConfig(config?: DocsConfig): NormalizedDocsConfig;
9
9
  declare function defineDocsConfig<const T extends DocsConfig>(config: T): T;
10
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 };
11
+ export { type BrandConfig, type BuildConfig, type ComponentsConfig, type ContentConfig, type DocsConfig, DocsConfigError, type DocsSource, type MarkdownConfig, type NavigationConfig, type NavigationItem, type NavigationTab, type NormalizedDocsConfig, type SearchConfig, type SiteConfig, type ThemeConfig, type ThemePaletteConfig, type ThemeTokenValue, type ThemeTokens, type TypographyPreset, type TypographyPresets, defineDocsConfig, normalizeDocsConfig, validateConfig };
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/config/index.ts"],"mappings":";;cAsDa,wBAAwB;WAC1B,aAAa;EAEtB,YAAY,aAAa;;iBAOX,eAAe,QAAQ,aAAa;iBA6DpC,oBACd,SAAQ,aACP;iBAwCa,uBAAuB,UAAU,YAAY,QAAQ,IAAI"}
@@ -32,6 +32,16 @@ const OBJECT_KEYS = {
32
32
  ]),
33
33
  search: /* @__PURE__ */ new Set(["enabled"]),
34
34
  components: /* @__PURE__ */ new Set(["overrides"]),
35
+ theme: /* @__PURE__ */ new Set([
36
+ "variant",
37
+ "brand",
38
+ "palette",
39
+ "states",
40
+ "tokens",
41
+ "presets",
42
+ "styles",
43
+ "contrastLevel"
44
+ ]),
35
45
  build: /* @__PURE__ */ new Set([
36
46
  "strict",
37
47
  "ci",
@@ -1 +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,cA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;CACzE,MAAM,cAAc,eAAe,MAAM;CACzC,IAAI,YAAY,SAAS,GAAG,MAAM,IAAI,gBAAgB,WAAW;CACjE,OAAO;AACT"}
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 theme: new Set([\n \"variant\",\n \"brand\",\n \"palette\",\n \"states\",\n \"tokens\",\n \"presets\",\n \"styles\",\n \"contrastLevel\",\n ]),\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 NavigationTab,\n NormalizedDocsConfig,\n SearchConfig,\n SiteConfig,\n ThemeConfig,\n ThemePaletteConfig,\n ThemeTokens,\n ThemeTokenValue,\n TypographyPreset,\n TypographyPresets,\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,SAAS,CAAC;CAC3B,4BAAY,IAAI,IAAI,CAAC,WAAW,CAAC;CACjC,uBAAO,IAAI,IAAI;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,uBAAO,IAAI,IAAI;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH;AAEA,IAAa,kBAAb,cAAqC,MAAM;CACzC;CAEA,YAAY,aAA+B;EACzC,MAAM,YAAY,KAAK,eAAe,WAAW,O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SAAgB,oBACd,SAAqB,CAAC,GACA;CACtB,MAAM,cAAc,eAAe,MAAM;CACzC,IAAI,YAAY,SAAS,GAAG,MAAM,IAAI,gBAAgB,WAAW;CACjE,MAAM,aAAa,MAAM,QAAQ,OAAO,UAAU,IAC9C,EAAE,OAAO,OAAO,WAAW,IAC1B,OAAO,cAAc,CAAC;CAE3B,OAAO;EACL,MAAM,EAAE,GAAG,OAAO,KAAK;EACvB,SAAS;GACP,kBAAkB;GAClB,yBAAyB;GACzB,GAAG,OAAO;EACZ;EACA;EACA,OAAO;GAAE,GAAG,OAAO;GAAO,OAAO,OAAO,OAAO,SAAS;EAAc;EACtE,UAAU;GACR,oBAAoB;GACpB,SAAS;GACT,iBAAiB;GACjB,oBAAoB;GACpB,GAAG,OAAO;EACZ;EACA,QAAQ;GAAE,SAAS;GAAM,GAAG,OAAO;EAAO;EAC1C,YAAY,EAAE,GAAG,OAAO,WAAW;EACnC,OAAO;GACL,QAAQ;GACR,IAAI,QAAQ,IAAI,OAAO;GACvB,MAAM;GACN,UAAU;GACV,kBAAkB;GAClB,kBAAkB;GAClB,UAAU;GACV,cAAc;GACd,eAAe;GACf,GAAG,OAAO;EACZ;CACF;AACF;AAEA,SAAgB,iBAA6C,QAAc;CACzE,MAAM,cAAc,eAAe,MAAM;CACzC,IAAI,YAAY,SAAS,GAAG,MAAM,IAAI,gBAAgB,WAAW;CACjE,OAAO;AACT"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://tasty.style/schemas/tasty-docs.schema.json",
4
- "title": "Tasty Docs configuration",
3
+ "$id": "https://tasty.style/schemas/cookbook.schema.json",
4
+ "title": "Cookbook configuration",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
7
  "properties": {
@@ -24,14 +24,139 @@
24
24
  "sources": { "type": "array", "items": { "$ref": "#/$defs/source" } }
25
25
  }
26
26
  },
27
- "navigation": { "type": ["object", "array"] },
28
- "theme": { "type": "object" },
27
+ "navigation": {
28
+ "oneOf": [
29
+ {
30
+ "type": "array",
31
+ "items": { "$ref": "#/$defs/navigationItem" }
32
+ },
33
+ {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "properties": {
37
+ "items": {
38
+ "type": "array",
39
+ "items": { "$ref": "#/$defs/navigationItem" }
40
+ },
41
+ "tabs": {
42
+ "type": "array",
43
+ "items": { "$ref": "#/$defs/navigationTab" }
44
+ }
45
+ }
46
+ }
47
+ ]
48
+ },
49
+ "theme": {
50
+ "type": "object",
51
+ "additionalProperties": false,
52
+ "properties": {
53
+ "variant": { "type": "string" },
54
+ "brand": {},
55
+ "palette": {
56
+ "type": "object",
57
+ "additionalProperties": false,
58
+ "properties": {
59
+ "surface": {},
60
+ "text": {},
61
+ "textSoft": {}
62
+ }
63
+ },
64
+ "states": {
65
+ "type": "object",
66
+ "additionalProperties": { "type": "string" }
67
+ },
68
+ "tokens": {
69
+ "type": "object",
70
+ "propertyNames": { "pattern": "^(\\$|--)[a-zA-Z0-9_-]+$" },
71
+ "additionalProperties": { "type": ["string", "number"] }
72
+ },
73
+ "presets": {
74
+ "type": "object",
75
+ "additionalProperties": { "$ref": "#/$defs/typographyPreset" }
76
+ },
77
+ "styles": { "type": "object" },
78
+ "contrastLevel": {
79
+ "oneOf": [
80
+ { "const": "auto" },
81
+ { "type": "number", "minimum": 0, "maximum": 100 }
82
+ ]
83
+ }
84
+ }
85
+ },
29
86
  "markdown": { "type": "object" },
30
87
  "search": { "type": "object" },
31
88
  "components": { "type": "object" },
32
89
  "build": { "type": "object" }
33
90
  },
34
91
  "$defs": {
92
+ "navigationItem": {
93
+ "oneOf": [
94
+ { "type": "string" },
95
+ {
96
+ "type": "object",
97
+ "additionalProperties": false,
98
+ "required": ["label", "items"],
99
+ "properties": {
100
+ "label": { "type": "string" },
101
+ "items": {
102
+ "type": "array",
103
+ "items": { "$ref": "#/$defs/navigationItem" }
104
+ }
105
+ }
106
+ },
107
+ {
108
+ "type": "object",
109
+ "additionalProperties": false,
110
+ "required": ["label", "autogenerate"],
111
+ "properties": {
112
+ "label": { "type": "string" },
113
+ "autogenerate": {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": ["directory"],
117
+ "properties": { "directory": { "type": "string" } }
118
+ }
119
+ }
120
+ },
121
+ {
122
+ "type": "object",
123
+ "additionalProperties": false,
124
+ "required": ["label", "link"],
125
+ "properties": {
126
+ "label": { "type": "string" },
127
+ "link": { "type": "string" }
128
+ }
129
+ }
130
+ ]
131
+ },
132
+ "navigationTab": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": ["label", "link"],
136
+ "properties": {
137
+ "label": { "type": "string" },
138
+ "link": { "type": "string" },
139
+ "items": {
140
+ "type": "array",
141
+ "items": { "$ref": "#/$defs/navigationItem" }
142
+ }
143
+ }
144
+ },
145
+ "typographyPreset": {
146
+ "type": "object",
147
+ "additionalProperties": false,
148
+ "properties": {
149
+ "fontFamily": { "type": "string" },
150
+ "fontSize": { "type": ["string", "number"] },
151
+ "lineHeight": { "type": ["string", "number"] },
152
+ "letterSpacing": { "type": ["string", "number"] },
153
+ "fontWeight": { "type": ["string", "number"] },
154
+ "boldFontWeight": { "type": ["string", "number"] },
155
+ "iconSize": { "type": ["string", "number"] },
156
+ "textTransform": { "type": ["string", "number"] },
157
+ "fontStyle": { "type": ["string", "number"] }
158
+ }
159
+ },
35
160
  "source": {
36
161
  "type": "object",
37
162
  "oneOf": [
@@ -1,4 +1,4 @@
1
- import { a as CreateDocsGraphOptions, c as DocsConfig, f as DocsGraph, h as DocsRoute, s as DocsAsset, u as DocsEntry } from "../types-rjENJzWH.js";
1
+ import { c as DocsAsset, d as DocsEntry, g as DocsRoute, l as DocsConfig, o as CreateDocsGraphOptions, p as DocsGraph } from "../types-BinP19sy.js";
2
2
  //#region src/content/index.d.ts
3
3
  interface DocsLoaderContext {
4
4
  store: {
@@ -8,16 +8,40 @@ interface DocsLoaderContext {
8
8
  data: Record<string, unknown>;
9
9
  body: string;
10
10
  filePath?: string;
11
+ digest?: string;
12
+ rendered?: RenderedContent;
13
+ assetImports?: string[];
11
14
  }): void;
12
15
  };
13
16
  logger?: {
14
17
  info(message: string): void;
15
18
  };
19
+ config?: {
20
+ root: URL | string;
21
+ srcDir: URL | string;
22
+ };
16
23
  parseData?: (input: {
17
24
  id: string;
18
25
  data: Record<string, unknown>;
19
26
  filePath?: string;
20
27
  }) => Promise<Record<string, unknown>>;
28
+ renderMarkdown?: (content: string, options?: {
29
+ fileURL?: URL;
30
+ }) => Promise<RenderedContent>;
31
+ generateDigest?: (data: Record<string, unknown> | string) => string;
32
+ }
33
+ interface RenderedContent {
34
+ html: string;
35
+ metadata?: {
36
+ imagePaths?: string[];
37
+ headings?: Array<{
38
+ depth: number;
39
+ slug: string;
40
+ text: string;
41
+ }>;
42
+ frontmatter?: Record<string, unknown>;
43
+ [key: string]: unknown;
44
+ };
21
45
  }
22
46
  declare function createDocsLoader(config?: DocsConfig, options?: Omit<CreateDocsGraphOptions, "config">): {
23
47
  name: string;
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/content/index.ts"],"mappings":";;UAUiB;EACf;IACE;IACA,IAAI;MACF;MACA,MAAM;MACN;MACA;MACA;MACA,WAAW;MACX;;;EAGJ;IAAW,KAAK;;EAChB;IAAW,MAAM;IAAc,QAAQ;;EACvC,aAAa;IACX;IACA,MAAM;IACN;QACI,QAAQ;EACd,kBACE,iBACA;IAAY,UAAU;QACnB,QAAQ;EACb,kBAAkB,MAAM;;UAGhB;EACR;EACA;IACE;IACA,WAAW;MAAQ;MAAe;MAAc;;IAChD,cAAc;KACb;;;iBAIW,iBACd,SAAS,YACT,UAAS,KAAK;EAGZ;EACM,KAAI,SAAU,oBAAoB"}
@@ -1,2 +1,2 @@
1
- import { t as createDocsLoader } from "../content-DStZeziu.js";
1
+ import { t as createDocsLoader } from "../content-Bhdv88Pe.js";
2
2
  export { createDocsLoader };
@@ -1,8 +1,9 @@
1
1
  import { normalizeDocsConfig } from "./config/index.js";
2
2
  import { cloneAst, parseMarkdown, removeRenderedTitle, serializeMarkdown, stripLeadingBadgeBlock } from "./markdown/index.js";
3
+ import { basename, dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
4
+ import { fileURLToPath, pathToFileURL } from "node:url";
3
5
  import { createHash } from "node:crypto";
4
6
  import { lstat, mkdir, mkdtemp, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
5
- import { basename, dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
6
7
  import matter from "gray-matter";
7
8
  import { glob } from "tinyglobby";
8
9
  import { visit } from "unist-util-visit";
@@ -11,7 +12,7 @@ import npa from "npm-package-arg";
11
12
  import pacote from "pacote";
12
13
  //#region src/npm/index.ts
13
14
  const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
14
- const LOCK_FILE = "tasty-docs.lock.json";
15
+ const LOCK_FILE = "cookbook.lock.json";
15
16
  async function resolvePackageLock(requested, options = {}) {
16
17
  const parsed = npa(requested);
17
18
  if (![
@@ -48,7 +49,7 @@ async function writeDocsLock(root, lock) {
48
49
  await writeFile(join(root, LOCK_FILE), `${JSON.stringify(lock, null, 2)}\n`, "utf8");
49
50
  }
50
51
  function validateLock(lock) {
51
- if (lock.schemaVersion !== 1 || !Array.isArray(lock.sources)) throw new Error("Unsupported or invalid tasty-docs.lock.json.");
52
+ if (lock.schemaVersion !== 1 || !Array.isArray(lock.sources)) throw new Error("Unsupported or invalid cookbook.lock.json.");
52
53
  for (const source of lock.sources) {
53
54
  if (!source.requested || !source.resolved || !source.registry || !source.integrity) throw new Error("Every lock source requires requested, resolved, registry, and integrity.");
54
55
  if (npa(source.resolved).type !== "version") throw new Error(`Locked source must use an exact version: ${source.resolved}.`);
@@ -60,14 +61,14 @@ async function materializePackage(source, config, projectRoot) {
60
61
  if (!projectRoot) throw new Error(`Vendored source ${source.resolved} requires a project root.`);
61
62
  const vendored = resolve(projectRoot, source.vendored);
62
63
  if (!inside$1(projectRoot, vendored)) throw new Error(`Vendored package path escapes the project root: ${source.vendored}.`);
63
- if ((await readFile(join(vendored, ".tasty-docs-integrity"), "utf8")).trim() !== source.integrity) throw new Error(`Vendored package integrity marker does not match ${source.resolved}.`);
64
+ if ((await readFile(join(vendored, ".cookbook-integrity"), "utf8")).trim() !== source.integrity) throw new Error(`Vendored package integrity marker does not match ${source.resolved}.`);
64
65
  await validateExtractedTree(vendored, config);
65
66
  return vendored;
66
67
  }
67
- const cacheRoot = resolve(config.cacheDir || join(homedir(), ".cache", "tasty-docs"), "artifacts");
68
+ const cacheRoot = resolve(config.cacheDir || join(homedir(), ".cache", "cookbook"), "artifacts");
68
69
  const key = createHash("sha256").update(source.integrity).digest("hex");
69
70
  const destination = join(cacheRoot, key);
70
- const marker = join(destination, ".tasty-docs-integrity");
71
+ const marker = join(destination, ".cookbook-integrity");
71
72
  try {
72
73
  if ((await readFile(marker, "utf8")).trim() === source.integrity) return destination;
73
74
  } catch (error) {
@@ -88,7 +89,7 @@ async function materializePackage(source, config, projectRoot) {
88
89
  cache: join(cacheRoot, "_cacache")
89
90
  });
90
91
  await validateExtractedTree(temporary, config);
91
- await writeFile(join(temporary, ".tasty-docs-integrity"), `${source.integrity}\n`);
92
+ await writeFile(join(temporary, ".cookbook-integrity"), `${source.integrity}\n`);
92
93
  await rm(destination, {
93
94
  recursive: true,
94
95
  force: true
@@ -111,7 +112,7 @@ async function validateExtractedTree(root, config) {
111
112
  const directory = pending.pop();
112
113
  if (!directory) break;
113
114
  for (const name of await readdir(directory)) {
114
- if (name === ".tasty-docs-integrity") continue;
115
+ if (name === ".cookbook-integrity") continue;
115
116
  const path = join(directory, name);
116
117
  const info = await lstat(path);
117
118
  const rel = relative(root, path);
@@ -130,7 +131,7 @@ async function validateExtractedTree(root, config) {
130
131
  }
131
132
  async function discoverPackage(root) {
132
133
  const manifest = JSON.parse(await readFile(join(root, "package.json"), "utf8"));
133
- const hints = manifest.tastyDocs;
134
+ const hints = manifest.cookbook;
134
135
  const homeCandidates = [
135
136
  hints?.index,
136
137
  "README.md",
@@ -170,7 +171,7 @@ function packageNameFromSpecifier(specifier) {
170
171
  }
171
172
  function lockForSource(lock, requested) {
172
173
  const match = lock?.sources.find((source) => source.requested === requested || packageNameFromSpecifier(source.requested) === packageNameFromSpecifier(requested));
173
- if (!match) throw new Error(`Package source ${requested} is not locked. Run "tasty-docs update" to create ${LOCK_FILE}.`);
174
+ if (!match) throw new Error(`Package source ${requested} is not locked. Run "cookbook update" to create ${LOCK_FILE}.`);
174
175
  return match;
175
176
  }
176
177
  function defaultLock(sources) {
@@ -236,6 +237,13 @@ async function createDocsGraph(options = {}) {
236
237
  }
237
238
  for (const entry of entries) await transformEntry(entry, absoluteMap, routeMap, config, diagnostics);
238
239
  validateNavigation(config.navigation.items ?? [], routeMap, diagnostics);
240
+ for (const tab of config.navigation.tabs ?? []) {
241
+ validateNavigation([{
242
+ label: tab.label,
243
+ link: tab.link
244
+ }], routeMap, diagnostics);
245
+ validateNavigation(tab.items ?? [], routeMap, diagnostics);
246
+ }
239
247
  entries.sort((left, right) => left.route.localeCompare(right.route));
240
248
  return {
241
249
  root,
@@ -698,21 +706,39 @@ function createDocsLoader(config, options = {}) {
698
706
  context.store.clear();
699
707
  for (const entry of graph.entries) {
700
708
  const loaderEntry = toLoaderEntry(entry);
709
+ const filePath = starlightFilePath(entry, context.config);
701
710
  const data = context.parseData ? await context.parseData({
702
711
  id: loaderEntry.id,
703
712
  data: loaderEntry.data,
704
- filePath: entry.sourcePath
713
+ filePath
705
714
  }) : loaderEntry.data;
715
+ const rendered = await context.renderMarkdown?.(entry.transformedBody, { fileURL: pathToFileURL(entry.absolutePath) });
706
716
  context.store.set({
707
717
  ...loaderEntry,
708
718
  data,
709
- filePath: entry.sourcePath
719
+ filePath,
720
+ ...context.generateDigest ? { digest: context.generateDigest(entry.transformedBody) } : {},
721
+ ...rendered ? {
722
+ rendered,
723
+ assetImports: rendered.metadata?.imagePaths ?? []
724
+ } : {}
710
725
  });
711
726
  }
712
- context.logger?.info(`Loaded ${graph.entries.length} Tasty Docs pages.`);
727
+ context.logger?.info(`Loaded ${graph.entries.length} Cookbook pages.`);
713
728
  }
714
729
  };
715
730
  }
731
+ function starlightFilePath(entry, config) {
732
+ const id = entry.route === "/" ? "index" : entry.route.slice(1);
733
+ const extension = extname(entry.sourcePath).toLowerCase() === ".mdx" ? ".mdx" : ".md";
734
+ if (!config) return `src/content/docs/${id}${extension}`;
735
+ const root = toPath(config.root);
736
+ const srcDir = toPath(config.srcDir);
737
+ return relative(root, join(srcDir, "content", "docs", `${id}${extension}`)).split(sep).join("/");
738
+ }
739
+ function toPath(value) {
740
+ return typeof value === "string" ? value : fileURLToPath(value);
741
+ }
716
742
  function toLoaderEntry(entry) {
717
743
  return {
718
744
  id: entry.route === "/" ? "index" : entry.route.slice(1),
@@ -721,7 +747,7 @@ function toLoaderEntry(entry) {
721
747
  draft: entry.frontmatter.draft ?? false,
722
748
  ...entry.description ? { description: entry.description } : {},
723
749
  ...entry.frontmatter,
724
- tastyDocs: {
750
+ cookbook: {
725
751
  sourcePath: entry.sourcePath,
726
752
  route: entry.route,
727
753
  headings: entry.headings
@@ -733,4 +759,4 @@ function toLoaderEntry(entry) {
733
759
  //#endregion
734
760
  export { writeDocsLock as _, validateDocs as a, routeForPath as c, lockForSource as d, materializePackage as f, validateLock as g, resolvePackageLock as h, formatDiagnostics as i, defaultLock as l, readDocsLock as m, DocsValidationError as n, createDocsGraph as o, packageNameFromSpecifier as p, assertValidDocs as r, normalizeRoute as s, createDocsLoader as t, discoverPackage as u };
735
761
 
736
- //# sourceMappingURL=content-DStZeziu.js.map
762
+ //# sourceMappingURL=content-Bhdv88Pe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-Bhdv88Pe.js","names":["inside"],"sources":["../src/npm/index.ts","../src/graph/index.ts","../src/validation/index.ts","../src/content/index.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { homedir } from \"node:os\";\nimport {\n lstat,\n mkdir,\n mkdtemp,\n readFile,\n readdir,\n rename,\n rm,\n stat,\n writeFile,\n} from \"node:fs/promises\";\nimport { dirname, isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport npa from \"npm-package-arg\";\nimport pacote from \"pacote\";\nimport { glob } from \"tinyglobby\";\nimport type {\n NormalizedDocsConfig,\n PackageDiscovery,\n PackageLockSource,\n PackageManifest,\n CookbookLock,\n} from \"../types.js\";\n\nconst DEFAULT_REGISTRY = \"https://registry.npmjs.org/\";\nconst LOCK_FILE = \"cookbook.lock.json\";\n\nexport interface ResolvePackageOptions {\n registry?: string;\n cacheDir?: string;\n}\n\nexport async function resolvePackageLock(\n requested: string,\n options: ResolvePackageOptions = {},\n): Promise<PackageLockSource> {\n const parsed = npa(requested);\n if (![\"tag\", \"version\", \"range\"].includes(parsed.type)) {\n throw new Error(\n `Only npm registry package specifiers are supported (received ${parsed.type}).`,\n );\n }\n const registry = options.registry ?? DEFAULT_REGISTRY;\n const manifest = (await pacote.manifest(requested, {\n registry,\n ...(options.cacheDir ? { cache: options.cacheDir } : {}),\n fullMetadata: true,\n })) as PackageManifest;\n if (!manifest.name || !manifest.version || !manifest._integrity) {\n throw new Error(\n `Registry metadata for ${requested} did not include version and integrity.`,\n );\n }\n return {\n requested,\n resolved: `${manifest.name}@${manifest.version}`,\n registry,\n integrity: manifest._integrity,\n };\n}\n\nexport async function readDocsLock(\n root: string,\n): Promise<CookbookLock | undefined> {\n try {\n const value = JSON.parse(\n await readFile(join(root, LOCK_FILE), \"utf8\"),\n ) as CookbookLock;\n validateLock(value);\n return value;\n } catch (error) {\n if (isMissing(error)) return undefined;\n throw error;\n }\n}\n\nexport async function writeDocsLock(\n root: string,\n lock: CookbookLock,\n): Promise<void> {\n validateLock(lock);\n await writeFile(\n join(root, LOCK_FILE),\n `${JSON.stringify(lock, null, 2)}\\n`,\n \"utf8\",\n );\n}\n\nexport function validateLock(lock: CookbookLock): void {\n if (lock.schemaVersion !== 1 || !Array.isArray(lock.sources)) {\n throw new Error(\"Unsupported or invalid cookbook.lock.json.\");\n }\n for (const source of lock.sources) {\n if (\n !source.requested ||\n !source.resolved ||\n !source.registry ||\n !source.integrity\n ) {\n throw new Error(\n \"Every lock source requires requested, resolved, registry, and integrity.\",\n );\n }\n const parsed = npa(source.resolved);\n if (parsed.type !== \"version\") {\n throw new Error(\n `Locked source must use an exact version: ${source.resolved}.`,\n );\n }\n if (\n source.vendored &&\n (source.vendored.startsWith(\"/\") ||\n source.vendored.split(/[\\\\/]/).includes(\"..\"))\n ) {\n throw new Error(\n `Vendored package path must stay within the project: ${source.vendored}.`,\n );\n }\n }\n}\n\nexport async function materializePackage(\n source: PackageLockSource,\n config: NormalizedDocsConfig[\"build\"],\n projectRoot?: string,\n): Promise<string> {\n if (source.vendored) {\n if (!projectRoot) {\n throw new Error(\n `Vendored source ${source.resolved} requires a project root.`,\n );\n }\n const vendored = resolve(projectRoot, source.vendored);\n if (!inside(projectRoot, vendored)) {\n throw new Error(\n `Vendored package path escapes the project root: ${source.vendored}.`,\n );\n }\n const marker = (\n await readFile(join(vendored, \".cookbook-integrity\"), \"utf8\")\n ).trim();\n if (marker !== source.integrity) {\n throw new Error(\n `Vendored package integrity marker does not match ${source.resolved}.`,\n );\n }\n await validateExtractedTree(vendored, config);\n return vendored;\n }\n const cacheRoot = resolve(\n config.cacheDir || join(homedir(), \".cache\", \"cookbook\"),\n \"artifacts\",\n );\n const key = createHash(\"sha256\").update(source.integrity).digest(\"hex\");\n const destination = join(cacheRoot, key);\n const marker = join(destination, \".cookbook-integrity\");\n try {\n if ((await readFile(marker, \"utf8\")).trim() === source.integrity)\n return destination;\n } catch (error) {\n if (!isMissing(error)) throw error;\n }\n\n await mkdir(cacheRoot, { recursive: true });\n const temporary = await mkdtemp(join(cacheRoot, \".extract-\"));\n try {\n const tarball = await pacote.tarball(source.resolved, {\n registry: source.registry,\n integrity: source.integrity,\n cache: join(cacheRoot, \"_cacache\"),\n });\n if (tarball.byteLength > config.maxArtifactBytes) {\n throw new Error(\n `Package artifact is ${tarball.byteLength} bytes; limit is ${config.maxArtifactBytes}.`,\n );\n }\n await pacote.extract(source.resolved, temporary, {\n registry: source.registry,\n integrity: source.integrity,\n cache: join(cacheRoot, \"_cacache\"),\n });\n await validateExtractedTree(temporary, config);\n await writeFile(\n join(temporary, \".cookbook-integrity\"),\n `${source.integrity}\\n`,\n );\n await rm(destination, { recursive: true, force: true });\n await rename(temporary, destination);\n return destination;\n } catch (error) {\n await rm(temporary, { recursive: true, force: true });\n throw error;\n }\n}\n\nasync function validateExtractedTree(\n root: string,\n config: NormalizedDocsConfig[\"build\"],\n): Promise<void> {\n let files = 0;\n let bytes = 0;\n const pending = [root];\n while (pending.length > 0) {\n const directory = pending.pop();\n if (!directory) break;\n for (const name of await readdir(directory)) {\n if (name === \".cookbook-integrity\") continue;\n const path = join(directory, name);\n const info = await lstat(path);\n const rel = relative(root, path);\n if (rel.startsWith(`..${sep}`) || rel === \"..\") {\n throw new Error(`Package path escapes artifact root: ${rel}.`);\n }\n if (rel.split(sep).length > config.maxPathDepth) {\n throw new Error(`Package path exceeds maximum depth: ${rel}.`);\n }\n if (info.isSymbolicLink()) {\n throw new Error(`Package symlinks are not allowed: ${rel}.`);\n }\n if (info.isDirectory()) {\n pending.push(path);\n } else if (info.isFile()) {\n files += 1;\n bytes += info.size;\n if (info.size > config.maxAssetBytes) {\n throw new Error(`Package file exceeds maximum size: ${rel}.`);\n }\n if (files > config.maxFiles || bytes > config.maxUnpackedBytes) {\n throw new Error(\n \"Package exceeds configured file-count or unpacked-size limit.\",\n );\n }\n } else {\n throw new Error(`Unsupported package entry type: ${rel}.`);\n }\n }\n }\n}\n\nexport async function discoverPackage(root: string): Promise<PackageDiscovery> {\n const manifest = JSON.parse(\n await readFile(join(root, \"package.json\"), \"utf8\"),\n ) as PackageManifest;\n const hints = manifest.cookbook;\n const homeCandidates = [hints?.index, \"README.md\", \"readme.md\"].filter(\n (candidate): candidate is string => Boolean(candidate),\n );\n let home: string | undefined;\n for (const candidate of homeCandidates) {\n try {\n if ((await stat(join(root, candidate))).isFile()) {\n home = candidate;\n break;\n }\n } catch (error) {\n if (!isMissing(error)) throw error;\n }\n }\n\n const patterns = hints?.include?.length\n ? hints.include\n : [\n \"docs/**/*.{md,mdx}\",\n \"docs/**/*.{png,jpg,jpeg,gif,webp,avif,svg,pdf,txt,zip}\",\n ];\n const discovered = await glob(patterns, {\n cwd: root,\n onlyFiles: true,\n dot: false,\n ignore: hints?.exclude ?? [],\n });\n const pages = discovered.filter((path) => /\\.mdx?$/i.test(path));\n if (home && !pages.includes(home)) pages.unshift(home);\n const assets = discovered.filter((path) => !/\\.mdx?$/i.test(path));\n return { root, manifest, ...(home ? { home } : {}), pages, assets };\n}\n\nexport function packageNameFromSpecifier(specifier: string): string {\n const parsed = npa(specifier);\n if (!parsed.name)\n throw new Error(`Invalid npm package specifier: ${specifier}.`);\n return parsed.name;\n}\n\nexport function lockForSource(\n lock: CookbookLock | undefined,\n requested: string,\n): PackageLockSource {\n const match = lock?.sources.find(\n (source) =>\n source.requested === requested ||\n packageNameFromSpecifier(source.requested) ===\n packageNameFromSpecifier(requested),\n );\n if (!match) {\n throw new Error(\n `Package source ${requested} is not locked. Run \"cookbook update\" to create ${LOCK_FILE}.`,\n );\n }\n return match;\n}\n\nexport function defaultLock(sources: PackageLockSource[]): CookbookLock {\n return { schemaVersion: 1, sources };\n}\n\nfunction isMissing(error: unknown): boolean {\n return (\n typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n );\n}\n\nfunction inside(root: string, path: string): boolean {\n const rel = relative(resolve(root), resolve(path));\n return (\n rel === \"\" ||\n (!rel.startsWith(`..${sep}`) && rel !== \"..\" && !isAbsolute(rel))\n );\n}\n","import { createHash } from \"node:crypto\";\nimport { readFile, stat } from \"node:fs/promises\";\nimport {\n basename,\n dirname,\n extname,\n isAbsolute,\n relative,\n resolve,\n sep,\n} from \"node:path\";\nimport matter from \"gray-matter\";\nimport type { Image, Link, Root } from \"mdast\";\nimport { glob } from \"tinyglobby\";\nimport { visit } from \"unist-util-visit\";\nimport { normalizeDocsConfig } from \"../config/index.js\";\nimport {\n cloneAst,\n parseMarkdown,\n removeRenderedTitle,\n serializeMarkdown,\n stripLeadingBadgeBlock,\n} from \"../markdown/index.js\";\nimport {\n discoverPackage,\n lockForSource,\n materializePackage,\n readDocsLock,\n} from \"../npm/index.js\";\nimport type {\n CreateDocsGraphOptions,\n DocsAsset,\n DocsDiagnostic,\n DocsEntry,\n DocsFrontmatter,\n DocsGraph,\n DocsRoute,\n DocsSource,\n NavigationItem,\n NormalizedDocsConfig,\n PackageLockSource,\n} from \"../types.js\";\n\ninterface CollectedSource {\n absolutePath: string;\n sourcePath: string;\n sourceRoot: string;\n route?: string;\n title?: string;\n description?: string;\n trust: \"markdown\" | \"mdx\";\n packageLock?: PackageLockSource;\n}\n\nconst MARKDOWN_EXTENSIONS = [\".md\", \".mdx\"];\nconst FRONTMATTER_KEYS = new Set([\n \"title\",\n \"description\",\n \"slug\",\n \"draft\",\n \"sidebar\",\n \"toc\",\n \"editUrl\",\n \"prev\",\n \"next\",\n \"search\",\n \"head\",\n]);\n\nexport async function createDocsGraph(\n options: CreateDocsGraphOptions = {},\n): Promise<DocsGraph> {\n const root = resolve(options.root ?? process.cwd());\n const config = normalizeDocsConfig(options.config);\n const diagnostics: DocsDiagnostic[] = [];\n const lock = options.lock ?? (await readDocsLock(root));\n const collected = await collectSources(root, config, lock, diagnostics);\n const entries: DocsEntry[] = [];\n const routeMap = new Map<string, DocsEntry>();\n const absoluteMap = new Map<string, DocsEntry>();\n const sourceMap = new Map<string, DocsEntry>();\n\n for (const source of collected) {\n const entry = await readEntry(source, config, diagnostics);\n if (!entry) continue;\n const existing = routeMap.get(entry.route);\n if (existing) {\n diagnostics.push({\n code: \"DOCS_DUPLICATE_ROUTE\",\n severity: \"error\",\n message: `Route ${entry.route} is owned by both ${existing.sourcePath} and ${entry.sourcePath}.`,\n file: entry.sourcePath,\n related: [{ file: existing.sourcePath, message: \"First route owner.\" }],\n });\n continue;\n }\n routeMap.set(entry.route, entry);\n absoluteMap.set(normalizeFs(entry.absolutePath), entry);\n sourceMap.set(entry.sourcePath, entry);\n sourceMap.set(entry.id, entry);\n entries.push(entry);\n }\n\n for (const entry of entries) {\n await transformEntry(entry, absoluteMap, routeMap, config, diagnostics);\n }\n validateNavigation(config.navigation.items ?? [], routeMap, diagnostics);\n for (const tab of config.navigation.tabs ?? []) {\n validateNavigation(\n [{ label: tab.label, link: tab.link }],\n routeMap,\n diagnostics,\n );\n validateNavigation(tab.items ?? [], routeMap, diagnostics);\n }\n\n entries.sort((left, right) => left.route.localeCompare(right.route));\n const routes: DocsRoute[] = entries.map((entry) => ({\n route: entry.route,\n entryId: entry.id,\n sourcePath: entry.sourcePath,\n title: entry.title,\n }));\n const assets = entries.flatMap((entry) => entry.assets);\n return {\n root,\n config,\n entries,\n routes,\n assets,\n diagnostics,\n entryByRoute(route) {\n return routeMap.get(normalizeRoute(route));\n },\n entryBySource(sourcePath) {\n return sourceMap.get(sourcePath);\n },\n };\n}\n\nasync function collectSources(\n root: string,\n config: NormalizedDocsConfig,\n lock: CreateDocsGraphOptions[\"lock\"],\n diagnostics: DocsDiagnostic[],\n): Promise<CollectedSource[]> {\n const declarations = config.content.sources?.length\n ? config.content.sources\n : await conventionSources(root);\n const results: CollectedSource[] = [];\n const identities = new Set<string>();\n\n for (const declaration of declarations) {\n try {\n const found = await collectDeclaration(root, declaration, config, lock);\n if (found.length === 0) {\n diagnostics.push({\n code: \"DOCS_SOURCE_NOT_FOUND\",\n severity: \"error\",\n message: `Source did not match any files: ${sourceLabel(declaration)}.`,\n });\n }\n for (const source of found) {\n const identity = normalizeFs(source.absolutePath);\n if (identities.has(identity)) continue;\n identities.add(identity);\n results.push(source);\n }\n } catch (error) {\n diagnostics.push({\n code:\n error instanceof OutsideRootError\n ? \"DOCS_SOURCE_OUTSIDE_ROOT\"\n : \"DOCS_SOURCE_NOT_FOUND\",\n severity: \"error\",\n message: errorMessage(error),\n });\n }\n }\n return results;\n}\n\nasync function conventionSources(root: string): Promise<DocsSource[]> {\n const sources: DocsSource[] = [];\n if (await isFile(resolve(root, \"README.md\")))\n sources.push({ file: \"README.md\", route: \"/\" });\n const docs = resolve(root, \"docs\");\n if (await isDirectory(docs)) {\n sources.push({ glob: \"docs/**/*.{md,mdx}\", base: \"docs\" });\n }\n return sources;\n}\n\nasync function collectDeclaration(\n root: string,\n declaration: DocsSource,\n config: NormalizedDocsConfig,\n lock: CreateDocsGraphOptions[\"lock\"],\n): Promise<CollectedSource[]> {\n if (\"package\" in declaration) {\n const packageLock = lockForSource(lock, declaration.package);\n const sourceRoot = await materializePackage(\n packageLock,\n config.build,\n root,\n );\n const discovery = await discoverPackage(sourceRoot);\n const patterns = declaration.include?.length\n ? declaration.include\n : discovery.pages;\n const files = declaration.include?.length\n ? await glob(patterns, {\n cwd: sourceRoot,\n onlyFiles: true,\n ignore: declaration.exclude ?? [],\n })\n : discovery.pages.filter(\n (path) => !(declaration.exclude ?? []).includes(path),\n );\n const index = declaration.index ?? discovery.home;\n return files\n .filter((path) =>\n MARKDOWN_EXTENSIONS.includes(extname(path).toLowerCase()),\n )\n .map((path) => ({\n absolutePath: resolve(sourceRoot, path),\n sourcePath: path,\n sourceRoot,\n route:\n path === index\n ? normalizeRoute(declaration.routeBase ?? \"/\")\n : routeForPath(path, \"docs\", declaration.routeBase),\n trust: declaration.trust ?? \"markdown\",\n packageLock,\n }));\n }\n\n if (\"file\" in declaration) {\n const absolutePath = resolveSourcePath(\n root,\n declaration.file,\n config.content.allowOutsideRoot,\n );\n if (!(await isFile(absolutePath))) return [];\n return [\n {\n absolutePath,\n sourcePath: toPosix(relative(root, absolutePath)),\n sourceRoot: root,\n ...(declaration.route ? { route: declaration.route } : {}),\n ...(declaration.title ? { title: declaration.title } : {}),\n ...(declaration.description\n ? { description: declaration.description }\n : {}),\n trust: \"mdx\",\n },\n ];\n }\n\n const patterns = Array.isArray(declaration.glob)\n ? declaration.glob\n : [declaration.glob];\n const paths = await glob(patterns, {\n cwd: root,\n onlyFiles: true,\n dot: false,\n ignore: [\"**/_*/**\", \"**/_*\", ...(declaration.exclude ?? [])],\n });\n return paths.map((path) => {\n const absolutePath = resolveSourcePath(\n root,\n path,\n config.content.allowOutsideRoot,\n );\n return {\n absolutePath,\n sourcePath: toPosix(relative(root, absolutePath)),\n sourceRoot: root,\n route: routeForPath(path, declaration.base, declaration.routeBase),\n trust: \"mdx\",\n };\n });\n}\n\nasync function readEntry(\n source: CollectedSource,\n config: NormalizedDocsConfig,\n diagnostics: DocsDiagnostic[],\n): Promise<DocsEntry | undefined> {\n if (\n extname(source.sourcePath).toLowerCase() === \".mdx\" &&\n source.trust !== \"mdx\"\n ) {\n diagnostics.push({\n code: \"DOCS_UNTRUSTED_MDX\",\n severity: \"error\",\n message: `Package MDX requires trust: 'mdx': ${source.sourcePath}.`,\n file: source.sourcePath,\n hint: \"Keep package sources in Markdown-safe mode or explicitly trust this locked artifact.\",\n });\n return undefined;\n }\n const original = await readFile(source.absolutePath, \"utf8\");\n const parsedMatter = matter(original);\n const frontmatter = parsedMatter.data as DocsFrontmatter;\n for (const key of Object.keys(parsedMatter.data)) {\n if (!FRONTMATTER_KEYS.has(key)) {\n diagnostics.push({\n code: \"DOCS_FRONTMATTER_INVALID\",\n severity: \"error\",\n message: `Unknown frontmatter key \"${key}\".`,\n file: source.sourcePath,\n });\n }\n }\n const parsed = parseMarkdown(parsedMatter.content);\n const route = normalizeRoute(\n frontmatter.slug ?? source.route ?? routeForPath(source.sourcePath),\n );\n const title =\n frontmatter.title ??\n source.title ??\n parsed.firstHeading ??\n titleFromFile(source.sourcePath);\n const description =\n frontmatter.description ?? source.description ?? parsed.description;\n const duplicateTitles = new Map<string, number>();\n for (const heading of parsed.headings) {\n const count = (duplicateTitles.get(heading.text) ?? 0) + 1;\n duplicateTitles.set(heading.text, count);\n if (count > 1) {\n diagnostics.push({\n code: \"DOCS_HEADING_DUPLICATE\",\n severity: \"warning\",\n message: `Repeated heading \"${heading.text}\" receives the generated ID \"${heading.slug}\".`,\n file: source.sourcePath,\n ...(heading.line ? { line: heading.line } : {}),\n });\n }\n }\n const idPrefix = source.packageLock?.resolved ?? \"local\";\n return {\n id: `${idPrefix}:${source.sourcePath}`,\n sourcePath: source.sourcePath,\n absolutePath: source.absolutePath,\n sourceRoot: source.sourceRoot,\n route,\n title,\n ...(description ? { description } : {}),\n frontmatter,\n headings: parsed.headings,\n body: parsedMatter.content,\n transformedBody: parsedMatter.content,\n ast: parsed.ast,\n links: [],\n assets: [],\n trust: source.trust,\n ...(source.packageLock\n ? {\n package: {\n requested: source.packageLock.requested,\n resolved: source.packageLock.resolved,\n },\n }\n : {}),\n };\n}\n\nasync function transformEntry(\n entry: DocsEntry,\n absoluteMap: Map<string, DocsEntry>,\n routeMap: Map<string, DocsEntry>,\n config: NormalizedDocsConfig,\n diagnostics: DocsDiagnostic[],\n): Promise<void> {\n const ast = cloneAst(entry.ast);\n if (config.markdown.stripLeadingBadges) stripLeadingBadgeBlock(ast);\n removeRenderedTitle(ast, entry.title);\n\n visit(ast, (node) => {\n if (node.type === \"html\" && entry.trust === \"markdown\") {\n const unsafe = /<\\s*script\\b|\\son[a-z]+\\s*=|javascript:/i.test(\n node.value,\n );\n if (unsafe) {\n diagnostics.push({\n code: \"DOCS_UNSAFE_HTML\",\n severity: \"error\",\n message: \"Script-capable HTML is not allowed in package Markdown.\",\n file: entry.sourcePath,\n ...(node.position?.start.line\n ? { line: node.position.start.line }\n : {}),\n });\n node.value = \"\";\n }\n }\n });\n\n const linkTasks: Promise<void>[] = [];\n visit(ast, (node) => {\n if (node.type === \"link\") {\n linkTasks.push(\n rewriteLink(node, entry, absoluteMap, routeMap, config, diagnostics),\n );\n } else if (node.type === \"image\") {\n linkTasks.push(rewriteAsset(node, entry, config, diagnostics));\n }\n });\n await Promise.all(linkTasks);\n entry.ast = ast;\n entry.transformedBody = serializeMarkdown(ast);\n}\n\nasync function rewriteLink(\n node: Link,\n entry: DocsEntry,\n absoluteMap: Map<string, DocsEntry>,\n routeMap: Map<string, DocsEntry>,\n config: NormalizedDocsConfig,\n diagnostics: DocsDiagnostic[],\n): Promise<void> {\n const reference: import(\"../types.js\").DocsReference = {\n original: node.url,\n ...lineData(node),\n };\n entry.links.push(reference);\n if (unsafeProtocol(node.url)) {\n diagnostic(\n diagnostics,\n \"DOCS_LINK_UNSAFE\",\n `Unsafe URL protocol: ${node.url}.`,\n entry,\n node,\n );\n return;\n }\n if (isExternal(node.url) || node.url.startsWith(\"#\")) return;\n const { pathname, query, fragment } = splitReference(node.url);\n if (pathname.startsWith(\"/\")) {\n const target = routeMap.get(normalizeRoute(pathname));\n if (!target) missingLink(diagnostics, entry, node, node.url, config);\n else validateFragment(fragment, target, entry, node, diagnostics, config);\n return;\n }\n const decoded = safeDecode(pathname);\n const targetPath = resolve(dirname(entry.absolutePath), decoded);\n if (!inside(entry.sourceRoot, targetPath)) {\n diagnostic(\n diagnostics,\n \"DOCS_SOURCE_OUTSIDE_ROOT\",\n `Link escapes its allowed source root: ${node.url}.`,\n entry,\n node,\n );\n return;\n }\n const target = findDocument(targetPath, absoluteMap);\n if (!target) {\n if (await isFile(targetPath)) return;\n missingLink(diagnostics, entry, node, node.url, config);\n return;\n }\n node.url = `${withBase(target.route, config.build.base)}${query}${fragment ? `#${fragment}` : \"\"}`;\n reference.resolved = node.url;\n reference.targetSource = target.sourcePath;\n if (fragment) reference.fragment = fragment;\n validateFragment(fragment, target, entry, node, diagnostics, config);\n}\n\nasync function rewriteAsset(\n node: Image,\n entry: DocsEntry,\n config: NormalizedDocsConfig,\n diagnostics: DocsDiagnostic[],\n): Promise<void> {\n const asset: DocsAsset = {\n original: node.url,\n ...lineData(node),\n };\n entry.assets.push(asset);\n if (isExternal(node.url)) return;\n if (unsafeProtocol(node.url)) {\n diagnostic(\n diagnostics,\n \"DOCS_ASSET_UNSAFE\",\n `Unsafe asset URL: ${node.url}.`,\n entry,\n node,\n );\n return;\n }\n const { pathname, query, fragment } = splitReference(node.url);\n const absolute = resolve(dirname(entry.absolutePath), safeDecode(pathname));\n if (!inside(entry.sourceRoot, absolute)) {\n diagnostic(\n diagnostics,\n \"DOCS_SOURCE_OUTSIDE_ROOT\",\n `Asset escapes its allowed source root: ${node.url}.`,\n entry,\n node,\n );\n return;\n }\n try {\n const info = await stat(absolute);\n if (!info.isFile()) throw new Error(\"not a file\");\n if (info.size > config.build.maxAssetBytes) {\n throw new Error(`asset exceeds ${config.build.maxAssetBytes} bytes`);\n }\n const hash = createHash(\"sha256\")\n .update(await readFile(absolute))\n .digest(\"hex\")\n .slice(0, 12);\n const publicPath = withBase(\n `/_tasty-assets/${hash}-${basename(absolute)}`,\n config.build.base,\n );\n node.url = `${publicPath}${query}${fragment ? `#${fragment}` : \"\"}`;\n Object.assign(asset, {\n resolved: node.url,\n sourcePath: absolute,\n publicPath,\n hash,\n bytes: info.size,\n });\n } catch (error) {\n diagnostic(\n diagnostics,\n \"DOCS_ASSET_NOT_FOUND\",\n `Asset not found or invalid: ${node.url} (${errorMessage(error)}).`,\n entry,\n node,\n );\n }\n}\n\nfunction findDocument(\n path: string,\n absoluteMap: Map<string, DocsEntry>,\n): DocsEntry | undefined {\n const candidates = [\n path,\n ...MARKDOWN_EXTENSIONS.map((extension) => `${path}${extension}`),\n ...MARKDOWN_EXTENSIONS.map((extension) =>\n resolve(path, `README${extension}`),\n ),\n ...MARKDOWN_EXTENSIONS.map((extension) =>\n resolve(path, `index${extension}`),\n ),\n ];\n for (const candidate of candidates) {\n const entry = absoluteMap.get(normalizeFs(candidate));\n if (entry) return entry;\n }\n return undefined;\n}\n\nfunction validateFragment(\n fragment: string,\n target: DocsEntry,\n source: DocsEntry,\n node: Link,\n diagnostics: DocsDiagnostic[],\n config: NormalizedDocsConfig,\n): void {\n if (!fragment) return;\n const decoded = safeDecode(fragment);\n if (!target.headings.some((heading) => heading.slug === decoded)) {\n diagnostics.push({\n code: \"DOCS_FRAGMENT_NOT_FOUND\",\n severity: config.build.ci ? \"error\" : \"warning\",\n message: `Heading fragment #${fragment} does not exist on ${target.route}.`,\n file: source.sourcePath,\n ...lineData(node),\n hint: `Known headings: ${target.headings.map((heading) => `#${heading.slug}`).join(\", \") || \"(none)\"}.`,\n });\n }\n}\n\nfunction missingLink(\n diagnostics: DocsDiagnostic[],\n entry: DocsEntry,\n node: Link,\n url: string,\n config: NormalizedDocsConfig,\n): void {\n diagnostics.push({\n code: \"DOCS_LINK_NOT_FOUND\",\n severity: config.build.strict ? \"error\" : \"warning\",\n message: `Internal link target not found: ${url}.`,\n file: entry.sourcePath,\n ...lineData(node),\n });\n}\n\nfunction validateNavigation(\n items: NavigationItem[],\n routes: Map<string, DocsEntry>,\n diagnostics: DocsDiagnostic[],\n): void {\n for (const item of items) {\n if (typeof item === \"string\") {\n if (!routes.has(normalizeRoute(item))) {\n diagnostics.push({\n code: \"DOCS_NAV_TARGET_NOT_FOUND\",\n severity: \"error\",\n message: `Navigation target does not exist: ${item}.`,\n });\n }\n } else if (\"items\" in item) {\n validateNavigation(item.items, routes, diagnostics);\n } else if (\n \"link\" in item &&\n item.link.startsWith(\"/\") &&\n !routes.has(normalizeRoute(item.link))\n ) {\n diagnostics.push({\n code: \"DOCS_NAV_TARGET_NOT_FOUND\",\n severity: \"error\",\n message: `Navigation target does not exist: ${item.link}.`,\n });\n }\n }\n}\n\nexport function normalizeRoute(route: string): string {\n const clean =\n route\n .split(/[?#]/, 1)[0]\n ?.replace(/\\\\/g, \"/\")\n .replace(/\\/{2,}/g, \"/\") ?? \"/\";\n const segments = clean.split(\"/\").filter(Boolean);\n if (segments.some((segment) => segment === \"..\"))\n throw new Error(`Route may not contain \"..\": ${route}.`);\n const normalized = `/${segments.join(\"/\")}`;\n return normalized === \"/\" ? \"/\" : normalized.replace(/\\/$/, \"\");\n}\n\nexport function routeForPath(\n path: string,\n base?: string,\n routeBase?: string,\n): string {\n let relativePath = toPosix(path);\n if (base) {\n const normalizedBase = toPosix(base)\n .replace(/^\\.\\//, \"\")\n .replace(/\\/$/, \"\");\n if (relativePath === normalizedBase) relativePath = \"\";\n else if (relativePath.startsWith(`${normalizedBase}/`))\n relativePath = relativePath.slice(normalizedBase.length + 1);\n }\n relativePath = relativePath.replace(/\\.(md|mdx)$/i, \"\");\n relativePath = relativePath\n .replace(/(^|\\/)README$/i, \"$1\")\n .replace(/(^|\\/)index$/i, \"$1\");\n return normalizeRoute(`${routeBase ?? \"\"}/${relativePath}`);\n}\n\nfunction resolveSourcePath(\n root: string,\n path: string,\n allowOutsideRoot: boolean,\n): string {\n const absolute = isAbsolute(path) ? resolve(path) : resolve(root, path);\n if (!allowOutsideRoot && !inside(root, absolute))\n throw new OutsideRootError(path);\n return absolute;\n}\n\nfunction inside(root: string, path: string): boolean {\n const rel = relative(resolve(root), resolve(path));\n return (\n rel === \"\" ||\n (!rel.startsWith(`..${sep}`) && rel !== \"..\" && !isAbsolute(rel))\n );\n}\n\nfunction splitReference(url: string): {\n pathname: string;\n query: string;\n fragment: string;\n} {\n const hashIndex = url.indexOf(\"#\");\n const fragment = hashIndex >= 0 ? url.slice(hashIndex + 1) : \"\";\n const withoutHash = hashIndex >= 0 ? url.slice(0, hashIndex) : url;\n const queryIndex = withoutHash.indexOf(\"?\");\n return {\n pathname: queryIndex >= 0 ? withoutHash.slice(0, queryIndex) : withoutHash,\n query: queryIndex >= 0 ? withoutHash.slice(queryIndex) : \"\",\n fragment,\n };\n}\n\nfunction isExternal(url: string): boolean {\n return /^(?:[a-z][a-z\\d+.-]*:|\\/\\/)/i.test(url);\n}\n\nfunction unsafeProtocol(url: string): boolean {\n return /^(?:javascript|vbscript|data):/i.test(url.trim());\n}\n\nfunction withBase(route: string, base: string): string {\n const normalizedBase =\n base === \"/\" ? \"\" : `/${base.replace(/^\\/+|\\/+$/g, \"\")}`;\n return `${normalizedBase}${normalizeRoute(route)}` || \"/\";\n}\n\nfunction titleFromFile(path: string): string {\n const raw = basename(path, extname(path)).replace(\n /^README$/i,\n basename(dirname(path)) || \"Documentation\",\n );\n return raw\n .replace(/[-_]+/g, \" \")\n .replace(/\\b\\w/g, (letter) => letter.toUpperCase());\n}\n\nfunction diagnostic(\n diagnostics: DocsDiagnostic[],\n code: string,\n message: string,\n entry: DocsEntry,\n node: PositionedNode,\n): void {\n diagnostics.push({\n code,\n severity: \"error\",\n message,\n file: entry.sourcePath,\n ...lineData(node),\n });\n}\n\ntype PositionedNode = { position?: { start: { line: number } } | undefined };\n\nfunction lineOf(node: PositionedNode): number | undefined {\n return node.position?.start.line;\n}\n\nfunction lineData(\n node: PositionedNode,\n): { line: number } | Record<string, never> {\n const line = lineOf(node);\n return line === undefined ? {} : { line };\n}\n\nfunction safeDecode(value: string): string {\n try {\n return decodeURIComponent(value);\n } catch {\n return value;\n }\n}\n\nfunction sourceLabel(source: DocsSource): string {\n if (\"file\" in source) return source.file;\n if (\"glob\" in source)\n return Array.isArray(source.glob) ? source.glob.join(\", \") : source.glob;\n return source.package;\n}\n\nfunction normalizeFs(path: string): string {\n return resolve(path);\n}\n\nfunction toPosix(path: string): string {\n return path.split(sep).join(\"/\");\n}\n\nasync function isFile(path: string): Promise<boolean> {\n try {\n return (await stat(path)).isFile();\n } catch {\n return false;\n }\n}\n\nasync function isDirectory(path: string): Promise<boolean> {\n try {\n return (await stat(path)).isDirectory();\n } catch {\n return false;\n }\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nclass OutsideRootError extends Error {\n constructor(path: string) {\n super(`Source path is outside the repository root: ${path}.`);\n this.name = \"OutsideRootError\";\n }\n}\n","import type { DocsDiagnostic, DocsGraph } from \"../types.js\";\n\nexport class DocsValidationError extends Error {\n readonly diagnostics: DocsDiagnostic[];\n\n constructor(diagnostics: DocsDiagnostic[]) {\n super(formatDiagnostics(diagnostics));\n this.name = \"DocsValidationError\";\n this.diagnostics = diagnostics;\n }\n}\n\nexport function validateDocs(graph: DocsGraph): DocsDiagnostic[] {\n return [...graph.diagnostics];\n}\n\nexport function assertValidDocs(graph: DocsGraph): void {\n const errors = graph.diagnostics.filter(\n (diagnostic) => diagnostic.severity === \"error\",\n );\n if (errors.length > 0) throw new DocsValidationError(errors);\n}\n\nexport function formatDiagnostics(\n diagnostics: DocsDiagnostic[],\n json = false,\n): string {\n if (json) return JSON.stringify(diagnostics, null, 2);\n return diagnostics\n .map((diagnostic) => {\n const location = diagnostic.file\n ? `${diagnostic.file}${diagnostic.line ? `:${diagnostic.line}` : \"\"}: `\n : \"\";\n const hint = diagnostic.hint ? `\\n hint: ${diagnostic.hint}` : \"\";\n return `${diagnostic.severity.toUpperCase()} ${diagnostic.code} ${location}${diagnostic.message}${hint}`;\n })\n .join(\"\\n\");\n}\n","import { extname, join, relative, sep } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { createDocsGraph } from \"../graph/index.js\";\nimport { assertValidDocs } from \"../validation/index.js\";\nimport type {\n CreateDocsGraphOptions,\n DocsConfig,\n DocsEntry,\n} from \"../types.js\";\n\nexport interface DocsLoaderContext {\n store: {\n clear(): void;\n set(entry: {\n id: string;\n data: Record<string, unknown>;\n body: string;\n filePath?: string;\n digest?: string;\n rendered?: RenderedContent;\n assetImports?: string[];\n }): void;\n };\n logger?: { info(message: string): void };\n config?: { root: URL | string; srcDir: URL | string };\n parseData?: (input: {\n id: string;\n data: Record<string, unknown>;\n filePath?: string;\n }) => Promise<Record<string, unknown>>;\n renderMarkdown?: (\n content: string,\n options?: { fileURL?: URL },\n ) => Promise<RenderedContent>;\n generateDigest?: (data: Record<string, unknown> | string) => string;\n}\n\ninterface RenderedContent {\n html: string;\n metadata?: {\n imagePaths?: string[];\n headings?: Array<{ depth: number; slug: string; text: string }>;\n frontmatter?: Record<string, unknown>;\n [key: string]: unknown;\n };\n}\n\nexport function createDocsLoader(\n config?: DocsConfig,\n options: Omit<CreateDocsGraphOptions, \"config\"> = {},\n) {\n return {\n name: \"@tenphi/docs\",\n async load(context: DocsLoaderContext): Promise<void> {\n const graph = await createDocsGraph({\n ...options,\n ...(config ? { config } : {}),\n });\n assertValidDocs(graph);\n context.store.clear();\n for (const entry of graph.entries) {\n const loaderEntry = toLoaderEntry(entry);\n const filePath = starlightFilePath(entry, context.config);\n const data = context.parseData\n ? await context.parseData({\n id: loaderEntry.id,\n data: loaderEntry.data,\n filePath,\n })\n : loaderEntry.data;\n const rendered = await context.renderMarkdown?.(entry.transformedBody, {\n fileURL: pathToFileURL(entry.absolutePath),\n });\n context.store.set({\n ...loaderEntry,\n data,\n filePath,\n ...(context.generateDigest\n ? { digest: context.generateDigest(entry.transformedBody) }\n : {}),\n ...(rendered\n ? {\n rendered,\n assetImports: rendered.metadata?.imagePaths ?? [],\n }\n : {}),\n });\n }\n context.logger?.info(`Loaded ${graph.entries.length} Cookbook pages.`);\n },\n };\n}\n\nfunction starlightFilePath(\n entry: DocsEntry,\n config?: DocsLoaderContext[\"config\"],\n): string {\n const id = entry.route === \"/\" ? \"index\" : entry.route.slice(1);\n const extension =\n extname(entry.sourcePath).toLowerCase() === \".mdx\" ? \".mdx\" : \".md\";\n if (!config) return `src/content/docs/${id}${extension}`;\n\n const root = toPath(config.root);\n const srcDir = toPath(config.srcDir);\n return relative(root, join(srcDir, \"content\", \"docs\", `${id}${extension}`))\n .split(sep)\n .join(\"/\");\n}\n\nfunction toPath(value: URL | string): string {\n return typeof value === \"string\" ? value : fileURLToPath(value);\n}\n\nfunction toLoaderEntry(entry: DocsEntry): {\n id: string;\n data: Record<string, unknown>;\n body: string;\n} {\n return {\n id: entry.route === \"/\" ? \"index\" : entry.route.slice(1),\n data: {\n title: entry.title,\n draft: entry.frontmatter.draft ?? false,\n ...(entry.description ? { description: entry.description } : {}),\n ...entry.frontmatter,\n cookbook: {\n sourcePath: entry.sourcePath,\n route: entry.route,\n headings: entry.headings,\n },\n },\n body: entry.transformedBody,\n };\n}\n\nexport type { DocsEntry, DocsGraph, DocsRoute, DocsAsset } from \"../types.js\";\n"],"mappings":";;;;;;;;;;;;;AAyBA,MAAM,mBAAmB;AACzB,MAAM,YAAY;AAOlB,eAAsB,mBACpB,WACA,UAAiC,CAAC,GACN;CAC5B,MAAM,SAAS,IAAI,SAAS;CAC5B,IAAI,CAAC;EAAC;EAAO;EAAW;CAAO,CAAC,CAAC,SAAS,OAAO,IAAI,GACnD,MAAM,IAAI,MACR,gEAAgE,OAAO,KAAK,GAC9E;CAEF,MAAM,WAAW,QAAQ,YAAY;CACrC,MAAM,WAAY,MAAM,OAAO,SAAS,WAAW;EACjD;EACA,GAAI,QAAQ,WAAW,EAAE,OAAO,QAAQ,SAAS,IAAI,CAAC;EACtD,cAAc;CAChB,CAAC;CACD,IAAI,CAAC,SAAS,QAAQ,CAAC,SAAS,WAAW,CAAC,SAAS,YACnD,MAAM,IAAI,MACR,yBAAyB,UAAU,wCACrC;CAEF,OAAO;EACL;EACA,UAAU,GAAG,SAAS,KAAK,GAAG,SAAS;EACvC;EACA,WAAW,SAAS;CACtB;AACF;AAEA,eAAsB,aACpB,MACmC;CACnC,IAAI;EACF,MAAM,QAAQ,KAAK,MACjB,MAAM,SAAS,KAAK,MAAM,SAAS,GAAG,MAAM,CAC9C;EACA,aAAa,KAAK;EAClB,OAAO;CACT,SAAS,OAAO;EACd,IAAI,UAAU,KAAK,GAAG,OAAO,KAAA;EAC7B,MAAM;CACR;AACF;AAEA,eAAsB,cACpB,MACA,MACe;CACf,aAAa,IAAI;CACjB,MAAM,UACJ,KAAK,MAAM,S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YAAY,MAAM;IAClB,OAAO,MAAM;IACb,UAAU,MAAM;GAClB;EACF;EACA,MAAM,MAAM;CACd;AACF"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as PackageLockSource, D as TastyDocsLock, E as SiteConfig, O as ThemeConfig, S as PackageDiscovery, T as SearchConfig, _ as MarkdownConfig, a as CreateDocsGraphOptions, b as NavigationPlacement, c as DocsConfig, d as DocsFrontmatter, f as DocsGraph, g as DocsSource, h as DocsRoute, i as ContentConfig, l as DocsDiagnostic, m as DocsReference, n as BuildConfig, o as DiagnosticSeverity, p as DocsHeading, r as ComponentsConfig, s as DocsAsset, t as BrandConfig, u as DocsEntry, v as NavigationConfig, w as PackageManifest, x as NormalizedDocsConfig, y as NavigationItem } from "./types-rjENJzWH.js";
1
+ import { A as ThemePaletteConfig, C as NormalizedDocsConfig, D as SearchConfig, E as PackageManifest, M as ThemeTokens, N as TypographyPreset, O as SiteConfig, P as TypographyPresets, S as NavigationTab, T as PackageLockSource, _ as DocsSource, a as CookbookLock, b as NavigationItem, c as DocsAsset, d as DocsEntry, f as DocsFrontmatter, g as DocsRoute, h as DocsReference, i as ContentConfig, j as ThemeTokenValue, k as ThemeConfig, l as DocsConfig, m as DocsHeading, n as BuildConfig, o as CreateDocsGraphOptions, p as DocsGraph, r as ComponentsConfig, s as DiagnosticSeverity, t as BrandConfig, u as DocsDiagnostic, v as MarkdownConfig, w as PackageDiscovery, x as NavigationPlacement, y as NavigationConfig } from "./types-BinP19sy.js";
2
2
  import { DocsConfigError, defineDocsConfig, normalizeDocsConfig, validateConfig } from "./config/index.js";
3
3
  import { createDocsLoader } from "./content/index.js";
4
4
  //#region src/graph/index.d.ts
@@ -12,14 +12,14 @@ interface ResolvePackageOptions {
12
12
  cacheDir?: string;
13
13
  }
14
14
  declare function resolvePackageLock(requested: string, options?: ResolvePackageOptions): Promise<PackageLockSource>;
15
- declare function readDocsLock(root: string): Promise<TastyDocsLock | undefined>;
16
- declare function writeDocsLock(root: string, lock: TastyDocsLock): Promise<void>;
17
- declare function validateLock(lock: TastyDocsLock): void;
15
+ declare function readDocsLock(root: string): Promise<CookbookLock | undefined>;
16
+ declare function writeDocsLock(root: string, lock: CookbookLock): Promise<void>;
17
+ declare function validateLock(lock: CookbookLock): void;
18
18
  declare function materializePackage(source: PackageLockSource, config: NormalizedDocsConfig["build"], projectRoot?: string): Promise<string>;
19
19
  declare function discoverPackage(root: string): Promise<PackageDiscovery>;
20
20
  declare function packageNameFromSpecifier(specifier: string): string;
21
- declare function lockForSource(lock: TastyDocsLock | undefined, requested: string): PackageLockSource;
22
- declare function defaultLock(sources: PackageLockSource[]): TastyDocsLock;
21
+ declare function lockForSource(lock: CookbookLock | undefined, requested: string): PackageLockSource;
22
+ declare function defaultLock(sources: PackageLockSource[]): CookbookLock;
23
23
  //#endregion
24
24
  //#region src/validation/index.d.ts
25
25
  declare class DocsValidationError extends Error {
@@ -30,5 +30,5 @@ declare function validateDocs(graph: DocsGraph): DocsDiagnostic[];
30
30
  declare function assertValidDocs(graph: DocsGraph): void;
31
31
  declare function formatDiagnostics(diagnostics: DocsDiagnostic[], json?: boolean): string;
32
32
  //#endregion
33
- export { type BrandConfig, type BuildConfig, type ComponentsConfig, type ContentConfig, type CreateDocsGraphOptions, type DiagnosticSeverity, type DocsAsset, type DocsConfig, DocsConfigError, type DocsDiagnostic, type DocsEntry, type DocsFrontmatter, type DocsGraph, type DocsHeading, type DocsReference, type DocsRoute, type DocsSource, DocsValidationError, type MarkdownConfig, type NavigationConfig, type NavigationItem, type NavigationPlacement, type NormalizedDocsConfig, type PackageDiscovery, type PackageLockSource, type PackageManifest, type SearchConfig, type SiteConfig, type TastyDocsLock, type ThemeConfig, assertValidDocs, createDocsGraph, createDocsLoader, defaultLock, defineDocsConfig, discoverPackage, formatDiagnostics, lockForSource, materializePackage, normalizeDocsConfig, normalizeRoute, packageNameFromSpecifier, readDocsLock, resolvePackageLock, routeForPath, validateConfig, validateDocs, validateLock, writeDocsLock };
33
+ export { type BrandConfig, type BuildConfig, type ComponentsConfig, type ContentConfig, type CookbookLock, type CreateDocsGraphOptions, type DiagnosticSeverity, type DocsAsset, type DocsConfig, DocsConfigError, type DocsDiagnostic, type DocsEntry, type DocsFrontmatter, type DocsGraph, type DocsHeading, type DocsReference, type DocsRoute, type DocsSource, DocsValidationError, type MarkdownConfig, type NavigationConfig, type NavigationItem, type NavigationPlacement, type NavigationTab, type NormalizedDocsConfig, type PackageDiscovery, type PackageLockSource, type PackageManifest, type SearchConfig, type SiteConfig, type ThemeConfig, type ThemePaletteConfig, type ThemeTokenValue, type ThemeTokens, type TypographyPreset, type TypographyPresets, assertValidDocs, createDocsGraph, createDocsLoader, defaultLock, defineDocsConfig, discoverPackage, formatDiagnostics, lockForSource, materializePackage, normalizeDocsConfig, normalizeRoute, packageNameFromSpecifier, readDocsLock, resolvePackageLock, routeForPath, validateConfig, validateDocs, validateLock, writeDocsLock };
34
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/graph/index.ts","../src/npm/index.ts","../src/validation/index.ts"],"mappings":";;;;iBAqEsB,gBACpB,UAAS,yBACR,QAAQ;iBAmiBK,eAAe;iBAaf,aACd,cACA,eACA;;;UC9lBe;EACf;EACA;;iBAGoB,mBACpB,mBACA,UAAS,wBACR,QAAQ;iBA0BW,aACpB,eACC,QAAQ;iBAaW,cACpB,cACA,MAAM,gBACL;iBASa,aAAa,MAAM;iBAiCb,mBACpB,QAAQ,mBACR,QAAQ,+BACR,uBACC;iBAkHmB,gBAAgB,eAAe,QAAQ;iBAsC7C,yBAAyB;iBAOzB,cACd,MAAM,2BACN,oBACC;iBAea,YAAY,SAAS,sBAAsB;;;cC7S9C,4BAA4B;WAC9B,aAAa;EAEtB,YAAY,aAAa;;iBAOX,aAAa,OAAO,YAAY;iBAIhC,gBAAgB,OAAO;iBAOvB,kBACd,aAAa,kBACb"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/graph/index.ts","../src/npm/index.ts","../src/validation/index.ts"],"mappings":";;;;iBAqEsB,gBACpB,UAAS,yBACR,QAAQ;iBA2iBK,eAAe;iBAaf,aACd,cACA,eACA;;;UCtmBe;EACf;EACA;;iBAGoB,mBACpB,mBACA,UAAS,wBACR,QAAQ;iBA0BW,aACpB,eACC,QAAQ;iBAaW,cACpB,cACA,MAAM,eACL;iBASa,aAAa,MAAM;iBAiCb,mBACpB,QAAQ,mBACR,QAAQ,+BACR,uBACC;iBAkHmB,gBAAgB,eAAe,QAAQ;iBAsC7C,yBAAyB;iBAOzB,cACd,MAAM,0BACN,oBACC;iBAea,YAAY,SAAS,sBAAsB;;;cC7S9C,4BAA4B;WAC9B,aAAa;EAEtB,YAAY,aAAa;;iBAOX,aAAa,OAAO,YAAY;iBAIhC,gBAAgB,OAAO;iBAOvB,kBACd,aAAa,kBACb"}
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { DocsConfigError, defineDocsConfig, normalizeDocsConfig, validateConfig } from "./config/index.js";
2
- import { _ as writeDocsLock, a as validateDocs, c as routeForPath, d as lockForSource, f as materializePackage, g as validateLock, h as resolvePackageLock, i as formatDiagnostics, l as defaultLock, m as readDocsLock, n as DocsValidationError, o as createDocsGraph, p as packageNameFromSpecifier, r as assertValidDocs, s as normalizeRoute, t as createDocsLoader, u as discoverPackage } from "./content-DStZeziu.js";
2
+ import { _ as writeDocsLock, a as validateDocs, c as routeForPath, d as lockForSource, f as materializePackage, g as validateLock, h as resolvePackageLock, i as formatDiagnostics, l as defaultLock, m as readDocsLock, n as DocsValidationError, o as createDocsGraph, p as packageNameFromSpecifier, r as assertValidDocs, s as normalizeRoute, t as createDocsLoader, u as discoverPackage } from "./content-Bhdv88Pe.js";
3
3
  export { DocsConfigError, DocsValidationError, assertValidDocs, createDocsGraph, createDocsLoader, defaultLock, defineDocsConfig, discoverPackage, formatDiagnostics, lockForSource, materializePackage, normalizeDocsConfig, normalizeRoute, packageNameFromSpecifier, readDocsLock, resolvePackageLock, routeForPath, validateConfig, validateDocs, validateLock, writeDocsLock };
@@ -1,4 +1,4 @@
1
- import { A as Heading, M as Paragraph, N as PhrasingContent, P as Root, j as Link, k as Content, p as DocsHeading } from "../types-rjENJzWH.js";
1
+ import { B as Root, F as Content, I as Heading, L as Link, R as Paragraph, m as DocsHeading, z as PhrasingContent } from "../types-BinP19sy.js";
2
2
  //#region src/markdown/index.d.ts
3
3
  interface ParsedMarkdown {
4
4
  ast: Root;
@@ -1,9 +1,9 @@
1
- import { mkdir, mkdtemp, writeFile } from "node:fs/promises";
2
1
  import { dirname, join } from "node:path";
2
+ import { mkdir, mkdtemp, writeFile } from "node:fs/promises";
3
3
  import { tmpdir } from "node:os";
4
4
  //#region src/testing/index.ts
5
5
  async function createDocsFixture(files) {
6
- const root = await mkdtemp(join(tmpdir(), "tasty-docs-fixture-"));
6
+ const root = await mkdtemp(join(tmpdir(), "cookbook-fixture-"));
7
7
  for (const [path, contents] of Object.entries(files)) {
8
8
  const target = join(root, path);
9
9
  await mkdir(dirname(target), { recursive: true });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/testing/index.ts"],"sourcesContent":["import { mkdtemp, mkdir, writeFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nexport async function createDocsFixture(\n files: Record<string, string | Uint8Array>,\n): Promise<string> {\n const root = await mkdtemp(join(tmpdir(), \"tasty-docs-fixture-\"));\n for (const [path, contents] of Object.entries(files)) {\n const target = join(root, path);\n await mkdir(dirname(target), { recursive: true });\n await writeFile(target, contents);\n }\n return root;\n}\n"],"mappings":";;;;AAIA,eAAsB,kBACpB,OACiB;CACjB,MAAM,OAAO,MAAM,QAAQ,KAAK,OAAO,GAAG,qBAAqB,CAAC;CAChE,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,KAAK,GAAG;EACpD,MAAM,SAAS,KAAK,MAAM,IAAI;EAC9B,MAAM,MAAM,QAAQ,MAAM,GAAG,EAAE,WAAW,KAAK,CAAC;EAChD,MAAM,UAAU,QAAQ,QAAQ;CAClC;CACA,OAAO;AACT"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/testing/index.ts"],"sourcesContent":["import { mkdtemp, mkdir, writeFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nexport async function createDocsFixture(\n files: Record<string, string | Uint8Array>,\n): Promise<string> {\n const root = await mkdtemp(join(tmpdir(), \"cookbook-fixture-\"));\n for (const [path, contents] of Object.entries(files)) {\n const target = join(root, path);\n await mkdir(dirname(target), { recursive: true });\n await writeFile(target, contents);\n }\n return root;\n}\n"],"mappings":";;;;AAIA,eAAsB,kBACpB,OACiB;CACjB,MAAM,OAAO,MAAM,QAAQ,KAAK,OAAO,GAAG,mBAAmB,CAAC;CAC9D,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,KAAK,GAAG;EACpD,MAAM,SAAS,KAAK,MAAM,IAAI;EAC9B,MAAM,MAAM,QAAQ,MAAM,GAAG,EAAE,WAAW,KAAK,CAAC;EAChD,MAAM,UAAU,QAAQ,QAAQ;CAClC;CACA,OAAO;AACT"}
@@ -1102,8 +1102,16 @@ type NavigationItem = string | {
1102
1102
  label: string;
1103
1103
  link: string;
1104
1104
  };
1105
+ interface NavigationTab {
1106
+ label: string;
1107
+ link: string;
1108
+ /** Sidebar tree shown while this tab is active. */
1109
+ items?: NavigationItem[];
1110
+ }
1105
1111
  interface NavigationConfig {
1106
1112
  items?: NavigationItem[];
1113
+ /** Optional primary navigation rendered as a compact row below the header. */
1114
+ tabs?: NavigationTab[];
1107
1115
  }
1108
1116
  type BrandConfig = GlazeColorValue | {
1109
1117
  from: GlazeColorValue;
@@ -1112,12 +1120,66 @@ type BrandConfig = GlazeColorValue | {
1112
1120
  };
1113
1121
  unsafeContrast?: boolean;
1114
1122
  };
1123
+ type ThemeTokenValue = string | number;
1124
+ /**
1125
+ * Tasty design tokens. `$name` is emitted as `--name`; existing `--name`
1126
+ * custom-property keys remain supported for compatibility.
1127
+ */
1128
+ interface ThemeTokens {
1129
+ $gap?: ThemeTokenValue;
1130
+ $radius?: ThemeTokenValue;
1131
+ "$card-radius"?: ThemeTokenValue;
1132
+ "$border-width"?: ThemeTokenValue;
1133
+ "$outline-width"?: ThemeTokenValue;
1134
+ "$outline-offset"?: ThemeTokenValue;
1135
+ "$layout-width"?: ThemeTokenValue;
1136
+ "$content-width"?: ThemeTokenValue;
1137
+ "$sidebar-width"?: ThemeTokenValue;
1138
+ "$control-height"?: ThemeTokenValue;
1139
+ [name: `$${string}`]: ThemeTokenValue | undefined;
1140
+ [customProperty: `--${string}`]: ThemeTokenValue | undefined;
1141
+ }
1142
+ interface TypographyPreset {
1143
+ fontFamily?: string;
1144
+ fontSize?: ThemeTokenValue;
1145
+ lineHeight?: ThemeTokenValue;
1146
+ letterSpacing?: ThemeTokenValue;
1147
+ fontWeight?: ThemeTokenValue;
1148
+ boldFontWeight?: ThemeTokenValue;
1149
+ iconSize?: ThemeTokenValue;
1150
+ textTransform?: ThemeTokenValue;
1151
+ fontStyle?: ThemeTokenValue;
1152
+ }
1153
+ /** Built-in presets can be overridden and additional Tasty presets may be added. */
1154
+ interface TypographyPresets {
1155
+ body?: TypographyPreset;
1156
+ heading?: TypographyPreset;
1157
+ h1?: TypographyPreset;
1158
+ h2?: TypographyPreset;
1159
+ h3?: TypographyPreset;
1160
+ h4?: TypographyPreset;
1161
+ h5?: TypographyPreset;
1162
+ h6?: TypographyPreset;
1163
+ small?: TypographyPreset;
1164
+ code?: TypographyPreset;
1165
+ [name: string]: TypographyPreset | undefined;
1166
+ }
1167
+ /** Semantic palette inputs. Glaze resolves every value for all appearance modes. */
1168
+ interface ThemePaletteConfig {
1169
+ /** Light-scheme page surface; dark and high-contrast values adapt. */
1170
+ surface?: GlazeColorValue;
1171
+ /** Primary reading text seed, resolved against `surface`. */
1172
+ text?: GlazeColorValue;
1173
+ /** Secondary text seed, resolved against `surface`. */
1174
+ textSoft?: GlazeColorValue;
1175
+ }
1115
1176
  interface ThemeConfig {
1116
1177
  variant?: string;
1117
1178
  brand?: BrandConfig;
1179
+ palette?: ThemePaletteConfig;
1118
1180
  states?: Record<string, string>;
1119
- tokens?: Record<string, string | number>;
1120
- presets?: Record<string, unknown>;
1181
+ tokens?: ThemeTokens;
1182
+ presets?: TypographyPresets;
1121
1183
  styles?: Record<string, unknown>;
1122
1184
  contrastLevel?: number | "auto";
1123
1185
  }
@@ -1251,7 +1313,7 @@ interface PackageLockSource {
1251
1313
  integrity: string;
1252
1314
  vendored?: string;
1253
1315
  }
1254
- interface TastyDocsLock {
1316
+ interface CookbookLock {
1255
1317
  schemaVersion: 1;
1256
1318
  sources: PackageLockSource[];
1257
1319
  }
@@ -1265,7 +1327,7 @@ interface PackageManifest {
1265
1327
  url?: string;
1266
1328
  directory?: string;
1267
1329
  };
1268
- tastyDocs?: {
1330
+ cookbook?: {
1269
1331
  index?: string;
1270
1332
  include?: string[];
1271
1333
  exclude?: string[];
@@ -1286,8 +1348,8 @@ interface PackageDiscovery {
1286
1348
  interface CreateDocsGraphOptions {
1287
1349
  root?: string;
1288
1350
  config?: DocsConfig;
1289
- lock?: TastyDocsLock;
1351
+ lock?: CookbookLock;
1290
1352
  }
1291
1353
  //#endregion
1292
- export { Heading as A, PackageLockSource as C, TastyDocsLock as D, SiteConfig as E, Paragraph as M, PhrasingContent as N, ThemeConfig as O, Root as P, PackageDiscovery as S, SearchConfig as T, MarkdownConfig as _, CreateDocsGraphOptions as a, NavigationPlacement as b, DocsConfig as c, DocsFrontmatter as d, DocsGraph as f, DocsSource as g, DocsRoute as h, ContentConfig as i, Link as j, Content as k, DocsDiagnostic as l, DocsReference as m, BuildConfig as n, DiagnosticSeverity as o, DocsHeading as p, ComponentsConfig as r, DocsAsset as s, BrandConfig as t, DocsEntry as u, NavigationConfig as v, PackageManifest as w, NormalizedDocsConfig as x, NavigationItem as y };
1293
- //# sourceMappingURL=types-rjENJzWH.d.ts.map
1354
+ export { ThemePaletteConfig as A, Root as B, NormalizedDocsConfig as C, SearchConfig as D, PackageManifest as E, Content as F, Heading as I, Link as L, ThemeTokens as M, TypographyPreset as N, SiteConfig as O, TypographyPresets as P, Paragraph as R, NavigationTab as S, PackageLockSource as T, DocsSource as _, CookbookLock as a, NavigationItem as b, DocsAsset as c, DocsEntry as d, DocsFrontmatter as f, DocsRoute as g, DocsReference as h, ContentConfig as i, ThemeTokenValue as j, ThemeConfig as k, DocsConfig as l, DocsHeading as m, BuildConfig as n, CreateDocsGraphOptions as o, DocsGraph as p, ComponentsConfig as r, DiagnosticSeverity as s, BrandConfig as t, DocsDiagnostic as u, MarkdownConfig as v, PackageDiscovery as w, NavigationPlacement as x, NavigationConfig as y, PhrasingContent as z };
1355
+ //# sourceMappingURL=types-BinP19sy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-rjENJzWH.d.ts","names":[],"sources":["../../../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts","../../../node_modules/.pnpm/@types+mdast@4.0.4/node_modules/@types/mdast/index.d.ts","../src/types.ts"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;;;;;;;;;;;;UAqBiB;;;;UAKA;;;;EAIb;;;;EAKA;;;;EAIA;;;;;;;UAQa;;;;EAIb,OAAO;;;;EAKP,KAAK;;;;;;;;;;;;UA6BQ;;;;EAIb;;;;EAKA,OAAO;;;;;;;EAQP,WAAW;;;;;;;;;;;;;;;;;;;;;;KCjFH;;;;;;;;;;KAWA;;;;;UAOK;;;;;EAKb;;;;;;;;;;;UAYa;;;;;;;;;;;;;;EAcb;;;;;;;;;;EAWA;;;;;UAMa,kBAAkB;;;;EAI/B,eAAe;;;;;UAMF;;;;EAIb;;;;;EAKA;;;;;;;;;;;;;;;;;;;;;UAuBa,aAAa;;;;;;;;;KAWlB,eAAe,sBAAsB;;;;;;;;;;;;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,YAAY;;UAGG;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP,UAAU;EACV,aAAa,mBAAmB;EAChC,QAAQ;EACR,WAAW;EACX,SAAS;EACT,aAAa;EACb,QAAQ;;UAGO;EACf,MAAM;EACN,SAAS,SACP,KAAK,kEAEL;EACF,YAAY;EACZ,OAAO;IAAgB,OAAO;;EAC9B,UAAU,SACR,KACE,gGAOF;EACF,QAAQ,SAAS;EACjB,YAAY;EACZ,OAAO,SAAS;;UAGD;EACf;EACA;EACA;EACA;EACA;IAAoB;IAAgB;IAAgB;;EACpD;IAAgB;IAA0B;;EAC1C;EACA;EACA;EACA;EACA,OAAO,MAAM;;UAGE;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe,kBAAkB;EACjC;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA,aAAa;EACb,UAAU;EACV;EACA;EACA,KAAK;EACL,OAAO;EACP,QAAQ;EACR;EACA;IAAY;IAAmB;;;UAGhB;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,QAAQ;EACR,aAAa;EACb,aAAa,gBAAgB;EAC7B,cAAc,qBAAqB;;UAGpB;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,SAAS;;UAGM;EACf;EACA;EACA;EACA;EACA;IAAwB;IAAe;IAAc;;EACrD;IACE;IACA;IACA;IACA;MAAU,QAAQ;;;EAEpB;EACA;;UAGe;EACf;EACA,UAAU;EACV;EACA;EACA;;UAGe;EACf;EACA,SAAS;EACT,OAAO"}
1
+ {"version":3,"file":"types-BinP19sy.d.ts","names":[],"sources":["../../../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts","../../../node_modules/.pnpm/@types+mdast@4.0.4/node_modules/@types/mdast/index.d.ts","../src/types.ts"],"x_google_ignoreList":[0,1],"mappings":";;;;;;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UAAU,SACR,KACE,gGAOF;EACF,QAAQ,SAAS;EACjB,YAAY;EACZ,OAAO,SAAS;;UAGD;EACf;EACA;EACA;EACA;EACA;IAAoB;IAAgB;IAAgB;;EACpD;IAAgB;IAA0B;;EAC1C;EACA;EACA;EACA;EACA,OAAO,MAAM;;UAGE;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe,kBAAkB;EACjC;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA,aAAa;EACb,UAAU;EACV;EACA;EACA,KAAK;EACL,OAAO;EACP,QAAQ;EACR;EACA;IAAY;IAAmB;;;UAGhB;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,QAAQ;EACR,aAAa;EACb,aAAa,gBAAgB;EAC7B,cAAc,qBAAqB;;UAGpB;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,SAAS;;UAGM;EACf;EACA;EACA;EACA;EACA;IAAwB;IAAe;IAAc;;EACrD;IACE;IACA;IACA;IACA;MAAU,QAAQ;;;EAEpB;EACA;;UAGe;EACf;EACA,UAAU;EACV;EACA;EACA;;UAGe;EACf;EACA,SAAS;EACT,OAAO"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tenphi/docs",
3
- "version": "0.1.0",
4
- "description": "Repository-native content and configuration engine for Tasty Docs",
3
+ "version": "0.4.0",
4
+ "description": "Repository-native content and configuration engine for Cookbook",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "exports": {
@@ -40,12 +40,12 @@
40
40
  },
41
41
  "repository": {
42
42
  "type": "git",
43
- "url": "git+https://github.com/tenphi/tasty-docs.git",
43
+ "url": "git+https://github.com/tenphi/cookbook.git",
44
44
  "directory": "packages/docs"
45
45
  },
46
- "homepage": "https://github.com/tenphi/tasty-docs#readme",
46
+ "homepage": "https://github.com/tenphi/cookbook#readme",
47
47
  "bugs": {
48
- "url": "https://github.com/tenphi/tasty-docs/issues"
48
+ "url": "https://github.com/tenphi/cookbook/issues"
49
49
  },
50
50
  "author": "Andrey Yamanov",
51
51
  "license": "MIT",
@@ -57,8 +57,8 @@
57
57
  "mdast-util-gfm": "^3.1.0",
58
58
  "mdast-util-to-markdown": "^2.1.2",
59
59
  "micromark-extension-gfm": "^3.0.0",
60
- "npm-package-arg": "^14.0.0",
61
- "pacote": "^22.0.0",
60
+ "npm-package-arg": "^13.0.2",
61
+ "pacote": "^21.5.1",
62
62
  "tinyglobby": "^0.2.15",
63
63
  "unist-util-visit": "^5.0.0"
64
64
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-DStZeziu.js","names":["inside"],"sources":["../src/npm/index.ts","../src/graph/index.ts","../src/validation/index.ts","../src/content/index.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { homedir } from \"node:os\";\nimport {\n lstat,\n mkdir,\n mkdtemp,\n readFile,\n readdir,\n rename,\n rm,\n stat,\n writeFile,\n} from \"node:fs/promises\";\nimport { dirname, isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport npa from \"npm-package-arg\";\nimport pacote from \"pacote\";\nimport { glob } from \"tinyglobby\";\nimport type {\n NormalizedDocsConfig,\n PackageDiscovery,\n PackageLockSource,\n PackageManifest,\n TastyDocsLock,\n} from \"../types.js\";\n\nconst DEFAULT_REGISTRY = \"https://registry.npmjs.org/\";\nconst LOCK_FILE = \"tasty-docs.lock.json\";\n\nexport interface ResolvePackageOptions {\n registry?: string;\n cacheDir?: string;\n}\n\nexport async function resolvePackageLock(\n requested: string,\n options: ResolvePackageOptions = {},\n): Promise<PackageLockSource> {\n const parsed = npa(requested);\n if (![\"tag\", \"version\", \"range\"].includes(parsed.type)) {\n throw new Error(\n `Only npm registry package specifiers are supported (received ${parsed.type}).`,\n );\n }\n const registry = options.registry ?? DEFAULT_REGISTRY;\n const manifest = (await pacote.manifest(requested, {\n registry,\n ...(options.cacheDir ? { cache: options.cacheDir } : {}),\n fullMetadata: true,\n })) as PackageManifest;\n if (!manifest.name || !manifest.version || !manifest._integrity) {\n throw new Error(\n `Registry metadata for ${requested} did not include version and integrity.`,\n );\n }\n return {\n requested,\n resolved: `${manifest.name}@${manifest.version}`,\n registry,\n integrity: manifest._integrity,\n };\n}\n\nexport async function readDocsLock(\n root: string,\n): Promise<TastyDocsLock | undefined> {\n try {\n const value = JSON.parse(\n await readFile(join(root, LOCK_FILE), \"utf8\"),\n ) as TastyDocsLock;\n validateLock(value);\n return value;\n } catch (error) {\n if (isMissing(error)) return undefined;\n throw error;\n }\n}\n\nexport async function writeDocsLock(\n root: string,\n lock: TastyDocsLock,\n): Promise<void> {\n validateLock(lock);\n await writeFile(\n join(root, LOCK_FILE),\n `${JSON.stringify(lock, null, 2)}\\n`,\n \"utf8\",\n );\n}\n\nexport function validateLock(lock: TastyDocsLock): void {\n if (lock.schemaVersion !== 1 || !Array.isArray(lock.sources)) {\n throw new Error(\"Unsupported or invalid tasty-docs.lock.json.\");\n }\n for (const source of lock.sources) {\n if (\n !source.requested ||\n !source.resolved ||\n !source.registry ||\n !source.integrity\n ) {\n throw new Error(\n \"Every lock source requires requested, resolved, registry, and integrity.\",\n );\n }\n const parsed = npa(source.resolved);\n if (parsed.type !== \"version\") {\n throw new Error(\n `Locked source must use an exact version: ${source.resolved}.`,\n );\n }\n if (\n source.vendored &&\n (source.vendored.startsWith(\"/\") ||\n source.vendored.split(/[\\\\/]/).includes(\"..\"))\n ) {\n throw new Error(\n `Vendored package path must stay within the project: ${source.vendored}.`,\n );\n }\n }\n}\n\nexport async function materializePackage(\n source: PackageLockSource,\n config: NormalizedDocsConfig[\"build\"],\n projectRoot?: string,\n): Promise<string> {\n if (source.vendored) {\n if (!projectRoot) {\n throw new Error(\n `Vendored source ${source.resolved} requires a project root.`,\n );\n }\n const vendored = resolve(projectRoot, source.vendored);\n if (!inside(projectRoot, vendored)) {\n throw new Error(\n `Vendored package path escapes the project root: ${source.vendored}.`,\n );\n }\n const marker = (\n await readFile(join(vendored, \".tasty-docs-integrity\"), \"utf8\")\n ).trim();\n if (marker !== source.integrity) {\n throw new Error(\n `Vendored package integrity marker does not match ${source.resolved}.`,\n );\n }\n await validateExtractedTree(vendored, config);\n return vendored;\n }\n const cacheRoot = resolve(\n config.cacheDir || join(homedir(), \".cache\", \"tasty-docs\"),\n \"artifacts\",\n );\n const key = createHash(\"sha256\").update(source.integrity).digest(\"hex\");\n const destination = join(cacheRoot, key);\n const marker = join(destination, \".tasty-docs-integrity\");\n try {\n if ((await readFile(marker, \"utf8\")).trim() === source.integrity)\n return destination;\n } catch (error) {\n if (!isMissing(error)) throw error;\n }\n\n await mkdir(cacheRoot, { recursive: true });\n const temporary = await mkdtemp(join(cacheRoot, \".extract-\"));\n try {\n const tarball = await pacote.tarball(source.resolved, {\n registry: source.registry,\n integrity: source.integrity,\n cache: join(cacheRoot, \"_cacache\"),\n });\n if (tarball.byteLength > config.maxArtifactBytes) {\n throw new Error(\n `Package artifact is ${tarball.byteLength} bytes; limit is ${config.maxArtifactBytes}.`,\n );\n }\n await pacote.extract(source.resolved, temporary, {\n registry: source.registry,\n integrity: source.integrity,\n cache: join(cacheRoot, \"_cacache\"),\n });\n await validateExtractedTree(temporary, config);\n await writeFile(\n join(temporary, \".tasty-docs-integrity\"),\n `${source.integrity}\\n`,\n );\n await rm(destination, { recursive: true, force: true });\n await rename(temporary, destination);\n return destination;\n } catch (error) {\n await rm(temporary, { recursive: true, force: true });\n throw error;\n }\n}\n\nasync function validateExtractedTree(\n root: string,\n config: NormalizedDocsConfig[\"build\"],\n): Promise<void> {\n let files = 0;\n let bytes = 0;\n const pending = [root];\n while (pending.length > 0) {\n const directory = pending.pop();\n if (!directory) break;\n for (const name of await readdir(directory)) {\n if (name === \".tasty-docs-integrity\") continue;\n const path = join(directory, name);\n const info = await lstat(path);\n const rel = relative(root, path);\n if (rel.startsWith(`..${sep}`) || rel === \"..\") {\n throw new Error(`Package path escapes artifact root: ${rel}.`);\n }\n if (rel.split(sep).length > config.maxPathDepth) {\n throw new Error(`Package path exceeds maximum depth: ${rel}.`);\n }\n if (info.isSymbolicLink()) {\n throw new Error(`Package symlinks are not allowed: ${rel}.`);\n }\n if (info.isDirectory()) {\n pending.push(path);\n } else if (info.isFile()) {\n files += 1;\n bytes += info.size;\n if (info.size > config.maxAssetBytes) {\n throw new Error(`Package file exceeds maximum size: ${rel}.`);\n }\n if (files > config.maxFiles || bytes > config.maxUnpackedBytes) {\n throw new Error(\n \"Package exceeds configured file-count or unpacked-size limit.\",\n );\n }\n } else {\n throw new Error(`Unsupported package entry type: ${rel}.`);\n }\n }\n }\n}\n\nexport async function discoverPackage(root: string): Promise<PackageDiscovery> {\n const manifest = JSON.parse(\n await readFile(join(root, \"package.json\"), \"utf8\"),\n ) as PackageManifest;\n const hints = manifest.tastyDocs;\n const homeCandidates = [hints?.index, \"README.md\", \"readme.md\"].filter(\n (candidate): candidate is string => Boolean(candidate),\n );\n let home: string | undefined;\n for (const candidate of homeCandidates) {\n try {\n if ((await stat(join(root, candidate))).isFile()) {\n home = candidate;\n break;\n }\n } catch (error) {\n if (!isMissing(error)) throw error;\n }\n }\n\n const patterns = hints?.include?.length\n ? hints.include\n : [\n \"docs/**/*.{md,mdx}\",\n \"docs/**/*.{png,jpg,jpeg,gif,webp,avif,svg,pdf,txt,zip}\",\n ];\n const discovered = await glob(patterns, {\n cwd: root,\n onlyFiles: true,\n dot: false,\n ignore: hints?.exclude ?? [],\n });\n const pages = discovered.filter((path) => /\\.mdx?$/i.test(path));\n if (home && !pages.includes(home)) pages.unshift(home);\n const assets = discovered.filter((path) => !/\\.mdx?$/i.test(path));\n return { root, manifest, ...(home ? { home } : {}), pages, assets };\n}\n\nexport function packageNameFromSpecifier(specifier: string): string {\n const parsed = npa(specifier);\n if (!parsed.name)\n throw new Error(`Invalid npm package specifier: ${specifier}.`);\n return parsed.name;\n}\n\nexport function lockForSource(\n lock: TastyDocsLock | undefined,\n requested: string,\n): PackageLockSource {\n const match = lock?.sources.find(\n (source) =>\n source.requested === requested ||\n packageNameFromSpecifier(source.requested) ===\n packageNameFromSpecifier(requested),\n );\n if (!match) {\n throw new Error(\n `Package source ${requested} is not locked. Run \"tasty-docs update\" to create ${LOCK_FILE}.`,\n );\n }\n return match;\n}\n\nexport function defaultLock(sources: PackageLockSource[]): TastyDocsLock {\n return { schemaVersion: 1, sources };\n}\n\nfunction isMissing(error: unknown): boolean {\n return (\n typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n );\n}\n\nfunction inside(root: string, path: string): boolean {\n const rel = relative(resolve(root), resolve(path));\n return (\n rel === \"\" ||\n (!rel.startsWith(`..${sep}`) && rel !== \"..\" && !isAbsolute(rel))\n );\n}\n","import { createHash } from \"node:crypto\";\nimport { readFile, stat } from \"node:fs/promises\";\nimport {\n basename,\n dirname,\n extname,\n isAbsolute,\n relative,\n resolve,\n sep,\n} from \"node:path\";\nimport matter from \"gray-matter\";\nimport type { Image, Link, Root } from \"mdast\";\nimport { glob } from \"tinyglobby\";\nimport { visit } from \"unist-util-visit\";\nimport { normalizeDocsConfig } from \"../config/index.js\";\nimport {\n cloneAst,\n parseMarkdown,\n removeRenderedTitle,\n serializeMarkdown,\n stripLeadingBadgeBlock,\n} from \"../markdown/index.js\";\nimport {\n discoverPackage,\n lockForSource,\n materializePackage,\n readDocsLock,\n} from \"../npm/index.js\";\nimport type {\n CreateDocsGraphOptions,\n DocsAsset,\n DocsDiagnostic,\n DocsEntry,\n DocsFrontmatter,\n DocsGraph,\n DocsRoute,\n DocsSource,\n NavigationItem,\n NormalizedDocsConfig,\n PackageLockSource,\n} from \"../types.js\";\n\ninterface CollectedSource {\n absolutePath: string;\n sourcePath: string;\n sourceRoot: string;\n route?: string;\n title?: string;\n description?: string;\n trust: \"markdown\" | \"mdx\";\n packageLock?: PackageLockSource;\n}\n\nconst MARKDOWN_EXTENSIONS = [\".md\", \".mdx\"];\nconst FRONTMATTER_KEYS = new Set([\n \"title\",\n \"description\",\n \"slug\",\n \"draft\",\n \"sidebar\",\n \"toc\",\n \"editUrl\",\n \"prev\",\n \"next\",\n \"search\",\n \"head\",\n]);\n\nexport async function createDocsGraph(\n options: CreateDocsGraphOptions = {},\n): Promise<DocsGraph> {\n const root = resolve(options.root ?? process.cwd());\n const config = normalizeDocsConfig(options.config);\n const diagnostics: DocsDiagnostic[] = [];\n const lock = options.lock ?? (await readDocsLock(root));\n const collected = await collectSources(root, config, lock, diagnostics);\n const entries: DocsEntry[] = [];\n const routeMap = new Map<string, DocsEntry>();\n const absoluteMap = new Map<string, DocsEntry>();\n const sourceMap = new Map<string, DocsEntry>();\n\n for (const source of collected) {\n const entry = await readEntry(source, config, diagnostics);\n if (!entry) continue;\n const existing = routeMap.get(entry.route);\n if (existing) {\n diagnostics.push({\n code: \"DOCS_DUPLICATE_ROUTE\",\n severity: \"error\",\n message: `Route ${entry.route} is owned by both ${existing.sourcePath} and ${entry.sourcePath}.`,\n file: entry.sourcePath,\n related: [{ file: existing.sourcePath, message: \"First route owner.\" }],\n });\n continue;\n }\n routeMap.set(entry.route, entry);\n absoluteMap.set(normalizeFs(entry.absolutePath), entry);\n sourceMap.set(entry.sourcePath, entry);\n sourceMap.set(entry.id, entry);\n entries.push(entry);\n }\n\n for (const entry of entries) {\n await transformEntry(entry, absoluteMap, routeMap, config, diagnostics);\n }\n validateNavigation(config.navigation.items ?? [], routeMap, diagnostics);\n\n entries.sort((left, right) => left.route.localeCompare(right.route));\n const routes: DocsRoute[] = entries.map((entry) => ({\n route: entry.route,\n entryId: entry.id,\n sourcePath: entry.sourcePath,\n title: entry.title,\n }));\n const assets = entries.flatMap((entry) => entry.assets);\n return {\n root,\n config,\n entries,\n routes,\n assets,\n diagnostics,\n entryByRoute(route) {\n return routeMap.get(normalizeRoute(route));\n },\n entryBySource(sourcePath) {\n return sourceMap.get(sourcePath);\n },\n };\n}\n\nasync function collectSources(\n root: string,\n config: NormalizedDocsConfig,\n lock: CreateDocsGraphOptions[\"lock\"],\n diagnostics: DocsDiagnostic[],\n): Promise<CollectedSource[]> {\n const declarations = config.content.sources?.length\n ? config.content.sources\n : await conventionSources(root);\n const results: CollectedSource[] = [];\n const identities = new Set<string>();\n\n for (const declaration of declarations) {\n try {\n const found = await collectDeclaration(root, declaration, config, lock);\n if (found.length === 0) {\n diagnostics.push({\n code: \"DOCS_SOURCE_NOT_FOUND\",\n severity: \"error\",\n message: `Source did not match any files: ${sourceLabel(declaration)}.`,\n });\n }\n for (const source of found) {\n const identity = normalizeFs(source.absolutePath);\n if (identities.has(identity)) continue;\n identities.add(identity);\n results.push(source);\n }\n } catch (error) {\n diagnostics.push({\n code:\n error instanceof OutsideRootError\n ? \"DOCS_SOURCE_OUTSIDE_ROOT\"\n : \"DOCS_SOURCE_NOT_FOUND\",\n severity: \"error\",\n message: errorMessage(error),\n });\n }\n }\n return results;\n}\n\nasync function conventionSources(root: string): Promise<DocsSource[]> {\n const sources: DocsSource[] = [];\n if (await isFile(resolve(root, \"README.md\")))\n sources.push({ file: \"README.md\", route: \"/\" });\n const docs = resolve(root, \"docs\");\n if (await isDirectory(docs)) {\n sources.push({ glob: \"docs/**/*.{md,mdx}\", base: \"docs\" });\n }\n return sources;\n}\n\nasync function collectDeclaration(\n root: string,\n declaration: DocsSource,\n config: NormalizedDocsConfig,\n lock: CreateDocsGraphOptions[\"lock\"],\n): Promise<CollectedSource[]> {\n if (\"package\" in declaration) {\n const packageLock = lockForSource(lock, declaration.package);\n const sourceRoot = await materializePackage(\n packageLock,\n config.build,\n root,\n );\n const discovery = await discoverPackage(sourceRoot);\n const patterns = declaration.include?.length\n ? declaration.include\n : discovery.pages;\n const files = declaration.include?.length\n ? await glob(patterns, {\n cwd: sourceRoot,\n onlyFiles: true,\n ignore: declaration.exclude ?? [],\n })\n : discovery.pages.filter(\n (path) => !(declaration.exclude ?? []).includes(path),\n );\n const index = declaration.index ?? discovery.home;\n return files\n .filter((path) =>\n MARKDOWN_EXTENSIONS.includes(extname(path).toLowerCase()),\n )\n .map((path) => ({\n absolutePath: resolve(sourceRoot, path),\n sourcePath: path,\n sourceRoot,\n route:\n path === index\n ? normalizeRoute(declaration.routeBase ?? \"/\")\n : routeForPath(path, \"docs\", declaration.routeBase),\n trust: declaration.trust ?? \"markdown\",\n packageLock,\n }));\n }\n\n if (\"file\" in declaration) {\n const absolutePath = resolveSourcePath(\n root,\n declaration.file,\n config.content.allowOutsideRoot,\n );\n if (!(await isFile(absolutePath))) return [];\n return [\n {\n absolutePath,\n sourcePath: toPosix(relative(root, absolutePath)),\n sourceRoot: root,\n ...(declaration.route ? { route: declaration.route } : {}),\n ...(declaration.title ? { title: declaration.title } : {}),\n ...(declaration.description\n ? { description: declaration.description }\n : {}),\n trust: \"mdx\",\n },\n ];\n }\n\n const patterns = Array.isArray(declaration.glob)\n ? declaration.glob\n : [declaration.glob];\n const paths = await glob(patterns, {\n cwd: root,\n onlyFiles: true,\n dot: false,\n ignore: [\"**/_*/**\", \"**/_*\", ...(declaration.exclude ?? [])],\n });\n return paths.map((path) => {\n const absolutePath = resolveSourcePath(\n root,\n path,\n config.content.allowOutsideRoot,\n );\n return {\n absolutePath,\n sourcePath: toPosix(relative(root, absolutePath)),\n sourceRoot: root,\n route: routeForPath(path, declaration.base, declaration.routeBase),\n trust: \"mdx\",\n };\n });\n}\n\nasync function readEntry(\n source: CollectedSource,\n config: NormalizedDocsConfig,\n diagnostics: DocsDiagnostic[],\n): Promise<DocsEntry | undefined> {\n if (\n extname(source.sourcePath).toLowerCase() === \".mdx\" &&\n source.trust !== \"mdx\"\n ) {\n diagnostics.push({\n code: \"DOCS_UNTRUSTED_MDX\",\n severity: \"error\",\n message: `Package MDX requires trust: 'mdx': ${source.sourcePath}.`,\n file: source.sourcePath,\n hint: \"Keep package sources in Markdown-safe mode or explicitly trust this locked artifact.\",\n });\n return undefined;\n }\n const original = await readFile(source.absolutePath, \"utf8\");\n const parsedMatter = matter(original);\n const frontmatter = parsedMatter.data as DocsFrontmatter;\n for (const key of Object.keys(parsedMatter.data)) {\n if (!FRONTMATTER_KEYS.has(key)) {\n diagnostics.push({\n code: \"DOCS_FRONTMATTER_INVALID\",\n severity: \"error\",\n message: `Unknown frontmatter key \"${key}\".`,\n file: source.sourcePath,\n });\n }\n }\n const parsed = parseMarkdown(parsedMatter.content);\n const route = normalizeRoute(\n frontmatter.slug ?? source.route ?? routeForPath(source.sourcePath),\n );\n const title =\n frontmatter.title ??\n source.title ??\n parsed.firstHeading ??\n titleFromFile(source.sourcePath);\n const description =\n frontmatter.description ?? source.description ?? parsed.description;\n const duplicateTitles = new Map<string, number>();\n for (const heading of parsed.headings) {\n const count = (duplicateTitles.get(heading.text) ?? 0) + 1;\n duplicateTitles.set(heading.text, count);\n if (count > 1) {\n diagnostics.push({\n code: \"DOCS_HEADING_DUPLICATE\",\n severity: \"warning\",\n message: `Repeated heading \"${heading.text}\" receives the generated ID \"${heading.slug}\".`,\n file: source.sourcePath,\n ...(heading.line ? { line: heading.line } : {}),\n });\n }\n }\n const idPrefix = source.packageLock?.resolved ?? \"local\";\n return {\n id: `${idPrefix}:${source.sourcePath}`,\n sourcePath: source.sourcePath,\n absolutePath: source.absolutePath,\n sourceRoot: source.sourceRoot,\n route,\n title,\n ...(description ? { description } : {}),\n frontmatter,\n headings: parsed.headings,\n body: parsedMatter.content,\n transformedBody: parsedMatter.content,\n ast: parsed.ast,\n links: [],\n assets: [],\n trust: source.trust,\n ...(source.packageLock\n ? {\n package: {\n requested: source.packageLock.requested,\n resolved: source.packageLock.resolved,\n },\n }\n : {}),\n };\n}\n\nasync function transformEntry(\n entry: DocsEntry,\n absoluteMap: Map<string, DocsEntry>,\n routeMap: Map<string, DocsEntry>,\n config: NormalizedDocsConfig,\n diagnostics: DocsDiagnostic[],\n): Promise<void> {\n const ast = cloneAst(entry.ast);\n if (config.markdown.stripLeadingBadges) stripLeadingBadgeBlock(ast);\n removeRenderedTitle(ast, entry.title);\n\n visit(ast, (node) => {\n if (node.type === \"html\" && entry.trust === \"markdown\") {\n const unsafe = /<\\s*script\\b|\\son[a-z]+\\s*=|javascript:/i.test(\n node.value,\n );\n if (unsafe) {\n diagnostics.push({\n code: \"DOCS_UNSAFE_HTML\",\n severity: \"error\",\n message: \"Script-capable HTML is not allowed in package Markdown.\",\n file: entry.sourcePath,\n ...(node.position?.start.line\n ? { line: node.position.start.line }\n : {}),\n });\n node.value = \"\";\n }\n }\n });\n\n const linkTasks: Promise<void>[] = [];\n visit(ast, (node) => {\n if (node.type === \"link\") {\n linkTasks.push(\n rewriteLink(node, entry, absoluteMap, routeMap, config, diagnostics),\n );\n } else if (node.type === \"image\") {\n linkTasks.push(rewriteAsset(node, entry, config, diagnostics));\n }\n });\n await Promise.all(linkTasks);\n entry.ast = ast;\n entry.transformedBody = serializeMarkdown(ast);\n}\n\nasync function rewriteLink(\n node: Link,\n entry: DocsEntry,\n absoluteMap: Map<string, DocsEntry>,\n routeMap: Map<string, DocsEntry>,\n config: NormalizedDocsConfig,\n diagnostics: DocsDiagnostic[],\n): Promise<void> {\n const reference: import(\"../types.js\").DocsReference = {\n original: node.url,\n ...lineData(node),\n };\n entry.links.push(reference);\n if (unsafeProtocol(node.url)) {\n diagnostic(\n diagnostics,\n \"DOCS_LINK_UNSAFE\",\n `Unsafe URL protocol: ${node.url}.`,\n entry,\n node,\n );\n return;\n }\n if (isExternal(node.url) || node.url.startsWith(\"#\")) return;\n const { pathname, query, fragment } = splitReference(node.url);\n if (pathname.startsWith(\"/\")) {\n const target = routeMap.get(normalizeRoute(pathname));\n if (!target) missingLink(diagnostics, entry, node, node.url, config);\n else validateFragment(fragment, target, entry, node, diagnostics, config);\n return;\n }\n const decoded = safeDecode(pathname);\n const targetPath = resolve(dirname(entry.absolutePath), decoded);\n if (!inside(entry.sourceRoot, targetPath)) {\n diagnostic(\n diagnostics,\n \"DOCS_SOURCE_OUTSIDE_ROOT\",\n `Link escapes its allowed source root: ${node.url}.`,\n entry,\n node,\n );\n return;\n }\n const target = findDocument(targetPath, absoluteMap);\n if (!target) {\n if (await isFile(targetPath)) return;\n missingLink(diagnostics, entry, node, node.url, config);\n return;\n }\n node.url = `${withBase(target.route, config.build.base)}${query}${fragment ? `#${fragment}` : \"\"}`;\n reference.resolved = node.url;\n reference.targetSource = target.sourcePath;\n if (fragment) reference.fragment = fragment;\n validateFragment(fragment, target, entry, node, diagnostics, config);\n}\n\nasync function rewriteAsset(\n node: Image,\n entry: DocsEntry,\n config: NormalizedDocsConfig,\n diagnostics: DocsDiagnostic[],\n): Promise<void> {\n const asset: DocsAsset = {\n original: node.url,\n ...lineData(node),\n };\n entry.assets.push(asset);\n if (isExternal(node.url)) return;\n if (unsafeProtocol(node.url)) {\n diagnostic(\n diagnostics,\n \"DOCS_ASSET_UNSAFE\",\n `Unsafe asset URL: ${node.url}.`,\n entry,\n node,\n );\n return;\n }\n const { pathname, query, fragment } = splitReference(node.url);\n const absolute = resolve(dirname(entry.absolutePath), safeDecode(pathname));\n if (!inside(entry.sourceRoot, absolute)) {\n diagnostic(\n diagnostics,\n \"DOCS_SOURCE_OUTSIDE_ROOT\",\n `Asset escapes its allowed source root: ${node.url}.`,\n entry,\n node,\n );\n return;\n }\n try {\n const info = await stat(absolute);\n if (!info.isFile()) throw new Error(\"not a file\");\n if (info.size > config.build.maxAssetBytes) {\n throw new Error(`asset exceeds ${config.build.maxAssetBytes} bytes`);\n }\n const hash = createHash(\"sha256\")\n .update(await readFile(absolute))\n .digest(\"hex\")\n .slice(0, 12);\n const publicPath = withBase(\n `/_tasty-assets/${hash}-${basename(absolute)}`,\n config.build.base,\n );\n node.url = `${publicPath}${query}${fragment ? `#${fragment}` : \"\"}`;\n Object.assign(asset, {\n resolved: node.url,\n sourcePath: absolute,\n publicPath,\n hash,\n bytes: info.size,\n });\n } catch (error) {\n diagnostic(\n diagnostics,\n \"DOCS_ASSET_NOT_FOUND\",\n `Asset not found or invalid: ${node.url} (${errorMessage(error)}).`,\n entry,\n node,\n );\n }\n}\n\nfunction findDocument(\n path: string,\n absoluteMap: Map<string, DocsEntry>,\n): DocsEntry | undefined {\n const candidates = [\n path,\n ...MARKDOWN_EXTENSIONS.map((extension) => `${path}${extension}`),\n ...MARKDOWN_EXTENSIONS.map((extension) =>\n resolve(path, `README${extension}`),\n ),\n ...MARKDOWN_EXTENSIONS.map((extension) =>\n resolve(path, `index${extension}`),\n ),\n ];\n for (const candidate of candidates) {\n const entry = absoluteMap.get(normalizeFs(candidate));\n if (entry) return entry;\n }\n return undefined;\n}\n\nfunction validateFragment(\n fragment: string,\n target: DocsEntry,\n source: DocsEntry,\n node: Link,\n diagnostics: DocsDiagnostic[],\n config: NormalizedDocsConfig,\n): void {\n if (!fragment) return;\n const decoded = safeDecode(fragment);\n if (!target.headings.some((heading) => heading.slug === decoded)) {\n diagnostics.push({\n code: \"DOCS_FRAGMENT_NOT_FOUND\",\n severity: config.build.ci ? \"error\" : \"warning\",\n message: `Heading fragment #${fragment} does not exist on ${target.route}.`,\n file: source.sourcePath,\n ...lineData(node),\n hint: `Known headings: ${target.headings.map((heading) => `#${heading.slug}`).join(\", \") || \"(none)\"}.`,\n });\n }\n}\n\nfunction missingLink(\n diagnostics: DocsDiagnostic[],\n entry: DocsEntry,\n node: Link,\n url: string,\n config: NormalizedDocsConfig,\n): void {\n diagnostics.push({\n code: \"DOCS_LINK_NOT_FOUND\",\n severity: config.build.strict ? \"error\" : \"warning\",\n message: `Internal link target not found: ${url}.`,\n file: entry.sourcePath,\n ...lineData(node),\n });\n}\n\nfunction validateNavigation(\n items: NavigationItem[],\n routes: Map<string, DocsEntry>,\n diagnostics: DocsDiagnostic[],\n): void {\n for (const item of items) {\n if (typeof item === \"string\") {\n if (!routes.has(normalizeRoute(item))) {\n diagnostics.push({\n code: \"DOCS_NAV_TARGET_NOT_FOUND\",\n severity: \"error\",\n message: `Navigation target does not exist: ${item}.`,\n });\n }\n } else if (\"items\" in item) {\n validateNavigation(item.items, routes, diagnostics);\n } else if (\n \"link\" in item &&\n item.link.startsWith(\"/\") &&\n !routes.has(normalizeRoute(item.link))\n ) {\n diagnostics.push({\n code: \"DOCS_NAV_TARGET_NOT_FOUND\",\n severity: \"error\",\n message: `Navigation target does not exist: ${item.link}.`,\n });\n }\n }\n}\n\nexport function normalizeRoute(route: string): string {\n const clean =\n route\n .split(/[?#]/, 1)[0]\n ?.replace(/\\\\/g, \"/\")\n .replace(/\\/{2,}/g, \"/\") ?? \"/\";\n const segments = clean.split(\"/\").filter(Boolean);\n if (segments.some((segment) => segment === \"..\"))\n throw new Error(`Route may not contain \"..\": ${route}.`);\n const normalized = `/${segments.join(\"/\")}`;\n return normalized === \"/\" ? \"/\" : normalized.replace(/\\/$/, \"\");\n}\n\nexport function routeForPath(\n path: string,\n base?: string,\n routeBase?: string,\n): string {\n let relativePath = toPosix(path);\n if (base) {\n const normalizedBase = toPosix(base)\n .replace(/^\\.\\//, \"\")\n .replace(/\\/$/, \"\");\n if (relativePath === normalizedBase) relativePath = \"\";\n else if (relativePath.startsWith(`${normalizedBase}/`))\n relativePath = relativePath.slice(normalizedBase.length + 1);\n }\n relativePath = relativePath.replace(/\\.(md|mdx)$/i, \"\");\n relativePath = relativePath\n .replace(/(^|\\/)README$/i, \"$1\")\n .replace(/(^|\\/)index$/i, \"$1\");\n return normalizeRoute(`${routeBase ?? \"\"}/${relativePath}`);\n}\n\nfunction resolveSourcePath(\n root: string,\n path: string,\n allowOutsideRoot: boolean,\n): string {\n const absolute = isAbsolute(path) ? resolve(path) : resolve(root, path);\n if (!allowOutsideRoot && !inside(root, absolute))\n throw new OutsideRootError(path);\n return absolute;\n}\n\nfunction inside(root: string, path: string): boolean {\n const rel = relative(resolve(root), resolve(path));\n return (\n rel === \"\" ||\n (!rel.startsWith(`..${sep}`) && rel !== \"..\" && !isAbsolute(rel))\n );\n}\n\nfunction splitReference(url: string): {\n pathname: string;\n query: string;\n fragment: string;\n} {\n const hashIndex = url.indexOf(\"#\");\n const fragment = hashIndex >= 0 ? url.slice(hashIndex + 1) : \"\";\n const withoutHash = hashIndex >= 0 ? url.slice(0, hashIndex) : url;\n const queryIndex = withoutHash.indexOf(\"?\");\n return {\n pathname: queryIndex >= 0 ? withoutHash.slice(0, queryIndex) : withoutHash,\n query: queryIndex >= 0 ? withoutHash.slice(queryIndex) : \"\",\n fragment,\n };\n}\n\nfunction isExternal(url: string): boolean {\n return /^(?:[a-z][a-z\\d+.-]*:|\\/\\/)/i.test(url);\n}\n\nfunction unsafeProtocol(url: string): boolean {\n return /^(?:javascript|vbscript|data):/i.test(url.trim());\n}\n\nfunction withBase(route: string, base: string): string {\n const normalizedBase =\n base === \"/\" ? \"\" : `/${base.replace(/^\\/+|\\/+$/g, \"\")}`;\n return `${normalizedBase}${normalizeRoute(route)}` || \"/\";\n}\n\nfunction titleFromFile(path: string): string {\n const raw = basename(path, extname(path)).replace(\n /^README$/i,\n basename(dirname(path)) || \"Documentation\",\n );\n return raw\n .replace(/[-_]+/g, \" \")\n .replace(/\\b\\w/g, (letter) => letter.toUpperCase());\n}\n\nfunction diagnostic(\n diagnostics: DocsDiagnostic[],\n code: string,\n message: string,\n entry: DocsEntry,\n node: PositionedNode,\n): void {\n diagnostics.push({\n code,\n severity: \"error\",\n message,\n file: entry.sourcePath,\n ...lineData(node),\n });\n}\n\ntype PositionedNode = { position?: { start: { line: number } } | undefined };\n\nfunction lineOf(node: PositionedNode): number | undefined {\n return node.position?.start.line;\n}\n\nfunction lineData(\n node: PositionedNode,\n): { line: number } | Record<string, never> {\n const line = lineOf(node);\n return line === undefined ? {} : { line };\n}\n\nfunction safeDecode(value: string): string {\n try {\n return decodeURIComponent(value);\n } catch {\n return value;\n }\n}\n\nfunction sourceLabel(source: DocsSource): string {\n if (\"file\" in source) return source.file;\n if (\"glob\" in source)\n return Array.isArray(source.glob) ? source.glob.join(\", \") : source.glob;\n return source.package;\n}\n\nfunction normalizeFs(path: string): string {\n return resolve(path);\n}\n\nfunction toPosix(path: string): string {\n return path.split(sep).join(\"/\");\n}\n\nasync function isFile(path: string): Promise<boolean> {\n try {\n return (await stat(path)).isFile();\n } catch {\n return false;\n }\n}\n\nasync function isDirectory(path: string): Promise<boolean> {\n try {\n return (await stat(path)).isDirectory();\n } catch {\n return false;\n }\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nclass OutsideRootError extends Error {\n constructor(path: string) {\n super(`Source path is outside the repository root: ${path}.`);\n this.name = \"OutsideRootError\";\n }\n}\n","import type { DocsDiagnostic, DocsGraph } from \"../types.js\";\n\nexport class DocsValidationError extends Error {\n readonly diagnostics: DocsDiagnostic[];\n\n constructor(diagnostics: DocsDiagnostic[]) {\n super(formatDiagnostics(diagnostics));\n this.name = \"DocsValidationError\";\n this.diagnostics = diagnostics;\n }\n}\n\nexport function validateDocs(graph: DocsGraph): DocsDiagnostic[] {\n return [...graph.diagnostics];\n}\n\nexport function assertValidDocs(graph: DocsGraph): void {\n const errors = graph.diagnostics.filter(\n (diagnostic) => diagnostic.severity === \"error\",\n );\n if (errors.length > 0) throw new DocsValidationError(errors);\n}\n\nexport function formatDiagnostics(\n diagnostics: DocsDiagnostic[],\n json = false,\n): string {\n if (json) return JSON.stringify(diagnostics, null, 2);\n return diagnostics\n .map((diagnostic) => {\n const location = diagnostic.file\n ? `${diagnostic.file}${diagnostic.line ? `:${diagnostic.line}` : \"\"}: `\n : \"\";\n const hint = diagnostic.hint ? `\\n hint: ${diagnostic.hint}` : \"\";\n return `${diagnostic.severity.toUpperCase()} ${diagnostic.code} ${location}${diagnostic.message}${hint}`;\n })\n .join(\"\\n\");\n}\n","import { createDocsGraph } from \"../graph/index.js\";\nimport { assertValidDocs } from \"../validation/index.js\";\nimport type {\n CreateDocsGraphOptions,\n DocsConfig,\n DocsEntry,\n} from \"../types.js\";\n\nexport interface DocsLoaderContext {\n store: {\n clear(): void;\n set(entry: {\n id: string;\n data: Record<string, unknown>;\n body: string;\n filePath?: string;\n }): void;\n };\n logger?: { info(message: string): void };\n parseData?: (input: {\n id: string;\n data: Record<string, unknown>;\n filePath?: string;\n }) => Promise<Record<string, unknown>>;\n}\n\nexport function createDocsLoader(\n config?: DocsConfig,\n options: Omit<CreateDocsGraphOptions, \"config\"> = {},\n) {\n return {\n name: \"@tenphi/docs\",\n async load(context: DocsLoaderContext): Promise<void> {\n const graph = await createDocsGraph({\n ...options,\n ...(config ? { config } : {}),\n });\n assertValidDocs(graph);\n context.store.clear();\n for (const entry of graph.entries) {\n const loaderEntry = toLoaderEntry(entry);\n const data = context.parseData\n ? await context.parseData({\n id: loaderEntry.id,\n data: loaderEntry.data,\n filePath: entry.sourcePath,\n })\n : loaderEntry.data;\n context.store.set({\n ...loaderEntry,\n data,\n filePath: entry.sourcePath,\n });\n }\n context.logger?.info(`Loaded ${graph.entries.length} Tasty Docs pages.`);\n },\n };\n}\n\nfunction toLoaderEntry(entry: DocsEntry): {\n id: string;\n data: Record<string, unknown>;\n body: string;\n} {\n return {\n id: entry.route === \"/\" ? \"index\" : entry.route.slice(1),\n data: {\n title: entry.title,\n draft: entry.frontmatter.draft ?? false,\n ...(entry.description ? { description: entry.description } : {}),\n ...entry.frontmatter,\n tastyDocs: {\n sourcePath: entry.sourcePath,\n route: entry.route,\n headings: entry.headings,\n },\n },\n body: entry.transformedBody,\n };\n}\n\nexport type { DocsEntry, DocsGraph, DocsRoute, DocsAsset } from \"../types.js\";\n"],"mappings":";;;;;;;;;;;;AAyBA,MAAM,mBAAmB;AACzB,MAAM,YAAY;AAOlB,eAAsB,mBACpB,WACA,UAAiC,CAAC,GACN;CAC5B,MAAM,SAAS,IAAI,SAAS;CAC5B,IAAI,CAAC;EAAC;EAAO;EAAW;CAAO,CAAC,CAAC,SAAS,OAAO,IAAI,GACnD,MAAM,IAAI,MACR,gEAAgE,OAAO,KAAK,GAC9E;CAEF,MAAM,WAAW,QAAQ,YAAY;CACrC,MAAM,WAAY,MAAM,OAAO,SAAS,WAAW;EACjD;EACA,GAAI,QAAQ,WAAW,EAAE,OAAO,QAAQ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