bash-it icon indicating copy to clipboard operation
bash-it copied to clipboard

Moving external libraries into the vendor folder introduced in #1776

Open buhl opened this issue 5 years ago • 14 comments

#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):

  • [x] lib/composure.bash
  • [x] completion/available/apm.completion.bash
  • [ ] completion/available/bundler.completion.bash https://github.com/mernen/completion-ruby also has other ruby completion not in this list
  • [x] completion/available/defaults.completion.bash ? (no repo to be seen)
  • [x] completion/available/django.completion.bash https://github.com/django/django/tree/master/extras We have to add the complete django source code to vendor this completion script.
  • [ ] completion/available/docker-compose.completion.bash https://github.com/Yelp/docker-compose/tree/master/contrib/completion/bash ditto docker-compose
  • [ ] completion/available/fabric.completion.bash
  • [ ] completion/available/git_flow.completion.bash
  • [ ] completion/available/git_flow_avh.completion.bash
  • [ ] completion/available/gradle.completion.bash
  • [ ] completion/available/grunt.completion.bash
  • [ ] completion/available/gulp.completion.bash
  • [ ] completion/available/hub.completion.bash
  • [ ] completion/available/invoke.completion.bash
  • [x] completion/available/jboss7.completion.bash
  • [ ] completion/available/knife.completion.bash
  • [ ] completion/available/salt.completion.bash
  • [x] completion/available/svn.completion.bash
  • [ ] completion/available/vagrant.completion.bash

buhl avatar Jan 27 '21 21:01 buhl

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:

NoahGorny avatar Jan 27 '21 21:01 NoahGorny

@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.

cornfeedhobo avatar Jan 28 '21 13:01 cornfeedhobo

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?

buhl avatar Jan 29 '21 12:01 buhl

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

NoahGorny avatar Jan 29 '21 14:01 NoahGorny

Seconded. That feels more discoverable and intuitive.

cornfeedhobo avatar Jan 29 '21 14:01 cornfeedhobo

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?

buhl avatar Feb 07 '21 20:02 buhl

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

NoahGorny avatar Feb 08 '21 08:02 NoahGorny

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 avatar Feb 08 '21 15:02 buhl

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.

buhl avatar Feb 09 '21 08:02 buhl

What happens when you amend it?

NoahGorny avatar Feb 09 '21 08:02 NoahGorny

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

buhl avatar Feb 09 '21 10:02 buhl

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?

gaelicWizard avatar Aug 12 '21 22:08 gaelicWizard

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

NoahGorny avatar Aug 14 '21 07:08 NoahGorny

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

gaelicWizard avatar Jan 13 '22 06:01 gaelicWizard