-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow tracing changed files to affected story files CH-1205 CH-1393 #495
Conversation
CH-1205 Add full tracing of how a changed file leads to CSF in `stats-to-story-files`
Using a tree-like UI perhaps? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, a couple questions:
- I think maybe you could add some tests to the
getDependentStoryFiles
just checking thetracedPaths
end up looking as we expect? Perhaps the existing tests would work well here? - In terms of testing the UI of the traced paths, it might be nice to have at least one test that will ensure we notice if it breaks (I'm not super worried about the specifics of the UI, but we could do stories?)
- I'm confused about
trace
vsstats-to-story-files
-- are they doing the same thing?
Makes sense. I'll extend one/some of the existing tests with
I think the snapshot test for 👆 would cover breakage. We can do a story for the visual side of it but it would require some refactoring to extract the (visual) text from the code into messages (components). At first I didn't think it was necessary because it was just a util, but now that it's also a flag, we should give it the proper UI treatment.
They both call |
I agree that seems like a good idea
JSON output? AFAIK that's not used anywhere so I guess not. |
CH-1393 Add a storybookBaseDir option to the trace/stats-to-story-files script
Currently you can set the config dir via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, 👍 @ghengeveld
Depends on https://github.com/chromaui/chromatic/pull/5786
This adds a
trace
utility and the--trace-changed
flag which print a tree visualization of how changed files relate to (bundles containing) affected story files:Adding the
--expanded
flag totrace
or setting--trace-changed=expanded
reveals underlying modules:npx chromatic trace [...changed file paths]
operates on a provided stats file (--stats-file
, defaultstorybook-static/preview-stats.json
) and provided list of changed files. Alternatively, you can pass the--trace-changed
flag to the regular CLI to print this info as part of the Chromatic build (possibly combined with--dry-run
).