tools-deps

socksy 2023-11-09T22:09:54.734599Z

just found that a Clojure project I maintain has a transient dependency to shadow-cljs due to a badly written :deps map in a cljc local/root lib dependency. But I am wondering — is there actually an idiomatic way to have a cljc lib have different dependencies for clojurescript vs clojure?

favila 2023-11-09T22:15:57.704869Z

I don’t think so. I routinely have to do manual :exclusions. Sometimes the lib will use :provided and make you manually require.

socksy 2023-11-09T22:17:09.821019Z

are there any docs on that?

favila 2023-11-09T22:17:18.485629Z

docs on what?

socksy 2023-11-09T22:18:03.174119Z

I don't know what :provided means exactly, and my googling isn't helping

favila 2023-11-09T22:18:18.124159Z

oh. This is something the lib would do.

favila 2023-11-09T22:19:12.370219Z

:provided is a maven-ism that means this thing is required by the lib at runtime, but won’t be included via transient deps retrievial

socksy 2023-11-09T22:19:46.200559Z

well i have commit access to the lib too so this is totally doable for me. If I were doing a normal project I might split these out into different aliases, but then I believe I would break the cljs project that does want it to depend on some cljs libs. But if it's a maven-ism does that mean that it'll be ignored for a local/root require?

favila 2023-11-09T22:20:02.527439Z

yeah it would be

favila 2023-11-09T22:20:15.847839Z

the equivalent would be hiding it in an alias

socksy 2023-11-09T22:21:28.575359Z

but then for the project that does need those dependencies you won't be able to specify the alias in the :deps map, right?

favila 2023-11-09T22:21:51.915419Z

right, you would need to know (e.g. reading the lib docs) what it needs and provide it yourself

socksy 2023-11-09T22:22:24.750919Z

alright, a list of 10 :exclusions it is then 😅