-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(rename): renames all -test files to .test #6266
Conversation
0c21e03
to
81e447f
Compare
Deploy preview for carbon-elements ready! Built with commit 0c21e03 |
@tw15egan this might impact some of the teams pulling in our stories potentially, just as a heads up. cc @jendowns @tay1orjones do you all still bring in stories for your storybooks or no? 👀 |
Do we know why the glob wasn't working previously btw? Story changes seem great, test files would be great to keep the test file strategy consistent between standalone and ones in |
Deploy preview for carbon-elements ready! Built with commit 10e5616 |
👍 I threw this up to start a discussion around this, because definitely not sure how far-reaching this change can be Not sure how much work would need to be put into exporting the stories, but can definitely look into that first if this will break people |
Deploy preview for carbon-components-react ready! Built with commit 0c21e03 https://deploy-preview-6266--carbon-components-react.netlify.app |
@joshblack after doing some research into why the globs weren't working it seems like babel doesn't utilize the glob package directly, so |
Deploy preview for carbon-components-react ready! Built with commit 81e447f https://deploy-preview-6266--carbon-components-react.netlify.app |
Deploy preview for carbon-components-react ready! Built with commit 10e5616 https://deploy-preview-6266--carbon-components-react.netlify.app |
@joshblack @tw15egan Yeah, we import stories from your build and include them in our storybook. We have them placed in the 'others' section and renamed it to 'Carbon' via a pseudo element overlay. This would break that for us - we'd probably be looking at copy/pasting stories from your codebase and then manually keeping them up to date when we update to new releases. We could potentially script that, but a more formal solution for story reuse would be nice. |
@tay1orjones yeah definitely don't want to break it for y'all. I haven't dug into much regarding Component Story Format, but if we could add the knobs as parameters then that seems like the next step before we go any further with these renames. |
@tay1orjones I threw up a PR that is switching our Accordion to the new storybook format. Is this all that would be needed (for each component)? |
9403546
to
5b2bed6
Compare
5b2bed6
to
90c206c
Compare
90c206c
to
69da478
Compare
@tay1orjones @joshblack I've updated this PR to just included a change to the test file names. I have a PR up exploring exporting storybook stories in the CSF format (just Accordion for now) if y'all want to take a look. I'm not sure exactly how you are importing them now vs what you would need to do differently with the proposed format but would love to get some eyes on it. |
@tw15egan I think that would work for us. I posted a comment on the other PR with some thoughts/questions around what it specifically might look like. Currently we re-export Accordion in our library with no modifications. So we directly reuse your story file by having an export {
default as AccordionStory,
} from 'carbon-components-react/lib/components/Accordion/Accordion-story'; |
@tw15egan would we want to add |
@joshblack if we are concerned with unintended problems with the name change we can go that route |
@tw15egan just was to minimize the number of changes that needed to happen for the issue. If we want to start communicating that test files should be written with |
Closes #2535
Updates all
-test.js
files to and.test.js
so that the glob successfully matches and does not include these files in our build. We also now get the custom icons for test files 🎉Changelog
Changed
Testing / Reviewing
Make sure all tests still run, and the storybook environment is the same.
Run
yarn build
in the react package, and ensure no test files are included in thees
orlib
output folders