adapting for node

This commit is contained in:
AJ ONeal 2015-01-15 01:00:59 -05:00
parent 6378a02f51
commit 5f1fb35758
5 changed files with 11 additions and 11 deletions

View File

@ -7,8 +7,8 @@
, forEachAsync = exports.forEachAsync || require('foreachasync').forEachAsync , forEachAsync = exports.forEachAsync || require('foreachasync').forEachAsync
, months , months
, THEME_PREFIX = 'themes' , THEME_PREFIX = 'themes'
//, sha1sum = exports.sha1sum || require('./lib/deardesi-node').sha1sum //, sha1sum = exports.sha1sum || require('./lib/node-adaptors').sha1sum
//, safeResolve = exports.safeResolve || require('./lib/deardesi-utils').safeResolve //, safeResolve = exports.safeResolve || require('./lib/utils').safeResolve
//, UUID = exports.uuid || require('node-uuid') //, UUID = exports.uuid || require('node-uuid')
; ;
@ -16,10 +16,13 @@
} }
if (!exports.window) { 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 // adds Desi.Frontmatter
require('./lib/frontmatter').create(Desi); require('./lib/frontmatter').create(Desi);
// adds Desi.fsapi
require('./lib/deardesi-node').create(Desi);
} }
months = { months = {
@ -228,8 +231,8 @@
} }
Desi.YAML = { Desi.YAML = {
parse: exports.jsyaml.load || require('jsyaml').load parse: (exports.jsyaml || require('js-yaml')).load
, stringify: exports.jsyaml.dump || require('jsyaml').dump , 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; exports.Desirae = exports.Desi = Desi.Desirae = Desi.Desi = Desi;
}('undefined' !== typeof exports && exports || window)); }('undefined' !== typeof exports && exports || window));

View File

@ -6,7 +6,7 @@ var PromiseA = require('bluebird').Promise
, path = require('path') , path = require('path')
, walk = require('walk') , walk = require('walk')
, escapeRegExp = require('escape-string-regexp') , escapeRegExp = require('escape-string-regexp')
, safeResolve = require('./deardesi-utils').safeResolve , safeResolve = require('../utils').safeResolve
, sha1sum = function (str) { return require('secret-utils').hashsum('sha1', str); } , sha1sum = function (str) { return require('secret-utils').hashsum('sha1', str); }
, mkdirp = PromiseA.promisify(require('mkdirp')) , mkdirp = PromiseA.promisify(require('mkdirp'))
, fsExtra = PromiseA.promisifyAll(require('fs.extra')) , fsExtra = PromiseA.promisifyAll(require('fs.extra'))

View File

@ -1,3 +1,4 @@
'use strict'; 'use strict';
exports.fsapi = require('./fsapi'); exports.fsapi = require('./fsapi');
exports.sha1sum = require('./sha1sum').sha1sum;