1 day ago · Tech · hide · 0 comments

Most developers get this wrong, in my experience… and I don’t blame them! Assumed audience: Software developers who know at least a little about versioning and package management. A bit of context: I wrote this up on social media in the middle of the week, and wanted to make sure it got its usual permanent home here. I was looking at a bunch of our package.json files internally this past week and considering the extent to which they’re actually just wrong on the strict semantics of our packages, but also considering how hard it is to have the right mental model for this — and monorepos make it harder by “absorbing” wrongness. A classic example: if you have a package that is designed to work with Vitest, but which is a library, it should explicitly include Vitest in peerDependencies. If it also uses Vitest for its own tests (which it probably should), it should also specify it in devDependencies. Consuming packages should then also specify it in their own devDependencies, so that they…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.