Publish a Lucent library
An npm package with a lucent field in package.json, its modules as source, and a lucent.json for its native needs.
{ "name": "trip-tracker", "version": "1.0.0", "files": [ "index.ts", "src", "lucent.json" ], "main": "index.ts", "lucent": { "sources": "src", "compatible": ">=0.0.3" }}export * from "./src/trip.lucent";export * from "./src/location.lucent";{ "ios": { "infoPlist": { "NSLocationWhenInUseUsageDescription": "Trip Tracker records your route while you track a trip." } }}lucent.sourcesis the folder with the package's modules.lucent.compatibleis the range of Lucent versions it supports; an app outside it fails to build, naming the package.mainre-exports the modules. Metro swaps each for its proxy in the app.- The package ships sources only. The app compiles them with its own modules, with its own Lucent, into its one native package.
lucent.jsonlists what the modules need from the app: pods, Gradle dependencies, permissions,Info.plistentries. The app's build merges them, and fails if two packages' needs cannot both hold. Seelucent.json.- Modules are named
<package>/<module>, so two packages can each have astoragemodule.
npm publishThis is the tutorial's package, which step 8 makes. examples/lucent-haptics is another.