A collection of premade features for nbb
This repository aims to make it easy to use libraries that nbb is not currently able to evaluate through SCI. This repository does this by providing premade features/libraries that can be pulled in to a custom build of nbb.
Use the features in this repository to build a custom nbb. Here are the steps for doing this:
- In a new project, copy this repository's
bb.edn
andpackage.json
files.- NOTE: The
:git/sha
fornbb/nbb
may be old. You may want to update it to build the most recent version of nbb.
- NOTE: The
- In
package.json
, rename thenbb-features
references to make them your own. - In
bb.edn
, leave the nbb dependencies as those are needed for building nbb. As for the other dependencies, replace them with the features you want enabled. If the feature is local, use:local/root
as seen in the copiedbb.edn
. If using a feature from this remote repository, pull them in like this:
:deps
{datascript/deps
{:git/url "https://github.com/babashka/nbb-features"
:git/sha "7af8569a7f932af2cde5f8677133915540ab0c49"
:deps/root "features/datascript"}
}
- Build your custom nbb with
bb release
. Runnode lib/nbb_main.js
and your nbb with custom features enabled will run!
The following libraries are provided as features:
- https://github.com/tonsky/datascript
- https://github.com/tonsky/datascript-transit
- https://github.com/frankiesardo/linked
NOTE: These features usually provide a subset of a library's API to nbb. To see what library fns are available, see the feature's sci configuration.
To contribute a new feature, please add a new feature under features/
and corresponding tests under test/features/
. See this doc for what's required to make a feature. Before contributing a feature, make sure that the library doesn't already work with nbb and SCI. If your nbb feature was useful to you, we'd love to have it as a contribution!
Distributed under the EPL License. See LICENSE.