-
Notifications
You must be signed in to change notification settings - Fork 773
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
Depreciate regular expressions for copy's filter #239
Comments
What if the RegExp's were deprecated and you just passed a function |
FYI, functions are supported now. |
They are supported but they don't know the base path. A deprecation might |
@jprichardson ping? |
I'd prefer only functions, but I'm afraid that it'll break a lot of code. Long-term, this should use file glob patterns with another module like Thoughts? |
@jprichardson Migration from regexes is simple:
Edit: Incorrect, you will lose the
If you want to depreciate, go ahead. |
Regular Expression filters in ncp.js:38 are run against the full source path, i.e.:
/Users/martin/Private/projects/nodeschool/git-it-electron/node_modules/eslint/node_modules/uglify-js/node_modules/source-map/lib/util.js
If I want in the folder
git-it-electron
to exclude theeslint
folder I need to know that I am in the/Users/martin/Private/projects/nodeschool/git-it-electron
folder when I do that. If I test for/eslint/
then It would exclude the folder properly but If by some accident I would put the project in a folder called:/Users/eslint/Private/projects/nodeschool/git-it-electron
It would ignore all of the files in my project 😢 . This means that someone would need to implement the file matching with that in mind. Given that
ncp.js
already considers the working directory I think it would be specially awesome ifA. there would be the opportunity to have filters that work relatively to the working directory
B. there would be the opportunity to specify where the working directory is (overriding the good
process.cwd()
default)Additionally it would be super awesome if the filter would allow glob file patterns instead of regexp patterns because they are made for files.
Note: I am thinking about the API a little and think it would be good to have an
include
andexclude
option instead of filters. (Considering #65)The text was updated successfully, but these errors were encountered: