Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .fallowrc.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"packages/cli/src/warmCheckClient.fixture.ts",
"packages/cli/src/browser/chromeOrphans.fixture.ts",
"packages/cli/src/capture/publicNetwork.fixture.ts",
"packages/cli/src/registry/envProxy.fixture.ts",
"packages/cli/src/utils/commandResult.fixture.ts",
"packages/studio-server/src/routes/recoveryDrafts.fixture.ts",
// Test fixture worker, spawned by path via the pools' workerEntryPath
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<a href="https://www.npmjs.com/package/hyperframes"><img src="https://img.shields.io/npm/v/hyperframes.svg?style=flat" alt="npm version"></a>
<a href="https://www.npmjs.com/package/hyperframes"><img src="https://img.shields.io/npm/dm/hyperframes.svg?style=flat" alt="npm downloads"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License"></a>
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D22-brightgreen" alt="Node.js"></a>
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D22.19-brightgreen" alt="Node.js"></a>
<a href="https://discord.gg/fzbdWyjphr"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
</p>

Expand Down Expand Up @@ -113,7 +113,7 @@ npx hyperframes preview # live preview in the browser
npx hyperframes render # render to MP4
```

Requirements: Node.js 22+ and FFmpeg. Render in the cloud with `hyperframes cloud render`, or on your own [AWS Lambda](https://hyperframes.heygen.com/deploy/aws-lambda?utm_source=github&utm_medium=readme).
Requirements: Node.js 22.19+ and FFmpeg. Render in the cloud with `hyperframes cloud render`, or on your own [AWS Lambda](https://hyperframes.heygen.com/deploy/aws-lambda?utm_source=github&utm_medium=readme).

<details>
<summary>Skill install options, updates and the core set (full details)</summary>
Expand Down
8 changes: 5 additions & 3 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/guides/claude-design-hyperframes.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ A HyperFrames video composition. Plain HTML + GSAP; rendered to MP4 by the `hype

## Requirements

- **Node.js 22+** -- [nodejs.org](https://nodejs.org/)
- **Node.js 22.19+** -- [nodejs.org](https://nodejs.org/)
- **FFmpeg** -- `brew install ffmpeg` (macOS) or `sudo apt install ffmpeg` (Debian/Ubuntu) or [ffmpeg.org/download](https://ffmpeg.org/download.html) (Windows)

Verify: `npx hyperframes doctor`
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ and other agents for you, with the HyperFrames skills built in.
| Codex | Use your existing HyperFrames plugin; directory updates are published separately |
| OpenCode | Use standalone skills |

You need Node.js 22+ and npm for the local CLI, plus FFmpeg for rendering.
You need Node.js 22.19+ and npm for the local CLI, plus FFmpeg for rendering.
Install on each machine you use; a plugin does not synchronize your machines.

## Claude Code
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/with-claude-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ claude plugin install hyperframes@hyperframes

- [Claude Code](https://code.claude.com/docs), signed in with your Claude account
or an Anthropic Console account. Its usage bills to that account.
- Node.js 22 or newer, and npm.
- Node.js 22.19 or newer, and npm.
- FFmpeg, for rendering MP4 files. Run `npx hyperframes doctor` to check.

## Install
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/with-codex.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This installs the core skills into your user's shared skills folder,

- [Codex](https://developers.openai.com/codex), signed in with your ChatGPT
account or an OpenAI API key. Its usage bills to that account.
- Node.js 22 or newer, and npm.
- Node.js 22.19 or newer, and npm.
- FFmpeg, for rendering MP4 files. Run `npx hyperframes doctor` to check.

## Install
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/with-cursor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and **Cursor** in the picker.
## Before you start

- [Cursor](https://cursor.com), signed in. Agent usage bills to your Cursor plan.
- Node.js 22 or newer, and npm.
- Node.js 22.19 or newer, and npm.
- FFmpeg, for rendering MP4 files. Run `npx hyperframes doctor` to check.

## Install
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@
}
},
"engines": {
"node": ">=22"
"node": ">=22.19.0"
}
}
2 changes: 1 addition & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Or use directly with npx:
npx hyperframes <command>
```

**Requirements:** Node.js >= 22, FFmpeg
**Requirements:** Node.js >= 22.19, FFmpeg

## Commands

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"open": "^10.0.0",
"postcss": "^8.5.8",
"puppeteer-core": "^25.10.0",
"undici": "7.30.1",
"undici": "8.13.0",
"yauzl": "^3.4.0"
},
"devDependencies": {
Expand Down Expand Up @@ -106,6 +106,6 @@
"sharp": "^0.35.5"
},
"engines": {
"node": ">=22"
"node": ">=22.19.0"
}
}
1 change: 1 addition & 0 deletions packages/cli/src/backgroundChecksWorker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "./utils/hideChildConsoles.js";
import "./utils/envProxyFetch.js";
import "./utils/windowsExeSearch.js";
import { checkForUpdate } from "./utils/updateCheck.js";
import { refreshSkillsCache } from "./utils/skillsUpdateCheck.js";
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ for (const stream of [process.stdout, process.stderr]) {
// We emit the worker entry next to cli.js (see tsup.config.ts) and tell
// the pool where to find it via the published env-var override.
import "./utils/hideChildConsoles.js";
import "./utils/envProxyFetch.js";
import "./utils/windowsExeSearch.js";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/fontLocalizeCli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "./utils/hideChildConsoles.js";
import "./utils/envProxyFetch.js";
import "./utils/windowsExeSearch.js";
import { injectDeterministicFontFaces } from "@hyperframes/producer";
import { runFontLocalize, stampFontVersions } from "./fontLocalize.js";
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/hangReport.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "./utils/hideChildConsoles.js";
import "./utils/envProxyFetch.js";
import "./utils/windowsExeSearch.js";
import { writeFileSync } from "node:fs";
import { isAbsolute, join } from "node:path";
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/src/registry/envProxy.fixture.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import "../utils/envProxyFetch.js";
import { readRegistryManifest } from "./remote.js";

const started = Date.now();
await readRegistryManifest("https://registry.proxy-fixture.com/registry", { skipCache: true }).then(
() => process.stdout.write("read\n"),
() => process.stdout.write(`failed after ${Date.now() - started} ms\n`),
);
50 changes: 50 additions & 0 deletions packages/cli/src/registry/envProxy.process.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { spawn } from "node:child_process";
import { mkdtempSync, rmSync } from "node:fs";
import { createServer } from "node:http";
import type { AddressInfo } from "node:net";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { expect, it, onTestFinished } from "vitest";

const fixture = join(dirname(fileURLToPath(import.meta.url)), "envProxy.fixture.ts");

// fails without the fix: Node's own env proxy reconnects with no pause when the proxy drops the tunnel, so one
// registry read opened thousands of connections a second and the process outlived its own error.
it("a registry read through an env proxy that drops the tunnel fails once and the process ends", async () => {
let tunnels = 0;
const proxy = createServer((_, res) => res.writeHead(502).end());
proxy.on("connect", (_, client) => {
tunnels++;
client.destroy();
});
await new Promise<void>((resolve) => proxy.listen(0, "127.0.0.1", resolve));
onTestFinished(() => void proxy.close());
const url = `http://127.0.0.1:${(proxy.address() as AddressInfo).port}`;
const home = mkdtempSync(join(tmpdir(), "hf-env-proxy-"));
onTestFinished(() => rmSync(home, { recursive: true, force: true }));
const child = spawn(process.execPath, ["--import", "tsx", fixture], {
env: {
...process.env,
HOME: home,
HYPERFRAMES_CACHE_DIR: home,
HTTPS_PROXY: url,
HTTP_PROXY: url,
NO_PROXY: "",
NODE_USE_ENV_PROXY: "1",
},
stdio: ["ignore", "pipe", "inherit"],
});
onTestFinished(() => void child.kill("SIGKILL"));
setTimeout(() => child.kill("SIGKILL"), 8_000).unref();
let printed = "";
child.stdout.setEncoding("utf8");
child.stdout.on("data", (chunk: string) => (printed += chunk));
const ended = await new Promise((resolve) =>
child.once("exit", (code, signal) => resolve(code ?? signal)),
);
expect(printed).toMatch(/^failed after \d+ ms/);
expect(Number(printed.match(/\d+/)?.[0])).toBeLessThan(2_000);
expect(ended).toBe(0);
expect(tunnels).toBeLessThanOrEqual(2);
}, 30_000);
1 change: 1 addition & 0 deletions packages/cli/src/renderSetupWorker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "./utils/hideChildConsoles.js";
import "./utils/envProxyFetch.js";
import "./utils/windowsExeSearch.js";
import { readFile, rm } from "node:fs/promises";
import { constants, setPriority } from "node:os";
Expand Down
13 changes: 10 additions & 3 deletions packages/cli/src/runtimeVersion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,24 @@ import { runtimeVersionError, runtimeVersionJson } from "./runtimeVersion.js";
describe("runtimeVersionError", () => {
it("rejects Node 20 before the bundled CLI is imported", () => {
expect(runtimeVersionError("20.11.1")).toBe(
"HyperFrames requires Node.js >= 22 (current: 20.11.1). Switch Node versions and retry.",
"HyperFrames requires Node.js >= 22.19 (current: 20.11.1). Switch Node versions and retry.",
);
});

it("accepts supported Node releases", () => {
expect(runtimeVersionError("22.0.0")).toBeNull();
expect(runtimeVersionError("22.19.0")).toBeNull();
expect(runtimeVersionError("23.0.0")).toBeNull();
expect(runtimeVersionError("24.14.0")).toBeNull();
});

it("rejects a Node 22 older than 22.19, which undici 8 needs", () => {
expect(runtimeVersionError("22.18.0")).toContain(
"requires Node.js >= 22.19 (current: 22.18.0)",
);
});

it("rejects malformed versions safely", () => {
expect(runtimeVersionError("unknown")).toContain("requires Node.js >= 22");
expect(runtimeVersionError("unknown")).toContain("requires Node.js >= 22.19");
});
});

Expand Down
9 changes: 5 additions & 4 deletions packages/cli/src/runtimeVersion.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const MINIMUM_NODE_MAJOR = 22;
const MINIMUM_NODE_FOR_UNDICI_8 = { major: 22, minor: 19 };

export function runtimeVersionError(version: string): string | null {
const major = Number.parseInt(version.split(".", 1)[0] ?? "", 10);
if (Number.isFinite(major) && major >= MINIMUM_NODE_MAJOR) return null;
return `HyperFrames requires Node.js >= ${MINIMUM_NODE_MAJOR} (current: ${version}). Switch Node versions and retry.`;
const [major = Number.NaN, minor = Number.NaN] = version.split(".").map(Number);
const { major: needMajor, minor: needMinor } = MINIMUM_NODE_FOR_UNDICI_8;
if (major > needMajor || (major === needMajor && minor >= needMinor)) return null;
return `HyperFrames requires Node.js >= ${needMajor}.${needMinor} (current: ${version}). Switch Node versions and retry.`;
}

export function runtimeVersionJson(message: string, argv: readonly string[]): string | null {
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/src/utils/envProxyFetch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { envProxyEnabled } from "@hyperframes/core/env-proxy";

if (envProxyEnabled()) {
const { EnvHttpProxyAgent, setGlobalDispatcher } = await import("undici/index.js");
setGlobalDispatcher(new EnvHttpProxyAgent());
}
1 change: 1 addition & 0 deletions packages/cli/src/warmCheck.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "./utils/hideChildConsoles.js";
import "./utils/envProxyFetch.js";
import "./utils/windowsExeSearch.js";
import { randomBytes } from "node:crypto";
import { unlinkSync } from "node:fs";
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/warmCheckClient.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "./utils/hideChildConsoles.js";
import "./utils/envProxyFetch.js";
import "./utils/windowsExeSearch.js";
import { spawn } from "node:child_process";
import { randomBytes } from "node:crypto";
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Framework-agnostic: works with GSAP, Lottie, Three.js, CSS animations, or any we
npm install @hyperframes/engine
```

**Requirements:** Node.js >= 22, FFmpeg, and the pinned `chrome-headless-shell`: run `npx hyperframes browser ensure` once, or name a browser in `PRODUCER_HEADLESS_SHELL_PATH`. A cached browser is used only when its files match the pinned build. HDR capture needs a full Chrome named in `HYPERFRAMES_BROWSER_PATH`.
**Requirements:** Node.js >= 22.19, FFmpeg, and the pinned `chrome-headless-shell`: run `npx hyperframes browser ensure` once, or name a browser in `PRODUCER_HEADLESS_SHELL_PATH`. A cached browser is used only when its files match the pinned build. HDR capture needs a full Chrome named in `HYPERFRAMES_BROWSER_PATH`.

## What it does

Expand Down
4 changes: 2 additions & 2 deletions packages/engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"linkedom": "^0.18.12",
"puppeteer": "~25.13.0",
"puppeteer-core": "^25.13.0",
"undici": "7.30.1"
"undici": "8.13.0"
},
"devDependencies": {
"@types/node": "^25.0.10",
Expand All @@ -132,6 +132,6 @@
"vitest": "^4.1.12"
},
"engines": {
"node": ">=22"
"node": ">=22.19.0"
}
}
38 changes: 38 additions & 0 deletions packages/engine/src/utils/urlDownloader.slowReader.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { mkdtempSync, rmSync, statSync } from "node:fs";
import { appendFile } from "node:fs/promises";
import { createServer } from "node:http";
import type { AddressInfo } from "node:net";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterEach, expect, it } from "vitest";

const cleanup: Array<() => void> = [];
afterEach(() => {
for (const step of cleanup.splice(0).reverse()) step();
});

it("the undici downloads use saves, chunk by chunk, a body that ends when the server hangs up", async () => {
const bodySize = 1024 * 1024;
let serverGone!: () => void;
const gone = new Promise<void>((resolve) => (serverGone = resolve));
const server = createServer((_req, res) => {
res.useChunkedEncodingByDefault = false;
res.writeHead(200, { connection: "close" });
res.socket?.once("close", serverGone);
res.end(Buffer.alloc(bodySize, 1));
});
cleanup.push(() => server.close());
await new Promise<void>((resolve) => server.listen(0, "127.0.0.1", resolve));
const { port } = server.address() as AddressInfo;

const { Agent, fetch } = await import("undici/index.js");
const dispatcher = new Agent({ allowH2: false });
cleanup.push(() => void dispatcher.close());
const response = await fetch(`http://127.0.0.1:${port}/`, { dispatcher });
await gone;
const dir = mkdtempSync(join(tmpdir(), "hf-slow-reader-"));
cleanup.push(() => rmSync(dir, { recursive: true, force: true }));
// Each chunk reaches the disk before the next is read, as a download's does.
for await (const chunk of response.body!) await appendFile(join(dir, "body"), chunk);
expect(statSync(join(dir, "body")).size).toBe(bodySize);
});
2 changes: 1 addition & 1 deletion packages/gcp-cloud-run/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@
"yaml": "^2.9.0"
},
"engines": {
"node": ">=22"
"node": ">=22.19.0"
}
}
2 changes: 1 addition & 1 deletion packages/producer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Full HTML-to-video rendering pipeline: capture frames with Chrome's BeginFrame A
npm install @hyperframes/producer
```

**Requirements:** Node.js >= 22, FFmpeg, and the pinned `chrome-headless-shell`: run `npx hyperframes browser ensure` once, or name a browser in `PRODUCER_HEADLESS_SHELL_PATH`. A cached browser is used only when its files match the pinned build. HDR capture needs a full Chrome named in `HYPERFRAMES_BROWSER_PATH`.
**Requirements:** Node.js >= 22.19, FFmpeg, and the pinned `chrome-headless-shell`: run `npx hyperframes browser ensure` once, or name a browser in `PRODUCER_HEADLESS_SHELL_PATH`. A cached browser is used only when its files match the pinned build. HDR capture needs a full Chrome named in `HYPERFRAMES_BROWSER_PATH`.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion packages/producer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@
"vitest": "^4.1.12"
},
"engines": {
"node": ">=22"
"node": ">=22.19.0"
}
}
8 changes: 0 additions & 8 deletions scripts/check-no-main-deletions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2167,14 +2167,6 @@ export const ALLOWED_DELETIONS = new Map([
"packages/studio/src/utils/htmlAttrSafety.ts",
"Studio's hand-synced copy of core's html-attr-safety rules; Studio imports core's now, one source",
],
...[
"packages/cli/src/registry/envProxy.fixture.ts",
"packages/cli/src/registry/envProxy.process.test.ts",
"packages/cli/src/utils/envProxyFetch.ts",
].map((path) => [
path,
"held for v0.10.0 with #8311, the change that added it; drop this entry when it re-lands",
]),
[
"packages/studio/src/components/editor/anchoredResizeReleaseShift.test.ts",
"tested computeNextResizeAnchor, deleted with the per-frame convergence; the pin is now one measured formula",
Expand Down
Loading
Loading