Fork me on GitHub

oh, I was wondering if I did something to make those go away...glad to hear they're coming back 😄


Hi, is it possible to edit node modules and have those changes be picked up by shadow-cljs?


For debugging purposes


@kevin.van.rooijen shadow-cljs no longer watches individual files in node_modules, it only watches package.json files for modifications. so you can touch node_modules/the-dep/package.json which should trigger a rebuild


Thanks, that does trigger a rebuild.


I successfully finished porting my big LaTeX documents to Asciidoctor/Antora with the help of a byte-field diagram generator I created as a node module using shadow-cljs. I had been using it straight out of Git, but today I just published it to npm (my first npm module) so I can start documenting it the way people will actually want to use it. But when I try to change my build pipeline to use it from the npm install instead of my local git repo, I am getting an error I can’t understand:

$ANTORA_DJ --fetch doc/dev_svg.yml --stacktrace
no "source-map-support" (run "npm install source-map-support --save-dev" to get it)
Error: ENOENT: no such file or directory, open '/Users/jim/git/dysentery/node_modules/bytefield-svg/.shadow-cljs/builds/lib/dev/out/cljs-runtime/goog.debug.error.js'
    at Object.openSync (fs.js:436:3)
    at Object.readFileSync (fs.js:341:35)
    at global.SHADOW_IMPORT (/Users/jim/git/dysentery/node_modules/bytefield-svg/lib.js:58:15)
    at /Users/jim/git/dysentery/node_modules/bytefield-svg/lib.js:2212:1
    at /Users/jim/git/dysentery/node_modules/bytefield-svg/lib.js:5:26
    at Object.<anonymous> (/Users/jim/git/dysentery/node_modules/bytefield-svg/lib.js:9:3)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
I am running the command inside my dysentery repository, where I have locally installed my bytefield-svg npm module. Its source is here:


Do I need to build it in a different way to publish it to npm or something?


(The error message is correct in that there is no .shadow-cljs directory in the npm-installed copy of bytefield-svg. That directory does exist in the git repo where I built the module to publish to npm. I am a total npm n00b, and pretty wet behind the ears when it comes to shadow-cljs as well, this project was my first non-JVM Clojure effort, so hopefully someone can help me understand what is going on!)


you cannot publish development builds to npm, they are only meant to run on the machine that compiled it


you must use shadow-cljs release your-build and publish that instead


Ok, that makes sense. I will give it a shot. Does it make sense to set up an npm script for that?


In your command line what is your-build?


whatever your build id is


I don’t know what a build id is. The name in package.json?


how do you use shadow-cljs now?


i mean what command do you run


it will have the build id in it ... its the key in the :builds map


well ... and what does that run?


Yup, was just going there. 😄 It runs shadow-cljs compile lib so I am guessing the magic id is lib.


So I will add a release script. Thanks! Trying…


Is the npm script helpful at all? Maybe the simple shadow-cljs api might be beneficial for you while you’re learning. Way less indirection


As it is, I have a devil of a time when I dabble in JS projects remembering if they use npm, yarn, or gulp to build; adding another tool seems even worse. But I understand where you are coming from.


Anyway, having to rebuild gave me a chance to update my dependencies on shadow-cljs and borkdude/sci, so at least 1.0.1 is more than a 1.0.0 that works! 😉


Yes! The npm-installed version works now. Thanks again for your patient and clear help.