Skip to content

Commit f1aa0f5

Browse files
committed
Handle :paths in deps.local.edn, and top-level shadow builds
1 parent 8f92cba commit f1aa0f5

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

deps.edn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
com.lambdaisland/dotenv {:mvn/version "0.2.5"}}
66

77
:aliases
8-
{:clojure { :extra-deps {babashka/babashka {:mvn/version "1.0.164" :scope "provided"}
9-
org.clojure/tools.deps.alpha {:mvn/version "0.14.1222"}
8+
{:clojure { :extra-deps {babashka/babashka {:mvn/version "1.0.167" :scope "provided"}
9+
org.clojure/tools.deps.alpha {:mvn/version "0.15.1254"}
1010
com.nextjournal/beholder {:mvn/version "1.0.0"}
11-
thheller/shadow-cljs {:mvn/version "2.20.5"}
11+
thheller/shadow-cljs {:mvn/version "2.20.13"}
1212
com.lambdaisland/classpath {:mvn/version "0.4.44"}}}
1313
:dev
1414
{:extra-paths ["dev"]

src/lambdaisland/launchpad.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
;; Pull these out and inject them into -Sdeps, otherwise they are only
172172
;; picked up with the next reload
173173
(update :extra-deps merge (:deps deps-local))
174+
(assoc :paths (concat (:paths deps-edn) (:paths deps-local)))
174175
;; It seems like if we set `{:aliases {}}` via `-Sdeps` it overrides
175176
;; deps.edn aliases, rather than merging them, so we merge them
176177
;; ourselves and pass them all to -Sdeps. Needs more testing to see if
@@ -233,13 +234,14 @@
233234
`(future
234235
(lambdaisland.launchpad.watcher/watch! ~watch-handlers))))))
235236

236-
(defn clojure-cli-args [{:keys [aliases requires nrepl-port java-args middleware extra-deps alias-defs eval-forms] :as ctx}]
237+
(defn clojure-cli-args [{:keys [aliases requires nrepl-port java-args middleware extra-deps paths alias-defs eval-forms] :as ctx}]
237238
(cond-> ["clojure"]
238239
:-> (into (map #(str "-J" %)) java-args)
239240
(seq aliases)
240241
(conj (str/join (cons "-A" aliases)))
241-
extra-deps
242+
(or extra-deps paths alias-defs)
242243
(into ["-Sdeps" (pr-str {:deps extra-deps
244+
:paths paths
243245
:aliases alias-defs})])
244246
:->
245247
(into ["-M" "-e" (pr-str `(do ~(when (seq requires)

src/lambdaisland/launchpad/shadow.clj

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
(.toAbsolutePath (Path/of "" (into-array String []))))
1414

1515
(defn find-shadow-roots
16-
"Find all libraries included via :local/root that haev a shadow-cljs.edn at
16+
"Find all libraries included via :local/root that have a shadow-cljs.edn at
1717
their root."
1818
[]
19-
(keep (fn [{:local/keys [root]}]
20-
(when (and root (.exists (io/file root "shadow-cljs.edn")))
21-
root))
22-
(vals (:libs (licp/read-basis)))))
19+
(cond-> (keep (fn [{:local/keys [root]}]
20+
(when (and root (.exists (io/file root "shadow-cljs.edn")))
21+
root))
22+
(vals (:libs (licp/read-basis))))
23+
(.exists (io/file "shadow-cljs.edn"))
24+
(conj "")))
2325

2426
(defn read-shadow-config
2527
"Slurp in a shadow-cljs.edn, applying normalization and defaults."
@@ -80,7 +82,9 @@
8082
[build-id
8183
(assoc (update-build-keys process-root module-root v)
8284
:build-id build-id
83-
:js-options {:js-package-dirs [(str module-path "/node_modules")]})])))
85+
:js-options (if (= "" module-path)
86+
{}
87+
{:js-package-dirs [(str module-path "/node_modules")]}))])))
8488

8589
builds))))))
8690
(assoc :deps {})

0 commit comments

Comments
 (0)