Commit 6186cc9f authored by Romain Courteaud's avatar Romain Courteaud

Prototype node build

parent c810b3f9
...@@ -29,6 +29,7 @@ EXTERNALDIR = external ...@@ -29,6 +29,7 @@ EXTERNALDIR = external
VERSION = 3.32.1 VERSION = 3.32.1
JIOVERSION = ${DISTDIR}/jio-v${VERSION}.js JIOVERSION = ${DISTDIR}/jio-v${VERSION}.js
JIOLATEST = ${DISTDIR}/jio-latest.js JIOLATEST = ${DISTDIR}/jio-latest.js
JIONODELATEST = ${DISTDIR}/jio-node-latest.js
all: fetch lint build all: fetch lint build
...@@ -134,6 +135,29 @@ ${JIOVERSION}: lib/uri/URI.js \ ...@@ -134,6 +135,29 @@ ${JIOVERSION}: lib/uri/URI.js \
@mkdir -p $(@D) @mkdir -p $(@D)
cat $^ > $@ cat $^ > $@
#############################################
# Node
#############################################
node: ${JIONODELATEST}
${JIONODELATEST}: ${SRCDIR}/node/jio-start.js \
${EXTERNALDIR}/rsvp-2.0.4.js \
${EXTERNALDIR}/moment.js \
${SRCDIR}/node/jio-external.js \
${SRCDIR}/queries/parser-begin.js \
${SRCDIR}/queries/build/parser.js \
${SRCDIR}/queries/parser-end.js \
${SRCDIR}/queries/query.js \
${SRCDIR}/node/query.js \
${SRCDIR}/jio.date/jiodate.js \
${SRCDIR}/jio.js \
${SRCDIR}/node/jio.js \
${SRCDIR}/jio.storage/uuidstorage.js \
${SRCDIR}/jio.storage/memorystorage.js \
${SRCDIR}/node/jio-end.js
@mkdir -p $(@D)
cat $^ > $@
############################################# #############################################
# Jison # Jison
############################################# #############################################
......
/*global require*/
(function (require) {
"use strict";
var jIO = require('../dist/jio-node-latest.js'),
storage = jIO.createJIO({type: 'memory'});
storage
.put('1', {
foo: 'bar'
})
.then(function (id) {
console.log(id === '1');
return storage.allDocs();
})
.then(function (results) {
console.log(results.data.total_rows === 1);
return storage.get('1');
})
.then(function (result) {
console.log(result);
});
}(require));
// return jIO;
// export UriTemplate, when module is present, or pass it to window or global
if (typeof module !== "undefined") {
module.exports = jIO;
}
else if (typeof define === "function") {
define([],function() {
return jIO;
});
}
else if (typeof window !== "undefined") {
window.jIO = jIO;
}
else {
global.jIO = jIO;
}
} ({}));
\ No newline at end of file
var RSVP = window.RSVP,
moment = window.moment;
\ No newline at end of file
(function (global) {
var window = {},
Blob = null,
EventTarget = null,
Blob = null,
FileReader = null,
atob = null,
btoa = null,
navigator = null;
\ No newline at end of file
var jIO = window.jIO;
\ No newline at end of file
var QueryFactory = window.QueryFactory,
Query = window.Query;
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment