Git Product home page Git Product logo

Comments (11)

tunnckoCore avatar tunnckoCore commented on June 6, 2024

or say we have this one

var patterns = [
  'foo/**',               // include all filepaths (files and folders)
  '!foo/',                // we dont want `foo/` in the list
  '!foo/bar/',            // and also dont want `foo/bar/`
  '!foo/bar/*',           // we dont want all files
  'foo/bar/*.j*',         // except that are .js and .json
];

results

[charlike@localhost glob-fs]$ node playing.js multimatch
[ 'foo/bar.js',
  'foo/bar.md',
  'foo/bar.txt',
  'foo/bar.hbs',
  'foo/bar.json',
  'foo/bar.coffee',
  'foo/bar/bar.js',
  'foo/bar/bar.json' ] 8
[charlike@localhost glob-fs]$ node playing.js micromatch
[ 'foo/bar.js',
  'foo/bar.md',
  'foo/bar.txt',
  'foo/bar.hbs',
  'foo/bar.json',
  'foo/bar.coffee' ] 6
[charlike@localhost glob-fs]$

from micromatch.

jonschlinkert avatar jonschlinkert commented on June 6, 2024

note there foo/bar/bar.json missing

This is exactly what I was talking about with "re-inclusion" patterns. You said: micromatch/glob-fs#1 (comment).

Now you know what I mean? This isn't a bug, I did the PR to multimatch that allows it to re-include patterns like that, I can do the same here. IMO, this is the expected result since you are removing it from the set. But maybe it makes more sense to re-include.

talking about that, can you answer me why is needed to ignore negate glob if it is first in given patterns?!

I have no idea, I agree. it makes no sense

edit: actually, I think the reason they did that is because they didn't have the correct logic to do inclusion/exclusion patterns, like what was implemented in multimatch and globby

from micromatch.

jonschlinkert avatar jonschlinkert commented on June 6, 2024

Initially I was thinking maybe we should change to what multimatch does, but I'm not sure that's correct. You can get the exact result you want with foo/bar/*.j*, right? Why exclude everything first, then include that?

from micromatch.

jonschlinkert avatar jonschlinkert commented on June 6, 2024

also I'm almost ready to push up a first pass at glob-fs. I focused 100% on the correctness of resolving paths, so it's all sync atm. It will be easy to do async, promises, streams whatever once the basic path logic is down

from micromatch.

tunnckoCore avatar tunnckoCore commented on June 6, 2024

Hmm, right, clear. Yea, maybe make more sense to save this behaving and allow users to un-negate patterns in options, like not-documented ignore option.

You can get the exact result you want with foo/bar/.j, right?

Yep, but you know ... testing, complexity, possible use cases and etc.

also I'm almost ready to push up a first pass at glob-fs.

Great! From you sync, from me streams, haha. Almost pass all gulp/glob-stream tests. lol
Benchmarks shows x22,000 faster than glob-stream and its normal. :) glob-stream is slowest thing that I ever seen, srsly. And tools from this chain glob-stream -> vinyl-fs -> gulp, verb, template, assemble are very slow natively, because the glob-stream and glob + minimatch.

But yea, you know that - for this reason we work on micromatch/glob-fs :)

from micromatch.

tunnckoCore avatar tunnckoCore commented on June 6, 2024

actually, I think the reason they did that is because they didn't have the correct logic to do inclusion/exclusion patterns, like what was implemented in multimatch and globby

mm, yea and for this reason we'll never pass 90-100% of gulp/glob-stream/vinyl-fs tests and they are very very weird and low quality. They not deserves 100%-coverage-badge LOL

Cant wait for you first shot 🎉

from micromatch.

jonschlinkert avatar jonschlinkert commented on June 6, 2024

@tunnckoCore was this resolved?

from micromatch.

tunnckoCore avatar tunnckoCore commented on June 6, 2024

I'll look after 10-20mins

from micromatch.

jonschlinkert avatar jonschlinkert commented on June 6, 2024

no prob, I don't know how long I'll last anyway, trying to keep my eyes open!

from micromatch.

tunnckoCore avatar tunnckoCore commented on June 6, 2024

@jonschlinkert okey, we can close and wait your push.

from micromatch.

jonschlinkert avatar jonschlinkert commented on June 6, 2024

k thx

from micromatch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.