Skip to content

niivue/mono

Repository files navigation

NiiVue Monorepo

Monorepo for the NiiVue ecosystem — browser-based medical image visualization.

Packages

Package Description npm
@niivue/niivueCore WebGPU/WebGL2 medical image viewernpm
@niivue/nvreactReact bindings for NiiVuenpm
@niivue/nv-web-componentLit-based Web Components for NiiVuenpm
@niivue/nv-ext-drawingDrawing interpolation and segmentation toolsnpm
@niivue/nv-ext-image-processingImage processing (Otsu thresholding, haze removal, etc.)npm
@niivue/nv-ext-save-htmlExport a NiiVue scene as a self-contained HTML filenpm
@niivue/nv-ext-dcm2niixDICOM-to-NIfTI conversion in the browser via the dcm2niix WASM buildnpm
@niivue/nv-ext-niimathniimath pipelines in the browser via the niimath WASM buildnpm
@niivue/web-bridgeTyped two-way JSON-envelope bridge between a NiiVue web view and a native (WKWebView) host
NiiVueKitSwift package (BridgeCore + NiiVueKit) pairing with @niivue/web-bridge to embed NiiVue in SwiftUI apps via WKWebView
@niivue/dev-imagesShared test volumes, meshes, and tractography files (Git LFS)
ipyniivueJupyter widget wrapping NiiVue (anywidget) — Python wheelPyPI

Apps

App Description
demo-ext-drawingDemo app for the drawing extension
demo-ext-image-processingDemo app for the image processing extension
demo-ext-save-htmlDemo app for the save-to-HTML extension
demo-ext-dcm2niixDemo app for the dcm2niix DICOM-to-NIfTI extension
demo-ext-fullstackFullstack demo wiring NiiVue to a Bun server that runs the niimath native binary
demo-ext-niimathBrowser-only demo running niimath as WASM via @niivue/niimath
demo-nv-web-componentDemo app for the Web Components package
medgfxNative macOS/iOS SwiftUI app embedding NiiVue in a WebView

Getting Started

Use the hot-reloadable live demos for local development—they provide the fastest feedback loop while working on the project.

git clone git@github.com:niivue/mono.git
cd mono
bun install
bunx nx build niivue
git lfs install
git lfs pull
bun run dev

Core commands include

bun install                # Install all dependencies
bunx nx build <project>    # Build a single project (builds deps first)
bunx nx run-many -t build  # Build all projects
bunx nx run-many -t test   # Run all tests

See CONTRIBUTING.md for detailed setup, tooling, and development instructions.

Releasing and Publishing

Packages are versioned and published using Nx Release and bun publish. Ensure you are logged in to npm (npm login) and have publish access to the @niivue scope.

# 1. Version — bumps package.json and updates workspace deps
#    Use --first-release if no git tags exist yet for the project
bunx nx release version <version> --projects=<project>

# 2. Changelog (optional) — generate from conventional commits
bunx nx release changelog <version> --projects=<project>

# 3. Build
bunx nx run-many -t build --projects=<project1>,<project2>

# 4. Publish — run from each package directory
#    bun publish resolves workspace:* dependencies automatically
cd packages/<project> && bun publish --tag next --access public

Use --tag next for prerelease versions (e.g. 1.0.0-rc.1). Omit --tag for stable releases (defaults to latest). The --access public flag is required for scoped @niivue/* packages.

GitHub Pages

Pushing to main automatically builds and deploys all examples and demo apps to GitHub Pages. To preview the site locally:

.github/build-pages.sh --serve   # build and serve at http://localhost:8080/mono/