Giter Club home page Giter Club logo

Comments (6)

RobinTail avatar RobinTail commented on May 26, 2024 1

Hello @sachinraja ,

TS already released satisfies in 4.9.
However, as longer as you don't need to use it, you don't have to update Typescript dependency of your library.

Moreover, consumers of your library, having their own TS 4.9 wouldn't see the warning I mentioned above, since your library would have it's own TS 4.8.4 version installed (as a sub-dependency needed for that particular purpose).

And the final piece. When TS 5.0 will be released, having some breaking changes and removed methods, your library would remain operational, since it would still operate the version defined in prod dependencies. It will work for those who'll be using TS 5 in their project as well.

So, in general and regarding Typescript, I see this approach more beneficial.
I'm going to do this in express-zod-api, since I found the same problem.
However, consider this as just a suggestion and my humble opinion.

Best wishes.

from zod-to-ts.

sachinraja avatar sachinraja commented on May 26, 2024

Hey, thanks for opening this! I'm still not sure if I want to move it from a peer dependency though. What happens if TS implements a new operator like satisfies? Would I also have to keep that version updated here and do a new release?

I'm ok with doing that but it doesn't feel right. It might be necessary though since TS doesn't follow semver.

from zod-to-ts.

RobinTail avatar RobinTail commented on May 26, 2024

@sachinraja ,

what would be your decision on this and #24 ?

from zod-to-ts.

sachinraja avatar sachinraja commented on May 26, 2024

I'm leaning on no for this @RobinTail. I don't like forcing the consumer to use our version of TypeScript. I'd rather use stricter peer dependencies to enforce a certain version. In almost every project I use zod-to-ts in, I don't want it to have its own version of TypeScript.

from zod-to-ts.

RobinTail avatar RobinTail commented on May 26, 2024

@sachinraja ,

By making Typescript a prod dependency you do not affect the version of Typescript on consumer's side.
Consumer's Typescript is installed to /node_modules/typescript, while Typescript used by your package (used by consumer) is installed to /node_modules/zod-to-ts/node_modules/typescript.
So they are completely independent installations.

However, if what I've said doesn't sound convincing enough, please close this issue so I'd know what final decision you ended up making, as I need to make mine.

from zod-to-ts.

RobinTail avatar RobinTail commented on May 26, 2024

@sachinraja

I don't like forcing the consumer to use our version of TypeScript.

and

I'd rather use stricter peer dependencies to enforce a certain version

these two statements contradict each other.
peer dependency — IS forcing the consumer to use certain TS version.

While I'm offering to have your own TS version installed for your package needs.

from zod-to-ts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.