Fork me on GitHub
#shadow-cljs
<
2021-08-18
>
greg19:08:57

I'm experimenting with shadow-cljs run from clj, and I noticed I can't run pom action

$ clj -Sdeps '{:deps {thheller/shadow-cljs {:mvn/version "2.15.4"}}}' -M -m shadow.cljs.devtools.cli pom
Unknown action.
compile watch work fine, but pom doesn't. Any idea what is wrong with this call?

greg19:08:20

This is how the help looks like:

$ clj -Sdeps '{:deps {thheller/shadow-cljs {:mvn/version "2.15.4"}}}' -M -m shadow.cljs.devtools.cli -h
Usage:
  shadow-cljs <action> <zero or more build ids>

Supported actions are:

     compile - ...
       watch - ...
       check - ...
     release - ...
   classpath - ...
   node-repl - ...
browser-repl - ...
   cljs-repl - ...
    clj-repl - ...
    clj-eval - ...
     clj-run - ...
         run - ...
        info - ...
         pom - ...
    npm-deps - ...
        test - ...
         aot - ...
        init - ...
        help - ...
      server - ...
       start - ...
        stop - ...
     restart - ...

Options:
-----
      --npm                internal, used by the shadow-cljs npm package
  -d, --dependency DEP     adds an additional dependency (eg. -d foo/bar:1.2.3 -d another/thing:4.0.0)
      --config-merge DATA  merges additional EDN data into the build config
  -A, --aliases ALIASES    adds aliases for use with clj, only effective when using deps.edn
      --source-maps        temporarily enable source-maps for release debugging
      --pseudo-names       temporarily enable pseudo-names for release debugging. DO NOT SHIP THIS CODE!
      --debug              enable source-maps + pseudo-names. DO NOT SHIP THIS CODE!
      --stdin              clj-eval from stdin
  -v, --verbose            verbose build log
      --force-spawn        spawn new process, do not connect to running server
      --cli-info           prints a bunch of information
      --via VIA            internal option, used by node script
  -h, --help
-----
So theoretically the pom is supported. but for some reason it doesn't work.

thheller06:08:44

pom is done by the npm shadow-cljs script and only works when using shadow-cljs.edn. Otherwise there is no point and so the JVM code doesn't support it.

greg18:08:25

I had shadow-cljs.edn in the project, and yes, using npm shadow-cljs pom worked fine for me. I've just thought there is a parity between js and jvm version

thheller18:08:04

you seem to be misunderstanding something here. what do you mean by "js and jvm version"?

greg09:09:18

By "jvm version" I meant the thheller/shadow-cljs, the one distributed with maven, the one I could use with deps.tools

greg20:08:43

Is there a cljs equivalent of clj' shadow.cljs.devtools.api? (I want to run shadow/compile from cljs script)