forked from ember-bootstrap/ember-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
42 lines (37 loc) · 1.19 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* eslint-env node */
const gulp = require('gulp');
const ghPages = require('gulp-gh-pages');
const execa = require('execa');
const merge = require('merge-stream');
const striptags = require('striptags');
const transform = require('gulp-transform');
const insert = require('gulp-insert');
gulp.task('docs:api', function() {
return execa('ember', ['ember-cli-yuidoc']);
});
gulp.task('docs:app', function() {
return execa('ember', ['build', '--prod']);
});
gulp.task('docs:publish', gulp.series(gulp.parallel('docs:api', 'docs:app'), function() {
return merge(
gulp.src('docs/api/**/*', { base: 'docs' }),
gulp.src('dist/**/*'),
gulp.src('CHANGELOG.md').pipe(transform(striptags, { encoding: 'utf8' }))
)
.pipe(ghPages());
}));
gulp.task('changelog', function() {
let index = process.argv.indexOf('--tag');
let args = ['-s'];
if (index !== -1) {
let tag = process.argv[index + 1];
args.push('--next-version', tag);
}
return execa('node_modules/lerna-changelog/bin/cli.js', args)
.then(({ stdout }) => {
return gulp.src('CHANGELOG.md')
.pipe(insert.prepend(stdout))
.pipe(gulp.dest('./'));
});
});
gulp.task('docs', gulp.series('docs:publish'));