vizmatic 0.1.4 → 0.1.6

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/PROMPT.md CHANGED
@@ -2,10 +2,18 @@
2
2
 
3
3
  Use Vizmatic to create polished, theme-aware diagrams, figures, dashboards, presentation frames, and animated GIFs from structured React scene primitives.
4
4
 
5
- ## Install
5
+ ## Install Or Run
6
6
 
7
7
  Use the package manager already present in the project.
8
8
 
9
+ For one-off renders, use the binary without changing `package.json`:
10
+
11
+ ```bash
12
+ pnpm dlx vizmatic ./frame.tsx --out ./dist/frames --theme dark,light
13
+ ```
14
+
15
+ Install when the project needs scripts, editor types, or direct renderer APIs:
16
+
9
17
  ```bash
10
18
  pnpm add vizmatic react
11
19
  ```
@@ -106,7 +114,7 @@ export default frame.default
106
114
  Render it:
107
115
 
108
116
  ```bash
109
- pnpm exec vizmatic render frames --out public/vizmatic --theme dark,light --watermark "Your Product" --watermark-image ./logo.svg --watermark-position top-right
117
+ pnpm exec vizmatic frames --out public/vizmatic --theme dark,light --watermark "Your Product" --watermark-image ./logo.svg --watermark-position top-right
110
118
  ```
111
119
 
112
120
  Frame modules can also export a watermark element when code-owned branding is clearer than CLI flags:
package/README.md CHANGED
@@ -31,6 +31,16 @@
31
31
 
32
32
  ## Quick Start
33
33
 
34
+ Use Vizmatic as a one-off binary without touching `package.json`:
35
+
36
+ ```bash
37
+ pnpm dlx vizmatic ./frame.tsx --out ./dist/frames --theme dark,light
38
+ ```
39
+
40
+ Bare CLI frames auto-import Vizmatic primitives and inject theme colors. Use normal imports when a frame needs helpers, data loading, custom dependencies, or direct renderer APIs.
41
+
42
+ Install it when you want project scripts, editor types, or direct renderer APIs:
43
+
34
44
  ```bash
35
45
  pnpm add vizmatic react
36
46
  ```
@@ -44,33 +54,24 @@ pnpm add github:bvolpato/vizmatic react
44
54
  Create a frame:
45
55
 
46
56
  ```tsx
47
- import React from "react"
48
- import { defineIllustration, Flow, Scene } from "vizmatic"
49
-
50
- export const width = 1040
51
- export const height = 560
52
-
53
- const frame = defineIllustration((c) => (
54
- <Scene c={c} title="Agent visual pipeline">
55
- <Flow
56
- c={c}
57
- stages={[
58
- { title: "Prompt", subtitle: "intent", tone: "blue" },
59
- { title: "Scene spec", subtitle: "typed structure", tone: "purple" },
60
- { title: "PNG / SVG / GIF", subtitle: "rendered artifact", tone: "green" },
61
- ]}
62
- />
63
- </Scene>
64
- ))
65
-
66
- export const create = frame.create
67
- export default frame.default
57
+ width = 1040
58
+ height = 560
59
+
60
+ <Scene title="Agent visual pipeline">
61
+ <Flow
62
+ stages={[
63
+ { title: "Prompt", subtitle: "intent", tone: "blue" },
64
+ { title: "Scene spec", subtitle: "typed structure", tone: "purple" },
65
+ { title: "PNG / SVG / GIF", subtitle: "rendered artifact", tone: "green" },
66
+ ]}
67
+ />
68
+ </Scene>
68
69
  ```
69
70
 
70
71
  Render it:
71
72
 
72
73
  ```bash
73
- vizmatic render ./frame.tsx --out ./dist/frames --theme dark,light --watermark "Acme" --watermark-image ./logo.svg
74
+ vizmatic ./frame.tsx --out ./dist/frames --theme dark,light --watermark "Acme" --watermark-image ./logo.svg
74
75
  ```
75
76
 
76
77
  Render an animation:
