@takazudo/zudo-doc 4.4.13 → 5.0.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.
Files changed (86) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/dist/category-nav/index.d.ts +31 -0
  3. package/dist/category-nav/index.js +15 -3
  4. package/dist/category-tree-nav/index.d.ts +32 -0
  5. package/dist/category-tree-nav/index.js +16 -4
  6. package/dist/chrome/derive.d.ts +32 -3
  7. package/dist/chrome/derive.js +26 -7
  8. package/dist/code-syntax/mermaid-init-script.d.ts +6 -7
  9. package/dist/config.d.ts +22 -5
  10. package/dist/config.js +11 -0
  11. package/dist/content.css +1 -0
  12. package/dist/desktop-toc-toggle-island/index.d.ts +7 -0
  13. package/dist/desktop-toc-toggle-island/index.js +64 -0
  14. package/dist/doc-page-renderer/index.d.ts +12 -1
  15. package/dist/doc-page-renderer/index.js +10 -3
  16. package/dist/doc-page-shell/index.d.ts +13 -0
  17. package/dist/doc-page-shell/index.js +37 -3
  18. package/dist/doclayout/doc-layout.d.ts +14 -0
  19. package/dist/doclayout/doc-layout.js +4 -2
  20. package/dist/features.css +82 -10
  21. package/dist/head-with-defaults/index.js +1 -0
  22. package/dist/header/header.d.ts +1 -1
  23. package/dist/header/header.js +2 -2
  24. package/dist/header/types.d.ts +7 -0
  25. package/dist/header-with-defaults/index.d.ts +2 -0
  26. package/dist/header-with-defaults/index.js +9 -2
  27. package/dist/i18n-version/version-switcher.d.ts +36 -0
  28. package/dist/i18n-version/version-switcher.js +43 -3
  29. package/dist/inline-version-switcher/index.d.ts +18 -0
  30. package/dist/inline-version-switcher/index.js +3 -1
  31. package/dist/mdx-components/index.d.ts +11 -0
  32. package/dist/mdx-components/index.js +4 -4
  33. package/dist/nav-data-prep/index.d.ts +18 -3
  34. package/dist/nav-data-prep/index.js +3 -3
  35. package/dist/plugins/internal/claude-resources/generate.d.ts +11 -0
  36. package/dist/plugins/internal/claude-resources/generate.js +16 -13
  37. package/dist/plugins/internal/claude-resources/index.js +6 -1
  38. package/dist/preset.d.ts +16 -7
  39. package/dist/preset.js +8 -6
  40. package/dist/routes/_context.d.ts +1 -1
  41. package/dist/safelist.css +1 -1
  42. package/dist/settings.d.ts +17 -2
  43. package/dist/site-tree-nav/index.d.ts +21 -0
  44. package/dist/site-tree-nav/index.js +26 -7
  45. package/dist/theme-packs/academia/meta.json +1 -1
  46. package/dist/theme-packs/academia/pack.css +13 -3
  47. package/dist/theme-packs/blueprint/meta.json +1 -1
  48. package/dist/theme-packs/blueprint/pack.css +9 -0
  49. package/dist/theme-packs/broadsheet/meta.json +1 -1
  50. package/dist/theme-packs/broadsheet/pack.css +9 -0
  51. package/dist/theme-packs/drift/meta.json +1 -1
  52. package/dist/theme-packs/drift/pack.css +9 -0
  53. package/dist/theme-packs/fjord/meta.json +1 -1
  54. package/dist/theme-packs/fjord/pack.css +9 -0
  55. package/dist/theme-packs/hearth/meta.json +1 -1
  56. package/dist/theme-packs/hearth/pack.css +9 -0
  57. package/dist/theme-packs/hollow/meta.json +1 -1
  58. package/dist/theme-packs/hollow/pack.css +9 -0
  59. package/dist/theme-packs/matcha/meta.json +1 -1
  60. package/dist/theme-packs/matcha/pack.css +9 -0
  61. package/dist/theme-packs/nocturne/meta.json +1 -1
  62. package/dist/theme-packs/nocturne/pack.css +9 -0
  63. package/dist/theme-packs/observatory/meta.json +1 -1
  64. package/dist/theme-packs/observatory/pack.css +18 -0
  65. package/dist/theme-packs/onyx/meta.json +1 -1
  66. package/dist/theme-packs/onyx/pack.css +9 -0
  67. package/dist/theme-packs/sakura/meta.json +1 -1
  68. package/dist/theme-packs/sakura/pack.css +9 -0
  69. package/dist/theme-packs/sumi/meta.json +1 -1
  70. package/dist/theme-packs/sumi/pack.css +9 -0
  71. package/dist/theme-packs/timberline/meta.json +1 -1
  72. package/dist/theme-packs/timberline/pack.css +9 -0
  73. package/dist/theme-packs-registry/validator.js +38 -6
  74. package/dist/toc-prepaint/index.d.ts +60 -0
  75. package/dist/toc-prepaint/index.js +44 -0
  76. package/dist/url-helpers/index.d.ts +1 -1
  77. package/dist/url-helpers/index.js +2 -2
  78. package/dist/version-availability/index.d.ts +75 -0
  79. package/dist/version-availability/index.js +56 -0
  80. package/dist/versions-page/index.d.ts +9 -1
  81. package/dist/versions-page/index.js +6 -2
  82. package/eject/header/header.tsx +3 -2
  83. package/eject/header/types.ts +7 -0
  84. package/package.json +17 -10
  85. package/tsconfig.base.json +2 -1
  86. package/zfb-config-shim.d.ts +22 -204
