Fork me on GitHub
#nbb
<
2022-06-12
>
borkdude18:06:21

Made a little something on the way home from #clojured Prismatic/schema support as an optional pre-compiled dependency via another npm package (does not make the nbb package itself bigger) https://github.com/babashka/nbb#prismaticschema

🙌 1
valtteri18:06:50

Very cool! 🙂 Perhaps Malli next? 😉

borkdude19:06:28

Somehow npm publish of the inner package doesn't work in CI, but it does work on my own computer

borkdude19:06:18

Think I fixed it now... if next build succeeds, will add malli

🚀 1
borkdude19:06:47

What would be a good format for the package names:

@babashka/nbb-prismatic-schema
for prismatic/schema, or use underscores?

borkdude19:06:57

what if libname contains hyphens already?

borkdude19:06:03

whatever, I'll change it if it becomes annoying

valtteri19:06:35

@babashka/nbb-prismatic-schema this looks good

valtteri19:06:42

How does this work..? You compile cljs to js (esm) and publish to npm?

valtteri19:06:21

Neat, simple and it works. 🙂 Let’s hope this doesn’t turn into a maintenance nightmare

valtteri19:06:47

Or do you already plan some kind of automation for publishing new versions?

valtteri19:06:27

Anyways, npm install ... is way less tedious than pulling in the clj(s) deps, generating classpath etc

borkdude19:06:18

OK, trying malli on CI now..

borkdude19:06:30

yes, I automated publishing new versions

😎 1
borkdude19:06:30

I don't know what's up with this npm stuff:

npm ERR! code E404
npm ERR! 404 Not Found - PUT  - Not found
npm ERR! 404 
npm ERR! 404  '@babashka/[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url

borkdude19:06:38

while publishing the library itself

borkdude19:06:03

I had this problem too with schema, but it went away after a while

borkdude21:06:41

@valtteri

$ npx nbb
Welcome to nbb v0.5.115!
user=> (require '[malli.core :as m])
nil
user=> (m/validate :string "foo")
true
{"dependencies":
 {"nbb":"^0.5.115",
  "@babashka/nbb-metosin-malli":"^0.5.115"
 }
}

💯 3
💘 4
😍 1
littleli11:06:19

@U04V15CAJ Can we expect malli to be usable also from bb soon or that is unbased expectation to have?

borkdude11:06:24

With bb the options are: 1. include as built-in 2. make malli compatible from source. My preference would be 2 so bb can stay lean (I think clojure spec would have to go in first). But the code is quite complicated and currently probably not compatible with SCI. But perhaps with some work it can be made so, like we did with schema recently.

2️⃣ 1
borkdude21:06:41

@valtteri

$ npx nbb
Welcome to nbb v0.5.115!
user=> (require '[malli.core :as m])
nil
user=> (m/validate :string "foo")
true
{"dependencies":
 {"nbb":"^0.5.115",
  "@babashka/nbb-metosin-malli":"^0.5.115"
 }
}

💯 3
💘 4
😍 1