Fork me on GitHub
#calva
<
2022-09-20
>
seepel01:09:33

I've been using the deps.edn + shadow-cljs command to launch my application and the shadow-cljs output goes to my output.calva-repl file. This is completely reeking havoc with autosave turned on. Is there anyway to redirect the output of the shadow-cljs build to the terminal window?

skylize01:09:48

Use shadow-cljs command instead of deps+shadow.

seepel02:09:29

I also have a bunch of aliases that I want to use in my clj repl, so I think I'm a bit stuck there.

skylize02:09:52

Stuck how? Did you try my suggestion? Shadow-cljs with :deps true and started via Jack-in:`shadow-cljs` will boot a Clojure repl using your deps.edn file, and then use that Clojure repl to boot itself.

skylize02:09:22

It's just a matter of who's in charge. • Jack-in: deps.edn + shadow-cljs - Calva starts a Clojure repl. Then Calva passes code into the Clojure repl to a start Shadow repl. • Jack-in:`shadow-cljs` - Calva starts Shadow, which seeing deps.edn file starts a Clojure repl. Then Shadow passes code into the Clojure repl to start a Shadow repl.

skylize02:09:44

In the deps.ed +shadow-cljs scenario, all the output from Shadow gets mixed in with Clojure repl output, exactly what you are complaining about. In the case of just shadow-cljs, Shadow can direct its output directly to the terminal, exactly what you are requesting.

seepel02:09:11

Thank you for taking the time to help out! I did try your suggestion, I get the following error

shadow-cljs - config: /home/sean/src/gluino.io/shadow-cljs.edn
shadow-cljs - starting via "clojure"
Execution error (FileNotFoundException) at clojure.main/main (main.java:40).
Could not locate shadow/cljs/devtools/cli__init.class, shadow/cljs/devtools/cli.clj or shadow/cljs/devtools/cli.cljc on classpath.
Perhaps one of my config settings is a bit weird, I'll describe what I believe to be the relevant bits. I have my shadow-cljs.edn setup with :deps true
{:deps true
 :builds
 {:app {:target :browser
        ...}}}
I have several aliases in my deps.edn
{:deps {...}
 :aliases
 {:clj
  {:extra-deps {...}}
  :cljs
  {:extra-deps {...}}
  :shadow-cljs
  {:extra-deps {thheller/shadow-cljs {:mvn/version "2.19.5"}}}}}
When I use vim-iced I use this command to start it. I'm afraid I'm a little bit of a newbie, so I'm not sure exactly how it maps back to the clojure/clj commands though...
iced repl :app --force-shadow-cljs -A:clj:cljs:dev:shadow-cljs
When I start using deps.edn + shadow-cljs I can select those aliases when I launch the repl, but with just shadow-cljs it fails to find the necessary deps.

skylize03:09:05

Put thheller/shadow-cljs in main :deps instead of an alias.

lilactown04:09:09

in your shadow-cljs.edn, you can give it the aliases you want it to use to the :deps key

lilactown04:09:25

e.g. {:deps [:cljs :shadow-cljs] ,,,}

seepel04:09:45

Oh, interesting, I’ll give that a try.

seepel05:09:47

Yup, that got me going again, thanks so much @U4YGF4NGM

pez21:09:00

Dear Calva friends, I almost forgot to announce this morning's release: https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.304https://github.com/BetterThanTomorrow/calva/issues/1871 This change bumps the bundled deps.clj to v0.1.1165. And it also will make Calva check for newer versions and download and replace if so. A bit like how we manage clojure-lsp versions, but with less settings and options around it.