-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
Add ability to exclude files and entire folders from built application #165
Conversation
I understand why you want this, and i understand the complexity of what you want to achieve. |
I'm not clear how a package that removes unnecessary composer dependencies would be useful to exclude specific, unrelated files and folders in a PHP project. Can you explain your thought process? |
I was thinking you wanted to reduce (as for nativephp exclusiv) the generated build file size. For example when they build it in laravel 5X but i want to check it out on v10, and i only want "the stuff" that is used. |
No this PR is about removing files like file-caches or files where you store data and need them to be removed for a clean build of the app. |
|
||
private function delete_directory_recursive($dir) | ||
{ | ||
if (! file_exists($dir)) { |
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.
space
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.
I'm not sure I'm clear on what you mean by "space". Can you please elaborate?
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.
I agree that clean code is the goal but I don't agree that removing the space makes it easier to read. In fact, (and this is strictly my own personal opinion) I believe that the space makes it more readable as it's easy to see that there are two characters "(!" indicating something weird is about to happen, separated by a space, and then the variable name that the weirdness is about to apply to, making it easy for someone reading the code to quickly see that the expression is being negated.
If Marcel is against this, I'll revert it, but for now, I'm going to leave it.
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.
For reference, it's being applied via the not_operator_with_successor_space
PHP-CS-Fixer rule and also referenced in Spatie's Laravel code style guide
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.
I apologize! Thank you for your explain, It is my mistake!
Awesome, thank you for this! |
As it stands right now, the
native:build
command takes your entire project folder and builds the application with it.This may not be desirable as certain files may be unnecessary for the app to run, or may unintentionally leak sensitive information by being included.
This PR allows for the blocking of individual files, folders, glob patterns, or wildcards (a user can mix and match) that they do not want being packaged.
I realize the tests are probably overly verbose but I couldn't think of a better way to generalize them. Happy to refactor them if anyone can give me any pointers on a good way to do that.