File tree 9 files changed +56
-11
lines changed
9 files changed +56
-11
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,5 @@ resources/public/ui
12
12
.store
13
13
out
14
14
. # *
15
+ .clj-kondo
16
+ .lsp /.cache
Original file line number Diff line number Diff line change
1
+ {:project-specs [:classpath-cmd [" cat" " .cpcache/launchpad.edn" ]]}
Original file line number Diff line number Diff line change 2
2
3
3
## Added
4
4
5
+ - Write the current classpath to ` .cpcache/launchpad.cp ` , for integrating third
6
+ parties like clojure-lsp. (configure ` cat .cpache/launchpad.cp ` as your
7
+ ` :classpath-cmd ` )
8
+ - Call ` (user/go) ` in a ` try/catch `
9
+ - Start the watcher on a separate thread, it can take a long time to boot, and
10
+ meanwhile we shouldn't block REPL startup.
11
+
5
12
## Fixed
6
13
7
- ## Changed
14
+ - Pick up any ` :deps ` from ` deps.local.edn ` at startup, not at the first
15
+ classpath reload
8
16
9
17
# 0.11.59-alpha (2022-10-21 / 8454771)
10
18
@@ -90,4 +98,4 @@ Initial release
90
98
- lambdaisland.classpath integration
91
99
- Support for cider-nrepl, refactor-nrepl
92
100
- Basic support for shadow-cljs cljs nREPL-base REPL
93
- - Auto-connect for Emacs
101
+ - Auto-connect for Emacs
Original file line number Diff line number Diff line change 1
1
{:deps
2
2
{lambdaisland/open-source {:git/url " https://github.com/lambdaisland/open-source"
3
3
:sha " 7f39ffb76d47e2ff83d4478957c2ca4fd180f3e5"
4
- #_#_:local/root " ../open-source" }}}
4
+ #_#_:local/root " ../open-source" }
5
+ com.lambdaisland/launchpad {:local/root " ." }}}
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bb
2
+ (ns transit.dev-repl.main
3
+ (:require [lambdaisland.launchpad :as launchpad]))
4
+
5
+ (launchpad/main {})
Original file line number Diff line number Diff line change 2
2
3
3
:deps
4
4
{org.clojure/clojure {:mvn/version " 1.11.1" }
5
- com.lambdaisland/dotenv {:mvn/version " 0.1.1 " }}
5
+ com.lambdaisland/dotenv {:mvn/version " 0.2.5 " }}
6
6
7
7
:aliases
8
8
{:clojure { :extra-deps {babashka/babashka {:mvn/version " 1.0.164" :scope " provided" }
16
16
17
17
:test
18
18
{:extra-paths [" test" ]
19
- :extra-deps {lambdaisland/kaocha {:mvn/version " 1.70.1086 " }}}}}
19
+ :extra-deps {lambdaisland/kaocha {:mvn/version " 1.71.1119 " }}}}}
Original file line number Diff line number Diff line change 158
158
:else
159
159
b))
160
160
deps-edn deps-local))
161
+ ; ; Pull these out and inject them into -Sdeps, otherwise they are only
162
+ ; ; picked up with the next reload
163
+ (update :extra-deps merge (:deps deps-local))
161
164
; ; It seems like if we set `{:aliases {}}` via `-Sdeps` it overrides
162
165
; ; deps.edn aliases, rather than merging them, so we merge them
163
166
; ; ourselves and pass them all to -Sdeps. Needs more testing to see if
217
220
(-> ctx
218
221
(update :requires conj 'lambdaisland.launchpad.watcher)
219
222
(update :eval-forms (fnil conj [])
220
- `(lambdaisland.launchpad.watcher/watch! ~watch-handlers)))))
223
+ `(future
224
+ (lambdaisland.launchpad.watcher/watch! ~watch-handlers))))))
221
225
222
226
(defn clojure-cli-args [{:keys [aliases requires nrepl-port java-args middleware extra-deps alias-defs eval-forms] :as ctx}]
223
227
(cond-> [" clojure" ]
238
242
(cond-> ctx
239
243
(:go options)
240
244
(update :eval-forms (fnil conj [])
241
- '(user/go))))
245
+ '(try
246
+ (user/go )
247
+ (catch Exception e
248
+ (println " (user/go) failed" e))))))
242
249
243
250
(defn run-nrepl-server [{:keys [nrepl-port middleware] :as ctx}]
244
251
(-> ctx
258
265
(as-> ctx <>
259
266
(update <> :extra-deps assoc 'com.lambdaisland/classpath classpath-coords)
260
267
(update <> :requires conj 'lambdaisland.launchpad.deps)
268
+ (update <> :eval-forms (fnil conj [])
269
+ `(lambdaisland.launchpad.deps/write-cpcache-file))
261
270
(register-watch-handlers
262
271
<>
263
272
`(lambdaisland.launchpad.deps/watch-handlers
Original file line number Diff line number Diff line change 3
3
[clojure.edn :as edn]
4
4
[clojure.java.io :as io]
5
5
[clojure.tools.deps.alpha :as deps]
6
- [lambdaisland.classpath.watch-deps :as watch-deps]))
6
+ [clojure.string :as str]
7
+ [lambdaisland.classpath.watch-deps :as watch-deps]
8
+ [lambdaisland.classpath :as licp]))
7
9
8
10
(defn basis [opts]
9
11
(let [deps-local-file (io/file " deps.local.edn" )
14
16
(update :aliases concat (:launchpad/aliases deps-local))
15
17
(assoc :extra extra-deps)))))
16
18
19
+ (defn write-cpcache-file
20
+ " Write the current classpath to well-known location. Can be used to configure
21
+ things like LSP that try to guess the classpath without having a running
22
+ process.
23
+
24
+ e.g. .lsp/config.edn
25
+ ```
26
+ {:project-specs [:classpath-cmd [\" cat\" \" .cpcache/launchpad.edn\" ]]}
27
+ ```
28
+ "
29
+ []
30
+ (spit " .cpcache/launchpad.cp"
31
+ (str/join
32
+ " :"
33
+ (time (mapcat second (licp/classpath-chain ))))))
34
+
17
35
(defn watch-handlers [opts]
18
36
(let [basis (basis opts)
19
37
deps-paths (cond-> [(watch-deps/path watch-deps/process-root-path " deps.edn" )
27
45
(conj (watch-deps/canonical-path (:extra opts)))
28
46
:always
29
47
(concat (:watch-paths opts)))
30
- handler (partial #'watch-deps/on-event deps-paths opts)]
48
+ handler (fn [e]
49
+ (#'watch-deps/on-event deps-paths opts e)
50
+ (write-cpcache-file ))]
31
51
(into {}
32
52
(map (fn [p]
33
53
[(str p) handler]))
Original file line number Diff line number Diff line change 106
106
(recur ))))))
107
107
108
108
#_(start-builds :main )
109
-
110
- (require 'shadow.build)
109
+ #_(require 'shadow.build)
You can’t perform that action at this time.
0 commit comments