Fork me on GitHub
#shadow-cljs
<
2020-05-16
>
r0man12:05:24

Hello, is the build report broken? Running npx shadow-cljs run shadow.cljs.build-report app report.html give me this error: No such var: shadow.cljs.devtools.cli/from-remote.

thheller14:05:25

@r0man downgrade to 2.9.2 for now. I broke the remote interaction in 2.9.4. will fix soon but have something else I want to fix first.

r0man14:05:01

Alright, thanks!

Stuart20:05:43

hi, I'm a complete newcomer to clojurescript and I'm having some issues with shadow-cljs (most likely me being dumb) and getting it to play nicely with cursive and IntelliJ, can someone lend a hand?

Stuart20:05:22

I have read from the docs that I can create a pom.xml and import this into cursive, but I have no idea how to do this in IntelliJ

Stuart20:05:47

Right now, things like defn and println just aren't recognised by IntelliJ and cursive

thheller20:05:08

@qmstuart make sure you have the maven plugin installed in IntelliJ. otherwise it won't properly support importing pom.xml

darwin20:05:06

why do you need pom.xml? cursive supports deps.edn and that plays pretty well with shadow-cljs :deps true

Stuart20:05:16

THen I must be doing something wrong then 😞

thheller20:05:48

@darwin that requires tools.deps ... pom.xml is much simpler and works just as well

✔️ 4
thheller20:05:03

@qmstuart do you have the plugin active?

Stuart20:05:29

It says the Maven plugin is bundled

thheller20:05:37

yes, but is it active?

Stuart20:05:54

on the plugins screen of settings, I have an option to disable, so I presume it must be currently enabled ?

thheller20:05:09

is the checkbox next to it checked or not?

Stuart20:05:23

it is 🙂

Stuart20:05:41

(when I say I'm a newbie, I mean I just tried to get shadow-cljs working for the first time about 8 hours ago)

thheller20:05:45

and you did file -> new -> project from existing sources?

Stuart20:05:07

that's what I was missing! I was looking for an import option somewhere!

Stuart20:05:09

thank you!

Stuart20:05:20

I didnt understand I had to open it as a project file itself

Stuart20:05:32

thank you so much

thheller20:05:37

yeah let it create a project from the generated pom.xml

coby21:05:20

Say I have this setup for a full stack Clojure/Script project:

src/my-app # app code goes in here
test/my-app # tests go in here
deps.edn
shadow-cljs.edn
And my shadow config:
{:source-paths ["src" "test"]
 :deps true
 :builds {:app ...

          :test {:test-dir "resources/public/test"
                 :target :browser-test
                 :ns-regexp "-test$"
                 :devtools {:http-root "resources/public/test"
                            :http-port 3002}}}}
This works fine for running CLJ tests via clojure -A:dev -m kaocha.runner, but I've never gotten this setup to work with Shadow/CLJS. watch doesn't seem to detect that the test files are even there. I see in the Testing section of the Shadow docs that it's "common" to keep files in src/main and src/test, but is that a requirement?

thheller21:05:06

if you use :deps true then you configure :paths in deps.edn only

thheller21:05:39

:source-paths in shadow-cljs.edn has no effect at all. you should get a big warning for that on startup, unless your version is too old for that.

coby21:05:10

ah ok, just upgraded, getting the warning now

coby22:05:37

ok, so looks like I need to add shadow as a dep to my :dev profile...do the maven and npm versions stay in lockstep?

coby22:05:19

looks like they are both at 2.9.6 atm, but just wondering 🙂

thheller22:05:11

I do recommend that but I just learned my lesson again to try to keep them compatible so it shouldn't matter most of the time

thheller22:05:46

the version in deps.edn is the one that counts, the npm package is only for command-line stuff which doesn't really do much

coby22:05:35

just got it working, thanks!