T
TanStack3mo ago
exotic-emerald

Would there be interest for adding `sherif` to the tanstack/router monorepo?

It's a high quality, fast tool for ensuring consistency across all the dependencies of a monorepo. https://github.com/QuiiBz/sherif It's as simple as pnpx sherif. No config, no install, doesn't even need node_modules. It has an autofix mode (--fix) perfect for the autofix.yml github action. And a non-autofix mode that could be added to test:ci and test:pr (though I don't know nx so I'm not sure how to go about this). We've been using this tool at work for about 1 year, and it occasionally catches a few nice things. We've never seen it catch something that it wasn't a good idea to fix. I ran it quickly just to see, and got some reports like:
⨯ error Dependency @tailwindcss/vite has multiple versions defined in the workspace. multiple-dependency-versions
./examples/react
start-tailwind-v4 ^4.1.6 ↑ highest
start-bare ^4.0.8 ↓ lowest
./examples/solid
start-bare ^4.0.8 ↓ lowest

1 issue found in ./e2e/react-start/basic-auth/package.json:

⨯ error Similar Prisma dependencies should use the same version. unsync-similar-dependencies
│ {
│ "dependencies": {
~ "@prisma/client": "5.22.0",
~ "prisma": "^5.22.0"
│ }
│ }

1 issue found in ./e2e/react-router/rspack-basic-virtual-named-export-config-file-based/package.json:

⨯ error devDependencies should be ordered alphabetically. unordered-dependencies
│ {
│ "devDependencies": {
~ ... ← keys aren't sorted.
│ }
│ }

1 issue found in ./e2e/e2e-utils/package.json:

⨯ error package.json should not have empty dependencies fields. empty-dependencies
│ {
- "dependencies": {} ← field is empty.
│ }
⨯ error Dependency @tailwindcss/vite has multiple versions defined in the workspace. multiple-dependency-versions
./examples/react
start-tailwind-v4 ^4.1.6 ↑ highest
start-bare ^4.0.8 ↓ lowest
./examples/solid
start-bare ^4.0.8 ↓ lowest

1 issue found in ./e2e/react-start/basic-auth/package.json:

⨯ error Similar Prisma dependencies should use the same version. unsync-similar-dependencies
│ {
│ "dependencies": {
~ "@prisma/client": "5.22.0",
~ "prisma": "^5.22.0"
│ }
│ }

1 issue found in ./e2e/react-router/rspack-basic-virtual-named-export-config-file-based/package.json:

⨯ error devDependencies should be ordered alphabetically. unordered-dependencies
│ {
│ "devDependencies": {
~ ... ← keys aren't sorted.
│ }
│ }

1 issue found in ./e2e/e2e-utils/package.json:

⨯ error package.json should not have empty dependencies fields. empty-dependencies
│ {
- "dependencies": {} ← field is empty.
│ }
PS: used the react tag, but just because there wasn't a more appropriate one
3 Replies
conscious-sapphire
conscious-sapphire3mo ago
we do use it for query i think cc @TkDodo 🔮 would you recommend for router?
exotic-emerald
exotic-emeraldOP3mo ago
off topic minor nitpick: i see in the github actions there is a bunch of if: ${{ always() }} and I think if: always() also works.
afraid-scarlet
afraid-scarlet3mo ago
yeah it's good except that we sometimes want different versions of dependencies, e.g. when we test against multiple versions of nextJs in our e2e test suite so we needed to define exceptions

Did you find this page helpful?