Repository navigation
fix(cli): show every discover entry field in text output - #6521
Conversation
The package list and single-package text views printed a fixed subset of fields, so category and version appeared only in --json. Both views now render the whole entry.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
This fix restores the intended text output for astryx discover: the package list and single-package views now show every field the --json entry carries, including category and version, instead of a hand-picked subset. That aligns the text projection with the documented contract that text mirrors the JSON entry, and the new test derives its expectations from the JSON keys so a future field cannot silently drift out of text again. The JSON output, exit codes, and component listing behaviour are unchanged, and the new projection tests pass.
[Automated review]
PR Analysis Report
No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Visual Regression23 of 420 shot(s) changed. View the report A change here is a question, not a failure: check whether the after is the
and 3 more. Generated by PR Enrichment workflow | View full report |









User impact
astryx discoverreturns package entries withname,category,componentsandversion. The text rendering of the package list and of a single package (astryx discover @scope/name) printed only a hand-picked subset, socategoryandversionnever appeared in text even though--jsoncarried them. A reader of the text output could not see which version of an integration package it was browsing, and could not grep for either field.After this change both text views render the whole entry, so every JSON field appears as a
key: valueline.Problem and solution fit
fieldslist (displayName,name,description,components) to the record formatter instead of letting it render the entry. Two of the four listed fields are optional and usually absent, and two fields the entry does carry were left out.--json. With fields missing, the two views disagree about what a package entry contains.The fix drops the explicit
fieldslist, so the record formatter renders each entry's own keys in JSON order and skips absent ones. The default component summary (first 10 plus "+N more") and--componentsbehave as before.Expected behavior and authority
docs/specs/AST-017/spec.md(authority: current), FR13:and DEC-4:
docs/architecture/cli-surface.md(authority: current), INV4 and INV5: human output is a projection of the JSON, and text field names mirror JSON keys one to one.This changes text output only. The JSON envelope, exit codes and error codes are unchanged, so under
spec:AST-017FR5 it is a nonbreakingpatchfix.Smallest restoration
Two lines in
packages/cli/clients/cli/commands/discover.mjs: thediscover.listanddiscover.detailtext renderings no longer passfields. No other view, formatter or API changes.Evidence
@acme/many(version 2.0.0, twelve components),astryx discover --jsonreturned{"name":"@acme/many","category":"@acme/many","components":[...],"version":"2.0.0"}, whileastryx discoverprinted onlyname:andcomponents:lines.astryx discover @acme/manyprinted the same two.name:,category:,components:andversion:lines, with the same values as the JSON.C00, ..., C09, +2 more, andastryx discover --componentsstill lists all twelve. The empty-list messages, component doc views and search view are untouched.packages/cli/clients/cli/commands/discover.text-projection.test.mjsrunsdiscover --jsonanddiscover(and the@test/kitdetail view) and requires akey: valuetext line for every key of the JSON entry. Both cases fail onmain(nocategory:line) and pass with the fix; reverting onlydiscover.mjsturns both red. Because the test reads the keys from the JSON, a field added to the entry later without a text projection also fails it.Scope
Testing
All pass. The full CLI suite matches
mainapart from the two new tests.