So when clj -A:cider-clj with the following deps alias:
:cider-clj {:extra-deps {cider/cider-nrepl {:mvn/version "0.22.4"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}
This starts an nrepl server.
Now, assuming i want to launch an HTTP server. I know i could use my editor to connect to the nrepl, then send nrepl the expression to launch the HTTP server. But is there another way where that happens through the command line invocation? maybe by adding another alias?
Something like
clj -M:cider-clj:start-server where start-server points to a exec-fn key in deps that points the start server function? I tried that it and it doesn't seem to work, i assume because you can't have both a main-opts and a exec-fn. MY other thought is that i have to extend the main-opts functionality, that is, pass something to the nrepl cmdline.you can only have one entry point. So the pre-defined ones start an nrepl server, or start a web-server, but neither does both. you could make your own entry point that starts a webserver and also starts an nrepl server though
gotcha.
How do i resolve this warning:
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 3.6.0 (package: 20221023.1644) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
given i got it while running cider-connect-clj then picking an nrepl port of the server started by running:
clj -M:dev:refactor:cider-clj
Where the aliases are defined as such:
:cider-clj {:extra-deps {cider/cider-nrepl {:mvn/version "LATEST"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}
:refactor {:extra-deps {refactor-nrepl {:mvn/version "LATEST"}
cider/cider-nrepl {:mvn/version "LATEST"}}}
;; note dev isn't likely relevant here...
:dev {:extra-paths ["dev"]
:extra-deps {expound/expound {:mvn/version "0.9.0"}
reloaded.repl/reloaded.repl {:mvn/version "0.2.4"}
org.clojure/tools.namespace {:mvn/version "1.3.0"}}}
i wouldn't have expected this error because it's saying the emacs https://practical.li/spacemacs/refactor/clj-refactor/ package is installed, but the refactor-nrepl clojure middleware dep isn't, which it should be, in my mind, because i include it through the extra deps in the "refactor" aliasare you sure the middleware was added to the nrepl server?
>
"-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"
> its not added to the nrepl server. it is just on the classpath
just jack-in like normal and copy the startup command and use parts of that
also donβt use LATEST because it has to hit maven each day to get the latest LATEST. Just go with the numbers from the regular jack-in command
its printed at the top of the repl buffer
thanks a lot. i think i get it now. π