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

fs.DuplexCollection byGlob returns wrong result #363

Open
1 task done
ilhan007 opened this issue Nov 21, 2019 · 1 comment · May be fixed by SAP/ui5-fs#193
Open
1 task done

fs.DuplexCollection byGlob returns wrong result #363

ilhan007 opened this issue Nov 21, 2019 · 1 comment · May be fixed by SAP/ui5-fs#193
Assignees
Labels
bug Something isn't working module/ui5-builder Related to the UI5 Builder module

Comments

@ilhan007
Copy link
Member

Hello guys,
I created a small sample, using the ui5-tooling with simple configuration and custom task.
I tried to exclude all files from processing, except for two types of files (.lit.js and .hbs), look at the ui5.yaml.
But, this seems to cause an issue in my custom task, when I try to execute
workspace.byGlob("/resources/*.hbs") - it matches not only .hbs files, but the .lit.js files as well.

Expected Behavior

workspace.byGlob("/resources/*.hbs") to match .hbs files only.

Current Behavior

workspace.byGlob("/resources/*.hbs") matches not just .hbs files, but .lit.js as well.

Steps to reproduce the issue

  1. Clone repository https://github.com/ilhan007/ui5-tooling-customtask-sample
  2. Run npm install in the root
  3. Run npm run build
  4. Explore the build log - the result from workspace.byGlob("/resources/*.hbs") is logged and you can see that it finds not just .hbs files. Or, You can add debugger in the task at this line:https://github.com/ilhan007/ui5-tooling-customtask-sample/blob/master/lib/task.js#L5

Context

  • UI5 Module Version (output of ui5 --version when using the CLI): 1.12.1
  • Node.js Version: 12.13.0
  • npm Version: 6.12
  • OS/Platform: macOS 10.15 Catalina

Affected components (if known)

@RandomByte RandomByte self-assigned this Nov 22, 2019
RandomByte referenced this issue in SAP/ui5-fs Nov 22, 2019
…e result set themselves

The current handling of glob exclude patterns may lead to resources
being added to a result set even though they do not match the provided
glob patterns. This can happen if a negated exclude pattern is provided.

Resolves https://github.com/SAP/ui5-builder/issues/367
@RandomByte
Copy link
Member

Thanks for reporting! I looked into this and created SAP/ui5-fs#193 with a possible implementation to resolve this. However, this depends on the implementation of a change in the upstream fast-glob library: mrmlnc/fast-glob#86

Until then, every resource you re-include in your exclude patterns gets added to the result set, even if your actual glob pattern does not match it.

@RandomByte RandomByte transferred this issue from SAP/ui5-builder Nov 20, 2020
@RandomByte RandomByte added bug Something isn't working module/ui5-builder Related to the UI5 Builder module labels Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module/ui5-builder Related to the UI5 Builder module
Projects
None yet
2 participants