Fork me on GitHub
#shadow-cljs
<
2021-07-27
>
souenzzo03:07:26

Hello I started a library that allow you to run npm install without need a node runtime or npm installed. It's a pure-clojure implementation of an interpreter" of package-lock.json that downloads packages from npm registry and untar it into node_modules. Easy as run (npm/install {:path "."}), or with new -T, clj -T:npm install :path '"."' For me, the advantage of this project is allow me to create advanced compiled cljs without need a nodejs runtime inside my docker image. I would like to know from other cljs developers if this is an interesting lib before continue to work on this project. https://github.com/souenzzo/tools.npm

clojure-spin 3
thheller03:07:09

@souenzzo you should probably make that work based on either package.json or some other kind of config (eg. deps.edn). how would you get a package-lock.json without having npm or node installed in the first place? 😛

souenzzo11:07:02

Well, the idea is that you will have a commited package-lock.json In your local/dev machine you will still use node/npm/etc it's just to simplify the deploy pipeline

thheller03:07:10

node is also required for some parts of shadow-cljs, so you'll definitely need node for some builds

souenzzo11:07:02

can you provide an example?!

thheller16:07:41

anything using ESM code in node_modules. it'll run through babel

thheller16:07:07

should be plenty packages doing this nowadays but can't think of one right now