-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
base: next
Are you sure you want to change the base?
Indexer: Improve locating stories with specials chars in path #22110
Conversation
const fullGlob = slash(path.join(specifier.directory, specifier.files)); | ||
const files = await glob( | ||
fullGlob, | ||
// Do not treat workingDir path as a glob pattern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It means that with cwd
, we're now treating only path.join(specifier.directory, specifier.files)
as glob. In case the comment brings more confusion than value, I'm happy to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see now.
Would I need to do the same here:
#22186
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say yes, in case there are special chars in the path, they won't match without it.
Hi @shilman, anything I can do to help push this PR toward a merge? |
@jankoritak Sorry for the delay. I'll make some time to review with @ndelangen this coming week. |
Thank you all for your hard work on this issue, this is currently impacting me. Hopefully a merge is around the corner! |
@jankoritak this PR I referenced got merged: #22186 Would you be able to apply the fixes from this PR on that part of the codebase as well? |
@ndelangen Sure, I'll look into it. Thanks for the update. |
@JReinhold or @valentinpalkovic Is either of you able to determine if this is still something we need going forwards? |
This Pr's fix seems reasonable. |
@jankoritak could you resolve the merge conflicts? |
Hey @ndelangen, will do. I forgot about this PR, my bad! |
); | ||
|
||
const files = await glob(fullGlob, commonGlobOptions(fullGlob)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we end up calling glob()
twice?
@ndelangen please take another look! |
@jankoritak I updated the branch, looks like CI found some problems, are you interested in fixing up this PR? |
@ndelangen I am. However, I'm swamped at the moment. Would you guys be open to waiting for a couple more weeks till I find time to fine-tune the PR? In case this is a no-go for you, lemme know. |
That's not a problem, as a heads-up to you: |
I think some merging has gone bad, as this now does |
Closes #21636
What I did
StoryIndexGenerator.ts
not to treatthis.options.workingDir
as a glob. This allows the absolute part of the path to contain special glob characters without breaking the match.How to test
Special (1)
) in your path that contains a repository with a storybook.next
branch.this
branch.Checklist
MIGRATION.MD
Maintainers
make sure to add the
ci:merged
orci:daily
GH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]