zk / inky

Sketch in ClojureScript
http://inky.cc
Eclipse Public License 1.0
3 stars 1 forks source link

inky.cc

A ClojureScript sketchbook.

Build Status

Working on Sketches Locally

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:

  1. Create a gist with a cljs file. Easy start: fork this gist.
  2. Clone that gist locally: git clone git@gist.github.com/<gist-id>.git
  3. cd <gist-id>
  4. 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

Prereqs

Config

Env vars:

Dev

Copy 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.

Testing

Run bin/test

Deploy

Deploys to Heroku. Run bin/ship

Bumping Versions

This should be done when new cljs libs are added, or the lein plugin is updated.

Places to bump:

If you're adding a new lib, don't forget to add it to inky.config/cljs-libs.

TODO

Internals

Job States

Inky 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.

This is a first cut on representing the different job states.

License

Copyright © 2013 Zachary Kim http://zacharykim.com

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