create-zudo-doc 0.2.16 → 0.2.18

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.
@@ -2,10 +2,15 @@ import type { FeatureModule } from "../compose.js";
2
2
  /**
3
3
  * Dynamic page transition feature.
4
4
  *
5
- * When enabled, wires the SPA client-side router (ClientRouterBootstrap
6
- * island) and the page-loading overlay (PageLoadingOverlay, pure SSR) into
7
- * body-end-islands, and injects the View-Transitions CSS + page-loading
8
- * overlay CSS into global.css.
5
+ * When enabled:
6
+ * - Sets `enableClientRouter={settings.dynamicPageTransition}` on every
7
+ * `<DocLayoutWithDefaults>` render site the SSR `<ClientRouter />` render
8
+ * self-activates the SPA router on the client as a top-level module side
9
+ * effect (primary activation path).
10
+ * - Wires the ClientRouterBootstrap island and the PageLoadingOverlay (pure
11
+ * SSR) into body-end-islands — the island is now a redundant fallback;
12
+ * PageLoadingOverlay provides the loading spinner UI.
13
+ * - Injects the View-Transitions CSS + page-loading overlay CSS into global.css.
9
14
  *
10
15
  * Bug fix (#2265): the page-loading overlay CSS (.page-loading-overlay /
11
16
  * .page-loading-spinner / @keyframes page-loading-spin / [data-zd-nav-pending])
@@ -1,10 +1,15 @@
1
1
  /**
2
2
  * Dynamic page transition feature.
3
3
  *
4
- * When enabled, wires the SPA client-side router (ClientRouterBootstrap
5
- * island) and the page-loading overlay (PageLoadingOverlay, pure SSR) into
6
- * body-end-islands, and injects the View-Transitions CSS + page-loading
7
- * overlay CSS into global.css.
4
+ * When enabled:
5
+ * - Sets `enableClientRouter={settings.dynamicPageTransition}` on every
6
+ * `<DocLayoutWithDefaults>` render site the SSR `<ClientRouter />` render
7
+ * self-activates the SPA router on the client as a top-level module side
8
+ * effect (primary activation path).
9
+ * - Wires the ClientRouterBootstrap island and the PageLoadingOverlay (pure
10
+ * SSR) into body-end-islands — the island is now a redundant fallback;
11
+ * PageLoadingOverlay provides the loading spinner UI.
12
+ * - Injects the View-Transitions CSS + page-loading overlay CSS into global.css.
8
13
  *
9
14
  * Bug fix (#2265): the page-loading overlay CSS (.page-loading-overlay /
10
15
  * .page-loading-spinner / @keyframes page-loading-spin / [data-zd-nav-pending])
package/dist/scaffold.js CHANGED
@@ -447,11 +447,11 @@ function generatePackageJson(choices) {
447
447
  // stability, multi-valued response headers (e.g. multiple Set-Cookie),
448
448
  // supplementary-plane CJK reading-time, plus CLI/server/runtime hardening
449
449
  // and render perf passes. No consumer-facing / CLI breaking change.
450
- "@takazudo/zfb": "0.1.0-next.54",
451
- "@takazudo/zfb-runtime": "0.1.0-next.54",
450
+ "@takazudo/zfb": "0.1.0-next.55",
451
+ "@takazudo/zfb-runtime": "0.1.0-next.55",
452
452
  // zfb-adapter-cloudflare — required for any route with `prerender = false`.
453
453
  // Pinned in lockstep with @takazudo/zfb.
454
- "@takazudo/zfb-adapter-cloudflare": "0.1.0-next.54",
454
+ "@takazudo/zfb-adapter-cloudflare": "0.1.0-next.55",
455
455
  // @takazudo/zudo-doc — published from this monorepo via
456
456
  // .github/workflows/publish-zudo-doc.yml. The pin here is bumped in
457
457
  // lockstep by scripts/release-create-zudo-doc.sh whenever zudo-doc's
@@ -463,7 +463,7 @@ function generatePackageJson(choices) {
463
463
  // ties this pin to packages/zudo-doc's version, so the lockstep release
464
464
  // bumps both together; do not cut a create-zudo-doc release until the
465
465
  // matching @takazudo/zudo-doc version (with content.css) is on npm.
466
- "@takazudo/zudo-doc": "^0.2.16",
466
+ "@takazudo/zudo-doc": "^0.2.18",
467
467
  // zod — used by the generated zfb.config.ts. zfb-config-gen emits
468
468
  // `import { z } from "zod"` for the content-collection schema +
469
469
  // `z.toJSONSchema(...)` conversion. Without this dep, the consumer
@@ -517,7 +517,7 @@ function generatePackageJson(choices) {
517
517
  // @takazudo/zudo-doc/integrations/doc-history which in turn imports
518
518
  // @takazudo/zudo-doc-history-server/git-history. Without this dep the
519
519
  // plugin host fails at init with ERR_MODULE_NOT_FOUND — W8A (#1739).
520
- deps["@takazudo/zudo-doc-history-server"] = "^0.2.16";
520
+ deps["@takazudo/zudo-doc-history-server"] = "^0.2.18";
521
521
  // W7A (#1736): doc-history-plugin.mjs spawns `tsx -e <inline-script>` to
522
522
  // run the v2 runtime in a TS-aware Node subprocess; without tsx the
523
523
  // plugin's preBuild step exits with ENOENT before zfb finishes config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-zudo-doc",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "description": "Create a new zudo-doc documentation site",
5
5
  "license": "MIT",
6
6
  "author": "Takeshi Takatsudo",
@@ -44,6 +44,7 @@ export default function NotFoundPage(): JSX.Element {
44
44
  headerOverride={<HeaderWithDefaults lang={locale} />}
45
45
  footerOverride={<FooterWithDefaults lang={locale} />}
46
46
  bodyEndComponents={<BodyEndIslands basePath={settings.base ?? "/"} />}
47
+ enableClientRouter={settings.dynamicPageTransition}
47
48
  >
48
49
  <div class="min-h-[60vh] flex flex-col items-center justify-center px-hsp-2xl py-vsp-xl">
49
50
  <h1 class="text-display font-bold mb-vsp-md">404</h1>
@@ -73,6 +73,7 @@ export default function IndexPage(): JSX.Element {
73
73
  headerOverride={<HeaderWithDefaults lang={locale} currentPath={withBase("/")} />}
74
74
  footerOverride={<FooterWithDefaults lang={locale} />}
75
75
  bodyEndComponents={<BodyEndIslands basePath={settings.base ?? "/"} />}
76
+ enableClientRouter={settings.dynamicPageTransition}
76
77
  >
77
78
  {/* Hero: logo left, title+desc+links right, block centered */}
78
79
  <div class="flex justify-center mb-vsp-xl">
@@ -18,8 +18,14 @@ import { SidebarResizerInit } from "@takazudo/zudo-doc/sidebar-resizer";
18
18
 
19
19
  /**
20
20
  * The `bodyEndComponents` slot content shared by all four doc-route page
21
- * components: `BodyEndIslands` (modal overlays, client-router bootstrap,
22
- * image-enlarge) and the optional `SidebarResizerInit` drag handle.
21
+ * components: `BodyEndIslands` (modal overlays, optional client-router
22
+ * bootstrap when `dynamicPageTransition` is on, image-enlarge) and the
23
+ * optional `SidebarResizerInit` drag handle. Whether the client-router
24
+ * bootstrap island is included depends on `settings.dynamicPageTransition`
25
+ * (gated inside `BodyEndIslands`). The SSR `<ClientRouter />` mounted by
26
+ * `DocLayout` self-activates when `enableClientRouter` is `true`; the
27
+ * island here is redundant for that activation path and kept only for the
28
+ * `when="load"` hydration slot.
23
29
  */
24
30
  export function DocBodyEnd(): JSX.Element {
25
31
  return (
@@ -218,6 +218,7 @@ export function DocPageShell(props: DocPageShellProps): JSX.Element {
218
218
  afterSidebar={<SidebarPrepaint />}
219
219
  footerOverride={<FooterWithDefaults lang={locale} />}
220
220
  bodyEndComponents={<DocBodyEnd />}
221
+ enableClientRouter={settings.dynamicPageTransition}
221
222
  >
222
223
  {kind === "autoIndex" ? (
223
224
  /* Auto-index page: category without an index.mdx.
@@ -142,6 +142,7 @@ export function TagDetailPageView({
142
142
  breadcrumbOverride={<Breadcrumb items={breadcrumbItems} />}
143
143
  footerOverride={<FooterWithDefaults lang={locale} />}
144
144
  bodyEndComponents={<BodyEndIslands basePath={settings.base ?? "/"} />}
145
+ enableClientRouter={settings.dynamicPageTransition}
145
146
  >
146
147
  <h1 class="text-heading font-bold mb-vsp-xs">{pageTitle}</h1>
147
148
  <p class="text-muted mb-vsp-lg">{countText}</p>
@@ -198,6 +199,7 @@ export function TagsIndexPageView({ locale }: { locale: string }): JSX.Element {
198
199
  breadcrumbOverride={<Breadcrumb items={breadcrumbItems} />}
199
200
  footerOverride={<FooterWithDefaults lang={locale} />}
200
201
  bodyEndComponents={<BodyEndIslands basePath={settings.base ?? "/"} />}
202
+ enableClientRouter={settings.dynamicPageTransition}
201
203
  >
202
204
  <h1 class="text-heading font-bold mb-vsp-lg">{pageTitle}</h1>
203
205
  {!settings.docTags || tags.length === 0 ? (
@@ -51,6 +51,14 @@ import type { JSX } from "preact";
51
51
  * walks page → BodyEndIslands → ClientRouterBootstrap and includes the
52
52
  * client-router barrel in the per-island bundle, where the side-effect
53
53
  * import above can fire on the client.
54
+ *
55
+ * Note: the SSR `<ClientRouter />` mounted by `DocLayout` (via
56
+ * `enableClientRouter`) self-activates the SPA router when its head meta
57
+ * tags reach the browser. This host island is therefore a no-op for
58
+ * router activation — it is kept only for the `when="load"` hydration
59
+ * slot and bundle inclusion. The actual on/off gate is
60
+ * `enableClientRouter` on `<DocLayoutWithDefaults>`, set to
61
+ * `settings.dynamicPageTransition` at every call site.
54
62
  */
55
63
  function ClientRouterBootstrap(): JSX.Element | null {
56
64
  return null;
@@ -117,6 +117,7 @@ export default function LocaleIndexPage({ params }: PageArgs): JSX.Element {
117
117
  headerOverride={<HeaderWithDefaults lang={locale as Locale} currentPath={withBase(`/${locale}/`)} />}
118
118
  footerOverride={<FooterWithDefaults lang={locale} />}
119
119
  bodyEndComponents={<BodyEndIslands basePath={settings.base ?? "/"} />}
120
+ enableClientRouter={settings.dynamicPageTransition}
120
121
  >
121
122
  {/* Hero: logo left, title+desc+links right, block centered */}
122
123
  <div class="flex justify-center mb-vsp-xl">
@@ -73,6 +73,7 @@ export function VersionsPageView({ locale }: { locale: string }): JSX.Element {
73
73
  headerOverride={<HeaderWithDefaults lang={locale as Locale} currentPath={withBase(`${prefix}/docs/versions`)} />}
74
74
  footerOverride={<FooterWithDefaults lang={locale} />}
75
75
  bodyEndComponents={<BodyEndIslands basePath={settings.base ?? "/"} />}
76
+ enableClientRouter={settings.dynamicPageTransition}
76
77
  >
77
78
  <VersionsPageContent
78
79
  latestHref={latestHref}