Repository navigation
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
miguel-heygen
left a comment
There was a problem hiding this comment.
Thanks, this is a clean fix. Moving the notice below the JSON early return is the right place for it, and the new test runs the real command and parses the whole of stdout, so it catches anything else that leaks in. I confirmed both cases fail on the old code with the same parser error and pass with the change.
One related thing you may want to fold in or leave for later: --shot runs before the JSON branch, so keyframes … --shot out.png --json still prints the screenshot lines (or the "no statically resolved animated element" message) as plain text to stdout instead of JSON (packages/cli/src/commands/keyframes.ts:1093, output at :857 and :883). It predates this PR and isn't what the issue reported, so it doesn't block this.
Verdict: APPROVE
Reasoning: The fix is minimal and correct, the regression test runs the real command and fails without the change, and all checks are green.
What
keyframes --runtime css --jsonand--runtime anime --jsonnow emit parseable JSON. Both commands were prefixing the JSON object with a human-readable notice, breaking scripts even though the CLI exited 0.Why
Agents and scripts need to parse the complete stdout when they request
--json.With the issue's exact HTML and
--runtime css --jsonor--runtime anime --json:JSON.parse(stdout)Unexpected token 'k', "keyframes:"... is not valid JSONruntime: "css", one CSS keyframe;runtime: "anime", one Anime.js record--jsonRelated work
Fixes #6226.
Searched open and closed issues/PRs by symptom and notice path before implementation and publication. #5526 and #2374 cover static keyframe data and template extraction, #5959 concerns rendered image transforms, and #5534 is a release. None covers this output failure.
How
Move the existing notice after the JSON early return. Add command-level regression cases for CSS and Anime.js that parse every stdout log together, including the empty-result case. Document runtime-filtered JSON output in the CLI guide.
Test plan
3d45d1b037860afd42439a2b4ca7e0dc762448c3.git diff --check.docs/developers/cli.mdx. Mintlify validation/broken-link commands were unavailable becausemintis not installed; no software was installed for them.Validation ran on Linux x86_64, Node v26.11.1, Bun 1.4.1. The repository requests Bun 1.4.4; the commands passed without upgrading Bun.
/tmpreached its user quota during setup, so builds and tests used a writableTMPDIRon the worktree filesystem.