tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
souenzzo 2021-04-03T01:42:47.340700Z

Where we can find the http://mvnrepository.com src?!

mokr 2021-04-03T15:20:23.357Z

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.

mokr 2021-04-04T15:08:12.361600Z

I’ve not filed a request at https://ask.clojure.org/index.php/10400/support-for-shorthand-commands-in-tools-deps

mpenet 2021-04-04T17:24:23.372900Z

Just (Justfile) is also a good companion to deps.edn, it's quite easy to replicate most of lein with it +deps.edn

mpenet 2021-04-04T17:25:12.373600Z

https://github.com/casey/just

mpenet 2021-04-04T17:25:49.373900Z

There are many runners like this that can be used for now

vlaaad 2021-04-03T15:25:31.357200Z

Sounds like aliases with :exec-fn and :exec-args

2021-04-03T15:45:57.357400Z

I believe it is semi-common to create short bash scripts and/or Makefile kind of things for this, too.

alexmiller 2021-04-03T15:55:10.357600Z

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

alexmiller 2021-04-03T15:58:31.357900Z

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

alexmiller 2021-04-03T15:58:48.358100Z

or you could fold the :graph alias stuff into that same alias to get down to just clj -X:trace

alexmiller 2021-04-03T15:59:10.358300Z

there is also some additional work coming soon around tool installation

🤤 5
mokr 2021-04-03T16:40:40.358600Z

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.

borkdude 2021-04-03T17:14:01.359100Z

@mokr I am making something like "npm scripts" for babashka: https://github.com/babashka/babashka/discussions/765#discussioncomment-564820 Feel free to give feedback

borkdude 2021-04-03T17:15:59.359400Z

It's already possibly today to "hide" this behind a function and call it like bb -m tasks/my-clojure-invocation

borkdude 2021-04-03T17:17:52.359800Z

Also made a short video about it: https://youtu.be/_zr1dicJs-E

mokr 2021-04-03T17:32:12.360Z

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

borkdude 2021-04-03T17:48:45.360200Z

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.

borkdude 2021-04-03T17:49:56.360600Z

But only having "shortcuts" for specific clojure invocations would already be useful.