hopefully trivial question: i've been having an issue with a .clj-only namespace in a mostly .cljc project - that one .clj-only namespace https://app.circleci.com/pipelines/github/cljdoc/builder/42570/workflows/f138b5e0-06e0-4a2d-96bc-b2c0943ce2b5/jobs/58945, complaining about a missing .cljs or .cljc file - do i need to declare somewhere that that namespace is .clj only ?
Hi @mccraigmccraig, you can do so in your cljdoc.edn file. Example usage https://github.com/babashka/fs/blob/2c0905e829aa60fc0c89a1f4bf3d369a1b75254d/doc/cljdoc.edn#L4.
Full docs https://github.com/cljdoc/cljdoc/blob/master/doc/userguide/for-library-authors.adoc#languages.
@lee it's just one namespace though - every other namespace in the project is clj+`cljs`
Oh. So your library is targeting ClojureScript and Clojure users?
yes, exactly
almost all the lib features are cross-platform, but there's one namespace which adds clj-only features
currently i have a stub .cljs file for that one namespace, to get past the analyzer
Can you link me to that ns?
https://github.com/yapsterapp/slip/blob/trunk/src/slip/reloaded.clj
Thanks, I'm not sure yet why cljs analysis is trying to analyze that source. I'll look at your failed cljdoc build more closely to understand what is going on.
ha, yeah, i was a bit surprised - thanks for looking!
Hmm... in the 0.0.56 slip.jar from clojars I see a slip/sample.cljc :
(ns slip.sample
(:require
[promesa.core :as p]
[slip.multimethods :as mm]
[slip.reloaded :refer [defsys-fns]]))
(defmethod mm/start :config
[k d]
d)
(defmethod mm/start :foo
[k d]
(p/delay 0 d))
(def sys-spec
{:config {:slip/data {:foo 100 :bar 200}}
:foo {:slip/data #slip/ref [:config :foo]}})
(defsys-fns sys-spec)
It is loading the slip.reloaded namespace. This will occur for both Clojure and ClojureScript cljdoc API analysis.
If I delete slip/sample.cljc from the jar in my local m2 repo, then rerun cljdoc API analysis, it passes.
Soo... not sure where this sample.cljc file is coming from, but if you don't need it in your jar, maybe delete it?
Or... if you do need it in the slip jar, mark its namespace with ^:no-doc to tell cljdoc to skip it.@mccraigmccraig lemme know if that all makes sense, if not, happy to dig deeper with you.
oh 🤦♂️ - i must have accidentally committed sample.cljc - it's not meant to be there, at least not yet... sorry @lee for wasting your time
I don't feel my time was wasted @mccraigmccraig, happy to help.