Maintain configuration consistency and compatibility by using a single, intentional strategy for dependency declarations, peer ranges, and script runtimes.
Apply these rules: 1) Pick a monorepo pattern per package type
workspace:* (so pnpm rewrites correctly) when the package is meant to work inside the workspace.workspace:* in examples if the repo’s established convention is semver.2) Prefer package-local dependency ownership
dependencies/peerDependencies (avoid relying on root devDependencies).3) Use peerDependencies when you don’t bundle
peerDependency (and match the repo’s compatibility range).4) Make peer semver ranges explicit and future-proof
5) Don’t duplicate tooling already provided by shared configs
6) Use the correct TS/script runner for the declared Node environment
tsx.Example (peer range + script runner):
{
"peerDependencies": {
"next": "^13 || ^14",
"typescript": "^5.0.0"
},
"scripts": {
"verify-links": "pnpm tsx scripts/verify-links.ts"
}
}
Example (workspace dep):
{
"dependencies": {
"@tanstack/query-core": "workspace:*"
}
}
Enter the URL of a public GitHub repository