From 8dd15244faae6b907c48491d1eeced7aba55195c Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Thu, 22 Sep 2016 16:45:52 -0700 Subject: [PATCH] Update README. --- README.md | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 77f90f5a..eb456c31 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Datomish is a persistent, embedded knowledge base. It's written in ClojureScript, and draws heavily on [DataScript](https://github.com/tonsky/datascript) and [Datomic](http://datomic.com). -Note that at time of writing, there's nothing here. +Datomish compiles into a single JavaScript file, and is usable both in Node (on top of `promise_sqlite`) and in Firefox (on top of `Sqlite.jsm`). It also works in pure Clojure on the JVM on top of `jdbc-sqlite`. ## Motivation @@ -63,15 +63,17 @@ contribute. At present this code is licensed under MPLv2.0. That license is subject to change prior to external contributions. +Datomish includes some code from DataScript, kindly relicensed by Nikita Prokopov. + + ## SQLite dependencies Datomish uses partial indices, which are available in SQLite 3.8.0 and higher. It also uses FTS4, which is [a compile time option](http://www.sqlite.org/fts3.html#section_2). -## Running a REPL -### Prep +## Prep You'll need [Leiningen](http://leiningen.org). @@ -86,25 +88,7 @@ npm install brew install rlwrap ``` -Run `lein cljsbuild auto advanced` to generate JavaScript into `target/`. - -To build for a browser, into `release-browser`: - -``` -lein cljsbuild once release-browser -``` - -To build for node, into `release-node`: - -``` -lein cljsbuild once release-node -``` - -To package or install a JAR for node, modifying the source path appropriately (make sure you clean up swap or temp files in `src`!): - -``` -lein with-profile node jar -``` +## Running a REPL ### Starting a ClojureScript REPL from the terminal @@ -158,17 +142,33 @@ Now you can use `:Eval`, `cqc`, and friends to evaluate code. Fireplace should c Run `lein doo node test once`, or `lein doo node` to re-run on file changes. -### Preparing an NPM release -The intention is that the `release-js/` directory is roughly the shape of an npm-ready JavaScript package. +## To build for Firefox -To generate a require/import-ready `release-js/datomish.js`, run ``` -lein cljsbuild once release +lein cljsbuild once release-browser +``` + +### To build and run the example add-on: + +``` +cd addon +./build.sh +cd release +./run.sh +``` + +## Preparing an NPM release + +The intention is that the `target/release-node/` directory is roughly the shape of an npm-ready JavaScript package. + +To generate a require/import-ready `target/release-node/datomish.js`, run +``` +lein cljsbuild once release-node ``` To verify that importing into Node.js succeeds, run ``` -node release-js/test +npm run test ``` Many thanks to ([David Nolen](https://github.com/swannodette)) and ([Nikita Prokopov](https://github.com/tonsky)) for demonstrating how to package ClojureScript for distribution via npm.