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

Core: Fix issue with recursive glob with prior special chars #17252

Merged
merged 1 commit into from Jan 17, 2022

Conversation

tmeasday
Copy link
Member

@tmeasday tmeasday commented Jan 17, 2022

Issue: #17038, #16964, #16924

In all three cases the issue is special glob patterns before the ** in the glob.

In 6.4, we incorrectly changed the condition for a recursive look up to be the files glob had to start with **, which is broken in the above cases.

What I did

This goes back to the old condition (recursive if the glob contains '**' or '/' -- I suspect just the latter would be enough). Plus add a fix for our normalisation of directory names when they are just '..' or '.'

How to test

See tests. You can also create a reproduction SB with one of the following stories fields:

module.exports = {
  stories: [
    
    // https://github.com/storybookjs/storybook/issues/17038
    // '../sr*/**/*.stories.@(js|jsx|ts|tsx)',

    // https://github.com/storybookjs/storybook/issues/16964
    // '../!(foo)/**/*.stories.@(js|jsx|ts|tsx)',

    // https://github.com/storybookjs/storybook/issues/16924
    '../{src,random}/**/*.stories.@(js|jsx|ts|tsx)',
  ],

@nx-cloud
Copy link

nx-cloud bot commented Jan 17, 2022

☁️ Nx Cloud Report

CI ran the following commands for commit b1e0534. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@tmeasday tmeasday requested a review from shilman January 17, 2022 05:36
@tmeasday tmeasday added bug core patch:yes Bugfix & documentation PR that need to be picked to main branch labels Jan 17, 2022
@shilman shilman changed the title Fix issue with recursive glob with prior special chars Core: Fix issue with recursive glob with prior special chars Jan 17, 2022
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 💯

@shilman shilman merged commit 2f83d1b into next Jan 17, 2022
@shilman shilman deleted the 17038-16964-16924-fix-complex-globs branch January 17, 2022 08:54
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jan 20, 2022
shilman added a commit that referenced this pull request Jan 20, 2022
…lex-globs

Core: Fix issue with recursive glob with prior special chars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug core patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants