The @mantine/hooks barrel exports ~17 non-hook plain functions alongside its use*
hooks (randomId, mergeRefs, getHotkeyHandler, the *Mask family,
read*StorageValue, clamp, range, upperFirst, …). These carry no docgen entry —
so ADR 0002 ("backfill non-docgen surface via hand-written supplements") appears to
apply. It does not.
Decision. Wrap these utilities by widening the generator's barrel enumeration,
not by hand-writing them into a supplement. The mantine.hooks namespace is already
produced by enumerating the @mantine/hooks barrel and filtering to use* — it is
not a docgen-driven namespace. These utilities are present and enumerable in the
very barrel we already crawl; they are omitted only by our own use* predicate. So the
consistent fix is to relax the filter to everything-minus-excludes and reuse the existing
emit-hook-def (a raw-passthrough alias, identical in shape) — routing non-use* names
to a util-docstring/util-docs.edn pair for their docs.
This draws the boundary ADR 0002 left implicit:
Box, compound parts) → supplement.codegen/supplements/hooks.cljc (the ADR 0002 path). Rejected: it
would hand-write, as literal source text, def-aliases for names we can read straight off
the barrel — the exact "hand-maintained crawler-substitute" ADR 0002's own rejected
alternative warned against. It would also require adding a supplement-hoisting path to
emit-hooks-ns, which today has none. Enumeration is the cheaper, drift-safe mechanism.normalizeRadialValue — undocumented, so excluded on the same "we expose
what the docs describe" rule that governs the whole pipeline, not as a value judgment.codegen/input/util-docs.edn ({:desc, :page} per
entry). Upstream has no machine-readable source — the functions-reference page is
hand-written MDX and the functions carry no JSDoc. The doc URL is derived from the JS
name (lowercase, separators stripped: .../guides/functions-reference/#randomid,
.../hooks/use-hotkeys/#gethotkeyhandler), so only the description is truly irreducible.util-docs.edn entry fails the
build — the same enumerate-and-guard discipline as the collision and drift checks, and
what keeps everything-minus-excludes safe across version bumps.Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |