Skip to content

Commit 2daedcd

Browse files
feat(skills): style templates on the HyperFrames plan (#6842)
* fix(cli,skills): say a step's credits are its total, and keep cost out of retries An out-of-credits refusal named what the step needs, and an agent read that as the shortfall. It now says the number is the step's total. After its last try, an agent told the person what was spent and what another try would cost. The HeyGen reference now says not to. * fix(cli): plan avatar credits from the HyperFrames price rows An avatar's credits came from its old API price, about five times what the plan charges, so --max-credits refused calls that fit and a top-up asked for too much. They now use the Avatar IV photo row plus the general avatar video row, 950 credits a minute. * fix(cli): pin the avatar price test and keep pricing under the comment share * fix(cli): plan avatar seconds on the Avatar IV row alone The general avatar row is only checked at admission and billed on seconds left after Avatar IV, so adding it to every second made a 15 s script plan at 238 instead of 200 and a 220 limit refuse a call that fits. * feat(skills): creator templates on the HyperFrames plan A Pro account asks for a video in a creator's format and the agent pulls that template on demand. The packs sit in the private bucket behind the plan-gated bundle route, so a Free account gets a 402 and the upgrade step. A pull costs no credits; making the film spends them as Reverse does. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(skills): make creator-remix the one template skill SKILL.md holds the catalog, the Pro openings, the pull and the credit rules. references/remix.md is how to make the episode, from Desktop's creator-remix with only what the app alone has swapped for the CLI. The packs now hold only the template, so their hashes change. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(skills): the creator-remix skill and its packs SKILL.md holds the catalog, the Pro openings, the pull and the credit rules. references/remix.md is how to make the episode, from Desktop's creator-remix with only what the app alone has swapped for the CLI. The packs now hold only the template, so their hashes change. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(skills): word creator-remix's sign-in steps the way media-use does Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(skills): a creator-remix presenter runs on the plan by default The person's own HeyGen avatar is recommended, not required: without one, 小Lin's presenter is made with HeyGen Video 1 from their photo. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(cli): pin template packs whose voice bills the plan first Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(cli): offload media named inside template tags References in a composition's <template> were never rewritten, because the DOM query stops at the tag and template.content does not serialize, so the file stayed in the zip. A stem matched as a plain word and a same-named file elsewhere counted as a mention too. A 5-minute presented film went from 196 MB to 71 MB. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(cli): lipsync, and avatars that speak a finished voice Video 1 takes audio as a reference and re-paces it, so a shot's lips follow its own track and drift up to a second from the voice. generate --type lipsync redoes the mouth to the exact voice. generate --type avatar takes --audio, and --avatar for the person's own look, so the lips land on the voice from one job. Also moves the plan rows to the 2026-10-30 price book, estimates a voice's credits so --max-credits can hold it, logs jobs from a folder with no project, and describes the resolve flags. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(skills): presenters go avatar first, and a voice can be stock The person's own avatar, then Avatar IV from their photo, then Video 1 with lipsync. With no clone or recording, a stock voice named in the credits. Pins the five rebuilt packs. The archive test keeps its ../ under GNU tar with -P. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(cli): fix avatar price and sfx provider tests, trim comments A wav gives the avatar price test an exact length on every platform. The sfx tests now expect HeyGen first. Comment share is back under the base. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(core): read a font shorthand whose size nests parentheses `font: calc(var(--size) * 1px)/1 "X"` cut at the first closing parenthesis, so a bad family name failed the render. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(cli): one ledger row per job, and search skips a template's own pictures A job done at once logs one row, transcribe logs to the project, and resolve no longer offers a component's file for a search. --reuse and --provider get help text. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(skills): pin the tested template packs, and a board needs no voice Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(cli): read the transcribe ledger row as JSON, for Windows paths Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(cli): pin the Big Questions pack without the film length check Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(skills): call them style templates, and the docs example pulls a real slug Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(cli): pin the cleaned template packs Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(skills): drop the stock-presenter ban and the no-spend-before-storyboard rule Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(cli): pin the Paper Trail and Long Story Short packs without the stock-presenter ban Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(skills): rename creator-remix to style-remix, and the five templates to names that say the look Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(skills): style-remix lists the five templates when none is named Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(cli): pin the Finance Explainer pack that varies its motion graphics Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(cli): media-use generate --type cutout takes a shot out of its background on the plan Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(cli): pin the Finance Explainer pack without the provisional variety rule Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(cli): pin the five style packs with variety rules measured on real films Animated Science gets a worlds-and-boards budget, 3D True Crime a main board and a brief corner note, 3D Brand caps by measured rate, Finance and Collage set pieces and more than one look. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(skills): media-use names the on-plan cutout and lipsync commands, not the heygen CLI ones Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(cli): cutout retries dedupe on request_id, uploads carry their real type; style-remix is public The background-removal route dedupes on the body's request_id and ignores the Idempotency-Key header, so a retry after a lost answer started a second job: runJob now also sends the key in the body for such a route. Uploads typed every non-MP4 file as audio, so WebM and MOV inputs were refused: they now take their type from the extension. Fails without the fix: the new cutout test in generate.test.ts sees audio/mpeg for WebM and MOV. style-remix drops metadata.internal and is listed with the other published skills. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(cli): keep the comment share of the touched files at main's Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: count style-remix in the README and CLAUDE.md skill lists Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(skills): rename style-remix to style-sampling Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 3f42dc1 commit 2daedcd

44 files changed

Lines changed: 1101 additions & 119 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.prettierignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,4 @@ skills/figma/SKILL.md
5757
skills/slideshow/SKILL.md
5858
skills/remotion-to-hyperframes/SKILL.md
5959
skills/reverse-any-video/SKILL.md
60+
skills/style-sampling/SKILL.md

‎AGENTS.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This repo ships AI agent skills via [vercel-labs/skills](https://github.com/verc
88

99
```bash
1010
npx hyperframes skills update # default: installs/refreshes the core set plus anything already installed
11-
npx hyperframes skills # all 8 published skills at once
11+
npx hyperframes skills # all 9 published skills at once
1212
npx skills add heygen-com/hyperframes # interactive picker (terminal only; repo-internal skills are excluded by default)
1313
```
1414

@@ -22,6 +22,7 @@ Make any video by asking for it; the `/hyperframes` skill carries the contract a
2222
- `/slideshow` — a presentation, pitch deck or interactive deck. Output is a navigable deck, not a rendered MP4.
2323
- `/remotion-to-hyperframes` — bring existing video code or footage into HyperFrames (Remotion first; also Motion Canvas, Lottie, Three.js, canvas, or renders from other tools) and verify it frame by frame against the original.
2424
- `/reverse-any-video` — rebuild any video file as an editable HyperFrames project (motion graphics, talking heads, live action or AI-generated footage) and check the render against the original frame by frame. A HyperFrames Pro feature.
25+
- `/style-sampling` — make a new episode on your topic in one of five proven styles (Collage Explainer, Finance Explainer, Animated Science Explainer, 3D Brand Explainer, 3D True Crime). A HyperFrames Pro feature.
2526

2627
## Issue and PR triage
2728

‎CLAUDE.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Open-source video rendering framework: write HTML, render video.
44

55
## Skills
66

7-
This repo ships 8 AI agent skills via [vercel-labs/skills](https://github.com/vercel-labs/skills). Install them before writing compositions — they encode framework-specific patterns that generic docs don't cover. **Default to the core set** (`/hyperframes`, `/hyperframes-cli`, `/hyperframes-registry`, `/media-use`); `/slideshow`, `/remotion-to-hyperframes`, `/reverse-any-video` and `/figma` install on demand. Install all 8 only when the user explicitly asks for the full set.
7+
This repo ships 9 AI agent skills via [vercel-labs/skills](https://github.com/vercel-labs/skills). Install them before writing compositions — they encode framework-specific patterns that generic docs don't cover. **Default to the core set** (`/hyperframes`, `/hyperframes-cli`, `/hyperframes-registry`, `/media-use`); `/slideshow`, `/remotion-to-hyperframes`, `/reverse-any-video`, `/style-sampling` and `/figma` install on demand. Install all 9 only when the user explicitly asks for the full set.
88

99
```bash
1010
npx hyperframes skills update # default: installs/refreshes the core set plus anything already installed
11-
npx hyperframes skills # all 8 published skills at once — only on explicit request
11+
npx hyperframes skills # all 9 published skills at once — only on explicit request
1212
npx skills add heygen-com/hyperframes # interactive picker; internal skills require INSTALL_INTERNAL_SKILLS=1 for discovery
1313
npx skills add heygen-com/hyperframes --all # excludes internal skills unless INSTALL_INTERNAL_SKILLS=1
1414
npx skills add heygen-com/hyperframes --skill <name> # a named match installs regardless of metadata.internal (bare name, no leading slash)
@@ -28,6 +28,7 @@ Make any video by asking for it; the `/hyperframes` skill carries the render con
2828
- `/slideshow` — a presentation, pitch deck or interactive deck with discrete slides, fragment reveals, branching, hotspot navigation and presenter mode with speaker notes; also converts an existing page into a deck. Output is a navigable deck, not a rendered MP4.
2929
- `/remotion-to-hyperframes` — bring existing video code or footage into HyperFrames (Remotion first; also Motion Canvas, Lottie, Three.js, canvas, or renders from other tools) and verify it frame by frame against the original.
3030
- `/reverse-any-video` — rebuild any video file as an editable HyperFrames project (motion graphics, talking heads, live action or AI-generated footage) and check the render against the original frame by frame. A HyperFrames Pro feature.
31+
- `/style-sampling` — make a new episode on your topic in one of five proven styles (Collage Explainer, Finance Explainer, Animated Science Explainer, 3D Brand Explainer, 3D True Crime). A HyperFrames Pro feature.
3132

3233
## Skill catalog maintenance
3334

‎README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ For standalone skills (including OpenCode), use:
6464
npx skills add heygen-com/hyperframes
6565
```
6666

67-
> The picker opens with nothing pre-selected — the **Core Skills** group is all you need; `/slideshow`, `/remotion-to-hyperframes`, `/reverse-any-video` and `/figma` install on demand. Agents and non-interactive runs should use `npx hyperframes skills update` instead — it installs exactly the core set, whereas `skills add --all` installs all 8 published skills. The six repo-internal skills under `.claude/skills` / `.agents/skills` are excluded by default. For the full published set use `npx hyperframes skills`.
67+
> The picker opens with nothing pre-selected — the **Core Skills** group is all you need; `/slideshow`, `/remotion-to-hyperframes`, `/reverse-any-video`, `/style-sampling` and `/figma` install on demand. Agents and non-interactive runs should use `npx hyperframes skills update` instead — it installs exactly the core set, whereas `skills add --all` installs all 9 published skills. The six repo-internal skills under `.claude/skills` / `.agents/skills` are excluded by default. For the full published set use `npx hyperframes skills`.
6868
>
6969
> `skills add` resolves the skills.sh registry blob, which can lag `main` by hours. `npx hyperframes skills update` installs from the current `main`, so reach for it when you need the newest copy of a skill.
7070
@@ -81,9 +81,9 @@ The skills teach agents the HyperFrames production loop: plan the video, write v
8181

8282
## Skills
8383

84-
HyperFrames ships 8 skills. Make any video by asking for it; the `/hyperframes` skill carries the contract and the references (film, captions, overlays, motion, look). Read it first.
84+
HyperFrames ships 9 skills. Make any video by asking for it; the `/hyperframes` skill carries the contract and the references (film, captions, overlays, motion, look). Read it first.
8585

86-
For standalone installation, default to the **core set** (`/hyperframes`, `/hyperframes-cli`, `/hyperframes-registry`, `/media-use`). `npx hyperframes skills update` installs exactly that from anywhere; the interactive picker (`npx skills add heygen-com/hyperframes`) lists it as the "Core Skills" group, nothing pre-selected. The picker is interactive-only — a non-interactive or agent run without `--skill` installs all 8. Use `npx skills add heygen-com/hyperframes --all` to install the complete published set deliberately (skips the picker), or `npx skills add heygen-com/hyperframes --skill <name>` for just one (bare name, no leading `/`).
86+
For standalone installation, default to the **core set** (`/hyperframes`, `/hyperframes-cli`, `/hyperframes-registry`, `/media-use`). `npx hyperframes skills update` installs exactly that from anywhere; the interactive picker (`npx skills add heygen-com/hyperframes`) lists it as the "Core Skills" group, nothing pre-selected. The picker is interactive-only — a non-interactive or agent run without `--skill` installs all 9. Use `npx skills add heygen-com/hyperframes --all` to install the complete published set deliberately (skips the picker), or `npx skills add heygen-com/hyperframes --skill <name>` for just one (bare name, no leading `/`).
8787

8888
Standalone installs stay lean after that: `npx hyperframes init` installs the **core set** only when it is missing and never touches a skill you already have (`npx hyperframes skills update` refreshes them, and never removes one); `/figma`, `/slideshow`, `/remotion-to-hyperframes` and `/reverse-any-video` install **on demand** with `npx hyperframes skills update <name>`. Nothing re-pulls the full set behind your back.
8989

@@ -120,6 +120,7 @@ This writes `dist/hyperframes-plugin.zip` with a `hyperframes/` root folder and
120120
| `/slideshow` | A presentation, pitch deck or interactive deck — discrete slides, fragment reveals, branching, hotspot navigation, presenter mode with speaker notes. Output is a navigable deck, not a rendered MP4. |
121121
| `/remotion-to-hyperframes` | Bringing existing video code or footage into HyperFrames (Remotion first; also Motion Canvas, Lottie, Three.js, canvas, other tools' renders), verified frame by frame. |
122122
| `/reverse-any-video` | Rebuilding any video file as an editable HyperFrames project (motion graphics, talking heads, live action, AI-generated footage), checked frame by frame against the original. HyperFrames Pro. |
123+
| `/style-sampling` | Making a new episode on your topic in one of five proven styles: Collage Explainer, Finance Explainer, Animated Science Explainer, 3D Brand Explainer, 3D True Crime. HyperFrames Pro. |
123124

124125
For visual design handoff workflows, see the [Claude Design guide](https://hyperframes.heygen.com/guides/claude-design) and [Open Design guide](https://hyperframes.heygen.com/guides/open-design).
125126

‎docs/guides/skills.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ Make any video by asking for it; the `/hyperframes` skill carries the contract a
126126
| `/slideshow` | A presentation, pitch deck or interactive deck. Output is a navigable deck, not a rendered MP4. |
127127
| `/remotion-to-hyperframes` | Bringing existing video code or footage into HyperFrames (Remotion first; also Motion Canvas, Lottie, Three.js, canvas, other tools' renders), verified frame by frame. |
128128
| `/reverse-any-video` | Rebuilding any video file as an editable HyperFrames project (motion graphics, talking heads, live action, AI-generated footage), checked frame by frame against the original. HyperFrames Pro. |
129+
| `/style-sampling` | Making a new episode on your topic in one of five proven styles: Collage Explainer, Finance Explainer, Animated Science Explainer, 3D Brand Explainer, 3D True Crime. HyperFrames Pro. |
129130

130131
You can name a skill directly, but you do not need to memorize the names to start.
131132

‎docs/packages/cli.mdx‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ npm install -g hyperframes
3333
| Make a file | [`render`](#render), [`benchmark`](#benchmark) |
3434
| Render somewhere else | [`cloud`](#hyperframes-cloud), [`lambda`](#hyperframes-lambda), [`cloudrun`](#hyperframes-cloudrun) |
3535
| Fix your setup | [`doctor`](#doctor), [`browser`](#browser), [`upgrade`](#upgrade), [`docs`](#docs), [`info`](#info-and-compositions), [`compositions`](#info-and-compositions), [`clean`](#clean) |
36-
| Connect other tools | [`auth`](#hyperframes-auth), [`billing`](#billing), [`skills`](#skills), [`usage`](#usage), [`figma`](#figma-and-events), [`events`](#figma-and-events), [`telemetry`](#telemetry), [`feedback`](#feedback) |
36+
| Connect other tools | [`auth`](#hyperframes-auth), [`billing`](#billing), [`templates`](#templates), [`skills`](#skills), [`usage`](#usage), [`figma`](#figma-and-events), [`events`](#figma-and-events), [`telemetry`](#telemetry), [`feedback`](#feedback) |
3737

3838
`validate`, `inspect`, and `layout` still work but are
3939
[deprecated](#deprecated-validate-inspect-and-layout). Use `check` instead.
@@ -2288,6 +2288,20 @@ npx hyperframes billing top-up --needed 180
22882288
| `--tool` | The step that is waiting, shown on the page |
22892289
| `--timeout` | Seconds to wait (default 600) |
22902290

2291+
### `templates`
2292+
2293+
Pulls a style template into the project's `templates/<slug>/`, for a HyperFrames
2294+
Pro account: `collage-explainer`, `finance-explainer`, `animated-science-explainer`,
2295+
`3d-brand-explainer` or `3d-true-crime`. A pull costs no credits, and a template already there is left alone.
2296+
2297+
```bash
2298+
npx hyperframes templates pull collage-explainer
2299+
```
2300+
2301+
| Flag | Description |
2302+
| ------- | ----------------------------------------------- |
2303+
| `--dir` | Project folder (default: the current folder) |
2304+
22912305
### `figma` and `events`
22922306

22932307
`npx hyperframes figma` imports through the Figma REST API, with three

‎packages/cli/src/api/transcribe.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ async function transcribeOnHeygen(
423423
try {
424424
const result = await transcribeWithHeygen(inputPath, join(dir, TRANSCRIPT_FILE), {
425425
diarize: options.speakers,
426-
projectDir: dir,
427426
onStatus: options.onStatus,
428427
});
429428
return finishTranscript(result, "heygen", dir, sidecar);

‎packages/cli/src/cli.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ const commandLoaders = {
180180
measure: () => import("./commands/measure.js").then((m) => m.default),
181181
reverse: () => import("./commands/reverse.js").then((m) => m.default),
182182
billing: () => import("./commands/billing.js").then((m) => m.default),
183+
templates: () => import("./commands/templates.js").then((m) => m.default),
183184
capture: () => import("./commands/capture.js").then((m) => m.default),
184185
lambda: () => import("./commands/lambda.js").then((m) => m.default),
185186
cloudrun: () => import("./commands/cloudrun.js").then((m) => m.default),

‎packages/cli/src/cloud/offload.test.ts‎

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,106 @@ describe("offloadHeavyMedia", () => {
894894
expect(fileMap.has("media/clip.mp4")).toBe(true);
895895
});
896896

897+
it("offloads a heavy file only a composition's <template> plays", async () => {
898+
const dir = project({
899+
"index.html": html(`<div data-composition-src="compositions/a.html"></div>`),
900+
"compositions/a.html":
901+
`<template id="a"><div data-composition-id="a">` +
902+
`<video class="clip" src="media/clip.mp4" data-start="0" data-duration="2"></video>` +
903+
`</div></template>`,
904+
"media/clip.mp4": HEAVY,
905+
});
906+
const fileMap = buildPublishFileMap(dir);
907+
908+
const [item] = await offloadHeavyMedia(dir, fileMap, {
909+
apiBaseUrl: "https://api.example",
910+
upload: fakeUpload(),
911+
cachePath: cachePath(),
912+
});
913+
914+
const composition = String(fileMap.get("compositions/a.html"));
915+
expect(composition.startsWith(`<template id="a">`)).toBe(true);
916+
expect(composition).toContain(`src="${item?.url}"`);
917+
expect(fileMap.has("media/clip.mp4")).toBe(false);
918+
});
919+
920+
it("keeps a heavy file a script inside a <template> builds from split strings", async () => {
921+
const dir = project({
922+
"index.html": html(
923+
`<video id="v" src="media/clip.mp4"></video>` +
924+
`<template><script>v.src = "media/" + "clip" + ".mp4";</script></template>`,
925+
),
926+
"media/clip.mp4": HEAVY,
927+
});
928+
const fileMap = buildPublishFileMap(dir);
929+
930+
await offloadHeavyMedia(dir, fileMap, {
931+
apiBaseUrl: "https://api.example",
932+
upload: fakeUpload(),
933+
cachePath: cachePath(),
934+
});
935+
936+
expect(fileMap.has("media/clip.mp4")).toBe(true);
937+
});
938+
939+
it("drops an offloaded file whose stem is only a word in script code", async () => {
940+
const dir = project({
941+
"index.html": html(
942+
`<video id="v" src="media/host.mp4"></video>` +
943+
`<script>const host = "video/mp4"; const hosted = host.wave;</script>`,
944+
),
945+
"media/host.mp4": HEAVY,
946+
});
947+
const fileMap = buildPublishFileMap(dir);
948+
949+
const [item] = await offloadHeavyMedia(dir, fileMap, {
950+
apiBaseUrl: "https://api.example",
951+
upload: fakeUpload(),
952+
cachePath: cachePath(),
953+
});
954+
955+
expect(item?.kept_in_archive).toBeUndefined();
956+
expect(fileMap.has("media/host.mp4")).toBe(false);
957+
});
958+
959+
it("drops an offloaded file when only another folder's file shares its name", async () => {
960+
const dir = project({
961+
"index.html": html(
962+
`<video id="v" src="media/host.mp4"></video>` +
963+
`<video id="w" src="media/outro/host.mp4"></video>`,
964+
),
965+
"media/host.mp4": HEAVY,
966+
"media/outro/host.mp4": Buffer.alloc(16, 2),
967+
});
968+
const fileMap = buildPublishFileMap(dir);
969+
970+
await offloadHeavyMedia(dir, fileMap, {
971+
apiBaseUrl: "https://api.example",
972+
upload: fakeUpload(),
973+
cachePath: cachePath(),
974+
});
975+
976+
expect(fileMap.has("media/host.mp4")).toBe(false);
977+
expect(fileMap.has("media/outro/host.mp4")).toBe(true);
978+
});
979+
980+
it("keeps a zip copy of an offloaded file another file names by a relative path", async () => {
981+
const dir = project({
982+
"index.html": html(`<video id="v" src="media/clip.mp4"></video>`),
983+
"notes.txt": "see ../media/clip.mp4",
984+
"media/clip.mp4": HEAVY,
985+
});
986+
const fileMap = buildPublishFileMap(dir);
987+
988+
await offloadHeavyMedia(dir, fileMap, {
989+
apiBaseUrl: "https://api.example",
990+
upload: fakeUpload(),
991+
cachePath: cachePath(),
992+
});
993+
994+
expect(fileMap.has("media/clip.mp4")).toBe(true);
995+
});
996+
897997
it("prepares an entry GIF staged on disk from a checked private copy", async () => {
898998
const files = {
899999
"index.html": html(`<img src="media/loop.gif" />`),

0 commit comments

Comments
 (0)