Skip to content

Commit

Permalink
Sort globbed files for consistent ordering.
Browse files Browse the repository at this point in the history
For #16767

Apparently globby's order is non deterministic: sindresorhus/globby#131

I wasn't able to reproduce in our tests but definitely saw the behaviour in the issue.
  • Loading branch information
tmeasday committed Nov 25, 2021
1 parent 95b9763 commit 14c30cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core-server/src/utils/StoryIndexGenerator.ts
Expand Up @@ -50,7 +50,7 @@ export class StoryIndexGenerator {
path.join(this.options.workingDir, specifier.directory, specifier.files)
);
const files = await glob(fullGlob);
files.forEach((absolutePath: Path) => {
files.sort().forEach((absolutePath: Path) => {
const ext = path.extname(absolutePath);
const relativePath = path.relative(this.options.workingDir, absolutePath);
if (!['.js', '.jsx', '.ts', '.tsx', '.mdx'].includes(ext)) {
Expand Down

0 comments on commit 14c30cf

Please sign in to comment.