From 924bb64da6d14d515751e6357c4600d31768f1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Thu, 5 Nov 2026 02:22:27 +0000 Subject: [PATCH] fix(cli): lint and check accept --lint-verbose, and two skills stop teaching --describe false (#7201) --- docs/packages/cli.mdx | 1 + packages/cli/src/commands/check.test.ts | 9 +++++ packages/cli/src/commands/check.ts | 5 +++ packages/cli/src/commands/lint.test.ts | 40 +++++++++++++++++++ packages/cli/src/commands/lint.ts | 10 ++++- skills-manifest.json | 4 +- skills/hyperframes/references/storyboard.md | 2 +- .../media-use/references/media-treatments.md | 2 +- 8 files changed, 67 insertions(+), 6 deletions(-) diff --git a/docs/packages/cli.mdx b/docs/packages/cli.mdx index 88e68350ff..6d22fc2d04 100644 --- a/docs/packages/cli.mdx +++ b/docs/packages/cli.mdx @@ -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, diff --git a/packages/cli/src/commands/check.test.ts b/packages/cli/src/commands/check.test.ts index ee4f3c09dc..93073696a4 100644 --- a/packages/cli/src/commands/check.test.ts +++ b/packages/cli/src/commands/check.test.ts @@ -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"); + }); +}); diff --git a/packages/cli/src/commands/check.ts b/packages/cli/src/commands/check.ts index 4b0d3fab02..272d0630e8 100644 --- a/packages/cli/src/commands/check.ts +++ b/packages/cli/src/commands/check.ts @@ -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)", diff --git a/packages/cli/src/commands/lint.test.ts b/packages/cli/src/commands/lint.test.ts index 32034b36c8..51d2bce0e8 100644 --- a/packages/cli/src/commands/lint.test.ts +++ b/packages/cli/src/commands/lint.test.ts @@ -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) => { + 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"]); + }); +}); diff --git a/packages/cli/src/commands/lint.ts b/packages/cli/src/commands/lint.ts index 7bbd9ca44f..bc98713245 100644 --- a/packages/cli/src/commands/lint.ts +++ b/packages/cli/src/commands/lint.ts @@ -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); diff --git a/skills-manifest.json b/skills-manifest.json index 0b84ae7d2c..9eeef1c2ea 100644 --- a/skills-manifest.json +++ b/skills-manifest.json @@ -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": { diff --git a/skills/hyperframes/references/storyboard.md b/skills/hyperframes/references/storyboard.md index 6d35319b2d..acb7a167f9 100644 --- a/skills/hyperframes/references/storyboard.md +++ b/skills/hyperframes/references/storyboard.md @@ -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 --no-end --describe false -o boards/stills`. Each still is named `frame-NN-at-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 --no-end -o boards/stills`. Each still is named `frame-NN-at-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 `), 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. diff --git a/skills/media-use/references/media-treatments.md b/skills/media-use/references/media-treatments.md index 38c2facffa..846dc9fdf5 100644 --- a/skills/media-use/references/media-treatments.md +++ b/skills/media-use/references/media-treatments.md @@ -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 --frames 3 --no-end --describe false \ + hyperframes snapshot --frames 3 --no-end \ --output snapshots/treatment-before ```