babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
borkdude 2021-04-30T10:17:30.305Z

babashka 0.3.7 Issues resolved: https://github.com/babashka/babashka/blob/master/CHANGELOG.md#037 Task changes/improvements: https://github.com/babashka/babashka/issues/778

🙌 3
borkdude 2021-04-30T13:17:10.308200Z

Most notable task changes: - Tasks now have :enter and :leave hook which can be set globally under :tasks and can be overridden per task - New current-task function which contains :name of the task and all of the other data of the task map from the bb.edn file - The above two things together can be used to log task names (at the start and/or end of a task) - New run function: (run 'my-task {:parallel true}) to invoke other tasks in serial, force parallel, do whatever you want.

🎉 2
borkdude 2021-04-30T13:39:10.309100Z

I already kinda regret the run name, maybe I should have chosen run-task to not confuse it with run!?

borkdude 2021-04-30T13:39:30.309500Z

Anyway, naming is hard.

☝️ 3
borkdude 2021-04-30T13:43:38.309900Z

Maybe a nice naming convention:

clean+dev (do (run 'clean)
              (run 'dev))
bb clean+dev

dharrigan 2021-04-30T13:47:14.310400Z

it's not too late to change it 🙂

dharrigan 2021-04-30T13:48:07.311400Z

Nothing is set in stone, esp with software 😉 You could accrete it, and notify deprecate the run name, then in a few releases, remove it completely.

borkdude 2021-04-30T13:48:24.311800Z

Well, I chose it like this since the bb run subcommand is also called like this and this function accepts the same opts

borkdude 2021-04-30T13:49:17.312600Z

But like with all names, I fret about those for weeks, change them, and sometimes and up reverting them to go back to the same name, so I take my regret with a grain of salt and I will listen to the feedback of users as well

borkdude 2021-04-30T13:50:23.313200Z

Anyway, (shell "bb run --parallel ...") is now a thing of the past:

-dev {:depends [dev-cljs dev-less]}
         dev {:doc "Run app in dev mode, watch CLJS and LESS files for changes"
              :task (run '-dev {:parallel true})}

wilkerlucio 2021-04-30T14:38:46.313300Z

I think the run name is fine, there is the clojure run!, but in the babashka tasks context I think run makes sense

borkdude 2021-04-30T14:39:46.313500Z

Thanks :)

bherrmann 2021-04-30T17:50:49.314400Z

There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors. -- Leon Bambrick

borkdude 2021-04-30T19:01:01.315100Z

Small demo of how you can use :enter and :leave to print task names while they progress: https://github.com/clj-kondo/clj-kondo.lsp/blob/e906d4fc64f070311644529430b035bf9cbb7a0d/bb.edn#L7-L12

👍 1
❤️ 1