@navipartner/demo-video 0.4.0 → 0.5.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/README.md +128 -109
- package/bin/args.d.mts +39 -30
- package/bin/args.mjs +158 -153
- package/bin/demo-video.mjs +425 -272
- package/bin/encode.mjs +187 -187
- package/bin/init.d.mts +30 -24
- package/bin/init.mjs +520 -447
- package/bin/pick.d.mts +23 -18
- package/bin/pick.mjs +265 -252
- package/bin/pitch.d.mts +17 -0
- package/bin/pitch.mjs +261 -0
- package/dist/{adapter-CWqMoNdw.d.ts → adapter-D_iU2dh2.d.ts} +19 -0
- package/dist/index.d.ts +3 -3
- package/dist/runner/index.d.ts +2 -2
- package/dist/runner/index.js +61 -3
- package/package.json +1 -1
- package/skills/np-demo-video/SKILL.md +364 -348
- package/skills/np-demo-video/linear.md +117 -0
- package/skills/np-demo-video/look.md +158 -158
- package/skills/np-demo-video/reference.md +92 -82
package/README.md
CHANGED
|
@@ -1,109 +1,128 @@
|
|
|
1
|
-
# @navipartner/demo-video
|
|
2
|
-
|
|
3
|
-
Marketing demo videos of
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
`
|
|
83
|
-
`
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
1
|
+
# @navipartner/demo-video
|
|
2
|
+
|
|
3
|
+
Marketing demo videos of React apps.
|
|
4
|
+
|
|
5
|
+
- Filmed on the app's own e2e mocks.
|
|
6
|
+
- NaviPartner look: camera pushes, serif cards.
|
|
7
|
+
- Any customer's brand, chosen per video.
|
|
8
|
+
- Smooth 60 fps, frame by frame.
|
|
9
|
+
- pnpm repos, GitHub Actions, `@playwright/test` 1.59+.
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
npx --ignore-scripts @navipartner/demo-video init
|
|
14
|
+
pnpm install
|
|
15
|
+
|
|
16
|
+
- Adds the skill, label and workflow.
|
|
17
|
+
- Finds apps with a `playwright.config`.
|
|
18
|
+
- One app: set up directly.
|
|
19
|
+
- Several apps: `init --app <folder>` each.
|
|
20
|
+
- Safe to re-run; `--dry-run` previews.
|
|
21
|
+
- Then ask Claude for a video.
|
|
22
|
+
|
|
23
|
+
## Get a video
|
|
24
|
+
|
|
25
|
+
| Ask | Who | You get |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| @Linear "video of checkout from np-pos for Acme" | Linear users | that story in Acme's brand, attached |
|
|
28
|
+
| @Linear "pitch draft of checkout for Northwind (northwind.example)" | Linear users | a researched brand, attached |
|
|
29
|
+
| `/demo-video` on a PR | members | primary story, from the PR branch |
|
|
30
|
+
| `/demo-video checkout in acme branding` | members | that story, that brand |
|
|
31
|
+
| `/demo-video help` | members | menu of stories and brands |
|
|
32
|
+
| `demo video` label on a PR | whoever labels | every changed story, each push |
|
|
33
|
+
| Actions → Demo video → Run workflow | repo writers | any story, any branch |
|
|
34
|
+
| `pnpm exec demo-video render` | developers | any story, locally |
|
|
35
|
+
|
|
36
|
+
- Requests only pick existing stories.
|
|
37
|
+
- New stories come via PRs.
|
|
38
|
+
- PR comments: first line is the request.
|
|
39
|
+
- Unknown names get the menu.
|
|
40
|
+
|
|
41
|
+
### In Linear
|
|
42
|
+
|
|
43
|
+
- Ask @Linear in plain words.
|
|
44
|
+
- Name the repo, story and customer.
|
|
45
|
+
- Follows the skill's `linear.md`.
|
|
46
|
+
- Brand in the repo: 60 fps video.
|
|
47
|
+
- No brand yet: a pitch draft.
|
|
48
|
+
- MP4 and contact sheet attached.
|
|
49
|
+
- Nothing committed, nothing kept.
|
|
50
|
+
- Linear AI credits, no API key.
|
|
51
|
+
- Slow sandbox: ~15× video length.
|
|
52
|
+
|
|
53
|
+
### Pitch drafts
|
|
54
|
+
|
|
55
|
+
- @Linear researches the customer's own website.
|
|
56
|
+
- Brand checked, then filmed at 30 fps.
|
|
57
|
+
- Google Fonts stand-ins only.
|
|
58
|
+
- That customer only; check before sending.
|
|
59
|
+
|
|
60
|
+
## Stories and brands
|
|
61
|
+
|
|
62
|
+
- **Story:** `demo/stories/<name>.json`, scenes as JSON.
|
|
63
|
+
- Built only from the mocks.
|
|
64
|
+
- One story per app is primary.
|
|
65
|
+
- **Variant:** `checkout.acme.json`, customer's own words.
|
|
66
|
+
- **Brand:** `demo/brands/<name>.json` plus assets.
|
|
67
|
+
- `navipartner` ships as the default.
|
|
68
|
+
- **Brand needs:** the adapter lists what brands need.
|
|
69
|
+
- Missing needs fail `check`.
|
|
70
|
+
- Customer brands need customer permission.
|
|
71
|
+
- The skill has fields and the look.
|
|
72
|
+
|
|
73
|
+
## Commands
|
|
74
|
+
|
|
75
|
+
Run in the app's folder: `pnpm exec demo-video <command>`.
|
|
76
|
+
|
|
77
|
+
| Command | Does |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `init` | sets up a repo or app |
|
|
80
|
+
| `list` | stories, primary first |
|
|
81
|
+
| `check` | dry run in seconds, names problems |
|
|
82
|
+
| `render` | MP4, contact sheet, ten stills |
|
|
83
|
+
| `record` / `encode` / `stills` | render in parts |
|
|
84
|
+
| `brand-needs` | what a brand must give |
|
|
85
|
+
| `pitch <proposal.json>` | pitch draft from a researched brand |
|
|
86
|
+
| `pick` | what a request means (workflows) |
|
|
87
|
+
|
|
88
|
+
| Flag | Means |
|
|
89
|
+
|---|---|
|
|
90
|
+
| `--story <name>` | default: primary story |
|
|
91
|
+
| `--brand <name>` | default: `navipartner` |
|
|
92
|
+
| `--draft` | 30 fps, twice as fast |
|
|
93
|
+
| `--brands <dir>` | extra brands folder, searched first |
|
|
94
|
+
| `--app <dir>` | app folder, default `.` |
|
|
95
|
+
| `--json` | machine-readable output |
|
|
96
|
+
|
|
97
|
+
Output lands in `demo/out/`. Failures keep Playwright's output in `demo/out/failed/`.
|
|
98
|
+
|
|
99
|
+
## Develop
|
|
100
|
+
|
|
101
|
+
pnpm install
|
|
102
|
+
pnpm test && pnpm typecheck && pnpm lint && pnpm build
|
|
103
|
+
|
|
104
|
+
- CI runs tests, actionlint, smoke render.
|
|
105
|
+
|
|
106
|
+
## Release
|
|
107
|
+
|
|
108
|
+
1. Bump `version` on main.
|
|
109
|
+
2. `git tag vX.Y.Z && git push origin vX.Y.Z`.
|
|
110
|
+
|
|
111
|
+
- CI publishes to npm (`latest`).
|
|
112
|
+
- Trusted publishing, no npm token.
|
|
113
|
+
- `v0` tag moves along.
|
|
114
|
+
- Manual `release.yml` run: `next` prerelease.
|
|
115
|
+
|
|
116
|
+
## Public package, private repo
|
|
117
|
+
|
|
118
|
+
- `check-public.mjs` checks every tarball.
|
|
119
|
+
- Allowed files only, no source maps.
|
|
120
|
+
- No secrets, emails or local paths.
|
|
121
|
+
- Names aren't caught: keep customers out.
|
|
122
|
+
|
|
123
|
+
## Compatibility
|
|
124
|
+
|
|
125
|
+
- Projects pin the CLI version.
|
|
126
|
+
- Their workflows follow `v0` immediately.
|
|
127
|
+
- Workflows must support CLI 0.4+.
|
|
128
|
+
- Breaking that means `v1`.
|
package/bin/args.d.mts
CHANGED
|
@@ -1,30 +1,39 @@
|
|
|
1
|
-
export interface DemoArgs {
|
|
2
|
-
command:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export function
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
export interface DemoArgs {
|
|
2
|
+
command:
|
|
3
|
+
| "check"
|
|
4
|
+
| "render"
|
|
5
|
+
| "record"
|
|
6
|
+
| "encode"
|
|
7
|
+
| "stills"
|
|
8
|
+
| "list"
|
|
9
|
+
| "brand-needs";
|
|
10
|
+
appDir: string;
|
|
11
|
+
demoDir: string;
|
|
12
|
+
adapterPath: string;
|
|
13
|
+
workDir: string;
|
|
14
|
+
runnerDir: string;
|
|
15
|
+
configPath: string;
|
|
16
|
+
outDir: string;
|
|
17
|
+
storyboardPath: string | null;
|
|
18
|
+
brand: string | null;
|
|
19
|
+
/** `--brands`: a brands folder outside the repo, searched first. */
|
|
20
|
+
brandsDir: string | null;
|
|
21
|
+
json: boolean;
|
|
22
|
+
draft: boolean;
|
|
23
|
+
}
|
|
24
|
+
export const COMMANDS: readonly string[];
|
|
25
|
+
export function parseArgs(argv: string[], cwd: string): DemoArgs;
|
|
26
|
+
export interface StoryEntry {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string | null;
|
|
29
|
+
primary: boolean;
|
|
30
|
+
/** A variant: the story it extends, and the brand it is for. */
|
|
31
|
+
extends?: string;
|
|
32
|
+
brand?: string | null;
|
|
33
|
+
}
|
|
34
|
+
export function listStories(demoDir: string): StoryEntry[];
|
|
35
|
+
export function resolveStoryboard(
|
|
36
|
+
value: string,
|
|
37
|
+
cwd: string,
|
|
38
|
+
demoDir: string,
|
|
39
|
+
): string;
|
package/bin/args.mjs
CHANGED
|
@@ -1,153 +1,158 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
|
|
4
|
-
export const COMMANDS = [
|
|
5
|
-
"check",
|
|
6
|
-
"render",
|
|
7
|
-
"record",
|
|
8
|
-
"encode",
|
|
9
|
-
"stills",
|
|
10
|
-
"list",
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
--
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
export const COMMANDS = [
|
|
5
|
+
"check",
|
|
6
|
+
"render",
|
|
7
|
+
"record",
|
|
8
|
+
"encode",
|
|
9
|
+
"stills",
|
|
10
|
+
"list",
|
|
11
|
+
"brand-needs",
|
|
12
|
+
];
|
|
13
|
+
const NEEDS_STORYBOARD = new Set(["check", "render", "record"]);
|
|
14
|
+
const USAGE = `Usage: demo-video <${COMMANDS.join("|")}> [--app <dir>] [--story <name|file.json>] [--brand <name>] [--brands <dir>] [--draft] [--json]
|
|
15
|
+
Without --story, check, render and record use the app's primary story.
|
|
16
|
+
--draft renders at 30 fps (about half the time) to iterate on a story.
|
|
17
|
+
--brands adds a brands folder outside the repo, searched first.
|
|
18
|
+
brand-needs: what a brand must give this app (its adapter's brandNeeds).
|
|
19
|
+
Setup: demo-video init [--app <dir>] [--dry-run]
|
|
20
|
+
For a /demo-video request: demo-video pick --request "<text>" [--json] <app dir>...
|
|
21
|
+
For a pitch draft (the skill's linear.md): demo-video pitch <proposal.json> [--app <dir>] [--story <name>] [--out <dir>] [--json]`;
|
|
22
|
+
|
|
23
|
+
export const resolveStoryboard = (value, cwd, demoDir) => {
|
|
24
|
+
if (value.endsWith(".json")) {
|
|
25
|
+
const file = path.resolve(cwd, value);
|
|
26
|
+
if (!fs.existsSync(file)) {
|
|
27
|
+
throw new Error(`Story file ${file} does not exist`);
|
|
28
|
+
}
|
|
29
|
+
return file;
|
|
30
|
+
}
|
|
31
|
+
const dir = path.join(demoDir, "stories");
|
|
32
|
+
const file = path.join(dir, `${value}.json`);
|
|
33
|
+
if (!fs.existsSync(file)) {
|
|
34
|
+
const known = fs.existsSync(dir)
|
|
35
|
+
? fs
|
|
36
|
+
.readdirSync(dir)
|
|
37
|
+
.filter((f) => f.endsWith(".json"))
|
|
38
|
+
.map((f) => f.slice(0, -".json".length))
|
|
39
|
+
: [];
|
|
40
|
+
throw new Error(
|
|
41
|
+
`No story "${value}" in ${dir}. Known: ${known.join(", ") || "(none)"}`,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
return file;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The app's stories, primary first, then by name. Reads only `description`
|
|
49
|
+
* and `primary`: the full check needs the adapter and runs in `check`.
|
|
50
|
+
*/
|
|
51
|
+
export const listStories = (demoDir) => {
|
|
52
|
+
const dir = path.join(demoDir, "stories");
|
|
53
|
+
if (!fs.existsSync(dir)) {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
const stories = fs
|
|
57
|
+
.readdirSync(dir)
|
|
58
|
+
.filter((f) => f.endsWith(".json"))
|
|
59
|
+
.map((f) => {
|
|
60
|
+
const story = JSON.parse(fs.readFileSync(path.join(dir, f), "utf8"));
|
|
61
|
+
return {
|
|
62
|
+
name: f.slice(0, -".json".length),
|
|
63
|
+
description: story.description ?? null,
|
|
64
|
+
primary: story.primary === true,
|
|
65
|
+
// A variant: the base story's flow, for one brand.
|
|
66
|
+
...(story.extends
|
|
67
|
+
? { extends: story.extends, brand: story.brand ?? null }
|
|
68
|
+
: {}),
|
|
69
|
+
};
|
|
70
|
+
})
|
|
71
|
+
.sort(
|
|
72
|
+
(a, b) =>
|
|
73
|
+
Number(b.primary) - Number(a.primary) || a.name.localeCompare(b.name),
|
|
74
|
+
);
|
|
75
|
+
const primaries = stories.filter((s) => s.primary).map((s) => s.name);
|
|
76
|
+
if (primaries.length > 1) {
|
|
77
|
+
throw new Error(
|
|
78
|
+
`Only one story can be primary; ${primaries.join(", ")} all are (in ${dir})`,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
return stories;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const parseArgs = (argv, cwd) => {
|
|
85
|
+
const [command, ...rest] = argv;
|
|
86
|
+
if (!COMMANDS.includes(command)) {
|
|
87
|
+
throw new Error(USAGE);
|
|
88
|
+
}
|
|
89
|
+
const opts = {
|
|
90
|
+
app: ".",
|
|
91
|
+
story: undefined,
|
|
92
|
+
brand: undefined,
|
|
93
|
+
json: false,
|
|
94
|
+
draft: false,
|
|
95
|
+
};
|
|
96
|
+
for (let i = 0; i < rest.length; i++) {
|
|
97
|
+
const arg = rest[i];
|
|
98
|
+
if (arg === "--json") {
|
|
99
|
+
opts.json = true;
|
|
100
|
+
} else if (arg === "--draft") {
|
|
101
|
+
opts.draft = true;
|
|
102
|
+
} else if (["--app", "--story", "--brand", "--brands"].includes(arg)) {
|
|
103
|
+
const value = rest[++i];
|
|
104
|
+
if (!value) {
|
|
105
|
+
throw new Error(`${arg} needs a value`);
|
|
106
|
+
}
|
|
107
|
+
opts[arg.slice(2)] = value;
|
|
108
|
+
} else {
|
|
109
|
+
throw new Error(`Unknown option ${arg}\n${USAGE}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const appDir = path.resolve(cwd, opts.app);
|
|
113
|
+
const demoDir = path.join(appDir, "demo");
|
|
114
|
+
const adapterPath = path.join(demoDir, "demo.config.ts");
|
|
115
|
+
if (!fs.existsSync(adapterPath)) {
|
|
116
|
+
throw new Error(`No demo adapter: expected ${adapterPath}`);
|
|
117
|
+
}
|
|
118
|
+
// Everything a run needs only while it runs (the generated Playwright
|
|
119
|
+
// config and spec, the check report, the raw recording, Playwright's
|
|
120
|
+
// results) goes here, inside demo/out/ (gitignored), and is deleted when
|
|
121
|
+
// the command ends. Only a failure's results are kept, in demo/out/failed/.
|
|
122
|
+
// `check` has its own folder, so it never touches the take that `record`
|
|
123
|
+
// leaves for `encode`.
|
|
124
|
+
const workDir = path.join(
|
|
125
|
+
demoDir,
|
|
126
|
+
"out",
|
|
127
|
+
".work",
|
|
128
|
+
command === "check" || command === "brand-needs" ? command : "take",
|
|
129
|
+
);
|
|
130
|
+
const runnerDir = path.join(workDir, "runner");
|
|
131
|
+
let storyboardPath = null;
|
|
132
|
+
if (NEEDS_STORYBOARD.has(command)) {
|
|
133
|
+
// No --story: the app's primary story, its main journey.
|
|
134
|
+
const story =
|
|
135
|
+
opts.story ?? listStories(demoDir).find((s) => s.primary)?.name;
|
|
136
|
+
if (!story) {
|
|
137
|
+
throw new Error(
|
|
138
|
+
`No --story given and no primary story in ${path.join(demoDir, "stories")}. Name one with --story, or mark the app's main journey "primary": true.`,
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
storyboardPath = resolveStoryboard(story, cwd, demoDir);
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
command,
|
|
145
|
+
appDir,
|
|
146
|
+
demoDir,
|
|
147
|
+
adapterPath,
|
|
148
|
+
workDir,
|
|
149
|
+
runnerDir,
|
|
150
|
+
configPath: path.join(runnerDir, "playwright.config.mjs"),
|
|
151
|
+
outDir: path.join(demoDir, "out"),
|
|
152
|
+
storyboardPath,
|
|
153
|
+
brand: opts.brand ?? null,
|
|
154
|
+
brandsDir: opts.brands ? path.resolve(cwd, opts.brands) : null,
|
|
155
|
+
json: opts.json,
|
|
156
|
+
draft: opts.draft,
|
|
157
|
+
};
|
|
158
|
+
};
|