This is an npm-workspace monorepo:
packages/
react-native-nitro-vto/ published — native core + Nitro bridge
example/ Expo demo app
Inside packages/react-native-nitro-vto/:
android/src/main/java/eu/alan/vto/core/ Kotlin renderers (VtoView + Filament + ARCore)
android/src/main/java/com/margelo/... Nitro bridge (HybridNitroVtoView)
android/src/main/assets/ compiled .filamat / .ktx / .txt
ios/ Swift/ObjC++ renderers + Nitro bridge
ios/assets/ compiled .filamat / .ktx / .txt
assets/ .mat / .hdr sources (not published)
scripts/ matc.ts / cmgen.ts (not published)
src/ TS entry, Nitro spec, types, Expo plugin
nitrogen/generated/ nitrogen output — do not edit
git clone git@github.com:alan-eu/react-native-nitro-vto.git
cd react-native-nitro-vto
npm installDownload Filament 1.71.4 binaries from filament releases, then at the repo root copy .env.example to .env and set:
MATC_PATH=/path/to/filament/bin/matc
CMGEN_PATH=/path/to/filament/bin/cmgen
Recompile when you touch a .mat or .hdr:
npm run matc --workspace=@alaneu/react-native-nitro-vto # .mat → .filamat
npm run cmgen --workspace=@alaneu/react-native-nitro-vto # .hdr → .ktx + _sh.txtcd example
npm run ios # or npm run androidThe example app consumes the package through the npm workspace, so native edits under packages/react-native-nitro-vto/ are picked up by the next native build. A Metro reload is not enough for native changes; rebuild via npm run ios / npm run android.
Any surface change (new prop, renamed method, new callback signature) must land in all of:
packages/react-native-nitro-vto/src/specs/NitroVtoView.nitro.ts— Nitro spec (re-runnpm run specsfrom the Nitro package)HybridNitroVtoView.{kt,swift}example/app/index.tsx— exercise the new surfacepackages/react-native-nitro-vto/README.md
- iOS: core renderers are Objective-C++ (
.mm/.h) using Filament's C++ API directly; theVtoViewfacade is Swift. Keep the public Swift APIpublicso it reaches the wrapper's auto-generated<Module>-Swift.h— that's what the Nitro HybridView imports. - Android: core is Kotlin, package
eu.alan.vto.core. Do not put anything incom.margelo.nitro.nitrovto— that namespace is reserved for Nitro-specific bridge code. - Filament: version is pinned at
1.71.4in the podspec andandroid/build.gradle; don't bump one without the other. - Assets: source
.mat/.hdrlive inpackages/react-native-nitro-vto/assets/; compiled.filamat/.ktx/.txtare checked in underpackages/react-native-nitro-vto/android/src/main/assets/andpackages/react-native-nitro-vto/ios/assets/. Always recompile and commit both source and compiled forms together. - Resource bundle lookup on iOS:
LoaderUtils.loadAssetNamed:looks upNitroVtoAssets.bundle, theresource_bundlesname declared in the podspec. Rename both together.
- Rebuild the example app on a physical device (ARKit face tracking needs a TrueDepth camera; simulator doesn't count).
- Confirm glasses render, face occlusion works, and model switching works.
npm pack --dry-run --workspace=packages/react-native-nitro-vto: every native source and compiled asset should appear in the listing. If one is missing, check thefilesfield in the package'spackage.json.
- The example app builds + runs on a physical device for both platforms.
- Working tree is clean (or only expected changes).
- You are logged into npm:
npm whoamireturns the account with publish rights to the@alaneuscope. - Dry-run the tarball and verify native sources and assets are present:
cd packages/react-native-nitro-vto && npm pack --dry-run
From the repo root:
npm run releaseThis runs, in order:
release-itinsidepackages/react-native-nitro-vto— builds viabob(prepackhook), publishes to npm.release-itat the root — bumps the version across every relevantpackage.json(root, the package, the example), creates a signed git tagvX.Y.Z, and opens a GitHub release with the conventional-commits changelog.
Each step prompts for the version bump type (patch / minor / major). Use the same answer for both so the package and the git tag stay aligned.
git push --follow-tags origin main- Verify the package on npm:
npm view @alaneu/react-native-nitro-vto version. - Smoke-test a fresh install in a scratch RN project (install the wrapper,
pod installon iOS, run on a device — catches packaging regressions thatnpm pack --dry-runmisses).