Prepare npm publish
This commit is contained in:
parent
ab42eb7f26
commit
b9e303dd83
4 changed files with 48 additions and 8 deletions
26
bb.edn
26
bb.edn
|
|
@ -1,13 +1,35 @@
|
|||
{: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")}
|
||||
release {:doc "Updates Github pages with new release build."
|
||||
:task (shell "script/release.clj")}}}
|
||||
|
||||
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")}}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue