-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.sh
executable file
·62 lines (47 loc) · 945 Bytes
/
Taskfile.sh
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
#!/bin/bash
set -e
PATH=./node_modules/.bin:$PATH
# Export environment variables from `.env`
if [ -f .env ]
then
export $(cat .env | sed 's/#.*//g' | xargs)
fi
# //////////////////////////////////////////////////////////////////////////////
# START tasks
build() {
jvdx build --clean -f modern,cjs,esm --no-sourcemap
}
format() {
jvdx format $*
}
lint() {
jvdx lint $*
}
test() {
jvdx test \
--testPathPattern=/tests \
--passWithNoTests \
--env=jsdom \
--setupFilesAfterEnv=./tests/setup-tests.js $*
}
validate() {
lint $*
test $*
}
clean() {
jvdx clean $*
}
run_examples() {
EXAMPLES_CACHE=.examples
parcel "examples/**/*.html" \
--no-source-maps \
--dist-dir ${EXAMPLES_CACHE}/.dist \
--cache-dir ${EXAMPLES_CACHE}/.cache
rm -rf ${EXAMPLES_CACHE}
}
default() {
build
}
# END tasks
# //////////////////////////////////////////////////////////////////////////////
${@:-default}