Fork me on GitHub

Hi. I’m thinking of writing some CLI tools in clojurescript targeting node.js. That seems very possible and I have a couple of examples at hand (clack, closh, ..). I don’t have any example using boot as build tool though. Anyone aware of a nice cli tool project using boot targeting node.js?


Has anyone encountered Boot pulling in the wrong version of tools.namespace?

Classpath conflict: org.clojure/tools.namespace version 0.2.11 already loaded, ALSO loading version 0.3.0-alpha4
I have an explicit dependency on 0.3.0-alpha4 in my :dependencies, and have excluded tools.namespace everywhere it's required but I'm still somehow getting the older version, which messes up compiling Clojurescript in my project.


0.2.11 doesn't show up in the output from boot show -d.


It's coming from my profile.boot. Commenting everything out in there fixes things. Also the warning doesn't show up during CI. I guess boot show -d ignores some of what's in profile.boot.


@sundbp If you find a good example, I also would like to know. Most things I’ve seen use lein + figwheel for node


yeah. i sort of gave up for right now and may try lein-figwheel way as a start.


yup, but struggled to see how the node case is to be set up


Maybe contact some of the authors


You can also start without the reloading. I guess the reloading is only useful when you have some long running process in your node process, like a webserver?


i’m really just looking for a boot based workflow with a nice way to connect my repl


I do have a project like that myself


cool - link?


(i don’t care about the reloading part at all)


I have a setup like this: cljs compiles node, Gulpfile watches js, re-runs node which produces some html


so I don’t use a REPL there, the node process terminates too fast for a REPL to make sense


ok. well, I really just want a good REPL experience to iterate on some node based cli tools..


I’m not sure what that looks like. A CLI tool isn’t long running right


so what would you want to do in the REPL then


I grow my code in my repl.


What is the REPL connected to if it’s a CLI tool that terminates fast?


the tool would terminate fast when running independently, but a REPL with the tool’s namespaces available can run forever.


so the REPL is preventing the process from quitting?


it’s connected to a process which does nothing but have a repl


I guess I should look into it myself more then


it’s not like my clojure REPLs are running the exact same thing as the prod version would. it’s just a REPL that loads some NS and from there executes code as per the repl. I’m looking for the same for node


I see how it works now, having tried - very cool


I’ve got boot-figreload + node working now


@sundbp Can I PM my code to you somewhere? Don’t want to flood this channel and I don’t have it on Github


sure. i’m on <mailto:[email protected]|[email protected]>, but you can laso just PM me here on slack.


is there a builtin task to delete the target directory, if it exists?


@hlolli depending on what you're trying to do, you could just omit the target task so that the directory doesn't get written?


I want it to be written, I see that some functions in a task are called ahead of the tasks, it's just about timeing, because I want to find out if a file exists within these directories during compilation to prevent conflicts.


before all starts I'd preferably like to have an empty directory called target


hlolli (with-pass-thru _ (dosh "mkdir", "-p", "target")) is a little anonymous task that will do it. just put in pipeline


maybe add another dosh call that does an rm


ok ok thanks, I wanted to know if it already existed before doing it, like lein clean.


when I run boot remote-client-dev, I get:

Writing adzerk/boot_reload.cljs to connect to ...
Writing main.cljs.edn...
Compiling ClojureScript...
• main.js
Compile sources, elapsed time: 4899.99279 msecs
Compile sources, elapsed time: 33.606849 msecs
         java.util.concurrent.ThreadPoolExecutor$  624
          java.util.concurrent.ThreadPoolExecutor.runWorker 1149
                        clojure.core/binding-conveyor-fn/fn                     core.clj: 2027
                              adzerk.boot-cljs/compile-1/fn                boot_cljs.clj:  160
                                   adzerk.boot-cljs/compile                boot_cljs.clj:   72
                                          boot.pod/call-in*                      pod.clj:  413
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke  102
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke  109
                                          boot.pod/call-in*                      pod.clj:  410
                                      boot.pod/eval-fn-call                      pod.clj:  359
                                         clojure.core/apply                     core.clj:  657
                         adzerk.boot-cljs.impl/compile-cljs                     impl.clj:  156
                            adzerk.boot-cljs.impl/dep-order                     impl.clj:   36
               adzerk.boot-cljs.impl/cljs-depdendency-graph                     impl.clj:   29
                                        clojure.core/reduce                     core.clj: 6753
                                clojure.core.protocols/fn/G                protocols.clj:   13
                                  clojure.core.protocols/fn                protocols.clj:   75
                         clojure.core.protocols/iter-reduce                protocols.clj:   49
            adzerk.boot-cljs.impl/cljs-depdendency-graph/fn                     impl.clj:   30
                      adzerk.boot-cljs.impl/ns-dependencies                     impl.clj:   23
                                  cljs.analyzer.api/find-ns                     api.cljc:  163
java.lang.AssertionError: Assert failed: (symbol? sym)
Elapsed time: 13.816 sec
is there anyway to get more info on "where exactly is this assertion happening" if it's due to my code (I suspect not) -- and if it's due to cljs/boot internal code, is it possible to get the name of the namespace it was processing when this happened ? as of right now, I have no where the error is coming from