@@ -0,0 +1,56 @@
1
+ function createGetUnavailableVersions(deps) {
2
+ const availableSlugCache = /* @__PURE__ */ new Map();
3
+ function getAvailableSlugs(locale, versionSlug) {
4
+ const key = `${locale}
5
+ ${versionSlug}`;
6
+ const cached = availableSlugCache.get(key);
7
+ if (cached) return cached;
8
+ const { docs, navDocs, categoryMeta } = deps.resolveNavSource(locale, versionSlug, {
9
+ applyDefaultLocaleOnlyFilter: true,
10
+ keepUnlisted: true
11
+ });
12
+ const slugs = /* @__PURE__ */ new Set();
13
+ for (const d of docs) {
14
+ if (d.data.category_no_page === true) continue;
15
+ slugs.add(d.data.slug ?? deps.toRouteSlug(d.slug));
16
+ }
17
+ const tree = deps.buildNavTree(navDocs, locale, categoryMeta);
18
+ for (const node of deps.collectAutoIndexNodes(tree)) {
19
+ slugs.add(node.slug);
20
+ }
21
+ availableSlugCache.set(key, slugs);
22
+ return slugs;
23
+ }
24
+ return function getUnavailableVersions(slug, locale) {
25
+ if (slug === void 0) return void 0;
26
+ if (!deps.versions || deps.versions.length === 0) return void 0;
27
+ const unavailable = /* @__PURE__ */ new Set();
28
+ for (const v of deps.versions) {
29
+ if (!getAvailableSlugs(locale, v.slug).has(slug)) {
30
+ unavailable.add(v.slug);
31
+ }
32
+ }
33
+ return unavailable;
34
+ };
35
+ }
36
+ const UNAVAILABLE_VERSIONS_ATTR = "data-doc-unavailable-versions";
37
+ function serializeUnavailableVersions(unavailableVersions) {
38
+ if (unavailableVersions === void 0) return {};
39
+ return { [UNAVAILABLE_VERSIONS_ATTR]: Array.from(unavailableVersions).sort().join(",") };
40
+ }
41
+ function assertNoCommaInVersionSlugs(versions) {
42
+ if (!versions) return;
43
+ for (const v of versions) {
44
+ if (v.slug.includes(",")) {
45
+ throw new TypeError(
46
+ `Invalid version slug "${v.slug}": version slugs must not contain commas (commas are the delimiter in the version-switcher's client-side availability payload \u2014 see version-availability/index.ts).`
47
+ );
48
+ }
49
+ }
50
+ }
51
+ export {
52
+ UNAVAILABLE_VERSIONS_ATTR,
53
+ assertNoCommaInVersionSlugs,
54
+ createGetUnavailableVersions,
55
+ serializeUnavailableVersions
56
+ };
@@ -15,6 +15,11 @@ export interface VersionsPageSettings {
15
15
  dynamicPageTransition?: boolean;
16
16
  versions: VersionsPageVersionEntry[] | false;
17
17
  base: string;
18
+ /**
19
+ * Route slug of the doc page linked as "latest docs" / each version's docs
20
+ * entry point. Defaults to `"getting-started"` when omitted.
21
+ */
22
+ entryDocSlug?: string;
18
23
  }
