Skip to main content

Normalize Tooling

Normalize scripts, gypfile, config, and workspaces fields in workspace package.json files.

Summary

The normalize-tooling recipe handles tooling-related fields in each workspace's package.json.

It normalizes the scripts object, gypfile flag, config object, and workspaces field according to workspace role conventions.

Behavior

For each eligible workspace, the recipe inspects tooling-related fields and applies the following rules. See Workspace Rules for how tags are determined.

  • scripts (Required) — If the field is missing, it is added as an empty object {}.
  • gypfile (Required) — If present but no binding.gyp file exists in the workspace directory, the field is removed. If missing but binding.gyp exists and neither scripts.preinstall nor scripts.install are defined, it is added as true.
  • config (Conditional) — Removed if the field is present but empty.
  • workspaces (Required) — Removed if the workspace role is not project. If the role is project and the field is missing, it is added as an empty array [].

Usage

Options

FlagDescription
-d, --dry-runPreview changes without modifying files.
-r, --replace-fileOverwrite the original file instead of creating a .nova-backup copy.