36 lines
1.5 KiB
Clojure
36 lines
1.5 KiB
Clojure
{:tasks
|
|
{:requires ([babashka.fs :as fs])
|
|
|
|
clean {:doc "Start from clean slate."
|
|
:task (do (run! fs/delete (fs/list-dir (fs/file "resources" "public" "js") "**.*"))
|
|
(fs/delete-tree ".cpcache")
|
|
(fs/delete-tree ".shadow-cljs"))}
|
|
|
|
dev {:doc "Development build. Starts webserver and watches for changes."
|
|
:task (clojure "-M:dev -m shadow.cljs.devtools.cli watch main")}
|
|
|
|
prod {:doc "Builds production artifacts."
|
|
:task (clojure {:extra-env {"SCI_ELIDE_VARS" "true"}}
|
|
"-M:dev -m shadow.cljs.devtools.cli release main")}
|
|
|
|
dist {:doc "Prepare dist folder for npm package"
|
|
:depends [prod]
|
|
:task (do
|
|
(fs/delete-tree "dist")
|
|
(fs/create-dirs "dist")
|
|
(run! (fn [f] (fs/copy f "dist"))
|
|
(fs/glob "resources/public/js" "*.js")))}
|
|
|
|
bump-version {:doc "Bumps package.json and pushes new git tag"
|
|
:task (do (shell "npm version patch")
|
|
(shell "git push --atomic origin main"
|
|
(str "v" (:version (json/parse-string (slurp "package.json") true)))))}
|
|
|
|
npm-publish {:doc "Updates Github pages with new release build."
|
|
:task (do (run 'dist)
|
|
(run 'bump-version)
|
|
(shell "npm publish"))}
|
|
|
|
gh-pages {:doc "Updates Github pages with new release build."
|
|
:task (shell "script/release.clj")}}}
|