In good clojure tradition, I sneaked in some clojure code into my customers enterprise environment.
I use shadow-cljs to generate a :node-library from my cljs code. This library is deployed to an enterprisey function as a service runtime (similar to AWS lambda) by an enterprisey cli tool. I cannot use shadows dev builds, as the enterprisey cli tool only accepts js files inside a single directory to be deployed to the runtime. Shadow references files outside this directory (like node_modules) and thus fails.
My workflow right now is to change code and then click manually on release build in shadow-cljs. I wait a bit and then see the changed code deployed inside the faas runtime.
I see 2 possible solutions:
Get shadow to put all dev build js files under a single directory.
Get shadow to do single file release-like builds on code changes during development.
This way the foo directory will contain all files. The build will however still access files from node_modules if you use any npm packages. In that case I’d recommend creating a package.json in the foo directory and installing the packages you need at runtime there. Don’t know if your “customers enterprise environment” supports this but I’d expect so?
Option 2. is not an option but you can always trigger a manual release build if needed. If you run shadow-cljs server separately you don’t pay the startup price and release builds can be reasonably fast. However optimizations may still take some time which is also why an “automatic” release build on watch changes is impractical.