Basically trying to make a nextjs for clojurescript. We're very much trying to provide the same things for the same reasons.
npm install @kepler16/clamBasically trying to make a nextjs for clojurescript. We're very much trying to provide the same things for the same reasons.
Check out the template for an example of usage.
deps.edn, no Leiningen supportshadow-cljs under the hoodpages directory in the root of the clam project (where your site entry points will go). This directory uses file based routing, so the location of the .cljs files in it matter.pages and .clam/cp in your deps.edn :paths entry.pages dir and generates complimentary code in .clam/cpRunning npx clam dev runs a node script which:
- Crawls directories upwards to find the clam.edn file, marking the clam project root
- Does some directory preparation
- Starts an node http server that can execute serverless functions
- Kicks off a jvm which runs the clam build watcher
The clam build watcher watches the pages directory and runs the clojurescript analyzer against the .cljs files, which it then uses to create optimised shadow-cljs build configurations.
The build watcher kicks off a shadow-cljs server process and starts 2 watch processes. Once for the browser :clam/site and one for the serverless node environment :clam/api. Both of these are attachable with a repl.
clam templatenpm installnpx clam dev.shadow-cljs/nrepl.port file). Attach to the shadow-cljs build: Either :clam/api or clam/site or both, depending on where you want your repl. Note that because there's no shadow-cljs.edn file, emacs (and probably others) won't auto pick up these builds so you will need to manually type them in.You should have a hot reloadable development story. To add a new page to the site, just make a .cljs file in the corresponding place and
npx clam release --vercel to your package.json build script will generate release files in a way that just works with vercel.