Include deps.cljs giving externs for Node.js consumers; normalize build output.

cljsbuild using leiningen projects that depend on Datomish will
automatically include the externs.
This commit is contained in:
Richard Newman 2016-09-22 15:56:20 -07:00
parent d0a04a5e56
commit 9587311412
10 changed files with 17 additions and 61 deletions

6
.gitignore vendored
View file

@ -22,12 +22,6 @@ pom.xml
pom.xml.asc
/.cljs_node_repl/
/.cljs_rhino_repl/
/release-browser
/release-browser/datomish.js
/release-browser/datomish.bare.js
/release-node
/release-node/datomish.js
/release-node/datomish.bare.js
/addon/built/index.js
/addon/node_modules/
/addon/release/datomish-test.xpi

View file

@ -1,4 +1,4 @@
(defproject datomish "0.1.0-SNAPSHOT"
(defproject datomish "0.1.1-SNAPSHOT"
:description "A persistent, embedded knowledge base inspired by Datomic and DataScript."
:url "https://github.com/mozilla/datomish"
:license {:name "Mozilla Public License Version 2.0"
@ -24,18 +24,18 @@
{
:release-node
{
:source-paths ["src/node"]
:source-paths ["src/common" "src/node"]
:assert false
:compiler
{
;; :externs specified in deps.cljs.
:elide-asserts true
:externs ["src/node/externs.js"]
:hashbang false
:language-in :ecmascript5
:language-out :ecmascript5
:optimizations :advanced
:output-dir "release-node"
:output-to "release-node/datomish.bare.js"
:output-dir "target/release-node"
:output-to "target/release-node/datomish.bare.js"
:output-wrapper false
:parallel-build true
:pretty-print true
@ -60,12 +60,12 @@
:compiler
{
:elide-asserts true
:externs ["src/browser/externs.js"]
:externs ["src/browser/externs/datomish.js"]
:language-in :ecmascript5
:language-out :ecmascript5
:optimizations :advanced
:output-dir "release-browser"
:output-to "release-browser/datomish.bare.js"
:output-dir "target/release-browser"
:output-to "target/release-browser/datomish.bare.js"
:output-wrapper false
:parallel-build true
:preloads [datomish.preload]
@ -75,25 +75,9 @@
}
:notify-command ["release-browser/wrap_bare.sh"]}
:advanced
{:source-paths ["src/node"]
:compiler
{
:externs ["src/node/externs.js"]
:language-in :ecmascript5
:language-out :ecmascript5
:output-dir "target/advanced"
:output-to "target/advanced/datomish.js"
:optimizations :advanced
:parallel-build true
:pretty-print true
:source-map "target/advanced/datomish.js.map"
:target :nodejs
}}
:test
{
:source-paths ["src/node" "test"]
:source-paths ["src/common" "src/node" "test"]
:compiler
{
:language-in :ecmascript5
@ -125,26 +109,5 @@
:doo {:build "test"}
:clean-targets ^{:protect false}
[
"target"
"release-node/cljs/"
"release-node/cljs_promises/"
"release-node/clojure/"
"release-node/datascript/"
"release-node/datomish/"
"release-node/honeysql/"
"release-node/taoensso/"
"release-node/datomish.bare.js"
"release-node/datomish.js"
"release-browser/cljs/"
"release-browser/cljs_promises/"
"release-browser/clojure/"
"release-browser/datascript/"
"release-browser/datomish/"
"release-browser/honeysql/"
"release-browser/taoensso/"
"release-browser/datomish.bare.js"
"release-browser/datomish.js"
]
:clean-targets ^{:protect false} ["target"]
)

View file

@ -1,2 +0,0 @@
var d = require('./datomish');
console.log(d.q("[:find ?e ?v :where [?e \"name\" ?v] {:x :y}]"));

View file

@ -2,6 +2,6 @@
set -e
(cat release-browser/wrapper.prefix; cat release-browser/datomish.bare.js; cat release-browser/wrapper.suffix) > release-browser/datomish.js
(cat release-browser/wrapper.prefix; cat target/release-browser/datomish.bare.js; cat release-browser/wrapper.suffix) > target/release-browser/datomish.js
echo "Packed release-browser/datomish.js"
echo "Packed target/release-browser/datomish.js"

View file

@ -1,2 +1,2 @@
var d = require('./datomish');
var d = require('../target/release-node/datomish');
console.log(d.q("[:find ?e ?v :where [?e \"name\" ?v] {:x :y}]"));

View file

@ -2,6 +2,6 @@
set -e
(cat release-node/wrapper.prefix && cat release-node/datomish.bare.js && cat release-node/wrapper.suffix) > release-node/datomish.js
(cat release-node/wrapper.prefix && cat target/release-node/datomish.bare.js && cat release-node/wrapper.suffix) > target/release-node/datomish.js
echo "Packed release-node/datomish.js"
echo "Packed target/release-node/datomish.js"

1
src/node/deps.cljs Normal file
View file

@ -0,0 +1 @@
{:externs ["externs/datomish.js"]}

View file

@ -2,7 +2,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
var datomish = require("../../release-node/datomish.js");
var datomish = require("../../target/release-node/datomish.js");
var schema = {
"name": "pages",