create-zudo-sg 0.1.0 → 0.1.1
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 +20 -0
- package/README.md +50 -8
- package/package.json +1 -1
- package/templates/default/_gitignore +4 -1
- package/templates/default/package.json +5 -5
- package/templates/default/pnpm-workspace.yaml +11 -5
- package/templates/default/src/styleguide/sg-registry.ts +34 -6
- package/templates/default/src/styles/global.css +28 -0
- package/templates/default/zudo-sg.config.mjs +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ 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.1] - 2026-09-20
|
|
8
|
+
|
|
9
|
+
Hardens fresh starter projects and aligns them with `@takazudo/zudo-sg 0.2.1`.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Include the complete host stylesheet needed by the catalog, detail
|
|
14
|
+
workbench, token dashboard, and responsive sidebar.
|
|
15
|
+
- Ignore generated zfb cache and temporary build artifacts while continuing to
|
|
16
|
+
track the generated lockfile.
|
|
17
|
+
- Exempt the starter's exact shipped zfb, zudo-doc, zdtp, and zudo-sg versions
|
|
18
|
+
from pnpm's minimum-release-age policy, including zfb platform binaries.
|
|
19
|
+
- Let the first `gen-registry` run create its output instead of requiring a
|
|
20
|
+
marker-only seed file.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Update the starter engine range to `@takazudo/zudo-sg ^0.2.1`.
|
|
25
|
+
- Verify generated lockfiles with a clean frozen install before release.
|
|
26
|
+
|
|
7
27
|
## [0.1.0] - 2026-09-20
|
|
8
28
|
|
|
9
29
|
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`,
|
|
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/
|
|
65
|
-
|
|
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
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@takazudo/zdtp": "0.8.0",
|
|
16
|
-
"@takazudo/zfb": "2.
|
|
17
|
-
"@takazudo/zfb-md-wasm": "2.
|
|
18
|
-
"@takazudo/zfb-runtime": "2.
|
|
19
|
-
"@takazudo/zudo-doc": "5.26.
|
|
20
|
-
"@takazudo/zudo-sg": "^0.2.
|
|
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.1",
|
|
21
21
|
"diff": "^8.0.4",
|
|
22
22
|
"katex": "^0.16.38",
|
|
23
23
|
"preact": "^10.29.1",
|
|
@@ -2,8 +2,14 @@ packages: []
|
|
|
2
2
|
allowBuilds:
|
|
3
3
|
esbuild: true
|
|
4
4
|
minimumReleaseAgeExclude:
|
|
5
|
-
- "@takazudo/
|
|
6
|
-
- "@takazudo/zfb-
|
|
7
|
-
- "@takazudo/zfb-
|
|
8
|
-
- "@takazudo/
|
|
9
|
-
- "@takazudo/
|
|
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.1"
|
|
@@ -1,10 +1,38 @@
|
|
|
1
|
-
// GENERATED by `zudo-sg gen-registry
|
|
2
|
-
// after changing stories; the command rewrites the
|
|
3
|
-
// ui/*.stories.tsx
|
|
4
|
-
//
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
9
|
-
//
|
|
10
|
-
//
|
|
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: {
|