A ClojureScript sketchbook.
Inky has a dev mode to work on sketches locally. Why? Sub-second (2-3s now, sub-second to return shortly) recompiles and source maps.
Just add the lein-inky plugin to your ~/.lein/profiles.clj
like so:
{:user {:plugins [[lein-inky "0.1.7"]]}}
After that:
git clone git@gist.github.com/<gist-id>.git
cd <gist-id>
lein inky
. Once the server is running visit
http://localhost:4659.One gotcha, for source maps to correctly resolve your file, you must
name it after the last part of the ns. For example, if the ns if your
sketch is foo.bar.baz
, name the file baz.cljs
(in the root
directory of the gist).
Starter gist to fork: https://gist.github.com/zk/8108564
Env vars:
PORT
-- web port to bind toAWS_ACCESS_ID
-- s3 credsAWS_SECRET_ACCESS_KEY
AWS_S3_BUCKET
-- s3 bucket to store compiled codeGA_TRACKING_ID
-- Google AnalyticsGA_TRACKING_HOST
-- ex. 'inky.cc'MONGO_URL
-- DB connection url, mongodb:// formatGH_CLIENT_ID
-- GH app credsGH_CLIENT_SECRET
NUM_WORKERS
-- Number of compile workers to spawn, defaults to 2Copy bin/dev.sample to bin/dev, fill in appropriate env vars. Note that the env vars are only necessary if you're working on inky. If you're working on a sketch locally, only $PORT
is required (provided by foreman).
Warning: There's a nasty bug where foreman won't correctly kill java processes it starts when foreman exits due to a child process exiting (this behavior doesn't manifest when you SIGINT foreman). You may need to manually kill previous processes manually.
Run bin/test
Deploys to Heroku. Run bin/ship
This should be done when new cljs libs are added, or the lein plugin is updated.
Places to bump:
project.clj
plugin/project.clj
2xREADME.md
src/clj/inky/local.clj
If you're adding a new lib, don't forget to add it to inky.config/cljs-libs
.
Thread
s for spawning workersInky runs several worker threads internally to compile gists, which
pull from a job queue backed by MongoDB (:compile-jobs
). Jobs
transition through several states as they are compiled, and as errors
pop up. All flags are unix timestamps unless otherwise specified.
:created
is set.:created
and :started
are set.:created
, :started
, and
:succeeded
are set.:created
, :started
, and :failed
are set
(see :error-cause
for message).This is a first cut on representing the different job states.
Copyright © 2013 Zachary Kim http://zacharykim.com
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.