create-zudo-doc 3.2.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/README.md +3 -2
- package/dist/api.d.ts +2 -0
- package/dist/api.js +9 -1
- package/dist/claude-md-gen.d.ts +8 -0
- package/dist/claude-md-gen.js +44 -26
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +11 -1
- package/dist/compose.d.ts +14 -20
- package/dist/compose.js +15 -25
- package/dist/constants.d.ts +6 -0
- package/dist/constants.js +123 -1
- package/dist/features/body-foot-util.d.ts +8 -4
- package/dist/features/body-foot-util.js +8 -4
- package/dist/features/claude-resources.d.ts +9 -0
- package/dist/features/claude-resources.js +10 -6
- package/dist/features/design-token-panel.d.ts +0 -12
- package/dist/features/design-token-panel.js +32 -93
- package/dist/features/doc-history.d.ts +19 -3
- package/dist/features/doc-history.js +49 -60
- package/dist/features/doc-tags.d.ts +9 -13
- package/dist/features/doc-tags.js +10 -26
- package/dist/features/dynamic-page-transition.d.ts +19 -30
- package/dist/features/dynamic-page-transition.js +21 -209
- package/dist/features/footer-taglist.d.ts +1 -1
- package/dist/features/footer-taglist.js +1 -1
- package/dist/features/footer.d.ts +3 -2
- package/dist/features/footer.js +3 -2
- package/dist/features/i18n.d.ts +13 -8
- package/dist/features/i18n.js +14 -9
- package/dist/features/image-enlarge.d.ts +7 -26
- package/dist/features/image-enlarge.js +7 -26
- package/dist/features/index.js +2 -0
- package/dist/features/llms-txt.d.ts +3 -5
- package/dist/features/llms-txt.js +3 -5
- package/dist/features/search.d.ts +7 -3
- package/dist/features/search.js +7 -3
- package/dist/features/sidebar-resizer.d.ts +4 -8
- package/dist/features/sidebar-resizer.js +4 -8
- package/dist/features/sidebar-toggle.d.ts +7 -7
- package/dist/features/sidebar-toggle.js +7 -7
- package/dist/features/tag-governance.d.ts +3 -8
- package/dist/features/tag-governance.js +37 -9
- package/dist/features/tauri.d.ts +13 -10
- package/dist/features/tauri.js +16 -52
- package/dist/features/theme-pack-switcher.d.ts +11 -0
- package/dist/features/theme-pack-switcher.js +13 -0
- package/dist/features/versioning.d.ts +12 -24
- package/dist/features/versioning.js +13 -39
- package/dist/index.js +5 -3
- package/dist/preset.d.ts +2 -0
- package/dist/preset.js +12 -1
- package/dist/prompts.d.ts +2 -0
- package/dist/prompts.js +22 -1
- package/dist/scaffold.d.ts +13 -6
- package/dist/scaffold.js +97 -78
- package/dist/utils.d.ts +10 -0
- package/dist/utils.js +14 -0
- package/dist/zfb-config-gen.d.ts +32 -20
- package/dist/zfb-config-gen.js +410 -53
- package/package.json +2 -2
- package/templates/base/pages/docs/[[...slug]].tsx +64 -0
- package/templates/base/pages/index.tsx +6 -41
- package/templates/base/src/styles/global.css +15 -340
- package/templates/base/tsconfig.json +3 -26
- package/templates/features/i18n/files/pages/[locale]/docs/[[...slug]].tsx +92 -0
- package/dist/settings-gen.d.ts +0 -2
- package/dist/settings-gen.js +0 -320
- package/templates/base/.htmlvalidate.json +0 -5
- package/templates/base/.zfb/doc-history-meta.json +0 -1
- package/templates/base/pages/_data.ts +0 -160
- package/templates/base/pages/lib/_body-end-islands.tsx +0 -165
- package/templates/base/pages/lib/_chrome.ts +0 -167
- package/templates/base/pages/lib/_details.tsx +0 -29
- package/templates/base/pages/lib/_doc-route-entries.ts +0 -10
- package/templates/base/pages/lib/_extract-headings.ts +0 -37
- package/templates/base/pages/lib/_frontmatter-preview-data.ts +0 -27
- package/templates/base/pages/lib/_nav-source-cache.ts +0 -100
- package/templates/base/pages/lib/_nav-source-docs.ts +0 -17
- package/templates/base/pages/lib/_preset-generator.tsx +0 -81
- package/templates/base/pages/lib/_route-context.ts +0 -32
- package/templates/base/pages/lib/_search-widget.tsx +0 -17
- package/templates/base/pages/lib/doc-page-props.ts +0 -30
- package/templates/base/pages/lib/locale-merge.ts +0 -59
- package/templates/base/scripts/run-b4push.sh +0 -102
- package/templates/base/src/components/ai-chat-modal.tsx +0 -18
- package/templates/base/src/components/content/code-group.tsx +0 -3
- package/templates/base/src/components/content/content-admonition.tsx +0 -4
- package/templates/base/src/components/desktop-sidebar-toggle.tsx +0 -15
- package/templates/base/src/components/doc-history.tsx +0 -21
- package/templates/base/src/components/image-enlarge.tsx +0 -24
- package/templates/base/src/components/preset-generator.tsx +0 -14
- package/templates/base/src/components/sidebar-toggle.tsx +0 -6
- package/templates/base/src/components/sidebar-tree.tsx +0 -6
- package/templates/base/src/config/color-scheme-utils.ts +0 -69
- package/templates/base/src/config/color-schemes.ts +0 -165
- package/templates/base/src/config/docs-schema.ts +0 -95
- package/templates/base/src/config/frontmatter-preview-defaults.ts +0 -27
- package/templates/base/src/config/frontmatter-preview-renderers.tsx +0 -46
- package/templates/base/src/config/i18n.ts +0 -239
- package/templates/base/src/config/settings-types.ts +0 -45
- package/templates/base/src/config/sidebars.ts +0 -66
- package/templates/base/src/config/tag-vocabulary-types.ts +0 -4
- package/templates/base/src/config/tag-vocabulary.ts +0 -20
- package/templates/base/src/config/z-index-tokens.ts +0 -128
- package/templates/base/src/types/docs-entry.ts +0 -28
- package/templates/base/src/types/heading.ts +0 -5
- package/templates/base/src/types/locale.ts +0 -10
- package/templates/base/src/utils/base.ts +0 -164
- package/templates/base/src/utils/docs.ts +0 -446
- package/templates/base/src/utils/git-info.ts +0 -70
- package/templates/base/src/utils/github.ts +0 -22
- package/templates/base/src/utils/nav-scope.ts +0 -34
- package/templates/base/src/utils/sidebar.ts +0 -36
- package/templates/base/src/utils/slug.ts +0 -10
- package/templates/base/src/utils/smart-break.tsx +0 -12
- package/templates/base/src/utils/tags.ts +0 -83
- package/templates/base/zfb-shim.d.ts +0 -183
- package/templates/features/bodyFootUtil/files/src/utils/github.ts +0 -22
- package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/escape-for-mdx.test.ts +0 -42
- package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/generate.test.ts +0 -752
- package/templates/features/claudeResources/files/src/integrations/claude-resources/escape-for-mdx.ts +0 -97
- package/templates/features/claudeResources/files/src/integrations/claude-resources/generate.ts +0 -735
- package/templates/features/designTokenPanel/files/src/components/design-token-panel-bootstrap.tsx +0 -15
- package/templates/features/designTokenPanel/files/src/config/design-token-panel-config.ts +0 -435
- package/templates/features/designTokenPanel/files/src/config/design-tokens-manifest.ts +0 -174
- package/templates/features/designTokenPanel/files/src/lib/design-token-panel-bootstrap.ts +0 -30
- package/templates/features/docHistory/files/src/components/doc-history.tsx +0 -10
- package/templates/features/docHistory/files/src/types/doc-history.ts +0 -7
- package/templates/features/dynamicPageTransition/files/src/components/client-router-bootstrap.tsx +0 -72
- package/templates/features/i18n/files/pages/[locale]/index.tsx +0 -72
- package/templates/features/imageEnlarge/files/src/components/image-enlarge.tsx +0 -11
- package/templates/features/sidebarToggle/files/src/components/desktop-sidebar-toggle.tsx +0 -6
- package/templates/features/tagGovernance/files/scripts/tags-audit.ts +0 -131
- package/templates/features/tagGovernance/files/scripts/tags-suggest.ts +0 -428
- package/templates/features/tauri/files/src/components/find-bar.tsx +0 -122
- package/templates/features/tauri/files/src/components/find-in-page-init.tsx +0 -59
- package/templates/features/tauri/files/src/utils/find-in-page.ts +0 -175
|
@@ -1,100 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Emitted as a <script dangerouslySetInnerHTML> alongside the
|
|
5
|
-
* DesignTokenPanelBootstrap Island so the header palette button is
|
|
6
|
-
* responsive before the island hydrates. Records the first click as a
|
|
7
|
-
* boolean flag and exposes window.__zdtpReadyClicks so the bootstrap
|
|
8
|
-
* module can drain and re-dispatch once the real zdtp listener is live.
|
|
9
|
-
* Guards against double-installation across SPA body swaps via
|
|
10
|
-
* __zdtpToggleShimInstalled. Mirrors the host's ZDTP_TOGGLE_SHIM_SRC
|
|
11
|
-
* constant (pages/lib/_body-end-islands.tsx, zudolab/zudo-doc#1627 Part B).
|
|
12
|
-
*/
|
|
13
|
-
const ZDTP_TOGGLE_SHIM_SRC = `(function(){
|
|
14
|
-
if(window.__zdtpToggleShimInstalled)return;
|
|
15
|
-
window.__zdtpToggleShimInstalled=true;
|
|
16
|
-
var pending=false;
|
|
17
|
-
function shim(){pending=true;}
|
|
18
|
-
window.addEventListener('toggle-design-token-panel',shim);
|
|
19
|
-
window.__zdtpReadyClicks=function(){
|
|
20
|
-
window.removeEventListener('toggle-design-token-panel',shim);
|
|
21
|
-
delete window.__zdtpReadyClicks;
|
|
22
|
-
if(pending){pending=false;window.dispatchEvent(new CustomEvent('toggle-design-token-panel'));}
|
|
23
|
-
};
|
|
24
|
-
})();`;
|
|
1
|
+
import fs from "fs-extra";
|
|
2
|
+
import path from "path";
|
|
25
3
|
/**
|
|
26
4
|
* Design-token-panel (zdtp) feature.
|
|
27
5
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
6
|
+
* Minimal-scaffold cutover (epic zudolab/zudo-doc#2651, Wave 6 #2660): the
|
|
7
|
+
* bootstrap island, its config builder, and the pre-hydration toggle shim
|
|
8
|
+
* are ALL package-owned now —
|
|
9
|
+
* `chrome/derive.tsx`'s `deriveBodyEndIslands` auto-defaults the real
|
|
10
|
+
* `DesignTokenPanelBootstrap` island for every `createChrome` consumer
|
|
11
|
+
* (#2658 gate-2 fix, verified against the locked-manifest self-contained
|
|
12
|
+
* doc stub in the target-manifest confirm fixture), and
|
|
13
|
+
* `doc-body-end-islands/index.tsx` carries the toggle shim inline. So this
|
|
14
|
+
* feature has nothing left to inject into `pages/lib/_body-end-islands.tsx`
|
|
15
|
+
* or `src/config/settings-types.ts` — both files are gone anyway.
|
|
16
|
+
*
|
|
17
|
+
* The ONE thing that stays generator-owned: `@takazudo/zdtp/styles.css` is
|
|
18
|
+
* the single conditional line in `src/styles/global.css` (documented in
|
|
19
|
+
* that file's header comment) — it can't ship unconditionally from
|
|
20
|
+
* `@takazudo/zudo-doc/theme.css` because it pulls in zdtp's own bytes.
|
|
21
|
+
* Inserted right after the `@layer zd-preflight, zd-flow;` line (the same
|
|
22
|
+
* position the locked-manifest reference shape uses).
|
|
36
23
|
*/
|
|
24
|
+
const ZDTP_IMPORT_LINE = `@import "@takazudo/zdtp/styles.css";`;
|
|
25
|
+
const LAYER_LINE = `@layer zd-preflight, zd-flow;`;
|
|
37
26
|
export const designTokenPanelFeature = () => ({
|
|
38
27
|
name: "designTokenPanel",
|
|
39
|
-
injections: [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// 1. Import the island entry. Inserted AFTER the
|
|
51
|
-
// `// @slot:body-end-islands:imports` anchor.
|
|
52
|
-
{
|
|
53
|
-
file: "pages/lib/_body-end-islands.tsx",
|
|
54
|
-
anchor: "// @slot:body-end-islands:imports",
|
|
55
|
-
position: "after",
|
|
56
|
-
content: `import DesignTokenPanelBootstrap from "@/components/design-token-panel-bootstrap";`,
|
|
57
|
-
},
|
|
58
|
-
// 2. Stable island marker name (belt-and-braces guard matching the
|
|
59
|
-
// sibling islands in the file). Inserted AFTER the
|
|
60
|
-
// `// @slot:body-end-islands:display-names` anchor.
|
|
61
|
-
{
|
|
62
|
-
file: "pages/lib/_body-end-islands.tsx",
|
|
63
|
-
anchor: "// @slot:body-end-islands:display-names",
|
|
64
|
-
position: "after",
|
|
65
|
-
content: `(DesignTokenPanelBootstrap as { displayName?: string }).displayName = "DesignTokenPanelBootstrap";`,
|
|
66
|
-
},
|
|
67
|
-
// 4. Extend HeaderRightTriggerName with "design-token-panel". Uses
|
|
68
|
-
// replace-range between the :start/:end anchors in settings-types.ts
|
|
69
|
-
// so the base template emits only "ai-chat" and this injection adds
|
|
70
|
-
// the zdtp trigger only when the feature is on (zudolab/zudo-doc#2162).
|
|
71
|
-
{
|
|
72
|
-
file: "src/config/settings-types.ts",
|
|
73
|
-
anchor: "// @slot:settings-types:trigger-names:start",
|
|
74
|
-
position: "replace",
|
|
75
|
-
content: `export type HeaderRightTriggerName = "design-token-panel" | "ai-chat";`,
|
|
76
|
-
},
|
|
77
|
-
// 3. Island mount + pre-hydration toggle shim. Inserted AFTER the
|
|
78
|
-
// `{/* @slot:body-end-islands:extra-islands */}` anchor.
|
|
79
|
-
// when="load" (not "idle"): the bootstrap module registers the
|
|
80
|
-
// `toggle-design-token-panel` window listener as a side effect of
|
|
81
|
-
// its import, so it must hydrate as early as possible (zudolab/zudo-doc#1623).
|
|
82
|
-
// The inline <script> is the pre-hydration shim (zudolab/zudo-doc#1627 Part B).
|
|
83
|
-
{
|
|
84
|
-
file: "pages/lib/_body-end-islands.tsx",
|
|
85
|
-
anchor: "{/* @slot:body-end-islands:extra-islands */}",
|
|
86
|
-
position: "after",
|
|
87
|
-
content: ` {/* zdtp panel bootstrap: hydrates on load so configurePanel() runs early
|
|
88
|
-
and the toggle-design-token-panel listener is live before the user
|
|
89
|
-
clicks the header trigger. The inline script is the pre-hydration
|
|
90
|
-
shim that queues the first click (zudolab/zudo-doc#1627 Part B). */}
|
|
91
|
-
<script
|
|
92
|
-
dangerouslySetInnerHTML={{ __html: ${JSON.stringify(ZDTP_TOGGLE_SHIM_SRC)} }}
|
|
93
|
-
/>
|
|
94
|
-
{Island({
|
|
95
|
-
when: "load",
|
|
96
|
-
children: <DesignTokenPanelBootstrap />,
|
|
97
|
-
}) as unknown as VNode}`,
|
|
98
|
-
},
|
|
99
|
-
],
|
|
28
|
+
injections: [],
|
|
29
|
+
postProcess: async (targetDir) => {
|
|
30
|
+
const cssPath = path.join(targetDir, "src/styles/global.css");
|
|
31
|
+
if (!(await fs.pathExists(cssPath)))
|
|
32
|
+
return;
|
|
33
|
+
let content = await fs.readFile(cssPath, "utf-8");
|
|
34
|
+
if (content.includes(ZDTP_IMPORT_LINE))
|
|
35
|
+
return; // already patched (idempotent)
|
|
36
|
+
content = content.replace(LAYER_LINE, `${LAYER_LINE}\n${ZDTP_IMPORT_LINE}`);
|
|
37
|
+
await fs.writeFile(cssPath, content);
|
|
38
|
+
},
|
|
100
39
|
});
|
|
@@ -2,8 +2,24 @@ import type { FeatureModule } from "../compose.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Doc-history feature.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Minimal-scaffold cutover (epic zudolab/zudo-doc#2651, Wave 6 #2660):
|
|
6
|
+
* `settings.docHistory` is a plain zudoDoc() field now (see zfb-config-gen.ts)
|
|
7
|
+
* and the diff-viewer CSS (`.diff-row`/`.diff-line-*`) ships unconditionally
|
|
8
|
+
* from `@takazudo/zudo-doc/features.css` (epic #2344 S4) — the old
|
|
9
|
+
* `@slot:global-css:feature-styles` CSS injection this module used to carry
|
|
10
|
+
* is DEAD (the anchor no longer exists in the ~20-line `global.css`) and has
|
|
11
|
+
* been removed.
|
|
12
|
+
*
|
|
13
|
+
* What's left to wire: the self-contained doc-route stub(s)
|
|
14
|
+
* (`pages/docs/[[...slug]].tsx`, and its i18n locale sibling when i18n is
|
|
15
|
+
* also selected) always thread the host's `chromeBindings`. Unlike
|
|
16
|
+
* `DesignTokenPanelBootstrap` (auto-defaulted at the chrome-derive seam,
|
|
17
|
+
* #2658 gate-2 fix), `DocHistory`'s derive-level default is a deliberate
|
|
18
|
+
* no-op stub (see `routes/_chrome.tsx`'s comment on why — its own island
|
|
19
|
+
* needs the REAL host binding to hydrate). So when docHistory is selected,
|
|
20
|
+
* this feature patches the stub(s) to statically import the real
|
|
21
|
+
* `DocHistory` component and merge it over those bindings — preserving every
|
|
22
|
+
* configured host slot while maintaining the same #2480 scanner-reachability
|
|
23
|
+
* chain `routes/_chrome.tsx` uses for the package's own routes.
|
|
8
24
|
*/
|
|
9
25
|
export declare const docHistoryFeature: FeatureModule;
|
|
@@ -1,67 +1,56 @@
|
|
|
1
|
+
import fs from "fs-extra";
|
|
2
|
+
import path from "path";
|
|
1
3
|
/**
|
|
2
4
|
* Doc-history feature.
|
|
3
5
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
6
|
+
* Minimal-scaffold cutover (epic zudolab/zudo-doc#2651, Wave 6 #2660):
|
|
7
|
+
* `settings.docHistory` is a plain zudoDoc() field now (see zfb-config-gen.ts)
|
|
8
|
+
* and the diff-viewer CSS (`.diff-row`/`.diff-line-*`) ships unconditionally
|
|
9
|
+
* from `@takazudo/zudo-doc/features.css` (epic #2344 S4) — the old
|
|
10
|
+
* `@slot:global-css:feature-styles` CSS injection this module used to carry
|
|
11
|
+
* is DEAD (the anchor no longer exists in the ~20-line `global.css`) and has
|
|
12
|
+
* been removed.
|
|
13
|
+
*
|
|
14
|
+
* What's left to wire: the self-contained doc-route stub(s)
|
|
15
|
+
* (`pages/docs/[[...slug]].tsx`, and its i18n locale sibling when i18n is
|
|
16
|
+
* also selected) always thread the host's `chromeBindings`. Unlike
|
|
17
|
+
* `DesignTokenPanelBootstrap` (auto-defaulted at the chrome-derive seam,
|
|
18
|
+
* #2658 gate-2 fix), `DocHistory`'s derive-level default is a deliberate
|
|
19
|
+
* no-op stub (see `routes/_chrome.tsx`'s comment on why — its own island
|
|
20
|
+
* needs the REAL host binding to hydrate). So when docHistory is selected,
|
|
21
|
+
* this feature patches the stub(s) to statically import the real
|
|
22
|
+
* `DocHistory` component and merge it over those bindings — preserving every
|
|
23
|
+
* configured host slot while maintaining the same #2480 scanner-reachability
|
|
24
|
+
* chain `routes/_chrome.tsx` uses for the package's own routes.
|
|
7
25
|
*/
|
|
8
26
|
export const docHistoryFeature = () => ({
|
|
9
27
|
name: "docHistory",
|
|
10
|
-
injections: [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
content
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.diff-line-content {
|
|
40
|
-
font-family: var(--font-mono, ui-monospace, monospace);
|
|
41
|
-
font-size: var(--text-caption);
|
|
42
|
-
line-height: 1.5;
|
|
43
|
-
padding: 0 var(--spacing-hsp-sm);
|
|
44
|
-
white-space: pre-wrap;
|
|
45
|
-
word-break: break-all;
|
|
46
|
-
vertical-align: top;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* Left column right border to separate the two sides */
|
|
50
|
-
.diff-row td:nth-child(2) {
|
|
51
|
-
border-right: 2px solid var(--color-muted);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.diff-line-added {
|
|
55
|
-
background-color: color-mix(in oklch, var(--color-success) 15%, transparent);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.diff-line-removed {
|
|
59
|
-
background-color: color-mix(in oklch, var(--color-danger) 15%, transparent);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.diff-line-empty {
|
|
63
|
-
background-color: color-mix(in oklch, var(--color-muted) 8%, transparent);
|
|
64
|
-
}`,
|
|
65
|
-
},
|
|
66
|
-
],
|
|
28
|
+
injections: [],
|
|
29
|
+
postProcess: async (targetDir) => {
|
|
30
|
+
const stubPaths = [
|
|
31
|
+
path.join(targetDir, "pages", "docs", "[[...slug]].tsx"),
|
|
32
|
+
path.join(targetDir, "pages", "[locale]", "docs", "[[...slug]].tsx"),
|
|
33
|
+
];
|
|
34
|
+
for (const stubPath of stubPaths) {
|
|
35
|
+
if (!(await fs.pathExists(stubPath)))
|
|
36
|
+
continue;
|
|
37
|
+
let content = await fs.readFile(stubPath, "utf-8");
|
|
38
|
+
// Idempotency guard: check for the actual inserted import statement,
|
|
39
|
+
// NOT a bare `.includes("DocHistory")` — this file's own header
|
|
40
|
+
// comment (explaining WHY this patch exists) mentions "DocHistory" in
|
|
41
|
+
// prose, which would false-positive a weaker check and skip patching
|
|
42
|
+
// on every run.
|
|
43
|
+
const importMarker = `import { DocHistory } from "@takazudo/zudo-doc/doc-history";`;
|
|
44
|
+
if (content.includes(importMarker))
|
|
45
|
+
continue; // already patched
|
|
46
|
+
content = content.replace(`import { createChrome } from "@takazudo/zudo-doc/chrome";`, `import { createChrome } from "@takazudo/zudo-doc/chrome";
|
|
47
|
+
${importMarker}
|
|
48
|
+
import { defineChromeBindings } from "@takazudo/zudo-doc/chrome-bindings";`);
|
|
49
|
+
content = content.replace(`const { renderDocPage } = createChrome(routeCtx, chromeBindings);`, `const { renderDocPage } = createChrome(routeCtx, {
|
|
50
|
+
...chromeBindings,
|
|
51
|
+
...defineChromeBindings({ DocHistory }),
|
|
52
|
+
});`);
|
|
53
|
+
await fs.writeFile(stubPath, content);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
67
56
|
});
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import type { FeatureModule } from "../compose.js";
|
|
2
2
|
/**
|
|
3
|
-
* docTags feature
|
|
3
|
+
* docTags feature.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Purely a `zudoDoc({ docTags: true })` field (see `zfb-config-gen.ts`) —
|
|
6
|
+
* the `/docs/tags` + `/docs/tags/[tag]` routes are PACKAGE-INJECTED
|
|
7
|
+
* (`routes/docs-tags-index.tsx` / `routes/docs-tags-tag.tsx`), gated on
|
|
8
|
+
* `settings.docTags`. `templates/features/docTags/files/` has been empty
|
|
9
|
+
* since the host catch-all stubs were retired in favor of package
|
|
10
|
+
* injection — there is nothing left to copy or postProcess.
|
|
6
11
|
*
|
|
7
|
-
*
|
|
8
|
-
* `
|
|
9
|
-
*
|
|
10
|
-
* docs/tags/[tag].tsx
|
|
11
|
-
* docs/tags/index.tsx
|
|
12
|
-
* [locale]/docs/tags/[tag].tsx — only when i18n ALSO selected
|
|
13
|
-
* [locale]/docs/tags/index.tsx — only when i18n ALSO selected
|
|
14
|
-
*
|
|
15
|
-
* `copyFeatureFiles` (compose.ts) auto-emits every file under
|
|
16
|
-
* `files/`; postProcess removes the `[locale]/**` subset when i18n
|
|
17
|
-
* is NOT selected. See W2 spec-lock §Cross-feature interaction.
|
|
12
|
+
* Known limitation: same injected-DYNAMIC-route dev-mode gap noted on the
|
|
13
|
+
* versioning feature — the tag routes may 404 in `zfb dev` (build is fine).
|
|
18
14
|
*/
|
|
19
15
|
export declare const docTagsFeature: FeatureModule;
|
|
@@ -1,33 +1,17 @@
|
|
|
1
|
-
import fs from "fs-extra";
|
|
2
|
-
import path from "path";
|
|
3
1
|
/**
|
|
4
|
-
* docTags feature
|
|
2
|
+
* docTags feature.
|
|
5
3
|
*
|
|
6
|
-
*
|
|
4
|
+
* Purely a `zudoDoc({ docTags: true })` field (see `zfb-config-gen.ts`) —
|
|
5
|
+
* the `/docs/tags` + `/docs/tags/[tag]` routes are PACKAGE-INJECTED
|
|
6
|
+
* (`routes/docs-tags-index.tsx` / `routes/docs-tags-tag.tsx`), gated on
|
|
7
|
+
* `settings.docTags`. `templates/features/docTags/files/` has been empty
|
|
8
|
+
* since the host catch-all stubs were retired in favor of package
|
|
9
|
+
* injection — there is nothing left to copy or postProcess.
|
|
7
10
|
*
|
|
8
|
-
*
|
|
9
|
-
* `
|
|
10
|
-
*
|
|
11
|
-
* docs/tags/[tag].tsx
|
|
12
|
-
* docs/tags/index.tsx
|
|
13
|
-
* [locale]/docs/tags/[tag].tsx — only when i18n ALSO selected
|
|
14
|
-
* [locale]/docs/tags/index.tsx — only when i18n ALSO selected
|
|
15
|
-
*
|
|
16
|
-
* `copyFeatureFiles` (compose.ts) auto-emits every file under
|
|
17
|
-
* `files/`; postProcess removes the `[locale]/**` subset when i18n
|
|
18
|
-
* is NOT selected. See W2 spec-lock §Cross-feature interaction.
|
|
11
|
+
* Known limitation: same injected-DYNAMIC-route dev-mode gap noted on the
|
|
12
|
+
* versioning feature — the tag routes may 404 in `zfb dev` (build is fine).
|
|
19
13
|
*/
|
|
20
|
-
export const docTagsFeature = (
|
|
14
|
+
export const docTagsFeature = () => ({
|
|
21
15
|
name: "docTags",
|
|
22
16
|
injections: [],
|
|
23
|
-
postProcess: async (targetDir) => {
|
|
24
|
-
if (!choices.features.includes("i18n")) {
|
|
25
|
-
// i18n is OFF — strip the locale-scoped tag pages that were
|
|
26
|
-
// copied unconditionally by copyFeatureFiles.
|
|
27
|
-
const localeTagsDir = path.join(targetDir, "pages", "[locale]", "docs", "tags");
|
|
28
|
-
if (await fs.pathExists(localeTagsDir)) {
|
|
29
|
-
await fs.remove(localeTagsDir);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
17
|
});
|
|
@@ -2,36 +2,25 @@ import type { FeatureModule } from "../compose.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Dynamic page transition feature.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* - Injects `@import "@takazudo/zudo-doc/page-loading.css"` at the
|
|
14
|
-
* `@slot:global-css:imports` anchor (top of global.css, before rule blocks).
|
|
15
|
-
* - Injects the `--color-page-loading-overlay` token into `@theme` at the
|
|
16
|
-
* `@slot:global-css:theme-tokens` anchor.
|
|
17
|
-
* - Injects the View-Transitions CSS into global.css at
|
|
18
|
-
* `@slot:global-css:feature-styles`.
|
|
5
|
+
* Minimal-scaffold cutover (epic zudolab/zudo-doc#2651, Wave 6 #2660):
|
|
6
|
+
* purely a `zudoDoc({ dynamicPageTransition: true })` field now (see
|
|
7
|
+
* `zfb-config-gen.ts`). The primary activation path —
|
|
8
|
+
* `<ClientRouter enableClientRouter={settings.dynamicPageTransition} />`
|
|
9
|
+
* rendered by the package's own `doc-page-shell`/`doclayout` — and the
|
|
10
|
+
* pure-SSR `<PageLoadingOverlay/>` mount are BOTH already handled inside
|
|
11
|
+
* `doc-body-end-islands/index.tsx`, gated on the same flag; the View-
|
|
12
|
+
* Transitions CSS ships unconditionally from `@takazudo/zudo-doc/features.css`.
|
|
19
13
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* The ClientRouterBootstrap component lives in
|
|
33
|
-
* templates/features/dynamicPageTransition/files/src/components/ and is
|
|
34
|
-
* byte-identical to the host src/components/client-router-bootstrap.tsx.
|
|
35
|
-
* The feature-template drift checker enforces this parity automatically.
|
|
14
|
+
* DROPPED: the host `ClientRouterBootstrap` island
|
|
15
|
+
* (`templates/features/dynamicPageTransition/files/src/components/`) —
|
|
16
|
+
* its old host-owned mount point (`pages/lib/_body-end-islands.tsx`) no
|
|
17
|
+
* longer exists, and the package's own doc-body-end-islands header comment
|
|
18
|
+
* already calls it "a redundant fallback" once PageLoadingOverlay covers the
|
|
19
|
+
* loading UI. Known gap (documented, out of this generator's scope): the
|
|
20
|
+
* package's SSR-only `<ClientRouter/>` import may still need a "use client"
|
|
21
|
+
* bootstrap to guarantee the click-intercept ships to the browser bundle —
|
|
22
|
+
* same class of issue as tauri's find-in-page island (see tauri.ts). If a
|
|
23
|
+
* project needs it restored, wire a custom island through
|
|
24
|
+
* `settings.chromeBindingsModule`'s `BodyEndIslands` slot.
|
|
36
25
|
*/
|
|
37
26
|
export declare const dynamicPageTransitionFeature: FeatureModule;
|