@@ -37,32 +37,101 @@ and hooking up your editor (if supported, otherwise a manual connect to nREPL is
37
37
needed).
38
38
39
39
It takes information from ` deps.edn ` (checked in) and ` deps.local.edn ` (not
40
- checked in, not yet implemented ) and arguments passed in on the command line to
41
- determine which modules to include, which middleware to add to nREPL, which
42
- shadow-cljs builds to start, etc.
40
+ checked in) and arguments passed in on the command line to determine which
41
+ modules to include, which middleware to add to nREPL, which shadow-cljs builds
42
+ to start, etc.
43
43
44
+ Launchpad integrates with ` lambdaisland.classpath ` to provide hot-reloading of
45
+ ` deps.edn ` and ` deps.local.edn ` , so you can add dependencies to your project,
46
+ switch a dependency to a newer version, or from a Maven-provided jar to a local
47
+ checkout, all without restarting your process and REPL. You can even activate
48
+ additional aliases without restarting. How cool is that?
44
49
45
- ## Features
50
+ ## Project setup
46
51
47
- <!-- installation -->
48
- ## Installation
52
+ See ` template ` for an example setup, you need a few different pieces.
49
53
50
- To use the latest release, add the following to your ` bb.edn ` :
54
+ * ` bb.edn `
51
55
56
+ ``` clj
57
+ {:deps {com.lambdaisland/launchpad { ... }}}
52
58
```
53
- com.lambdaisland/launchpad {:mvn/version "0.0.0"}
59
+
60
+ * ` bin/launchpad `
61
+
62
+ This is the default convention for launchpad-based projects, it provides a
63
+ recognizable, predictable entry point that people will be looking for in your
64
+ project, so use it. This is a simple babashka script invoking launchpad, but
65
+ there's lots of room to customize this. Want to check the Java version, launch
66
+ docker-compose, ensure environment variables are set up? You do that here.
67
+
68
+ ``` clj
69
+ #! /usr/bin/env bb
70
+
71
+ ('require '[lambdaisland.launchpad :as launchpad])
72
+
73
+ (launchpad/main {})
74
+
75
+ ; ; (launchpad/main {:steps (into [(partial launchpad/ensure-java-version 17)]
76
+ ; ; launchpad/default-steps)})
54
77
```
55
78
56
- or add the following to your ` project.clj ` ([ Leiningen] ( https://leiningen.org/ ) )
79
+ * ` deps.edn `
80
+
81
+ You need a top-level ` deps.edn ` , where you reference your sub-projects with
82
+ aliases and ` :local/root ` .
57
83
84
+ ``` clj
85
+ {:deps
86
+ {... good place for dev tooling like portal, scope-capture ...}
87
+
88
+ ; ; Monorepo setup with two subprojects, if you have a multi-repo setup then use
89
+ ; ; paths like `"../proj1"`
90
+ :aliases
91
+ {:proj1
92
+ {:deps {com.example/proj1 {:local/root " proj1" }}}
93
+
94
+ :proj2
95
+ {:deps {com.example/proj2 {:local/root " proj2" }}}}}
58
96
```
59
- [com.lambdaisland/launchpad "0.0.0"]
97
+
98
+ ` proj1 ` and ` proj2 ` are then folders with their own ` deps.edn ` , ` src ` , etc.
99
+
100
+ * ` .gitignore `
101
+
102
+ Make sure to ` .gitignore ` the ` deps.local.edn ` file, this is where you can do
103
+ individual configuration.
104
+
105
+ ``` shell
106
+ echo deps.local.edn >> .gitignore
60
107
```
61
- <!-- /installation -->
62
108
63
- ## Rationale
109
+ * ` deps.local.edn `
110
+
111
+ This follows the structure like ` deps.edn ` , and gets passed to tools.deps as an
112
+ extra source, but there are a few special keys here that you can use to
113
+ configure launchpad.
114
+
115
+ ``` clj
116
+ {; ; regular deps.edn stuff will work in here
117
+ :deps {}
118
+ :aliases {}
119
+
120
+ ; ; but some extra keys are supported to influence launchpad itself
121
+ :launchpad/aliases [:proj1 ] ; additional aliases, will be added to whatever
122
+ ; aliases you specify on the command line
123
+ :launchpad/main-opts [" --emacs" ] ; additional CLI flags, so you can encode your
124
+ ; own preferences
125
+ :launchpad/shadow-build-ids [] ; which shadow builds to start, although it may
126
+ ; be preferable to configure this as part of
127
+ ; specific aliases in your main deps.edn
128
+ }
129
+ ```
64
130
65
- ## Usage
131
+ You don't have to stop there, you could add a ` dev/user.clj ` (add "dev" to your
132
+ ` :paths ` in that case), add other useful scripts or repl sessions, maybe you
133
+ even want to put cross-project integration tests in this repo, but the above is
134
+ the main stuff you need.
66
135
67
136
<!-- opencollective -->
68
137
## Lambda Island Open Source
0 commit comments