Fork me on GitHub
#tools-deps
<
2020-07-22
>
practicalli-johnny16:07:03

I'm using https://github.com/seancorfield/clj-new to add a new file/namespace called handlers to an existing project, practicalli/banking. I assume this is the right command given an alias called :new in my user level deps.edn file. It seems to work okay.

clojure -R:new -m clj-new.generate ns=practicalli.handlers
cc @seancorfield

seancorfield16:07:09

That's a reasonable approach. I'd probably add a :gen alias so I didn't have to type -m clj-new.generate each time.

seancorfield16:07:57

(caution: the generators are very primitive and not particularly well thought out -- I don't actually find them valuable and I would prefer they not be promoted as a way to do anything!)

seancorfield16:07:35

At some point, they'll probably be completely rewritten (in a new ns, naturally).

practicalli-johnny17:07:27

Ok, thanks. I only just used it today for the first time successfully. I tried previously but was getting an error as I didnt include any kind of clj-new alias, so content in just getting it working for myself 🙂

practicalli-johnny17:07:10

I am more interested in writing some templates to use with clj-new, so will focus on that instead, which I assume is quite stable.

seancorfield17:07:00

@jr0cket Yup, if you run into any problems, feel free to DM me about it.

seancorfield17:07:41

The built-in app/lib templates are probably a good place to get started. Also let me know if you have suggestions for improving the README around writing templates.

👍 3
markbastian21:07:54

What's the best way to run a socket or nrepl server locally? The scenario is that we have a windows user with a deps.edn project that is having trouble getting a repl started in IntelliJ. I was thinking he could just run a socket REPL and jack in. I see aliases for nrepl https://nrepl.org/nrepl/usage/server.html as well as socket repl directions https://clojure.org/reference/repl_and_main#_launching_a_socket_server. Any recommendations besides having an accident and getting a Mac instead?

markbastian21:07:01

Should this be the right invocation? clj -Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl}"

markbastian21:07:58

Got it! From https://oli.me.uk/exploring-repl-tooling-with-prepl/:

clj -J-Dclojure.server.jvm="{:port 5555 :accept clojure.core.server/repl}"

salam03:07:30

a better approach would be to create an alias in the project deps.edn: https://github.com/seancorfield/dot-clojure/blob/develop/deps.edn#L66 i'm a cursive user myself and this is how i start a socket repl server in the terminal ( clojure -O:socket ) and connect cursive (a socket repl client) to it by creating a remote socket repl run configuration in intellij idea.

markbastian15:07:00

Nice. Thanks! I think 90% of the answers are in Sean Corfield's deps.edn file.

salam15:07:31

yup, i personally found a lot of gems in there. 🙂