babashka / neil

A CLI to add common aliases and features to deps.edn-based projects
MIT License
377 stars 27 forks source link

Remove generated `neil` code from Git repo #70

Closed rads closed 2 years ago

rads commented 2 years ago

See here: https://github.com/babashka/neil/pull/67#issuecomment-1203663690

borkdude commented 2 years ago

One thing to keep in mind is that installers mentioned in the README should also be migrated to the new location.

borkdude commented 2 years ago

Hmm, I think all packages rely on the script being in the root so maybe it's not a good idea to change this...

rads commented 2 years ago

@borkdude:

Hmm, I think all packages rely on the script being in the root so maybe it's not a good idea to change this...

One option would be to have a GitHub Action on main that would run bb gen-script && git add -f neil on a separate branch, such as release.

This means we could commit to main without the script, but we would have to create tags off of the release branch. I don't think this would require any changes to the packages since they would still use the same tag-based URL.

What do you think about this?

borkdude commented 2 years ago

That's an interesting approach! I'd be open to that. I think what should also happen is a check that checks if the generated script still runs before we release.

rads commented 2 years ago

Cool, I can start looking into this.

borkdude commented 2 years ago

@rads I might have a slightly better idea. The neil script can simply be (babashka.deps/add-deps {:deps {org.babashka/neil {:git/url "..." :git/tag "..." :git/sha "..."}}) and then we can periodically update it.

rads commented 2 years ago

@borkdude: I was originally thinking this might be a drawback because the neil script would incur additional startup time after the brew install. However, now I realize that we are already calling babashka.deps/add-deps in prelude so we are fetching network dependencies on the first run anyways. With that in mind, I think using a simple shim like you're suggesting is a good solution.

borkdude commented 2 years ago

Yes, exactly. It doesn't matter that much. We could move the whole prelude to the neil script so we have only one add-deps call instead of two then.

borkdude commented 2 years ago

Hm, o no wait, we could get rid of the prelude thing I think, since the deps would be in deps.edn already in the project.