Looking for a bit of advice / what other people are doing.
I have some code I'd like to use both from my JVM REPL and from Babashka tasks. Where would you put that code, and where would you put its dependencies?
• All "dev help code" in dev/, then put "dev" on :paths both in deps.edn and bb.edn?
• What about dependencies for the code? Dependencies both in bb.edn and the :dev alias in deps.edn?
I'm aiming to write as much as possible of the dev/ code compatible with both Babashka and JVM Clojure.
I usually call dev bb or .bb or .build but I think dev is fine too :) About sharing deps, you could use an extra deps edn with local root for this too
> About sharing deps, you could use an extra deps edn with local root for this too
Care to elaborate a bit here? Not sure I'm following — there's probably something I don't know how to do.
My understanding is that if I add :local/root "." to my bb.edn, that only picks up the "root" dependencies from deps.edn. Do you mean having a different deps.edn file that just contains the dev/babashka deps?
I think I might have the idea —
;; devdeps/deps.edn
{:deps {#_"shared dev dependencies"}}
;; deps.edn
{:aliases {:dev {:extra-deps {blabla {:local/root "devdeps"}}}}}
;; bb.edn
{:deps {blabla {:local/root "devdeps"}}}
Is this what you had in mind?yes
another possibility is to re-use the root deps.edn and do this:
(babashka.deps/add-deps (clojure.edn/read-string (slurp "deps.edn")) {:aliases [:dev]})Oooh, that's nice, I like not having to create extra folders just to share deps. Thanks again! ❤️
https://clojurians.slack.com/archives/C015AL9QYH1/p1754427915191899
Awesome, another milestone in bb history! :)
Looking like it's soon time to sunset awyeah-api.
And thanks for helping me get the necessary changes into babashka proper to support it!
👀 Looks like I released it 1 May 2022. So, over three years of service.