create-zudo-sg 0.1.0 → 0.1.2

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 CHANGED
@@ -4,6 +4,41 @@ 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.2] - 2026-09-20
8
+
9
+ Gives fresh starter projects a styled homepage and usable default navigation.
10
+
11
+ ### Fixed
12
+
13
+ - Style the host-owned homepage with token-based typography, spacing, and
14
+ clearly visible links to Components and Design Tokens after Tailwind preflight.
15
+ - Verify the packed starter's homepage markup and generated utility CSS.
16
+
17
+ ### Changed
18
+
19
+ - Update the starter engine range to `@takazudo/zudo-sg ^0.2.2`, which supplies
20
+ default header navigation and search controls for minimally configured hosts.
21
+
22
+ ## [0.1.1] - 2026-09-20
23
+
24
+ Hardens fresh starter projects and aligns them with `@takazudo/zudo-sg 0.2.1`.
25
+
26
+ ### Fixed
27
+
28
+ - Include the complete host stylesheet needed by the catalog, detail
29
+ workbench, token dashboard, and responsive sidebar.
30
+ - Ignore generated zfb cache and temporary build artifacts while continuing to
31
+ track the generated lockfile.
32
+ - Exempt the starter's exact shipped zfb, zudo-doc, zdtp, and zudo-sg versions
33
+ from pnpm's minimum-release-age policy, including zfb platform binaries.
34
+ - Let the first `gen-registry` run create its output instead of requiring a
35
+ marker-only seed file.
36
+
37
+ ### Changed
38
+
39
+ - Update the starter engine range to `@takazudo/zudo-sg ^0.2.1`.
40
+ - Verify generated lockfiles with a clean frozen install before release.
41
+
7
42
  ## [0.1.0] - 2026-09-20
8
43
 
9
44
  Initial release of the pnpm-only `create-zudo-sg` initializer.
package/README.md CHANGED
@@ -16,13 +16,12 @@ pnpm gen-token-manifest
16
16
  pnpm dev
