CLI: configuration and manifest
CLI reference for the React team and CI: configuration and manifest. The brownfield key with every field, the manifest that nuib package writes, and the exit codes of all commands.
Configuration: the brownfield key
Section titled “Configuration: the brownfield key”The brownfield key of the React project’s package.json is the only configuration. Paths are relative to the React project.
"brownfield": { "name": "ShopReact", "version": "0.1.0", "ios": { "minimum": "16.0" }, "android": { "minSdk": 26, "group": "com.example", "artifact": "shop-react" }, "registry": "../registry", "dev": { "port": 8081 }, "hosts": { "ios": "../ios-app", "android": { "path": "../android-app", "module": "app" } }}| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
name |
string | Yes | The artifact’s name: the SwiftPM package and Swift module, and the generated entry type on both platforms. An identifier: letters, digits and _, starting with a letter. |
|
version |
string | Yes | The artifact’s version, also the Maven version. A semantic version: 1.2.3 or 1.2.3-tag. |
|
ios |
object | To package iOS | The iOS section. | |
ios.minimum |
string | Yes, in ios |
The deployment target, "16.0" or newer. |
|
android |
object | To package Android | The Android section. | |
android.minSdk |
integer | Yes, in android |
The minimum SDK, 26 or higher. | |
android.group |
string | Yes, in android |
The Maven group, such as com.example. Lower case. |
|
android.artifact |
string | Yes, in android |
The Maven artifact id, such as shop-react. Lower case. |
|
modules |
string[] |
No | [] |
Optional engine modules. This version has none, so any name is refused. |
registry |
string | No | None | The local registry directory of nuib publish and nuib check. |
dev |
object | No | Development settings. | |
dev.port |
integer | No | 8081 |
The dev server port, 1 to 65535. nuib dev serves on it and the dev variant records http://localhost:<port>. |
hosts |
object | No | The native apps that nuib dev ios and nuib dev android open. |
|
hosts.ios |
string or object | For nuib dev ios |
A path, or an object with path, scheme and configuration. |
|
hosts.ios.path |
string | Yes, in the object | The app’s directory or its .xcodeproj. |
|
hosts.ios.scheme |
string | No | The project’s only scheme | The scheme to build. Needed when the project has several. |
hosts.ios.configuration |
string | No | Debug |
The build configuration. |
hosts.android |
string or object | For nuib dev android |
A path, or an object with path and module. |
|
hosts.android.path |
string | Yes, in the object | The app’s Gradle build directory (with settings.gradle or settings.gradle.kts) or its parent. |
|
hosts.android.module |
string | No | app |
The application module. |
The manifest
Section titled “The manifest”manifest.json describes one packaged version: its identity, its contract, its sizes and the hash of every packaged file. nuib package writes it last, at <out>/manifest.json, and nuib publish copies it to <registry>/<name>/<version>/manifest.json. Nothing reads it at run time: it is the record that nuib check, nuib publish and CI compare versions with.
A shortened example:
{ "schema": "nuib.manifest/6", "artifact": { "name": "ShopReact", "version": "0.1.0", "variant": "release" }, "hashes": { "contract": "<sha256>", "ios": { "engine": "<hash>", "framework": "<hash>", "facade": "<sha256>" } }, "contract": { "schema": "nuib.contract/1", "surfaces": [ { "name": "PointsHistory", "props": [ { "name": "userId", "optional": false, "type": { "kind": "string" } } ] } ], "channels": [] }, "platforms": { "ios": { "minimum": "16.0", "module": "ShopReact", "swiftPackage": "ios/ShopReact", "slices": { "ios-arm64": { "binary": 0, "bytecode": 0 } } }, "android": { "minSdk": 26, "coordinate": "com.example:shop-react:0.1.0", "repository": "android/maven", "aar": 0, "abis": { "arm64-v8a": { "runtimeLibrary": 0, "bytecode": 0 } } } }, "files": { "<path relative to the output directory>": "<sha256>" }}| Field | What it holds |
|---|---|
schema |
The manifest format, nuib.manifest/6. nuib check and nuib publish read only this format; a manifest in another format, an older one included, is refused with exit 1: <file>: unsupported manifest schema <found>; this nuib reads nuib.manifest/6 only. Package again with this version of nuib: nuib package |
artifact |
name, version and variant (release or dev). |
nitroUIVersion |
The Nitro UI version the artifact was built with (the installed nitro-ui-runtime). |
hashes.contract |
SHA-256 of the contract. It changes when a surface or a prop is added, removed, renamed, retyped or reordered. Compare it between two versions to see whether the contract changed. |
hashes.ios, hashes.android |
The engine, framework and facade hashes of the platform. A changed engine hash means the native engine changed. |
contract.channels |
Reserved. It is always [] in this version and is part of the contract hash. |
contract.surfaces[] |
Each surface with its name and its props, in declaration order; each prop has name, optional and type. |
nativeModules[] |
The native modules in the engine: name, package, version. |
platforms.ios |
minimum, the Swift module the app imports, the swiftPackage path, and slices: sizes in bytes per slice. binary is the size that ships. |
platforms.android |
minSdk, the Maven coordinate (group:artifact:version), the Kotlin package, the repository path, the aar size, and abis: sizes in bytes per ABI. aar and runtimeLibrary are the sizes that ship. |
platforms.*.symbols |
What ties the debug files to the binaries: the UUID and dSYM path of each iOS slice, the build id and unstripped path of each Android library, and the source map of the app code. Paths are relative to the output directory, and to the version directory once published. |
toolchain |
The versions of the tools that built the artifact, with one key per tool; toolchain.nuib is the version of the CLI that packaged it. |
files |
SHA-256 of every packaged file, by path relative to the output directory. nuib publish compares these with the files before it publishes them. |
Exit codes
Section titled “Exit codes”| Code | Command | Meaning |
|---|---|---|
0 |
All | Success. For nuib check: every check passed, warnings allowed. Also --help. |
1 |
All | A usage or configuration error, or the command was refused or failed. The reason is printed after nuib: on standard error. Also nuib with no command, which prints the help. |
2 |
nuib |
Unknown command. |
4 |
nuib check |
Type errors. |
8 |
nuib check |
Contract errors. |
16 |
nuib check |
Version policy. |
32 |
nuib check |
Size threshold. |
129, 130, 143 |
nuib dev |
Stopped by SIGHUP, SIGINT (Ctrl-C) or SIGTERM, after the clean-up. |
| Other | nuib dev |
The exit code of the dev server when it ends by itself. |
When several checks of nuib check fail, the code is their sum: types and contract give 12, version and size give 48.
A CI step:
$ bun run nuib check --json > check.json$ echo $?16More of the CLI reference
Section titled “More of the CLI reference”- CLI: dev and check: commands for development and checks.
- CLI: package, publish and link: package, publish and link.