create-vizcraft-playground 0.1.0 → 0.2.0

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/README.md ADDED
@@ -0,0 +1,103 @@
1
+ # create-vizcraft-playground
2
+
3
+ Scaffold a new [VizCraft](https://www.npmjs.com/package/vizcraft) interactive visualization playground in seconds.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ npx create-vizcraft-playground my-playground
9
+ ```
10
+
11
+ Or without a project name — the CLI will prompt you:
12
+
13
+ ```bash
14
+ npx create-vizcraft-playground
15
+ ```
16
+
17
+ The scaffolder will ask for:
18
+
19
+ - **Project directory name**
20
+ - **Playground title** shown on the landing page
21
+ - **Subtitle** — one-liner description
22
+ - **Accent colour** — hex value for the primary theme colour
23
+
24
+ Then just install and run:
25
+
26
+ ```bash
27
+ cd my-playground
28
+ npm install
29
+ npm run dev
30
+ ```
31
+
32
+ Open [http://localhost:5173](http://localhost:5173).
33
+
34
+ ## Re-running the setup wizard
35
+
36
+ You can re-configure the title, subtitle, and accent colour at any time:
37
+
38
+ ```bash
39
+ npm run init
40
+ ```
41
+
42
+ This regenerates `src/playground.config.ts`.
43
+
44
+ ## Adding a plugin
45
+
46
+ Generate a new visualization plugin:
47
+
48
+ ```bash
49
+ npm run generate <plugin-name> --category "Category Name"
50
+ ```
51
+
52
+ Example:
53
+
54
+ ```bash
55
+ npm run generate supply-demand --category "Microeconomics"
56
+ ```
57
+
58
+ This creates `src/plugins/<plugin-name>/` and wires it into the registry automatically. See [template/README.md](template/README.md) for full plugin docs.
59
+
60
+ ### Sandbox plugins
61
+
62
+ Use the `--sandbox` flag to generate an interactive, architecture-builder-style plugin where users can dynamically add and remove components and the scene, steps, and animations all adapt reactively:
63
+
64
+ ```bash
65
+ npm run generate cloud-lab --category "Systems" --sandbox
66
+ ```
67
+
68
+ A sandbox plugin differs from a standard one in a few key ways:
69
+
70
+ - **Controls panel** — a `controls.tsx` component rendered in the Shell sidebar lets users toggle infrastructure components on and off.
71
+ - **Dynamic steps** — steps are derived from the current component state, so adding a cache or load balancer automatically adds relevant walkthrough steps.
72
+ - **Declarative flow engine** — a `flow-engine.ts` file describes all signal animations as data. No imperative per-step animation code; adding a step means adding a config entry.
73
+ - **8 files** instead of the standard 6, including `flow-engine.ts` and `controls.tsx`.
74
+
75
+ Use sandbox plugins when you want an interactive scene where composition affects both the narrative and the visualization.
76
+
77
+ ### Timeline plugins
78
+
79
+ Use the `--timeline` flag to generate a progressive-reveal timeline plugin with animated nodes, a colored progress bar, auto-pan, and declarative steps generated from a data array:
80
+
81
+ ```bash
82
+ npm run generate historical-events --category "History" --timeline
83
+ ```
84
+
85
+ A timeline plugin differs from the standard one in a few key ways:
86
+
87
+ - **Declarative flow engine** — a `flow-engine.ts` file defines steps as data. Per-item steps are auto-generated from the items array so adding an item automatically adds a step.
88
+ - **Data file** — a `data.ts` file contains the timeline items, category colors, era ranges, and connection definitions.
89
+ - **Progressive reveal** — items light up one-by-one with a 3-state system (reached / active / upcoming) and a colored progress bar tracks progress.
90
+ - **Animated nodes** — the active node rises up with an `animateTo()` entrance and the camera auto-pans via `zoomToNode()`.
91
+ - **8 files** instead of the standard 6, including `flow-engine.ts` and `data.ts`.
92
+
93
+ Use timeline plugins when you want a chronological walkthrough with per-item detail cards and connection overlays.
94
+
95
+ ## Requirements
96
+
97
+ - Node.js 20+
98
+
99
+ 3. Add a short summary sentence.
100
+
101
+ ## Template docs
102
+
103
+ Scaffolded playground usage and plugin-generation docs are in template/README.md.
package/index.js CHANGED
@@ -160,6 +160,10 @@ export default playgroundConfig;
160
160
  console.log("");
161
161
  console.log(' npm run generate my-concept --category "My Category"');
162
162
  console.log("");
163
+ console.log(" Or scaffold a sandbox plugin (dynamic components, flow engine):");
164
+ console.log("");
165
+ console.log(' npm run generate my-concept --sandbox --category "My Category"');
166
+ console.log("");
163
167
 
164
168
  rl.close();
165
169
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vizcraft-playground",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Scaffold a new VizCraft interactive visualization playground",
5
5
  "type": "module",
6
6
  "bin": {
@@ -35,7 +35,27 @@ For example:
35
35
  npm run generate supply-demand --category "Microeconomics"
36
36
  ```
37
37
 
38
- This creates `src/plugins/<plugin-name>/` with six files and wires it into the registry automatically. If the category doesn't exist yet, it will be created.
38
+ This creates `src/plugins/<plugin-name>/` and wires it into the registry automatically. If the category doesn't exist yet, it will be created.
39
+
40
+ ### Generate a sandbox plugin
41
+
42
+ Use the sandbox option when you want dynamic infrastructure toggles and adaptive step flows:
43
+
44
+ ```bash
45
+ npm run generate cloud-lab --category "Systems" --sandbox
46
+ ```
47
+
48
+ The generator includes sandbox-aware defaults and structure for component toggles, step mapping, and interaction-focused scenes.
49
+
50
+ ### Generate a timeline plugin
51
+
52
+ Use the timeline option when you want a progressive-reveal timeline with animated nodes, a progress bar, and declarative steps auto-generated from a data array:
53
+
54
+ ```bash
55
+ npm run generate historical-events --category "History" --timeline
56
+ ```
57
+
58
+ A timeline plugin generates 8 files (the standard 6 plus `flow-engine.ts` and `data.ts`). Steps are built dynamically from the items array in `data.ts` — adding an item automatically adds a step.
39
59
 
40
60
  ### Plugin structure
41
61