cljdoc

mccraigmccraig 2023-06-01T15:08:25.648189Z

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 ?

mccraigmccraig 2023-06-01T17:00:09.573919Z

@lee it's just one namespace though - every other namespace in the project is clj+`cljs`

lread 2023-06-01T17:08:36.333879Z

Oh. So your library is targeting ClojureScript and Clojure users?

mccraigmccraig 2023-06-01T17:08:53.746689Z

yes, exactly

mccraigmccraig 2023-06-01T17:10:14.875099Z

almost all the lib features are cross-platform, but there's one namespace which adds clj-only features

mccraigmccraig 2023-06-01T17:12:15.090559Z

currently i have a stub .cljs file for that one namespace, to get past the analyzer

lread 2023-06-01T17:12:37.317849Z

Can you link me to that ns?

lread 2023-06-01T17:19:27.873509Z

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.

mccraigmccraig 2023-06-01T17:20:50.686939Z

ha, yeah, i was a bit surprised - thanks for looking!

lread 2023-06-01T17:37:26.823879Z

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.

lread 2023-06-01T17:43:51.349719Z

@mccraigmccraig lemme know if that all makes sense, if not, happy to dig deeper with you.

mccraigmccraig 2023-06-01T17:47:16.637669Z

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

lread 2023-06-01T17:49:23.984339Z

I don't feel my time was wasted @mccraigmccraig, happy to help.

❤️ 1