@takazudo/zudo-doc 10.0.0 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/theme-cli/config-io.d.ts +4 -0
- package/dist/theme-cli/config-io.js +3 -1
- package/dist/theme-cli/config-scanner.js +26 -5
- package/dist/theme-cli/list.d.ts +3 -0
- package/dist/theme-cli/list.js +11 -3
- package/dist/theme-packs/graphite/pack.css +1 -1
- package/dist/theme-packs/quiet-slate/pack.css +1 -1
- package/dist/theme-packs/warm-mineral/pack.css +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ 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.1] - 2026-11-11
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
- 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)
|
|
14
|
+
|
|
9
15
|
## [10.0.0] - 2026-11-10
|
|
10
16
|
|
|
11
17
|
### Breaking Changes
|
|
@@ -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)
|
|
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
|
|
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
|
-
|
|
50
|
-
|
|
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
|
|
84
|
+
if (c === "`") return skipTemplateLiteral(source, i);
|
|
64
85
|
return null;
|
|
65
86
|
}
|
|
66
87
|
function skipWhitespaceAndComments(source, i) {
|
package/dist/theme-cli/list.d.ts
CHANGED
|
@@ -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;
|
package/dist/theme-cli/list.js
CHANGED
|
@@ -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 {
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takazudo/zudo-doc",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.1",
|
|
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",
|
|
@@ -809,7 +809,7 @@
|
|
|
809
809
|
"typescript": "^5.0.0",
|
|
810
810
|
"vitest": "^4.1.12",
|
|
811
811
|
"zod": "^4.6.7",
|
|
812
|
-
"@takazudo/zudo-doc-history-server": "10.0.
|
|
812
|
+
"@takazudo/zudo-doc-history-server": "10.0.1"
|
|
813
813
|
},
|
|
814
814
|
"scripts": {
|
|
815
815
|
"gen:search-widget-script": "node scripts/gen-search-widget-script.mjs",
|