Skip to content

filter(npm): add npm install / npm ci filter #40

@mpecan

Description

@mpecan

Goal

Expand npm filters to cover npm install and npm ci — the install operations. Currently npm/run.toml exists for script execution but install operations have no filter.

Background

npm install with a medium-sized project emits:

  • npm warn deprecated <package>@<version>: ... for every deprecated transitive dependency (often dozens of lines for packages the user can't control)
  • npm notice informational lines
  • Progress indicators (in non-CI mode)

The community has requested a way to suppress deprecated warnings from sub-dependencies while keeping those from direct dependencies (npm/cli#5232). Currently the only option is --loglevel=error which also hides useful notices.

Filters to Add

npm/install.tomlnpm install / npm i

  • Skip: npm warn deprecated lines (transitive dep deprecations), npm notice lines, progress lines
  • Keep: npm error lines, npm warn EBADENGINE (Node version mismatch), security audit summary if present, the final added X packages summary line

npm/ci.tomlnpm ci

  • Same as npm/install.toml but also keep npm warn lines that indicate lock file conflicts (these are actionable in CI context)

Fixture Files Needed

  • tests/fixtures/npm/install-clean.txt — fresh install with many deprecated transitive dep warnings
  • tests/fixtures/npm/install-error.txt — install failure (version conflict, network error)
  • tests/fixtures/npm/ci-lockfile-mismatch.txtnpm ci with lock file mismatch warning

Acceptance Criteria

  • Deprecated transitive dependency warnings removed from output
  • npm error lines always preserved
  • Final package count summary line always preserved
  • Integration tests pass for all fixture files

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions