Skip to content

Commit

Permalink
Core: Fix register.tsx/jsx as manager code in preset heuristic
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed May 29, 2020
1 parent a38451f commit 65ab7e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/src/server/presets.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const resolveAddonName = (name) => {
return {
name,
// Accept `register`, `register.js`, `require.resolve('foo/register'), `register-panel`
type: path.match(/register(-panel)?(.js)?$/) ? 'managerEntries' : 'presets',
type: path.match(/register(-panel)?(.(js|ts|tsx|jsx))?$/) ? 'managerEntries' : 'presets',
};
}

Expand Down
2 changes: 2 additions & 0 deletions lib/core/src/server/presets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ describe('splitAddons', () => {
'@storybook/addon-actions/register',
'storybook-addon-readme/register',
'addon-foo/register.js',
'addon-bar/register.ts',
'addon-baz/register.tsx',
'@storybook/addon-notes/register-panel',
];
expect(splitAddons(addons)).toEqual({
Expand Down

0 comments on commit 65ab7e2

Please sign in to comment.