-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
132 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#! /usr/bin/env node | ||
|
||
'use strict' | ||
|
||
const gulp = require('gulp') | ||
const args = require('args-parser')(process.argv) | ||
|
||
require('../src/gulp-log')(gulp) | ||
require('../gulp')(gulp, ['docs']) | ||
|
||
if (args.publish) { | ||
gulp.start('docs:publish') | ||
} else { | ||
gulp.start('docs:build') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,8 @@ module.exports = (gulp, tasks) => { | |
'release', | ||
'coverage', | ||
'lint', | ||
'default' | ||
'default', | ||
'docs' | ||
] | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
module.exports = (gulp) => { | ||
require('./clean/browser')(gulp) | ||
require('./clean/docs')(gulp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict' | ||
|
||
module.exports = (gulp) => { | ||
gulp.task('clean:docs', (done) => { | ||
const rimraf = require('rimraf') | ||
|
||
rimraf('./docs', done) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict' | ||
|
||
module.exports = (gulp) => { | ||
require('./clean')(gulp) | ||
require('./docs/build')(gulp) | ||
require('./docs/publish')(gulp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use strict' | ||
|
||
const pump = require('pump') | ||
const join = require('path').join | ||
const docs = require('gulp-documentation') | ||
const exists = require('path-exists').sync | ||
|
||
const pkg = require('../../config/user').pkg | ||
|
||
module.exports = (gulp) => { | ||
gulp.task('docs:build', ['clean:docs'], (cb) => { | ||
const options = { | ||
github: true | ||
} | ||
|
||
const configFile = join(process.cwd(), 'documentation.yml') | ||
if (exists(configFile)) { | ||
options.config = configFile | ||
} | ||
|
||
pump( | ||
gulp.src([ | ||
'./src/**/*.js' | ||
]), | ||
docs('html', options, { | ||
theme: require.resolve('clean-documentation-theme'), | ||
version: pkg.version, | ||
name: pkg.name | ||
}), | ||
gulp.dest('./docs'), | ||
cb | ||
) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict' | ||
|
||
const join = require('path').join | ||
const ghPages = require('gh-pages') | ||
const util = require('gulp-util') | ||
|
||
module.exports = (gulp) => { | ||
gulp.task('docs:publish', ['docs:build'], (cb) => { | ||
ghPages.publish(join(process.cwd(), 'docs'), { | ||
message: 'docs: auto build', | ||
logger (msg) { | ||
util.log(`'${util.colors.cyan('docs:publish')}' ${msg}`) | ||
} | ||
}, cb) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict' | ||
|
||
const includes = require('lodash.includes') | ||
const runSequence = require('run-sequence') | ||
|
||
module.exports = (gulp) => { | ||
const util = require('gulp-util') | ||
|
||
gulp.task('release:docs', (cb) => { | ||
if (includes(util.env._, 'docs')) { | ||
runSequence.use(gulp)('docs:publish', cb) | ||
return | ||
} | ||
|
||
cb() | ||
}) | ||
} |