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 nobinding.gypfile exists in the workspace directory, the field is removed. If missing butbinding.gypexists and neitherscripts.preinstallnorscripts.installare defined, it is added astrue.config(Conditional) — Removed if the field is present but empty.workspaces(Required) — Removed if the workspace role is notproject. If the role isprojectand the field is missing, it is added as an empty array[].
Config Fields
A workspace is only processed when its nova.config.json entry opts in. The recipe filters out any workspace that does not enable normalize-tooling, and skips entirely when no workspace enables it.
| Field | Description |
|---|---|
workspaces[].recipes | Per-workspace recipe map in nova.config.json. A workspace with no recipes map is skipped. |
workspaces[].recipes['normalize-tooling'] | Recipe tuple enabling this recipe for the workspace. The first tuple element must be true; otherwise the workspace is skipped. |
Usage
Options
| Flag | Description |
|---|---|
-d, --dry-run | Run without writing any files. |
-r, --replace-file | Overwrite the original file instead of creating a .nova-backup copy. |