Repository navigation
ci: check the published types with TypeScript 6 and 7 - #238
Merged
Merged
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.
Applications compile the published declarations with whatever TypeScript they use, but
test:packageonly checked them with the version this repository pins, TypeScript 5.9. TypeScript 6 and the native TypeScript 7 compiler are both current releases now.scripts/test-package.mjsaccepts aTYPESCRIPT_VERSIONenvironment variable. When it is set, the script installs that TypeScript release next to the isolated consumer and compilestest/package-fixture/consumer.mtsagainst the packed tarball with it; without it, the check uses the repository's TypeScript as before. A newdeclarationsjob in CI runs the check with the latest TypeScript 6 and 7 releases on Node.js 22. It isn't a required check. The README's Data and TypeScript section now states which TypeScript releases CI checks the declarations with, and the development section documents the variable.Validation:
pnpm test:packagepasses without the variable, withTYPESCRIPT_VERSION=6(TypeScript 6.0.3), and withTYPESCRIPT_VERSION=7(TypeScript 7.0.2). With a mistyped campaign field planted in the consumer, the TypeScript 7 run fails with TS2322, so the installed compiler really checks the declarations.pnpm lint --max-warnings 0andpnpm format:checkpass.