mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-03 12:17:03 +00:00
* feat(cli): skipContrastInMotion moves to HF_TOOL_CONTEXT check-review
The --skip-contrast-in-motion flag and HYPERFRAMES_CHECK_SKIP_CONTRAST_IN_MOTION
env give way to a check-review capability in HF_TOOL_CONTEXT, so only a harness
turns it on. The skill text and manifest go back to main.
* feat(cli): check-review findingFrames saves one plain frame per finding time
With HF_TOOL_CONTEXT check-review.findingFrames, every error/warning finding in
layout or contrast with a real bbox gets frameTime (the middle sample of its
longest held run, by the heldMs gap rule) and frame (the absolute path of an
unannotated full frame shared by every finding at that time). One seek and
screenshot per distinct time, capped at 60 times with errors first, into the
run's snapshot folder; not listed in snapshots, history or events. Without the
capability, output is unchanged.
* docs(cli): finding-frame comments name the check-review capability, not a flag
* fix(cli): validate finding frame times and preserve cancellation
* fix(cli): count finding frame progress toward the check deadline
* feat(cli): check-review inspect attaches the inspector's report to each framed finding
With findingFrames on, the finding-frames page is served with the
inspector's GSAP hooks. After each frame is captured, every finding framed
at that time is inspected by its data-hf-id, else its selector, and the
inspector's own report is attached as the finding's inspect field. A failed
inspection becomes that finding's { error } and never fails the check.
Without the capability nothing changes.
Drops the unused @types/mime-types devDependency that the dependency audit
flags once packages/cli/package.json is touched.
* fix(cli): stop finding inspections after cancellation
* fix(cli): reject ambiguous finding inspection targets
* fix(ci): build inspector before Windows CLI smoke
* fix(cli): parse viewport HTML with explicit server parser
113 lines
3.9 KiB
TypeScript
113 lines
3.9 KiB
TypeScript
import { defineConfig } from "tsup";
|
|
import { resolve } from "node:path";
|
|
import { readFileSync } from "node:fs";
|
|
import { sourceAliases } from "../../scripts/package-subpaths.mjs";
|
|
|
|
const pkg = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf-8")) as {
|
|
version: string;
|
|
};
|
|
const producerPkg = JSON.parse(
|
|
readFileSync(new URL("../producer/package.json", import.meta.url), "utf-8"),
|
|
) as { version: string };
|
|
|
|
export default defineConfig({
|
|
entry: {
|
|
cli: "src/cli.ts",
|
|
fontLocalizeCli: "src/fontLocalizeCli.ts",
|
|
runtimeVersion: "src/runtimeVersion.ts",
|
|
warmCheck: "src/warmCheck.ts",
|
|
warmCheckClient: "src/warmCheckClient.ts",
|
|
renderSetupWorker: "src/renderSetupWorker.ts",
|
|
backgroundChecksWorker: "src/backgroundChecksWorker.ts",
|
|
sherpaWorker: "src/whisper/sherpaWorker.ts",
|
|
shaderTransitionWorker: "../producer/src/services/shaderTransitionWorker.ts",
|
|
api: "src/api.ts",
|
|
},
|
|
format: ["esm"],
|
|
outDir: "dist",
|
|
target: "node22",
|
|
platform: "node",
|
|
bundle: true,
|
|
splitting: true,
|
|
sourcemap: false,
|
|
// Types for the `./api` export only; the other entries are programs, not libraries.
|
|
dts: { entry: { api: "src/api.ts" } },
|
|
clean: true,
|
|
banner: {
|
|
js: `import { createRequire as __hf_createRequire } from "node:module";
|
|
import { fileURLToPath as __hf_fileURLToPath } from "node:url";
|
|
import { dirname as __hf_dirname } from "node:path";
|
|
var require = __hf_createRequire(import.meta.url);
|
|
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
var __dirname = __hf_dirname(__filename);`,
|
|
},
|
|
external: [
|
|
"puppeteer-core",
|
|
"puppeteer",
|
|
"@puppeteer/browsers",
|
|
// Native module — its platform binary (@img/sharp-<os>-<arch>) must be
|
|
// resolved from node_modules at runtime, never bundled. Loaded lazily by
|
|
// the capture pipeline; runtime resolution comes from the `dependencies`
|
|
// entry in package.json.
|
|
"sharp",
|
|
"open",
|
|
"hono",
|
|
"hono/*",
|
|
"@hono/node-server",
|
|
"adm-zip",
|
|
"esbuild",
|
|
"giget",
|
|
"postcss",
|
|
// aws-lambda transitively pulls @aws-sdk/* + @smithy/* which include
|
|
// .browser.js conditional exports esbuild can't bundle cleanly into
|
|
// a node binary. Keep it external; the lambda subverb files dynamic-
|
|
// import it only when the user runs `hyperframes lambda *`, so the
|
|
// CLI's cold start doesn't load it. Runtime resolution comes from
|
|
// @hyperframes/aws-lambda being a `dependencies` entry in package.json.
|
|
"@hyperframes/aws-lambda",
|
|
"@hyperframes/aws-lambda/sdk",
|
|
// Same treatment for the GCP adapter: the cloudrun subverb files
|
|
// dynamic-import `@hyperframes/gcp-cloud-run/sdk` only when the user runs
|
|
// `hyperframes cloudrun *`. Keep it external; runtime resolution comes
|
|
// from the `dependencies`/workspace entry, not the bundled CLI.
|
|
"@hyperframes/gcp-cloud-run",
|
|
"@hyperframes/gcp-cloud-run/sdk",
|
|
"@hyperframes/gcp-cloud-run/terraform",
|
|
],
|
|
noExternal: [
|
|
"@hyperframes/core",
|
|
"@hyperframes/parsers",
|
|
"@hyperframes/studio-server",
|
|
"@hyperframes/lint",
|
|
"@hyperframes/producer",
|
|
"@hyperframes/engine",
|
|
"@hyperframes/inspector",
|
|
"@clack/prompts",
|
|
"@clack/core",
|
|
"picocolors",
|
|
"linkedom",
|
|
"sisteransi",
|
|
"is-unicode-supported",
|
|
"citty",
|
|
],
|
|
define: {
|
|
__CLI_VERSION__: JSON.stringify(pkg.version),
|
|
__PRODUCER_VERSION__: JSON.stringify(producerPkg.version),
|
|
},
|
|
esbuildOptions(options) {
|
|
options.alias = {
|
|
// Exact subpaths are generated from the same contracts as package
|
|
// exports, avoiding esbuild's root-alias prefix substitution trap.
|
|
...sourceAliases(resolve(__dirname, "../producer"), [".", "./distributed"]),
|
|
...sourceAliases(resolve(__dirname, "../engine"), [
|
|
".",
|
|
"./chrome-host-ceiling",
|
|
"./shader-transitions",
|
|
"./system-memory",
|
|
"./wsl-host",
|
|
]),
|
|
};
|
|
options.loader = { ...options.loader, ".browser.js": "text" };
|
|
},
|
|
});
|