@takazudo/zudo-doc 10.0.0 → 10.0.2

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/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ The format is based on Keep a Changelog, and release notes are generated from th
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [10.0.2] - 2026-11-11
10
+
11
+ ### Other Changes
12
+
13
+ - The optional `diff` peer now admits `^8.0.0 || ^9.0.0`. (501d41ab)
14
+
15
+ ## [10.0.1] - 2026-11-11
16
+
17
+ ### Bug Fixes
18
+
19
+ - The theme CLI reads `themePack` next to interpolated template literals in `zfb.config.ts`. `${...}` spans stay opaque, so list and apply can still see a later `themePack`. An omitted `themePack` is reported as detected Graphite. A real config syntax error is printed instead of the generic unreadable fallback. Apply still refuses a value it cannot safely replace. (7e5c783b)
20
+
9
21
  ## [10.0.0] - 2026-11-10
10
22
 
11
23
  ### Breaking Changes
@@ -56,19 +56,19 @@ export declare function deriveNavDataPrep(ctx: ChromeContext): {
56
56
  buildLocaleLinksForNav: (currentPath: string, lang: string, localeCount: number) => import("../url-helpers/index.js").LocaleLink[] | undefined;
57
57
  buildSidebarNodes: (lang: string, navSection: string | undefined, currentVersion: string | undefined, emptyWhenUnsectioned?: boolean | undefined) => import("../sidebar/types.js").SidebarNavNode[];
58
58
  buildSidebarContext: (lang: string, navSection: string | undefined, currentVersion: string | undefined, emptyWhenUnsectioned?: boolean) => {
59
+ nodes: never[];
60
+ navigation: undefined;
61
+ } | {
59
62
  nodes: import("../sidebar/types.js").SidebarNavNode[];
60
63
  navigation: {
61
- id: string;
62
- roots: import("../sidebar/types.js").SidebarNavNode[];
63
64
  initialExpansion?: Record<string, "collapsed" | "expanded">;
64
65
  parents: Record<string, string | null>;
65
66
  localParentId?: string;
67
+ id: string;
68
+ roots: import("../sidebar/types.js").SidebarNavNode[];
66
69
  };
67
- } | {
68
- nodes: never[];
69
- navigation: undefined;
70
70
  };
71
- getThemeDefaultMode: () => "light" | "dark" | undefined;
71
+ getThemeDefaultMode: () => "dark" | "light" | undefined;
72
72
  };
73
73
  /** Derive the header SearchWidget: `ctx.hostBindings.SearchWidget` when the host
74
74
  * supplies one, else the package `SearchWidget` bound to the site base. */
@@ -42,9 +42,9 @@ export declare function buildDocsSchema(opts?: BuildDocsSchemaOptions): z.ZodObj
42
42
  collapsed: "collapsed";
43
43
  expanded: "expanded";
44
44
  }>>;
45
- tags: z.ZodOptional<z.ZodArray<z.ZodString>> | z.ZodOptional<z.ZodArray<z.ZodEnum<{
45
+ tags: z.ZodOptional<z.ZodArray<z.ZodEnum<{
46
46
  [x: string]: string;
47
- }>>>;
47
+ }>>> | z.ZodOptional<z.ZodArray<z.ZodString>>;
48
48
  search_exclude: z.ZodOptional<z.ZodBoolean>;
49
49
  pagination_next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
50
  pagination_prev: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -67,9 +67,9 @@ export declare function buildDocsSchema(opts?: BuildDocsSchemaOptions): z.ZodObj
67
67
  }>>;
68
68
  note_tray_dated: z.ZodOptional<z.ZodBoolean>;
69
69
  note_tray_sidebar: z.ZodOptional<z.ZodEnum<{
70
- year: "year";
71
- month: "month";
72
70
  index: "index";
71
+ month: "month";
72
+ year: "year";
73
73
  }>>;
74
74
  date: z.ZodOptional<z.ZodString>;
75
75
  updated: z.ZodOptional<z.ZodString>;
@@ -1,3 +1,3 @@
1
1
  export declare const contentType = "text/plain";
2
- declare const _default: () => string;
3
2
  export default _default;
3
+ declare function _default(): string;
@@ -6,6 +6,10 @@ export interface DetectActiveThemePackResult {
6
6
  * this scanner can confidently read — `slug` is then the documented
7
7
  * default, not a confirmed reading of the project's real config. */
8
8
  detected: boolean;
9
+ /** Set when the file exists but the scanner threw `ConfigSyntaxError`.
10
+ * Callers should show this message instead of the generic unreadable
11
+ * fallback. Absent when the file is simply missing or non-canonical. */
12
+ syntaxError?: string;
9
13
  }
