Fork me on GitHub
#babashka
<
2023-01-27
>
teodorlu10:01:31

I reworked neil-quickadd. Ditched the shell history because it was full of false positives, and figured I'd rather add libraries usage in Clojure projects. And where do those come from? Cloned repositories! It's just files. (Unix is great! 😁) I think I'm onto something this time - it's feelig smooth to use. There's three commands: neil-quickadd scan, neil-quickadd libs and neil-quickadd neil-quickadd scan PATH recursively walks PATH for dependencies in deps.edn files. PATH defaults to .

$ neil-quickadd scan ~/dev/teodorlu
$ neil-quickadd scan ~/dev/babashka
After running these two commands, my index contains every dependency found in repos cloned from my user, or the babashka github organization. Then use neil-quickadd libs to list the index, or neil-quickadd to select a dep with fzf (by shelling out), then adding the dep with neil dep add. To install: 1. Install Neil: https://github.com/babashka/neil 2. Install fzf: https://github.com/junegunn/fzf 3. Install bbin: https://github.com/babashka/bbin 4. Install neil-quickadd with bbin:
$ bbin install io.github.teodorlu/neil-quickadd --latest-sha
Please give it a try -- feedback is very much welcome! And a big thanks to @borkdude and @rads - without their work, neil-quickadd wouldn't exist. https://github.com/teodorlu/neil-quickadd/

🎉 10
elken11:01:05

That reminds me; I've tried to use bbin to install jet and I get the below

borkdude11:01:53

jet isn't a babashka script. bbin is for installing babashka scripts

elken11:01:07

Ah so I'm just dumb thanks xD

borkdude11:01:31

co-incidentally, I'm working on jet right now :)

elken11:01:16

Anything you'd like to share with the class? 👀

borkdude11:01:15

not really, but if you have any last-minute wishes... ;)

emilaasa15:01:28

I used bb tasks as a task runner for a recent small project at work and I really enjoyed it! Works wonders!

❤️ 2
☝️ 2
borkdude15:01:45

Thanks for sharing, always good to hear :)

emilaasa15:01:34

Can I read more about how :depends work somewhere? I looked at https://book.babashka.org/#_dependencies_between_tasks - and also it works pretty well for me. I'm just curious what's happening there

borkdude15:01:24

You mean how it is implemented or how to use it?

emilaasa15:01:32

How it's implemented

borkdude15:01:42

The source code :)

Eugen16:01:00

hi, any idea how we can have interactive mode in Babashka repl ? https://github.com/lispyclouds/bblgum/issues/1 or even clojure repl?

borkdude16:01:51

It worked for me in the rlwrap bb repl

borkdude16:01:23

So when you invoke this from a terminal it should work, what else do you expect?

lispyclouds18:01:02

yeah like i mentioned in the linked issue, this is the lib not working in the editor repls like cider, conjure, calva etc as they are not TTYs. it is expected. this is also now noted as a https://github.com/lispyclouds/bblgum#caveats

lispyclouds18:01:33

@U011NGC5FFY maybe this could be a better question for #C03S1KBA2 in general, how would people handle tty things in their editor repls?

Eugen05:01:20

I was thinking that maybe starting a new process from the repl might work ?!

Eugen05:01:03

at least in this specifc case = testing bblgum

lispyclouds06:01:39

The problem is the the way editor repls redender things vs the terminal. TUI things like gum would talk in a particular protocol and expect the thing to render it that way. Terminals do this and unless the editor repl implements this tty protocol it won’t work. It’s the way for example vim draws itself on the terminal screen.

lispyclouds06:01:43

And a new process is getting started every time you run a gum function, as long as the viewing thing can’t handle the protocol, can’t do much

Eugen06:01:06

now I get the issue 🙂 thanks

lispyclouds06:01:50

You can use the vscodes terminal as a half way solution 😃

lispyclouds06:01:29

At least that keeps you from switching away from your editor

Eugen06:01:26

thanks. Will ask on #C03S1KBA2 to see if there are some ideas.

Ivan Fedorov20:01:40

Hey! I’m sure there’s a bb script that produces a github workflow file, that is also aware of shadow-cljs.edn deps, but I can’t find it.

borkdude21:01:39

Do you mean in relation to neil or so? There was a discussion about that here: https://github.com/babashka/neil/discussions/60

Ivan Fedorov21:01:14

hmm, I just need to update a github workflow file with the package version taken from shadow-cljs.edn build script checks out around 10 private repos with github checkout action like:

- name: Checkout company/dep-name
        uses: actions/checkout@v3
        with:
          repository: company/dep-name
          ref: v0.10.1
          path: dep-name
          fetch-depth: 0
Then we release an update to some dependency, and update its version inside shadow-cljs.edn. And then we have to manually update the github workflow file. But it can be done with a babashka script.

Ivan Fedorov21:01:35

A pointer to any simple templater project on babashka would be great

borkdude21:01:05

Do you mean a project which edits a .yaml file?

borkdude21:01:13

Babashka itself generates its yaml build files (circleci) from .edn files

borkdude21:01:28

Another way is to make a .template.yml file and then replace the version in the template, e.g. {{version}} and then write the .yml file

Ivan Fedorov21:01:18

cool, thanks! yeah, I think the template would be the easiest for us.