Sync Environment
Sync engines, os, cpu, libc, devEngines, and packageManager fields in workspace package.json files.
Summary
The sync-environment recipe ensures that runtime environment fields in each workspace's package.json follow consistent conventions.
When the trackNodeLtsVersions setting is enabled, it automatically updates the engines.node constraint to match all currently active Node.js LTS versions.
Behavior
For each eligible workspace, the recipe inspects environment and runtime fields and applies the following rules. See Workspace Rules for how tags are determined.
packageManager(Conditional) — Removed if the workspace role is notproject. If the role isprojectbut the value is not a string inname@versionformat, it is removed.engines(Required) — If missing, it is created. When active Node.js LTS versions are available,engines.nodeis set to the computed constraint. Ifenginesexists butengines.nodeis missing, the constraint is added.engines.nodetracking — WhentrackNodeLtsVersionsis enabled, the recipe checks whether the currentengines.nodevalue covers all active LTS major versions using>=N,^N,~N,N.x, or*patterns. If coverage is incomplete, a warning is logged. The value is then synced to the computed constraint.os(Conditional) — Removed if the field is present but empty.cpu(Conditional) — Removed if the field is present but empty.libc(Required) — Removed ifosdoes not includelinux. If missing butosincludeslinux, it is added as["glibc"].devEngines(Conditional) — Removed if the field is present but empty.
Settings
Settings are configured per workspace in nova.config.json under the recipes key:
| Setting | Type | Description |
|---|---|---|
trackNodeLtsVersions | boolean | Automatically sync engines.node to current Node.js LTS versions. |
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. |