Minimal runtime dependencies
Why it matters
Every dependency in dependencies is installed by every consumer, even in production. TypeScript, @types/*, test runners, and build tools in dependencies instead of devDependencies inflate the install footprint of every project that depends on yours. node-fetch as a runtime dependency in a package that declares engines: { node: '>=18' } installs a redundant polyfill of a built-in. CWE-1357 covers use of unnecessarily broad components; SLSA L1 and SSDF PO.3.2 both require that the published artifact's dependency tree is intentional and minimal.
Severity rationale
Medium because misplaced or unnecessary runtime dependencies increase install size and supply chain surface area for all consumers, without providing any functional benefit.
Remediation
Audit dependencies and move build tools, type packages, and test frameworks to devDependencies. Replace convenience packages with built-in equivalents.
// Before — misplaced deps:
{
"dependencies": {
"typescript": "^5.0.0",
"@types/node": "^20.0.0",
"node-fetch": "^3.0.0",
"vitest": "^1.0.0"
}
}
// After — clean runtime deps:
{
"dependencies": {},
"devDependencies": {
"typescript": "^5.0.0",
"@types/node": "^20.0.0",
"vitest": "^1.0.0"
}
}
Run npx depcheck to surface unused dependencies. Replace node-fetch with built-in fetch (Node 18+) and uuid with crypto.randomUUID(). Target: no more than 10 runtime dependencies for a typical SDK.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the SDK / Package Quality Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · maintainability.modifiability — Modifiability — minimal runtime deps reduce version-conflict surface
- ssdf:800-218 · PO.3.2 — Review and update software dependency requirements
- slsa:1.0 · L1 — SLSA L1 — fewer deps shrink provenance scope
- cwe · CWE-1357 — Reliance on Insufficiently Trustworthy Component
Taxons
History
- 2026-04-18·v1.0.0·Initial import from sdk-package-quality·automated