@runsnative/recipe
v1.1.0
Published
Recipe CLI — add, check, update, and eject tracked RunsNative recipes
Readme
@runsnative/recipe
Add, check, update, and eject tracked RunsNative recipes.
A recipe is source you own, not a dependency you call. recipe add copies it into
your tree and records, per file, whether upstream owns it (synced) or you do
(owned). Later, recipe update 3-way-merges upstream's changes into the synced
files and never touches the owned ones. That is the whole idea: you keep your nav
items and your logo; you still get upstream's accessibility fix.
npm i -D @runsnative/recipe @runsnative/recipe-header
npx recipe add header --dir src/chromeCommands
| Command | Does |
|---|---|
| recipe add <name> | Seed a tracked instance from canonical. Refuses to clobber. |
| recipe check <name> | Re-hash against canonical. Reports the instance's real state. |
| recipe update <name> | 3-way-merge synced files to current canonical. Owned files untouched. |
| recipe eject <name> | Stop tracking. Everything becomes owned; writes a tombstone. |
States, and what they mean
| State | Exit | Meaning |
|---|---|---|
| up-to-date | 0 | Nothing to do. |
| customized | 0 | You edited an owned file. That is the point of owning it — green. |
| update-available | 1 | Canonical moved on. Run recipe update. |
| locally-drifted | 2 | You hand-edited a synced file. Resolve before updating. |
Where canonical comes from
recipe add, check, and update all need canonical. It is resolved in this order:
--canonical <dir>— an explicit directory.--runsnative-root <path>— a runsnative checkout. Auto-detected when the CLI is running from inside one.@runsnative/recipe-<name>, via node module resolution. This is the path for everyone outside the monorepo: install the recipe package and the CLI finds it innode_modules.
If none resolve, the CLI says so and names the package to install. It will not
report up-to-date for a recipe it cannot see — a green that was never computed
is worse than an error.
No network, no account
check and update read canonical off your disk. They make no HTTP call, need no
RunsNative account, and work offline. npm supplies the versioning and integrity
hashes. If you stop paying RunsNative for anything, this keeps working — the
tracked rung is carveable to pure-npm operation, and
tests/reachability.test.js proves it in a scratch directory with no runsnative
checkout present.
The optional recipe.config.json at your project root sets the default channel and
the automation policy. Absent, the documented defaults apply; autoMerge.mode
hard-defaults to off, so nothing is ever applied without your explicit opt-in.
Requires Node >= 18. License: MIT.
