Skip to content

ci: check the published types with TypeScript 6 and 7 - #238

Merged
sadjow merged 3 commits into
mainfrom
ci/typescript-declarations
Oct 15, 2026
Merged

sadjow merged 3 commits into
mainfrom
ci/typescript-declarations

Conversation

@sadjow

@sadjow sadjow commented Oct 15, 2026

Copy link
Copy Markdown
Member

Applications compile the published declarations with whatever TypeScript they use, but test:package only 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.mjs accepts a TYPESCRIPT_VERSION environment variable. When it is set, the script installs that TypeScript release next to the isolated consumer and compiles test/package-fixture/consumer.mts against the packed tarball with it; without it, the check uses the repository's TypeScript as before. A new declarations job 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:package passes without the variable, with TYPESCRIPT_VERSION=6 (TypeScript 6.0.3), and with TYPESCRIPT_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 0 and pnpm format:check pass.

@sadjow
sadjow merged commit 3c637f5 into main Oct 15, 2026
9 checks passed
@sadjow
sadjow deleted the ci/typescript-declarations branch October 15, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant