mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
fix(cli): lint and check accept --lint-verbose, and two skills stop teaching --describe false (#7201)
This commit is contained in:
@@ -1192,6 +1192,7 @@ npx hyperframes lint [dir] --json
|
||||
Errors (`✗`) must be fixed before rendering — a missing adapter library, invalid
|
||||
attributes. Warnings (`⚠`) are likely problems. Info (`ℹ`) notices are hidden
|
||||
unless you pass `--verbose`, which keeps output clean for agents and CI.
|
||||
`--lint-verbose`, which `render`, `preview` and `publish` use for the same wish, works here and on `check` too.
|
||||
`--json` adds `errorCount`, `warningCount`, `infoCount`, and a `findings` array.
|
||||
|
||||
The linter catches missing attributes, missing adapter libraries (GSAP, Lottie,
|
||||
|
||||
@@ -14,6 +14,7 @@ vi.mock("../telemetry/events.js", () => ({
|
||||
|
||||
import { contrastRatio, parseColorRGBA } from "./contrast-bg.js";
|
||||
import { createCheckCommand, parseCheckRange } from "./check.js";
|
||||
import { assertKnownFlags } from "../utils/reject-unknown-flags.js";
|
||||
import { readConfig } from "../telemetry/config.js";
|
||||
import { CheckDeadlineError, CheckStoppedError } from "../utils/checkDeadline.js";
|
||||
import { trackCommandFailures } from "../utils/command-failure-tracking.js";
|
||||
@@ -3882,3 +3883,11 @@ describe("check stopped by a signal", () => {
|
||||
expect(order).toEqual(["print {", "exit 143"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("check --lint-verbose", () => {
|
||||
it("is a known flag, as render, preview and publish spell it, and a made-up one still is not", () => {
|
||||
const check = createCheckCommand() as never;
|
||||
expect(() => assertKnownFlags(check, ["--lint-verbose", "--json"], "check")).not.toThrow();
|
||||
expect(() => assertKnownFlags(check, ["--lint-loud"], "check")).toThrow("Unknown flag");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -165,6 +165,11 @@ async function saveCheckReport(
|
||||
const CHECK_COMMAND_ARGS = {
|
||||
dir: { type: "positional", description: "Project directory", required: false },
|
||||
json: { type: "boolean", description: "Output agent-readable JSON", default: false },
|
||||
"lint-verbose": {
|
||||
type: "boolean",
|
||||
description: "Accepted as render's spelling; check always prints every lint finding",
|
||||
default: false,
|
||||
},
|
||||
samples: {
|
||||
type: "string",
|
||||
description: "Number of midpoint samples across the duration (default: 9)",
|
||||
|
||||
@@ -88,3 +88,43 @@ describe("lint command exit handling", () => {
|
||||
expect(consumeCommandResult().exitCode).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("lint --lint-verbose", () => {
|
||||
beforeEach(() => {
|
||||
consumeCommandResult();
|
||||
lintProjectMock.mockResolvedValue({
|
||||
results: [
|
||||
{
|
||||
result: {
|
||||
findings: [
|
||||
{ severity: "warning", code: "warn" },
|
||||
{ severity: "info", code: "note" },
|
||||
],
|
||||
},
|
||||
file: "index.html",
|
||||
},
|
||||
],
|
||||
totalErrors: 0,
|
||||
totalWarnings: 1,
|
||||
totalInfos: 1,
|
||||
});
|
||||
});
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
consumeCommandResult();
|
||||
});
|
||||
|
||||
const codes = async (args: Record<string, unknown>) => {
|
||||
const log = vi.spyOn(console, "log").mockImplementation(() => {});
|
||||
await run({ json: true, ...args });
|
||||
return (JSON.parse(String(log.mock.calls.at(-1)?.[0])).findings as { code: string }[]).map(
|
||||
(f) => f.code,
|
||||
);
|
||||
};
|
||||
|
||||
it("shows info findings like --verbose, which render, preview and publish spell --lint-verbose", async () => {
|
||||
expect(await codes({})).toEqual(["warn"]);
|
||||
expect(await codes({ verbose: true })).toEqual(["warn", "note"]);
|
||||
expect(await codes({ "lint-verbose": true })).toEqual(["warn", "note"]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -39,6 +39,11 @@ export default defineCommand({
|
||||
description: "Show info-level findings (hidden by default)",
|
||||
default: false,
|
||||
},
|
||||
"lint-verbose": {
|
||||
type: "boolean",
|
||||
description: "Same as --verbose (render, preview and publish spell it --lint-verbose)",
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
async run({ args }) {
|
||||
// Set process.exitCode + return instead of process.exit(): process.exit()
|
||||
@@ -48,6 +53,7 @@ export default defineCommand({
|
||||
// first, then Node exits with the set code — the pattern the other commands
|
||||
// (publish/transcribe/upgrade/play/present) already use.
|
||||
try {
|
||||
const verbose = Boolean(args.verbose || args["lint-verbose"]);
|
||||
const { project, entryFile } = resolveLintTarget(args.dir);
|
||||
const startedAt = Date.now();
|
||||
const lintResult = await lintProject(
|
||||
@@ -70,7 +76,7 @@ export default defineCommand({
|
||||
errorCount: lintResult.totalErrors,
|
||||
warningCount: lintResult.totalWarnings,
|
||||
infoCount: lintResult.totalInfos,
|
||||
findings: args.verbose ? allFindings : allFindings.filter((f) => f.severity !== "info"),
|
||||
findings: verbose ? allFindings : allFindings.filter((f) => f.severity !== "info"),
|
||||
filesScanned: lintResult.results.length,
|
||||
};
|
||||
console.log(JSON.stringify(withMeta(combined), null, 2));
|
||||
@@ -92,7 +98,7 @@ export default defineCommand({
|
||||
const lines = formatLintFindings(lintResult, {
|
||||
showElementId: true,
|
||||
showSummary: true,
|
||||
verbose: args.verbose,
|
||||
verbose,
|
||||
});
|
||||
for (const line of lines) console.log(line);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"files": 2
|
||||
},
|
||||
"hyperframes": {
|
||||
"hash": "7db75badd2151d6c",
|
||||
"hash": "7e43b38bd9936270",
|
||||
"files": 77
|
||||
},
|
||||
"hyperframes-cli": {
|
||||
@@ -18,7 +18,7 @@
|
||||
"files": 13
|
||||
},
|
||||
"media-use": {
|
||||
"hash": "b17f9033fa158cee",
|
||||
"hash": "02b0526fd767bee8",
|
||||
"files": 118
|
||||
},
|
||||
"remotion-to-hyperframes": {
|
||||
|
||||
@@ -9,7 +9,7 @@ The person sees the plan as stills on the board, comments or draws on a frame, a
|
||||
## 1. The run
|
||||
|
||||
1. **Pose each shot** in the composition the project renders, the root `index.html`, at its key moment: real words, real fonts, real colors, the focal point big enough to read on a phone. A shot posed in its own file (`compositions/frames/NN-*.html`) shows only once it is mounted in `index.html` (`data-composition-src`) at its planned start; `snapshot` renders `index.html` and nothing else. Before the first pose, copy `index.html` to `boards/.film.html`: until the go, the preview plays that film, never the stills (step 4).
|
||||
2. **Snapshot every still in one run** with your host's snapshot tool when one is offered (each shot's seconds, out `boards/stills`); otherwise `npx hyperframes snapshot --at <every shot's seconds, in film order> --no-end --describe false -o boards/stills`. Each still is named `frame-NN-at-<seconds>s.png`, NN its place in the film. Every `snapshot` run clears its `-o` folder and numbers from `00`, so never snapshot a single moment into `boards/stills/` itself (step 5). Look at every still yourself; fix and snapshot again until each one holds.
|
||||
2. **Snapshot every still in one run** with your host's snapshot tool when one is offered (each shot's seconds, out `boards/stills`); otherwise `npx hyperframes snapshot --at <every shot's seconds, in film order> --no-end -o boards/stills`. Each still is named `frame-NN-at-<seconds>s.png`, NN its place in the film. Every `snapshot` run clears its `-o` folder and numbers from `00`, so never snapshot a single moment into `boards/stills/` itself (step 5). Look at every still yourself; fix and snapshot again until each one holds.
|
||||
3. **Write `boards/storyboard.html`** (§ 2), styled as a finished board: Inter or the system sans-serif, a light page, each frame a rounded card with its still above its words, even gaps.
|
||||
4. **Put the film back.** Copy the posed `index.html` to `boards/.posed.html`, then `boards/.film.html` back over `index.html`. The board stays on its own page: held stills in the preview read as a slideshow.
|
||||
5. **Stop.** Hand the person the board and wait for their go. Notes on frames change only those frames. For each one: copy `boards/.posed.html` over `index.html`, re-pose it, snapshot just its moment into `boards/stills/redo/` (`--at <its seconds>`), move that one file over the frame's old still under the old name (its new time in the name if the time changed, and the page's `src` with it), then put the film back (step 4), rewrite the page and stop again. The other stills stay as approved.
|
||||
|
||||
@@ -138,7 +138,7 @@ drops frames. Do not impose or claim a universal hard cap from one machine.
|
||||
one labeled sheet and read that one image:
|
||||
|
||||
```bash
|
||||
hyperframes snapshot <project> --frames 3 --no-end --describe false \
|
||||
hyperframes snapshot <project> --frames 3 --no-end \
|
||||
--output snapshots/treatment-before
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user