Upgrade to TypeScript 7.0.2#31
Merged
Merged
Conversation
TypeScript 7 is a native rewrite that no longer ships lib/typescript.js, which Next.js and ts-morph still require for programmatic API access. - Add typescript-7 (7.0.2) for the native tsc compiler via typecheck script - Keep typescript (^6.0.2) for Next.js build type-checking and ts-morph - Set explicit types: ["node"] in tsconfig for TS7 default behavior - Add typecheck script and CI job using the TS7 compiler - Remove stale pnpm-lock.yaml (project uses bun.lock) Co-authored-by: Bartosz Zagrodzki <Bartek532@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: Bartosz Zagrodzki <Bartek532@users.noreply.github.com>
TypeScript 7 cannot replace the main typescript package yet because Next.js requires lib/typescript.js for build-time type checking. - Pin typescript-7 to 7.0.2 for the native TS7 compiler - Keep typescript@^6.0.2 for Next.js and ts-morph API access Co-authored-by: Bartosz Zagrodzki <Bartek532@users.noreply.github.com>
TypeScript 7 cannot be the sole dependency yet because Next.js requires lib/typescript.js during build. The typescript-7 alias was unused after dropping the typecheck script. Co-authored-by: Bartosz Zagrodzki <Bartek532@users.noreply.github.com>
- Set typescript to 7.0.2 (native compiler) - Add @typescript/native-preview for Next.js compatibility - Enable typescript.ignoreBuildErrors until Next.js supports TS7 API Co-authored-by: Bartosz Zagrodzki <Bartek532@users.noreply.github.com>
Verified by testing each piece individually: - @typescript/native-preview: required (Next.js postinstall/build) - typescript.ignoreBuildErrors: not needed with native-preview - tsconfig types: ["node"]: not needed for this project Fix oxfmt ordering in package.json devDependencies. Co-authored-by: Bartosz Zagrodzki <Bartek532@users.noreply.github.com>
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
Upgrades to TypeScript 7.0.2 with only the config that is actually required.
Required
typescript@7.0.2@typescript/native-previewlib/typescript.js, which TS7 removed. This package tells Next.js to use the native compiler path sopostinstallandnext builddon't fail or loopNot needed (verified by testing)
typescript.ignoreBuildErrorsnative-previewis presenttsconfig types: ["node"]build,lint, andtsc --noEmitall pass without itAlso fixed
package.jsondevDependency ordering foroxfmt.Validation
bun run formatbun run lintbun run buildpostinstall