A Leiningen template that sets up a workflow for figwheel and weasel with the least of effort as possible.
Create a new app from the template:
lein new mjstarter foobar
Start the figwheel and nrepl server:
cd foobar lein cooper
Give it a minute.
Add the following function to Emacs:
(defun mjstarter () "Cider-connect to localhost:52123 and start weasel repl" (interactive) (cider-connect "localhost" 52123) (cider-insert-in-repl "(require 'mjstarter.core) (mjstarter.core/weasel)" t))
Start the cljs repl.
Navigate in a browser to http://localhost:3449/index.html
Edit the cljs files in src-cljs and the css files in resources/public. Browser updates without refreshing.
Editing the template
For more info on creating leiningen templates see here .
To adapt the template, first clone the repo:
git clone firstname.lastname@example.org:Michieljoris/mjstarter.git
src/leiningen/new/mjstarter.clj . There are some settings in there for host and port settings for weasel, figwheel and the nrepl server, and of course the rest of the configuration for the template.
The files that make up the instantiated project are in
To add/update the modified template in the local leiningen repository:
To push to clojars.org:
But this will push to my account at clojars.org.
To make a new template:
lein new template template-name
Then adapt it, possibly copying from this template.
Don’t forget to add to ~/.lein/profiles.clj:
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.