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

globs with multiple expanded parts broken in 3.2.0 #257

Closed
devongovett opened this issue Feb 20, 2020 · 6 comments
Closed

globs with multiple expanded parts broken in 3.2.0 #257

devongovett opened this issue Feb 20, 2020 · 6 comments
Assignees
Milestone

Comments

@devongovett
Copy link

Environment

  • OS Version: macOS 10.12
  • Node.js Version: 12

Actual Behavior

Patterns with multiple glob parts that are broken now.

fast-glob@3.2.0:

require('fast-glob').sync('packages/@react-spectrum/*/docs/*.mdx')
[]

Expected Behavior

fast-glob@3.1.1:

require('fast-glob').sync('packages/@react-spectrum/*/docs/*.mdx')
[
  '/Users/govett/dev/react-spectrum/packages/@react-spectrum/button/docs/Button.mdx',
  '/Users/govett/dev/react-spectrum/packages/@react-spectrum/radio/docs/Radio.mdx',
  '/Users/govett/dev/react-spectrum/packages/@react-spectrum/textfield/docs/TextArea.mdx',
  '/Users/govett/dev/react-spectrum/packages/@react-spectrum/textfield/docs/TextField.mdx'
]
@mrmlnc
Copy link
Owner

mrmlnc commented Feb 20, 2020

Just checked the latest version on Windows 10 and WSL (Ubuntu).

Unfortunately, I cannot reproduce your problem. Any additional steps/suggestions? Maybe you have a repository?

packages/
└── @react-spectrum
    ├── button
    │   └── docs
    │       └── test.mdx
    └── radio
        └── docs
            └── test.mdx
const fg = require('.');

const entries = fg.sync('packages/@react-spectrum/*/docs/*.mdx');
// + absolute, cwd

console.dir(entries, { colors: true });
[
  'packages/@react-spectrum/button/docs/test.mdx',
  'packages/@react-spectrum/radio/docs/test.mdx'
]

@milesj
Copy link

milesj commented Feb 21, 2020

I may be having a similar problem? Updated to 3.2.1 and this now fails and returns no results:

fg.sync([`./packages/*/package.json`], {
  absolute: true,
  cwd: '~/repos/nimbus', // is absolute in code
});

Edit: If I remove the leading ./ it works.

@mrmlnc
Copy link
Owner

mrmlnc commented Feb 21, 2020

Thanks, @milesj! I'll check it today.

@mrmlnc
Copy link
Owner

mrmlnc commented Feb 21, 2020

Confirm. The pattern with leading dot works incorrectly for deep reading. I'll fix it today.

@mrmlnc
Copy link
Owner

mrmlnc commented Feb 21, 2020

I'm published a release (3.2.2) addressed to this issue. If you have any problems, please create a separated issue.

Thanks for the feedback 🎉

@mrmlnc mrmlnc closed this as completed Feb 21, 2020
@mrmlnc mrmlnc added this to the 3.2.2 milestone Feb 21, 2020
@ondratra
Copy link

Is this issue really fixed in 3.2.2? I have upgraded from some older version of fast-glob to 3.2.2 but group expansion is broken (somaPath/(option1|option2)/*.extension finds nothing even when somaPath/option1/*.extension finds some files)

@mrmlnc
Copy link
Owner

mrmlnc commented Feb 27, 2020

@ondratra, please create a separated issue with steps hot to I can reproduce your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants