This repository has been archived by the owner on Oct 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Improve defaultFilter
#226
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic in lines
15
and16
is kept the same as the original.However, the original had a bug it seemed, since
filename
cannot start with/
.I am not 100% what the intent is here. My guess is:
node_modules
.well-known
__MACOSX
I am not quite sure how the recursion applies. For example, if
node_modules
is excluded, does this function gets called withnode_modules/example-module/
? Depending on the answer to this question, the test would be different.We might also consider using
junk
.@erezrokah What are your thoughts on all this?
It'd be nice to improve this, but I don't want to break anything either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See relevant CLI PR netlify/cli#1272 and the logic the
js-client
is trying to mimic:https://github.com/netlify/open-api/blob/e72e2eb2d7eedf02bccc5916fc0330022f7f823b/go/porcelain/deploy.go#L692
An important distinction is when the publish directory is hidden netlify/cli#1227 (comment)
I think once a directory is excluded, so does its nested directories:
https://github.com/okdistribute/folder-walker/blob/9c3b07320e152def5c3cbc26c772ebebc6d5c124/index.js#L44
You're correct with the intent and the changes you made makes sense.
Not sure if we want to improve the fix from the CLI as a breaking change. The CLI has some special handling when deploying the root directory as described in the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a breaking change that we might want to hold on for the moment, especially before the holidays.
The initial intent was to improve the coding style, so let's merge this PR with no change of behavior, even if the code is somewhat nonsensical (since it replicates the original code), then follow-up with another PR for the behavior part.