glob = require('glob'),
path = require('path');
-var util = require('../common/util');
+var file = require('../common/file'),
+ mapping = require('../common/mapping');
-var mapping = require('../../fp/_mapping'),
- templatePath = path.join(__dirname, 'template/modules'),
- template = util.globTemplate(path.join(templatePath, '*.jst'));
+var templatePath = path.join(__dirname, 'template/modules'),
+ template = file.globTemplate(path.join(templatePath, '*.jst'));
var aryMethods = _.union(
mapping.aryMethod[1],
var ignored = [
'_*.js',
'core.js',
+ 'core.min.js',
'fp.js',
'index.js',
- 'lodash.js'
+ 'lodash.js',
+ 'lodash.min.js'
];
function isAlias(funcName) {
_.each([mapping.aliasToReal, mapping.remap], function(data) {
_.forOwn(data, function(realName, alias) {
var modulePath = path.join(target, alias + '.js');
- if (!_.startsWith(alias, '_') &&
- !_.includes(modulePaths, modulePath)) {
+ if (!_.includes(modulePaths, modulePath)) {
modulePaths.push(modulePath);
}
});
var actions = modulePaths.map(function(modulePath) {
var moduleName = path.basename(modulePath, '.js');
- return util.writeFile(path.join(fpPath, moduleName + '.js'), getTemplate(moduleName));
+ return file.write(path.join(fpPath, moduleName + '.js'), getTemplate(moduleName));
});
- actions.unshift(util.copyFile(path.join(__dirname, '../../fp'), fpPath));
- actions.push(util.writeFile(path.join(target, 'fp.js'), template.fp()));
- actions.push(util.writeFile(path.join(fpPath, 'convert.js'), template.convert()));
- actions.push(util.writeFile(path.join(fpPath, '_util.js'), template._util()));
+ actions.unshift(file.copy(path.join(__dirname, '../../fp'), fpPath));
+ actions.push(file.write(path.join(fpPath, '_falseOptions.js'), template._falseOptions()));
+ actions.push(file.write(path.join(fpPath, '_util.js'), template._util()));
+ actions.push(file.write(path.join(target, 'fp.js'), template.fp()));
+ actions.push(file.write(path.join(fpPath, 'convert.js'), template.convert()));
async.series(actions, onComplete);
}