Skip to content

Commit

Permalink
Merge pull request #19018 from storybookjs/story-glob
Browse files Browse the repository at this point in the history
Core: Fix default story glob
  • Loading branch information
shilman authored Aug 26, 2022
2 parents 196839d + c8a0ba8 commit 53186d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ describe('normalizeStoriesEntry', () => {
{
"titlePrefix": "",
"directory": ".",
"files": "**/*.(stories|docs).@(mdx|tsx|ts|jsx|js)",
"files": "**/*.@(mdx|stories.mdx|stories.tsx|stories.ts|stories.jsx|stories.js)",
"importPathMatcher": {}
}
`);
Expand All @@ -241,7 +241,7 @@ describe('normalizeStoriesEntry', () => {
expect(specifier).toMatchInlineSnapshot(`
{
"titlePrefix": "",
"files": "**/*.(stories|docs).@(mdx|tsx|ts|jsx|js)",
"files": "**/*.@(mdx|stories.mdx|stories.tsx|stories.ts|stories.jsx|stories.js)",
"directory": ".",
"importPathMatcher": {}
}
Expand All @@ -265,7 +265,7 @@ describe('normalizeStoriesEntry', () => {
expect(specifier).toMatchInlineSnapshot(`
{
"titlePrefix": "atoms",
"files": "**/*.(stories|docs).@(mdx|tsx|ts|jsx|js)",
"files": "**/*.@(mdx|stories.mdx|stories.tsx|stories.ts|stories.jsx|stories.js)",
"directory": ".",
"importPathMatcher": {}
}
Expand Down
2 changes: 1 addition & 1 deletion code/lib/core-common/src/utils/normalize-stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { normalizeStoryPath } from './paths';
import { globToRegexp } from './glob-to-regexp';

const DEFAULT_TITLE_PREFIX = '';
const DEFAULT_FILES = '**/*.(stories|docs).@(mdx|tsx|ts|jsx|js)';
const DEFAULT_FILES = '**/*.@(mdx|stories.mdx|stories.tsx|stories.ts|stories.jsx|stories.js)';

// TODO: remove - LEGACY support for bad glob patterns we had in SB 5 - remove in SB7
const fixBadGlob = deprecate(
Expand Down

0 comments on commit 53186d8

Please sign in to comment.