fix: make typescript peer optional and relax range (>=5.0.0)#8
Open
tnayuki wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7.
Problem
typescriptis declared as a required peer dependency pinned to^6.0.2. Any consumer not on TypeScript 6.x fails to install:TypeScript is needed neither at install nor at runtime — the package ships compiled JS (
dist/index.js), and the bundled.d.tsuses only basic declaration syntax (verified to type-check under TS 4.5 withskipLibCheck). The^6.0.2peer effectively tracks the version TS was built with (history: none →^5→^6.0.2) rather than a real minimum.Change
optional: truestops the peer from breakingnpm installfor consumers who don't have (or don't need) TypeScript — this is the key fix.>=5.0.0relaxes the caret pin to a lower bound, so newer TS releases keep satisfying it without further bumps.This matches common practice for type-shipping packages: many declare no
typescriptpeer at all (zod, type-fest, drizzle-orm, @trpc/server), and those that do mark it optional with a>=bound (valibot>=5optional, ts-essentials>=4.5.0optional).No runtime or API changes.