Conversation
|
hi @moroshko! just to note, it's completly "vibe-coded" I'm working on adding Storybook on my react app, and wanted to build a "Catalog UI" with 2 actions "IDE-like" "Go to implementation"/"Go to definition". Claude found your repo, but it didn't recognize some components, not even sure which ones, but I think the "aliased" ones, so I guess it was because this repo is old and didn't support that So, the idea behind, is to add a community addon, that use the react-scanner json output, to build this "Catalog-UI" I made a fork and add that for my project, but I think it could be nice to use your repo on the community addon that I would like to add on Storybook Addons: https://storybook.js.org/addons/ I also think, there is a lot of potential here "unexplored" to use Storybook as a TDD like implementation for Agents |
Applications that already maintain a TypeScript program or another symbol resolver cannot currently report an unused import or supply the canonical identity of a JSX tag imported through a barrel. The file-local import lookup can also attribute a shadowed identifier to the imported component.
This adds two optional synchronous hooks, keeping current behavior when neither is configured:
resolveImport({ filePath, node, specifier, importInfo })returns{ componentName, importRecord }to append caller-defined import evidence to the raw report, including imports with no JSX. Returning a falsy value skips that import record.resolveComponent({ filePath, node, name })returns{ componentName, importInfo }from an external resolver. Returning a falsy value excludes the tag without falling back to its local import name. Existing JSX filters still apply to the resolved identity.For example, an external resolver can identify
<Alias />from a local barrel asButtonfromexample-ui, while rejecting a same-named parameter. An import-record callback can preserve the specifier's file, line and column even if the imported component is never rendered. Import records remain separate from JSX instances; no runtime evaluation or wrapper-prop propagation is added.The README documents the arguments, return values, filter behavior and examples. Eleven generic tests cover unused and type-only imports, specifier locations, nested records, resolver exclusion, module/component filters, option forwarding and callback validation. No application-specific resolver or registry is included.
Validation on Node 24.19.0 with the existing dependency lock:
npm test: 70 tests passed.npm run lint: passed.npm run test:coverage: passed, with 100% statements, branches, functions and lines.Dependency versions, the package lock and LICENSE are unchanged. Parser upgrades can be considered separately; they are outside this focused contribution. Opening as a draft for review of the hook API and raw-report shape.