Fork me on GitHub
#tools-deps
<
2022-02-05
>
hlship00:02:59

What's the thinking on having one alias "depend" on another; for example, in our libs, we tend to have a :dev alias that defines test namespaces and dependencies, and then a :test alias that brings in the test-runner dependency and exec-fn; we end up having to execute clj -X:dev:test. What would be the repercussions of something like {:depends-on [:dev]} to incorporate aliases. I have to imagine this is something you've already considered.

practicalli-johnny08:02:33

My own thoughts are about the complexity this will bring, especially if one alias depends one another which then depends on another… At present aliases are defined without dependencies on other aliases, so I consider them akin to pure functions. The results of composing aliases, :dev:test, it therefore simple to understand Adding dependencies between aliases feel like it will easily break this simple model and make aliases more complex. I am sure we appreciate the circular dependencies challenges that arise from library dependencies when each library includes a range of other libraries. I assume alias dependencies would also increase the complexity of the tooling that needs to processes those alias dependencies. I therefore value keeping aliases simple and self-defined

2
💯 1
seancorfield01:02:56

@hlship I think that's probably one of the most requested features in one form or another... There's at least one Q on http://ask.clojure.org about (which may have a JIRA link).

seancorfield01:02:27

The latter would allow you to have a :test alias that expanded to :dev:runner for example.

seancorfield01:02:30

(the first two are more about aliases in projects you depend on -- your :depends-on threw me for a second there, until I re-read it and posted that third link!)

practicalli-johnny08:02:33

My own thoughts are about the complexity this will bring, especially if one alias depends one another which then depends on another… At present aliases are defined without dependencies on other aliases, so I consider them akin to pure functions. The results of composing aliases, :dev:test, it therefore simple to understand Adding dependencies between aliases feel like it will easily break this simple model and make aliases more complex. I am sure we appreciate the circular dependencies challenges that arise from library dependencies when each library includes a range of other libraries. I assume alias dependencies would also increase the complexity of the tooling that needs to processes those alias dependencies. I therefore value keeping aliases simple and self-defined

2
💯 1
practicalli-johnny08:02:24

Taking my user level aliases as an example, I create many aliases with a specific purpose which can mostly be used by themselves. This makes the Clojure command simple and more deterministic https://github.com/practicalli/clojure-deps-edn