Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Docs

on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:

permissions:
contents: write

jobs:
build-and-deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout (with submodules)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive

- name: Setup pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6
with:
version: 10.27.0

- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: .nvmrc
cache: pnpm

- name: Install JS dependencies
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.91.1"
targets: aarch64-linux-android

- name: Install cargo-ndk
run: cargo install cargo-ndk

- name: Setup just
uses: extractions/setup-just@v2

- name: Apply bdk-ffi patches
run: just submodule-apply-patch

- name: Install JDK
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: zulu
java-version: "17"

- name: Accept Android SDK licenses
run: |
yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null

- name: Generate TypeScript bindings
run: pnpm ubrn:android --config ubrn.config.yaml

- name: Setup Python (for Zensical)
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install uv
run: pip install uv

- name: Build full documentation site
run: just docs-build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
keep_files: false
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Changelog

Changelog information can be found in the bdk-ffi repository: https://github.com/bitcoindevkit/bdk-ffi/blob/master/CHANGELOG.md
## [Unreleased]

- Add TypeDoc-generated API reference at `/api/` on the documentation site
- Add `just api-docs` and `just docs-build` recipes
- Add CI workflow to build and publish API docs to GitHub Pages

Changelog information for bdk-ffi releases can be found in the bdk-ffi repository: https://github.com/bitcoindevkit/bdk-ffi/blob/master/CHANGELOG.md
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ The code in this repository is mostly comprised of:

The core Rust code that is exposed to the React Native language bindings actually resides in the [bdk-ffi](https://github.com/bitcoindevkit/bdk-ffi) repository. This repo pulls it in as a submodule.

## Exploring the Example Apps
## Exploring the API and Example Apps

To take a look at the API exposed in this library, you can run our example applications. [Read the docs on this here](https://bitcoindevkit.github.io/bdk-rn/example-apps/), and [find our example apps here](https://github.com/thunderbiscuit/bdk-rn-example-apps).
Browse the [API reference](https://bitcoindevkit.github.io/bdk-rn/api/) for all public classes, methods, and types. For hands-on usage walkthroughs, run our [example applications](https://github.com/thunderbiscuit/bdk-rn-example-apps). [Read the docs on example apps here](https://bitcoindevkit.github.io/bdk-rn/example-apps/).

<br>

Expand Down
2 changes: 1 addition & 1 deletion deploy-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -euo pipefail

rm -rf ./site/*
uv run zensical build
just docs-build
cd ./site/
git init .
git switch --create gh-pages
Expand Down
5 changes: 5 additions & 0 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# API Reference

Browse the auto-generated API reference for all public classes, methods, and types.

**[Open API Reference →](../api/index.html)**
28 changes: 28 additions & 0 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,31 @@ just test-android
3. Update tests: `cd tests && npm install`
4. Add or modify tests in the tests
5. Run the app and verify test results in logcat or in the emulator

## Generating API Reference Docs

The API reference is generated with [TypeDoc](https://typedoc.org/) from the
TypeScript bindings produced by ubrn. You must generate the bindings first:

```shell
just submodule-init
just submodule-apply-patch
pnpm ubrn:android --config ubrn.config.yaml
```

Then build the API docs alone or the full site:

```shell
# API reference only → site/api/
just api-docs

# Full site (guides + API) → site/
just docs-build
```

Preview the API reference by opening `site/api/index.html` in a browser.
`just docs` serves the Zensical guides only; use a static server on `site/`
to preview the combined site locally.

Docs are deployed to GitHub Pages on push to `main` (once CI is in place),
or manually via `./deploy-docs.sh`.
4 changes: 4 additions & 0 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ To build the library and start testing locally, you must have:
## Additional Resources

For more advanced information on how to build this library, see the [uniffi-bindgen-react-native documentation](https://jhugman.github.io/uniffi-bindgen-react-native/guides/rn/getting-started.html).

## API Reference

Browse the auto-generated [API reference](https://bitcoindevkit.github.io/bdk-rn/api/) for all public classes, methods, and types. Example apps (linked below) provide supplementary usage walkthroughs.
11 changes: 11 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ build-tarball:
pnpm ubrn:ios --config ubrn.config.yaml
pnpm pack

[group("Docs")]
[doc("Generate API reference docs. Requires: just submodule-apply-patch && pnpm ubrn:android first.")]
api-docs:
./node_modules/.bin/typedoc

[group("Docs")]
[doc("Build full documentation site (Zensical guides + TypeDoc API reference).")]
docs-build:
uv run zensical build
./node_modules/.bin/typedoc

[group("Docs")]
[doc("Serve the docs locally.")]
docs:
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"test": "jest",
"typecheck": "tsc",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
"api-docs": "typedoc",
"clean": "del-cli android/build lib",
"prepare": "bob build",
"release": "release-it --only-version"
Expand Down Expand Up @@ -85,6 +86,7 @@
"react-native-builder-bob": "^0.40.13",
"release-it": "^17.10.0",
"turbo": "^1.10.7",
"typedoc": "0.27.9",
"typescript": "^5.8.3"
},
"peerDependencies": {
Expand Down
Loading