10
14
  /**
11
15
  * Best-effort read of the project's configured `themePack` slug. Never
@@ -64,7 +64,9 @@ async function detectActiveThemePack(cwd) {
64
64
  const slug = unquoteStringLiteralSpan(source, themePackMember.valueStart, themePackMember.valueEnd);
65
65
  return { slug: resolveThemePackAlias(slug), detected: true };
66
66
  } catch (err) {
67
- if (err instanceof ConfigSyntaxError) return fallback;
67
+ if (err instanceof ConfigSyntaxError) {
68
+ return { ...fallback, syntaxError: err.message };
69
+ }
68
70
  throw err;
69
71
  }
70
72
  }
@@ -36,7 +36,29 @@ function skipStringLiteral(source, i) {
36
36
  }
37
37
  throw new ConfigSyntaxError(`unterminated string literal (${quote}...) in zfb.config.ts`);
38
38
  }
39
- function skipSimpleTemplateLiteral(source, i) {
39
+ function skipTemplateInterpolation(source, openBrace) {
40
+ let depth = 1;
41
+ let i = openBrace + 1;
42
+ while (i < source.length) {
43
+ const skip = trySkipToken(source, i);
44
+ if (skip !== null) {
45
+ i = skip;
46
+ continue;
47
+ }
48
+ const c = source[i];
49
+ if (c === "{") {
50
+ depth++;
51
+ } else if (c === "}") {
52
+ depth--;
53
+ if (depth === 0) return i + 1;
54
+ }
55
+ i++;
56
+ }
57
+ throw new ConfigSyntaxError(
58
+ "unterminated template literal interpolation (`${...}`) in zfb.config.ts"
59
+ );
60
+ }
61
+ function skipTemplateLiteral(source, i) {
40
62
  let j = i + 1;
41
63
  while (j < source.length) {
42
64
  const c = source[j];
@@ -46,9 +68,8 @@ function skipSimpleTemplateLiteral(source, i) {
46
68
  }
47
69
  if (c === "`") return j + 1;
48
70
  if (c === "$" && source[j + 1] === "{") {
49
- throw new ConfigSyntaxError(
50
- "template literal interpolation (`${...}`) in zfb.config.ts is not supported by the theme CLI's config parser"
51
- );
71
+ j = skipTemplateInterpolation(source, j + 1);
72
+ continue;
52
73
  }
53
74
  j++;
54
75
  }
@@ -60,7 +81,7 @@ function trySkipToken(source, i) {
60
81
  if (c === "/" && c2 === "/") return skipLineComment(source, i);
61
82
  if (c === "/" && c2 === "*") return skipBlockComment(source, i);
62
83
  if (c === '"' || c === "'") return skipStringLiteral(source, i);
63
- if (c === "`") return skipSimpleTemplateLiteral(source, i);
84
+ if (c === "`") return skipTemplateLiteral(source, i);
64
85
  return null;
65
86
  }
66
87
  function skipWhitespaceAndComments(source, i) {
@@ -13,6 +13,9 @@ export interface ThemeListResult {
13
13
  /** `false` when the active slug is a fallback (zfb.config.ts missing or
14
14
  * not confidently parseable) rather than a confirmed reading. */
15
15
  activeDetected: boolean;
16
+ /** Scanner failure from `zfb.config.ts`, when parsing threw rather than
17
+ * merely finding no readable `themePack` field. */
18
+ syntaxError?: string;
16
19
  }
