Fork me on GitHub
#tools-deps
<
2020-06-15
>
Aleed22:06:04

tools.deps doesn’t load :local/repo aliases, right? how do you handle conditionally loading dev/test/etc aliases on per subproject basis?

Alex Miller (Clojure team)22:06:42

Right, and you don’t

Alex Miller (Clojure team)22:06:02

Something we’ve thought about a little

Alex Miller (Clojure team)22:06:13

But needs more thinking

Aleed22:06:26

yeah, I found some archived slack convos about it. kind of hard to appropriately work with monorepos without such a feature, everything has to configured in the root deps.edn (?)

Aleed23:06:18

what if it aliases were specifically included, just like dependencies are?

{my-subproject {:local/root "./my-subproject"
                :aliases [:dev :test]}}

Alex Miller (Clojure team)23:06:49

I’m not going to start from what if - this needs a design process

9
seancorfield23:06:45

We have a monorepo at work and we specifically use CLJ_CONFIG to set the "user" deps.edn to come from a specific directory in the monorepo so that we have a single, central place for all repo-wide aliases anyone needs. This also helps maintain repeatability because each developer's "user" deps.edn is excluded and we can control exactly what each alias does.

Aleed23:06:47

if subprojects have paths that are loaded based on alias, do you configure this all in the central deps.edn instead? e.g {:extra-paths ["subproject1/test" "subproject2/test"]}

seancorfield23:06:32

It depends on whether the alias (and the optional subproject) are going to be needed for "all" other subprojects or just specific one(s). We scope things appropriately.

⚒️ 3
seancorfield23:06:02

All our subprojects are at the same level so ../subproject/path always works.