This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-22
Channels
- # announcements (2)
- # babashka (18)
- # beginners (87)
- # calva (22)
- # chlorine-clover (5)
- # cider (11)
- # clj-kondo (10)
- # clojure (71)
- # clojure-austin (1)
- # clojure-norway (6)
- # clojure-uk (13)
- # clojurescript (3)
- # core-async (10)
- # data-science (17)
- # datascript (1)
- # datomic (22)
- # emacs (10)
- # fulcro (32)
- # hoplon (8)
- # jobs-discuss (2)
- # malli (5)
- # meander (5)
- # nrepl (35)
- # off-topic (8)
- # pathom (38)
- # planck (21)
- # re-frame (10)
- # reagent (17)
- # reitit (7)
- # shadow-cljs (26)
- # tools-deps (3)
- # xtdb (7)
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?
@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
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: https://github.com/Deep-Symmetry/bytefield-svgDo 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
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
?
I don’t know what a build id is. The name
in package.json
?
npm run build
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.