mranderson icon indicating copy to clipboard operation
mranderson copied to clipboard

Fix broken cljdoc api analysis

Open lread opened this issue 2 years ago • 7 comments

Problem

The MrAnderson readme has a cljdoc badge which is showing "API import failed":

image

I assume that we'd like to fix this.

Diagnosis

Cljdoc is barfing when trying to load mranderson.util namespace. It references leiningen.core.main which is not on the classpath during cljdoc analysis.

Public API

Cljdoc API docs ideally document the public API of a library.

I don't know what the public API of mranderson is, but once I do, we can tell cljdoc to ignore mranderson internals via :no-doc metadata on mranderson namespaces and vars that are considered internal.

This might well be enough to fix cljdoc API analysis. If not we can explore further.

My current guess a public supported nses:

  • mranderson.core
  • mrnaderson.plugin

Next Steps

I am happy to follow up with a PR once we agree on an approach.

lread avatar Sep 13 '22 17:09 lread

Perhaps related?: #34 and #42

lread avatar Sep 13 '22 18:09 lread

I thing mranderson.core and mranderson.plugin is a good guess. I might consider adding mranderson.move as well which is the real gist what mranderson does (based on Stuart Sierra's work) and could be used independently as well I think. Hope this makes sense.

benedekfazekas avatar Sep 14 '22 08:09 benedekfazekas

Cool yeah, that seems good. Once I get the cljdoc analysis working I'll share the API that it documents for your review.

lread avatar Sep 14 '22 14:09 lread

sounds awesome, thanks

benedekfazekas avatar Sep 14 '22 15:09 benedekfazekas

Ok, @benedekfazekas, I have a cljdoc preview from my dev box for you:

image

For some reason, aether is not getting :mranderson/inlined metadata and is therefore included when it should not be. I'll take a peek and raise a separate issue.

Otherwise, we are getting to the nitty gritty of what vars to include for each ns. Any var you include would be part of your public API and therefore supported moving forward (barring any deliberate breaking changes). The ones that seemed very likely to me, I marked in green. For the others, I can make guesses, but easier to ask you.

I did a grep.app to learn what folks are using in the wild. I only see iced-nrepl using MrAnderson directly. It uses mranderson.core/copy-source-files and mranderson.core/mranderson.

Grep.app did not find lein-isolate, which uses mranderson.middleware and leiningen.inline-deps, but I expect leiningen.inline-deps won't be part of your public API, right?

Anyhoo, looking forward to learning your thoughts.

lread avatar Oct 15 '22 01:10 lread

I guess mranderson.core/mranderson mranderson.move are the real candidates. maybe adding a CLI and properly carve away the lein plugin would clarify this a bit more...

benedekfazekas avatar Oct 16 '22 17:10 benedekfazekas

Cool, I propose starting ultra-conservative and only exposing mranderson.core/mranderson.

You can always add things to the supported API at a later date.

That said you have documented the move ns clearly with ALPHA. So you've given a clear warning. If you were to expose mranderson.move, would it just be move-ns fn to start with?

lread avatar Oct 16 '22 17:10 lread