fix(cli): use the resolved owner package for a component's plain-text import hint - #5294
Conversation
… import hint `astryx component <Name>`'s text formatter recomputed the import hint via the core-only resolveImportPath regardless of the component's actual owner, so an integration-owned component always printed an @astryxdesign/core import that did not exist. The JSON response already resolves this correctly via withOwnership; the command now uses that value instead of redoing the resolution.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
cixzhang
left a comment
There was a problem hiding this comment.
Thanks, this fixes the misleading integration import hint by reusing the API’s resolved package. The focused regression and ownership suites pass.
[Reviewed by Robohands]
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
Stale automated approval from the previous reviewer; this PR needs a fresh current-head review.
cixzhang
left a comment
There was a problem hiding this comment.
Thanks, this fixes the misleading import hint by reusing the package Astryx already resolved across full, compact, and brief output. Focused regression and ownership checks pass.
[Reviewed by Robohands]
|
The failed-jobs retry on this exact head reproduced the same repository-owned CLI type-surface error from its old base ( |
Problem
astryx component <Name>'s plain-text output always showedimport {Name} from '@astryxdesign/core/...', even for a component owned by an integration package with no core equivalent. #4810 already fixed this for the JSON response (withOwnershipinapi/component/_adapter.mjsnow resolves the specifier against the owning package'sexportsmap), but the command's text formatter never used that value — it recomputed its own hint viaresolveImportPath(coreDir, resolvedName), which only ever resolves against core.Fix
component.detail's text-output branch inclients/cli/commands/component/index.mjsnow readsresult.data.import(the valuewithOwnershipalready resolved correctly) instead of recomputing it. One line.Testing
Extended
import-hint-correctness.test.mjswith a newdescribecovering integration-owned components end to end viarunCli, using the same "root the fixture inside the package tree" patterndoctor.test.mjsalready uses (Vite'sserver.fs.allowcan't serve a real tmp-path config at runtime):component <Name>(full) shows the integration's own package, not@astryxdesign/core.component <Name> --detail briefshows the same.package.jsondoes export a matching subpath still resolves to that subpath (composes correctly with fix(cli): resolve integration import specifiers against the package exports map #4810's fix).Confirmed all three fail without the one-line fix (reverted it locally and reran) and pass with it.
import-hint-correctness.test.mjs: 497/497 passed.component-ownership.test.mjs,component-package.test.mjs,component-resolution.test.mjs: 44/44 passed.eslinton both changed files: clean.