Skip to content

Commit

Permalink
ensure the changed default_files_pattern is applied to entries that d…
Browse files Browse the repository at this point in the history
…idn't need filtering
  • Loading branch information
ndelangen committed Nov 17, 2023
1 parent c643d59 commit 36d0747
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions code/lib/core-server/src/presets/common-override-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ export const framework: PresetProperty<'framework', StorybookConfig> = async (co

export const stories: PresetProperty<'stories', StorybookConfig> = async (entries, options) => {
if (options?.build?.test?.disableMDXEntries) {
const list = normalizeStories(entries, {
configDir: options.configDir,
workingDir: options.configDir,
default_files_pattern: '**/*.@(stories.@(js|jsx|mjs|ts|tsx))',
});
const result = (
await Promise.all(
normalizeStories(entries, {
configDir: options.configDir,
workingDir: options.configDir,
default_files_pattern: '**/*.@(stories.@(js|jsx|mjs|ts|tsx))',
}).map(async ({ directory, files, titlePrefix }) => {
list.map(async ({ directory, files, titlePrefix }) => {
const pattern = join(directory, files);
const absolutePattern = isAbsolute(pattern) ? pattern : join(options.configDir, pattern);
const absoluteDirectory = isAbsolute(directory)
Expand Down Expand Up @@ -62,7 +63,7 @@ export const stories: PresetProperty<'stories', StorybookConfig> = async (entrie
}));
acc.push(...items);
} else {
items = [entries[i]];
items = [list[i]];
}
acc.push(...items);

Expand Down

0 comments on commit 36d0747

Please sign in to comment.