@takazudo/zudo-doc 3.3.0 → 4.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.
- package/CHANGELOG.md +32 -0
- package/README.md +2 -2
- package/bin/tag-cli-config.ts +126 -0
- package/bin/tags-audit-runner.ts +60 -76
- package/bin/tags-audit.mjs +17 -36
- package/bin/tags-suggest-runner.ts +429 -0
- package/bin/tags-suggest.mjs +30 -0
- package/bin/zudo-doc.mjs +78 -25
- package/dist/breadcrumb/breadcrumb.d.ts +4 -4
- package/dist/breadcrumb/find-path.d.ts +2 -2
- package/dist/breadcrumb/index.d.ts +1 -1
- package/dist/breadcrumb/types.d.ts +0 -5
- package/dist/chrome/derive.d.ts +16 -10
- package/dist/chrome/derive.js +53 -4
- package/dist/chrome/index.d.ts +13 -10
- package/dist/chrome/index.js +12 -6
- package/dist/chrome/primary-slots.d.ts +21 -0
- package/dist/chrome/primary-slots.js +59 -0
- package/dist/chrome-bindings.d.ts +68 -0
- package/dist/code-syntax/code-block-enhancer-script.d.ts +4 -0
- package/dist/code-syntax/code-block-enhancer-script.js +7 -4
- package/dist/code-syntax/code-block-enhancer.d.ts +2 -2
- package/dist/code-syntax/code-block-enhancer.js +1 -3
- package/dist/code-syntax/index.d.ts +5 -5
- package/dist/code-syntax/index.js +4 -13
- package/dist/code-syntax/mermaid-init-script.d.ts +1 -22
- package/dist/code-syntax/mermaid-init-script.js +0 -2
- package/dist/code-syntax/mermaid-init.d.ts +0 -1
- package/dist/code-syntax/mermaid-init.js +3 -4
- package/dist/code-syntax/tabs-init.d.ts +0 -1
- package/dist/code-syntax/tabs-init.js +1 -3
- package/dist/code-syntax/tabs.d.ts +0 -1
- package/dist/code-syntax/tabs.js +1 -3
- package/dist/color-scheme-utils.d.ts +71 -3
- package/dist/color-scheme-utils.js +137 -0
- package/dist/color-schemes-defaults/index.js +13 -0
- package/dist/config.d.ts +28 -12
- package/dist/config.js +11 -2
- package/dist/content/component-map.d.ts +0 -16
- package/dist/content/component-map.js +2 -4
- package/dist/content/index.d.ts +1 -1
- package/dist/content/index.js +2 -3
- package/dist/content.css +1 -1
- package/dist/design-token-panel-bootstrap.d.ts +45 -40
- package/dist/design-token-panel-bootstrap.js +98 -21
- package/dist/design-token-panel-config/index.js +1 -4
- package/dist/doc-body-end-islands/design-token-panel-island.d.ts +15 -0
- package/dist/doc-body-end-islands/design-token-panel-island.js +31 -0
- package/dist/doc-body-end-islands/index.d.ts +39 -17
- package/dist/doc-body-end-islands/index.js +13 -21
- package/dist/doc-body-end-islands/theme-pack-switcher-island.d.ts +37 -0
- package/dist/doc-body-end-islands/theme-pack-switcher-island.js +18 -0
- package/dist/doc-content-header/index.js +1 -1
- package/dist/doc-history-area/index.d.ts +10 -4
- package/dist/doc-history-area/index.js +3 -2
- package/dist/doc-metainfo-area/index.d.ts +1 -0
- package/dist/doc-page-props/index.d.ts +7 -23
- package/dist/doc-page-renderer/index.d.ts +1 -0
- package/dist/doc-page-renderer/index.js +1 -0
- package/dist/doc-page-shell/index.js +19 -12
- package/dist/doc-pager/index.js +1 -1
- package/dist/doc-route-entries/index.d.ts +2 -2
- package/dist/doclayout/doc-layout-with-defaults.js +4 -4
- package/dist/doclayout/doc-layout.d.ts +8 -0
- package/dist/doclayout/doc-layout.js +10 -1
- package/dist/docs-schema/index.js +1 -5
- package/dist/eject/index.d.ts +16 -0
- package/dist/eject/index.js +122 -28
- package/dist/extract-headings/index.d.ts +5 -8
- package/dist/extract-headings/index.js +2 -9
- package/dist/factory-context/index.d.ts +42 -4
- package/dist/features.css +55 -43
- package/dist/footer/footer.js +1 -0
- package/dist/head-with-defaults/index.d.ts +2 -0
- package/dist/head-with-defaults/index.js +16 -0
- package/dist/header/header.d.ts +10 -5
- package/dist/header/header.js +45 -5
- package/dist/header/index.d.ts +1 -1
- package/dist/header/types.d.ts +30 -1
- package/dist/header-with-defaults/index.js +1 -0
- package/dist/home-page/index.d.ts +2 -0
- package/dist/home-page/index.js +11 -5
- package/dist/home-page/prepare-home-data.js +1 -1
- package/dist/locale-merge/index.d.ts +9 -14
- package/dist/locale-merge/index.js +6 -4
- package/dist/mdx-components/index.js +4 -4
- package/dist/plugins/claude-resources.d.ts +1 -0
- package/dist/plugins/claude-resources.js +4 -2
- package/dist/plugins/doc-history.js +1 -1
- package/dist/{integrations → plugins/internal}/claude-resources/index.d.ts +1 -16
- package/dist/{integrations → plugins/internal}/claude-resources/index.js +0 -9
- package/dist/{integrations → plugins/internal}/doc-history/index.d.ts +0 -17
- package/dist/{integrations → plugins/internal}/doc-history/index.js +0 -4
- package/dist/{integrations → plugins/internal}/doc-history/pre-build.d.ts +2 -4
- package/dist/plugins/internal/llms-txt/index.d.ts +7 -0
- package/dist/{integrations → plugins/internal}/llms-txt/load.d.ts +1 -1
- package/dist/{integrations → plugins/internal}/llms-txt/load.js +2 -2
- package/dist/{integrations → plugins/internal}/llms-txt/strip.d.ts +2 -3
- package/dist/{integrations → plugins/internal}/llms-txt/strip.js +1 -1
- package/dist/{integrations → plugins/internal}/llms-txt/types.d.ts +13 -22
- package/dist/{integrations → plugins/internal}/search-index/collect.js +1 -1
- package/dist/plugins/internal/theme-packs/copy.d.ts +32 -0
- package/dist/plugins/internal/theme-packs/copy.js +45 -0
- package/dist/plugins/internal/theme-packs/dev-middleware.d.ts +22 -0
- package/dist/plugins/internal/theme-packs/dev-middleware.js +80 -0
- package/dist/plugins/internal/theme-packs/index.d.ts +6 -0
- package/dist/plugins/internal/theme-packs/index.js +9 -0
- package/dist/plugins/internal/theme-packs/resolve.d.ts +17 -0
- package/dist/plugins/internal/theme-packs/resolve.js +17 -0
- package/dist/plugins/internal/theme-packs/types.d.ts +22 -0
- package/dist/plugins/internal/theme-packs/types.js +0 -0
- package/dist/plugins/llms-txt.js +1 -1
- package/dist/plugins/routes.js +11 -1
- package/dist/plugins/search-index.js +1 -1
- package/dist/plugins/theme-packs.d.ts +3 -0
- package/dist/plugins/theme-packs.js +40 -0
- package/dist/preset.d.ts +19 -14
- package/dist/preset.js +24 -9
- package/dist/route-context/index.js +4 -6
- package/dist/route-enumerators/index.d.ts +6 -18
- package/dist/route-enumerators/index.js +8 -6
- package/dist/routes/404.js +3 -1
- package/dist/routes/_chrome.js +2 -2
- package/dist/routes/_context.d.ts +7 -3
- package/dist/routes/_context.js +2 -0
- package/dist/routes/_docs-helpers.js +9 -21
- package/dist/safelist.css +1 -1
- package/dist/settings.d.ts +27 -12
- package/dist/sidebar-tree/build-tree.d.ts +3 -4
- package/dist/sidebar-tree/build-tree.js +4 -3
- package/dist/sidebar-tree/index.d.ts +2 -2
- package/dist/sidebar-tree/types.d.ts +6 -17
- package/dist/site-tree-nav-island/index.d.ts +3 -1
- package/dist/site-tree-nav-island/index.js +17 -5
- package/dist/site-tree-nav-island/state.d.ts +4 -0
- package/dist/site-tree-nav-island/state.js +10 -0
- package/dist/tag-helpers/index.d.ts +6 -13
- package/dist/tag-helpers/index.js +5 -23
- package/dist/tag-pages/index.d.ts +8 -21
- package/dist/tag-pages/index.js +14 -10
- package/dist/tags-audit.d.ts +16 -44
- package/dist/tags-audit.js +9 -172
- package/dist/theme/color-scheme-provider.d.ts +2 -3
- package/dist/theme/color-scheme-provider.js +2 -10
- package/dist/theme/index.d.ts +1 -4
- package/dist/theme/index.js +2 -30
- package/dist/theme/theme-pack-provider.d.ts +42 -0
- package/dist/theme/theme-pack-provider.js +75 -0
- package/dist/theme-cli/apply.d.ts +16 -0
- package/dist/theme-cli/apply.js +61 -0
- package/dist/theme-cli/config-io.d.ts +15 -0
- package/dist/theme-cli/config-io.js +51 -0
- package/dist/theme-cli/config-rewriter.d.ts +21 -0
- package/dist/theme-cli/config-rewriter.js +141 -0
- package/dist/theme-cli/config-scanner.d.ts +63 -0
- package/dist/theme-cli/config-scanner.js +288 -0
- package/dist/theme-cli/index.d.ts +7 -0
- package/dist/theme-cli/index.js +38 -0
- package/dist/theme-cli/list.d.ts +27 -0
- package/dist/theme-cli/list.js +64 -0
- package/dist/theme-cli/provenance.d.ts +17 -0
- package/dist/theme-cli/provenance.js +35 -0
- package/dist/theme-cli/registry.d.ts +14 -0
- package/dist/theme-cli/registry.js +13 -0
- package/dist/theme-pack-dialog/dialog-state.d.ts +25 -0
- package/dist/theme-pack-dialog/dialog-state.js +40 -0
- package/dist/theme-pack-dialog/index.d.ts +5 -0
- package/dist/theme-pack-dialog/index.js +152 -0
- package/dist/theme-pack-dialog/theme-pack-card.d.ts +25 -0
- package/dist/theme-pack-dialog/theme-pack-card.js +72 -0
- package/dist/theme-pack-switcher/index.d.ts +49 -0
- package/dist/theme-pack-switcher/index.js +205 -0
- package/dist/theme-pack-switcher/switcher-state.d.ts +56 -0
- package/dist/theme-pack-switcher/switcher-state.js +43 -0
- package/dist/theme-pack-switcher/theme-pack-sync.d.ts +85 -0
- package/dist/theme-pack-switcher/theme-pack-sync.js +121 -0
- package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-400-latin.woff2 +0 -0
- package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-700-latin.woff2 +0 -0
- package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-400-latin.woff2 +0 -0
- package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-700-latin.woff2 +0 -0
- package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-italic-latin.woff2 +0 -0
- package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-latin.woff2 +0 -0
- package/dist/theme-packs/beacon/fonts/OFL.txt +94 -0
- package/dist/theme-packs/beacon/meta.json +37 -0
- package/dist/theme-packs/beacon/pack.css +442 -0
- package/dist/theme-packs/broadsheet/fonts/CourierPrime-400-latin.woff2 +0 -0
- package/dist/theme-packs/broadsheet/fonts/CourierPrime-700-latin.woff2 +0 -0
- package/dist/theme-packs/broadsheet/fonts/OFL.txt +95 -0
- package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-italic-latin.woff2 +0 -0
- package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-latin.woff2 +0 -0
- package/dist/theme-packs/broadsheet/fonts/SourceSerif4-italic-latin.woff2 +0 -0
- package/dist/theme-packs/broadsheet/fonts/SourceSerif4-latin.woff2 +0 -0
- package/dist/theme-packs/broadsheet/meta.json +38 -0
- package/dist/theme-packs/broadsheet/pack.css +448 -0
- package/dist/theme-packs/brutalist/fonts/ArchivoBlack-latin.woff2 +0 -0
- package/dist/theme-packs/brutalist/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/brutalist/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/theme-packs/brutalist/fonts/IBMPlexMono-700-latin.woff2 +0 -0
- package/dist/theme-packs/brutalist/fonts/OFL.txt +95 -0
- package/dist/theme-packs/brutalist/fonts/SpaceGrotesk-latin.woff2 +0 -0
- package/dist/theme-packs/brutalist/meta.json +38 -0
- package/dist/theme-packs/brutalist/pack.css +546 -0
- package/dist/theme-packs/default/meta.json +37 -0
- package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/IBMPlexSans-italic-latin.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/IBMPlexSans-latin-ext.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/IBMPlexSans-latin.woff2 +0 -0
- package/dist/theme-packs/drift/fonts/OFL.txt +93 -0
- package/dist/theme-packs/drift/meta.json +37 -0
- package/dist/theme-packs/drift/pack.css +478 -0
- package/dist/theme-packs/fjord/fonts/Inter-latin-ext.woff2 +0 -0
- package/dist/theme-packs/fjord/fonts/Inter-latin.woff2 +0 -0
- package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
- package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin.woff2 +0 -0
- package/dist/theme-packs/fjord/fonts/OFL.txt +94 -0
- package/dist/theme-packs/fjord/meta.json +37 -0
- package/dist/theme-packs/fjord/pack.css +375 -0
- package/dist/theme-packs/foundry/fonts/Inter-latin-ext.woff2 +0 -0
- package/dist/theme-packs/foundry/fonts/Inter-latin.woff2 +0 -0
- package/dist/theme-packs/foundry/fonts/OFL.txt +93 -0
- package/dist/theme-packs/foundry/meta.json +37 -0
- package/dist/theme-packs/foundry/pack.css +202 -0
- package/dist/theme-packs/futura-editorial/fonts/Jost-latin.woff2 +0 -0
- package/dist/theme-packs/futura-editorial/fonts/NotoSans-italic-latin.woff2 +0 -0
- package/dist/theme-packs/futura-editorial/fonts/NotoSans-latin.woff2 +0 -0
- package/dist/theme-packs/futura-editorial/fonts/OFL.txt +95 -0
- package/dist/theme-packs/futura-editorial/fonts/SpaceMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/futura-editorial/fonts/SpaceMono-700-latin.woff2 +0 -0
- package/dist/theme-packs/futura-editorial/meta.json +38 -0
- package/dist/theme-packs/futura-editorial/pack.css +313 -0
- package/dist/theme-packs/hearth/fonts/Fraunces-italic-latin.woff2 +0 -0
- package/dist/theme-packs/hearth/fonts/Fraunces-latin.woff2 +0 -0
- package/dist/theme-packs/hearth/fonts/Nunito-latin.woff2 +0 -0
- package/dist/theme-packs/hearth/fonts/OFL.txt +95 -0
- package/dist/theme-packs/hearth/fonts/SplineSansMono-latin.woff2 +0 -0
- package/dist/theme-packs/hearth/meta.json +38 -0
- package/dist/theme-packs/hearth/pack.css +385 -0
- package/dist/theme-packs/hollow/fonts/OFL.txt +94 -0
- package/dist/theme-packs/hollow/fonts/SpaceGrotesk-latin.woff2 +0 -0
- package/dist/theme-packs/hollow/fonts/SpaceMono-400-italic-latin.woff2 +0 -0
- package/dist/theme-packs/hollow/fonts/SpaceMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/hollow/fonts/SpaceMono-700-latin.woff2 +0 -0
- package/dist/theme-packs/hollow/meta.json +37 -0
- package/dist/theme-packs/hollow/pack.css +428 -0
- package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext-italic.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-italic.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/CrimsonPro-latin.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/theme-packs/ledger/fonts/OFL.txt +94 -0
- package/dist/theme-packs/ledger/meta.json +37 -0
- package/dist/theme-packs/ledger/pack.css +463 -0
- package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin-ext.woff2 +0 -0
- package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin.woff2 +0 -0
- package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin-ext.woff2 +0 -0
- package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin.woff2 +0 -0
- package/dist/theme-packs/manuscript/fonts/EBGaramond-latin-italic.woff2 +0 -0
- package/dist/theme-packs/manuscript/fonts/EBGaramond-latin.woff2 +0 -0
- package/dist/theme-packs/manuscript/fonts/OFL.txt +94 -0
- package/dist/theme-packs/manuscript/meta.json +37 -0
- package/dist/theme-packs/manuscript/pack.css +376 -0
- package/dist/theme-packs/matcha/fonts/MPLUS1Code-latin.woff2 +0 -0
- package/dist/theme-packs/matcha/fonts/OFL.txt +95 -0
- package/dist/theme-packs/matcha/fonts/ShipporiMincho-500-latin.woff2 +0 -0
- package/dist/theme-packs/matcha/fonts/ShipporiMincho-700-latin.woff2 +0 -0
- package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
- package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
- package/dist/theme-packs/matcha/meta.json +38 -0
- package/dist/theme-packs/matcha/pack.css +409 -0
- package/dist/theme-packs/nocturne/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
- package/dist/theme-packs/nocturne/fonts/CormorantGaramond-latin.woff2 +0 -0
- package/dist/theme-packs/nocturne/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/nocturne/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/theme-packs/nocturne/fonts/IBMPlexMono-italic-latin.woff2 +0 -0
- package/dist/theme-packs/nocturne/fonts/Manrope-latin.woff2 +0 -0
- package/dist/theme-packs/nocturne/fonts/OFL.txt +95 -0
- package/dist/theme-packs/nocturne/meta.json +38 -0
- package/dist/theme-packs/nocturne/pack.css +502 -0
- package/dist/theme-packs/observatory/fonts/JosefinSans-latin.woff2 +0 -0
- package/dist/theme-packs/observatory/fonts/Jost-italic-latin.woff2 +0 -0
- package/dist/theme-packs/observatory/fonts/Jost-latin.woff2 +0 -0
- package/dist/theme-packs/observatory/fonts/OFL.txt +95 -0
- package/dist/theme-packs/observatory/fonts/SpaceMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/observatory/fonts/SpaceMono-700-latin.woff2 +0 -0
- package/dist/theme-packs/observatory/fonts/SpaceMono-italic-latin.woff2 +0 -0
- package/dist/theme-packs/observatory/meta.json +38 -0
- package/dist/theme-packs/observatory/pack.css +728 -0
- package/dist/theme-packs/onyx/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/CormorantGaramond-latin.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/Jost-latin.woff2 +0 -0
- package/dist/theme-packs/onyx/fonts/OFL.txt +95 -0
- package/dist/theme-packs/onyx/meta.json +38 -0
- package/dist/theme-packs/onyx/pack.css +497 -0
- package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
- package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin.woff2 +0 -0
- package/dist/theme-packs/phosphor/fonts/OFL.txt +94 -0
- package/dist/theme-packs/phosphor/fonts/VT323-latin-ext.woff2 +0 -0
- package/dist/theme-packs/phosphor/fonts/VT323-latin.woff2 +0 -0
- package/dist/theme-packs/phosphor/meta.json +38 -0
- package/dist/theme-packs/phosphor/pack.css +493 -0
- package/dist/theme-packs/solar/fonts/OFL.txt +94 -0
- package/dist/theme-packs/solar/fonts/SourceCodePro-italic-latin.woff2 +0 -0
- package/dist/theme-packs/solar/fonts/SourceCodePro-latin.woff2 +0 -0
- package/dist/theme-packs/solar/fonts/SourceSans3-italic-latin.woff2 +0 -0
- package/dist/theme-packs/solar/fonts/SourceSans3-latin.woff2 +0 -0
- package/dist/theme-packs/solar/meta.json +37 -0
- package/dist/theme-packs/solar/pack.css +380 -0
- package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/OFL.txt +95 -0
- package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-600-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-700-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-800-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
- package/dist/theme-packs/sumi/meta.json +38 -0
- package/dist/theme-packs/sumi/pack.css +502 -0
- package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
- package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-600-latin.woff2 +0 -0
- package/dist/theme-packs/swissgrid/fonts/Inter-latin-ext.woff2 +0 -0
- package/dist/theme-packs/swissgrid/fonts/Inter-latin.woff2 +0 -0
- package/dist/theme-packs/swissgrid/fonts/InterTight-latin.woff2 +0 -0
- package/dist/theme-packs/swissgrid/fonts/OFL.txt +95 -0
- package/dist/theme-packs/swissgrid/meta.json +38 -0
- package/dist/theme-packs/swissgrid/pack.css +518 -0
- package/dist/theme-packs/washi/fonts/MPlus1Code-400-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/MPlus1Code-500-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/OFL.txt +95 -0
- package/dist/theme-packs/washi/fonts/ShipporiMincho-500-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/ShipporiMincho-600-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/ShipporiMincho-700-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
- package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-700-latin.woff2 +0 -0
- package/dist/theme-packs/washi/meta.json +38 -0
- package/dist/theme-packs/washi/pack.css +479 -0
- package/dist/theme-packs-registry/index.d.ts +5 -0
- package/dist/theme-packs-registry/index.js +30 -0
- package/dist/theme-packs-registry/load-registry.d.ts +23 -0
- package/dist/theme-packs-registry/load-registry.js +64 -0
- package/dist/theme-packs-registry/meta-schema.d.ts +70 -0
- package/dist/theme-packs-registry/meta-schema.js +38 -0
- package/dist/theme-packs-registry/resolve-enabled-packs.d.ts +25 -0
- package/dist/theme-packs-registry/resolve-enabled-packs.js +43 -0
- package/dist/theme-packs-registry/token-manifest.d.ts +19 -0
- package/dist/theme-packs-registry/token-manifest.js +57 -0
- package/dist/theme-packs-registry/validator.d.ts +35 -0
- package/dist/theme-packs-registry/validator.js +284 -0
- package/dist/theme-toggle/color-scheme-sync.d.ts +2 -4
- package/dist/versions-page/index.d.ts +2 -2
- package/dist/versions-page/index.js +8 -8
- package/eject/breadcrumb/breadcrumb.tsx +4 -4
- package/eject/breadcrumb/find-path.ts +2 -2
- package/eject/breadcrumb/index.ts +1 -1
- package/eject/breadcrumb/types.ts +0 -6
- package/eject/code-group/index.tsx +2 -2
- package/eject/doc-history/index.tsx +1 -1
- package/eject/doc-pager/index.tsx +1 -1
- package/eject/footer/footer.tsx +1 -0
- package/eject/header/header.tsx +86 -21
- package/eject/header/index.ts +3 -0
- package/eject/header/types.ts +39 -1
- package/eject/site-tree-nav-island/index.tsx +15 -3
- package/eject/site-tree-nav-island/state.ts +9 -0
- package/eject/theme-toggle/color-scheme-sync.ts +2 -4
- package/package.json +35 -29
- package/routes-src/404.tsx +4 -1
- package/routes-src/_chrome.tsx +6 -5
- package/routes-src/_context.ts +4 -0
- package/routes-src/_docs-helpers.ts +9 -29
- package/routes-src/_virtual.d.ts +4 -0
- package/virtual-modules.d.ts +4 -0
- package/zfb-config-shim.d.ts +40 -18
- package/dist/integrations/llms-txt/index.d.ts +0 -33
- package/dist/theme/color-tweak-export-modal.d.ts +0 -16
- package/dist/theme/color-tweak-export-modal.js +0 -138
- package/dist/theme/design-token-serde.d.ts +0 -183
- package/dist/theme/design-token-serde.js +0 -346
- package/dist/theme/design-token-types.d.ts +0 -13
- package/dist/theme/design-token-types.js +0 -6
- package/dist/theme/iframe-bridge.d.ts +0 -42
- package/dist/theme/iframe-bridge.js +0 -72
- /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.js +0 -0
- /package/dist/{integrations → plugins/internal}/claude-resources/generate.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/claude-resources/generate.js +0 -0
- /package/dist/{integrations → plugins/internal}/doc-history/pre-build.js +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.js +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/emit.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/emit.js +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/generate.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/generate.js +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/index.js +0 -0
- /package/dist/{integrations → plugins/internal}/llms-txt/types.js +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/build-emitter.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/build-emitter.js +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/collect.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.js +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/index.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/index.js +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/types.d.ts +0 -0
- /package/dist/{integrations → plugins/internal}/search-index/types.js +0 -0
|
@@ -2,13 +2,6 @@ import path from "node:path";
|
|
|
2
2
|
import {
|
|
3
3
|
generateClaudeResourcesDocs
|
|
4
4
|
} from "./generate.js";
|
|
5
|
-
const CLAUDE_RESOURCES_PLUGIN_NAME = "@takazudo/zudo-doc-claude-resources";
|
|
6
|
-
function claudeResourcesPlugin(options) {
|
|
7
|
-
return {
|
|
8
|
-
name: CLAUDE_RESOURCES_PLUGIN_NAME,
|
|
9
|
-
options: { ...options }
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
5
|
function runClaudeResourcesPreStep(options) {
|
|
13
6
|
const projectRoot = path.resolve(options.projectRoot ?? process.cwd());
|
|
14
7
|
const claudeDir = path.isAbsolute(options.claudeDir) ? options.claudeDir : path.resolve(projectRoot, options.claudeDir);
|
|
@@ -18,8 +11,6 @@ function runClaudeResourcesPreStep(options) {
|
|
|
18
11
|
return generateClaudeResourcesDocs({ claudeDir, projectRoot: scanRoot, docsDir });
|
|
19
12
|
}
|
|
20
13
|
export {
|
|
21
|
-
CLAUDE_RESOURCES_PLUGIN_NAME,
|
|
22
|
-
claudeResourcesPlugin,
|
|
23
14
|
generateClaudeResourcesDocs,
|
|
24
15
|
runClaudeResourcesPreStep
|
|
25
16
|
};
|
|
@@ -24,13 +24,6 @@ export interface DocHistoryOptions {
|
|
|
24
24
|
*/
|
|
25
25
|
maxEntries?: number;
|
|
26
26
|
}
|
|
27
|
-
/** zfb v0 plugin descriptor — mirrors `PluginConfig` in `zfb/config`. */
|
|
28
|
-
export interface DocHistoryPluginDescriptor {
|
|
29
|
-
/** Stable plugin id used by the future zfb plugin runtime to dispatch hooks. */
|
|
30
|
-
name: "doc-history";
|
|
31
|
-
/** Options forwarded verbatim into the zfb config; must be JSON-serialisable. */
|
|
32
|
-
options: DocHistoryOptions;
|
|
33
|
-
}
|
|
34
27
|
/** Default doc-history-server port — matches `@takazudo/zudo-doc-history-server`. */
|
|
35
28
|
export declare const DEFAULT_SERVER_PORT = 4322;
|
|
36
29
|
/** Default git history depth — matches `@takazudo/zudo-doc-history-server`. */
|
|
@@ -41,16 +34,6 @@ export declare const DOC_HISTORY_ROUTE_PREFIX = "/doc-history/";
|
|
|
41
34
|
export declare const DOC_HISTORY_OUTPUT_DIRNAME = "doc-history";
|
|
42
35
|
/** CLI bin name exposed by `@takazudo/zudo-doc-history-server` for inline generation. */
|
|
43
36
|
export declare const DOC_HISTORY_GENERATE_BIN = "doc-history-generate";
|
|
44
|
-
/**
|
|
45
|
-
* Build the zfb config-side descriptor. Add the return value to the
|
|
46
|
-
* `plugins: [...]` array in `zfb.config.ts`.
|
|
47
|
-
*
|
|
48
|
-
* The shape is intentionally limited to `{ name, options }` because
|
|
49
|
-
* that is the only thing today's zfb config loader consumes (see the
|
|
50
|
-
* Rust `PluginConfig` struct in zfb's `config.rs`). Runtime wiring is
|
|
51
|
-
* done through the sibling helpers in this module.
|
|
52
|
-
*/
|
|
53
|
-
export declare function docHistoryPlugin(options: DocHistoryOptions): DocHistoryPluginDescriptor;
|
|
54
37
|
/** Connect-style middleware signature — works as a Vite plugin middleware. */
|
|
55
38
|
export type ConnectMiddleware = (req: IncomingMessage, res: ServerResponse, next: (err?: unknown) => void) => void;
|
|
56
39
|
/** Minimal logger surface used by the middleware on proxy failure. */
|
|
@@ -9,9 +9,6 @@ const DEFAULT_MAX_ENTRIES = 50;
|
|
|
9
9
|
const DOC_HISTORY_ROUTE_PREFIX = "/doc-history/";
|
|
10
10
|
const DOC_HISTORY_OUTPUT_DIRNAME = "doc-history";
|
|
11
11
|
const DOC_HISTORY_GENERATE_BIN = "doc-history-generate";
|
|
12
|
-
function docHistoryPlugin(options) {
|
|
13
|
-
return { name: "doc-history", options };
|
|
14
|
-
}
|
|
15
12
|
function createDocHistoryDevMiddleware(options, logger) {
|
|
16
13
|
const port = options.serverPort ?? DEFAULT_SERVER_PORT;
|
|
17
14
|
return (req, res, next) => {
|
|
@@ -153,7 +150,6 @@ export {
|
|
|
153
150
|
DOC_HISTORY_ROUTE_PREFIX,
|
|
154
151
|
buildGenerateCliArgs,
|
|
155
152
|
createDocHistoryDevMiddleware,
|
|
156
|
-
docHistoryPlugin,
|
|
157
153
|
resolveDocHistoryGenerateBin,
|
|
158
154
|
runDocHistoryMetaStep,
|
|
159
155
|
runDocHistoryPostBuild,
|
|
@@ -42,11 +42,9 @@ export interface DocHistoryMetaEntry {
|
|
|
42
42
|
/**
|
|
43
43
|
* Source file extension (".mdx" or ".md") — the content walkers accept
|
|
44
44
|
* both (`collectContentFiles` matches `\.mdx?$`), so the view-source URL
|
|
45
|
-
* builder
|
|
46
|
-
* hardcoding ".mdx". Optional in older manifests; readers fall back to
|
|
47
|
-
* ".mdx" when absent.
|
|
45
|
+
* builder uses the actual source extension.
|
|
48
46
|
*/
|
|
49
|
-
ext
|
|
47
|
+
ext: ".mdx" | ".md";
|
|
50
48
|
}
|
|
51
49
|
/** Manifest shape — keyed by composedSlug. */
|
|
52
50
|
export type DocHistoryMetaManifest = Record<string, DocHistoryMetaEntry>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { createLlmsTxtDevMiddleware } from "./dev-middleware.js";
|
|
2
|
+
export type { LlmsTxtDevMiddlewareOptions, LlmsTxtMiddleware, LlmsTxtMiddlewareLogger, LlmsTxtNextFn, } from "./dev-middleware.js";
|
|
3
|
+
export { emitLlmsTxt } from "./emit.js";
|
|
4
|
+
export { generateLlmsFullTxt, generateLlmsTxt, } from "./generate.js";
|
|
5
|
+
export { collectMdFiles, isExcluded, loadDocEntries, parseMarkdownFile, slugToUrl, } from "./load.js";
|
|
6
|
+
export { stripImportsAndJsx, stripMarkdown } from "./strip.js";
|
|
7
|
+
export type { LlmsDocEntry, LlmsTxtEmitOptions, LlmsTxtEmitResult, LlmsTxtFrontmatter, LlmsTxtLoadOptions, LlmsTxtLocaleConfig, LlmsTxtLogger, LlmsTxtSiteMeta, } from "./types.js";
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* surface is unchanged.
|
|
10
10
|
*/
|
|
11
11
|
import type { LlmsDocEntry, LlmsTxtLoadOptions } from "./types.js";
|
|
12
|
-
export { collectMdFiles, isExcluded, parseMarkdownFile, slugToUrl, } from "
|
|
12
|
+
export { collectMdFiles, isExcluded, parseMarkdownFile, slugToUrl, } from "../../../md-utils/index.js";
|
|
13
13
|
/**
|
|
14
14
|
* Build the sorted {@link LlmsDocEntry} list for a single content root.
|
|
15
15
|
* Excluded pages (draft / unlisted / search_exclude) are dropped.
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
parseMarkdownFile,
|
|
6
6
|
slugToUrl,
|
|
7
7
|
stripMarkdown
|
|
8
|
-
} from "
|
|
8
|
+
} from "../../../md-utils/index.js";
|
|
9
9
|
import { stripImportsAndJsx } from "./strip.js";
|
|
10
10
|
import {
|
|
11
11
|
collectMdFiles as collectMdFiles2,
|
|
12
12
|
isExcluded as isExcluded2,
|
|
13
13
|
parseMarkdownFile as parseMarkdownFile2,
|
|
14
14
|
slugToUrl as slugToUrl2
|
|
15
|
-
} from "
|
|
15
|
+
} from "../../../md-utils/index.js";
|
|
16
16
|
function loadDocEntries(options) {
|
|
17
17
|
const { contentDir, locale, base, siteUrl } = options;
|
|
18
18
|
const absDir = resolve(contentDir);
|
|
@@ -10,10 +10,9 @@
|
|
|
10
10
|
* `stripMarkdown` (used to derive a fallback `description` from the body
|
|
11
11
|
* when frontmatter doesn't carry one) lives in the shared `md-utils`
|
|
12
12
|
* module — one implementation for search-index and llms-txt
|
|
13
|
-
* (zudo-doc#2024) — and is re-exported here
|
|
14
|
-
* unchanged.
|
|
13
|
+
* (zudo-doc#2024) — and is re-exported here for the internal loader barrel.
|
|
15
14
|
*/
|
|
16
|
-
export { stripMarkdown } from "
|
|
15
|
+
export { stripMarkdown } from "../../../md-utils/index.js";
|
|
17
16
|
/**
|
|
18
17
|
* Strip imports, exports, and HTML/JSX tags from MDX/MD content while
|
|
19
18
|
* keeping the prose layout (headings, lists, blockquotes) intact for
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { stripMarkdown } from "
|
|
1
|
+
import { stripMarkdown } from "../../../md-utils/index.js";
|
|
2
2
|
function stripImportsAndJsx(content) {
|
|
3
3
|
return content.replace(/^import\s+.*$/gm, "").replace(/^export\s+.*$/gm, "").replace(/\{\/\*[\s\S]*?\*\/\}/g, "").replace(/<\/?[a-zA-Z][a-zA-Z0-9]*[^>]*>/g, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
4
4
|
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Internal types for the framework-agnostic llms-txt build emitter.
|
|
3
3
|
*
|
|
4
|
-
* The shapes
|
|
5
|
-
*
|
|
6
|
-
* pipeline that exposes a `dist/` output directory and a list of
|
|
7
|
-
* markdown content roots — Astro today, zfb tomorrow, plain Node tooling
|
|
8
|
-
* in a unit test, etc.
|
|
4
|
+
* The shapes are deliberately framework-neutral so the current zfb plugin
|
|
5
|
+
* and plain Node test tooling can share the same emitter.
|
|
9
6
|
*/
|
|
10
|
-
import type { MdDocFrontmatter } from "
|
|
7
|
+
import type { MdDocFrontmatter } from "../../../md-utils/index.js";
|
|
11
8
|
/**
|
|
12
9
|
* Frontmatter fields the loader reads off of each MDX/MD file. Callers
|
|
13
|
-
* are free to extend this; unrecognised fields are ignored.
|
|
10
|
+
* are free to extend this; unrecognised fields are ignored. Re-export of the
|
|
14
11
|
* shared {@link MdDocFrontmatter} shape (`md-utils`, zudo-doc#2024) —
|
|
15
12
|
* search-index and llms-txt read the same fields.
|
|
16
13
|
*/
|
|
@@ -44,8 +41,8 @@ export interface LlmsDocEntry {
|
|
|
44
41
|
}
|
|
45
42
|
/**
|
|
46
43
|
* Site-level metadata threaded through the generators. Matches the
|
|
47
|
-
* `siteName` / `siteDescription`
|
|
48
|
-
*
|
|
44
|
+
* current `siteName` / `siteDescription` settings one-for-one so callers can
|
|
45
|
+
* pass the current settings object straight through.
|
|
49
46
|
*/
|
|
50
47
|
export interface LlmsTxtSiteMeta {
|
|
51
48
|
siteName: string;
|
|
@@ -81,16 +78,13 @@ export interface LlmsTxtLoadOptions {
|
|
|
81
78
|
/**
|
|
82
79
|
* Optional absolute site URL. When set, the loader produces fully
|
|
83
80
|
* qualified URLs by prefixing the base+path with `siteUrl`. When
|
|
84
|
-
* empty, URLs are returned path-only
|
|
85
|
-
* behaviour for projects that omit `siteUrl`).
|
|
81
|
+
* empty, URLs are returned path-only for projects that omit `siteUrl`.
|
|
86
82
|
*/
|
|
87
83
|
siteUrl?: string;
|
|
88
84
|
}
|
|
89
85
|
/**
|
|
90
|
-
* Top-level options for {@link emitLlmsTxt}.
|
|
91
|
-
*
|
|
92
|
-
* module so that a one-line registration in `zfb.config.ts` (or a
|
|
93
|
-
* `b4-build` hook in Astro) can wire the same behaviour.
|
|
86
|
+
* Top-level options for {@link emitLlmsTxt}. The current zfb plugin supplies
|
|
87
|
+
* these explicitly from its resolved config.
|
|
94
88
|
*/
|
|
95
89
|
export interface LlmsTxtEmitOptions extends LlmsTxtSiteMeta {
|
|
96
90
|
/** Absolute output directory — typically `dist/`. */
|
|
@@ -110,16 +104,13 @@ export interface LlmsTxtEmitOptions extends LlmsTxtSiteMeta {
|
|
|
110
104
|
*/
|
|
111
105
|
locales?: LlmsTxtLocaleConfig[];
|
|
112
106
|
/**
|
|
113
|
-
* Optional logger. Defaults to a no-op so unit tests stay quiet; the
|
|
114
|
-
*
|
|
115
|
-
* a future zfb plugin can pipe its own.
|
|
107
|
+
* Optional logger. Defaults to a no-op so unit tests stay quiet; the zfb
|
|
108
|
+
* plugin can pipe its logger through.
|
|
116
109
|
*/
|
|
117
110
|
logger?: LlmsTxtLogger;
|
|
118
111
|
}
|
|
119
112
|
/**
|
|
120
|
-
* Minimal logger interface
|
|
121
|
-
* `logger` and `console`. Only `info` is used today; the wider shape is
|
|
122
|
-
* provided so the option can hold either object without type acrobatics.
|
|
113
|
+
* Minimal logger interface. Only `info` is used today.
|
|
123
114
|
*/
|
|
124
115
|
export interface LlmsTxtLogger {
|
|
125
116
|
info: (msg: string) => void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ThemePackRegistry } from "../../../theme-packs-registry/index.js";
|
|
2
|
+
export interface CopyThemePacksParams {
|
|
3
|
+
/** The shipped `theme-packs/` directory — `dist/theme-packs/` once
|
|
4
|
+
* compiled (workspace-built and published shapes alike), `src/theme-packs/`
|
|
5
|
+
* when vitest runs the source directly. Same resolution rule as
|
|
6
|
+
* `routes.ts`'s `themePacksDir`. */
|
|
7
|
+
packsDir: string | URL;
|
|
8
|
+
/** The ENABLED, ORDERED registry (already resolved via `resolveEnabledPacks`). */
|
|
9
|
+
enabled: ThemePackRegistry;
|
|
10
|
+
/** The build's output directory (`ctx.outDir`). */
|
|
11
|
+
outDir: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CopyThemePacksResult {
|
|
14
|
+
/** `false` when the ADR's no-op rule applies (no CSS-bearing pack enabled)
|
|
15
|
+
* — nothing was written. */
|
|
16
|
+
copied: boolean;
|
|
17
|
+
/** Absolute path of `${outDir}/theme-packs/`, when `copied` is `true`. */
|
|
18
|
+
destDir?: string;
|
|
19
|
+
/** Absolute path of the written `index.json`, when `copied` is `true`. */
|
|
20
|
+
indexJsonPath?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Copy every enabled pack's `meta.json` (+ `pack.css` when it ships one, +
|
|
24
|
+
* `fonts/*` when present) into `${outDir}/theme-packs/<slug>/…`, and write
|
|
25
|
+
* the aggregated `${outDir}/theme-packs/index.json` manifest
|
|
26
|
+
* (`{ schemaVersion: 1, packs: ThemePackMeta[] }`) in resolved order.
|
|
27
|
+
*
|
|
28
|
+
* No-ops (writes nothing, returns `{ copied: false }`) when the enabled set
|
|
29
|
+
* has no CSS-bearing pack — i.e. only `"default"` is enabled — per the ADR's
|
|
30
|
+
* dead-weight-avoidance rule.
|
|
31
|
+
*/
|
|
32
|
+
export declare function copyEnabledThemePacks({ packsDir, enabled, outDir, }: CopyThemePacksParams): CopyThemePacksResult;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { copyFileSync, existsSync, mkdirSync, readdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { hasCssBearingPack } from "./resolve.js";
|
|
5
|
+
function copyEnabledThemePacks({
|
|
6
|
+
packsDir,
|
|
7
|
+
enabled,
|
|
8
|
+
outDir
|
|
9
|
+
}) {
|
|
10
|
+
if (!hasCssBearingPack(enabled)) {
|
|
11
|
+
return { copied: false };
|
|
12
|
+
}
|
|
13
|
+
const srcRoot = packsDir instanceof URL ? fileURLToPath(packsDir) : packsDir;
|
|
14
|
+
const destRoot = join(outDir, "theme-packs");
|
|
15
|
+
mkdirSync(destRoot, { recursive: true });
|
|
16
|
+
for (const entry of enabled) {
|
|
17
|
+
const srcDir = join(srcRoot, entry.slug);
|
|
18
|
+
const destDir = join(destRoot, entry.slug);
|
|
19
|
+
mkdirSync(destDir, { recursive: true });
|
|
20
|
+
copyFileSync(join(srcDir, "meta.json"), join(destDir, "meta.json"));
|
|
21
|
+
if (entry.hasStylesheet) {
|
|
22
|
+
copyFileSync(join(srcDir, "pack.css"), join(destDir, "pack.css"));
|
|
23
|
+
}
|
|
24
|
+
const fontsSrcDir = join(srcDir, "fonts");
|
|
25
|
+
if (existsSync(fontsSrcDir)) {
|
|
26
|
+
const fontsDestDir = join(destDir, "fonts");
|
|
27
|
+
mkdirSync(fontsDestDir, { recursive: true });
|
|
28
|
+
for (const file of readdirSync(fontsSrcDir, { withFileTypes: true })) {
|
|
29
|
+
if (file.isFile()) {
|
|
30
|
+
copyFileSync(join(fontsSrcDir, file.name), join(fontsDestDir, file.name));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const manifest = {
|
|
36
|
+
schemaVersion: 1,
|
|
37
|
+
packs: enabled.map((entry) => entry.meta)
|
|
38
|
+
};
|
|
39
|
+
const indexJsonPath = join(destRoot, "index.json");
|
|
40
|
+
writeFileSync(indexJsonPath, JSON.stringify(manifest));
|
|
41
|
+
return { copied: true, destDir: destRoot, indexJsonPath };
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
copyEnabledThemePacks
|
|
45
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import type { ThemePackRegistry } from "../../../theme-packs-registry/index.js";
|
|
3
|
+
export type ThemePacksNextFn = (err?: unknown) => void;
|
|
4
|
+
export type ThemePacksMiddleware = (req: IncomingMessage, res: ServerResponse, next: ThemePacksNextFn) => void;
|
|
5
|
+
export interface CreateThemePacksDevMiddlewareParams {
|
|
6
|
+
/** The shipped `theme-packs/` directory (workspace `src/theme-packs/` under
|
|
7
|
+
* vitest, `dist/theme-packs/` from the published/workspace-built package). */
|
|
8
|
+
packsDir: string | URL;
|
|
9
|
+
/** The ENABLED, ORDERED registry (already resolved via `resolveEnabledPacks`). */
|
|
10
|
+
enabled: ThemePackRegistry;
|
|
11
|
+
/** Base-stripped route prefix this registration matches under, e.g.
|
|
12
|
+
* `/theme-packs` for base `/`, or `/my-docs/theme-packs` for base
|
|
13
|
+
* `/my-docs/` (same `getBasePrefix` convention as the sibling plugins). */
|
|
14
|
+
routePrefix: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Build a dev-server middleware serving the enabled packs' files plus a
|
|
18
|
+
* generated `index.json` aggregate. Every request re-reads from disk (no
|
|
19
|
+
* caching) so authoring edits to `pack.css` during `zudo-doc` development
|
|
20
|
+
* surface without a dev-server restart.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createThemePacksDevMiddleware({ packsDir, enabled, routePrefix, }: CreateThemePacksDevMiddlewareParams): ThemePacksMiddleware;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { resolve as resolvePath, sep } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
const CONTENT_TYPES = {
|
|
5
|
+
".css": "text/css",
|
|
6
|
+
".json": "application/json",
|
|
7
|
+
".woff2": "font/woff2"
|
|
8
|
+
};
|
|
9
|
+
function contentTypeFor(path) {
|
|
10
|
+
const dot = path.lastIndexOf(".");
|
|
11
|
+
if (dot === -1) return void 0;
|
|
12
|
+
return CONTENT_TYPES[path.slice(dot).toLowerCase()];
|
|
13
|
+
}
|
|
14
|
+
function createThemePacksDevMiddleware({
|
|
15
|
+
packsDir,
|
|
16
|
+
enabled,
|
|
17
|
+
routePrefix
|
|
18
|
+
}) {
|
|
19
|
+
const rootDir = resolvePath(packsDir instanceof URL ? fileURLToPath(packsDir) : packsDir);
|
|
20
|
+
const bySlug = new Map(enabled.map((entry) => [entry.slug, entry]));
|
|
21
|
+
const prefix = routePrefix.endsWith("/") ? routePrefix : `${routePrefix}/`;
|
|
22
|
+
const indexPath = `${prefix}index.json`;
|
|
23
|
+
return (req, res, next) => {
|
|
24
|
+
const url = (req.url ?? "").split("?")[0] ?? "";
|
|
25
|
+
if (!url.startsWith(prefix)) {
|
|
26
|
+
next();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (url === indexPath) {
|
|
30
|
+
const manifest = {
|
|
31
|
+
schemaVersion: 1,
|
|
32
|
+
packs: enabled.map((entry2) => entry2.meta)
|
|
33
|
+
};
|
|
34
|
+
res.setHeader("Content-Type", "application/json");
|
|
35
|
+
res.end(JSON.stringify(manifest));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const rest = url.slice(prefix.length);
|
|
39
|
+
const segments = rest.split("/");
|
|
40
|
+
const slug = segments[0];
|
|
41
|
+
const tail = segments.slice(1).join("/");
|
|
42
|
+
if (!slug || segments.some((s) => s === "" || s === "." || s === "..")) {
|
|
43
|
+
next();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const entry = bySlug.get(slug);
|
|
47
|
+
if (!entry) {
|
|
48
|
+
next();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (tail !== "pack.css" && !tail.startsWith("fonts/")) {
|
|
52
|
+
next();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (tail === "pack.css" && !entry.hasStylesheet) {
|
|
56
|
+
next();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const packDir = resolvePath(rootDir, slug);
|
|
60
|
+
const filePath = resolvePath(packDir, tail);
|
|
61
|
+
if (!filePath.startsWith(packDir + sep)) {
|
|
62
|
+
res.statusCode = 400;
|
|
63
|
+
res.end("Bad Request");
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (!existsSync(filePath)) {
|
|
67
|
+
next();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const contentType = contentTypeFor(filePath);
|
|
71
|
+
const isBinary = contentType === "font/woff2";
|
|
72
|
+
const body = isBinary ? readFileSync(filePath) : readFileSync(filePath, "utf8");
|
|
73
|
+
res.statusCode = 200;
|
|
74
|
+
if (contentType) res.setHeader("Content-Type", contentType);
|
|
75
|
+
res.end(body);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
createThemePacksDevMiddleware
|
|
80
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { resolveThemePacksForOptions, hasCssBearingPack } from "./resolve.js";
|
|
2
|
+
export { copyEnabledThemePacks } from "./copy.js";
|
|
3
|
+
export type { CopyThemePacksParams, CopyThemePacksResult } from "./copy.js";
|
|
4
|
+
export { createThemePacksDevMiddleware } from "./dev-middleware.js";
|
|
5
|
+
export type { ThemePacksMiddleware, ThemePacksNextFn, CreateThemePacksDevMiddlewareParams, } from "./dev-middleware.js";
|
|
6
|
+
export type { ThemePacksPluginOptions, ThemePacksIndexManifest } from "./types.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { resolveThemePacksForOptions, hasCssBearingPack } from "./resolve.js";
|
|
2
|
+
import { copyEnabledThemePacks } from "./copy.js";
|
|
3
|
+
import { createThemePacksDevMiddleware } from "./dev-middleware.js";
|
|
4
|
+
export {
|
|
5
|
+
copyEnabledThemePacks,
|
|
6
|
+
createThemePacksDevMiddleware,
|
|
7
|
+
hasCssBearingPack,
|
|
8
|
+
resolveThemePacksForOptions
|
|
9
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ThemePackRegistry } from "../../../theme-packs-registry/index.js";
|
|
2
|
+
import type { ThemePacksPluginOptions } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the ENABLED, ORDERED pack registry for `options` against the
|
|
5
|
+
* shipped `packsDir`. Throws — naming the offending pack/slug — on a broken
|
|
6
|
+
* bundled pack (`loadThemePackRegistry`) or an unknown/duplicate configured
|
|
7
|
+
* slug (`resolveEnabledPacks`); this is the fail-loudly precedent every hook
|
|
8
|
+
* (`setup`, `postBuild`, `devMiddleware`) relies on (never a silent
|
|
9
|
+
* fallback).
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveThemePacksForOptions(packsDir: string | URL, options: ThemePacksPluginOptions): ThemePackRegistry;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the resolved enabled set has anything worth copying/serving — the
|
|
14
|
+
* ADR's dead-weight-avoidance rule: "no-ops when the resolved enabled set has
|
|
15
|
+
* no CSS-bearing pack (i.e. only `default`)".
|
|
16
|
+
*/
|
|
17
|
+
export declare function hasCssBearingPack(enabled: ThemePackRegistry): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadThemePackRegistry,
|
|
3
|
+
resolveEnabledPacks
|
|
4
|
+
} from "../../../theme-packs-registry/index.js";
|
|
5
|
+
function resolveThemePacksForOptions(packsDir, options) {
|
|
6
|
+
return resolveEnabledPacks(loadThemePackRegistry(packsDir), {
|
|
7
|
+
themePack: options.themePack,
|
|
8
|
+
themePacks: options.themePacks
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function hasCssBearingPack(enabled) {
|
|
12
|
+
return enabled.some((entry) => entry.hasStylesheet);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
hasCssBearingPack,
|
|
16
|
+
resolveThemePacksForOptions
|
|
17
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ThemePackMeta } from "../../../theme-packs-registry/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options threaded from `preset.ts`'s `buildPlugins()` into the
|
|
4
|
+
* `@takazudo/zudo-doc/plugins/theme-packs` bare-specifier descriptor — the
|
|
5
|
+
* settings subset `resolveEnabledPacks` needs, plus `base` for URL
|
|
6
|
+
* prefixing in `devMiddleware`.
|
|
7
|
+
*/
|
|
8
|
+
export interface ThemePacksPluginOptions {
|
|
9
|
+
base?: string;
|
|
10
|
+
themePack?: string;
|
|
11
|
+
themePacks?: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The aggregated registry manifest shape written to (postBuild) / served at
|
|
15
|
+
* (devMiddleware) `theme-packs/index.json` — ADR Decision 1, "registry
|
|
16
|
+
* manifest": `{ schemaVersion: 1, packs: ThemePackMeta[] }`, `packs` in the
|
|
17
|
+
* resolved `themePacks` order.
|
|
18
|
+
*/
|
|
19
|
+
export interface ThemePacksIndexManifest {
|
|
20
|
+
schemaVersion: 1;
|
|
21
|
+
packs: ThemePackMeta[];
|
|
22
|
+
}
|
|
File without changes
|
package/dist/plugins/llms-txt.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { emitLlmsTxt, createLlmsTxtDevMiddleware } from "
|
|
1
|
+
import { emitLlmsTxt, createLlmsTxtDevMiddleware } from "./internal/llms-txt/index.js";
|
|
2
2
|
import { connectToZfbHandler } from "./connect-adapter.js";
|
|
3
3
|
import { getBasePrefix } from "./plugin-utils.js";
|
|
4
4
|
const plugin = {
|
package/dist/plugins/routes.js
CHANGED
|
@@ -2,6 +2,10 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
import { existsSync, statSync, cpSync, rmSync, mkdirSync } from "node:fs";
|
|
3
3
|
import { dirname, basename, join } from "node:path";
|
|
4
4
|
import { definePlugin } from "@takazudo/zfb/plugins";
|
|
5
|
+
import {
|
|
6
|
+
loadThemePackRegistry,
|
|
7
|
+
resolveEnabledPacks
|
|
8
|
+
} from "../theme-packs-registry/index.js";
|
|
5
9
|
function deriveRoutes(settings) {
|
|
6
10
|
const routes = [];
|
|
7
11
|
const localeCodes = Object.keys(settings.locales ?? {});
|
|
@@ -70,13 +74,19 @@ const plugin = definePlugin({
|
|
|
70
74
|
const translations = options.translations ?? {};
|
|
71
75
|
const tagVocabulary = options.tagVocabulary ?? [];
|
|
72
76
|
const colorSchemes = options.colorSchemes ?? null;
|
|
77
|
+
const themePacksDir = new URL("../theme-packs/", import.meta.url);
|
|
78
|
+
const themePackRegistry = resolveEnabledPacks(
|
|
79
|
+
loadThemePackRegistry(themePacksDir),
|
|
80
|
+
{ themePack: settings.themePack, themePacks: settings.themePacks }
|
|
81
|
+
);
|
|
73
82
|
ctx.addVirtualModule(
|
|
74
83
|
"virtual:zudo-doc-route-context",
|
|
75
84
|
() => `export const routeContext = ${JSON.stringify({
|
|
76
85
|
settings,
|
|
77
86
|
translations,
|
|
78
87
|
tagVocabulary,
|
|
79
|
-
colorSchemes
|
|
88
|
+
colorSchemes,
|
|
89
|
+
themePackRegistry
|
|
80
90
|
})};
|
|
81
91
|
`
|
|
82
92
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { emitSearchIndex, createSearchIndexDevMiddleware } from "
|
|
1
|
+
import { emitSearchIndex, createSearchIndexDevMiddleware } from "./internal/search-index/index.js";
|
|
2
2
|
import { connectToZfbHandler } from "./connect-adapter.js";
|
|
3
3
|
import { getBasePrefix } from "./plugin-utils.js";
|
|
4
4
|
const plugin = {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveThemePacksForOptions,
|
|
3
|
+
hasCssBearingPack,
|
|
4
|
+
copyEnabledThemePacks,
|
|
5
|
+
createThemePacksDevMiddleware
|
|
6
|
+
} from "./internal/theme-packs/index.js";
|
|
7
|
+
import { connectToZfbHandler } from "./connect-adapter.js";
|
|
8
|
+
import { getBasePrefix } from "./plugin-utils.js";
|
|
9
|
+
function themePacksDir() {
|
|
10
|
+
return new URL("../theme-packs/", import.meta.url);
|
|
11
|
+
}
|
|
12
|
+
const plugin = {
|
|
13
|
+
name: "theme-packs",
|
|
14
|
+
setup(ctx) {
|
|
15
|
+
const options = ctx.options;
|
|
16
|
+
resolveThemePacksForOptions(themePacksDir(), options);
|
|
17
|
+
},
|
|
18
|
+
async postBuild(ctx) {
|
|
19
|
+
const options = ctx.options;
|
|
20
|
+
const enabled = resolveThemePacksForOptions(themePacksDir(), options);
|
|
21
|
+
copyEnabledThemePacks({ packsDir: themePacksDir(), enabled, outDir: ctx.outDir });
|
|
22
|
+
},
|
|
23
|
+
devMiddleware(ctx) {
|
|
24
|
+
const options = ctx.options;
|
|
25
|
+
const enabled = resolveThemePacksForOptions(themePacksDir(), options);
|
|
26
|
+
if (!hasCssBearingPack(enabled)) return;
|
|
27
|
+
const basePrefix = getBasePrefix(options.base);
|
|
28
|
+
const routePrefix = `${basePrefix}/theme-packs`;
|
|
29
|
+
const middleware = createThemePacksDevMiddleware({
|
|
30
|
+
packsDir: themePacksDir(),
|
|
31
|
+
enabled,
|
|
32
|
+
routePrefix
|
|
33
|
+
});
|
|
34
|
+
ctx.register(routePrefix, connectToZfbHandler(middleware));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var theme_packs_default = plugin;
|
|
38
|
+
export {
|
|
39
|
+
theme_packs_default as default
|
|
40
|
+
};
|