Skip to main content

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.json is 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 setting removeUnknownKeys to false.
  • Reorder keys — All remaining keys are reordered to a canonical sort order. Known keys are placed first in the defined order. Unknown keys (when removeUnknownKeys is false) are appended after known keys in their original relative order. If the key order already matches, no changes are made. Disable per-workspace by setting reorderKeys to false.

Settings

SettingDefaultDescription
removeUnknownKeystrueRemove keys not recognized by npm, Node.js, Corepack, or bundlers.
reorderKeystrueReorder keys to a canonical sort order.

Usage

Options

FlagDescription
-d, --dry-runPreview changes without modifying files.
-r, --replace-fileOverwrite 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.