es128 / progeny

:baby: Recursively finds dependencies of style and template source files
MIT License
29 stars 15 forks source link

Add a default defaultSettings for other extensions #15

Closed diagramatics closed 8 years ago

diagramatics commented 8 years ago

I'm pretty sure this would benefit for custom implementations. Currently if you use a custom extension name for non-supported file types it'll throw a bunch of errors because you have to be super specific and fill in all the options.

es128 commented 8 years ago

Thanks for the PR. Can you show me an example of the type of utilization you're describing? I don't think I quite understand the use-case.

diagramatics commented 8 years ago

I'm trying to get the awesome HerringtonDarkholme/gulp-progeny package to use this package instead of reinventing the wheel with some new features lacking. One of the tests include having a custom filetype and configuration so I'm getting this package to be compatible with that feature.

For a more real life scenario, take this example. The package doesn't have support for ES6 import modules yet, but if somebody wants to bake their own implementation they will be able to do so by just filling in all the options that Progeny supports and leaving the rest as null. The latter is impossible right now because it'll throw errors on the missing configs since the default config is undefined.

es128 commented 8 years ago

Ok, I see what you're saying now. Users can pass a custom config, but if they don't define each key and are not using a pre-defined extension, then it throws somewhere in https://github.com/es128/progeny/blob/master/src/index.coffee#L159-L167.

Makes sense. Thanks!

es128 commented 8 years ago

Also, in case you're interested, reinventing the wheel over there was apparently a deliberate choice: https://github.com/HerringtonDarkholme/gulp-progeny/issues/3#issuecomment-55207332

diagramatics commented 8 years ago

Fortunately I'm welcomed to make a PR to use this package instead 😁 https://github.com/HerringtonDarkholme/gulp-progeny/issues/17