17
17
  ```
18
18
 
19
- The initializer is available from its first npm release; nothing is published
20
- by this epic.
21
-
22
19
  The command defaults to no dependency installation and prints the five
23
20
  commands after it creates the project. Pass `--install` when the initializer
24
21
  should run `pnpm install` for you. The generated `package.json` pins the
25
22
  package manager to pnpm, and this release has no npm, yarn, or `--pm` mode.
23
+ Commit the generated `pnpm-lock.yaml` so the host's dependency resolution is
24
+ reproducible.
26
25
 
27
26
  ## Usage
28
27
 
@@ -57,13 +56,14 @@ contains:
57
56
  shim for the host page.
58
57
  - Three small Preact examples under `ui/`: Button, Card, and Counter, with
59
58
  co-located stories and a Button MDX document.
60
- - `src/styleguide/sg-registry.ts`, an empty generated seed. Run
61
- `pnpm gen-registry` after changing stories.
59
+ - `src/styleguide/sg-registry.ts`, generated from the three example stories.
60
+ Run `pnpm gen-registry` after changing stories; the CLI also bootstraps a
61
+ missing or whitespace-only output.
62
62
  - `src/content/docs/getting-started.mdx`, a seed page for the generated host's
63
63
  documentation route.
64
- - `src/styles/preview-entry.css` and `src/styles/ui-tokens.css`, which provide
65
- the standalone preview stylesheet and the token source used by
66
- `pnpm gen-token-manifest`.
64
+ - `src/styles/global.css`, the automatically discovered host stylesheet, plus
65
+ `src/styles/preview-entry.css` for standalone previews and
66
+ `src/styles/ui-tokens.css`, the token source used by `pnpm gen-token-manifest`.
67
67
  - `tsconfig.json` and `pnpm-workspace.yaml`, a workspace policy suitable for a
68
68
  fresh host.
69
69
 
@@ -72,6 +72,48 @@ renames the package-safe `_gitignore` to `.gitignore`. The token manifest is
72
72
  generated after installation; it is intentionally not checked into the
73
73
  template seed.
74
74
 
75
+ ## Styles
76
+
77
+ zfb discovers `src/styles/global.css` automatically; no page import or config
78
+ entry is needed. Keep its imports in this order:
79
+
80
+ 1. Declare `@layer zd-preflight, zd-flow`, then import
81
+ `tailwindcss/preflight` in `layer(zd-preflight)` and unlayered
82
+ `tailwindcss/utilities`.
83
+ 2. Import `@takazudo/zudo-doc/theme.css`, then `./ui-tokens.css` and any
84
+ component package stylesheet. The theme supplies the framework tokens and
85
+ resets the color-token namespace; preflight is the only element reset.
86
+ 3. Import zudo-doc's `safelist.css`, `content.css`, `features.css`, and
87
+ `page-loading.css`, in that order.
88
+ 4. Import `@takazudo/zdtp/dashboard/styles.css` after content styles so the
89
+ `/tokens` dashboard wins ties with prose rules, then
90
+ `@takazudo/zudo-sg/styles.css` and `@takazudo/zudo-sg/safelist.css`.
91
+ 5. Keep the `@source` globs for `pages/`, `ui/`, and `src/content/`; add your
92
+ component package's source glob alongside them. zfb resolves these
93
+ global-entry paths from the project root.
94
+
95
+ Keep the engine styles and Tailwind utilities unlayered: utility margins must
96
+ outrank `zd-flow`, while engine chrome overrides must compete with utilities.
97
+ Do not add the full `tailwindcss` import or a second preflight. If an existing
98
+ host defines consumer-only color tokens before zudo-doc's theme, replace
99
+ `theme.css` with `theme-no-reset.css` to preserve them. That variant only
100
+ omits the color-token reset; tokens defined by both stylesheets still follow
101
+ source order.
102
+
103
+ The preview document uses `src/styles/preview-entry.css` independently. Add
104
+ your component package's styles and source scan there too when previews need
105
+ them; its `@source` paths are relative to that stylesheet. Keep dashboard and
106
+ catalog chrome imports in the host's global entry.
107
+
108
+ ## Release-age exemptions
109
+
110
+ The generated `pnpm-workspace.yaml` exempts only the exact versions shipped by
111
+ this starter: zfb, its runtime and wasm packages, zudo-doc, zdtp, the engine,
112
+ and zfb's platform binaries. Later dependency upgrades are not covered by
113
+ these entries and follow the consumer's normal `minimumReleaseAge` policy.
114
+ The platform binaries have their own entries because the package resolver
115
+ checks each optional package independently.
116
+
75
117
  ## Host requirements and caveats
76
118
 
77
119
  The starter targets Preact + zfb hosts. Keep these dependencies in a host
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-zudo-sg",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Create a new zudo-sg styleguide project",
5
5
  "license": "MIT",
6
6
  "author": "Takeshi Takatsudo",
@@ -1,4 +1,7 @@
1
1
  node_modules
2
2
  dist
3
3
  .zfb-build
4
- pnpm-lock.yaml
4
+ .zfb/
5
+ .zfb-esbuild-entry-*.tsx
6
+ .zfb-islands-tsconfig-*.json
7
+ .zfb-virtual-*.mjs
@@ -13,11 +13,11 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "@takazudo/zdtp": "0.8.0",
16
- "@takazudo/zfb": "2.19.0",
17
- "@takazudo/zfb-md-wasm": "2.19.0",
18
- "@takazudo/zfb-runtime": "2.19.0",
19
- "@takazudo/zudo-doc": "5.26.0",
20
- "@takazudo/zudo-sg": "^0.2.0",
16
+ "@takazudo/zfb": "2.20.0",
17
+ "@takazudo/zfb-md-wasm": "2.20.0",
18
+ "@takazudo/zfb-runtime": "2.20.0",
19
+ "@takazudo/zudo-doc": "5.26.2",
20
+ "@takazudo/zudo-sg": "^0.2.2",
21
21
  "diff": "^8.0.4",
22
22
  "katex": "^0.16.38",
23
23
  "preact": "^10.29.1",
@@ -12,11 +12,28 @@ export default function IndexPage(): JSX.Element {
12
12
  <html lang="en">
13
13
  <head>
14
14
  <meta charSet="utf-8" />
15
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
15
16
  <title>Styleguide starter</title>
16
17
  </head>
17
- <body>
18
- <h1 data-host-index>Styleguide starter</h1>
19
- <a href="/components">Components</a>
18
+ <body class="min-h-screen bg-bg font-sans text-base leading-normal text-fg">
19
+ <main class="mx-auto flex max-w-[48rem] flex-col gap-vsp-lg px-hsp-lg py-vsp-2xl">
20
+ <h1 data-host-index class="text-2xl font-bold leading-tight">Styleguide starter</h1>
21
+ <p class="text-muted">Explore your components, their stories, and the design tokens that bring them together.</p>
22
+ <nav aria-label="Styleguide" class="flex flex-wrap gap-hsp-md">
23
+ <a
24
+ href="/components"
25
+ class="inline-flex px-hsp-sm py-vsp-sm font-semibold text-accent underline hover:text-accent-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus"
26
+ >
27
+ Components
28
+ </a>
29
+ <a
30
+ href="/tokens"
31
+ class="inline-flex px-hsp-sm py-vsp-sm font-semibold text-accent underline hover:text-accent-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus"
32
+ >
33
+ Design Tokens
34
+ </a>
35
+ </nav>
36
+ </main>
20
37
  </body>
21
38
  </html>
22
39
  );
@@ -2,8 +2,14 @@ packages: []
2
2
  allowBuilds:
3
3
  esbuild: true
4
4
  minimumReleaseAgeExclude:
5
- - "@takazudo/zfb"
6
- - "@takazudo/zfb-runtime"
7
- - "@takazudo/zfb-md-wasm"
8
- - "@takazudo/zudo-doc"
9
- - "@takazudo/zdtp"
5
+ - "@takazudo/zdtp@0.8.0"
6
+ - "@takazudo/zfb-darwin-arm64@2.20.0"
7
+ - "@takazudo/zfb-darwin-x64@2.20.0"
8
+ - "@takazudo/zfb-linux-arm64-gnu@2.20.0"
9
+ - "@takazudo/zfb-linux-x64-gnu@2.20.0"
10
+ - "@takazudo/zfb-md-wasm@2.20.0"
11
+ - "@takazudo/zfb-runtime@2.20.0"
12
+ - "@takazudo/zfb-win32-x64-msvc@2.20.0"
13
+ - "@takazudo/zfb@2.20.0"
14
+ - "@takazudo/zudo-doc@5.26.2"
15
+ - "@takazudo/zudo-sg@0.2.2"
@@ -1,10 +1,38 @@
1
- // GENERATED by `zudo-sg gen-registry` — seed file. Run `pnpm gen-registry`
2
- // after changing stories; the command rewrites the block below from
3
- // ui/*.stories.tsx. This seed only needs the BEGIN/END markers present once.
4
- // GENERATED:SG_REGISTRY_BEGIN — do not hand-edit; run `pnpm gen-registry`.
1
+ // GENERATED by `zudo-sg gen-registry`.
2
+ // Run `zudo-sg gen-registry` after changing stories; the command rewrites the
3
+ // block below from `ui/*.stories.tsx`. Missing or whitespace-only output is
4
+ // bootstrapped automatically; non-empty output must contain both markers.
5
+ // GENERATED:SG_REGISTRY_BEGIN — do not hand-edit; run `zudo-sg gen-registry`.
5
6
  import type { StoryModule } from "@takazudo/zudo-sg/stories";
6
7
 
7
- export const storyModules: Record<string, StoryModule> = {};
8
+ import * as button from "../../ui/button/button.stories.tsx";
9
+ import * as card from "../../ui/card/card.stories.tsx";
10
+ import * as counter from "../../ui/counter/counter.stories.tsx";
8
11
 
9
- export const storyExportOrder: Record<string, string[]> = {};
12
+ /**
13
+ * Path → story module map. Keys are glob-relative (e.g.
14
+ * `./ui/src/button/button.stories.tsx`). Each module is
15
+ * `{ default: meta, ...named Story exports }`.
16
+ */
17
+ export const storyModules: Record<string, StoryModule> = {
18
+ "./ui/button/button.stories.tsx": button as unknown as StoryModule,
19
+ "./ui/card/card.stories.tsx": card as unknown as StoryModule,
20
+ "./ui/counter/counter.stories.tsx": counter as unknown as StoryModule,
21
+ };
22
+
23
+ /**
24
+ * Per-story named-export declaration order (SOURCE order), keyed by the
25
+ * same path as `storyModules`. registry.ts sorts each story's variants
26
+ * by this so tabs render in authored order (and the default tab is the
27
+ * first-authored story) instead of the alphabetical key-enumeration order
28
+ * of the `import * as` namespace. Captured at codegen time because the
29
+ * runtime namespace cannot recover source order (#128 / #174). Superset:
30
+ * lists every `export const`, so registry.ts uses it only to SORT the
31
+ * `isStory()`-filtered variants, never to gate membership.
32
+ */
33
+ export const storyExportOrder: Record<string, string[]> = {
34
+ "./ui/button/button.stories.tsx": ["Primary", "Plain"],
35
+ "./ui/card/card.stories.tsx": ["Basic"],
36
+ "./ui/counter/counter.stories.tsx": ["Basic"],
37
+ };
10
38
  // GENERATED:SG_REGISTRY_END
