jaidetree / cljs-tui-template

A leiningen template to generate ClojureScript Terminal-User-Interface applications built on web technologies you already know.
Apache License 2.0
230 stars 9 forks source link

Build issue with the default template & shadow-cljs #6

Closed JJ-Atkinson closed 5 years ago

JJ-Atkinson commented 5 years ago
[:app] Build completed. (113 files, 2 compiled, 2 warnings, 2.95s)

------ WARNING #1 - :undeclared-var --------------------------------------------
 Resource: clojure/tools/cli.cljc:126:17
--------------------------------------------------------------------------------
 123 |          (recur options (into extra-args (vec (rest args))) nil)
 124 | 
 125 |          (and (opt? opt) (nil? spec))
 126 |          (throw (Exception. (str "'" opt "' is not a valid argument")))
-----------------------^--------------------------------------------------------
 Use of undeclared Var clojure.tools.cli/Exception
--------------------------------------------------------------------------------
 127 | 
 128 |          (and (opt? opt) (spec :flag))
 129 |          (recur ((spec :assoc-fn) options (spec :name) (flag-for opt))
 130 |                 extra-args
--------------------------------------------------------------------------------

------ WARNING #2 - :undeclared-var --------------------------------------------
 Resource: clojure/tools/cli.cljc:228:25
--------------------------------------------------------------------------------
 225 |   (when *assert*
 226 |     (let [unknown-keys (keys (apply dissoc map spec-keys))]
 227 |       (when (seq unknown-keys)
 228 |         (binding [*out* *err*]
-------------------------------^------------------------------------------------
 Use of undeclared Var clojure.tools.cli/*err*
--------------------------------------------------------------------------------
 229 |           (println (str "Warning: The following options to parse-opts are unrecognized: "
 230 |                         (s/join ", " unknown-keys)))))))
 231 | 
 232 |   (select-keys map spec-keys))
--------------------------------------------------------------------------------

I'm running npm -v 6.8.0 and node -v 11.10.0.

jaidetree commented 5 years ago

This is due to cli tools not fully supporting ClojureScript. However, the core parsing functionality still works in my testing.

If you would like to remove the warnings the best option would be to remove the org.clojure/tools.cli dependency and the code that depends on it. If you still want arg parsing you may be able to use one of the many npm offerings and call (js->clj parsed-js-obj :keywordize-keys true) to get a Clojure hash-map.

Let me know if I can help further. Thanks for reporting this.

JJ-Atkinson commented 5 years ago

That works great. Thank you!

JJ-Atkinson commented 5 years ago

That works great. Thank you!