-
Notifications
You must be signed in to change notification settings - Fork 3
/
bb.edn
75 lines (74 loc) · 5.17 KB
/
bb.edn
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
{:paths []
:deps {org.babashka/cli {:mvn/version "0.4.39"}}
:tasks {compile-css {:doc "Compile SCSS -> CSS"
:task (do
(println "Compiling scss to css")
(shell {:dir "resources/scss"} "npx sass --no-source-map -s compressed main.scss:../public/css/main.css"))}
watch-css {:doc "Watch & recompile SCSS to CSS on file changes"
:task (do
(println "Watching SCSS under resources/scss")
(shell {:dir "resources/scss"} "npx sass --watch --no-source-map -s compressed main.scss:../public/css/main.css"))}
extract-fonts {:doc "Extract fonts"
:task (do
(println "Extracting fonts to resources/public/fonts/")
(shell {:dir "resources"} (format "unzip -P %s fonts.zip -d public/fonts/" (first *command-line-args*))))}
compile-contracts {:doc "Compile smart contracts"
:task (do
(println "Compiling smart contracts")
(shell "npx truffle compile"))}
pack-ui-dependencies {:doc "Generate a single js file from all npm dependencies"
:task (do
(println "Packing ui dependencies")
(shell "npx webpack"))}
watch-ui {:doc "Watch and compile ui code changes CLJS -> JS in src/ui/**"
:requires ([babashka.cli :as cli])
:task (let [aliases (or *command-line-args* [])
command-args (format "-M:dev:shadow-cljs%s watch ui" (clojure.string.join "" aliases))]
(println "Starting watch-ui. args:" command-args)
(clojure command-args))}
compile-ui {:doc "Compile ui CLJS -> JS in src/ui/** for release"
:requires ([babashka.cli :as cli])
:task (let [aliases (or *command-line-args* [])
command-args (format "-M:shadow-cljs%s release ui" (clojure.string.join "" aliases))]
(println "Preparing UI for release. args:" command-args)
(clojure command-args))}
release-ui {:doc "compile project and pack all dependencies for release"
:requires ([babashka.cli :as cli])
:depends [compile-ui pack-ui-dependencies]}
watch-server {:doc "Watch and compile server code changes CLJS -> JS in src/server/**"
:requires ([babashka.cli :as cli])
:task (let [aliases (or *command-line-args* [])
command-args (format "-M:dev:shadow-cljs%s watch server" (clojure.string.join "" aliases))]
(println "Starting watch server args:" command-args)
(clojure command-args))}
release-server {:doc "Compile server CLJS -> JS in src/server/** for release"
:requires ([babashka.cli :as cli])
:task (let [aliases (or *command-line-args* [])
command-args (format "-M:shadow-cljs%s release server" (clojure.string.join "" aliases))]
(println "Preparing server for release:" command-args)
(clojure command-args))}
watch-ui-server {:doc "Watch and compile both ui and server code changes CLJS -> JS in src/(ui|server)/**"
:requires ([babashka.cli :as cli])
:task (let [aliases (or *command-line-args* [])
command-args (format "-M:dev:shadow-cljs%s watch ui server" (clojure.string.join "" aliases))]
(println "Starting watch ui and server args:" command-args)
(clojure command-args))}
run-server {:doc "Start Node.js API server process"
:task (do
(println "Starting Streamtide API server")
(shell "node server/streamtide_server.js"))}
watch-server-tests {:doc "watch server tests"
:task (do
(println "Watch and compile server code changes tests")
(clojure "-M:dev:shadow-cljs watch server-tests"))}
run-server-tests {:doc "run server tests"
:task (do
(println "Running server tests")
(shell "node server/tests/server-tests.js"))}
compile-run-server-tests {:doc "Compile & run server tests"
:task (do
(println "Compiling server tests")
(clojure "-M:dev:shadow-cljs compile server-tests")
(println "Running server tests")
(shell "node server/tests/server-tests.js"))}
}}