l3nz / cli-matic

Compact, hands-free [sub]command line parsing library for Clojure.
Eclipse Public License 2.0
361 stars 29 forks source link

CLJS compatibilty #19

Closed l3nz closed 5 years ago

l3nz commented 6 years ago

Libs we depend on are supported.... what is to be done?

https://sunng.info/blog/writing-library-for-both-clojure-and-clojurescript.html

arichiardi commented 5 years ago

This is a good idea, I would be interested in trying this lib out and eventually replace tools.cli.

Checking the code...

l3nz commented 5 years ago

I expect that it should be trivial; it is a matter of implementing namespaces platform.cljs (where JVM stuff is) and optional.cljs where we have optional stuff - the only "optional" that I guess will be there initially is the ability to decode JSON that JS surely has.

Please note that I created the current cljs namespaces in a hurry and functions there just return nil, all of them - so they will break sth else down the line.

l3nz commented 5 years ago

Link https://medium.com/@jamesleonis/step-inside-cljsbuild-e38271b10415

arichiardi commented 5 years ago

Thank you for the quick answer! Maybe the link is not really the one you wanted to post? I see it points to a leiningen post :smile:

arichiardi commented 5 years ago

Oh I see, you wanted to write down the doc to how to configure lein for Cljs.

l3nz commented 5 years ago

Now I have a clean compile (kind of) but tests still do not pass. Want to give it a try?

arichiardi commented 5 years ago

Yep will give it a try, no promise about time but I will do my best :smile:

l3nz commented 5 years ago

I'm starting to think we should target Planck initially, as it seems the most likely thing one would use to write a CLI app.

arichiardi commented 5 years ago

The classic approach is to implement ClojureScript, keeping the amount of macros very low and then port it to self-host. I have done a bunch of those so I can help with that.

l3nz commented 5 years ago

Link to keep track of https://github.com/abiocljs/abio

l3nz commented 5 years ago

We have an initial working system with Planck: https://github.com/l3nz/cli-matic/blob/master/planck.md

l3nz commented 5 years ago

I am closing this bug for now after release 0.3.0 and focusing on specific issues

arichiardi commented 5 years ago

Thank you! Not a plank user (yet) but I see no reason why it shouldn't work on any self-host environment (like lumo)

l3nz commented 5 years ago

Yes, but you have to start somewhere :) at this point, as it's working, we cn just change the platforms.cljs adding stuff there for various environments! :smile: