|
2 | 2 |
|
3 | 3 | Why, hello! :wave: Thank you for your interest in contributing to Boot.
|
4 | 4 |
|
5 |
| -There are a lot of reasons you might be interested in contributing to Boot. |
6 |
| -Because of all the possibilities, there's a chance nothing here will help you. |
7 |
| - |
8 |
| -You should know that we have a friendly and active community that's generally |
9 |
| -happy to answer any questions you might have that might not be served by this |
10 |
| -document. The best places to find us are: |
| 5 | +Before reading, please know that we have a friendly and active community. We're |
| 6 | +generally happy to answer any questions you might have that aren't served by |
| 7 | +this document. The best places to find us are: |
11 | 8 |
|
12 | 9 | * [The `#boot` channel on Clojurians Slack][slack]
|
13 | 10 | * [Our Discourse site][discourse].
|
@@ -86,7 +83,72 @@ the [General Contribution Guidelines](#general-contribution-guidelines).
|
86 | 83 |
|
87 | 84 | ## Contributing a Feature
|
88 | 85 |
|
89 |
| -TODO |
| 86 | +Features are things like new tasks, new arguments for existing "builtin" tasks, or |
| 87 | +anything else that changes or augments the behavior of Boot. |
| 88 | + |
| 89 | +### New arguments to builtin tasks |
| 90 | + |
| 91 | +We accept these pretty regularly. They're backward-compatible from a naming |
| 92 | +perspective because we the Boot maintainers "own" the namespace of argument |
| 93 | +names. That is, builtin task arguments are not user-extensible, and so can't |
| 94 | +conflict with users' `build.boot` files. |
| 95 | + |
| 96 | +However, the number of available argument names for a task is finite, because |
| 97 | +arguments are limited to the alphabetic short option character, and there are only 25 |
| 98 | +available: 26 - 1 for `h`. |
| 99 | + |
| 100 | +The best new task arguments: |
| 101 | + |
| 102 | +* Don't change the behavior of any existing argument or combination of |
| 103 | + arguments. That is, if an argument `-c` is made available, the meaning of `-a |
| 104 | + -b` should stay the same. `-a -b -c` can do something different. |
| 105 | +* Are clearly documented. |
| 106 | + |
| 107 | +### New tasks |
| 108 | + |
| 109 | +We're least likely to accept these, because from a naming perspective, they can |
| 110 | +interfere with names a user creates in `boot.user` via `build.boot`. All of the |
| 111 | +builtin tasks are referred by default into the user's `build.boot`, and each |
| 112 | +time we make one, we effectively take away a potentially good name from a user. |
| 113 | + |
| 114 | +Of course, the user can `ns-unmap` names they don't want to conflict with, but |
| 115 | +this requires a `build.boot` or `~/.boot/profile` code change on their part. We |
| 116 | +try very hard to avoid requiring Boot users to change code because of incidental |
| 117 | +changes. |
| 118 | + |
| 119 | +#### Your own task library |
| 120 | + |
| 121 | +If you have an idea for a task that you'd like to distribute because you think |
| 122 | +it would be useful to others, you should first consider making your own library |
| 123 | +that contains that task. It's best to do this when: |
| 124 | + |
| 125 | +* The task doesn't *need* to run inside Boot: it doesn't influence other builtin |
| 126 | + tasks or leverage Boot's ownership of the filesystem, classpath, and entry |
| 127 | + point. |
| 128 | +* You want to distribute the task before the next Boot release. |
| 129 | + |
| 130 | +For example, Boot has no built-in `new` task. Instead, there is a `boot/new` |
| 131 | +library that provides one. The `new` task can be invoked like: |
| 132 | + |
| 133 | + boot -d boot/new new -t app -n my-app |
| 134 | + |
| 135 | +This works because `boot/new` exports |
| 136 | +the |
| 137 | +[`new`](https://github.com/boot-clj/boot-new/blob/19c0cf2f585cfe0a3d379af854f5e77f4834bf04/src/boot/new.clj#L4) task |
| 138 | +in its `ns` declaration. The `-d` option to Boot looks for exported tasks when |
| 139 | +it loads dependencies, and makes them available at the command line. |
| 140 | + |
| 141 | +If you had idea for a better `new` task, you could create it, and push it to |
| 142 | +Clojars yourself. It would then be accessible to Boot users like this: |
| 143 | + |
| 144 | + boot -d YourName/new new -t app -n my-app |
| 145 | + |
| 146 | +This task is also available to users programmatically. They could use your task via: |
| 147 | + |
| 148 | +```clojure |
| 149 | +(set-env! :dependencies '[[YourName/new "1.0.0"]]) |
| 150 | +(require '[YourName.new :refer [new]]') |
| 151 | +``` |
90 | 152 |
|
91 | 153 | [api-docs]: https://github.com/boot-clj/boot/tree/master/doc
|
92 | 154 | [changes]: https://github.com/boot-clj/boot/blob/master/CHANGES.md
|
|
0 commit comments