-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
121 lines (108 loc) · 2.89 KB
/
gulpfile.babel.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import { series, parallel } from "gulp";
import { sass } from "@coldfrontlabs/gulp-templates";
const paths = {
source: {
src: "scss",
dest: "scss",
},
test: {
src: "test",
dest: "test",
},
selector: "**/*.scss",
};
/**
* Lints all source Sass files.
*
* @returns {Object} - Gulp stream.
*/
export const lintSource = () =>
sass.lint({ source: `${paths.source.src}/${paths.selector}` });
lintSource.description = "Lints all source Sass files.";
/**
* Lints and fixes all source Sass files.
*
* @returns {Object} - Gulp stream.
*/
export const fixSource = () =>
sass.fix({ source: `${paths.source.src}/${paths.selector}` });
fixSource.description = "Lints and fixes all source Sass files.";
/**
* Lints all test Sass files.
*
* @returns {Object} - Gulp stream.
*/
export const lintTests = () =>
sass.lint({ source: `${paths.test.src}/${paths.selector}` });
lintTests.description = "Lints all test Sass files.";
/**
* Lints and fixes all test Sass files.
*
* @returns {Object} - Gulp stream.
*/
export const fixTests = () =>
sass.fix({ source: `${paths.test.src}/${paths.selector}` });
fixTests.description = "Lints and fixes all test Sass files.";
/**
* Compiles all class test Sass files.
*
* @returns {Object} - Gulp stream.
*/
export const compileClass = () =>
sass.compile({
source: `${paths.test.src}/classes/${paths.selector}`,
destination: `${paths.test.src}/classes/results`,
});
compileClass.description = "Compiles all class test Sass files.";
/**
* Compiles all mixin test Sass files.
*
* @returns {Object} - Gulp stream.
*/
export const compileMixin = () =>
sass.compile({
source: `${paths.test.src}/mixins/${paths.selector}`,
destination: `${paths.test.src}/mixins/results`,
});
compileMixin.description = "Compiles all mixin test Sass files.";
/**
* Compiles all other test Sass files.
*
* @returns {Object} - Gulp stream.
*/
export const compileOther = () =>
sass.compile({
source: `${paths.test.src}/other/${paths.selector}`,
destination: `${paths.test.src}/other/results`,
});
compileOther.description = "Compiles all other test Sass files.";
/**
* Lints all Sass files.
*
* @returns {Object} - Gulp stream.
*/
export const lint = parallel(lintSource, lintTests);
lint.description = "Lints all Sass files.";
/**
* Lints and fixes all Sass files.
*
* @returns {Object} - Gulp stream.
*/
export const fix = parallel(fixSource, fixTests);
fix.description = "Lints and fixes all Sass files.";
/**
* Compiles all test Sass files.
*
* @returns {Object} - Gulp stream.
*/
export const compile = parallel(compileClass, compileMixin, compileOther);
compile.description = "Compiles all test Sass files.";
/**
* Lints and compiles all Sass files.
*
* @returns {Object} - Gulp stream.
*/
export const test = series(lint, compile);
test.description = "Lints and compiles all Sass files.";
// Create default task.
export default test;