Closed zkanda closed 1 year ago
I'm wondering why TypeScript is a peerDependency at all. Libraries shouldn't have it as a dependency if it's only used for building (and not doing anything with the actual ts compiler)
I'm wondering why TypeScript is a peerDependency at all. Libraries shouldn't have it as a dependency if it's only used for building (and not doing anything with the actual ts compiler)
I think it has to do with the fact that CVA is designed for TS, but there are always those who can't (or won't) use TS and still want to use CVA.
Beat me to it. Also having the same issue 😭
I think it has to do with the fact that CVA is designed for TS, but there are always those who can't (or won't) use TS and still want to use CVA.
For those cases simply publishing the type declarations is enough. There's no need for TypeScript to be a peer dependency if all you're doing is publishing types
Hey gang!
Appreciate the enthusiasm to get the ball rolling on this, but I'm in strict vacation mode right now until mid-April.
I've been coding flat-out over the last year for work and during my free time – I don't get paid for my open-source work. (I can't use GitHub Sponsors due to lack of taxation features outside of the US)
Quickly dropping in to answer the burning question:
I'm wondering why TypeScript is a peerDependency at all. Libraries shouldn't have it as a dependency if it's only used for building (and not doing anything with the actual ts compiler)
It's here to make sure that people using CVA with TypeScript are using a supported version (I would much rather close https://github.com/joe-bell/cva/pull/127 in favour of a simple version bump to continue that trend)
Rest assured this will be fixed, and I'll tackle it as soon as I'm back from vacation. In the meantime I'd be grateful for a few weeks of patience 🙏
If you need a workaround in the meantime, check out options like pnpm patch
It's a bit of a 🐥 and the 🥚 problem – it is impossible to work around it with pnpm patch
or npx patch-package
. Patches are only applied in postinstall
, so it's too late because the error happens during the install. It is not possible to run patch-package
on preinstall
either, because patch-package
and cva is not installed yet https://github.com/ds300/patch-package/issues/49#issuecomment-831231339
Not sure if there are any possible workarounds besides forking, downgrading TS, or using npm install --force
locally and on CI for the time being. Totally understand you are on vacation and I wish you a good rest, I'm just surprised there are no mechanisms in JS to work around this 😅
Shipped in 0.5.1
:ship:
I'm still supposed to be on vacation right now, so please consider supporting the project if this release is useful to you!
I'm getting a dependency resolution error on the latest tagged version. Perhaps the project wanna release a new version.
Thanks for this amazing project.