Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexer: Improve locating stories with specials chars in path #22110

Merged
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions code/lib/core-server/src/utils/StoryIndexGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,16 @@ export class StoryIndexGenerator {
this.specifiers.map(async (specifier) => {
const pathToSubIndex = {} as SpecifierStoriesCache;

const fullGlob = slash(
path.join(this.options.workingDir, specifier.directory, specifier.files)
);
const fullGlob = slash(path.join(specifier.directory, specifier.files));

// Dynamically import globby because it is a pure ESM module
const { globby } = await import('globby');

const files = await globby(fullGlob, commonGlobOptions(fullGlob));
const files = await globby(fullGlob, {
absolute: true,
cwd: this.options.workingDir,
...commonGlobOptions(fullGlob),
});

if (files.length === 0) {
once.warn(
Expand Down