Cleanup
Remove unsupported keys and reorder remaining keys in workspace package.json files.
Summary
The cleanup recipe finalizes each workspace's package.json by removing keys that are not in the known set of npm, Node.js, Corepack, or bundler fields and reordering remaining keys to a canonical order.
Behavior is controlled per-workspace via recipe settings in nova.config.json.
Behavior
For each eligible workspace, the recipe applies up to two operations in order:
- Remove unknown keys — Every key in
package.jsonis checked against a combined allowlist of npm, Node.js, Corepack, and bundler fields. Keys not in the allowlist are logged as a warning and then deleted. Disable per-workspace by settingremoveUnknownKeystofalse. - Reorder keys — All remaining keys are reordered to a canonical sort order. Known keys are placed first in the defined order. Unknown keys (when
removeUnknownKeysisfalse) are appended after known keys in their original relative order. If the key order already matches, no changes are made. Disable per-workspace by settingreorderKeystofalse.
Settings
| Setting | Default | Description |
|---|---|---|
removeUnknownKeys | true | Remove keys not recognized by npm, Node.js, Corepack, or bundlers. |
reorderKeys | true | Reorder keys to a canonical sort order. |
Usage
Options
| Flag | Description |
|---|---|
-d, --dry-run | Preview changes without modifying files. |
-r, --replace-file | Overwrite the original file instead of creating a .nova-backup copy. |
Unsupported Keys
During cleanup, this recipe removes any package.json keys that are not in the known set of npm, Node.js, Corepack, or bundler fields.
Disable this behavior per-workspace by setting removeUnknownKeys to false in the recipe settings.