This repository has been archived by the owner on Dec 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Gulpfile.js
76 lines (65 loc) · 1.77 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const gulp = require('gulp');
const del = require('del');
const ts = require('gulp-typescript');
const yuidoc = require('gulp-yuidoc');
const jest = require('gulp-jest').default;
/**
* Setup global variables to use across tasks
*/
global.pkg = require('./package.json');
/**
* Constants for the Gruntfile so we can easily change the path for our environments.
*/
gulp.task('ts', function () {
const tsProject = ts.createProject('tsconfig.json');
return gulp.src('ts/**/*.ts')
.pipe(tsProject())
.pipe(gulp.dest('js/'));
});
gulp.task('clean', (done) => {
return del([
'ts/**/*.js'
]);
});
gulp.task('clean:docs', (done) => {
return del([
'docs/'
]);
});
gulp.task('docs', ['clean:docs'], (done) => {
const parserOptions = {
project: {
name: 'StructureJS',
description: pkg.description,
version: pkg.version,
url: pkg.homepage
}
};
const generatorOptions = {
//exclude: env.DIR_SRC + '/assets/vendor',
helpers: [],
themedir: 'friendly-theme',
extension: '.ts',
};
return gulp
.src('ts/**/*.ts')
.pipe(yuidoc.parser(parserOptions))
//.pipe(yuidoc.reporter())
.pipe(yuidoc.generator(generatorOptions))
.pipe(gulp.dest('docs/'))
});
gulp.task('test', () => {
return gulp
.src('__tests__')
.pipe(jest({
config: {
testPathPattern: /.\/__tests__\/.*-test.js/
// "preprocessorIgnorePatterns": [
// "<rootDir>/dist/", "<rootDir>/node_modules/"
// ],
// "automock": false
}
}));
});
gulp.task('default', ['clean', 'ts']);
gulp.task('release', ['default']);