shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
jmckitrick 2020-08-29T17:01:48.341600Z

Why would I get WARNING] can't find node_modules/shadow-cljs/cli/dist/shadow.cljs.npm.transform.js, please install npm install --save-dev shadow-cljs. even after I’ve run the npm install command?

thheller 2020-08-29T17:02:49.342Z

looks like either have an ancient global install or ancient project install of shadow-cljs

thheller 2020-08-29T17:02:58.342300Z

that file hasn't existed for quite a while

jmckitrick 2020-08-29T17:03:11.342600Z

That’s very possible. How to clean up?

jmckitrick 2020-08-29T17:03:29.343Z

global de-install and stick to project-only install?

thheller 2020-08-29T17:04:09.343500Z

project-only install means you must always run through npx shadow-cljs ...

thheller 2020-08-29T17:04:23.344Z

if you are ok with that you don't need the global install at all

thheller 2020-08-29T17:06:10.344700Z

the global install will use the project install if its a compatible version

thheller 2020-08-29T17:06:25.345100Z

which it usually is ... just not if they are too far apart

jmckitrick 2020-08-29T17:08:39.346300Z

What’s the cleanest way to remove the binary at /usr/local/bin/shadow-cljs so I don’t have a conflict?

jmckitrick 2020-08-29T17:08:58.346800Z

npm uninstall -g shadow-cljs seems like it works but the binary is still there

jmckitrick 2020-08-29T17:09:10.347100Z

And I don’t want to just delete it, that’s sloppy

thheller 2020-08-29T17:09:51.347600Z

check out where it is actually from

thheller 2020-08-29T17:10:05.347800Z

which shadow-cljs or so

thheller 2020-08-29T17:10:22.348100Z

maybe you installed it via yarn?

jmckitrick 2020-08-29T17:10:58.348300Z

ah, ok. Let’s see…

jmckitrick 2020-08-29T17:13:00.348800Z

It’s acting like it removed it, but the binary is still there… :thinking_face:

thheller 2020-08-29T17:14:54.349Z

just look at the file

thheller 2020-08-29T17:15:07.349400Z

is it a symlink? is it a bash script calling some other path?

thheller 2020-08-29T17:15:10.349600Z

must be from somewhere

jmckitrick 2020-08-29T17:16:08.350300Z

Ah, ok. You’re right, it’s a symlink to a yarn install. But I just removed that, I thought…

jmckitrick 2020-08-29T17:16:32.350800Z

I didn’t see a ‘global’ flag on yarn remove…. I’ll look again

thheller 2020-08-29T17:17:31.351Z

yarn global remove

jmckitrick 2020-08-29T17:17:37.351200Z

Ah, it’s a prefix….

jmckitrick 2020-08-29T17:17:59.351400Z

Bingo!

jmckitrick 2020-08-29T17:18:58.351900Z

I’m almost there… I’m extracting the luminus shadow config into a standalone config….

jmckitrick 2020-08-29T17:19:24.352200Z

It’s complaining about `com/cognitect/transit.js:649:8  variable module is undeclared`

jmckitrick 2020-08-29T17:19:42.352500Z

Is that a dev dependency I need?

thheller 2020-08-29T17:20:02.352800Z

thats just a warning. you can ignore that.

jmckitrick 2020-08-29T17:21:56.353100Z

Hmm.. my hot reloading has disappeared….

jmckitrick 2020-08-29T17:22:29.353700Z

I’m running in CIDER, and it worked when it was all in one project.clj… let me stash my changes and confirm that…

jmckitrick 2020-08-29T17:25:54.354500Z

All fixed. A fresh start of emacs and cider did the trick….

jmckitrick 2020-08-29T17:29:18.354900Z

So what issues will I have if my src files are separated by extension?

jmckitrick 2020-08-29T17:29:27.355100Z

The manual says ‘harder to use’

thheller 2020-08-29T20:23:02.355600Z

your choice. if you like doing it then do it. I'm assuming you are talking about src/clj and src/cljs?

jmckitrick 2020-08-29T20:43:17.000200Z

Correct

jmckitrick 2020-08-29T20:44:06.001100Z

The last piece I’m working on today is how to get ‘env/dev/cljs’ in the source path for dev, and ‘env/prod/cljs’ for prod given that :source-paths are global and there can be only one.

thheller 2020-08-29T20:44:48.001400Z

must use lein or deps.edn if you need that

thheller 2020-08-29T20:44:52.001600Z

not supported by shadow-cljs.edn