It’s that time again.
That time when I come back to my Clojure project, to try to make some progress with it. And again, fail, humiliated, as I spend 3 days masochistically battering my head against the desk, failing to get the build scripts working correctly.
As before, this is a Clojure + ClojureScript application.
It has figwheel for working on the cljs front-end. Clojure at the back-end.
I need to be able to run a :dev alias where figwheel hot reloads the page. But also where I work on the back-end.
I need to have a :prod alias to compile the whole system into an uberjar for distribution. This :prod build should compile both the cljs and the clj back-end. And bundle everything into the uberjar.
I prefer not to use shadow.js. AFAICT you can compile cljs without it, using the build tools.
I need to import some dependencies from github. (Otherwise I would totally just use Lein)
And yet again, I can’t figure out how to get this build setup working properly.
I originally created my setup with Zack Oakes’s LightMod. Which was fine. Until it broke when I needed to import dependencies from github. Some time ago Sean Corfield helpfully diagnosed that this was because the build that LightMod created was actually still using lein behind the scenes. So I’ve been trying to migrate to only using cli and build tools.
But I simply cannot massage what I have into something that works.
I confess, I have taken advice from ChatGPT. And this may have doubled my problems. (Although it did initially seem to give some useful hints and solve some problems.)
So I am once again asking : does anyone know of, or have, a simple template or minimal hello world type project that has all these properties?
- Clojurescript front end talking to Clojure backend
- figwheel for hot reloading
- uberjar for distribution
- uses build.tools
- can import dependencies from github
- ideally a way to avoid repeating a long list of dependencies for the :dev vs :prod builds / :aliases (although maybe this is impossible)
At this point, I’m happy to start from a working template or minimal example and move all my other code back into it.
But every time I start with something with less than all the features I listed above, and try to add some of those back in, I fail. Ignominiously.