Fork me on GitHub
#announcements
<
2022-06-24
>
joost-diepenmaat09:06:01

Also just released [nl.jomco/ring-openapi-validator "0.1.3"] Validates ring requests against openapi (swagger) specs. Includes middleware. See https://git.sr.ht/~jomco/ring-openapi-validator

👏 5
2
🎉 3
joost-diepenmaat09:06:45

Can also validate responses :-)

borkdude10:06:02

Announcing org.babashka/http-server {:mvn/version "0.1.4"} - an easy tool to serve static assets during development! Repo: https://github.com/babashka/http-server Use with Clojure: https://github.com/babashka/http-server#clojurehttps://t.co/7sn8XPc7Ga Use with babashka: https://github.com/babashka/http-server#babashkahttps://t.co/QUkaOhidlI Enjoy!

👍 16
👏 7
1
🎉 6
1
borkdude11:06:09

Thanks to @U0522TWDA who made this https://gist.github.com/holyjak/36c6284c047ffb7573e8a34399de27d8 which was in turn based on https://github.com/babashka/babashka/blob/master/examples/image-viewer.clj babashka example. I used several variations of this in my own projects, which eventually became this repo.

mkvlr11:06:50

A very nice, I was longing for this, glad you beat me to it!

borkdude11:06:20

It was already sitting there for half a year, I just had to add some docs to it :)

Tomas Brejla12:06:16

I never really got into clj tools, but

$ clj -Ttools install io.github.babashka/http-server '{:git/tag "v0.1.3"}' :as serve
$ clj -Tserve exec
is it a good idea to use such an generic "alias" as serve when using the :as alias? If I understand it correctly, it's considered to become a tool name, so I'd expect something like bb-http-server or similar. And use it as clj -Tbb-http-server serve (instead of exec)..

Tomas Brejla12:06:33

I mean upgrade attempt such as

clj -Ttools install-latest :tool serve
feels strange
clj -Ttools install-latest :tool bb-http-server
feels more reasonable to me.

borkdude12:06:04

@U01LFP3LA6P The alias is up to the user

truestory 1
Ben Sless13:06:50

Syntax error compiling at (babashka/cli.cljc:23:22).
Unable to resolve symbol: parse-double in this context
😞

Ben Sless13:06:41

Should at least specify it requires 1.11

borkdude13:06:23

Will fix that

borkdude13:06:02

Try 0.1.4 now

borkdude13:06:14

It's funny because org.babashka/cli already depends on clojure 1.11, I would assume the clojure CLI to pull in at least that version.

borkdude13:06:48

@UK0810AQ2 How were you "installing" it, as a clj tool, or so?

borkdude14:06:33

@UK0810AQ2 Can you try again using 0.1.4? If it persists, then I really don't know. Maybe the clojure version of your deps.edn is prioritized or you should update your clojure CLI? @U064X3EF3: halp... my clj tool depends on clojure 1.11, but somehow for Ben that's not working

Alex Miller (Clojure team)14:06:19

if Clojure version is not not specified, you'll get the version from the root deps.edn in the Clojure CLI install, which matches the first part of the CLI version

Alex Miller (Clojure team)14:06:37

what was you command Ben when you got that syntax error?

borkdude14:06:43

I can also see 1.11 pop up here:

$ clj -Spath -Tserve

Alex Miller (Clojure team)15:06:05

well, I repeat my request for knowing the actual command that caused the error (and the CLI version there)

👍 1
Ben Sless15:06:38

I had a version set in my global deps edn and by bumping it was able to use 0.1.3

Alex Miller (Clojure team)15:06:49

why do you have that at all?

borkdude15:06:37

Oh, actually I have that too:

:deps {
        org.clojure/clojure {:mvn/version "1.11.0"}
        }
and I'm noticing that this 1.11.0 ends up on my classpath instead of 1.11.1. I had it because I wanted to use 1.11 by default and the clojure CLI didn't have that yet

borkdude15:06:26

Shouldn't dependencies of tools or in local deps.edn override what's in your global home deps.edn though?

Alex Miller (Clojure team)16:06:02

No, top level (merged) overrides

borkdude16:06:50

but if you have

{:deps {foo/bar v1}
 :aliases {:foo {:extra-deps {foo/bar v2}}}
then clj -A:foo pulls in v2 and not v1 right?

Alex Miller (Clojure team)16:06:49

These are two different parts of the process

borkdude16:06:37

but isn't -T treated as some kind of alias, conceptually?

Alex Miller (Clojure team)16:06:46

Step 1 is to merge the deps.edn

Alex Miller (Clojure team)16:06:49

Yes, -T is kind of treated as an an alias, but again, that's part of a later step

borkdude16:06:02

I still don't see why a -T clojure version wouldn't override the global home clojure version then

Alex Miller (Clojure team)16:06:56

I'm going to take this to a thread in #tools-deps so we're not spamming here

borkdude06:06:59

@UK0810AQ2 note that a global clj dep in user deps.edn is going to override the clj version for all projects

👍 1
borkdude06:06:34

See conv in other channel, just wanted to share the summary here