Closed rdmchr closed 2 years ago
@rdmchr Thank you for raising this. We're evaluating the best way to do it and have arrived at 2 options
ignore
key I personally have an inclination for the 2nd method since it avoids the need to explain an additional file ( .appwriteignore ). Secondly, Firebase uses a similar convention and many developers would be familiar with it.
Let me know your thoughts
Both options would work fine I think, but have you thought about adding an option to get the ignored files from the .gitignore file?
Both options would work fine I think, but have you thought about adding an option to get the ignored files from the .gitignore file?
We considered this option but didn't think it's intuitive enough for a developer to expect .gitignore
to affect your Appwrite deploy process. Have you seen this behaviour in some other tool? If yes, please link us so we can see how they communicate this information.
Sadly I have never seen this feature, but I thought it might be useful since most of the time the files you want git and Appwrite to ignore are the same.
I have just encountered this with the node_modules
folder for my function. This should be (for instance) excluded at all times, I guess?
I have just encountered this with the
node_modules
folder for my function. This should be (for instance) excluded at all times, I guess?
Adding node_modules folder server as a patch to their issue when builds worker cant see monorepos or private dependencies. It would also be hard to exactly specify ignored folders for every runtime, as in some of them, it's up to you to choose the name and there is one mainly used by the community. Doesn't mean it's always the one your project uses.
I agree that function starters should include ignore file (whichever we go with), and should ignore the dependencies folder by default.
We decided on the following setup:
In appwrite.json
, there will be ignore
array on every function. This fills automatically with the dependencies folder if you use Appwrite CLI to generate the function (using template).
You can set this attribute to null
(or remove it). If you do that, it will start using .gitignore
as a source of files and folders that needs to be ignored.
If you don't want anything ignored, and don't want to use .gitignore
, you can set the attribute to empty array []
.
@rdmchr can this be closed now?
You should be able to add a .appwriteignore file to each function directory to make sure that some files are not uploaded. Ideally, there should be some config option to use .gitignore instead of .appwriteignore to make it easier, since most of the time the files would be the same.