-
Notifications
You must be signed in to change notification settings - Fork 121
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 support for ignorefile when copying project #255
Conversation
@pelmered is there a reason you can't use the id: 1
name: my-app-name
ignore:
- my-folder |
Sorry, I missed this comment. That is the problem with that solution. It runs so late in the process. The files are first copied to the build directory and then they are deleted. This is very slow and inefficient. The files should not be copied in the first place. I also think what happens in In my case I also need the files to be removed before the build step because the domain tests are autoloaded but broken when the However, there are probably use cases where you want files deleted after the build step as well so that should probably still be possible in some way. You can of course do that as the last step of the build process if you need. Maybe the .vaporignore file should be skipped and everything should be configured in |
Thanks for the additional context @pelmered. I'm going to close the PR for now and add this to the backlog internally for the team to discuss further. We don't have plans for a v2 right now. |
Ok, too bad. It would be great if you at least could hook into |
This PR adds support for a
.vaporignore
file that lets you control what files are copied over to the.vapor
build folder.Background
I have a project with a DDD-structure as is pretty common with Laravel nowdays. We recently started to put test files inside each domain and that causes problems with the domian autoloader we have. It scans though the domain code and when i loads the test files we get an error that the
TestCase
file can't be found becuase the whole/test
directory is not copied to the.vapor
build folder.While this is a very specific problem that can be solved in other ways, I got the idea to make vapor support an ignore file that lets you control what files are copied over to the
.vapor
build folder.Why
Other considerations
Maybe the
.idea
and/tests
excludes inApplicationFiles
should be removed as well to let the user control this, but that would probably be considered a breaking change. We could add this as a default if no.vaporignore
file is found to keep the current behavior. Maybe the same could go for the other lines in there as well, such asfrankenphp
,rr
(roadrunner)TODO
Write documentation, and maybe provide an example file/stub that can be published. I can write this if this gets accepted.
I would also like to add some tests, but that would require
orchestral/testbench
to make a proper test setup with ignore file.This is what the
.vaporignore
looks like in our project: