@takazudo/zudo-doc 11.0.0 → 12.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 +19 -0
- package/dist/agent-docs/search.js +6 -3
- package/dist/config.js +5 -0
- package/dist/content-admonition/index.d.ts +2 -1
- package/dist/content-admonition/index.js +2 -1
- package/dist/doc-page-renderer/index.d.ts +4 -0
- package/dist/doc-page-renderer/index.js +5 -0
- package/dist/doc-page-shell/index.d.ts +9 -0
- package/dist/doc-page-shell/index.js +2 -0
- package/dist/head-with-defaults/index.d.ts +9 -0
- package/dist/head-with-defaults/index.js +10 -0
- package/dist/home-page/index.js +8 -0
- package/dist/mcp/handler.js +1 -7
- package/dist/md-utils/index.d.ts +6 -1
- package/dist/md-utils/index.js +3 -2
- package/dist/mdx-components/index.js +4 -7
- package/dist/mdx-components/vocabulary.d.ts +19 -0
- package/dist/mdx-components/vocabulary.js +32 -0
- package/dist/plugins/internal/agent-export/components.d.ts +27 -0
- package/dist/plugins/internal/agent-export/components.js +125 -0
- package/dist/plugins/internal/agent-export/index.d.ts +4 -0
- package/dist/plugins/internal/agent-export/index.js +29 -8
- package/dist/plugins/internal/agent-export/normalize.d.ts +18 -1
- package/dist/plugins/internal/agent-export/normalize.js +91 -5
- package/dist/plugins/internal/llms-txt/dev-middleware.d.ts +2 -0
- package/dist/plugins/internal/llms-txt/dev-middleware.js +1 -0
- package/dist/plugins/internal/llms-txt/emit.js +3 -0
- package/dist/plugins/internal/llms-txt/load.js +2 -2
- package/dist/plugins/internal/llms-txt/types.d.ts +4 -0
- package/dist/plugins/internal/search-index/collect.js +5 -4
- package/dist/plugins/internal/search-index/types.d.ts +2 -0
- package/dist/preset.d.ts +2 -0
- package/dist/preset.js +5 -1
- package/dist/route-enumerators/index.d.ts +63 -2
- package/dist/route-enumerators/index.js +124 -21
- package/dist/routes/_context.d.ts +1 -1
- package/dist/routes/_context.js +6 -0
- package/dist/routes/sitemap.xml.js +19 -9
- package/eject/content-admonition/index.tsx +4 -9
- package/package.json +3 -3
- package/routes-src/_context.ts +3 -0
- package/routes-src/sitemap.xml.tsx +36 -12
|
@@ -15,14 +15,9 @@
|
|
|
15
15
|
// stays presentation-agnostic.
|
|
16
16
|
import type { Child } from "@takazudo/zfb/zudo-react";
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
| "info"
|
|
22
|
-
| "warning"
|
|
23
|
-
| "danger"
|
|
24
|
-
| "caution"
|
|
25
|
-
| "important";
|
|
18
|
+
import { admonitionComponentName, type AdmonitionVariant } from "../mdx-components/vocabulary.js";
|
|
19
|
+
|
|
20
|
+
export type { AdmonitionVariant };
|
|
26
21
|
|
|
27
22
|
export interface AdmonitionProps {
|
|
28
23
|
/** Custom title; falls back to the capitalized variant name (e.g. "Note"). */
|
|
@@ -36,7 +31,7 @@ export interface AdmonitionProps {
|
|
|
36
31
|
* no `title` — matching the Astro reference where every callout shows a title.
|
|
37
32
|
*/
|
|
38
33
|
export function makeAdmonition(variant: AdmonitionVariant) {
|
|
39
|
-
const defaultTitle =
|
|
34
|
+
const defaultTitle = admonitionComponentName(variant);
|
|
40
35
|
return function Admonition({ title, children }: AdmonitionProps): Child {
|
|
41
36
|
const heading = title && title.length > 0 ? title : defaultTitle;
|
|
42
37
|
return (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takazudo/zudo-doc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.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",
|
|
@@ -768,7 +768,7 @@
|
|
|
768
768
|
"@takazudo/zfb": "^6.0.1",
|
|
769
769
|
"@takazudo/zfb-md-wasm": "^6.0.1",
|
|
770
770
|
"@takazudo/zfb-runtime": "^6.0.1",
|
|
771
|
-
"@takazudo/zudo-doc-history-server": "^
|
|
771
|
+
"@takazudo/zudo-doc-history-server": "^12.0.0",
|
|
772
772
|
"diff": "^8.0.0 || ^9.0.0",
|
|
773
773
|
"katex": "^0.18.2 || ^0.19.0",
|
|
774
774
|
"zod": "^4.3.6"
|
|
@@ -823,7 +823,7 @@
|
|
|
823
823
|
"typescript": "^7.0.2",
|
|
824
824
|
"vitest": "5.1.0",
|
|
825
825
|
"zod": "^4.6.7",
|
|
826
|
-
"@takazudo/zudo-doc-history-server": "
|
|
826
|
+
"@takazudo/zudo-doc-history-server": "12.0.0"
|
|
827
827
|
},
|
|
828
828
|
"scripts": {
|
|
829
829
|
"gen:search-widget-script": "node scripts/gen-search-widget-script.mjs",
|
package/routes-src/_context.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
// Package route entrypoint: /sitemap.xml — package-owned equivalent of
|
|
2
2
|
// pages/sitemap.xml.tsx (epic Package-First Finale #2356, A1 #2361).
|
|
3
3
|
//
|
|
4
|
-
// URL enumeration is delegated to `
|
|
4
|
+
// URL enumeration is delegated to `enumerateSitemapEntries` (reconstructed in
|
|
5
5
|
// `_context` from `@takazudo/zudo-doc/route-enumerators`) so the sitemap cannot
|
|
6
6
|
// drift from the actual routes the page entrypoints build. Dormant unless
|
|
7
7
|
// `settings.packageOwnedRoutes` is on (Decision 6 precedence still applies).
|
|
8
|
+
//
|
|
9
|
+
// `lastmod` comes from the same doc-history manifest the visible "Updated"
|
|
10
|
+
// label reads (`chromeBindings.docHistoryMeta`, #4784); a route with no known
|
|
11
|
+
// date omits `<lastmod>` rather than claiming the build date.
|
|
8
12
|
|
|
9
|
-
import {
|
|
13
|
+
import { chromeBindings } from "virtual:zudo-doc-chrome-bindings";
|
|
14
|
+
import { settings, enumerateSitemapEntries } from "./_context.js";
|
|
10
15
|
|
|
11
16
|
export const frontmatter = { title: "Sitemap" };
|
|
12
17
|
export const contentType = "application/xml";
|
|
@@ -38,21 +43,40 @@ export default function Sitemap(): string {
|
|
|
38
43
|
</urlset>`;
|
|
39
44
|
}
|
|
40
45
|
|
|
41
|
-
const
|
|
46
|
+
const entries = enumerateSitemapEntries({
|
|
47
|
+
docHistoryMeta: settings.docHistory ? chromeBindings.docHistoryMeta : undefined,
|
|
48
|
+
});
|
|
42
49
|
const siteUrlBase = (settings.siteUrl ?? "").replace(/\/$/, "");
|
|
43
50
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
)
|
|
51
|
+
// hreflang alternates need absolute URLs, so they require siteUrl. The
|
|
52
|
+
// xhtml namespace is declared only when some entry carries one, keeping
|
|
53
|
+
// single-locale output byte-identical (#4787).
|
|
54
|
+
const withAlternates = siteUrlBase !== "" && entries.some((e) => e.alternates);
|
|
55
|
+
|
|
56
|
+
const urlEntries = entries
|
|
57
|
+
.sort((a, b) => a.url.localeCompare(b.url))
|
|
58
|
+
.map(({ url, lastmod, alternates }) => {
|
|
59
|
+
const lastmodLine = lastmod ? `\n <lastmod>${lastmod}</lastmod>` : "";
|
|
60
|
+
const alternateLines = withAlternates && alternates
|
|
61
|
+
? alternates
|
|
62
|
+
.map(
|
|
63
|
+
(a) =>
|
|
64
|
+
`\n <xhtml:link rel="alternate" hreflang="${escapeXml(a.hreflang)}" href="${escapeXml(siteUrlBase + a.url)}"/>`,
|
|
65
|
+
)
|
|
66
|
+
.join("")
|
|
67
|
+
: "";
|
|
68
|
+
return ` <url>
|
|
69
|
+
<loc>${escapeXml(siteUrlBase + url)}</loc>${lastmodLine}${alternateLines}
|
|
70
|
+
</url>`;
|
|
71
|
+
})
|
|
52
72
|
.join("\n");
|
|
53
73
|
|
|
74
|
+
const urlsetOpen = withAlternates
|
|
75
|
+
? '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">'
|
|
76
|
+
: '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
|
|
77
|
+
|
|
54
78
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
55
|
-
|
|
79
|
+
${urlsetOpen}
|
|
56
80
|
${urlEntries}
|
|
57
81
|
</urlset>
|
|
58
82
|
`;
|