Bash-it / bash-it

A community Bash framework.
MIT License
14.28k stars 2.29k forks source link

Moving external libraries into the vendor folder introduced in #1776 #1818

Open buhl opened 3 years ago

buhl commented 3 years ago

1776 introduces a new way to include and load external libraries.

This issues will keep track of the process of moving existing external libraries into the vendor folder. The following candidates are (please add others via comments):

NoahGorny commented 3 years ago

Wow @buhl, I was just going to open this kind of issue right now. Well done!

I will add other external stuff via editing your comment :smile:

cornfeedhobo commented 3 years ago

@buhl I'll reach out to Johnathan about the defaults plugin and see what he says. The place he used to host it isn't available anymore, and there is a bug anyways.

buhl commented 3 years ago

Question about the completion libraries. Lets take apm for instance. Should I vendor in the library and source it from completion/available/apm.completion.bash instead of vendor/init.d/apm.completion.bash?

NoahGorny commented 3 years ago

Question about the completion libraries. Lets take apm for instance. Should I vendor in the library and source it from completion/available/apm.completion.bash instead of vendor/init.d/apm.completion.bash?

I think it is the right solution

cornfeedhobo commented 3 years ago

Seconded. That feels more discoverable and intuitive.

buhl commented 3 years ago

I think we need to come up with a way to handle completions that are nested inside a projects source code. I was thinking something like a separate repository maintained by bash-it with a script to check for updates?

NoahGorny commented 3 years ago

I think we need to come up with a way to handle completions that are nested inside a projects source code. I was thinking something like a separate repository maintained by bash-it with a script to check for updates?

How about deleting all unneeded files and squashing the change into the vendoring commit? Should work okay

buhl commented 3 years ago

Could kind of work. git vendor makes the commit so I would have to delete the files and then git commit --amend. I can give it a try with django.

buhl commented 3 years ago

So this is more difficult than I first thought. git vendor makes dangling squashed commit and a simple merge commit. It is not trivial to rewrite the squashed commit.

NoahGorny commented 3 years ago

What happens when you amend it?

buhl commented 3 years ago

So I did it in #1836 and described the steps needed. It's not pretty though :)

gaelicWizard commented 3 years ago

For the completions that are part of the upstream project repo, shouldn't we just use a loader to locate and import the as-installed completion script? E.g., Subversion from Homebrew includes /usr/local/etc/bash_completion.d/subversion, so we should source that rather than copying our own, no? Are there linux distributions which exclude these things from their packages?

NoahGorny commented 3 years ago

You are indeed correct @gaelicWizard We should prefer local installations- see #1635 for reference, and if we can use tools to complete themselves its even better.

I will accept those kind of solutions as well as vendoring ones

gaelicWizard commented 2 years ago

completion/defaults has been vendor'd out, and completion/svn has been removed (with a best-effort placeholder).