create-zudo-sg 0.1.6 → 0.1.8
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 +28 -0
- package/README.md +8 -0
- package/package.json +1 -1
- package/templates/default/package.json +4 -4
- package/templates/default/pages/lib/_body-end-islands.tsx +6 -24
- package/templates/default/pages/lib/_engine-route-preview-token-panel-bootstrap.tsx +12 -0
- package/templates/default/pnpm-workspace.yaml +9 -9
- package/templates/default/src/styleguide/sg-registry.ts +9 -0
- package/templates/default/ui/a-preview/preview.stories.tsx +16 -0
- package/templates/default/ui/b-preview-two/preview-two.stories.tsx +16 -0
- package/templates/default/ui/canvas/canvas.stories.tsx +16 -0
- package/templates/default/zfb.config.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,34 @@ All notable changes to `create-zudo-sg` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on Keep a Changelog.
|
|
6
6
|
|
|
7
|
+
## [0.1.8] - 2026-09-25
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Update the starter's zfb, zfb-runtime, and zfb-md-wasm pins to 2.20.3,
|
|
12
|
+
including the exact release-age exclusions for their native packages.
|
|
13
|
+
- Update the starter engine range to `@takazudo/zudo-sg ^0.3.6`.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Make template regeneration work through symlinked paths, including macOS
|
|
18
|
+
temporary directories, while preserving import-only use from stdin.
|
|
19
|
+
|
|
20
|
+
## [0.1.7] - 2026-09-25
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Update the starter engine range to `@takazudo/zudo-sg ^0.3.5`.
|
|
25
|
+
- Add Preview, Preview 2, and Canvas example stories to demonstrate distinct
|
|
26
|
+
detail and preview routes in the generated styleguide.
|
|
27
|
+
- Enable SPA page transitions in the starter and mount the preview panel
|
|
28
|
+
bootstrap on engine routes while retaining early-click capture on host pages.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- Keep the public preview-token header trigger responsive to clicks before
|
|
33
|
+
its load island is ready, including navigation from a host page.
|
|
34
|
+
|
|
7
35
|
## [0.1.6] - 2026-09-24
|
|
8
36
|
|
|
9
37
|
### Changed
|
package/README.md
CHANGED
|
@@ -98,6 +98,14 @@ instead of an inert one:
|
|
|
98
98
|
injected `/components/*` and `/tokens` routes too, not just the host-owned
|
|
99
99
|
`/`.
|
|
100
100
|
|
|
101
|
+
The public header trigger installs an early toggle capture before the load
|
|
102
|
+
island is ready. A host with its own header trigger can render
|
|
103
|
+
`previewTokenPanelCaptureScript()` from `@takazudo/zudo-sg/token-tweak` in a
|
|
104
|
+
body-end `<script>` before `PreviewTokenPanelBootstrap` on both host and engine
|
|
105
|
+
routes. The helper is safe to render on each route; the bootstrap drains the
|
|
106
|
+
captured click parity once its listener is ready. The scaffold's
|
|
107
|
+
`BodyEndIslands` shows this composition.
|
|
108
|
+
|
|
101
109
|
This ships **tabs without the Apply write sandbox** — `zdtpApplyProxy` also
|
|
102
110
|
accepts `routingFile` and `writeRoot`, together, as an opt-in next step: they
|
|
103
111
|
let the panel's **Apply** button persist a tweak directly into your project's
|
package/package.json
CHANGED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@takazudo/zdtp": "0.8.2",
|
|
16
|
-
"@takazudo/zfb": "2.20.
|
|
17
|
-
"@takazudo/zfb-md-wasm": "2.20.
|
|
18
|
-
"@takazudo/zfb-runtime": "2.20.
|
|
16
|
+
"@takazudo/zfb": "2.20.3",
|
|
17
|
+
"@takazudo/zfb-md-wasm": "2.20.3",
|
|
18
|
+
"@takazudo/zfb-runtime": "2.20.3",
|
|
19
19
|
"@takazudo/zudo-doc": "5.27.0",
|
|
20
|
-
"@takazudo/zudo-sg": "^0.3.
|
|
20
|
+
"@takazudo/zudo-sg": "^0.3.6",
|
|
21
21
|
"diff": "^8.0.4",
|
|
22
22
|
"katex": "^0.16.38",
|
|
23
23
|
"preact": "^10.29.1",
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
// minus the doc-site islands this starter has no use for (AI chat, mermaid,
|
|
7
7
|
// doc-history, client-router bootstrap): this starter mounts only the
|
|
8
8
|
// engine's preview zdtp token panel bootstrap (`toggle-preview-token-panel`),
|
|
9
|
-
// which the header trigger `withZudoSg` injects opens.
|
|
9
|
+
// which the header trigger `withZudoSg` injects opens on engine routes.
|
|
10
10
|
//
|
|
11
11
|
// pages/index.tsx imports this file directly (as well as reaching it through
|
|
12
12
|
// `_chrome-bindings.tsx`'s `chromeBindingsModule` wiring), so zfb's island
|
|
13
13
|
// scanner is guaranteed to walk page -> this helper -> the real
|
|
14
|
-
//
|
|
14
|
+
// engine-route bootstrap wrapper and register its constructor under the
|
|
15
15
|
// SSR marker name. `chromeBindingsModule` then makes the injected
|
|
16
16
|
// /components/* and /tokens routes render the same marker, so they hydrate
|
|
17
17
|
// against that registered constructor too — not just this starter's
|
|
@@ -19,25 +19,8 @@
|
|
|
19
19
|
|
|
20
20
|
import type { VNode, JSX } from "preact";
|
|
21
21
|
import { Island } from "@takazudo/zfb";
|
|
22
|
-
import
|
|
23
|
-
|
|
24
|
-
(PreviewTokenPanelBootstrap as { displayName?: string }).displayName = "PreviewTokenPanelBootstrap";
|
|
25
|
-
|
|
26
|
-
function prehydrationPanelToggleScript(toggleEvent: string): string {
|
|
27
|
-
return `(${function capturePanelToggle(channel: string) {
|
|
28
|
-
const script = document.currentScript as (HTMLScriptElement & {
|
|
29
|
-
__zdtpPrehydrateListener?: EventListener;
|
|
30
|
-
}) | null;
|
|
31
|
-
if (!script || script.dataset.bound === "1") return;
|
|
32
|
-
script.dataset.bound = "1";
|
|
33
|
-
script.dataset.pending = "0";
|
|
34
|
-
const listener = () => {
|
|
35
|
-
script.dataset.pending = String(Number(script.dataset.pending ?? "0") + 1);
|
|
36
|
-
};
|
|
37
|
-
script.__zdtpPrehydrateListener = listener;
|
|
38
|
-
window.addEventListener(channel, listener);
|
|
39
|
-
}.toString()})(${JSON.stringify(toggleEvent)});`;
|
|
40
|
-
}
|
|
22
|
+
import EngineRoutePreviewTokenPanelBootstrap from "./_engine-route-preview-token-panel-bootstrap";
|
|
23
|
+
import { previewTokenPanelCaptureScript } from "@takazudo/zudo-sg/token-tweak";
|
|
41
24
|
|
|
42
25
|
/**
|
|
43
26
|
* The body-end islands this starter mounts. Currently just the preview
|
|
@@ -48,12 +31,11 @@ export function BodyEndIslands(): JSX.Element {
|
|
|
48
31
|
<>
|
|
49
32
|
{/* Capture pre-hydration clicks; the bootstrap drains this once it loads. */}
|
|
50
33
|
<script
|
|
51
|
-
|
|
52
|
-
dangerouslySetInnerHTML={{ __html: prehydrationPanelToggleScript("toggle-preview-token-panel") }}
|
|
34
|
+
dangerouslySetInnerHTML={{ __html: previewTokenPanelCaptureScript() }}
|
|
53
35
|
/>
|
|
54
36
|
{Island({
|
|
55
37
|
when: "load",
|
|
56
|
-
children: <
|
|
38
|
+
children: <EngineRoutePreviewTokenPanelBootstrap />,
|
|
57
39
|
}) as unknown as VNode}
|
|
58
40
|
</>
|
|
59
41
|
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/** @jsxRuntime automatic */
|
|
4
|
+
/** @jsxImportSource preact */
|
|
5
|
+
import PreviewTokenPanelBootstrap from "@takazudo/zudo-sg/token-tweak/preview-token-panel-bootstrap";
|
|
6
|
+
|
|
7
|
+
export default function EngineRoutePreviewTokenPanelBootstrap() {
|
|
8
|
+
if (typeof document === "undefined" || !document.querySelector("[data-sg-engine-route]")) return null;
|
|
9
|
+
return <PreviewTokenPanelBootstrap />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
EngineRoutePreviewTokenPanelBootstrap.displayName = "EngineRoutePreviewTokenPanelBootstrap";
|
|
@@ -3,13 +3,13 @@ allowBuilds:
|
|
|
3
3
|
esbuild: true
|
|
4
4
|
minimumReleaseAgeExclude:
|
|
5
5
|
- "@takazudo/zdtp@0.8.2"
|
|
6
|
-
- "@takazudo/zfb-darwin-arm64@2.20.
|
|
7
|
-
- "@takazudo/zfb-darwin-x64@2.20.
|
|
8
|
-
- "@takazudo/zfb-linux-arm64-gnu@2.20.
|
|
9
|
-
- "@takazudo/zfb-linux-x64-gnu@2.20.
|
|
10
|
-
- "@takazudo/zfb-md-wasm@2.20.
|
|
11
|
-
- "@takazudo/zfb-runtime@2.20.
|
|
12
|
-
- "@takazudo/zfb-win32-x64-msvc@2.20.
|
|
13
|
-
- "@takazudo/zfb@2.20.
|
|
6
|
+
- "@takazudo/zfb-darwin-arm64@2.20.3"
|
|
7
|
+
- "@takazudo/zfb-darwin-x64@2.20.3"
|
|
8
|
+
- "@takazudo/zfb-linux-arm64-gnu@2.20.3"
|
|
9
|
+
- "@takazudo/zfb-linux-x64-gnu@2.20.3"
|
|
10
|
+
- "@takazudo/zfb-md-wasm@2.20.3"
|
|
11
|
+
- "@takazudo/zfb-runtime@2.20.3"
|
|
12
|
+
- "@takazudo/zfb-win32-x64-msvc@2.20.3"
|
|
13
|
+
- "@takazudo/zfb@2.20.3"
|
|
14
14
|
- "@takazudo/zudo-doc@5.27.0"
|
|
15
|
-
- "@takazudo/zudo-sg@0.3.
|
|
15
|
+
- "@takazudo/zudo-sg@0.3.6"
|
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
// GENERATED:SG_REGISTRY_BEGIN — do not hand-edit; run `zudo-sg gen-registry`.
|
|
6
6
|
import type { StoryModule } from "@takazudo/zudo-sg/stories";
|
|
7
7
|
|
|
8
|
+
import * as aPreview from "../../ui/a-preview/preview.stories.tsx";
|
|
9
|
+
import * as bPreviewTwo from "../../ui/b-preview-two/preview-two.stories.tsx";
|
|
8
10
|
import * as button from "../../ui/button/button.stories.tsx";
|
|
11
|
+
import * as canvas from "../../ui/canvas/canvas.stories.tsx";
|
|
9
12
|
import * as card from "../../ui/card/card.stories.tsx";
|
|
10
13
|
import * as counter from "../../ui/counter/counter.stories.tsx";
|
|
11
14
|
|
|
@@ -15,7 +18,10 @@ import * as counter from "../../ui/counter/counter.stories.tsx";
|
|
|
15
18
|
* `{ default: meta, ...named Story exports }`.
|
|
16
19
|
*/
|
|
17
20
|
export const storyModules: Record<string, StoryModule> = {
|
|
21
|
+
"./ui/a-preview/preview.stories.tsx": aPreview as unknown as StoryModule,
|
|
22
|
+
"./ui/b-preview-two/preview-two.stories.tsx": bPreviewTwo as unknown as StoryModule,
|
|
18
23
|
"./ui/button/button.stories.tsx": button as unknown as StoryModule,
|
|
24
|
+
"./ui/canvas/canvas.stories.tsx": canvas as unknown as StoryModule,
|
|
19
25
|
"./ui/card/card.stories.tsx": card as unknown as StoryModule,
|
|
20
26
|
"./ui/counter/counter.stories.tsx": counter as unknown as StoryModule,
|
|
21
27
|
};
|
|
@@ -31,7 +37,10 @@ export const storyModules: Record<string, StoryModule> = {
|
|
|
31
37
|
* `isStory()`-filtered variants, never to gate membership.
|
|
32
38
|
*/
|
|
33
39
|
export const storyExportOrder: Record<string, string[]> = {
|
|
40
|
+
"./ui/a-preview/preview.stories.tsx": ["Default"],
|
|
41
|
+
"./ui/b-preview-two/preview-two.stories.tsx": ["Default"],
|
|
34
42
|
"./ui/button/button.stories.tsx": ["Primary", "Plain"],
|
|
43
|
+
"./ui/canvas/canvas.stories.tsx": ["Default"],
|
|
35
44
|
"./ui/card/card.stories.tsx": ["Basic"],
|
|
36
45
|
"./ui/counter/counter.stories.tsx": ["Basic"],
|
|
37
46
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
import type { Story, StoryMeta } from "@takazudo/zudo-sg/stories";
|
|
4
|
+
|
|
5
|
+
const meta: StoryMeta = {
|
|
6
|
+
title: "Preview",
|
|
7
|
+
category: "Route probes",
|
|
8
|
+
description: "Proves that a story titled Preview stays distinct from the iframe route.",
|
|
9
|
+
usage: "Packed route verifier probe.",
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
name: "Default",
|
|
15
|
+
render: () => <div data-packed-story-identity="packed-preview-default">Preview route probe</div>,
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
import type { Story, StoryMeta } from "@takazudo/zudo-sg/stories";
|
|
4
|
+
|
|
5
|
+
const meta: StoryMeta = {
|
|
6
|
+
title: "Preview 2",
|
|
7
|
+
category: "Route probes",
|
|
8
|
+
description: "Proves deterministic allocation alongside the Preview story.",
|
|
9
|
+
usage: "Packed route verifier probe.",
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
name: "Default",
|
|
15
|
+
render: () => <div data-packed-story-identity="packed-preview-two-default">Preview 2 route probe</div>,
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
import type { Story, StoryMeta } from "@takazudo/zudo-sg/stories";
|
|
4
|
+
|
|
5
|
+
const meta: StoryMeta = {
|
|
6
|
+
title: "Canvas",
|
|
7
|
+
category: "Route probes",
|
|
8
|
+
description: "Proves route-aware allocation for a custom preview endpoint.",
|
|
9
|
+
usage: "Packed route verifier probe.",
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
name: "Default",
|
|
15
|
+
render: () => <div data-packed-story-identity="packed-canvas-default">Canvas route probe</div>,
|
|
16
|
+
};
|
|
@@ -22,6 +22,7 @@ export default defineConfig(
|
|
|
22
22
|
// minimal (see package.json).
|
|
23
23
|
mermaid: false,
|
|
24
24
|
strictContentBridge: true,
|
|
25
|
+
dynamicPageTransition: true,
|
|
25
26
|
// Bundling follows `bundleZdtp ?? designTokenPanel`; this starter never
|
|
26
27
|
// sets `designTokenPanel`, so without this the zdtp loader resolves to
|
|
27
28
|
// zudo-doc's throwing stub and the engine's PREVIEW token panel (opened
|