Exposing babashka.nrepl.server-functions (#1297)

Co-authored-by: Odd Andreas Sørsæther <odd.andreas.sorsether@nav.no>
Co-authored-by: Odd Andreas Sørsæther <odd.andreas@ardoq.com>
This commit is contained in:
Odd A 2022-06-20 12:48:31 +02:00 committed by GitHub
parent 9ed705f8db
commit 573db8ea79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 0 deletions

View file

@ -5,6 +5,11 @@ For a list of breaking changes, check [here](#breaking-changes).
A preview of the next release can be installed from
[babashka-dev-builds](https://github.com/babashka/babashka-dev-builds).
## Unreleased
- Expose `babashka.nrepl.server/start-server!`- and `stop-server!`-functions to support programmatically starting
an nrepl-server. `start-server!` is redefined to not require a sci-context as its first argument.
## 0.8.156 (2022-06-08)
- macOS aarch64 support. Upgrading via brew or the installer script should

View file

@ -0,0 +1,16 @@
(ns babashka.impl.nrepl-server
{:no-doc true}
(:require [babashka.impl.common :as common]
[babashka.nrepl.server :refer [start-server! stop-server!]]
[sci.core :refer [create-ns new-var copy-var]]))
(def nrepl-server-namespace
(let [ns-sci (create-ns 'babashka.nrepl.server)]
{'start-server! (new-var 'start-server!
(fn
([]
(start-server! @common/ctx))
([opts]
(start-server! @common/ctx opts)))
{:ns ns-sci})
'stop-server! (copy-var stop-server! ns-sci)}))

View file

@ -32,6 +32,7 @@
[babashka.impl.error-handler :refer [error-handler]]
[babashka.impl.features :as features]
[babashka.impl.fs :refer [fs-namespace]]
[babashka.impl.nrepl-server :refer [nrepl-server-namespace]]
[babashka.impl.pods :as pods]
[babashka.impl.pprint :refer [pprint-namespace]]
[babashka.impl.print-deps :as print-deps]
@ -354,6 +355,7 @@ Use bb run --help to show this help output.
'clojure.tools.cli tools-cli-namespace
'clojure.java.shell shell-namespace
'babashka.core bbcore/core-namespace
'babashka.nrepl.server nrepl-server-namespace
'babashka.wait wait-namespace
'babashka.signal signal-ns
'clojure.java.io io-namespace