cljdoc

Adam Helins 2022-09-24T20:57:12.543489Z

Maybe you'll advise a better way to do the following. I'd like to release on Clojars a library that depends on tools.build. Since it is a git dependency, it won't appear in the POM file or anywhere in the jar and cljdoc analysis will fail ; tools.build will be missing. My solution is to wrap the tools.build functions I need in delays with a requiring-resolves and deref at runtime. That way, analysis should pass and users can add tools.buildto their project themselves. However this is certainly cumbersome. Any other alternatives? 🙏

Adam Helins 2022-09-26T11:58:25.172839Z

@seancorfield Well the lib is part of a monorepo in construction and as such can't be imported as a git dep. This is because prepping a lib is fully static and cannot take any arguments. Until this is true, I don't think it will be possible consuming only part of a monorepo.

seancorfield 2022-09-26T21:30:08.784349Z

@adam678 The poly tool is part of a monorepo but can be used as a git dep -- see :deps/root for how to point a git dep into a monorepo.

seancorfield 2022-09-25T21:19:02.619239Z

From a practical p.o.v. you really can't release libraries to Clojars (or Maven) if they rely on git deps -- you have to release them as git deps. There's a lot of tooling that isn't going to work properly, I suspect, and I have to ask: if your users need to add tools.build as a local git dep anyway to use your library, why not release your library as a git dep (and then it can depend on tools.build and users won't also need to add that themselves)?

seancorfield 2022-09-25T21:19:32.369179Z

I see no value in releasing such libs to Clojars -- only downsides.

lread 2022-09-25T21:20:33.997879Z

Oh thanks @seancorfield for answering, and sorry @adam678 for not noticing your followup!

lread 2022-09-25T21:22:22.875129Z

Also note: cljdoc only currently supports building docs from clojars released libs. We don’t yet have support building from a git hosted projects.

lread 2022-09-24T21:25:15.397019Z

Hiya @adam678! What some folks do is include those deps in their poms but mark them with a scope of provided. Here’s https://github.com/cljdoc/cljdoc/blob/master/doc/userguide/for-library-authors.adoc#getting-dependencies-right in our docs.

Adam Helins 2022-09-25T06:24:31.163499Z

Thanks @lee! But how would that work with a git dependency? 🤔

Adam Helins 2022-09-27T07:00:48.438159Z

@seancorfield I asked about that on #tools-deps to get a general answer but maybe you have a more practical experience. What happens when the same polylith repo is consumed twice as a gitlib? By pointing to different :deps/root?

seancorfield 2022-09-27T15:04:40.718839Z

They are treated as separate deps (since they have separate lib names).

seancorfield 2022-09-27T15:07:33.566339Z

Ah, I see Alex mentioned the transitive deps issue which, yeah, use true for any transitive deps that can conflict and can't be compared.

Adam Helins 2022-09-27T15:09:28.971459Z

So my hypothesis was there shouldn't be any problem as long as libs from the same repo are required with the same SHA. At least in a polylith-style repo where libs refer to other local libs via :local/root. Do you concur?

lread 2022-09-27T15:42:15.408459Z

(I’m not sure but I think you two aren’t talking about cljdoc anymore, that’s totally fine, but if you have cljdoc questions, lemme know, and I’ll try to answer them)

seancorfield 2022-09-27T17:21:42.432669Z

Yeah, this really wasn't a cljdoc Q 🙂

❤️ 3