Fork me on GitHub
#tools-deps
<
2019-07-16
>
credulous16:07:02

Hi. I’m a bit confused with my workflow using clj and deps.edn. Everything was so magic with lein, I never had to actually understand what was going on. 🙂 no such luxury/laziness here.

credulous16:07:36

I have an app that has both an API server and a clojurescript frontend. The server is using http-kit.

credulous16:07:22

In my deps.edn I have {:aliases {:run {:main-opts [ "-m" "alexandria.core" ] } } — in alexandria.core I initialize the db, start the http-kit server etc.

credulous16:07:55

In my global deps.edn, I have the alias :nrepl {:extra-deps {nrepl/nrepl {:mvn/version "0.6.0"}}}

credulous16:07:44

What I would like to do is start the server, and have an nrepl session start at the same time, preferably with both a repl prompt and a server to connect to from the editor (I use fireplace/vim)

credulous16:07:18

Right now I’m starting the server with clj -A:run, which doesn’t start a repl as near as I can tell

credulous16:07:49

and in a different terminal clj -R:nrepl -m nrepl.cmdline, which starts a nrepl server

credulous16:07:04

and in a different terminal just clj to get a repl prompt

Alex Miller (Clojure team)16:07:16

you might need something more here to get an nrepl client, not just a repl ?

credulous16:07:36

and in a different terminal shadow-cljs watch alexandria to get clojurescript compiling plus a clojurescript repl going

credulous16:07:49

I’m sure this is not the Right Way to do things.

Alex Miller (Clojure team)16:07:05

you could probably write a tiny script that combines several of these things and call that instead

Alex Miller (Clojure team)16:07:16

and I'm not sure if you need the clj at all?