Comparing version 0.0.8 to 0.0.9
@@ -70,3 +70,2 @@ 'use strict'; | ||
return Featurama; | ||
})(); | ||
//# sourceMappingURL=featurama-client.js.map | ||
})(); |
'use strict'; | ||
var _ = require('lodash'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var Table = require('cli-table'); | ||
var chalk = require('chalk'); | ||
var stack = require('callsite'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _lodash = require('lodash'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _fs = require('fs'); | ||
var _fs2 = _interopRequireDefault(_fs); | ||
var _path = require('path'); | ||
var _path2 = _interopRequireDefault(_path); | ||
var _cliTable = require('cli-table'); | ||
var _cliTable2 = _interopRequireDefault(_cliTable); | ||
var _chalk = require('chalk'); | ||
var _chalk2 = _interopRequireDefault(_chalk); | ||
var _callsite = require('callsite'); | ||
var _callsite2 = _interopRequireDefault(_callsite); | ||
/** | ||
@@ -15,7 +35,7 @@ * @module featurama | ||
// Get the path of the script that invoked `featurama` | ||
var pathToCaller = stack()[1].getFileName().match(/(.*\/).*/)[1]; | ||
var featureDir = path.resolve(pathToCaller, options.featuresPath); | ||
var pathToCaller = (0, _callsite2['default'])()[1].getFileName().match(/(.*[\\|\/]).*/)[1]; | ||
var featureDir = _path2['default'].resolve(pathToCaller, options.featuresPath); | ||
function _getFeatureFiles() { | ||
var files = fs.readdirSync(featureDir); | ||
var files = _fs2['default'].readdirSync(featureDir); | ||
return files.filter(function (file) { | ||
@@ -137,3 +157,3 @@ return (/.*\.js/.test(file) | ||
return _.defaults(data, { | ||
return _lodash2['default'].defaults(data, { | ||
jsFiles: [], | ||
@@ -173,4 +193,4 @@ vendorFiles: [], | ||
var table = new Table({ | ||
head: [chalk.blue('Feature'), chalk.blue('Enabled'), chalk.blue('JS Files'), chalk.blue('Vendor JS Files'), chalk.blue('SCSS Files')], | ||
var table = new _cliTable2['default']({ | ||
head: [_chalk2['default'].blue('Feature'), _chalk2['default'].blue('Enabled'), _chalk2['default'].blue('JS Files'), _chalk2['default'].blue('Vendor JS Files'), _chalk2['default'].blue('SCSS Files')], | ||
colWidths: [widths.featureName, widths.enabled, widths.jsFiles, widths.vendorFiles, widths.scssFiles] | ||
@@ -195,3 +215,2 @@ }); | ||
}; | ||
}; | ||
//# sourceMappingURL=featurama.js.map | ||
}; |
{ | ||
"name": "featurama", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Enable/Disable features via JS config files.", | ||
"main": "dist/featurama.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"compile": "cd lib && babel *.js -d ../dist", | ||
"test": "babel-node ./node_modules/jasmine-node/lib/jasmine-node/cli.js --color spec/*.js", | ||
"docs": "babel-node tasks/jsdox.js", | ||
"watch": "babel-node tasks/watch.js", | ||
"start": "npm run compile && npm test && npm run watch" | ||
}, | ||
@@ -25,10 +29,8 @@ "repository": { | ||
"devDependencies": { | ||
"grunt": "^0.4.5", | ||
"grunt-babel": "^5.0.1", | ||
"grunt-contrib-clean": "^0.6.0", | ||
"grunt-contrib-jasmine": "^0.9.1", | ||
"grunt-contrib-rename": "0.0.3", | ||
"grunt-contrib-watch": "^0.6.1", | ||
"grunt-jsdox": "^0.1.7", | ||
"lodash": "^3.10.1" | ||
"babel": "^5.8.23", | ||
"jasmine-node": "^1.14.5", | ||
"jsdox": "^0.4.9", | ||
"parallelshell": "^2.0.0", | ||
"shelljs": "^0.5.3", | ||
"watch": "^0.16.0" | ||
}, | ||
@@ -38,4 +40,5 @@ "dependencies": { | ||
"chalk": "^1.1.1", | ||
"cli-table": "^0.3.1" | ||
"cli-table": "^0.3.1", | ||
"lodash": "^3.10.1" | ||
} | ||
} |
@@ -1,16 +0,18 @@ | ||
module.exports = function(grunt) { | ||
grunt.config('jsdox', { | ||
generate: { | ||
options: { | ||
contentsEnabled: true, | ||
pathFilter: /dist/, | ||
templateDir: 'jsdox-templates', | ||
}, | ||
import jsdox from 'jsdox'; | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
src: ['dist/featurama.js'], | ||
dest: 'api', | ||
}, | ||
}); | ||
const OPTIONS = { | ||
templateDir: 'jsdox-templates', | ||
src: 'dist/featurama.js', | ||
dest: 'api', | ||
}; | ||
grunt.loadNpmTasks('grunt-jsdox'); | ||
}; | ||
if (!fs.existsSync(path.resolve(__dirname, '..', OPTIONS.dest))) { | ||
fs.mkdirSync(path.resolve(__dirname, '..', OPTIONS.dest)); | ||
} | ||
jsdox.generateForDir(OPTIONS.src, OPTIONS.dest, OPTIONS.templateDir, () => { | ||
fs.renameSync(path.resolve(__dirname, '..', OPTIONS.dest, 'featurama.md'), 'README.md'); | ||
fs.rmdirSync(path.resolve(__dirname, '..', OPTIONS.dest)); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
6
2
0
249460
4
52
5760
11
+ Addedlodash@^3.10.1
+ Addedlodash@3.10.1(transitive)