@softure-ai/marketing-kit 0.1.7 → 0.1.8

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.
Files changed (107) hide show
  1. package/README.md +79 -11
  2. package/dist/cli/main.js +84 -29
  3. package/dist/cli/main.js.map +1 -1
  4. package/dist/cli/og.d.ts +4 -1
  5. package/dist/cli/og.d.ts.map +1 -1
  6. package/dist/cli/og.js +15 -7
  7. package/dist/cli/og.js.map +1 -1
  8. package/dist/cli/options.d.ts +26 -2
  9. package/dist/cli/options.d.ts.map +1 -1
  10. package/dist/cli/options.js +97 -9
  11. package/dist/cli/options.js.map +1 -1
  12. package/dist/cli/voice.d.ts +14 -0
  13. package/dist/cli/voice.d.ts.map +1 -1
  14. package/dist/cli/voice.js +13 -0
  15. package/dist/cli/voice.js.map +1 -1
  16. package/dist/config/actions-schema.d.ts +14 -14
  17. package/dist/config/config.d.ts +2 -0
  18. package/dist/config/config.d.ts.map +1 -1
  19. package/dist/config/config.js +1 -1
  20. package/dist/config/config.js.map +1 -1
  21. package/dist/config/og-image-names.d.ts +7 -0
  22. package/dist/config/og-image-names.d.ts.map +1 -0
  23. package/dist/config/og-image-names.js +9 -0
  24. package/dist/config/og-image-names.js.map +1 -0
  25. package/dist/config/schema.d.ts +103 -15
  26. package/dist/config/schema.d.ts.map +1 -1
  27. package/dist/config/schema.js +64 -7
  28. package/dist/config/schema.js.map +1 -1
  29. package/dist/index.d.ts +5 -3
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +5 -3
  32. package/dist/index.js.map +1 -1
  33. package/dist/og/index.d.ts +3 -3
  34. package/dist/og/index.d.ts.map +1 -1
  35. package/dist/og/index.js +3 -2
  36. package/dist/og/index.js.map +1 -1
  37. package/dist/og/render.d.ts +13 -0
  38. package/dist/og/render.d.ts.map +1 -1
  39. package/dist/og/render.js +31 -6
  40. package/dist/og/render.js.map +1 -1
  41. package/dist/og/templates/big-number.d.ts +7 -0
  42. package/dist/og/templates/big-number.d.ts.map +1 -0
  43. package/dist/og/templates/big-number.js +41 -0
  44. package/dist/og/templates/big-number.js.map +1 -0
  45. package/dist/og/templates/carousel.d.ts +5 -0
  46. package/dist/og/templates/carousel.d.ts.map +1 -0
  47. package/dist/og/templates/carousel.js +26 -0
  48. package/dist/og/templates/carousel.js.map +1 -0
  49. package/dist/og/templates/context.d.ts +11 -3
  50. package/dist/og/templates/context.d.ts.map +1 -1
  51. package/dist/og/templates/context.js +6 -0
  52. package/dist/og/templates/context.js.map +1 -1
  53. package/dist/og/templates/frame.d.ts +2 -2
  54. package/dist/og/templates/frame.d.ts.map +1 -1
  55. package/dist/og/templates/frame.js +2 -2
  56. package/dist/og/templates/frame.js.map +1 -1
  57. package/dist/og/templates/index.d.ts +8 -3
  58. package/dist/og/templates/index.d.ts.map +1 -1
  59. package/dist/og/templates/index.js +18 -5
  60. package/dist/og/templates/index.js.map +1 -1
  61. package/dist/og/templates/portrait.d.ts +22 -0
  62. package/dist/og/templates/portrait.d.ts.map +1 -0
  63. package/dist/og/templates/portrait.js +75 -0
  64. package/dist/og/templates/portrait.js.map +1 -0
  65. package/dist/og/templates/schemas.d.ts +28 -0
  66. package/dist/og/templates/schemas.d.ts.map +1 -1
  67. package/dist/og/templates/schemas.js +26 -0
  68. package/dist/og/templates/schemas.js.map +1 -1
  69. package/dist/screenshot/gates.d.ts +6 -3
  70. package/dist/screenshot/gates.d.ts.map +1 -1
  71. package/dist/screenshot/gates.js +12 -3
  72. package/dist/screenshot/gates.js.map +1 -1
  73. package/dist/screenshot/screenshot.d.ts +17 -0
  74. package/dist/screenshot/screenshot.d.ts.map +1 -1
  75. package/dist/screenshot/screenshot.js +37 -6
  76. package/dist/screenshot/screenshot.js.map +1 -1
  77. package/dist/screenshot/storage-state.d.ts +9 -0
  78. package/dist/screenshot/storage-state.d.ts.map +1 -0
  79. package/dist/screenshot/storage-state.js +25 -0
  80. package/dist/screenshot/storage-state.js.map +1 -0
  81. package/dist/voice/placeholder.d.ts +35 -0
  82. package/dist/voice/placeholder.d.ts.map +1 -0
  83. package/dist/voice/placeholder.js +53 -0
  84. package/dist/voice/placeholder.js.map +1 -0
  85. package/package.json +1 -1
  86. package/schema/marketing.schema.json +343 -37
  87. package/src/cli/main.ts +80 -27
  88. package/src/cli/og.ts +14 -6
  89. package/src/cli/options.ts +109 -10
  90. package/src/cli/voice.ts +20 -0
  91. package/src/config/config.ts +3 -2
  92. package/src/config/og-image-names.ts +7 -0
  93. package/src/config/schema.ts +72 -8
  94. package/src/index.ts +7 -1
  95. package/src/og/index.ts +16 -2
  96. package/src/og/render.ts +36 -6
  97. package/src/og/templates/big-number.ts +44 -0
  98. package/src/og/templates/carousel.ts +27 -0
  99. package/src/og/templates/context.ts +16 -3
  100. package/src/og/templates/frame.ts +2 -2
  101. package/src/og/templates/index.ts +31 -9
  102. package/src/og/templates/portrait.ts +126 -0
  103. package/src/og/templates/schemas.ts +35 -0
  104. package/src/screenshot/gates.ts +13 -3
  105. package/src/screenshot/screenshot.ts +51 -11
  106. package/src/screenshot/storage-state.ts +24 -0
  107. package/src/voice/placeholder.ts +83 -0
