Skip to content

chore: use typescript 7 for the packages, keep 6 for the docs build - #4058

Merged
B4nan merged 2 commits into
masterfrom
chore/typescript-7
Aug 21, 2026
Merged

chore: use typescript 7 for the packages, keep 6 for the docs build#4058
B4nan merged 2 commits into
masterfrom
chore/typescript-7

Conversation

@B4nan

@B4nan B4nan commented Aug 20, 2026

Copy link
Copy Markdown
Member

Bumps typescript to ^7.0.2 (native compiler) for building and type-aware linting, together with oxlint-tsgolint@^7.0.2001, which version-tracks TS 7.

The docs build stays on TS 6: typedoc needs the TypeScript JS API, which the native compiler no longer exposes. The website keeps its own typescript: ^6.0.0 pin and pnpm nests that copy under node_modules/typedoc, so typedoc resolves 6.x while the packages compile with TS 7.

TS 7 also caught one real issue in the tests: RequestList#initialize() is private, and the call in request_list.test.ts now needs the same @ts-expect-error the surrounding test already uses for the private constructor.

The api-extractor runner script also imports typescript for its report parsing; that import now goes through a typescript-v6 alias (npm:typescript@^6.0.0), since the parsing needs the classic JS API (api-extractor itself bundles its own TypeScript and is unaffected). The regenerated reports in docs/public-api/ pick up TS 7's single-quoted string literal types in three packages, 4 lines total.

Same change as apify/apify-sdk-js#695. Build, docs build, type-aware lint, test typecheck and the unit suite all pass.

typedoc needs the TypeScript JS API that the TS 7 native compiler does
not expose, so the website keeps its own typescript ^6.0.0 pin; pnpm
nests that copy under node_modules/typedoc while the packages compile
with TS 7. oxlint-tsgolint moves to ^7.0.2001, which version-tracks
TS 7. TS 7 also flags the private RequestList#initialize() call in
request_list.test.ts, suppressed like the private-constructor call
above it.

Same change as apify/apify-sdk-js#695.
@B4nan B4nan added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Aug 20, 2026
@github-actions github-actions Bot added this to the 147th sprint - Tooling team milestone Aug 20, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Aug 20, 2026
The runner imports typescript for its report parsing, which now
resolves to the TS 7 native compiler without the JS API and crashed on
every package (api-extractor itself is unaffected: it bundles its own
TypeScript). A typescript-v6 npm alias keeps the runner on the classic
API. The regenerated reports pick up TS 7's single-quoted string
literal types in three packages.
@B4nan
B4nan requested a review from barjin August 20, 2026 15:08
Comment thread package.json
"turbo": "^2.10.11",
"typescript": "^6.0.0",
"typescript": "^7.0.2",
"typescript-v6": "npm:typescript@^6.0.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL you can do this with package.json versions, cool

@B4nan
B4nan merged commit 3c2dd5c into master Aug 21, 2026
17 of 18 checks passed
@B4nan
B4nan deleted the chore/typescript-7 branch August 21, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants