I think a (regulated, secure) npm for postgres would be great, that works from inside the postgres toolchain.
For context, there are a few efforts in progress. I'm sure there are more. - https://pgxman.com - https://pgt.dev - pgxn v2: https://github.com/orgs/pgxn/projects/1/views/1