babashka / neil

A CLI to add common aliases and features to deps.edn-based projects
MIT License
377 stars 27 forks source link

suggestion: support `neil add nrepl -with-cider` #199

Open behrica opened 11 months ago

behrica commented 11 months ago

this could add

--middleware" "[cider.nrepl/cider-middleware,refactor-nrepl.middleware/wrap-refactor]

and

cider/cider-nrepl {:mvn/version "latest"} + refactor-nrepl/refactor-nrepl {:mvn/version latest}

to the alias ":nrepl"

borkdude commented 11 months ago

I'm fine with adding this by default, people can remove it if they don't like it.

teodorlu commented 5 months ago

@behrica I might take a stab at this—the alias logic has recently changed, making it a bit easier to work with.

Can you help me check whether the following alias entry is what you'd expect?

{:extra-deps
 {nrepl/nrepl {:mvn/version "1.1.2"},
  cider/cider-nrepl {:mvn/version "0.49.0"},
  refactor-nrepl/refactor-nrepl {:mvn/version "3.10.0"}},
 :main-opts
 ["-m" "nrepl.cmdline" "--interactive" "--color"
  "--middleware" "[cider.nrepl/cider-middleware,refactor-nrepl.middleware/wrap-refactor]"]}
teodorlu commented 5 months ago

I've got code at #223 that produces the following:

$ neil-dev add nrepl
$ cat deps.edn 
{:deps {}
 :aliases {:nrepl {:extra-deps {nrepl/nrepl {:mvn/version "1.1.2"}, cider/cider-nrepl {:mvn/version "0.49.0"}, refactor-nrepl/refactor-nrepl {:mvn/version "3.10.0"}}
                   :main-opts ["-m" "nrepl.cmdline" "--interactive" "--color" "--middleware" "[cider.nrepl/cider-middleware,refactor-nrepl.middleware/wrap-refactor]"]}}}

I'm not super happy with the super long lines, especially that each key in :extra-deps is on its own line.