-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
73 lines (55 loc) · 1.83 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
const { series, parallel, src, dest, watch } = require('gulp');
const mocha = require('gulp-mocha');
const zip = require('gulp-zip');
//Convert pdf to json
function extractJson() {
return src('src/pdf2text.js').pipe(dest('functions/convert-pdf-to-json/'));
}
function convertFirestore() {
return src('src/firestore.js').pipe(dest('functions/convert-pdf-to-json/'));
}
function convertHub() {
return src('src/hub.js').pipe(dest('functions/convert-pdf-to-json/'));
}
function convertConfig() {
return src('src/config.json').pipe(dest('functions/convert-pdf-to-json/'));
}
function zipConvert() {
return src('functions/convert-pdf-to-json')
.pipe(zip('convert-pdf-to-json.zip'))
.pipe(dest('dist'))
}
//Extract events from file
function saveFile() {
return src('src/saveFile.js').pipe(dest('functions/convert-pdf-to-json'));
}
function extractEvents() {
return src('src/extractEvents.js').pipe(dest('functions/convert-pdf-to-json'));
}
function formatEvents() {
return src('src/formatEvents.js').pipe(dest('functions/extract-events'));
}
function extractConfig() {
return src('src/config.json').pipe(dest('functions/extract-events/'));
}
function extractHub() {
return src('src/hub.js').pipe(dest('functions/extract-events/'));
}
function extractFirestore() {
return src('src/firestore.js').pipe(dest('functions/extract-events/'));
}
function zipExtract() {
return src('functions/extract-events')
.pipe(zip('extract-events.zip'))
.pipe(dest('dist'))
}
//Receive hub messages
function test() {
return src(['test/*.js']).pipe(mocha());
}
exports.build = series(
test,
parallel(extractJson, convertHub, convertFirestore, saveFile, extractEvents, convertConfig),
parallel(formatEvents, extractHub, extractFirestore, extractConfig),
parallel(zipConvert, zipExtract)
);