Leinigen template with figwheel and weasel. Minimum boilerplate.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
resources/leiningen/new/mjstarter
src/leiningen/new
.gitignore
LICENSE
README.org
project.clj

README.org

mjstarter

A Leiningen template that sets up a workflow for figwheel and weasel with the least of effort as possible.

Usage

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.

M-x mjstarter

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 git@github.com:Michieljoris/mjstarter.git

Edit 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 resources/leiningen/new/mjstarter.

To add/update the modified template in the local leiningen repository:

lein install

To push to clojars.org:

lein deploy

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:

[mjstarter/lein-template "0.1.0-SNAPSHOT"] 

License

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.