Skip to content

fix(cli): the documented hook example referenced a hook that does not exist - #4742

Merged
josephfarina merged 1 commit into
mainfrom
fix/cli-broken-hook-example
Aug 5, 2026
Merged

josephfarina merged 1 commit into
mainfrom
fix/cli-broken-hook-example

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

Summary

astryx hook useToggle --json fails with ERR_UNKNOWN_HOOK — there is no useToggle in the design system (the CLI suggests useToast/useTheme instead).

It shipped in two places a consumer actually sees:

  • the examples in astryx manifest --json, which agents read to learn the CLI
  • the hook CommandDoc that feeds --help

Both now use useFocusTrap, which resolves.

How it was found

By executing every documented example instead of reading them. The drift harness compares a CommandDoc's flags and args against the live CLI, but nothing ever ran the examples — so an example naming a nonexistent subject looked perfectly valid.

The example-runner is now part of the Night Watch Doc Reviewer's CLI check, so this class of rot gets caught nightly.

Pre-existing: manifest.mjs has carried it since #4623, and #4714 propagated it into the CommandDoc.

Test plan

  • astryx hook useFocusTrap --json returns a hook.detail envelope, exit 0
  • Re-ran the example runner across all 31 documented examples — hook no longer reports. The 5 that remain reference files/packages absent from an empty sandbox (theme build ./src/themes/ocean.ts), which is legitimately illustrative
  • drift 60 docs / 0 errors, check:cli-structure green, typecheck:strict 0

Made with Cursor

… exist

`astryx hook useToggle --json` fails with ERR_UNKNOWN_HOOK — there is no
useToggle in the design system (the CLI helpfully suggests useToast/useTheme).
It shipped in two places a consumer sees: the examples in
`astryx manifest --json`, which agents read to learn the CLI, and the hook
CommandDoc that feeds --help. Both now use useFocusTrap, which resolves.

Found by executing every documented example rather than reading them: the drift
harness compares a CommandDoc's flags and args against the live CLI, but nothing
ran the examples, so an example naming a nonexistent subject looked fine.

Co-authored-by: Cursor <cursoragent@cursor.com>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 5, 2026
@vercel

vercel Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview Aug 5, 2026 9:46pm

Request Review

@josephfarina
josephfarina merged commit d1b7d82 into main Aug 5, 2026
18 checks passed
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

github-actions Bot added a commit that referenced this pull request Aug 5, 2026
@github-actions
github-actions Bot deleted the fix/cli-broken-hook-example branch August 6, 2026 06:58

This branch was successfully deployed

1 active deployment
Preview — fa181424 Deployed Aug 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant