@intentius/chant 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/codegen/docs.ts +13 -2
package/package.json
CHANGED
package/src/codegen/docs.ts
CHANGED
|
@@ -46,6 +46,8 @@ export interface DocsConfig {
|
|
|
46
46
|
basePath?: string;
|
|
47
47
|
/** Root directory for resolving {{file:...}} markers in extra page content */
|
|
48
48
|
examplesDir?: string;
|
|
49
|
+
/** Extra sidebar entries appended after extraPages (supports Starlight groups) */
|
|
50
|
+
sidebarExtra?: Array<Record<string, unknown>>;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
export interface DocsResult {
|
|
@@ -285,8 +287,12 @@ export function writeDocsSite(config: DocsConfig, result: DocsResult): void {
|
|
|
285
287
|
const outDir = config.outDir;
|
|
286
288
|
const contentDir = join(outDir, "src", "content", "docs");
|
|
287
289
|
|
|
288
|
-
// Clear stale content and Astro caches so changes are picked up on next build
|
|
289
|
-
|
|
290
|
+
// Clear stale generated content and Astro caches so changes are picked up on next build.
|
|
291
|
+
// Only remove files that will be regenerated — preserve hand-written pages.
|
|
292
|
+
for (const filename of result.pages.keys()) {
|
|
293
|
+
const filePath = join(contentDir, filename);
|
|
294
|
+
rmSync(filePath, { force: true });
|
|
295
|
+
}
|
|
290
296
|
rmSync(join(outDir, ".astro"), { recursive: true, force: true });
|
|
291
297
|
rmSync(join(outDir, "node_modules", ".astro"), { recursive: true, force: true });
|
|
292
298
|
|
|
@@ -411,6 +417,11 @@ function buildSidebar(
|
|
|
411
417
|
items.push({ label: "Serialization", slug: "serialization" });
|
|
412
418
|
}
|
|
413
419
|
|
|
420
|
+
// Append raw sidebar entries (supports groups and nested items)
|
|
421
|
+
if (config.sidebarExtra) {
|
|
422
|
+
items.push(...config.sidebarExtra);
|
|
423
|
+
}
|
|
424
|
+
|
|
414
425
|
return items;
|
|
415
426
|
}
|
|
416
427
|
|