-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.babel.js
47 lines (44 loc) · 1.4 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
const concat = require("gulp-concat");
const { src, dest, task } = require("gulp");
const { getFolders } = require("./scripts/buildUtils.js");
const fs = require("fs");
const order = require("gulp-order");
exports.default = task("build-readme", () => {
return src("docs/*.md")
.pipe(
order([
"HEADER.md",
"INSTALLATION.md",
"Imports.md",
"Attributes.md",
"Events.md",
"Slots.md",
"Stylings.md",
"Angular.md",
"React.md",
"Vue.md"
])
)
.pipe(concat("README.md"))
.pipe(dest("."));
});
exports.default = task("concat-stories-js", done => {
const components = getFolders("./src/components");
components.forEach(c => {
if (fs.existsSync(`stories/templates/${c}/additional.stories.js`)) {
return src([`stories/components/${c}.stories.js`, `stories/templates/${c}/additional.stories.js`])
.pipe(concat(`${c}.stories.js`))
.pipe(dest("stories/components"));
} else return done();
});
});
exports.default = task("concat-storybook-mdx", done => {
const components = getFolders("./src/components");
components.forEach(c => {
if (fs.existsSync(`stories/templates/${c}/additional.mdx`)) {
return src([`stories/components/${c}.mdx`, `stories/templates/${c}/additional.mdx`])
.pipe(concat(`${c}.mdx`))
.pipe(dest("stories/components"));
} else return done();
});
});