feat!: restrict typescript peer dependency to >=5.5 <7 - #71
Merged
Merged
Conversation
BREAKING CHANGE: The typescript peer dependency is narrowed from "*" to ">=5.5 <7". TypeScript 7 is rewritten in Go and no longer exposes the JavaScript programmatic API (createProgram, ModuleResolutionKind, etc.) that @arethetypeswrong/core relies on at runtime. Installing this plugin with only TypeScript 7 available will cause runtime failures. If you are migrating to TypeScript 7 (tsgo) for compiling your own code, you can run TypeScript 6 side-by-side using the official compatibility package: npm install -D typescript@npm:@typescript/typescript6@^6.0.0 This keeps "typescript" resolving to v6 for tools that depend on the JS API, while you use tsgo (or @typescript/native-preview) for builds and editor support. Once @arethetypeswrong/core adds TypeScript 7 support (expected after the stable programmatic API ships in TypeScript 7.1), this constraint will be relaxed.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Merged
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.
Summary
Restrict the
typescriptpeer dependency from"*"to">=5.5 <7".Motivation
TypeScript 7 is rewritten in Go and no longer exposes the JavaScript programmatic API (
createProgram,ModuleResolutionKind,createSourceFile, etc.). The@arethetypeswrong/corepackage relies on these APIs at runtime.During bundling, Rslib externalizes
typescript(because it is declared as a peer dependency), producing:in
dist/@arethetypeswrong/core.js. At runtime this resolves to whatevertypescriptthe consumer has installed. If that is TypeScript 7, all API calls returnundefinedand the plugin crashes.Breaking Change
Consumers who have
typescript >= 7as their only installed TypeScript will see a peer dependency warning. They need to ensure a TypeScript 5.x or 6.x is available for this plugin.Using TypeScript 6 side-by-side with TypeScript 7
If you are migrating to TypeScript 7 (
tsgo) for compiling your own code, you can run TypeScript 6 side-by-side using the official compatibility package:This keeps
typescriptresolving to v6 for tools that depend on the JS API, while you usetsgo(or@typescript/native-preview) for builds and editor support.Future
Once
@arethetypeswrong/coreadds TypeScript 7 support (expected after the stable programmatic API ships in TypeScript 7.1), this constraint will be relaxed.