From 8d3f0f51f417386832ec73122ef5c2f903828407 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Mon, 1 May 2023 22:07:20 +0200 Subject: [PATCH] wip --- bb.edn | 7 ++----- build/src/scittle/build.clj | 21 ++++++++++++--------- plugins/datascript/deps.edn | 0 3 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 plugins/datascript/deps.edn diff --git a/bb.edn b/bb.edn index 9fd5a70..9f3560b 100644 --- a/bb.edn +++ b/bb.edn @@ -18,8 +18,7 @@ (fs/delete-tree ".shadow-cljs"))} shadow:watch {:doc "Development build. Starts webserver and watches for changes." - :task (clojure {:extra-env {"SCI_ELIDE_VARS" "true"}} - "-M:dev -m shadow.cljs.devtools.cli watch main")} + :task (build/build *command-line-args* {:action "watch"})} http-server {:doc "Starts http server for serving static files" :requires ([babashka.http-server :as http]) @@ -37,9 +36,7 @@ (deref (promise)))} prod {:doc "Builds production artifacts." - :task (build/release *command-line-args* #_{:wrap-cmd-fn nil #_wrap-cmd}) - #_(clojure {:extra-env {"SCI_ELIDE_VARS" "true"}} - "-M:dev -m shadow.cljs.devtools.cli release main")} + :task (build/build *command-line-args*)} dist {:doc "Prepare dist folder for npm package" :depends [prod] diff --git a/build/src/scittle/build.clj b/build/src/scittle/build.clj index 49c42ff..a3d0712 100644 --- a/build/src/scittle/build.clj +++ b/build/src/scittle/build.clj @@ -43,9 +43,7 @@ feature-configs)) cmd'))) -(defn build - "Build scittle shadow builds using clojure cmd and commandline args. Features on - classpath are automatically added" +(defn- build* [cmd args] (let [building-outside-scittle? (not (fs/exists? "shadow-cljs.edn")) scittle-dir (when building-outside-scittle? @@ -61,9 +59,14 @@ (when building-outside-scittle? (fs/delete "shadow-cljs.edn")))) -(defn release - "Compiles release build." - [args & {:keys [wrap-cmd-fn] :or {wrap-cmd-fn identity}}] - (build (wrap-cmd-fn "-M -m shadow.cljs.devtools.cli --force-spawn release main") - args) - (run! fs/delete (fs/glob "lib" "**.map"))) +(defn build + "Build scittle shadow builds using clojure cmd and commandline args. Features on + classpath are automatically added. + + Options: + + * :action - compile action, defaults to release, but may also be compile or watch" + [args & {:keys [wrap-cmd-fn action] :or {wrap-cmd-fn identity + action "release"}}] + (build* (wrap-cmd-fn (format "-M -m shadow.cljs.devtools.cli --force-spawn %s main" action)) + args)) diff --git a/plugins/datascript/deps.edn b/plugins/datascript/deps.edn new file mode 100644 index 0000000..e69de29