Ah I see from your previous code you shared with me that you use the the cljs-proper branch on your codox fork?
@lee great to hear you're making progress, followed your discussion in #clojurescript as well 🙂
@lee cljdoc uses the cljs-proper
branch, that's right
I'm definitely open to respecting :file
metadata when it's present and if such change wouldn't cause any issues with the "usual case"
Thanks! I’ll take a look. I notice that you’ve adapted codox to trust the :file
when dealing with macros https://github.com/cljdoc/codox/blob/b29b16ae686e3400689bbdc93df57200b709443d/codox/src/codox/reader/clojurescript.clj#L61 - I’ll experiment with always trusting it. There might have been historical reasons not to always trust :file
for cljs?
@lee I think the reason that it's done the way it is there is mostly that that's how it's been done in the first place
could very well be that we could rely on :file
as provided by metadata in all cases
but would require some more testing, especially with protocol methods and this kind of stuff
do you have a set of goto projects you test against?
There's test-sources
in that project which I usually use with the -main
to test/debug stuff
clj -m codox.main clojure test-sources/
ok, good, thanks!
most of the time I combine this with heavy use of prn
and stuff. arguably not the best debugging/testing experience — so very happy if you feel inspired to improve this in any way
do you think some unit tests would be useful for codox?
totally
I made some initial work in that direction but didn't finish, let me see if I can commit that to a branch somewhere
oh… you are using kaocha on cljdoc. Cool, wanted to learn about that.
well actually there's not all that much 😄
yeah, kaocha is great!
What could be nice for codox is just a directory with source files and definition what the clj / cljs returns should return for analysing that directory
kaocha has some deep-diff stuff that could be pretty neat for this
I was going to try kaocha for rewrite-cljs, but got a bit nervous about current clojurescript support.
yeah, I guess more integration tests than unit tests.
yeah, cljs support is still a bit new unfortunately, I also recently played around with it for a work project but shadow-cljs' built-in testing stuff was sufficient at that point and just worked
I’m enjoying test support in figwheel main for dev right now and am using doo for ci.
Super cool you're working on rewrite-clj and rewrite-cljs btw, Arne (the author of Kaocha) is a huge fan of rewrite-clj* and always wanted to encourage some folks to contribute 😄
Cool! I’ve got a lot of todos on my list still, but am making good progress. I’ll probably start with an alpha to hopefully get feedback on some of my more, perhaps dubious, choices.
haha
It’s funny, I started with trying to help out a bit on cljfmt which led me to rewrite-clj which led me to rewrite-cljs with led me to potemkin import-vars which led me to cljdoc. My travels have been interesting and very educational!
it's a multi-dimensional rabbit hole!
ha! yes