ricokahler / sanity-codegen

Generate TypeScript types from your Sanity.io schemas
sanity-codegen-dev.vercel.app
MIT License
270 stars 19 forks source link

Needs support for Prettier version 3 #312

Open w3bdesign opened 1 year ago

w3bdesign commented 1 year ago
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: sanity-codegen@0.9.8
npm ERR! Found: prettier@3.0.0
npm ERR! node_modules/prettier
npm ERR!   dev prettier@"^3.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer prettier@"^2.0.0" from sanity-codegen@0.9.8
npm ERR! node_modules/sanity-codegen
npm ERR!   dev sanity-codegen@"^0.9.8" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: prettier@2.8.8
npm ERR! node_modules/prettier
npm ERR!   peer prettier@"^2.0.0" from sanity-codegen@0.9.8
npm ERR!   node_modules/sanity-codegen
npm ERR!     dev sanity-codegen@"^0.9.8" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /tmp/worker/dae811/764f68/cache/others/npm/_logs/2023-07-05T15_01_05_455Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /tmp/worker/dae811/764f68/cache/others/npm/_logs/2023-07-05T15_01_05_455Z-debug-0.log
w3bdesign commented 1 year ago

Should be resolved in https://github.com/ricokahler/sanity-codegen/pull/313

Ne-Ne commented 1 year ago

@w3bdesign I saw the PR that resolves the above, thanks for getting on this.

Are there plans to merge this back into main?

I am also curious why prettier is specified within peerDependencies as it breaks my project upgrade to v3.

mi-na-bot commented 1 year ago

@Ne-Ne The last release or a usable version was almost two years ago, so probably not soon! There is really nothing wrong with Prettier v2...

Ne-Ne commented 1 year ago

I don't have anything against Prettier v2 @minervabot.

However, this peerDependencies reference blocks consumers from upgrading tools. I currently run Renovate so I get auto-package updates. It is frustrating that my PR queue now has errors due to this blocking dep.

Ironically the Prettier package serves no purpose for npm package consumers and is only an internal tool.