Skip to content

Commit

Permalink
Merge pull request #20809 from sheriffMoose/revert-20679
Browse files Browse the repository at this point in the history
Revert addon-docs: update story index generator
  • Loading branch information
sheriffMoose authored Feb 4, 2023
2 parents 0a65301 + 48dda15 commit aaa8a08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/lib/core-server/src/utils/StoryIndexGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ export class StoryIndexGenerator {
);
}

isStoryFile(absolutePath: Path) {
return /(\.(js|jsx|ts|tsx)|\.stories\.mdx)$/i.test(absolutePath);
isDocsMdx(absolutePath: Path) {
return /(?<!\.stories)\.mdx$/i.test(absolutePath);
}

async ensureExtracted(): Promise<IndexEntry[]> {
Expand All @@ -181,7 +181,7 @@ export class StoryIndexGenerator {
// files may use the `<Meta of={XStories} />` syntax, which requires
// that the story file that contains the meta be processed first.
await this.updateExtracted(async (specifier, absolutePath) =>
this.isStoryFile(absolutePath) ? this.extractStories(specifier, absolutePath) : false
this.isDocsMdx(absolutePath) ? false : this.extractStories(specifier, absolutePath)
);

if (!this.options.docs.disable) {
Expand Down

0 comments on commit aaa8a08

Please sign in to comment.