Fork me on GitHub
#shadow-cljs
<
2020-01-22
>
sundbp12:01:26

Hi. Is there a typo on line 382 in shadow/cljs/npm/cli.cljs? Looks like the map isn't applied to clojure-args as I expect is the intention? @thheller

thheller12:01:22

its a transducer so it is used as intended?

sundbp12:01:46

I've switched to use borkdude's deps.exe on Windows (aliased to also be named clojure), and getting an error where my aliases ends up treated as a file somehow

sundbp12:01:17

Are you inserting a transducer into the prev vector?

thheller12:01:47

I assume you don't know what a transducer does? 😛

thheller12:01:07

(into ["-command" "clojure"] (map powershell-escape) clojure-args)

sundbp12:01:11

I am vaguely familiar, but not seen it applied the way it is in this expr

thheller12:01:24

(into ["-command" "clojure"] (map powershell-escape clojure-args))

thheller12:01:33

these prduce the same result

sundbp12:01:00

I guess I'm missing how the transducer is applied to the clojure-args the way it is written

thheller12:01:31

if you use deps.exe that is no longer a powershell command I would presume

sundbp12:01:44

It is not. A normal exe file

thheller12:01:44

so I wouldn't be surprised if it doesn't work

thheller12:01:06

just run things directly in that case

thheller12:01:29

clojure -m shadow.cljs.devtools.cli watch app is identical to shadow-cljs watch app

sundbp12:01:43

It takes the same args as the powershell thing. But seems the args get passed mangled for some reason

thheller12:01:57

yes .. they are escaped for powershell

thheller12:01:28

better yet run clojure -m shadow.cljs.devtools.cli server once

thheller12:01:35

and then use shadow-cljs as normal

thheller12:01:04

I don't know anything about deps.exe and don't have time to look into that right now

thheller12:01:14

you can open a ticket and I'll look at it when I get a chance

sundbp12:01:41

It is a clojure implemented replacement for the bash (and powershell) scripts. Compiled via graalvm.

sundbp12:01:26

(that I've added proxy support to and hence have an easier time getting to work in an enterprise Crap network setup)

sundbp12:01:48

I'll try the direct version for now. Thanks

thheller12:01:42

running a random .exe is easier in an enterprise setup? seems like that would be the first thing to be prohibited 😛

sundbp12:01:00

Well, compared to powershell modules to pass proxy info to the jvm, weirdly yes :)

thheller12:01:38

as I said .. no time.

sundbp12:01:48

Didn't mean to imply I want you to do anything :)

Eric Ihli20:01:49

Is there a way I can create a .js file in my project and have the build process send that file to the output-dir so another tool can pull it in with js/require? It looks like https://clojurescript.org/reference/dependencies#bundling-javascript-code would be an alternative. If I could do the following, then I wouldn't have to js/require, I could just (:require [my-lib])?

(cljs.build.api/build "src"
  {:output-to "out/main.js"
   :externs ["yayquery-externs.js"]
   :foreign-libs [{:file "yayquery.js"
                   :provides ["yq"]}]
   :optimizations :advanced})
But shadow doesn't work like that? https://shadow-cljs.github.io/docs/UsersGuide.html#publish-deps-cljs

Eric Ihli20:01:10

Assuming I can't convert the file to cljs and do things proper.

thheller20:01:42

what exactly are you trying to do though? I mean why must shadow-cljs be involved in copying a file?

thheller20:01:13

:foreign-libs is not supported by shadow-cljs and also doesn't do what you asked for

Eric Ihli20:01:03

Not that it must be. I'm just copying it over by hand now every time I re-generate it and it's been annoying enough that I'm looking for an alternative. Could be a separate watcher that I run somewhere. But that lead me to being curious if there was something possible with what I'm already using.

thheller20:01:14

hmm you generate it? why not generate it directly into output-dir?

thheller20:01:12

also what kind of file is it? why must it be loaded via require and not CLJS directly?

Eric Ihli20:01:23

This brings up another question I've been having but is probably more related to the react native workflow than shadow-cljs. Should I ever need to rm the output dir? Like, the docs on publishing for Android say to do a gradlew clean before a gradlew buildRelease. And the react-native cli has a react-native run-android --reset-cache . Is it ever necessary to rm -r ouput-dir/ ? That's kind of the reason I don't generate it straight to the output dir. I clean that directory occasionally and copy the file back over rather than re-generate it into the output dir.

thheller20:01:02

no clue. I don't do react-native development.

thheller20:01:30

any reasonable "cache" should be able to tell if a file changed or not