Skip to main content

Normalize Bundler

Normalize types, module, sideEffects, and esnext bundler convention fields in workspace package.json files.

Summary

The normalize-bundler recipe handles unofficial bundler convention fields in each workspace's package.json.

It merges the deprecated typings field into types, and normalizes module, sideEffects, and esnext fields according to common bundler expectations.

Behavior

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

  • typingstypes merge (Conditional) — If both fields exist, the existing types value is kept and typings is deleted. If only typings exists, it is renamed to types.
  • types (Conditional) — Removed if the workspace role does not allow it (only package and tool roles retain this field).
  • module (Conditional) — Removed if the workspace role does not allow it (only package and tool roles retain this field).
  • sideEffects (Conditional) — Removed if the workspace role does not allow it (only package roles retain this field).
  • esnext (Conditional) — Removed if the workspace role does not allow it (only package roles retain this field).

Usage

Options

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