Skip to content

Commit c716ca6

Browse files
committed
Flesh out the README and configure bin/proj
1 parent 6968f5c commit c716ca6

File tree

2 files changed

+87
-17
lines changed

2 files changed

+87
-17
lines changed

README.md

Lines changed: 82 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,101 @@ and hooking up your editor (if supported, otherwise a manual connect to nREPL is
3737
needed).
3838

3939
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.
4343

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?
4449

45-
## Features
50+
## Project setup
4651

47-
<!-- installation -->
48-
## Installation
52+
See `template` for an example setup, you need a few different pieces.
4953

50-
To use the latest release, add the following to your `bb.edn`:
54+
* `bb.edn`
5155

56+
```clj
57+
{:deps {com.lambdaisland/launchpad { ... }}}
5258
```
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)})
5477
```
5578

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`.
5783

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"}}}}}
5896
```
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
60107
```
61-
<!-- /installation -->
62108

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+
```
64130

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.
66135

67136
<!-- opencollective -->
68137
## Lambda Island Open Source

bin/proj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
(:require [lioss.main :as lioss]))
55

66
(lioss/main
7-
{:license :mpl
8-
:inception-year 2022
9-
:description ""
10-
:group-id "com.lambdaisland"})
7+
{:license :mpl
8+
:inception-year 2022
9+
:description "Clojure dev process launcher"
10+
:group-id "com.lambdaisland"
11+
:version-qualifier "alpha"})
1112

1213
;; Local Variables:
1314
;; mode:clojure

0 commit comments

Comments
 (0)