Skip to content
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

Storyshots: Fix support for jsx/tsx config files #9834

Merged
merged 4 commits into from Feb 14, 2020

Conversation

davidgoli
Copy link
Contributor

@davidgoli davidgoli commented Feb 12, 2020

Issue: #9771

What I did

Implemented support for *.jsx and *.tsx preview files.

How to test

  • Added a Jest unit test for the new behavior.
  • Verified in the minimal repro repository (in the linked issue) that these changes fix the original issue.

.flatMap(filename => supportedExtensions.map(ext => `${filename}.${ext}`))
.map(filename => path.join(configDir, filename));

return allFilenames.find(isFile) || false;
};

const getMainFile = (configDir: string): string | false => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: should the same file extension support be implemented for main.js as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please! 🙏

@shilman shilman changed the title Implement support for jsx/tsx preview files Storyshots: Fix support for jsx/tsx config files Feb 12, 2020
@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Feb 12, 2020
@shilman shilman added this to the 5.3.x milestone Feb 12, 2020
@ndelangen
Copy link
Member

Awesome, looks great to me!

@ndelangen ndelangen merged commit bc83e98 into storybookjs:next Feb 14, 2020
@shilman
Copy link
Member

shilman commented Feb 15, 2020

Great job @davidgoli. Clean!!! ✨

@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Feb 25, 2020
shilman pushed a commit that referenced this pull request Feb 25, 2020
Storyshots: Fix support for jsx/tsx config files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: storyshots bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants