Hey all. I’ve been marinating in an idea for a short while now and wanted to get some feedback on it. The TL;DR is: an easy CLI tool that would wrap common deps.edn aliases, with an easy and simple escape hatch for when you’re ready to move on from it.
The problem I’d like to try and solve is: I think there’s a hole in the tools-deps side of things, where leiningen and other tools work super well, like packaging projects, generating projects, adding dependencies, etc. The nice thing about having them in one umbrella tool is that all of those commands are easily discoverable.
Currently there are many people developing excellent applications that fit those use cases and work as aliases. I’m interested in the discoverability and ease, esp. for new developers, who I work with a lot at work. I’m more talking about the developer UX.
My proposed solution would be to have a utility that could provide easy access to a collection of “default” commands for people getting started with tools-deps. It would essentially serve as a wrapper around tools-deps aliases, with some functionality to update and then “inject” them for customization in particular projects.
Here’s an example. I’ve named the utility plum
for the extent of this message
$ plum update # pulls the latest utility aliases and installs them to your global deps.edn
Pulling latest...
Backing up /Users/will/.clojure/deps.edn to /Users/will/.clojure/deps.edn.bak.
Installing aliases into /Users/will/.clojure/deps.edn.
Success!
$ plum new app foo.core # alias for seancorfield/clj-new
$ cd foo
$ plum test # alias for com.cognitect/test-runner
Running tests in #{"test" "src/test/clojure"}
Testing foo.bar-test
FAIL in (a-test) (bar_test.clj:7)
FIXME, I fail.
expected: (= 0 1)
actual: (not (= 0 1))
Ran 1 tests containing 1 assertions.
1 failures, 0 errors.
The novel part of this is the inject
command which will take one of the aliases, and insert it into the local deps.edn file to allow for customization
$ plum inject test
Adding new alias :plum/test. This will modify your deps.edn. OK? (Y/n)
y
Adding alias.
Success!
You can then modify the local alias and run the modified version with plum test
, or via clojure -A:plum/test
. it does not require e.g. team mates to have the tool installed to use these same commands.
I think that this would act as a nice spring-board for users who are newer to the tools-deps ecosystem - perhaps they’re coming from Leiningen, or other languages with similar kitchen-sink tooling - while giving them an easy way to eject (well, inject ) once they’ve outgrown the simple commands and want to customize their projects more.
I’ve created plum
here which is a representation of my current ideas around it. Feedback would be appreciated. Does this sound like a good idea? Would people be willing to contribute?
My hope, if this is something that would add value, would be that this would live in clj-commons or something where the community would be able to participate in what aliases we include, and ensure that proper attribution is given.