Skip to content
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 .eggignore file and allow users to chose between the ignore file or the files field in egg.json #3

Closed
martonlederer opened this issue Jun 18, 2020 · 8 comments · Fixed by #30

Comments

@martonlederer
Copy link
Member

Is your feature request related to a problem? If so, please describe.
Right now the nest.land CLI publishes only the files given in the files field, in egg.json. Sometimes people have a lot of files imported from various directories and it's hard to keep track of all of them.

Also if you create a new file it is extra time to add it to the files field.

Describe the solution you'd like
The best solution would be to let the users choose between the files field or a .eggignore file. If the .eggignore file extists, the cli uses it instead of the files field.

Describe alternatives you've considered
An alternative already exists, using *

I will start working on this issue and create a pull request, please comment anything regarding the topic
@martonlederer martonlederer changed the title [FEATURE] Add .eggignore file and allow users to chose between the ignore file or the files field in egg.json [FEATURE] Add .eggignore file and allow users to chose between the ignore file or the files field in egg.json Jun 18, 2020
@justablob
Copy link

We considered this before releasing, but decided against an .eggignore file in favor of the more explicit files field. We considered the case that a developer might forget to ignore a new file, and if that file is supposed to not be published, like a .env file, it could cause more damage to publish that one file than to see you forgot to add a file, add it real quick and publish again. If you want to, feel free to add a .gitignore-like file, but please make it work alongside the current files field, if that's okay for you. If you really wanna go ignore-based, you can just add a **/* glob, as you said already.

@martonlederer
Copy link
Member Author

Yes I will make sure to make it work alongside the files field. As I mentioned, it will be optional, so eggs will use the files field by default, and will only use the ignore file, if it exists and has content

@zorbyte
Copy link
Contributor

zorbyte commented Jun 19, 2020

I propose we set it as optional. Instead set it up to use the files field and if there is no files field then look for a .eggignore. In addition, the eggignore should be applied on top of the files field if present. In the case neither are present, then do not upload any files.

@maximousblk
Copy link
Member

how about just use the .gitignore file but there will be a commented section under which the files for eggs will be listed?

example:

.idea
.env
*.log

# /*eggignore

# docs
# examples

# */eggignore

@t8
Copy link
Member

t8 commented Jun 19, 2020

@maximousblk Thanks for the idea! Although, I will say that we're working towards staying away from relying on any sort of source control so that we don't limit the scope of the registry.

@jsejcksn
Copy link

It would be nice to provide or link to a utility for generating the files array from the package directory. I think the main chore here is having to manually create the list. +1 for the util supporting a filter file like .gitignore

@t8
Copy link
Member

t8 commented Jun 30, 2020

@jsejcksn I completely agree. Adding some "intelligence" to this feature would greatly improve UX. We'll certainly consider implementing this in a future release. Thanks for bringing this up!

@notfilippo notfilippo transferred this issue from nestdotland/nest.land Jul 10, 2020
@t8 t8 linked a pull request Jul 17, 2020 that will close this issue
@zorbyte zorbyte changed the title [FEATURE] Add .eggignore file and allow users to chose between the ignore file or the files field in egg.json Add .eggignore file and allow users to chose between the ignore file or the files field in egg.json Jul 19, 2020
@t8
Copy link
Member

t8 commented Jul 19, 2020

Closing now, as this has already been implemented and merged into dev.

@t8 t8 closed this as completed Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants