Skip to content

refactor: collapse scanner boilerplate via runScanner + scanAll#79

Merged
mulhamna merged 10 commits into
mainfrom
refactor/scanner-boilerplate
Jun 21, 2026
Merged

refactor: collapse scanner boilerplate via runScanner + scanAll#79
mulhamna merged 10 commits into
mainfrom
refactor/scanner-boilerplate

Conversation

@mulhamna

Copy link
Copy Markdown
Owner

Summary

Changes

  • src/utils.js — new runScanner helper (shared binary resolve → exec → parse, plus the permission/timeout warning contract). Moved getCliOptionValue / hasCliFlag / optsOf here (were duplicated across audit.js and upgrade.js).
  • src/scanners/* — 32 exec-and-parse scanners reduced to command + parse. The 6 filesystem / multi-step scanners (cargo, dnf, go, gradle, maven, nuget) are intentionally left as-is — forcing them into the helper would hurt readability.
  • src/index.js — extract scanAll / resolveScanners; adopted in audit.js and upgrade.js.
  • src/upgrade.js — inline the trivial bucket summary. src/ports.js — drop a dead parseMacPorts regex branch.
  • Makefilemake verify = format:check + lint + test.
  • AGENTS.md / GEMINI.md — agent guides; ignore local .claude dir.
  • depschore(deps-dev): eslint 10.4.1 → 10.5.0, prettier 3.8.3 → 3.8.4.

Test plan

  • make verify (format:check + lint + test) green
  • node --test — 12 tests pass
  • Smoke: pkgmap, pkgmap -m npm, pkgmap audit -m npm --json, pkgmap ports --json, pkgmap upgrade -m npm --dry-run
  • npm run release:check

Supersedes dependabot #76 and #78 — both bumps are bundled in this PR.

@mulhamna mulhamna force-pushed the refactor/scanner-boilerplate branch from ffdbb09 to 8ba57c6 Compare June 21, 2026 05:20
@mulhamna mulhamna merged commit bac20f3 into main Jun 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant