fix(npm): flatten single-resolution peers when building package ids (#36608)