JonShort / npm-bumpall

Utility to bump all packages to latest
MIT License
0 stars 0 forks source link

[bug] - Support / ignore workspaces #15

Open JonShort opened 1 year ago

JonShort commented 1 year ago

Currently if this tool is run within repositories using npm workspaces, it can cause dependencies to be upgraded incorrectly.

Example

Project with one workspace (named package-1)

image

Run with -l (latest) flag

image

Workspace dependency remains outdated

image

⚠️ :bug: abbrev is now installed at root

image

Options

Option 1 - Ignore workspaces

image

This could be a good first step just to avoid the bug before adding full support

Since npm provides the "Depended by" field, we can probably filter workspace deps out within the existing filter section

Option 2 - Add workspace support

Workspace deps can be installed with npm i dependency@version -w workspace-name

This means that we could check if any workspace deps exist, and run multiple installs, e.g.

  1. Collect outdated deps
  2. Upgrate root packages
  3. Update workspace deps (loop per workspace)

This adds a fair amount of complexity, but isn't impossible