Fork me on GitHub
#reveal
<
2021-08-14
>
Carl00:08:33

I'm a clojure newbie trying to add reveal to the fulcro template project here: https://github.com/fulcrologic/fulcro-template and obtain nrepl integration with emacs. The deps.edn is below. I have added nrepl and reveal to :extra-deps under the :dev alias.

{:paths   ["src/main" "resources"]

 :deps    {org.clojure/clojure                 {:mvn/version "1.10.1"}
           bidi/bidi                           {:mvn/version "2.1.6"}
           com.taoensso/timbre                 {:mvn/version "5.0.0"}
           com.wsscode/pathom                  {:mvn/version "2.2.31"}
           com.fulcrologic/fulcro              {:mvn/version "3.4.4"}
           com.fulcrologic/fulcro-garden-css   {:mvn/version "3.0.8"}
           com.fulcrologic/semantic-ui-wrapper {:mvn/version "1.0.1"}
           com.fulcrologic/guardrails          {:mvn/version "0.0.12"}
           garden/garden                       {:mvn/version "1.3.9"}
           hiccup/hiccup                       {:mvn/version "1.0.5"}
           http-kit/http-kit                   {:mvn/version "2.5.0"}
           mount/mount                         {:mvn/version "0.1.16"}
           org.clojure/core.async              {:mvn/version "1.3.610"}

           ;; csv
           org.clojure/data.csv                {:mvn/version "1.0.0"}

           ;; To simulate Datomic on the back-end
           datascript/datascript               {:mvn/version "0.18.7"}

           ring/ring-core                      {:mvn/version "1.8.1"}
           ring/ring-defaults                  {:mvn/version "0.3.2"}}

 :aliases {:clj-tests {:extra-paths ["src/test"]
                       :main-opts   ["-m" "kaocha.runner"]
                       :extra-deps  {lambdaisland/kaocha {:mvn/version "1.0.700"}}}

           ;; See  for Emacs support
           :dev       {:extra-paths ["src/test" "src/dev" "src/workspaces"]
                       :jvm-opts    ["-XX:-OmitStackTraceInFastThrow"]
                       :main-opts  ["-m" "nrepl.cmdline"
                                    "--middleware" "[vlaaad.reveal.nrepl/middleware]"]
                       :extra-deps  {org.clojure/clojurescript   {:mvn/version "1.10.773"}
                                     thheller/shadow-cljs        {:mvn/version "2.11.8"}
                                     fulcrologic/fulcro-spec     {:mvn/version "3.1.8"}
                                     binaryage/devtools          {:mvn/version "1.0.0"}
                                     com.github.awkay/workspaces {:mvn/version "1.0.2"},
                                     org.clojure/tools.namespace {:mvn/version "1.0.0"}
                                     vlaaad/reveal {:mvn/version "1.3.212"}
                                     nrepl/nrepl   {:mvn/version "0.8.3"}
                                     }}}}
my shadow-cljs.edn is the same as the fulcro template. It uses the :dev alias:
{:deps   {:aliases [:dev]}
 :nrepl  {:port 9000}
 :builds {:main       {:target     :browser
                       :output-dir "resources/public/js/main"
                       :asset-path "/js/main"

                       :modules    {:main {:init-fn app.client/init}}
                       ;; guardrails checks only during dev
                       :dev        {:compiler-options
                                    {:external-config {:guardrails {}}}}

                       :devtools   {:after-load app.client/refresh
                                    :preloads   [com.fulcrologic.fulcro.inspect.preload app.development-preload]}}

          :test       {:target           :browser-test
                       :test-dir         "resources/public/js/test"
                       :ns-regexp        "-test$"
                       ;; static required for mocking to work
                       :compiler-options {:static-fns      false
                                          :external-config {:guardrails {:throw? true}}}
                       :devtools         {:http-port          8022
                                          :http-resource-root "public"
                                          :http-root          "resources/public/js/test"}}

          :ci-tests   {:target           :karma
                       :js-options       {:js-provider :shadow}
                       :compiler-options {:static-fns      false
                                          :external-config {:guardrails {:throw? true}}}
                       :output-to        "target/ci.js"
                       :ns-regexp        "-test$"}

          :workspaces {:target     nubank.workspaces.shadow-cljs.target
                       :ns-regexp  "-(test|ws)$"
                       :output-dir "resources/public/workspaces/js"
                       :asset-path "/workspaces/js"
                       :devtools   {:preloads           [com.fulcrologic.fulcro.inspect.preload]
                                    :http-root          "resources/public/workspaces"
                                    :http-port          8023
                                    :http-resource-root "."}}}}
Starting the app with shadow-cljs results in the following error regarding middleware:
carl@w540-mint:~/repos/finance-fulcro$ npx shadow-cljs watch main
shadow-cljs - config: /home/carl/repos/finance-fulcro/shadow-cljs.edn
shadow-cljs - starting via "clojure"
WARNING: Use of :main-opts with -A is deprecated. Use -M instead.
nREPL middleware: shadow.cljs.devtools.cli has no namespace
Any help would be appreciated! If it's all helpful, running clojure -A:dev -J-Dtrace -J-Dguardrails.enabled=true -Sdeps '{:deps {vlaaad/reveal {:mvn/version "1.3.212"}}}' -m vlaaad.reveal repl --middleware '[vlaaad.reveal.nrepl/middleware]' opens up reveal and I can see values that I tap. But I would like it all to live in my .edn files