Split the package model by package type
Problem
The package model has become large and full of conditional methods (validate x if npm?
).
The code is becoming more difficult to navigate and maintain, and thus more suseptible to bugs.
Solution
We should consider splitting the model by package type.
The goal is to have any logic that is specific to an individual package type live in its own isolated class and only have logic that is completely shared among all package types be in the shared class or module.