Closed l3nz closed 2 years ago
An alternative could be a reader conditional where we bind:
[clojure.spec.alpha :as s]
And then another one to mock s/fdef
with (fn [_] nil)
.
You can also do a lot with reader conditionals. Babashka supports the :bb
reader conditional.
@lread have you started implementing Babashka support? I'm very keen to see this and lend a hand if needed
Not really but I plan to. In theory I guess we should:
Not really but I plan to. In theory I guess we should:
- import the spartan.spec instead of spec
- make expound optional
- I guess most of the platform stuff is simply JVM.
OK I'll get on it 😁 I'll create a draft PR for you to look at soon
Well I've made a start https://github.com/l3nz/cli-matic/pull/128 I'll need to create a PR for https://github.com/borkdude/babashka too, since there are some things missing that are needed by cli-matic
FWIW, babashka is now released with the PR included.
@AndreTheHunter just womndering if you had some progress on this feature.
Looks like @borkdude made it work - https://github.com/borkdude/spartan.spec/blob/master/examples/cli_matic.clj !
Made a PR here: https://github.com/l3nz/cli-matic/pull/145
One more thought concerning babashka, but can he handled in a follow up: bb comes with clj-yaml.core
maintained under clj-commons. If you would switch to that version, the YAML-related features would work with bb too.
Is your feature request related to a problem? Please describe. CLI-matic does not work on Babashka, as it references clojure.spec and expound, and those are not supported by Babashka.
Describe the solution you'd like
Ideally, I'd love to load a mock 'clojure.spec.alpha' if there is none, that could be an alias of https://github.com/borkdude/spartan.spec/
It looks like it could be possible:
Not sure if this would work on SCI though - https://github.com/borkdude/babashka#differences-with-clojure looks promising anyway
See http://blog.josephwilk.net/clojure/isolating-external-dependencies-in-clojure.html