forked from mentat-collective/emmy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bb.edn
78 lines (66 loc) · 2.13 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
76
77
78
{:deps {org.babashka/http-server {:mvn/version "0.1.11"}
org.babashka/cli {:mvn/version "0.2.23"}
io.github.clj-kondo/clj-kondo-bb
{:git/sha "178b027e827172da0d63122a754bb4d765a6faeb"}}
:tasks
{:requires ([babashka.cli :as cli])
:init
(do (def cli-opts
(cli/parse-opts *command-line-args* {:coerce {:port :int}}))
(defn X [cmd]
(let [args *command-line-args*]
(if (even? (count args))
(apply shell cmd args)
(do (println "Please supply an even number of arguments!")
(System/exit 1))))))
repl
{:doc "Start a REPL with `emmy.env` loaded."
:task (shell "clj -M:test:dev:repl")}
test:clj
{:doc "Run CLJ tests."
:task (shell "clojure -X:test:runner")}
test:cljs
{:doc "Run CLJS tests."
:task (shell "npm run test")}
clerk-watch
{:doc "Runs `user/serve!` with a watcher process generating custom JS."
:task (X "clojure -X:nextjournal/clerk user/serve!")}
build-static
{:doc "Generate a fresh static build."
:task
(apply shell
"clojure -X:nextjournal/clerk"
*command-line-args*)}
serve
{:doc "Serve static assets"
:requires ([babashka.http-server :as server])
:task (server/exec
(merge {:port 8080
:dir "public/build"}
cli-opts))}
release-gh-pages
{:doc "Generate a fresh static build and release it to Github Pages."
:task
(do (shell "rm -rf public/build")
(run 'build-static)
(shell "npm run gh-pages"))}
publish-local
{:doc "Generate a fresh static build and start a local webserver."
:task
(do (run 'build-static)
(run 'serve))}
release
{:doc "Release the library to Clojars."
:task (shell "clojure -T:build publish")}
lint-deps
{:requires ([clj-kondo.core :as kondo])
:doc "Lint dependencies."
:task (kondo/run!
{:lint [(with-out-str
(babashka.tasks/clojure
"-Spath -A:nextjournal/clerk"))]
:dependencies true})}
lint
{:doc "Lint with clj-kondo."
:task (exec 'clj-kondo.core/exec)
:exec-args {:lint ["src" "test" "dev"]}}}}