gulp-help-doc
Advanced tools
Comparing version 1.0.5 to 1.0.6
18
index.js
@@ -39,3 +39,3 @@ /** | ||
* }, | ||
* gulpfile: 'gulpfile.js' | ||
* isTypescript: boolean | ||
* }} ConfigOptions | ||
@@ -54,5 +54,3 @@ */ | ||
logger: console, | ||
gulpfile: fs.existsSync('gulpfile.ts') ? | ||
'gulpfile.ts' : | ||
'gulpfile.js' | ||
isTypescript: fs.existsSync('gulpfile.ts') | ||
}; | ||
@@ -108,3 +106,13 @@ | ||
function build(gulp) { | ||
var source = fs.readFileSync('./' + OPTIONS.gulpfile).toString(); | ||
// make sure we don't loose anything from required files | ||
// @see https://github.com/Mikhus/gulp-help-doc/issues/2 | ||
// currently this is not supported for typescript | ||
var source = OPTIONS.isTypescript ? | ||
fs.readFileSync('gulpfile.ts').toString() : | ||
Object.keys(require.cache || {'gulpfile.js': ''}).map(function(file) { | ||
if (!/node_modules|\.json$/.test(file)) { | ||
return fs.readFileSync(file).toString() + '\n'; | ||
} | ||
}).join(''); | ||
var rxDoc = '\\/\\*\\*\\r?\n(((?!\\*\\/)[\\s\\S])*?)' + | ||
@@ -111,0 +119,0 @@ '@task\\s+\\{(.*)?\\}((?!\\*\\/)[\\s\\S])*?\\*\\/'; |
{ | ||
"name": "gulp-help-doc", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Gulp available tasks usage information based on jsdoc-like notations", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha" | ||
"test": "./node_modules/.bin/mocha", | ||
"toc": "./node_modules/.bin/markdown-toc -i README.md" | ||
}, | ||
@@ -31,4 +32,5 @@ "repository": { | ||
"gulp": "^3.9.1", | ||
"markdown-toc": "^0.12.16", | ||
"mocha": "^2.5.3" | ||
} | ||
} |
@@ -6,2 +6,13 @@ # gulp-help-doc | ||
<!-- toc --> | ||
- [Install](#install) | ||
- [Using](#using) | ||
- [How it works?](#how-it-works) | ||
- [Restrictions](#restrictions) | ||
- [API](#api) | ||
- [License](#license) | ||
<!-- tocstop --> | ||
## Install | ||
@@ -113,2 +124,8 @@ | ||
## Restrictions | ||
When using TypeScript version of gulpfile it does not support task | ||
doc definitions outside of main `gulpfile.ts`, so it is recommended to | ||
describe with docs all tasks in a main gulpfile. | ||
## API | ||
@@ -115,0 +132,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16533
329
164
4
297