19
24
  /** Host-supplied component bindings injected into the versions page factory. */
20
25
  export interface VersionsPageComponents {
@@ -32,7 +37,10 @@ export interface VersionsPageComponents {
32
37
  basePath: string;
33
38
  }) => JSX.Element;
34
39
  }
35
- /** Injected dependencies for {@link createVersionsPageView}. */
40
+ /**
41
+ * Legacy shape, unused by createVersionsPageView — reads ChromeContext
42
+ * directly; do not extend.
43
+ */
36
44
  export interface VersionsPageDeps {
37
45
  settings: VersionsPageSettings;
38
46
  /** Default locale code (e.g. `"en"`). */
@@ -12,6 +12,7 @@ function createVersionsPageView(ctx) {
12
12
  const defaultLocale = ctx.defaultLocale;
13
13
  const t = ctx.t;
14
14
  const withBase = ctx.withBase;
15
+ const isDefaultLocaleOnlyPath = ctx.isDefaultLocaleOnlyPath;
15
16
  const composeMetaTitle = deriveComposeMetaTitle(ctx);
16
17
  const HeadWithDefaults = createHeadWithDefaults(ctx);
17
18
  const { Header: HeaderWithDefaults, Footer: FooterWithDefaults } = derivePrimaryChromeSlots(ctx);
@@ -37,13 +38,16 @@ function createVersionsPageView(ctx) {
37
38
  statusCol: t("version.page.status", locale),
38
39
  docsCol: t("version.page.docs", locale)
39
40
  };
40
- const latestHref = withBase(`${prefix}/docs/getting-started`);
41
+ const entryDocSlug = settings.entryDocSlug ?? "getting-started";
42
+ const entryDocPath = `/docs/${entryDocSlug}`;
43
+ const entryDocPrefix = isDefaultLocaleOnlyPath(entryDocPath) ? "" : prefix;
44
+ const latestHref = withBase(`${entryDocPrefix}${entryDocPath}`);
41
45
  const versions = settings.versions ? settings.versions.map((v) => ({
42
46
  slug: v.slug,
43
47
  label: v.label ?? v.slug,
44
48
  // Version prefix comes BEFORE the locale — the only routed shape is
45
49
  // pages/v/[version]/{locale}/docs/...; /{locale}/v/... has no route.
46
- docsHref: withBase(`/v/${v.slug}${prefix}/docs/getting-started/`),
50
+ docsHref: withBase(`/v/${v.slug}${entryDocPrefix}/docs/${entryDocSlug}/`),
47
51
  banner: v.banner
48
52
  })) : [];
49
53
  return /* @__PURE__ */ jsx(
@@ -76,6 +76,7 @@ export interface HeaderUrlHelpers {
76
76
  path: string,
77
77
  lang?: Locale,
78
78
  currentVersion?: string,
79
+ versioned?: boolean,
79
80
  ): string;
80
81
  }
81
82
 
@@ -444,7 +445,7 @@ function renderNavItem(
444
445
  const isActive =
445
446
  isNavItemActiveByCategory(item, activeCategory) ||
446
447
  isNavItemActive(item, activeNavPath);
447
- const href = urlHelpers.navHref(item.path, lang, currentVersion);
448
+ const href = urlHelpers.navHref(item.path, lang, currentVersion, item.versioned);
448
449
  const label = item.labelKey ? i18n.t(item.labelKey, lang) : item.label;
449
450
 
450
451
  if (item.children && item.children.length > 0) {
@@ -488,7 +489,7 @@ function renderNavItem(
488
489
  <div class="absolute left-0 top-full z-dropdown hidden group-hover:block group-focus-within:block pt-vsp-3xs">
489
490
  <div class="min-w-[10rem] border border-muted rounded bg-surface shadow-lg py-vsp-3xs">
490
491
  {item.children.map((child) => {
491
- const childHref = urlHelpers.navHref(child.path, lang, currentVersion);
492
+ const childHref = urlHelpers.navHref(child.path, lang, currentVersion, child.versioned);
492
493
  const childLabel = child.labelKey
493
494
  ? i18n.t(child.labelKey, lang)
494
495
  : child.label;
@@ -26,6 +26,13 @@ export interface HeaderNavChildItem {
26
26
  labelKey?: string;
27
27
  path: string;
28
28
  categoryMatch?: string;
29
+ /**
30
+ * Whether links built from this item's `path` carry the active `/v/{version}`
31
+ * prefix. `false` targets a route that has no versioned counterpart, so its
32
+ * href must stay unversioned even when rendered under an active version.
33
+ * Default `true`.
34
+ */
35
+ versioned?: boolean;
29
36
  }
30
37
 
31
38
  export interface HeaderNavItem extends HeaderNavChildItem {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takazudo/zudo-doc",
3
- "version": "4.4.13",
3
+ "version": "5.0.0",
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",
@@ -227,6 +227,14 @@
227
227
  "types": "./dist/home-page/index.d.ts",
228
228
  "default": "./dist/home-page/index.js"
229
229
  },
230
+ "./desktop-toc-toggle-island": {
231
+ "types": "./dist/desktop-toc-toggle-island/index.d.ts",
232
+ "default": "./dist/desktop-toc-toggle-island/index.js"
233
+ },
234
+ "./toc-prepaint": {
235
+ "types": "./dist/toc-prepaint/index.d.ts",
236
+ "default": "./dist/toc-prepaint/index.js"
237
+ },
230
238
  "./theme.css": "./dist/theme.css",
231
239
  "./safelist.css": "./dist/safelist.css",
232
240
  "./content.css": "./dist/content.css",
@@ -598,10 +606,10 @@
598
606
  ],
599
607
  "peerDependencies": {
600
608
  "@takazudo/zdtp": "^0.4.9",
601
- "@takazudo/zfb": "^0.1.0-next.99",
602
- "@takazudo/zfb-md-wasm": "^0.1.0-next.99",
603
- "@takazudo/zfb-runtime": "^0.1.0-next.99",
604
- "@takazudo/zudo-doc-history-server": "^4.4.11",
609
+ "@takazudo/zfb": "^2.1.0",
610
+ "@takazudo/zfb-md-wasm": "^2.1.0",
611
+ "@takazudo/zfb-runtime": "^2.1.0",
612
+ "@takazudo/zudo-doc-history-server": "^5.0.0",
605
613
  "diff": "^8.0.0",
606
614
  "katex": "^0.16.0",
607
615
  "preact": "^10.29.1",
@@ -635,15 +643,14 @@
635
643
  "tsx": "^4.21.0"
636
644
  },
637
645
  "devDependencies": {
638
- "@takazudo/zfb": "0.1.0-next.99",
639
- "@takazudo/zfb-md-wasm": "0.1.0-next.99",
640
- "@takazudo/zfb-runtime": "0.1.0-next.99",
646
+ "@takazudo/zfb": "2.1.0",
647
+ "@takazudo/zfb-md-wasm": "2.1.0",
648
+ "@takazudo/zfb-runtime": "2.1.0",
641
649
  "@types/fs-extra": "^11.0.4",
642
650
  "@types/minimist": "^1.2.5",
643
651
  "@types/node": "^25.3.5",
644
652
  "@types/pluralize": "^0.0.33",
645
653
  "@types/string-similarity": "^4.0.2",
646
- "cross-env": "^7.0.3",
647
654
  "happy-dom": "^20.10.6",
648
655
  "npm-run-all2": "^7.0.2",
649
656
  "preact": "^10.29.1",
@@ -652,7 +659,7 @@
652
659
  "typescript": "^5.0.0",
653
660
  "vitest": "^4.1.0",
654
661
  "zod": "^4.3.6",
655
- "@takazudo/zudo-doc-history-server": "4.4.13"
662
+ "@takazudo/zudo-doc-history-server": "5.0.0"
656
663
  },
657
664
  "scripts": {
658
665
  "build": "tsup && tsc -p tsconfig.build.json",
@@ -13,7 +13,8 @@
13
13
  "esModuleInterop": true,
14
14
  "skipLibCheck": true,
15
15
  "allowJs": true,
16
- "jsx": "preserve",
16
+ "jsx": "react-jsx",
17
+ "jsxImportSource": "preact",
17
18
  "strict": true,
18
19
  "noImplicitAny": true,
19
20
  "strictNullChecks": true,
@@ -1,210 +1,28 @@
1
- // Package-shipped type shim for the bare `zfb/config` specifier (#2656).
1
+ // Package-shipped type shim for the bare `zfb/config` specifier (#2656, #3237).
2
2
  //
3
- // `@takazudo/zfb` is consumed as a published npm package. The package
4
- // exposes its real config types under the *scoped* subpath
5
- // `@takazudo/zfb/config` `dist/config.d.ts`. But `zfb.config.ts` imports
6
- // from the *bare* specifier `zfb/config`, which zfb's build tool aliases to
7
- // a runtime-only stub at parse time (`zfb-config-stub.mjs` `defineConfig`
8
- // is identity, carrying no types). No real file backs `zfb/config` in
9
- // `node_modules`, so this ambient declaration is what supplies the
10
- // `ZfbConfig` type to `zfb.config.ts`.
3
+ // `zfb.config.ts` imports from the *bare* specifier `zfb/config`, which zfb's
4
+ // config loader aliases to a runtime-only stub at parse time
5
+ // (`zfb-config-stub.mjs` `defineConfig` is identity, carrying no types). No
6
+ // real file backs `zfb/config` in `node_modules`, so an ambient declaration is
7
+ // what supplies its type. An ambient `declare module` wins over node
8
+ // resolution AND over tsconfig `paths`, so this file not any `paths` entry —
9
+ // is what `zfb check` (plain `tsc --noEmit`) binds `zfb.config.ts` against.
11
10
  //
12
- // Pulled into a consuming project via `tsconfig.base.json`'s
13
- // `files: ["./zfb-config-shim.d.ts", "./virtual-modules.d.ts"]` a project
14
- // extending the base no longer needs its own local `zfb-shim.d.ts`.
11
+ // It re-exports the real, installed `@takazudo/zfb/config` rather than
12
+ // restating its shape. There is NO hand-sync duty: this file tracks whatever
13
+ // `@takazudo/zfb` version the consumer has installed, automatically. The
14
+ // previous hand-copied field list drifted twice — `bundle`
15
+ // (Takazudo/zudo-front-builder#678 + zudolab/zudo-doc#1834) and then 12
16
+ // top-level fields including `copyPublicWithBase` (#3237) — each drift
17
+ // surfacing as a TS2353 on a config field the engine already honoured.
18
+ //
19
+ // Do NOT add a top-level `import`/`export` to this file: that would turn it
20
+ // into a module and the `declare module` would stop being ambient. The
21
+ // `export *` must stay INSIDE the block.
15
22
  //
16
- // IMPORTANT this block is the source of truth for the type `zfb check`
17
- // (plain `tsc --noEmit`) binds against the config. An ambient `declare
18
- // module` wins over node resolution AND over tsconfig `paths`, so it must
19
- // be kept in sync BY HAND with the published `@takazudo/zfb/config`
20
- // (`dist/config.d.ts`). When it lags the engine, valid config fields fail
21
- // `pnpm check` with TS2353 (see Takazudo/zudo-front-builder#678 +
22
- // zudolab/zudo-doc#1834 — `bundle` was missing here, blocking next.22's
23
- // `bundle.exclude`). See `packages/zudo-doc/CLAUDE.md` ("Shipped ambient
24
- // type shims") for the hand-sync duty this file carries.
23
+ // Pulled into a consuming project via `tsconfig.base.json`'s
24
+ // `files: ["./zfb-config-shim.d.ts", "./virtual-modules.d.ts"]`.
25
25
 
26
26
  declare module "zfb/config" {
27
- /** JSX framework runtime. */
28
- export type Framework = "preact" | "react";
29
-
30
- /** A content collection registered with the zfb engine. */
31
- export interface CollectionDef {
32
- /** Identifier used at the call site (e.g. `"docs"`). */
33
- name: string;
34
- /** Directory (relative to the project root) holding the entries. */
35
- path: string;
36
- /**
37
- * Optional schema. Reserved for v1.1 — accepted but not enforced
38
- * today. Authored as zod and converted to JSON Schema via
39
- * `z.toJSONSchema()` at the boundary.
40
- */
41
- schema?: Record<string, unknown>;
42
- }
43
-
44
- /** Tailwind options; absent = defaults. */
45
- export interface TailwindConfig {
46
- enabled?: boolean;
47
- }
48
-
49
- /** User-supplied plugin configuration entry. */
50
- export interface PluginConfig {
51
- name: string;
52
- options?: Record<string, unknown>;
53
- }
54
-
55
- /** Output mode for zfb fenced-code highlighting. */
56
- export type CodeHighlightMode = "inline" | "class";
57
-
58
- /** Fixed semantic taxonomy accepted by class-mode `roleClasses`. */
59
- export type CodeHighlightRole =
60
- | "escape"
61
- | "operator"
62
- | "comment"
63
- | "string"
64
- | "number"
65
- | "constant"
66
- | "keyword"
67
- | "function"
68
- | "type"
69
- | "namespace"
70
- | "property"
71
- | "variable"
72
- | "tag"
73
- | "attribute"
74
- | "punctuation"
75
- | "inserted"
76
- | "deleted"
77
- | "heading";
78
-
79
- /** zfb inline-theme or semantic class-mode configuration. */
80
- export type CodeHighlightConfig = {
81
- theme?: string;
82
- themesDir?: string;
83
- themeLight?: string;
84
- themeDark?: string;
85
- mode?: CodeHighlightMode;
86
- classPrefix?: string;
87
- roleClasses?: Partial<Record<CodeHighlightRole, string>>;
88
- defaultStylesheet?: boolean;
89
- };
90
-
91
- /**
92
- * Bundler options. Mirrors `BundleConfig` in crates/zfb/src/config.rs
93
- * and the published `@takazudo/zfb/config` (`dist/config.d.ts`). Added
94
- * in next.22 (`bundle.exclude`, #664) and extended in next.23
95
- * (`mainFields` / `external`, #676).
96
- */
97
- export interface BundleConfig {
98
- /**
99
- * Project-relative, gitignore-style globs for source files the bundler
100
- * must NOT pull into the esbuild graph (e.g. test fixtures or
101
- * `*.stories.tsx`). Matched files are skipped from the shadow-tree walk
102
- * and dropped from any eager `import.meta.glob(...)` expansion.
103
- */
104
- exclude?: string[];
105
- /**
106
- * Explicit esbuild `main-fields` for the `--platform=neutral` page/SSR
107
- * pass (empty by default under `neutral`), letting CJS-`main`-only deps
108
- * resolve. Mirrors `BundleConfig::main_fields`.
109
- */
110
- mainFields?: string[];
111
- /**
112
- * Bare specifiers to mark external in the `--platform=neutral` pass so
113
- * esbuild leaves them unbundled. Mirrors `BundleConfig::external`.
114
- */
115
- external?: string[];
116
- }
117
-
118
- /** Mirrors the Rust `Config` struct one-for-one. */
119
- export interface ZfbConfig {
120
- outDir?: string;
121
- publicDir?: string;
122
- host?: string;
123
- port?: number;
124
- framework?: Framework;
125
- collections?: CollectionDef[];
126
- tailwind?: TailwindConfig;
127
- /**
128
- * Bundler options. `bundle.exclude` keeps project-relative globs out of
129
- * the esbuild graph — used e.g. to skip `e2e/fixtures/**` so the MDX link
130
- * resolver doesn't walk committed test-fixture trees (silences spurious
131
- * broken-link warnings). Mirrors `Config::bundle`.
132
- */
133
- bundle?: BundleConfig;
134
- plugins?: PluginConfig[];
135
- adapter?: string;
136
- /**
137
- * Strip `.md` / `.mdx` from in-page `<a href>` paths and append a
138
- * trailing `/` so author-written `[label](other.mdx)` references
139
- * resolve to the rendered route URL. Mirrors Config::strip_md_ext
140
- * in crates/zfb/src/config.rs (zudolab/zfb#131).
141
- */
142
- stripMdExt?: boolean;
143
- /**
144
- * Site base path. Prefixed onto stable HTML asset URLs (CSS / JS
145
- * `<link>` and `<script>` tags). Normalised to start AND end with
146
- * `/`; `undefined` / `""` / `"/"` all behave identically (no
147
- * prefix). Mirrors Config::base in crates/zfb/src/config.rs
148
- * (Takazudo/zudo-front-builder#154).
149
- */
150
- base?: string;
151
- /**
152
- * Configures zfb's code highlighter. Class mode is mutually exclusive
153
- * with every theme field and emits semantic role classes; inline mode
154
- * retains the single/dual theme fields for general zfb consumers.
155
- */
156
- codeHighlight?: CodeHighlightConfig;
157
- /**
158
- * Markdown link resolver (port of `remarkResolveMarkdownLinks`).
159
- * Mirrors `Config::resolve_markdown_links` in crates/zfb/src/config.rs
160
- * (Takazudo/zudo-front-builder PR #234 / zudolab/zudo-doc#1577).
161
- * When `enabled: true`, the build appends `ResolveLinksPlugin` to the
162
- * mdast pipeline so author-written `[label](./other.mdx)` links are
163
- * rewritten to the corresponding rendered route URL — bypassing the
164
- * file→directory transformation that breaks relative paths in dist
165
- * HTML when `foo.mdx` becomes `foo/index.html`.
166
- */
167
- resolveMarkdownLinks?: {
168
- enabled?: boolean;
169
- docsDir?: string;
170
- dirs?: Array<{ dir: string; routePrefix: string }>;
171
- onBrokenLinks?: "warn" | "error" | "ignore";
172
- };
173
- /**
174
- * Whether the basePath rewriter should append a trailing `/` to
175
- * extensionless absolute hrefs. Mirrors `Config::trailing_slash` in
176
- * crates/zfb/src/config.rs (Takazudo/zudo-front-builder PR #234 /
177
- * zudolab/zudo-doc#1579). Off by default — preserves byte-for-byte
178
- * parity with the pre-`trailingSlash` build for projects that
179
- * haven't opted in.
180
- */
181
- trailingSlash?: boolean;
182
- /**
183
- * Minify production HTML output from `zfb build`.
184
- * Mirrors `Config::minify_html` in crates/zfb/src/config.rs.
185
- */
186
- minifyHtml?: boolean;
187
- /**
188
- * Markdown / MDX pipeline options. Mirrors `Config::markdown` →
189
- * `MarkdownConfig` in crates/zfb/src/config.rs. zfb next.12 moved the
190
- * former-Core features under `markdown.features` and next.13 ships the
191
- * rest as opt-in; zudo-doc uses `markdown.features` to opt back into the
192
- * former-Core four plus the additional opt-in features (#1804). Each
193
- * `features` value is per-feature: `true` for boolean-shorthand features,
194
- * or an options object for object-typed features.
195
- */
196
- markdown?: {
197
- gfm?: boolean | Record<string, boolean>;
198
- toc?: Record<string, unknown>;
199
- externalLinks?: Record<string, unknown>;
200
- cjkFriendly?: boolean;
201
- features?: Record<string, boolean | Record<string, unknown>>;
202
- };
203
- }
204
-
205
- /**
206
- * Identity helper: returns the supplied config as-is, but typed
207
- * against `ZfbConfig`. Use as the default export of `zfb.config.ts`.
208
- */
209
- export function defineConfig(config: ZfbConfig): ZfbConfig;
27
+ export * from "@takazudo/zfb/config";
210
28
  }