adapting for node
This commit is contained in:
parent
6378a02f51
commit
5f1fb35758
19
desirae.js
19
desirae.js
|
@ -7,8 +7,8 @@
|
|||
, forEachAsync = exports.forEachAsync || require('foreachasync').forEachAsync
|
||||
, months
|
||||
, THEME_PREFIX = 'themes'
|
||||
//, sha1sum = exports.sha1sum || require('./lib/deardesi-node').sha1sum
|
||||
//, safeResolve = exports.safeResolve || require('./lib/deardesi-utils').safeResolve
|
||||
//, sha1sum = exports.sha1sum || require('./lib/node-adaptors').sha1sum
|
||||
//, safeResolve = exports.safeResolve || require('./lib/utils').safeResolve
|
||||
//, UUID = exports.uuid || require('node-uuid')
|
||||
;
|
||||
|
||||
|
@ -16,10 +16,13 @@
|
|||
}
|
||||
|
||||
if (!exports.window) {
|
||||
Desi.sha1sum = require('./lib/node-adapters').sha1sum;
|
||||
Desi.fsapi = require('./lib/node-adapters').fsapi;
|
||||
|
||||
// adds helper methods to fsapi
|
||||
require('./lib/desirae-utils').create(Desi);
|
||||
// adds Desi.Frontmatter
|
||||
require('./lib/frontmatter').create(Desi);
|
||||
// adds Desi.fsapi
|
||||
require('./lib/deardesi-node').create(Desi);
|
||||
}
|
||||
|
||||
months = {
|
||||
|
@ -228,8 +231,8 @@
|
|||
}
|
||||
|
||||
Desi.YAML = {
|
||||
parse: exports.jsyaml.load || require('jsyaml').load
|
||||
, stringify: exports.jsyaml.dump || require('jsyaml').dump
|
||||
parse: (exports.jsyaml || require('js-yaml')).load
|
||||
, stringify: (exports.jsyaml || require('js-yaml')).dump
|
||||
};
|
||||
|
||||
|
||||
|
@ -1132,9 +1135,5 @@
|
|||
});
|
||||
};
|
||||
|
||||
if (!exports.window && !exports.window.Mustache) {
|
||||
Desi.fsapi = require('./lib/fsapi');
|
||||
}
|
||||
|
||||
exports.Desirae = exports.Desi = Desi.Desirae = Desi.Desi = Desi;
|
||||
}('undefined' !== typeof exports && exports || window));
|
||||
|
|
|
@ -6,7 +6,7 @@ var PromiseA = require('bluebird').Promise
|
|||
, path = require('path')
|
||||
, walk = require('walk')
|
||||
, escapeRegExp = require('escape-string-regexp')
|
||||
, safeResolve = require('./deardesi-utils').safeResolve
|
||||
, safeResolve = require('../utils').safeResolve
|
||||
, sha1sum = function (str) { return require('secret-utils').hashsum('sha1', str); }
|
||||
, mkdirp = PromiseA.promisify(require('mkdirp'))
|
||||
, fsExtra = PromiseA.promisifyAll(require('fs.extra'))
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
'use strict';
|
||||
|
||||
exports.fsapi = require('./fsapi');
|
||||
exports.sha1sum = require('./sha1sum').sha1sum;
|
||||
|
|
Loading…
Reference in New Issue