I've been working on a library that depends on a node module. It's tests are working fine, but when I try to consume it from another code base, the npm-deps from my compiler config is missing. Do I need to package up the node module as a cljsjs package to have it as a transitive dependency?
@christian767 No, not necessarily. Simple solution is to tell users of the library to add npm package themselves (npm-deps or manually or anything).
Transitive :npm-deps
are also supported, the library can create deps.cljs
file in jar root and :npm-deps
from that file is read by consumer projects, IF the apps use :install-deps true
option.
Creating the cljsjs package is also option, if you want to allow users to select if they want to use cljsjs or npm. Reagent does this.
Thanks
Guess I'll make the cljsjs package then, I'd rather my users needn't worry about specifics of my deps
Yes, I think that allows the broadest support for library now. To allow the lib also be used with npm, you should match the npm names in cljsjs package and use global-exports option: https://github.com/cljsjs/packages/blob/master/create-react-class/build.boot#L25-L28
With those options the JS lib can be used from Cljs using the same code as npm-deps, so users can use either
Cool, thanks!