Skip to content

Commit 6796c21

Browse files
committed
Docs and auto-detect launchpad version
1 parent c716ca6 commit 6796c21

File tree

3 files changed

+44
-7
lines changed

3 files changed

+44
-7
lines changed

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ docker-compose, ensure environment variables are set up? You do that here.
6868
```clj
6969
#!/usr/bin/env bb
7070

71-
('require '[lambdaisland.launchpad :as launchpad])
71+
(require '[lambdaisland.launchpad :as launchpad])
7272

7373
(launchpad/main {})
7474

@@ -133,6 +133,35 @@ You don't have to stop there, you could add a `dev/user.clj` (add "dev" to your
133133
even want to put cross-project integration tests in this repo, but the above is
134134
the main stuff you need.
135135

136+
## Using Launchpad
137+
138+
When invoking `bin/launchpad` you pass it any aliases you want to start, plus a
139+
number of optional flags. These currently allow injecting the CIDER and/or
140+
refactor-nrepl middleware, which will suffice to use launchpad with Emacs/CIDER,
141+
VS Code/Calva, and probably others.
142+
143+
Please do file issues on Github for your favorite editor environment, we want to
144+
eventually support every Clojure editor out there with a non-negligible user
145+
base.
146+
147+
Emacs is currently best supported, since we are able to query Emacs to find
148+
which versions of cider-nrepl and refactor-nrepl we should inject, and are also
149+
able to instruct Emacs to connect to the REPL, so the whole process is smooth
150+
and automated. This level of integration will not be possible with every editor,
151+
but we can look into what options we have.
152+
153+
```clj
154+
➜ bin/launchpad --help
155+
bin/launchpad <options> [proj1|proj2]+
156+
157+
-h, --help
158+
-v, --verbose Print debug information
159+
--cider-nrepl Include the CIDER nREPL middleware
160+
--refactor-nrepl Include the refactor-nrepl middleware
161+
--cider-connect Automatically connect CIDER
162+
--emacs Shorthand for --cider-nrepl --refactor-nrepl --cider-connect
163+
```
164+
136165
<!-- opencollective -->
137166
## Lambda Island Open Source
138167

src/lambdaisland/launchpad.clj

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@
2424
(def classpath-coords
2525
{:mvn/version "0.4.44"}
2626
#_{:local/root "/home/arne/github/lambdaisland/classpath"})
27-
(def launchpad-coords {
28-
;; :git/url "https://github.com/lambdaisland/launchpad"
29-
;; :git/sha "176b4678c201e2a04e9110c27b39628fd7342a60"
30-
:local/root "/home/arne/github/lambdaisland/launchpad"})
27+
28+
(def default-launchpad-coords
29+
"Version coordinates for Launchpad, which we use to inject ourselves into the
30+
project dependencies for runtime support. Only used when we are unable to find
31+
the current version in `bb.edn`"
32+
{:mvn/version "RELEASE"})
3133

3234
(def verbose? (some #{"-v" "--verbose"} *command-line-args*))
3335

@@ -230,8 +232,14 @@
230232
~@build-ids)))
231233
ctx)))
232234

235+
(defn find-launchpad-coords []
236+
(or
237+
(when (.exists (io/file "bb.edn"))
238+
(get-in (edn/read-string (slurp "bb.edn")) [:deps 'com.lambdaisland/launchpad]))
239+
default-launchpad-coords))
240+
233241
(defn include-launchpad-deps [{:keys [extra-deps] :as ctx}]
234-
(update ctx :extra-deps assoc 'com.lambdaisland/launchpad launchpad-coords))
242+
(update ctx :extra-deps assoc 'com.lambdaisland/launchpad (find-launchpad-coords)))
235243

236244
(defn start-process [{:keys [options aliases nrepl-port env] :as ctx}]
237245
(let [args (clojure-cli-args ctx)]

template/bin/launchpad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bb
22

3-
('require '[lambdaisland.launchpad :as launchpad])
3+
(require '[lambdaisland.launchpad :as launchpad])
44

55
(launchpad/main {})
66

0 commit comments

Comments
 (0)