package/README.md CHANGED
@@ -12,17 +12,31 @@ from one `marketing.json` (MK-2), the scene included as declarative actions (MK-
12
12
  TTS providers (MK-7), screenshots (MK-4) and OG images (MK-5) build on it. Background:
13
13
  [docs/03-marketing-kit.md](../../docs/03-marketing-kit.md).
14
14
 
15
+ ## Install
16
+
17
+ An app runs the kit through `npx` with a pinned version, not as a dependency:
18
+
19
+ ```json
20
+ { "scripts": { "marketing": "npx -y @softure-ai/marketing-kit@0.1.8" } }
21
+ ```
22
+
23
+ `npm run marketing -- all <video>` then runs the CLI. As a `devDependency` the kit would add more than 100 MB
24
+ (hyperframes, Playwright, sharp, resvg) to every `npm ci` and to the deps stage of the app's Docker image, which
25
+ never runs it. Bump the pin and the `$schema` URL of `marketing.json` together. A project that imports the library
26
+ API (`@softure-ai/marketing-kit`, `@softure-ai/marketing-kit/og`) installs it as usual.
27
+
15
28
  ## Commands
16
29
 
17
30
  ```bash
18
- softure-marketing all <video> # voiceover from the cache -> recording -> render -> post copy
31
+ softure-marketing all <video> [--placeholder] # voiceover from the cache -> recording -> render -> post copy
19
32
  softure-marketing voice <video>... [--commit] # voiceovers in order; without --commit only the cost estimate
20
- softure-marketing record <video> [--today=YYYY-MM-DD] [--url=...]
21
- softure-marketing render <video> [--quality=draft|standard|high]
33
+ softure-marketing record <video> [--today=YYYY-MM-DD] [--url=...] [--placeholder]
34
+ softure-marketing render <video> [--quality=draft|standard|high] [--placeholder]
22
35
  softure-marketing preview <video> # the composition in the hyperframes preview
23
36
  softure-marketing posts <video> # post copy only
24
37
  softure-marketing og [image] # OG images (PNG) of every ogImages entry, or of one
25
38
  softure-marketing shots [<id>] [--url=...] # the screenshots entries (or one), each behind its gates
39
+ softure-marketing shots --page=<url> --out=<file.png> --expect=<phrase> [...] # one page anywhere, same gates
26
40
  ```
27
41
 
28
42
  Every command takes `--config=<path>` (default `./marketing.json`). Exit codes: `0` done, `1` failed, `2`
@@ -38,6 +52,12 @@ the screen guard refused the recording (the screen did not show what the voiceov
38
52
  what was recorded, where it stopped and which videos were never sent). Without `--commit` the summary prints
39
53
  the batch's characters and estimate, so the cost is known before paying. Use it instead of a shell loop: a
40
54
  loop runs on after a failed call, and the provider sees every call it makes.
55
+ - **`--placeholder`** rehearses a film before paying for its voiceover: `all`, `record` and `render` use a free
56
+ stand-in, a quiet tone with the script's words at `voice.placeholder.wordsPerSecond` (default 2.5) and
57
+ `voice.placeholder.sentencePauseSeconds` (default 0.5) between sentences. It is written into
58
+ `<output.buildDir>/<video>/placeholder/`, never into `voice.cacheDir` (where it would count as the paid recording),
59
+ and the film goes to `<video>.placeholder.mp4`. A recording made on it renders only with `--placeholder`, and a
60
+ recording made on the paid voiceover only without it. Match the pace to the voice to see the film's real length.
41
61
  - **`--today`** records the app as of another day for one run; it overrides the video's `today`. Once a
42
62
  voiceover is paid for, pin its day in the video's `today` instead, so a plain `all` reproduces the film in any
43
63
  later month (the voiceover says numbers that depend on the day).
@@ -60,11 +80,19 @@ once per scheme, in its own browser, into `<id>-light.png` and `<id>-dark.png`;
60
80
  in `app.colorScheme`. `shots <id>` takes the entry's id and writes all of its files. Since an entry may
61
81
  write any of those three names, an id that is another entry's `<id>-light` or `<id>-dark` is refused.
62
82
  `full: true` first scrolls the page one screen at a time to the bottom, so lazy images and sections
63
- load, then captures the whole page. A screenshot is kept only when it passes every gate:
83
+ load, then captures the whole page. `scrollTo: <px>` instead captures one viewport frame scrolled that far, e.g. to
84
+ check scroll-driven motion (set `motion: "no-preference"` for it, or the page shows its end state). `waitMs` waits
85
+ that long after loading and scrolling, before the gates read the page, for an animation to settle (default 0).
86
+ `storageState` captures a signed-in screen: a Playwright storage state (cookies and localStorage), relative to the
87
+ folder of `marketing.json`, written by the app's own login script (`await context.storageState({ path })`) or by
88
+ `npx playwright codegen --save-storage=<file> <url>`. It holds a live session, so keep it out of git and regenerate
89
+ it when the session expires; a missing or broken file stops `shots` before the browser starts. A screenshot is kept
90
+ only when it passes every gate:
64
91
 
65
92
  | Gate | Refused when |
66
93
  | --- | --- |
67
94
  | `status` | the page answers with HTTP 400 or above, or not at all (`load`: it did not load within 30 s) |
95
+ | `scroll` | the page cannot scroll as far as `scrollTo` (the frame would show another place) |
68
96
  | `phrase` | the page does not show `expect` within 5 s of loading (hidden elements do not count) |
69
97
  | `size` | the file is smaller than `minBytes` (40 kB by default: a blank or broken page); the file is deleted |
70
98
 
@@ -78,6 +106,22 @@ exit code `1`. `--url` points at another address of the app; without it, `shots`
78
106
  starts `app.startCommand` as `record` does. A plain page can be smaller than 40 kB: set `minBytes` for it
79
107
  (the fixture's calculator, a dark page with one form, is about 16 kB and sets 5000).
80
108
 
109
+ #### One page anywhere: `shots --page`
110
+
111
+ ```bash
112
+ softure-marketing shots --page=https://example.com/pricing --out=shots/pricing.png --expect="Pricing" \
113
+ [--width=1440 --height=900 --scale=1 --full --scroll=<px> --wait=<ms> --motion=reduce|no-preference \
114
+ --scheme=light|dark --auth=<storage-state.json> --minbytes=40000]
115
+ ```
116
+
117
+ A competitor's page, production, or any page that is not a `screenshots` entry: the same browser settings
118
+ (`brand.locale`, `brand.timezone`, `app.hideSelectors`, `app.colorScheme` unless `--scheme`) and the same gates, one
119
+ file at `--out` (relative to the current directory; an older file there is removed first). The flags are the entry's
120
+ fields: `--scroll` is `scrollTo`, `--wait` is `waitMs`, `--auth` is `storageState` (relative to the current
121
+ directory), `--minbytes` is `minBytes`; the viewport defaults to 1440×900. `--expect` is required, so an error page
122
+ is never kept. The app is not started and `--url` does not apply. Every flag needs `=<value>` except `--full`, and
123
+ an unknown flag stops the run: a typo must never switch a gate off.
124
+
81
125
  ## `marketing.json`
82
126
 
83
127
  The contract is one zod schema (`src/config/schema.ts`), published as
@@ -162,7 +206,7 @@ folder of `marketing.json`. A complete example: [examples/fixture/marketing.json
162
206
  | | `posts[]` | `video`, `caption`, `hashtags`, `codes` (this video's own codes), `disclosure` (`true`; `false` leaves the disclosure out); a video without one gets no `posts.md` |
163
207
  | | `disclosure` | a paragraph after every post's caption, before the link: that the persona is an example, that it is not advice, that the voice is AI-generated; `{persona}` becomes the video's persona name |
164
208
  | `screenshots[]` | `id`, `path`, `width`, `height`, `full` (`false`), `expect`, `motion` (`reduce`), `minBytes` (`40000`), `scale` (`1`), `colorSchemes` | for `softure-marketing shots`, see [Screenshots](#screenshots) |
165
- | `ogImages[]` | `id`, `template` (`headline-cta`, `headline-chart`), `size` (`[1200, 630]`), `data` | for `softure-marketing og`, see [OG images](#og-images) |
209
+ | `ogImages[]` | `id`, `template` (`headline-cta`, `headline-chart`, `big-number`, `carousel`), `size` (`"landscape"`, `"portrait"`, `"square"`, `"story"` or `[width, height]`; `landscape` for the headline cards, `portrait` for the others), `data` | for `softure-marketing og`, see [OG images](#og-images) |
166
210
  | `layout` | per layout (`9:16`, `1:1`, `16:9` for phone films; `desktop` for desktop films): `caption` (`top`, `left`, `right`, `fontSize`), `persona` (`top`, `left`, `right`), `endCard` (`top`, `left`, `right`, `headlineSize`, `phone.scale`, `phone.center`) | overrides of the layout's geometry table for every film of that layout, in frame px (`endCard.phone` is the browser window's pose in `desktop`); a missing key keeps the table's value. Values must fit the frame and each box's margins must leave at least 200 px for its text. The frame, the screen box and the camera target are fixed |
167
211
  | `sfx` | `tap`, `key`, `whoosh`, `sparkle`, `pop` | sound effects; a missing one is silent |
168
212
  | `output` | `dir` (`marketing/out`), `buildDir` (`marketing/build`), `quality` (`standard`) | where films go; `--quality` wins |
@@ -190,6 +234,9 @@ default. Values must be hex literals (`#rgb`, `#rrggbb`, `#rrggbbaa`).
190
234
 
191
235
  ### From FIRE_TRACKER's constants
192
236
 
237
+ What MK-1 hard-coded and the key that holds it now. The table names the kind of value, not the value: a project's
238
+ look changes in its own `marketing.json`, without a change to the kit.
239
+
193
240
  | What MK-1 still had in code | Where it is now |
194
241
  | --- | --- |
195
242
  | `marketing.config.json` (`locale`, `brand.name`, `app`, `siteCss`, `posts.site`, `paths`) | `marketing.json`: `brand`, `app`, `brand.tokensFrom.css`, `social.linkTemplate`, `voice.cacheDir`, `output`, `sfx`, `brand.fonts` |
@@ -199,8 +246,8 @@ default. Values must be hex literals (`#rgb`, `#rrggbb`, `#rrggbbaa`).
199
246
  | hidden `nextjs-portal` and the mailing-list pill | `app.hideSelectors` |
200
247
  | the screen guard reading `main` | `app.screenGuardSelector` |
201
248
  | Geist and Newsreader files | `brand.fonts` |
202
- | the arc logo, `#059669` and the light caption pill | `brand.logo`, `brand.colors.captionHighlight`, `captionBackground` |
203
- | `--accessible` for the link pill and the avatar | `brand.colors.cta` (or `tokensFrom.roles.cta: "accessible"`) |
249
+ | the logo, the caption highlight colour and the light caption pill | `brand.logo`, `brand.colors.captionHighlight`, `captionBackground` |
250
+ | the token used for the link pill and the avatar | `brand.colors.cta` (or `tokensFrom.roles.cta: "<token>"`) |
204
251
  | FIRE's narrator voice, Polish | `voice.voiceId`, `voice.language: "pl"` (the cache keys of FIRE's paid recordings stay the same) |
205
252
  | `?z=` and three fixed platforms | `social.linkTemplate`, `social.platforms` |
206
253
  | five fixed sound file names | `sfx` |
@@ -328,6 +375,15 @@ format, so its paid recordings are reused as they are, with no re-keying and no
328
375
  `from the cache`; an estimate line means the text, voice or model differs from FIRE's, and nothing
329
376
  was spent.
330
377
 
378
+ ### Upgrading to 0.1.8
379
+
380
+ - Portrait social posts get their own templates: move a `headline-cta` entry with `size: [1080, 1350]` to
381
+ `big-number` (one figure as the hero) or to a `carousel` slide. `headline-cta` and `headline-chart` render as
382
+ before.
383
+ - A 0.1.7 `marketing.json`, its screenshots and the voiceover cache work as they are. New: `scrollTo`, `waitMs` and
384
+ `storageState` on `screenshots[]` entries, `shots --page` for any page, `--placeholder` on `all`/`record`/`render`
385
+ with `voice.placeholder`. An app that kept its own screenshot script for these can drop it.
386
+
331
387
  ### Upgrading to 0.1.7
332
388
 
333
389
  - A batch of voiceovers is one command: `voice a b c --commit` instead of a shell loop. Paid calls are spaced by
@@ -338,7 +394,8 @@ format, so its paid recordings are reused as they are, with no re-keying and no
338
394
  ## OG images
339
395
 
340
396
  `softure-marketing og` renders each `ogImages` entry with [Satori](https://github.com/vercel/satori)
341
- and resvg to `<output.dir>/og/<id>.png`, at `size` (1200×630 by default), outside Next. The brand
397
+ and resvg to `<output.dir>/og/<id>.png`, at `size` (1200×630 for the headline cards and 1080×1350 for the
398
+ portrait posts by default), outside Next. The brand
342
399
  supplies everything around the copy: the background and text colours, the logo and name in the top
343
400
  corner, and the fonts. `data` is the template's input, checked by its own schema (each template's
344
401
  fields are in the JSON Schema):
@@ -347,6 +404,15 @@ fields are in the JSON Schema):
347
404
  | --- | --- |
348
405
  | `headline-cta` | `headline` (≤ 90 characters), `eyebrow` (≤ 40), `cta` (≤ 32, a pill in `cta`/`onCta` colours), `tiles` (≤ 4 of `label` ≤ 24, `value` ≤ 16) |
349
406
  | `headline-chart` | `headline`, `eyebrow`, `tiles` (≤ 3), `chart`: `viewBox` `[width, height]` and `paths` (1-8) of `d` (SVG path data), `tone` (`accent`, `cta`, `foreground`, `muted`), `fill` (a tint instead of a line), `strokeWidth` (view box units) |
407
+ | `big-number` | `number` (≤ 12 characters, unit included, e.g. `898 PLN`; shorter numbers get bigger type), `caption` (≤ 90, the sentence under it), `eyebrow` (≤ 40), `tiles` (≤ 2), `cta` (≤ 32), `source` (≤ 80, small at the bottom) |
408
+ | `carousel` | `slides` (2-10) of `headline` (≤ 90), `eyebrow` (≤ 40), `body` (≤ 200), `tiles` (≤ 2), `cta` (≤ 32), `source` (≤ 80); `counter` (`true`: `n/N` in the top corner) |
409
+
410
+ **Social posts.** `big-number` and `carousel` are written for a 1080×1350 portrait post (their default `size`) and
411
+ scale by the limiting side, so `"square"` and `"story"` hold the same copy. The logo and name sit on top, the copy
412
+ fills the middle, the call to action and the source line are pinned to the bottom. A carousel entry writes one file
413
+ per slide, `<output.dir>/og/<id>-1.png`…`<id>-<n>.png`, with a shared look; an `ogImages` id that a slide's file
414
+ would also take is refused. The limits are what the post holds: copy at every limit stays inside the frame's margin
415
+ (a test renders it and checks the pixels), and a word too long for the line is broken rather than run past the edge.
350
416
 
351
417
  Values the app computes, such as a chart or a projected date, are computed by the app and arrive in
352
418
  `data` as numbers, text or SVG paths; the package only draws them.
@@ -395,14 +461,16 @@ export default async function Image(): Promise<Response> {
395
461
 
396
462
  `@resvg/resvg-js` is a native module: if the bundler tries to bundle it, list it in
397
463
  `serverExternalPackages` in `next.config.ts`. `renderOgImage({ template, data, size, brand, fonts })`
398
- renders without a `marketing.json` at all.
464
+ renders without a `marketing.json` at all. For a carousel, pass `slide` (1-based) to either function;
465
+ `countOgSlides(template, data)` says how many there are.
399
466
 
400
467
  ## Requirements
401
468
 
402
469
  - Node 22, **ffmpeg** in PATH.
403
470
  - A Chromium for the recording and the screenshots: Playwright's own, or `PLAYWRIGHT_CHROMIUM_PATH=<path>`.
404
- - A Chrome for hyperframes: downloaded on the first render (into `~/.cache/puppeteer`), or
405
- `HYPERFRAMES_BROWSER_PATH=<path>` (a Chromium headless shell works).
471
+ - A Chrome for hyperframes: downloaded on the first render (into `~/.cache/hyperframes/chrome`; an older
472
+ `~/.cache/puppeteer/chrome-headless-shell` is still used when it is there), or `HYPERFRAMES_BROWSER_PATH=<path>`
473
+ (a Chromium headless shell works).
406
474
  - The CLI runs hyperframes with `HYPERFRAMES_NO_TELEMETRY=1` unless you set it yourself.
407
475
 
408
476
  ## Licences
package/dist/cli/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { existsSync, mkdirSync, writeFileSync } from "node:fs";
3
- import { join } from "node:path";
3
+ import { join, resolve } from "node:path";
4
4
  import { findMissingFiles, formatConfigIssues, loadMarketingConfig } from "../config/config.js";
5
5
  import { getGeometry, getLayoutName } from "../compose/timeline.js";
6
6
  import { sceneBeats } from "../film.js";
@@ -10,18 +10,20 @@ import { recordFilm, ScreenGuardError } from "../record/record.js";
10
10
  import { findMachineProblem } from "../render/preflight.js";
11
11
  import { runHyperframes } from "../render/hyperframes.js";
12
12
  import { renderFilm } from "../render/render.js";
13
- import { takeScreenshots } from "../screenshot/screenshot.js";
13
+ import { takePageScreenshot, takeScreenshots } from "../screenshot/screenshot.js";
14
+ import { findStorageStateProblem } from "../screenshot/storage-state.js";
15
+ import { isPlaceholderKey } from "../voice/placeholder.js";
14
16
  import { splitIntoBeats } from "../voice/voiceover.js";
15
17
  import { CliFailure, fail } from "./failure.js";
16
18
  import { loadFilm } from "./films.js";
17
19
  import { writeOgImages } from "./og.js";
18
20
  import { getRecordingDay, readOptions } from "./options.js";
19
21
  import { ensureServer } from "./server.js";
20
- import { getVoiceoverPaths, produceVoiceover, produceVoiceovers, readJson, requireVoiceover } from "./voice.js";
22
+ import { getFilmVoiceover, produceVoiceover, produceVoiceovers, readJson } from "./voice.js";
21
23
  /**
22
24
  * `softure-marketing`: the only way into the films.
23
25
  *
24
- * all <film> voiceover from the cache -> recording -> render -> post copy
26
+ * all <film> [--placeholder] voiceover from the cache (or the free placeholder) -> recording -> render -> post copy
25
27
  * voice <film>... [--commit] voiceovers in order (paid only with --commit), spaced and stopped at the first error
26
28
  * record <film> [--today=YYYY-MM-DD] [--url=...] (--today overrides the video's today)
27
29
  * render <film> [--quality=draft|standard|high]
@@ -29,6 +31,7 @@ import { getVoiceoverPaths, produceVoiceover, produceVoiceovers, readJson, requi
29
31
  * posts <film>
30
32
  * og [image]
31
33
  * shots [<id>] [--url=...]
34
+ * shots --page=<url> --out=<file.png> --expect=<phrase> [...]
32
35
  */
33
36
  const getBuildDir = (config, film) => join(config.output.buildDir, film.id);
34
37
  const getOutDir = (config, film) => join(config.output.dir, film.id);
@@ -41,7 +44,9 @@ function preflight(config, film, needsRender) {
41
44
  fail(formatConfigIssues(config, missing));
42
45
  }
43
46
  async function record(config, film, options) {
44
- const voiceover = requireVoiceover(config, film);
47
+ const { voiceover, key, isPlaceholder } = getFilmVoiceover(config, film, { isPlaceholder: options.isPlaceholder, buildDir: getBuildDir(config, film) });
48
+ if (isPlaceholder)
49
+ console.log(`voiceover: the placeholder (a tone, ${config.voice.placeholder.wordsPerSecond} words a second); nothing paid, render it with --placeholder.`);
45
50
  const voices = splitIntoBeats(voiceover.words, film.beats, film.voice.tempo);
46
51
  const server = await ensureServer(config, film, options.url);
47
52
  mkdirSync(getBuildDir(config, film), { recursive: true });
@@ -54,7 +59,7 @@ async function record(config, film, options) {
54
59
  url: server.url,
55
60
  outDir: getBuildDir(config, film),
56
61
  voices,
57
- voiceoverKey: getVoiceoverPaths(config, film).key,
62
+ voiceoverKey: key,
58
63
  today: recordingDay.day ?? undefined,
59
64
  filmPath: film.scenePath,
60
65
  executablePath: process.env.PLAYWRIGHT_CHROMIUM_PATH || undefined,
@@ -100,14 +105,22 @@ function render(config, film, options) {
100
105
  fail(`no recording: run softure-marketing record ${film.id} first.`);
101
106
  // Our own file, written by `recordFilm`; the two fields that tie it to the script are checked below.
102
107
  const log = readJson(logPath);
103
- const voiceover = requireVoiceover(config, film);
108
+ // A recording follows the timings of the voiceover it was made on, so a placeholder recording never renders
109
+ // with the paid voiceover, nor the reverse.
110
+ if (isPlaceholderKey(log.voiceoverKey) !== options.isPlaceholder) {
111
+ if (options.isPlaceholder)
112
+ fail(`the recording was made on the paid voiceover: run softure-marketing record ${film.id} --placeholder, or render without --placeholder.`);
113
+ fail(`the recording was made on the placeholder voiceover: run softure-marketing record ${film.id} for the paid one, or render with --placeholder.`);
114
+ }
115
+ const { voiceover, key } = getFilmVoiceover(config, film, { isPlaceholder: options.isPlaceholder, buildDir: dir });
104
116
  // The recording must match the script; otherwise the action times belong to another voiceover or
105
117
  // other sentences, and the film would come out silently out of sync.
106
118
  const beatIds = sceneBeats(film).map((beat) => beat.id);
107
- if (log.voiceoverKey !== getVoiceoverPaths(config, film).key || log.beatIds?.join(",") !== beatIds.join(",")) {
108
- fail(`the recording does not match the current script (the sentences or the voiceover changed): run softure-marketing record ${film.id}.`);
119
+ if (log.voiceoverKey !== key || log.beatIds?.join(",") !== beatIds.join(",")) {
120
+ fail(`the recording does not match the current script (the sentences or the voiceover changed): run softure-marketing record ${film.id}${options.isPlaceholder ? " --placeholder" : ""}.`);
109
121
  }
110
- const output = join(getOutDir(config, film), `${film.id}.mp4`);
122
+ // A rehearsal never takes the place of the real film.
123
+ const output = join(getOutDir(config, film), options.isPlaceholder ? `${film.id}.placeholder.mp4` : `${film.id}.mp4`);
111
124
  const seconds = renderFilm({
112
125
  film,
113
126
  log,
@@ -144,8 +157,59 @@ function selectScreenshots(config, shotId) {
144
157
  fail(`no screenshots in ${config.file}: add entries to "screenshots".`);
145
158
  fail(`no screenshot "${shotId}" in ${config.file}; known: ${config.screenshots.map((entry) => entry.id).join(", ") || "none"}.`);
146
159
  }
160
+ /** The entries with their storage state as an absolute path, each checked before the browser starts. */
161
+ function resolveStorageStates(config, entries) {
162
+ const [first, ...rest] = entries.map((entry) => {
163
+ if (entry.storageState === undefined)
164
+ return entry;
165
+ const path = resolve(config.root, entry.storageState);
166
+ const problem = findStorageStateProblem(path);
167
+ if (problem !== null)
168
+ fail(`screenshot "${entry.id}": ${problem}.`);
169
+ return { ...entry, storageState: path };
170
+ });
171
+ // The map keeps the length of a non-empty tuple.
172
+ return [first, ...rest];
173
+ }
174
+ function getScreenshotBrowser(config) {
175
+ return { colorScheme: config.app.colorScheme, locale: config.brand.locale, timezone: config.brand.timezone, hideSelectors: config.app.hideSelectors };
176
+ }
177
+ /** Prints each result and fails when any shot was refused. */
178
+ function reportScreenshots(results) {
179
+ for (const result of results) {
180
+ if (result.ok)
181
+ console.log(`✓ ${result.file} (${(result.bytes / 1000).toFixed(0)} kB)`);
182
+ else
183
+ console.error(`✗ ${result.name}: ${result.message}`);
184
+ }
185
+ const failed = results.filter((result) => !result.ok).length;
186
+ if (failed > 0)
187
+ fail(`${failed} of ${results.length} screenshots failed their gates; see above.`);
188
+ }
189
+ /** `shots --page`: one page anywhere; the app is not started, and the storage state resolves from the current directory. */
190
+ async function pageShot(config, options) {
191
+ let { entry } = options;
192
+ if (entry.storageState !== undefined) {
193
+ const path = resolve(entry.storageState);
194
+ const problem = findStorageStateProblem(path);
195
+ if (problem !== null)
196
+ fail(`--auth: ${problem}.`);
197
+ entry = { ...entry, storageState: path };
198
+ }
199
+ const file = resolve(options.out);
200
+ console.log(`screenshot: ${options.page}.`);
201
+ const result = await takePageScreenshot({
202
+ entry,
203
+ url: options.page,
204
+ file,
205
+ scheme: options.scheme,
206
+ browser: getScreenshotBrowser(config),
207
+ executablePath: process.env.PLAYWRIGHT_CHROMIUM_PATH || undefined,
208
+ });
209
+ reportScreenshots([result]);
210
+ }
147
211
  async function shots(config, options) {
148
- const entries = selectScreenshots(config, options.shotId);
212
+ const entries = resolveStorageStates(config, selectScreenshots(config, options.shotId));
149
213
  const [first] = entries;
150
214
  const target = { url: new URL(first.path, config.app.baseUrl).href, ownUrl: `http://localhost:${config.app.port}${first.path}` };
151
215
  const server = await ensureServer(config, target, options.url === undefined ? undefined : new URL(first.path, options.url).href);
@@ -158,26 +222,13 @@ async function shots(config, options) {
158
222
  baseUrl: server.url,
159
223
  outDir,
160
224
  executablePath: process.env.PLAYWRIGHT_CHROMIUM_PATH || undefined,
161
- browser: {
162
- colorScheme: config.app.colorScheme,
163
- locale: config.brand.locale,
164
- timezone: config.brand.timezone,
165
- hideSelectors: config.app.hideSelectors,
166
- },
225
+ browser: getScreenshotBrowser(config),
167
226
  });
168
227
  }
169
228
  finally {
170
229
  server.stop();
171
230
  }
172
- for (const result of results) {
173
- if (result.ok)
174
- console.log(`✓ ${result.file} (${(result.bytes / 1000).toFixed(0)} kB)`);
175
- else
176
- console.error(`✗ ${result.name}: ${result.message}`);
177
- }
178
- const failed = results.filter((result) => !result.ok).length;
179
- if (failed > 0)
180
- fail(`${failed} of ${results.length} screenshots failed their gates; see above.`);
231
+ reportScreenshots(results);
181
232
  }
182
233
  async function main(argv) {
183
234
  const parsed = readOptions(argv);
@@ -193,7 +244,10 @@ async function main(argv) {
193
244
  return;
194
245
  }
195
246
  if (options.command === "shots") {
196
- await shots(config, options);
247
+ if (options.mode === "page")
248
+ await pageShot(config, options);
249
+ else
250
+ await shots(config, options);
197
251
  return;
198
252
  }
199
253
  if (options.command === "voice") {
@@ -227,8 +281,9 @@ async function main(argv) {
227
281
  }
228
282
  case "all": {
229
283
  preflight(config, film, true);
230
- if ((await produceVoiceover(config, film, false)) === null)
231
- fail("no voiceover; see the message above.");
284
+ if (!options.isPlaceholder && (await produceVoiceover(config, film, false)) === null) {
285
+ fail(`no voiceover; see the message above. To rehearse the film for free: softure-marketing all ${film.id} --placeholder.`);
286
+ }
232
287
  await record(config, film, options);
233
288
  render(config, film, options);
234
289
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,IAAI,E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EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YACpC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YAC9B,OAAO;QACT,CAAC;IACH,CAAC;AACH,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IACnD,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;QAChC,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC/E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/dist/cli/og.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  import type { MarketingConfig } from "../config/config.js";
2
- /** `og [image]`: writes `<output.dir>/og/<id>.png` for every `ogImages` entry, or for the one named. */
2
+ /**
3
+ * `og [image]`: writes `<output.dir>/og/<id>.png` for every `ogImages` entry, or for the one named; a carousel
4
+ * writes one file per slide, `<id>-1.png`…`<id>-<n>.png`.
5
+ */
3
6
  export declare function writeOgImages(config: MarketingConfig, imageId: string | null): Promise<void>;
4
7
  //# sourceMappingURL=og.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"og.d.ts","sourceRoot":"","sources":["../../src/cli/og.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAI3D,wGAAwG;AACxG,wBAAsB,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAelG"}
1
+ {"version":3,"file":"og.d.ts","sourceRoot":"","sources":["../../src/cli/og.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAK3D;;;GAGG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBlG"}
package/dist/cli/og.js CHANGED
@@ -1,8 +1,12 @@
1
1
  import { mkdirSync, writeFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
+ import { getOgImageNames } from "../config/og-image-names.js";
3
4
  import { renderConfiguredOgImage } from "../og/render.js";
4
5
  import { fail } from "./failure.js";
5
- /** `og [image]`: writes `<output.dir>/og/<id>.png` for every `ogImages` entry, or for the one named. */
6
+ /**
7
+ * `og [image]`: writes `<output.dir>/og/<id>.png` for every `ogImages` entry, or for the one named; a carousel
8
+ * writes one file per slide, `<id>-1.png`…`<id>-<n>.png`.
9
+ */
6
10
  export async function writeOgImages(config, imageId) {
7
11
  const entries = imageId === null ? config.ogImages : config.ogImages.filter((image) => image.id === imageId);
8
12
  if (config.ogImages.length === 0)
@@ -13,12 +17,16 @@ export async function writeOgImages(config, imageId) {
13
17
  const dir = join(config.output.dir, "og");
14
18
  mkdirSync(dir, { recursive: true });
15
19
  for (const entry of entries) {
16
- const png = await renderConfiguredOgImage({ config, id: entry.id });
17
- if (!png.ok)
18
- fail(png.error);
19
- const path = join(dir, `${entry.id}.png`);
20
- writeFileSync(path, png.value);
21
- console.log(`✓ ${path} (${entry.size[0]}×${entry.size[1]}, ${entry.template})`);
20
+ const names = getOgImageNames(entry);
21
+ for (const [index, name] of names.entries()) {
22
+ const png = await renderConfiguredOgImage({ config, id: entry.id, slide: index + 1 });
23
+ if (!png.ok)
24
+ fail(png.error);
25
+ const path = join(dir, `${name}.png`);
26
+ writeFileSync(path, png.value);
27
+ const slide = names.length > 1 ? `, slide ${String(index + 1)}/${String(names.length)}` : "";
28
+ console.log(`✓ ${path} (${String(entry.size[0])}×${String(entry.size[1])}, ${entry.template}${slide})`);
29
+ }
22
30
  }
23
31
  }
24
32
  //# sourceMappingURL=og.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"og.js","sourceRoot":"","sources":["../../src/cli/og.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,wGAAwG;AACxG,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAuB,EAAE,OAAsB;IACjF,MAAM,OAAO,GAAG,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;IAC7G,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,IAAI,CAAC,4CAA4C,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;IACnG,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,CAAC,OAAO,OAAO,IAAI,EAAE,oBAAoB,MAAM,CAAC,IAAI,YAAY,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9H,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,IAA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AM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7F,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,QAAQ,GAAG,KAAK,GAAG,CAAC,CAAC;QAC1G,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,4 +1,5 @@
1
- import { type Quality } from "../config/schema.js";
1
+ import { type ColorTheme } from "../config/colors.js";
2
+ import { type MarketingJson, type Quality } from "../config/schema.js";
2
3
  /**
3
4
  * `softure-marketing <command> <film> [flags]` (and `og [image]`, `shots [<id>]`): argument parsing, kept apart from
4
5
  * the commands so it is testable. A typo in a flag never passes silently: `--todya` would record the film from today
@@ -6,6 +7,11 @@ import { type Quality } from "../config/schema.js";
6
7
  */
7
8
  export declare const COMMANDS: readonly ["all", "voice", "record", "render", "preview", "posts", "og", "shots"];
8
9
  export type Command = (typeof COMMANDS)[number];
10
+ /** The viewport of an ad-hoc shot without --width/--height: a common laptop screen (FIRE's screenshot script). */
11
+ export declare const PAGE_SHOT_VIEWPORT: {
12
+ readonly width: 1440;
13
+ readonly height: 900;
14
+ };
9
15
  export interface FilmOptions {
10
16
  command: Exclude<Command, "og" | "shots">;
11
17
  /** The first film named; the only one for every command but `voice`. */
@@ -14,6 +20,8 @@ export interface FilmOptions {
14
20
  filmIds: string[];
15
21
  /** `voice` really pays for the voiceover only with `--commit`. */
16
22
  isCommit: boolean;
23
+ /** `--placeholder`: record and render on the free placeholder voiceover instead of the paid one. */
24
+ isPlaceholder: boolean;
17
25
  /** The day the app counts from; overrides the video's `today` for one run. */
18
26
  today?: string;
19
27
  /** Another address of the recorded page. */
@@ -30,14 +38,30 @@ export interface OgOptions {
30
38
  configPath: string;
31
39
  }
32
40
  /** `shots [<id>]`: every `screenshots` entry, or the one named. */
33
- export interface ShotsOptions {
41
+ export interface EntryShotsOptions {
34
42
  command: "shots";
43
+ mode: "entries";
35
44
  /** One `screenshots` entry; without it, every entry. */
36
45
  shotId?: string;
37
46
  /** Another address of the app; each entry's path resolves against it. */
38
47
  url?: string;
39
48
  configPath: string;
40
49
  }
50
+ /** `shots --page=<url> --out=<file> --expect=<phrase>`: one page anywhere, behind the same gates. */
51
+ export interface PageShotsOptions {
52
+ command: "shots";
53
+ mode: "page";
54
+ /** The page itself, not a base address. */
55
+ page: string;
56
+ /** The PNG to write, relative to the current directory. */
57
+ out: string;
58
+ /** The shot's settings in the shape of a `screenshots` entry (`id` "page", `path` "/"; `storageState` as given). */
59
+ entry: MarketingJson["screenshots"][number];
60
+ /** `--scheme`; without it, `app.colorScheme`. */
61
+ scheme?: ColorTheme;
62
+ configPath: string;
63
+ }
64
+ export type ShotsOptions = EntryShotsOptions | PageShotsOptions;
41
65
  export type CliOptions = FilmOptions | OgOptions | ShotsOptions;
42
66
  export type ReadOptionsResult = {
43
67
  ok: true;
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/cli/options.ts"],"names":[],"mappings":"AACA,OAAO,EAAkC,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnF;;;;GAIG;AAEH,eAAO,MAAM,QAAQ,kFAAmF,CAAC;AAEzG,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAOhD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC;IAC1C,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,kEAAkE;IAClE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