Where we can find the http://mvnrepository.com src?!
Hi, is there any plans to allow some sugar (short names / shortcuts) that would allow one to hide the sometimes long, not so sexy, commands behind a short name? Like Leiningen does with “aliases” (!= deps aliases)?
So that e.g. clj graph
could execute clj -X:graph graph :deps '"mydeps.edn"' :trace true :output '"trace"
I know tools deps is not intended to replace Leiningen, but it seem to have fragmented the already small Clojure(script) community and intended or not, my impression is that it’s used as a replacement as is, with no other tool wrapping it.
I do not mean to be rude and I’m very grateful for all the hard work that Cognitect and others puts into the tech I benefit from. I’m just a bit concerned in regards to how it looks to outsiders and newcomers and that you now need to remember, wrap in a script or copy paste long commands to get things done. Sure you can still use lein, but enough people seem to have transitioned that it’s pretty much mandatory to know both.
PS: If I missed something obvious here, then please enlighten me, nothing would be more welcome.
I’ve not filed a request at https://ask.clojure.org/index.php/10400/support-for-shorthand-commands-in-tools-deps
Just (Justfile) is also a good companion to deps.edn, it's quite easy to replicate most of lein with it +deps.edn
There are many runners like this that can be used for now
Sounds like aliases with :exec-fn and :exec-args
I believe it is semi-common to create short bash scripts and/or Makefile kind of things for this, too.
the best place to file requests is at https://ask.clojure.org (and this is not something that has an existing question specifically for it already afaik) - asking there lets this accumulate votes, which we factor into prioritization
as @vlaaad says, you can get part of the way there by creating an alias with :exec-fn and :exec-args keys and then invoking the alias. for this example, you'd create an alias like:
:trace {:exec-fn graph
:exec-args {:deps "mydeps.edn"
:trace true
:output "trace"}}
and then execute this in combination with the graph tool like:
clj -X:trace:graph
or you could fold the :graph alias stuff into that same alias to get down to just clj -X:trace
there is also some additional work coming soon around tool installation
Thanks, I knew this was close to a feature request, but I wanted to see the reaction to it 🙂 For some reason I keep forgetting that http://ask.clojure.org exists. If that’s the desired channel, then I will consider writing up something around this. Clojure itself and many of the libraries are very elegant and concise and I have the same hopes for the tooling.
@mokr I am making something like "npm scripts" for babashka: https://github.com/babashka/babashka/discussions/765#discussioncomment-564820 Feel free to give feedback
It's already possibly today to "hide" this behind a function and call it like bb -m tasks/my-clojure-invocation
like this: https://github.com/djblue/portal/commit/39144dbe520783e18ec13440c70844b3c207d9b5
Also made a short video about it: https://youtu.be/_zr1dicJs-E
@borkdude Thanks, I think I have had a look at babashka previously, but after a quick read now I see that I should have another look as it might actually fit well in my toolbox. That said, I think my initial question/request should be solved preferably in tools-deps itself to keep things simple. Especially for beginners that will soon enough have to navigate the library landscape in search of pieces that fit together.
Right. It would be useful if deps.edn had something like lein aliases. I wished this existed so I'm implementing it for bb. But I want to support something broader than lein aliases (more something in between npm run and make) and I don't expect deps.edn will support this use case. There is always the startup of the JVM too.
But only having "shortcuts" for specific clojure
invocations would already be useful.