executable-stories-demo 0.1.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,132 @@
1
+ # executable-stories-demo
2
+
3
+ Publish Astro product demo sites from executable-stories Playwright run artifacts.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add -D executable-stories-demo executable-stories-formatters
9
+ ```
10
+
11
+ ## Commands
12
+
13
+ ```bash
14
+ executable-stories-demo init my-demo-site
15
+ executable-stories-demo build --input reports/raw-run.json --site my-demo-site
16
+ executable-stories-demo preview --site my-demo-site
17
+
18
+ # CI-safe build (fail on missing assets)
19
+ executable-stories-demo build \
20
+ --input reports/raw-run.json \
21
+ --site my-demo-site \
22
+ --strict
23
+
24
+ # Custom assets path/base URL
25
+ executable-stories-demo build \
26
+ --input reports/raw-run.json \
27
+ --site my-demo-site \
28
+ --assets-dir public/media \
29
+ --assets-base-url /media
30
+ ```
31
+
32
+ ## Input contract
33
+
34
+ - `build --input` accepts:
35
+ - a raw run JSON (`status: pass|fail|skip`) which is canonicalized automatically, or
36
+ - an already canonical run JSON (`status: passed|failed|skipped|pending`).
37
+ - `build --site` must point to a scaffolded demo site containing `astro.config.mjs` (created by `init`).
38
+
39
+ ## Build flow
40
+
41
+ 1. `init` scaffolds an Astro Starlight site and writes `demo.config.json`.
42
+ 2. `build` reads the run JSON, generates story pages under `src/content/docs/stories`, appends scenario attachments (video/image/file) to each generated page, copies and hashes local media assets into `public/demo-assets`, writes `demo-manifest.json`, and updates `src/content/docs/index.mdx`.
43
+ 3. `preview` runs the Astro site (`dev` by default, configurable via `--mode`).
44
+
45
+ ## Config
46
+
47
+ `demo.config.json`:
48
+
49
+ ```json
50
+ {
51
+ "productName": "My Product",
52
+ "tagline": "Automate everything",
53
+ "theme": "default",
54
+ "template": "splash",
55
+ "cta": {
56
+ "primary": "Get Started",
57
+ "url": "/signup"
58
+ },
59
+ "stats": { "mode": "capability" },
60
+ "featured": { "scenario": "stories/checkout/happy-path" },
61
+ "branding": {
62
+ "logo": "/brand/logo.svg",
63
+ "ogImage": "/brand/og.png",
64
+ "favicon": "/brand/favicon.svg",
65
+ "accent": "#ff5722"
66
+ },
67
+ "seo": {
68
+ "title": "My Product — verified scenarios",
69
+ "description": "End-to-end product walkthrough.",
70
+ "twitter": "@acme",
71
+ "canonical": "https://example.com/demo/"
72
+ },
73
+ "sections": [
74
+ {
75
+ "kind": "feature-grid",
76
+ "heading": "Why teams use it",
77
+ "items": [
78
+ { "title": "Real test runs", "body": "Pages reflect what actually shipped." },
79
+ { "title": "One CLI", "body": "Pick a theme, ship a demo." }
80
+ ]
81
+ },
82
+ { "kind": "quote", "quote": "Replaced our static deck.", "attribution": "Sales engineer, Acme" }
83
+ ],
84
+ "scenarios": {
85
+ "order": ["stories/signup-flow", "stories/dashboard"]
86
+ }
87
+ }
88
+ ```
89
+
90
+ ### Templates
91
+
92
+ - `template: "splash"` (default) — product-page chassis: hero with optional logo + CTA, optional featured scenario with inline media, capability-framed stats, custom sections, scenario list. Designed for customers, prospects, sales engineering.
93
+ - `template: "dashboard"` — engineering test-report layout: hero, test-mode stats (Passed / Failed / Skipped), story list. The original demo behaviour.
94
+
95
+ ### Stats modes
96
+
97
+ - `stats.mode: "capability"` — buyer-friendly: total scenarios + verified count. Default for `splash`.
98
+ - `stats.mode: "test"` — engineering view: passed / failed / skipped. Default for `dashboard`.
99
+ - `stats.mode: "off"` — hide the strip entirely.
100
+
101
+ ### Featured scenario
102
+
103
+ Set `featured.scenario` to a story slug (e.g. `stories/checkout/happy-path`). The first video or image attachment from that scenario is rendered inline beneath the hero, with a "Read the full scenario →" link to the dedicated page. Splash mode only.
104
+
105
+ ### Sections
106
+
107
+ Splash mode supports an optional `sections[]` array with three kinds:
108
+
109
+ - `feature-grid` — three-column tile strip with `{ title, body }` items.
110
+ - `narrative` — heading + body copy + optional `media` image, two-column at ≥56rem.
111
+ - `quote` — pull quote with optional `attribution`.
112
+
113
+ ### SEO + branding
114
+
115
+ The `seo` and `branding` blocks emit `og:`, `twitter:`, `link[rel=canonical]`, and `link[rel=icon]` tags via Starlight's `head:` frontmatter. `branding.accent` overrides the active theme's `--demo-accent` token via a sanitised inline style.
116
+
117
+ ### Themes
118
+
119
+ Supported: `default`, `corporate`, `terminal`, `minimal`, `dashboard`, `playful`. Browse `/themes` on a generated site for a side-by-side gallery of palettes and typography — no need to scaffold six sites to compare.
120
+
121
+ Themes that force a single colour scheme (`corporate`, `terminal`, `minimal`, `dashboard`, `playful`) hide Starlight's theme toggle automatically; only `default` is light/dark adaptive.
122
+
123
+ Fonts are bundled via `@fontsource` packages and served from your own origin — no third-party CDN dependency, no GDPR concern, no render-blocking external requests.
124
+
125
+ ## DX guardrails
126
+
127
+ - Missing site directory: clear error with `init` hint.
128
+ - Invalid site (missing `astro.config.mjs`): clear scaffold error.
129
+ - Missing input JSON: explicit file-not-found error.
130
+ - Unknown theme values: automatically fall back to `default`.
131
+ - `--strict` enforces missing-asset failures for CI reliability.
132
+ - `--allow-missing-assets false` offers the same behavior without enabling all strict defaults.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/cli.js";
package/bin/intent.js ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ await import('@tanstack/intent/intent-library')