Skip to content

Commit

Permalink
Use cider-nrepl 0.34.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vemv committed Aug 3, 2023
1 parent b217386 commit cd96cfd
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

### Changes

- Bump the injected `cider-nrepl` to [0.32](https://github.com/clojure-emacs/cider-nrepl/blob/master/CHANGELOG.md).
- Bump the injected `cider-nrepl` to [0.34](https://github.com/clojure-emacs/cider-nrepl/blob/v0.34.0/CHANGELOG.md#0340-2023-08-03).
- Improve `nrepl-dict` error reporting.
- Preserve the `:cljs-repl-type` more reliably.

Expand Down
2 changes: 1 addition & 1 deletion cider.el
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ the artifact.")
(defconst cider-latest-clojure-version "1.10.1"
"Latest supported version of Clojure.")

(defconst cider-required-middleware-version "0.32.0-alpha3"
(defconst cider-required-middleware-version "0.34.0"
"The CIDER nREPL version that's known to work properly with CIDER.")

(defcustom cider-injected-middleware-version cider-required-middleware-version
Expand Down
10 changes: 5 additions & 5 deletions doc/modules/ROOT/pages/basics/middleware_setup.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Use the convenient plugin for defaults, either in your project's

[source,clojure]
----
:plugins [[cider/cider-nrepl "x.y.z"]
:plugins [[cider/cider-nrepl "0.34.0"]
[mx.cider/enrich-classpath "x.y.z"]]
----

Expand All @@ -46,7 +46,7 @@ A minimal `profiles.clj` for CIDER would be:

[source,clojure]
----
{:repl {:plugins [[cider/cider-nrepl "0.28.5"]
{:repl {:plugins [[cider/cider-nrepl "0.34.0"]
[mx.cider/enrich-classpath "1.9.0"]]}}
----

Expand All @@ -67,7 +67,7 @@ all of their projects using a `~/.boot/profile.boot` file like so:
(require 'boot.repl)
(swap! boot.repl/*default-dependencies*
concat '[[cider/cider-nrepl "0.25.2"]])
concat '[[cider/cider-nrepl "0.34.0"]])
(swap! boot.repl/*default-middleware*
conj 'cider.nrepl/cider-middleware)
Expand All @@ -84,11 +84,11 @@ run `cider-connect` or `cider-connect-cljs`.

[source,clojure]
----
:cider-clj {:extra-deps {cider/cider-nrepl {:mvn/version "0.22.4"}}
:cider-clj {:extra-deps {cider/cider-nrepl {:mvn/version "0.34.0"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}
:cider-cljs {:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.339"}
cider/cider-nrepl {:mvn/version "0.22.4"}
cider/cider-nrepl {:mvn/version "0.34.0"}
cider/piggieback {:mvn/version "0.5.3"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware"
"[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}
Expand Down
4 changes: 2 additions & 2 deletions doc/modules/ROOT/pages/basics/up_and_running.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ simple - CIDER simply passes the extra dependencies and nREPL configuration to
your build tool in the command it runs to start the nREPL server. Here's how
this looks for `tools.deps`:

$ clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.22.4"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
$ clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.34.0"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'

TIP: If you don't want `cider-jack-in` to inject dependencies automatically, set
`cider-inject-dependencies-at-jack-in` to `nil`. Note that you'll have to setup
Expand Down Expand Up @@ -292,7 +292,7 @@ It is also possible for plain `clj`, although the command is somewhat longer:

[source,sh]
----
$ clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.25.2"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
$ clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.34.0"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
----

Alternatively, you can start nREPL either manually or using the facilities
Expand Down
4 changes: 2 additions & 2 deletions doc/modules/ROOT/pages/cljs/shadow-cljs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ And connect to it with `cider-connect`.
...For that to work, `shadow-cljs.edn` contents like the following are assumed:

```clj
:dependencies [[cider/cider-nrepl "0.31.0"] ;; mandatory (unless it's inherited from deps.edn or otherwise present in the classpath of shadow-cljs's JVM process)
[refactor-nrepl/refactor-nrepl "3.6.0"]] ;; refactor-nrepl is optional
:dependencies [[cider/cider-nrepl "0.34.0"] ;; mandatory (unless it's inherited from deps.edn or otherwise present in the classpath of shadow-cljs's JVM process)
[refactor-nrepl/refactor-nrepl "3.9.0"]] ;; refactor-nrepl is optional

:nrepl {:middleware [cider.nrepl/cider-middleware ;; it's advisable to explicitly add this middleware. It's automatically added by shadow-cljs (if available in the classpath), unless `:nrepl {:cider false}`
refactor-nrepl.middleware/wrap-refactor] ;; refactor-nrepl is optional
Expand Down
44 changes: 22 additions & 22 deletions test/cider-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
(describe "when there is a single dependency"
(before-each
(setq-local cider-injected-nrepl-version "0.9.0")
(setq-local cider-injected-middleware-version "0.28.5")
(setq-local cider-injected-middleware-version "0.34.0")
(setq-local cider-jack-in-nrepl-middlewares '("cider.nrepl/cider-middleware"))
(setq-local cider-jack-in-dependencies-exclusions '())
(setq-local cider-enrich-classpath t))
Expand All @@ -152,7 +152,7 @@
:to-equal (concat "update-in :dependencies conj "
(shell-quote-argument "[nrepl/nrepl \"0.9.0\"]")
" -- update-in :plugins conj "
(shell-quote-argument "[cider/cider-nrepl \"0.28.5\"]")
(shell-quote-argument "[cider/cider-nrepl \"0.34.0\"]")
" -- update-in :plugins conj "
(shell-quote-argument "[mx.cider/enrich-classpath \"1.9.0\"]")
" -- update-in :middleware conj cider.enrich-classpath/middleware"
Expand All @@ -165,7 +165,7 @@
"update-in :dependencies conj "
(shell-quote-argument "[nrepl/nrepl \"0.9.0\" :exclusions [org.clojure/clojure]]")
" -- update-in :plugins conj "
(shell-quote-argument "[cider/cider-nrepl \"0.28.5\"]")
(shell-quote-argument "[cider/cider-nrepl \"0.34.0\"]")
" -- update-in :plugins conj "
(shell-quote-argument "[mx.cider/enrich-classpath \"1.9.0\"]")
" -- update-in :middleware conj cider.enrich-classpath/middleware"
Expand All @@ -177,7 +177,7 @@
:to-equal (concat "update-in :dependencies conj "
(shell-quote-argument "[nrepl/nrepl \"0.9.0\" :exclusions [org.clojure/clojure foo.bar/baz]]")
" -- update-in :plugins conj "
(shell-quote-argument "[cider/cider-nrepl \"0.28.5\"]")
(shell-quote-argument "[cider/cider-nrepl \"0.34.0\"]")
" -- update-in :plugins conj "
(shell-quote-argument "[mx.cider/enrich-classpath \"1.9.0\"]")
" -- update-in :middleware conj cider.enrich-classpath/middleware"
Expand All @@ -190,7 +190,7 @@
" -d "
(shell-quote-argument "nrepl/nrepl:0.9.0")
" -d "
(shell-quote-argument "cider/cider-nrepl:0.28.5")
(shell-quote-argument "cider/cider-nrepl:0.34.0")
" cider.tasks/add-middleware"
" -m "
(shell-quote-argument "cider.nrepl/cider-middleware")
Expand All @@ -199,7 +199,7 @@
(it "can inject dependencies in a gradle project"
(expect (cider-inject-jack-in-dependencies "--no-daemon" ":clojureRepl" 'gradle)
:to-equal (concat "--no-daemon "
(shell-quote-argument "-Pdev.clojurephant.jack-in.nrepl=nrepl:nrepl:0.9.0,cider:cider-nrepl:0.28.5")
(shell-quote-argument "-Pdev.clojurephant.jack-in.nrepl=nrepl:nrepl:0.9.0,cider:cider-nrepl:0.34.0")
" :clojureRepl "
(shell-quote-argument "--middleware=cider.nrepl/cider-middleware")))))

Expand All @@ -216,7 +216,7 @@
" -- update-in :plugins conj "
(shell-quote-argument "[refactor-nrepl \"2.0.0\"]")
" -- update-in :plugins conj "
(shell-quote-argument "[cider/cider-nrepl \"0.28.5\"]")
(shell-quote-argument "[cider/cider-nrepl \"0.34.0\"]")
" -- update-in :plugins conj "
(shell-quote-argument "[mx.cider/enrich-classpath \"1.9.0\"]")
" -- update-in :middleware conj cider.enrich-classpath/middleware"
Expand All @@ -229,7 +229,7 @@
" -d "
(shell-quote-argument "nrepl/nrepl:0.9.0")
" -d "
(shell-quote-argument "cider/cider-nrepl:0.28.5")
(shell-quote-argument "cider/cider-nrepl:0.34.0")
" -d "
(shell-quote-argument "refactor-nrepl:2.0.0")
" cider.tasks/add-middleware"
Expand All @@ -251,7 +251,7 @@
:to-equal (concat "-o -U update-in :dependencies conj "
(shell-quote-argument "[nrepl/nrepl \"0.9.0\"]")
" -- update-in :plugins conj "
(shell-quote-argument "[cider/cider-nrepl \"0.28.5\"]")
(shell-quote-argument "[cider/cider-nrepl \"0.34.0\"]")
" -- update-in :plugins conj "
(shell-quote-argument "[mx.cider/enrich-classpath \"1.9.0\"]")
" -- update-in :middleware conj cider.enrich-classpath/middleware"
Expand All @@ -262,15 +262,15 @@
" -d "
(shell-quote-argument "nrepl/nrepl:0.9.0")
" -d "
(shell-quote-argument "cider/cider-nrepl:0.28.5")
(shell-quote-argument "cider/cider-nrepl:0.34.0")
" cider.tasks/add-middleware"
" -m "
(shell-quote-argument "cider.nrepl/cider-middleware")
" repl -s wait")))
(it "can concat in a gradle project"
(expect (cider-inject-jack-in-dependencies "--no-daemon" ":clojureRepl" 'gradle)
:to-equal (concat "--no-daemon "
(shell-quote-argument "-Pdev.clojurephant.jack-in.nrepl=nrepl:nrepl:0.9.0,cider:cider-nrepl:0.28.5")
(shell-quote-argument "-Pdev.clojurephant.jack-in.nrepl=nrepl:nrepl:0.9.0,cider:cider-nrepl:0.34.0")
" :clojureRepl "
(shell-quote-argument "--middleware=cider.nrepl/cider-middleware")))))

Expand All @@ -285,14 +285,14 @@
(setq-local cider-jack-in-nrepl-middlewares '(("refactor-nrepl.middleware/wrap-refactor" :predicate middlewares-predicate) "cider.nrepl/cider-middleware" ("another/middleware"))))
(it "includes plugins whose predicates return true"
(expect (cider-jack-in-normalized-lein-plugins)
:to-equal '(("refactor-nrepl" "2.0.0") ("cider/cider-nrepl" "0.28.5"))))
:to-equal '(("refactor-nrepl" "2.0.0") ("cider/cider-nrepl" "0.34.0"))))
(it "includes middlewares whose predicates return true"
(expect (cider-jack-in-normalized-nrepl-middlewares)
:to-equal '("refactor-nrepl.middleware/wrap-refactor" "cider.nrepl/cider-middleware" "another/middleware")))
(it "ignores plugins whose predicates return false"
(spy-on 'plugins-predicate :and-return-value nil)
(expect (cider-jack-in-normalized-lein-plugins)
:to-equal '(("cider/cider-nrepl" "0.28.5")))
:to-equal '(("cider/cider-nrepl" "0.34.0")))
(spy-on 'middlewares-predicate :and-return-value nil)
(expect (cider-jack-in-normalized-nrepl-middlewares)
:to-equal '("cider.nrepl/cider-middleware" "another/middleware")))
Expand Down Expand Up @@ -321,7 +321,7 @@
:and-return-value '("refactor-nrepl.middleware/wrap-refactor" "cider.nrepl/cider-middleware"))
(spy-on 'cider-jack-in-normalized-lein-plugins
:and-return-value '(("refactor-nrepl" "2.0.0")
("cider/cider-nrepl" "0.28.5")
("cider/cider-nrepl" "0.34.0")
("mx.cider/enrich-classpath" "1.9.0")))
(setq-local cider-jack-in-dependencies-exclusions '())
(setq-local cider-enrich-classpath t))
Expand All @@ -332,7 +332,7 @@
" -- update-in :plugins conj "
(shell-quote-argument "[refactor-nrepl \"2.0.0\"]")
" -- update-in :plugins conj "
(shell-quote-argument "[cider/cider-nrepl \"0.28.5\"]")
(shell-quote-argument "[cider/cider-nrepl \"0.34.0\"]")
" -- update-in :plugins conj "
(shell-quote-argument "[mx.cider/enrich-classpath \"1.9.0\"]")
" -- update-in :middleware conj cider.enrich-classpath/middleware"
Expand All @@ -350,7 +350,7 @@
" -d "
(shell-quote-argument "nrepl/nrepl:0.9.0")
" -d "
(shell-quote-argument "cider/cider-nrepl:0.28.5")
(shell-quote-argument "cider/cider-nrepl:0.34.0")
" -d "
(shell-quote-argument "refactor-nrepl:2.0.0")
" cider.tasks/add-middleware"
Expand Down Expand Up @@ -445,7 +445,7 @@
(setq-local cider-jack-in-dependencies nil)
(setq-local cider-jack-in-nrepl-middlewares '("cider.nrepl/cider-middleware"))
(let ((expected (string-join `("clojure -Sdeps "
,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.28.5\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.34.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
" -M:cider/nrepl")
"")))
(setq-local cider-allow-jack-in-without-project t)
Expand All @@ -459,7 +459,7 @@

(it "allows specifying custom aliases with `cider-clojure-cli-aliases`"
(let ((expected (string-join `("clojure -Sdeps "
,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.28.5\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.34.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
" -M:dev:test:cider/nrepl")
"")))
(setq-local cider-jack-in-dependencies nil)
Expand All @@ -476,7 +476,7 @@
(it (format "should remove duplicates, yielding the same result (for %S command invocation)" command)
;; repeat the same test for PowerShell too
(let ((expected (string-join `("-Sdeps "
,(cider--shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.28.5\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}"
,(cider--shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.34.0\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}"
command)
" -M:dev:test:cider/nrepl")
"")))
Expand All @@ -486,7 +486,7 @@
:to-equal expected))))
(it "handles aliases correctly"
(let ((expected (string-join `("-Sdeps "
,(shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.28.5\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
,(shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.34.0\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
" -M:test:cider/nrepl")
""))
(deps '(("nrepl/nrepl" "0.9.0"))))
Expand All @@ -508,7 +508,7 @@
:to-equal expected)))))
(it "allows for global options"
(let ((expected (string-join `("-J-Djdk.attach.allowAttachSelf -Sdeps "
,(shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.28.5\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
,(shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.34.0\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
" -M:test:cider/nrepl")
""))
(deps '(("nrepl/nrepl" "0.9.0"))))
Expand All @@ -519,7 +519,7 @@
(setq-local cider-jack-in-dependencies '(("org.clojure/tools.deps" (("git/sha" . "6ae2b6f71773de7549d7f22759e8b09fec27f0d9")
("git/url" . "https://github.com/clojure/tools.deps/")))))
(let ((expected (string-join `("clojure -Sdeps "
,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.28.5\"} org.clojure/tools.deps { :git/sha \"6ae2b6f71773de7549d7f22759e8b09fec27f0d9\" :git/url \"https://github.com/clojure/tools.deps/\" }} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.34.0\"} org.clojure/tools.deps { :git/sha \"6ae2b6f71773de7549d7f22759e8b09fec27f0d9\" :git/url \"https://github.com/clojure/tools.deps/\" }} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}")
" -M:cider/nrepl")
"")))
(setq-local cider-allow-jack-in-without-project t)
Expand Down

0 comments on commit cd96cfd

Please sign in to comment.