Skip to content

Adopt stable TypeScript 7 across the workspace - #38

Merged
dahlia merged 2 commits into
fedify-dev:mainfrom
dahlia:fix/build-errors
Jul 28, 2026
Merged

Adopt stable TypeScript 7 across the workspace#38
dahlia merged 2 commits into
fedify-dev:mainfrom
dahlia:fix/build-errors

Conversation

@dahlia

@dahlia dahlia commented Jul 28, 2026

Copy link
Copy Markdown
Member

TypeScript 7 makes the native compiler the supported implementation behind the typescript package. Keeping @typescript/native-preview in mise.toml would leave type checking on a dated preview build while the workspace still declared TypeScript 6. The compiler should instead come from the same dependency graph as the code it checks.

The catalog in pnpm-workspace.yaml now selects TypeScript 7.0.2. Every package that participates in recursive type checking has a direct catalog dependency, including packages/web/package.json, so pnpm --recursive exec tsc --noEmit does not depend on a globally installed preview binary. tsdown moves to 0.22.14 because that release recognizes the stable TypeScript 7 package and declares support for it.

Keep declaration emission inside the workspace

The native declaration compiler exposed a boundary hidden by the preview setup. The GraphQL and application packages map workspace dependencies directly to sibling source trees. When tsdown starts declaration generation with a package-local config, those sources fall outside the root chosen by rolldown-plugin-dts, which can leave generated declarations beside files in packages/models/src/ and packages/graphql/src/.

The dedicated tsconfig.models.json, tsconfig.graphql.json, and tsconfig.drfed.json files give declaration generation the repository root as its boundary. Each one still extends its package config and narrows include to the package being built. Its typeRoots points back to that package's installed Node.js types, preserving the package-local dependency boundary even though the config itself lives at the root. This keeps tsdown's published .d.mts layout unchanged without allowing temporary declarations into source directories.

Keep one lockfile authoritative

The pnpm workspace already resolves all four packages through the root pnpm-lock.yaml. Keeping packages/web/pnpm-lock.yaml alongside it allowed the web package to describe a second dependency graph with different resolutions. Removing the nested lockfile makes the regenerated root lockfile the only record of the TypeScript and tsdown upgrade.

dahlia added 2 commits July 28, 2026 15:29
Replace the native preview tool with the stable TypeScript 7 package
and run type checks through tsc. Upgrade tsdown for TypeScript 7 support
and give declaration builds repository-root configs so workspace source
paths do not leak generated declarations into package sources.

User Prompt:
Now that TypeScript 7 has been officially released, replace the separately
installed tsgo preview with the official TypeScript 7 package throughout
the monorepo.

Assisted-by: Codex:gpt-5.6-sol
@dahlia dahlia added this to the DrFed 0.1.0 milestone Jul 28, 2026
@dahlia
dahlia requested review from 2chanhaeng, dodok8 and sij411 July 28, 2026 07:04
@dahlia dahlia self-assigned this Jul 28, 2026
@dahlia dahlia added bug Something isn't working dependencies Pull requests that update a dependency file labels Jul 28, 2026
@dahlia dahlia moved this from Todo to In progress in NLnet NGI0 Commons Fund (2026) Jul 28, 2026
@dahlia
dahlia merged commit 1fb1841 into fedify-dev:main Jul 28, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in NLnet NGI0 Commons Fund (2026) Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Pull requests that update a dependency file

Projects

Development

Successfully merging this pull request may close these issues.

3 participants