Repository navigation
feat(plugins): improve plugin list output - #567
Conversation
|
✅ Changeset file detected. |
|
Review completed for Generated by ChatGPT · Alter Ego |
Hanssen0-Alter-Ego
left a comment
There was a problem hiding this comment.
Found three low-priority display regressions in the original change (95ebaeb), still present at 2bc0ecf. The follow-up changeset was reviewed separately and has no findings. Two independent source passes and focused isolated CLI checks covered text and JSON behavior; the full Jest suite was not run.
Generated by ChatGPT · Alter Ego
| const jsCommands = new Set(js.map(({ command }) => command)); | ||
| const catalogRows = catalog | ||
| .filter(({ installed }) => !installed) | ||
| .map(({ command, version }) => { |
There was a problem hiding this comment.
[P3] Keep the catalog descriptions in the human list. This mapping discards the description previously shown for uninstalled tools. On a clean registry, the ckb-cli row now shows only its version and availability, omitting the catalog's explicit note that this build has no TUI. The grouped view can retain that information without restoring duplicate rows.
Suggested fix
Carry `description` into the catalog rows and render it after the status with a test for the `ckb-cli` note.|
|
||
| function pluginListRow({ command, version, kind, mode, state, error }: PluginInfo) { | ||
| const status = state === 'available' ? '✓ installed' : state; | ||
| return { command, version, status: kind === 'js' ? `${status} (${mode})` : status, error }; |
There was a problem hiding this comment.
[P3] Preserve installed-version diagnostics for broken managed tools. listPlugins() returns invalid or shadowed registrations before it can read the manifest version, but their registry-backed source.resolved remains available. The prior text showed that value; the new text shows -, and deduplication suppresses the separate catalog row. That makes it harder to identify the broken installation.
Suggested fix
For the human row only, fall back to the registered source/version when manifest version is unavailable; do not show the catalog pin as the installed version.| const versionWidth = rows.reduce((width, { version }) => Math.max(width, version?.length ?? 0), 1); | ||
| return rows.map( | ||
| ({ command, version, status, error }) => | ||
| ` ${command.padEnd(commandWidth)} ${(version ?? '-').padEnd(versionWidth)} ${status}${error ? ` — ${error}` : ''}`, |
There was a problem hiding this comment.
[P3] Render the missing-version placeholder for legacy descriptors. The legacy native manifest parser uses an empty string when the descriptor omits version (manifest.ts:107). ?? preserves that empty string, leaving a blank version column instead of -.
Suggested fix
Normalize empty versions to the same display placeholder as `undefined` and cover a versionless legacy row.|
Review completed for Generated by ChatGPT · Alter Ego |
Hanssen0-Alter-Ego
left a comment
There was a problem hiding this comment.
LGTM for afb07fd902c89b11968339a2cd09093e37074920 against 2bc0ecf6bb046c05e365464152b2e10ab0832935. Two independent passes found no actionable issue in the fix delta.
I verified the earlier findings: catalog descriptions are visible, broken registered tools show their recorded source without a duplicate row, and empty legacy versions render as -. The isolated list-action check passed seven text assertions and six before/after JSON comparisons. The Jest suite was not run because dependencies were unavailable in the offline cache.
Generated by ChatGPT · Alter Ego
Summary
offckb plugin listinto JavaScript plugins and binary tools, with aligned versions and✓ installed/✗ availablestatuses.blockedstatus when a JavaScript plugin already uses the command name.Verification
pnpm buildpnpm test --runInBand --silent tests/cli-errors.test.ts