@@ -0,0 +1,28 @@
1
+ /* zfb discovers this entry automatically. Flow spacing beats preflight;
2
+ * unlayered utilities can still override the zd-flow layer. */
3
+ @layer zd-preflight, zd-flow;
4
+ /* The only element reset is preflight; theme.css below resets color tokens only. */
5
+ @import "tailwindcss/preflight" layer(zd-preflight);
6
+ @import "tailwindcss/utilities";
7
+
8
+ /* Framework defaults first, then the starter's own token values. */
9
+ @import "@takazudo/zudo-doc/theme.css";
10
+ @import "./ui-tokens.css";
11
+ /* Add your component package's stylesheet here, after the theme's color reset. */
12
+
13
+ @import "@takazudo/zudo-doc/safelist.css";
14
+ @import "@takazudo/zudo-doc/content.css";
15
+ @import "@takazudo/zudo-doc/features.css";
16
+ @import "@takazudo/zudo-doc/page-loading.css";
17
+
18
+ /* Dashboard rules follow content CSS so they win ties with prose styling. */
19
+ @import "@takazudo/zdtp/dashboard/styles.css";
20
+ /* Keep engine styles unlayered alongside utilities so chrome overrides work. */
21
+ @import "@takazudo/zudo-sg/styles.css";
22
+ @import "@takazudo/zudo-sg/safelist.css";
23
+
24
+ /* zfb resolves these global-entry globs from the project root.
25
+ * Add your component package's @source here; package chrome uses the safelists. */
26
+ @source "pages/**/*.{tsx,ts,jsx,js}";
27
+ @source "ui/**/*.{tsx,ts,jsx,js,mdx,md}";
28
+ @source "src/content/**/*.{mdx,md}";
@@ -5,16 +5,15 @@
5
5
  // root's `ui/`) rather than a package name: this starter has no installed UI
6
6
  // provider package, only its own `ui/` corpus, so the generated registry's
7
7
  // `import * as … from "../../ui/<slug>.stories.tsx"` resolves as a plain
8
- // relative import. `uiPackageName` points at the engine's own `stories`
9
- // subpath (the actual origin of `StoryModule`) since there is no separate
10
- // provider package to attribute stories to.
8
+ // relative import. This host has no separate provider package, so it omits
9
+ // `uiPackageName`; generated usage snippets use each component's own relative
10
+ // module path instead.
11
11
 
12
12
  /** @satisfies {import("@takazudo/zudo-sg/config").ZudoSgComposeOptions} */
13
13
  export default {
14
14
  componentsRoots: [{ dir: "ui", importBase: "../../ui" }],
15
15
  registryOut: "./src/styleguide/sg-registry.ts",
16
16
  categoryOrder: ["Actions", "Layout"],
17
- uiPackageName: "@takazudo/zudo-sg/stories",
18
17
  barrelIndex: null,
19
18
  previewStyles: "./src/styles/preview-entry.css",
20
19
  tokens: {