runclj

runclj

simpler clojurescript development for minimal projects

github.com/nathants/runclj

what

tooling around single file clojurescript programs running on node or the browser.

runclj ./rotate_the_logs.cljs

how

transparently converts a single clojurescript file into a temporary shadow-cljs project in .shadow-cljs/.

installation

get the dependencies:

then:

git clone https://github.com/nathants/runclj
sudo mv runclj/bin/* runclj/bin/.shadow-cljs /usr/local/bin

examples

usage

runclj program.cljs

declare clojure and npm dependencies with meta-data at the start of the file.

#!/usr/bin/env runclj
^{:runclj {:npm [[express "4.16.3"]]
           :deps [[prismatic/schema "1.1.3"]]}}
(ns main
  (:require [schema.core :as schema :include-macros true]))

run the program.

runclj program.cljs

browser dev workflow

server dev workflow

runclj examples/server.cljs

deployment

runclj-tar program.cljs | ssh server tar xf -

then either install runclj and run normally runclj program.cljs

or run manually:

outgrowing runclj

if your project grows too large for a single file, copy the generated shadow-cljs project and continue working on that directly.

alternatively lift and shift to a project template like aws-gocljs.