Fork me on GitHub
#shadow-cljs
<
2022-01-12
>
Elso09:01:43

is there a way to configure shadow to write arbitrary keys to the generated package.json, or at least the engine key?

thheller16:01:39

@d.eltzner012 shadow-cljs does not generate a package.json ever?

Elso08:01:53

I just checked, I removed both package.json and package-lock.json, ran npx shadow-cljs compile app and there was a package.json generated?!

thheller17:01:41

ah. technically that is npm generating that. it is created by running npm install <packages> where packages comes from your dependencies declaring :npm-deps.

thheller17:01:58

you should keep this file and the associated package-lock.json in version control

thheller17:01:10

then you can add whatever you like to package.json yourself.

thheller17:01:29

and to answer your initial question: no, there is no way to have shadow-cljs add extra stuff

zendevil.eth17:01:25

I’m running npx shadow-cljs watch app , but I want to run it in the background. How do I do that?

dpsutton17:01:29

in general you add an & at the end of the command. But in practice i like having it in the foreground so i can easily stop, see compiler output, etc. so i prefer to just use a dedicated terminal tab for it

agold18:01:32

Also asked in #calva but no answer yet.

dpsutton18:01:38

this is most likely 100% an nrepl / calva issue. If you just do npx shadow-cljs node-repl and eval that presumably the output will show up in the terminal?

dpsutton18:01:15

❯ npx shadow-cljs node-repl
shadow-cljs - config: /Users/dan/projects/work/metabase/shadow-cljs.edn
shadow-cljs - connected to server

cljs.user=> shadow-cljs - #5 ready!

cljs.user=> (let [tn (js/setTimeout #(println "hello") 1000)]
    (println tn))
#object[Timeout 52]
nil
cljs.user=> hello

agold19:01:06

Thanks, yes, that works for me too.