grunt-sassdoc
Advanced tools
Comparing version 1.1.0 to 2.0.0-rc.2
{ | ||
"name": "grunt-sassdoc", | ||
"title": "grunt-sassdoc", | ||
"version": "1.1.0", | ||
"version": "2.0.0-rc.2", | ||
"description": "SassDoc grunt task", | ||
@@ -24,5 +24,10 @@ "keywords": [ | ||
}, | ||
"files": [ | ||
"tasks", | ||
"CHANGELOG.md", | ||
"README.md", | ||
"UNLICENSE" | ||
], | ||
"dependencies": { | ||
"sassdoc": "^1.2.0", | ||
"chalk": "^0.5.0", | ||
"sassdoc": "2.0.0-rc.6", | ||
"lodash": "^2.4.1" | ||
@@ -34,7 +39,7 @@ }, | ||
"grunt-contrib-clean": "^0.6.0", | ||
"grunt-eslint": "^0.6.0", | ||
"grunt-eslint": "^2.1.0", | ||
"grunt-tape": "0.0.2", | ||
"load-grunt-tasks": "^0.6.0", | ||
"tape": "^2.13.4", | ||
"time-grunt": "^0.4.0" | ||
"load-grunt-tasks": "^1.0.0", | ||
"tape": "^3.0.3", | ||
"time-grunt": "^1.0.0" | ||
}, | ||
@@ -52,4 +57,5 @@ "peerDependencies": { | ||
"scripts": { | ||
"rebuild": "rm -rf node_modules && npm install", | ||
"test": "grunt test" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
/* | ||
/** | ||
* grunt-sassdoc | ||
@@ -11,88 +11,35 @@ * | ||
var sassdoc = require('sassdoc'); | ||
var chalk = require('chalk'); | ||
var _ = require('lodash'); | ||
var ensure = require('lodash').assign; | ||
module.exports = function (grunt) { | ||
function validateSrc(filePair) { | ||
return filePair.src.filter(function (filepath) { | ||
if (!grunt.file.exists(filepath)) { | ||
grunt.log.warn('Source file "' + chalk.cyan(filepath) + '" not found.'); | ||
return false; | ||
} | ||
else { | ||
return true; | ||
} | ||
}); | ||
} | ||
function loadJSON(path) { | ||
if (!grunt.file.exists(path)) { | ||
grunt.log.warn('JSON file "' + chalk.cyan(path) + '" not found.'); | ||
return false; | ||
} | ||
else { | ||
return grunt.file.readJSON(path); | ||
} | ||
} | ||
function handleOptions() { | ||
// Defaults | ||
function cfg() { | ||
// Defaults. | ||
var options = this.options({ | ||
verbose: false, | ||
config: null, | ||
display: { | ||
access: ['public', 'private'], | ||
alias: false, | ||
watermark: true | ||
}, | ||
groups: { | ||
'undefined': 'Ungrouped' | ||
}, | ||
package: null, | ||
theme: 'default', | ||
basePath: null, | ||
force: false, | ||
interactive: true | ||
noUpdateNotifier: true | ||
}); | ||
// If a config file is passed and found, | ||
// its options will prevail over defauts. | ||
if (options.config) { | ||
var config = loadJSON(options.config); | ||
// Instantiate a new SassDoc Logger. | ||
var logger = new sassdoc.Logger(options.verbose); | ||
if (config) { | ||
options = _.assign(options, config); | ||
} | ||
} | ||
// Load raw configuration. | ||
var config = sassdoc.cfg.pre(options.config, logger); | ||
// If a package path is passed try to load the file. | ||
if (_.isString(options.package)) { | ||
options.package = loadJSON(options.package); | ||
} | ||
// If options.package is not usable, delete it. | ||
if (!_.isPlainObject(options.package) || _.isEmpty(options.package)) { | ||
options = _.omit(options, 'package'); | ||
} | ||
// Ensure that options take precedence over configuration values. | ||
ensure(config, options); | ||
// Enable SassDoc logger. | ||
if (options.verbose) { | ||
sassdoc.logger.enabled = true; | ||
} | ||
// Post process configuration. | ||
sassdoc.cfg.post(config); | ||
// Clean options not expected by SassDoc. | ||
options = _.omit(options, ['verbose', 'config']); | ||
return options; | ||
return config; | ||
} | ||
grunt.registerMultiTask('sassdoc', 'Generates documentation', function () { | ||
var done = this.async(); | ||
var target = this.target; | ||
var options = handleOptions.call(this); | ||
var config = cfg.call(this); | ||
function compile(filePair) { | ||
var src = validateSrc(filePair); | ||
var dest = filePair.dest; | ||
var src = filePair.orig.src; | ||
var dest = filePair.orig.dest; | ||
@@ -103,4 +50,2 @@ if (!src.length) { | ||
src = src[0]; | ||
// Emit start event if anyone is listening. | ||
@@ -111,3 +56,3 @@ if (grunt.event.listeners('sassdoc.start').length > 0) { | ||
sassdoc.documentize(src, dest, options) | ||
sassdoc.documentize(src, dest, config) | ||
.then(function () { | ||
@@ -122,4 +67,3 @@ grunt.log.ok('SassDoc documentation successfully generated.'); | ||
done(); | ||
}) | ||
.catch(function (err) { | ||
}, function (err) { | ||
grunt.log.error(err); | ||
@@ -126,0 +70,0 @@ grunt.fail.warn('SassDoc documentation failed.'); |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3
6050
55
1
+ Addedacorn@1.2.22.7.0(transitive)
+ Addedacorn-globals@1.0.9(transitive)
+ Addedasap@1.0.0(transitive)
+ Addedasync-each@0.1.6(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcdocparser@0.11.2(transitive)
+ Addedcharacter-parser@1.2.1(transitive)
+ Addedchokidar@0.12.6(transitive)
+ Addedclean-css@3.4.28(transitive)
+ Addedclone@0.2.01.0.4(transitive)
+ Addedclone-stats@0.0.1(transitive)
+ Addedcommander@2.6.02.8.1(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedconstantinople@3.0.2(transitive)
+ Addedcss@1.0.8(transitive)
+ Addedcss-parse@1.0.4(transitive)
+ Addedcss-stringify@1.0.5(transitive)
+ Addeddargs@3.0.1(transitive)
+ Addeddefaults@1.0.4(transitive)
+ Addeddocopt@0.4.1(transitive)
+ Addedduplexer2@0.0.2(transitive)
+ Addedfind-index@0.1.1(transitive)
+ Addedfirst-chunk-stream@1.0.0(transitive)
+ Addedfsevents@0.3.8(transitive)
+ Addedgaze@0.5.2(transitive)
+ Addedglob@4.5.3(transitive)
+ Addedglob-stream@3.1.18(transitive)
+ Addedglob-watcher@0.0.6(transitive)
+ Addedglob2base@0.0.12(transitive)
+ Addedglobule@0.1.0(transitive)
+ Addedgraceful-fs@2.0.3(transitive)
+ Addedgraceful-readlink@1.0.1(transitive)
+ Addedhandlebars@2.0.0(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedis-promise@1.0.12.2.2(transitive)
+ Addedis-utf8@0.2.1(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedjade@1.11.0(transitive)
+ Addedjstransformer@0.0.2(transitive)
+ Addedlodash@1.0.2(transitive)
+ Addedmerge@1.2.1(transitive)
+ Addedminimatch@2.0.10(transitive)
+ Addedmultipipe@0.1.2(transitive)
+ Addedmustache@0.8.2(transitive)
+ Addednan@2.22.0(transitive)
+ Addednunjucks@1.3.4(transitive)
+ Addedoptimist@0.3.7(transitive)
+ Addedordered-read-streams@0.1.0(transitive)
+ Addedpromise@2.0.06.1.0(transitive)
+ Addedreadable-stream@1.0.341.1.14(transitive)
+ Addedreaddirp@1.3.0(transitive)
+ Addedsass-convert@0.2.4(transitive)
+ Addedsassdoc@2.0.0-rc.6(transitive)
+ Addedsassdoc-extras@2.0.0-rc.1(transitive)
+ Addedsassdoc-theme-default@2.0.0-rc.8(transitive)
+ Addedscss-comment-parser@0.5.1-rc.4(transitive)
+ Addedsemver@4.3.6(transitive)
+ Addedsource-map@0.1.430.4.4(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedstrip-bom@1.0.0(transitive)
+ Addedthemeleon@2.0.1(transitive)
+ Addedthrough2@0.6.5(transitive)
+ Addedtransformers@2.1.0(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addeduglify-js@2.2.52.3.6(transitive)
+ Addedunique-stream@1.0.0(transitive)
+ Addedvinyl@0.4.6(transitive)
+ Addedvinyl-fs@0.3.14(transitive)
+ Addedvoid-elements@2.0.1(transitive)
+ Addedwith@4.0.3(transitive)
+ Addedxtend@4.0.2(transitive)
- Removedchalk@^0.5.0
- Removedcdocparser@0.4.0(transitive)
- Removeddocopt@0.6.2(transitive)
- Removedfdocopt@0.1.3(transitive)
- Removedsassdoc@1.10.12(transitive)
- Removedsassdoc-extras@1.0.3(transitive)
- Removedsassdoc-theme-default@1.7.4(transitive)
- Removedscss-comment-parser@0.5.0(transitive)
- Removedsemver@3.0.1(transitive)
- Removedthemeleon@0.2.11.0.4(transitive)
- Removedthemeleon-swig@0.2.1(transitive)
Updatedsassdoc@2.0.0-rc.6