This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-30
Channels
- # announcements (41)
- # aws (2)
- # aws-lambda (1)
- # babashka (51)
- # babashka-sci-dev (15)
- # beginners (56)
- # calva (15)
- # cider (8)
- # clojars (6)
- # clojure (107)
- # clojure-dev (6)
- # clojure-europe (33)
- # clojure-france (3)
- # clojure-nl (4)
- # clojure-sg (2)
- # clojure-uk (8)
- # clojurescript (16)
- # cursive (11)
- # data-oriented-programming (1)
- # datomic (4)
- # events (11)
- # fulcro (15)
- # graphql (6)
- # helix (17)
- # holy-lambda (1)
- # improve-getting-started (14)
- # integrant (39)
- # jobs (14)
- # lsp (36)
- # malli (3)
- # nrepl (8)
- # off-topic (26)
- # other-languages (1)
- # polylith (21)
- # portal (7)
- # practicalli (17)
- # re-frame (7)
- # react (4)
- # reitit (1)
- # remote-jobs (6)
- # sci (1)
- # shadow-cljs (45)
- # spacemacs (12)
- # tools-deps (5)
- # xtdb (26)
Hi, I was wondering if it is possible to run 'portal' against a bb nrepl? All the portal examples use the clj repl.
@mmer in the README of portal:
bb -cp `clj -Spath -Sdeps '{:deps {djblue/portal {:mvn/version "0.15.1"}}}'
`Can you require
other bb files? Or what’s the best way to build a library of common bb fns/modules?
Ideally I would like some bb files to be my library code, that my scripts could then require and use.
The two ways I would imagine it working from the book:
• are using bb.edn
with the paths
set
• using preloads
https://book.babashka.org/#_preloads
@splayemu Yes, if you set bb.edn to {:paths ["."]}
you can just require any script from the top level of your project. You can also choose another directory
Perhaps we should just add the current working directory to the classpath automatically (in nbb I've done this)
Thank you a ton! I now realize my problem was my directory structure didn’t equal my ns
name, so I guess deps.clj
couldn’t find the namespace I was looking for.
Is there a similar thing for BB as CLJ_CONFIG
?
CLJ_CONFIG=../.clojure
Yeah for bb.edn
In a monorepo, I want to execute scripts from various sub directories. Would like all the paths (and eventually tasks) to be able to execute from any sub directory.
What you could also do is make a root bb.edn and use :dir
(as in (shell {:dir ..} ..)
and (clojure {:dir ...} ...)
to execute commands in dirs from the root dir?
We're doing a similar thing here: https://github.com/clj-easy/graal-config/blob/master/bb.edn
invoke with:
bb native-image-test :dir config/com.taoensso/nippy/example :graalvm-version 21.1.2
There is an issue about what you are talking about I think here: https://github.com/babashka/babashka/discussions/869 Feel free to contribute to the discussion. What I'm missing most is a complete mono-repo setup where this kind of usage makes sense and I can try locally.
At work we have a mono-repo setup but each project just has its own bb.edn since the tasks are quite unique for each sub-project
What you can also do is split the code you want to use into a library and then use this library from each bb.edn
👀 :thinking_face:
you can see how local/root works here: https://clojure.org/guides/deps_and_cli
ah yeah that’s what we do for our non bb code
okay let me try some of these suggestions out, thanks a lot for your hard work and quick responses! really appreciate it and love bb
@ag That's a common question and unfortunately this is not possible in a JVM-ish environment. But on the other hand, it can also seen as a source of less confusion. E.g. when you change paths, and require a namespace or load-file
, suddenly your relative root has changed?
The counter-solution to this is to pass :dir
arguments to functions that need to be aware of a prefixed directory
In nbb
it is possible:
$ nbb -e '(js/process.chdir "proj") (js/process.cwd)'
"/private/tmp/proj"
This is because node allows it.Has any thought been given to a sci-derivate package updater? I'm starting to lose track of which clj-kondo or babashka or pcp etc (neil?) i have installed and whether updates are available. Someone must have a clever solution already.
I did start to write my own package manager a while back: https://github.com/borkdude/glam But I haven't been using it much. I figured it makes sense to go with the flow: people won't switch to a niche package manager for just a few packages?
Linux laptop here, so brew itself is a foreign package manager:) . I'm not sure where the line is either