borkdude / jet

CLI to transform between JSON, EDN, YAML and Transit using Clojure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

update-vals etc from Clojure 1.11 missing

Oddsor opened this issue · comments

commented

Tried writing a little transformer that was going to use update-vals, but it seems to be missing from Jet!

Similar story to other functions added in Clojure 1.11 such as update-keys, parse-long etc...

Can you make a repro?

commented

I made a PR with tests instead!
#138

Edit: And here's an example to illustrate the problem where I convert the keys in a map into keywords:

> echo "{\"a\" \"1\"}" | jet -T '(update-keys keyword)'
...
Caused by: clojure.lang.ExceptionInfo: Could not resolve symbol: update-keys

Thanks :)

I noticed the changelogs weren't updated yet. Can you do this too?

commented

Will do!
Also noted in the PR that maybe a separate NS should be created instead of inlining the missing functions directly?
Babashka does this with a core-extras in an "impl"-namespace

Yes, I think moving this extra config to sci.configs will be even better so then we can re-use it in both bb and jet and possibly more projects.

commented

Okay, so maybe the current PR should be closed and then I can open one for SCI where the functions are added to clojure-core here?
https://github.com/babashka/sci/blob/master/src/sci/impl/namespaces.cljc#L991C11-L991C11

commented

Cool, I'll give updating sci.configs a try later today 😊

commented

I tried to applying the recent update to sci.configs to Jet and noticed that leiningen is still used to build and test, which doesn't support referencing git-dependencies!

I can try to assist with moving to building using deps.edn instead if that's a good direction for the project, but for now it looks like this issue will be resolved with the next release 😊

Ah yes, sorry, I didn't notice that. We can move to tools.build. I'll make an issue for that and solve that myself, if nobody else jumps on it.