Fork me on GitHub
#clojure-uk
<
2019-07-23
>
practicalli-john09:07:12

Anyone doing interesting things with Clojure CLI tools and deps.edn? I’ve been enjoying rebel readline, it’s a great command line REPL experience. Also enjoying clj-new and depstar from @seancorfield I have started using figwheel-main with deps.edn too, seems quite nice and clean. Starting to ge the hand of separate aliases and builds Any other things I should take a look at? I hope to find some time soon to finally look at edge by JUXT to understand how that works.

rickmoynihan13:07:58

Just a pattern of usage that you might be interested in: We have a bunch of command line custom dev tools that we include in multiple projects via deps.edn. It means every developer can get the version locked tools without having to install them by hand.

rickmoynihan13:07:51

oh also you’ve reminded me, I wrote a deps.edn tool to deploy jars to clojars or a private S3 repo (wagon)… as there was no way to do it with a pure clojure tool. It’s still in a private repo and I’ve been meaning to release it, but completely forgot.

rickmoynihan14:07:11

ahhh man… I asked if anyone knew about one of those!

dominicm14:07:58

dunno when you wrote it, but I've been afk from slack 🙂

rickmoynihan14:07:00

it’s not significantly different to what’s in deps-deploy by the looks of it

rickmoynihan14:07:54

though i support pom templates too

dominicm14:07:10

what's a pom template? your own invention?

rickmoynihan14:07:56

essentially injecting values into a selmer template to build the pom

dominicm14:07:01

ah, magic 😄

dominicm14:07:09

I think pom manipulation was outsourced to another library

dominicm14:07:37

the idea being that deps-deploy is hyper-focused on taking a jar+pom and sending it somewhere. How you create that pom is a separate concern.

rickmoynihan14:07:16

it’s true - I wanted an easy solution.

dominicm14:07:26

(I don't think templating the pom is too common a concern either)

dominicm14:07:40

https://github.com/workframers/garamond is pretty neat for the common version part though 🙂

rickmoynihan15:07:12

> I don’t think templating the pom is too common a concern either It’s probably not common. One of my usecases was actually in a non clojure assets repo that we wanted to include as webjars in a downstream clojure project. The repo essentially had a common base of styles and different themes (extra css, and other assets e.g. logos etc). So we wanted to build multiple jars from one project with different asset names.

rickmoynihan16:07:12

Incidentally it looks like deps-deploy wasn’t an option for me as it doesn’t work with private repos and S3 wagon. So I may strip out the pom-templating and push my tool… though tbh it might be better just to extend deps-deploy with the wagon code I have.

dominicm20:07:34

that would be cool 🙂

dominicm09:07:17

You already knew what I was going to badger you about 🙂

dominicm09:07:34

pack (a deps.edn packager) just gained a neat feature - it can generate a docker image directly from your deps.edn file

👍 4
practicalli-john19:07:59

I just saw pack, sounds very useful for those times you need docker. Thanks

dominicm19:07:16

it also does uberjars 🙂

dominicm20:07:03

pack was designed under the principle of "don't mess with the classpath - it makes bad things happen". So far that's allowed me to sidestep a number of bugs that plague the other uberjar tools, and also be much faster. That principle turns out to extend really well to other things like AWS lambda and docker, hence the natural extension of pack to them.

practicalli-john06:07:11

Sounds very useful. I had a quick look at depstar (great name and logo) and Sean did note there were limitations. Sounds like pack is more complete. Thanks

practicalli-john06:07:46

I will do a broadcast or two on using Edge soon, now that I am starting to understand the approach.

dominicm14:07:14

Let me know if you have any questions 🙂

dominicm09:07:45

oh, oh, I'll tell you what's really cool! https://github.com/SevereOverfl0w/clj-embed allows you to create a nested deps.edn context in your application.

dominicm09:07:48

I'm using it for generating the Edge docs, I load codox+the dependency into it's own runtime, so that the docsite deps don't interfere with the dependent ones. It's much faster than shelling out to java.

👍 4
practicalli-john19:07:50

Thanks. That's a useful use case to think about.

dominicm19:07:27

I think it would be fun to build a clojure-style application server with, but haven't tried yet

seancorfield16:07:02

@jr0cket I assume you've looked over my dot clojure repo? Although that's my personal setup, we have quite a bit of that copied into our base deps.edn for our monorepo too.

practicalli-john19:07:20

Thanks Sean, I am steadily working through your examples and projects, highly useful. Thank you.