@@ -151,23 +152,16 @@ More examples live in [`examples/`](examples) and on the [website](https://bvolp
151
152
  Use this for small docs snippets and quick agent-generated frames.
152
153
 
153
154
  ```tsx
154
- import { defineIllustration, Flow, Scene } from "vizmatic"
155
-
156
- export const width = 1040
157
- export const height = 560
158
-
159
- const frame = defineIllustration((c) =>
160
- <Scene c={c} title="Agent pipeline">
161
- <Flow c={c} stages={[
162
- { title: "Prompt", tone: "blue" },
163
- { title: "Scene spec", tone: "purple" },
164
- { title: "PNG / GIF", tone: "green" },
165
- ]} />
166
- </Scene>
167
- )
168
-
169
- export const create = frame.create
170
- export default frame.default
155
+ width = 1040
156
+ height = 560
157
+
158
+ <Scene title="Agent pipeline">
159
+ <Flow stages={[
160
+ { title: "Prompt", tone: "blue" },
161
+ { title: "Scene spec", tone: "purple" },
162
+ { title: "PNG / GIF", tone: "green" },
163
+ ]} />
164
+ </Scene>
171
165
  ```
172
166
 
173
167
  ### Flow + callouts
@@ -175,33 +169,24 @@ export default frame.default
175
169
  Use this for process diagrams, architecture walkthroughs, and agent pipelines.
176
170
 
177
171
  ```tsx
178
- import React from "react"
179
- import { CalloutCard, defineIllustration, Flow, Row, Scene } from "vizmatic"
180
-
181
- export const width = 1040
182
- export const height = 560
183
-
184
- const frame = defineIllustration((c) => (
185
- <Scene c={c} title="Agent visual pipeline" subtitle="prompt -> scene spec -> verified artifact" gap={26}>
186
- <Flow
187
- c={c}
188
- connectorTone="purple"
189
- stages={[
190
- { eyebrow: "input", title: "Prompt", subtitle: "intent", tone: "blue", lines: ["goal", "audience", "constraints"], width: 190 },
191
- { eyebrow: "contract", title: "Scene spec", subtitle: "typed structure", tone: "purple", lines: ["cards", "flows", "charts"], width: 190 },
192
- { eyebrow: "render", title: "Satori", subtitle: "React primitives", tone: "cyan", lines: ["layout", "theme", "safe text"], width: 190 },
193
- { eyebrow: "output", title: "PNG / GIF", subtitle: "verified asset", tone: "green", lines: ["autocrop", "overflow checks"], width: 190 },
194
- ]}
195
- />
196
- <Row width="100%" gap={14}>
197
- <CalloutCard c={c} title="Model writes structure" detail="No hand-written SVG paths." tone="purple" width={470} />
198
- <CalloutCard c={c} title="Theme stays in control" detail="Colors and typography come from tokens." tone="green" width={470} />
199
- </Row>
200
- </Scene>
201
- ))
202
-
203
- export const create = frame.create
204
- export default frame.default
172
+ width = 1040
173
+ height = 560
174
+
175
+ <Scene title="Agent visual pipeline" subtitle="prompt -> scene spec -> verified artifact" gap={26}>
176
+ <Flow
177
+ connectorTone="purple"
178
+ stages={[
179
+ { eyebrow: "input", title: "Prompt", subtitle: "intent", tone: "blue", lines: ["goal", "audience", "constraints"], width: 190 },
180
+ { eyebrow: "contract", title: "Scene spec", subtitle: "typed structure", tone: "purple", lines: ["cards", "flows", "charts"], width: 190 },
181
+ { eyebrow: "render", title: "Satori", subtitle: "React primitives", tone: "cyan", lines: ["layout", "theme", "safe text"], width: 190 },
182
+ { eyebrow: "output", title: "PNG / GIF", subtitle: "verified asset", tone: "green", lines: ["autocrop", "overflow checks"], width: 190 },
183
+ ]}
184
+ />
185
+ <Row width="100%" gap={14}>
186
+ <CalloutCard title="Model writes structure" detail="No hand-written SVG paths." tone="purple" width={470} />
187
+ <CalloutCard title="Theme stays in control" detail="Colors and typography come from tokens." tone="green" width={470} />
188
+ </Row>
189
+ </Scene>
205
190
  ```
206
191
 
207
192
  ### Animated GIF
@@ -361,24 +346,22 @@ Vizmatic treats generated visuals as source-controlled build artifacts. CI fails
361
346
 
362
347
  | Gate | What it protects |
363
348
  |---|---|
364
- | `pnpm typecheck` | Type safety across `src/`, `examples/`, `scripts/`, and tests |
349
+ | `pnpm lint` | Static TypeScript coverage across `src/`, `examples/`, `scripts/`, and tests |
365
350
  | `pnpm test` | Render pipeline behavior, watermark options, and output validation |
366
351
  | `pnpm render:examples` | Dark/light PNGs, animated GIFs, source snippets, and website HTML |
367
352
  | `pnpm docs:check` | Local asset references, `PROMPT.md` sync, source modal themes, and homepage affordances |
368
- | `pnpm security:audit` | Fails on known low-or-higher npm advisories |
369
- | `npm pack --dry-run` | Published package contents before release |
370
- | CI generated-file check | Ensures rendered docs/examples are committed |
353
+ | `pnpm deps:check` | npm audit plus package tarball contents before release |
354
+ | `./test.sh` drift check | Ensures render/docs commands do not create extra changes |
371
355
 
372
356
  Run the full local gate:
373
357
 
374
358
  ```bash
375
- pnpm verify
376
- git diff --exit-code
359
+ ./test.sh
377
360
  ```
378
361
 
379
362
  ## Supply Chain Posture
380
363
 
381
- Vizmatic keeps runtime dependencies narrow: `satori` for JSX layout, `@resvg/resvg-js` for rasterization, `gifenc` for animated GIF output, and `tsx` so the CLI can load TSX scene files directly.
364
+ Vizmatic keeps runtime dependencies narrow: `react` for JSX frames, `satori` for JSX layout, `@resvg/resvg-js` for rasterization, `gifenc` for animated GIF output, and `tsx` so the CLI can load TSX scene files directly.
382
365
 
383
366
  Package resolution is intentionally conservative:
384
367
 
@@ -564,7 +547,7 @@ src/
564
547
  render.ts Satori -> SVG -> resvg -> PNG
565
548
  animate.ts ordered scene states -> GIF
566
549
  autocrop.ts content bounds and overflow checks
567
- cli.ts vizmatic render / vizmatic gif
550
+ cli.ts vizmatic file.tsx / vizmatic render / vizmatic gif
568
551
  examples/
569
552
  *.tsx generated gallery frames
570
553
  docs/