17
20
  export interface ListThemePacksOptions extends LoadInstalledThemePackCatalogOptions {
18
21
  cwd?: string;
@@ -6,7 +6,11 @@ import {
6
6
  async function listThemePacks(options = {}) {
7
7
  const cwd = options.cwd ?? process.cwd();
8
8
  const catalog = loadInstalledThemePackCatalog(options);
9
- const { slug: activeSlug, detected: activeDetected } = await detectActiveThemePack(cwd);
9
+ const {
10
+ slug: activeSlug,
11
+ detected: activeDetected,
12
+ syntaxError
13
+ } = await detectActiveThemePack(cwd);
10
14
  const rows = catalog.map((entry) => ({
11
15
  slug: entry.slug,
12
16
  name: entry.meta.name,
@@ -15,13 +19,13 @@ async function listThemePacks(options = {}) {
15
19
  description: entry.meta.description,
16
20
  active: entry.slug === activeSlug
17
21
  }));
18
- return { rows, activeSlug, activeDetected };
22
+ return { rows, activeSlug, activeDetected, syntaxError };
19
23
  }
20
24
  function padEnd(text, width) {
21
25
  return text.length >= width ? text : text + " ".repeat(width - text.length);
22
26
  }
23
27
  function formatThemeList(result) {
24
- const { rows, activeSlug, activeDetected } = result;
28
+ const { rows, activeSlug, activeDetected, syntaxError } = result;
25
29
  if (rows.length === 0) {
26
30
  return pc.yellow("No theme packs found in the installed @takazudo/zudo-doc package.");
27
31
  }
@@ -47,6 +51,10 @@ function formatThemeList(result) {
47
51
  lines.push("");
48
52
  if (activeDetected) {
49
53
  lines.push(`Active theme pack: ${pc.bold(activeSlug)}`);
54
+ } else if (syntaxError) {
55
+ lines.push(
56
+ pc.dim(`Active theme pack: ${activeSlug} (assumed default \u2014 ${syntaxError})`)
57
+ );
50
58
  } else {
51
59
  lines.push(
52
60
  pc.dim(
@@ -14,7 +14,7 @@
14
14
  hover bg inactive navigation hover fill
15
15
  active bg current navigation fill (90% bg + 10% accent)
16
16
  state bgs admonition fills (90% bg + 10% state colour)
17
- Classic (the reserved "default" pack) shares one muted role for
17
+ Classic (slug "classic") shares one muted role for
18
18
  text, borders and comments; these packs keep muted at readable
19
19
  text contrast and give decorative rules their own quieter line.
20
20
 
@@ -14,7 +14,7 @@
14
14
  hover bg inactive navigation hover fill
15
15
  active bg current navigation fill (90% bg + 10% accent)
16
16
  state bgs admonition fills (90% bg + 10% state colour)
17
- Classic (the reserved "default" pack) shares one muted role for
17
+ Classic (slug "classic") shares one muted role for
18
18
  text, borders and comments; these packs keep muted at readable
19
19
  text contrast and give decorative rules their own quieter line.
20
20
 
@@ -14,7 +14,7 @@
14
14
  hover bg inactive navigation hover fill
15
15
  active bg current navigation fill (90% bg + 10% accent)
16
16
  state bgs admonition fills (90% bg + 10% state colour)
17
- Classic (the reserved "default" pack) shares one muted role for
17
+ Classic (slug "classic") shares one muted role for
18
18
  text, borders and comments; these packs keep muted at readable
19
19
  text contrast and give decorative rules their own quieter line.
20
20
 
@@ -13,8 +13,8 @@ export declare const themePackMetaSchema: z.ZodObject<{
13
13
  name: z.ZodString;
14
14
  description: z.ZodString;
15
15
  mode: z.ZodEnum<{
16
- light: "light";
17
16
  dark: "dark";
17
+ light: "light";
18
18
  }>;
19
19
  version: z.ZodString;
20
20
  fonts: z.ZodObject<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takazudo/zudo-doc",
3
- "version": "10.0.0",
3
+ "version": "10.0.2",
4
4
  "type": "module",
5
5
  "description": "zudo-doc framework primitives layer that sits on top of zfb's engine — sidebar, theme, TOC, breadcrumb, layouts, head injection, View Transitions, SSR-skip wrappers (per ADR-003).",
6
6
  "license": "MIT",
@@ -757,7 +757,7 @@
757
757
  "@takazudo/zfb-md-wasm": "^6.0.1",
758
758
  "@takazudo/zfb-runtime": "^6.0.1",
759
759
  "@takazudo/zudo-doc-history-server": "^10.0.0",
760
- "diff": "^8.0.0",
760
+ "diff": "^8.0.0 || ^9.0.0",
761
761
  "katex": "^0.18.2 || ^0.19.0",
762
762
  "zod": "^4.3.6"
763
763
  },
@@ -786,7 +786,7 @@
786
786
  "esbuild": "^0.28.2",
787
787
  "fs-extra": "^11.4.1",
788
788
  "minimist": "^1.2.8",
789
- "parse5": "^8.0.1",
789
+ "parse5": "^8.1.1",
790
790
  "picocolors": "^1.1.1",
791
791
  "pluralize": "^8.0.0",
792
792
  "smol-toml": "^1.9.1",
@@ -801,15 +801,17 @@
801
801
  "@takazudo/zfb-runtime": "6.0.1",
802
802
  "@types/fs-extra": "^11.0.4",
803
803
  "@types/minimist": "^1.2.5",
804
- "@types/node": "^25.9.9",
804
+ "@types/node": "^26.6.6",
805
805
  "@types/pluralize": "^0.0.33",
806
+ "diff8": "npm:diff@8.0.4",
806
807
  "happy-dom": "^21.0.4",
807
808
  "katex": "^0.19.1",
809
+ "@typescript/typescript6": "^6.0.2",
808
810
  "tsup": "^9.0.0",
809
- "typescript": "^5.0.0",
811
+ "typescript": "^7.0.2",
810
812
  "vitest": "^4.1.12",
811
813
  "zod": "^4.6.7",
812
- "@takazudo/zudo-doc-history-server": "10.0.0"
814
+ "@takazudo/zudo-doc-history-server": "10.0.2"
813
815
  },
814
816
  "scripts": {
815
817
  "gen:search-widget-script": "node scripts/gen-search-widget-script.mjs",