A babashka tasks porcelain inside emacs
external deps and internal emacs tools used
for parsing the bb.edn, deps.edn file
seems like a decent way to find the bb.end/deps.edn - look in the project root
we'll also likely want to fire commands from there
Need to decide what mode the tasks buffers should run in
notes linked from emacs run-command's readme:
suggested (better?) alternative: term-mode + compilation-minor-mode
Built on a UI lib called transient
magit github: https://github.com/magit/magit
magit visual intro: https://emacsair.me/2017/09/01/magit-walk-through/
taskrunner
https://docs.doomemacs.org/latest/modules/tools/taskrunner/ Doom has a :taskrunner module, but it is deprecated: the docs say it is too trivial, _and_ that upstream taskrunner development has stopped. Could this be extended to support babashka?
run-command
great readme to read through. notes on compilation mode: https://massimilianomirra.com/notes/lightweight-external-command-integration-in-emacs-via-compilation-mode/
parses tasks lines from `bb tasks` command, then runs it via `bb <it>`
parses deps.edn, runs aliases
has some interesting deps, including one `parseedn` require
This thing is <500 lines and really quite clean! I learned some more emacs primitives in the close read.
One critique is that the mode the command runs in should probably be overwritable per command - i'm not sure why it's not, probably just no one has hit that use-case.
The term/vterm stuff requires a bit of logic to support killing running processes and re-running them - i suppose compiliation mode does that automatically?
I think for v1 fabb i wouldn't support helm at all - maybe we can later, but completing-read and ivy feels like enough.
I also think going harder into the helper functions would be a win. run-command has high utility if you're aware of the compilation-mode commands (for killing and re-running, etc), but fabb could provide a better namespace and more explicit features for re-running commands (through fabb-status, the minor modes, and the magit/transient style interface).
similar to the ink-mode contribution i made, it'll be providing the
replay/replay-with-edited-command in the 'process' buffers, or anywhere else in
the project (fabb status, or maybe a keybinding to popup a lighter-weight status
buffer/hydra/transient of some sort)
The magit-style interface. This could make the most sense, as it provides configuration for toggling options/switches on babashka tasks - though configuring switches/options would require some extra bb.edn task details to be provided or otherwise somehow inferred.
Following the magit-transient docs trail: https://magit.vc/manual/magit/Transient-Commands.html#Transient-Commands
Y'all know I love me some hydra! Hydra are fast and flexible, and easily expressed and maintained.
Might be simple enough, and familiar enough to folks. Emacs taskrunner has helm and ivy consumers.
The magit readme says only magit and git itself deserver to be called porcelains.
Where did this come from? Does it mean it covers the surface of it?
configuring switches/options (through a magit/transient-style ui)
would require some extra bb.edn task details to be provided or otherwise somehow
inferred
right now, babashka tasks don't offer a 'help' that
lists out the way the commands are used, what the
*command-line-args*
are, anything like that.
magit actually lets you edit the options that show up per popup: https://magit.vc/manual/magit-popup/Customizing-Existing-Popups.html So maybe there's some middle-ground for specifying options to bb tasks...
*fabb-status*
bufferIt seems reasonable to offer a
*fabb-status*
buffer that contains a list of the current
and previous task runs.
Magit has a process buffer for running git commands,
which can be seen with
$
. There are
some hints for always displaying it:
https://github.com/magit/magit/wiki/Tips-and-Tricks#automatically-displaying-the-process-buffer
Fabb's use-case is slightly different, in that I'd expect to run multiple of these tasks at a time.
*fabb-process*
buffers (more likely named with the
command and maybe the directory)edit it before it fires
Personally, i'd love to be able to optionally run bb-tasks via tmux - this would be an extra arm of the fabb code to maintain, but could be an opt-in via the interface when running/re-running a task.
Would be cool to show some details/number of running tasks, etc in the modeline
rschmukler 's helper for processing a changelog, git-tagging, pushing, etc., whenever a library is ready to release a new version.
I typically run tasks like `doctor-fe`, `doctor-be`, `styles-watch` when deving against clawe/doctor.
It'd be nice to run those via `fabb`, monitor them via fabb-status
bb.edns can be specified when running `bb`, which means we could support running
bb-tasks from misc other places, if we knew about those other bb.edns
we'd also have to specify the working directory of those places
My most common python backend style is a test runners like pytest wrapped in watchmedo, and taking a match-pattern for which test to run against.
I clean up the noise into a `bb test-match
<some-pattern>` usage - getting a shared output or
history (likely just the
*fabb-status*
) for commands like these would be
excellent.
run-command supports this
should be able to c-x c-e (evaluate) bb task code in a bb.edn with fabb
or something close to that
i.e. make not-leaving-emacs to write-and-fire bb.tasks a thing
via transient/hydra?
Welcome to the Clawe garden doc! This file is for thinking and organizing the work on the clawe repo.
Clawe lets you use clojure and babashka to write wm-level keybindings and manage apps and workspaces.