Skip to content

Commit 5117aa7

Browse files
fix(docs): isolate TypeScript compiler API
1 parent 46e8e7d commit 5117aa7

7 files changed

Lines changed: 60 additions & 41 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@ updates:
1212
rspress:
1313
patterns:
1414
- '@rspress/*'
15-
ignore:
16-
# typescript@7.0.x is a native compiler: import('typescript') is only
17-
# { version, versionMajorMinor }. website/rspress.config.ts,
18-
# @rspress/plugin-twoslash@2.0.21 (peer ^6.0.3 -> twoslash@0.3.9 peer
19-
# ^5.5.0 || ^6.0.0), and typedoc@0.28.20 (peer 5.0.x–6.0.x;
20-
# TypeStrong/typedoc#3098 targets TS 7.1) all need the JS compiler API
21-
# and crash on 7.0.2. Root tsc is already 7.0.2; website stays on
22-
# 6.0.3. Drop this ignore when TypeDoc and twoslash support TS 7.
23-
- dependency-name: typescript
24-
update-types:
25-
- version-update:semver-major
2615
- package-ecosystem: github-actions
2716
# `/` covers .github/workflows/*; the composite actions under
2817
# .github/actions/* (where pnpm/setup lives) are separate directories.

‎.pnpmfile.cjs‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const typescriptApiConsumers = new Set([
2+
'@rspress/plugin-twoslash',
3+
'@rspress/plugin-typedoc',
4+
'@shikijs/twoslash',
5+
'twoslash',
6+
'typedoc',
7+
]);
8+
9+
function readPackage(pkg) {
10+
if (!typescriptApiConsumers.has(pkg.name)) {
11+
return pkg;
12+
}
13+
// Keep JavaScript-API consumers isolated from the website's native TypeScript 7 peer.
14+
pkg.dependencies ??= {};
15+
pkg.dependencies.typescript = pkg.peerDependencies?.typescript ?? '*';
16+
if (pkg.peerDependencies) {
17+
delete pkg.peerDependencies.typescript;
18+
}
19+
return pkg;
20+
}
21+
22+
module.exports = { hooks: { readPackage } };

‎docs/effect-conventions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ docs, or examples' user code. The four-concept newcomer ledger is untouched.
1111
| --- | --- |
1212
| npm `effect` | **`4.0.0-rc.112`** (exact). Latest published `rc` dist-tag on 2026-09-01. The Wave 3.5 brief named `4.0.0-rc.113`; that version was not on the registry. Re-pin chores take the next published RC. |
1313
| Vendored tree | `repos/effect` via `git subtree` from [Effect-TS/effect](https://github.com/Effect-TS/effect.git) `main` (v4). Squash commit tracks `packages/effect` version **4.0.0-rc.112**. |
14-
| `website` `typescript` | **`6.0.3`**, behind the root's TypeScript 7, because `typedoc@0.28` peers on `<= 6.0.x`. TypeDoc compiles the built `packages/agent-bundle/dist` declarations with it, while Twoslash compiles documentation samples against package source. Re-pin chores check whether a newer `typedoc` lifts the ceiling. |
14+
| `website` TypeScript | Native **`7.0.2`** runs `tsc`; the `typescript-6` alias stays on **`6.0.3`** for TypeDoc, Twoslash, and `rspress.config.ts` compiler-API calls. `.pnpmfile.cjs` turns those plugins' TypeScript peers into dependencies, and the scoped overrides in `pnpm-workspace.yaml` isolate them from TypeScript 7. Re-pin chores update the alias and overrides together. |
1515

1616
Application code imports the npm package. Never import from `repos/**`.
1717

‎pnpm-lock.yaml‎

Lines changed: 27 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pnpm-workspace.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ packages:
1212
# this checkout is about to publish.
1313
overrides:
1414
'@agent-bundle/runtime': workspace:*
15+
'@rspress/plugin-twoslash>typescript': npm:typescript@6.0.3
16+
'@rspress/plugin-typedoc>typescript': npm:typescript@6.0.3
17+
'@shikijs/twoslash>typescript': npm:typescript@6.0.3
1518
rsc-markdown-stream: workspace:*
19+
'twoslash>typescript': npm:typescript@6.0.3
20+
'typedoc>typescript': npm:typescript@6.0.3
1621
allowBuilds:
1722
'@google/genai': false
1823
msgpackr-extract: false

‎website/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"@types/react": "19.2.18",
3131
"react": "19.2.8",
3232
"react-dom": "19.2.8",
33-
"typescript": "6.0.3",
33+
"typescript": "7.0.2",
34+
"typescript-6": "npm:typescript@6.0.3",
3435
"zod": "4.5.4"
3536
}
3637
}

‎website/rspress.config.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { pluginLlms } from '@rspress/plugin-llms';
44
import { pluginTwoslash } from '@rspress/plugin-twoslash';
55
import { pluginTypeDoc } from '@rspress/plugin-typedoc';
66
import { transformerNotationHighlight } from '@shikijs/transformers';
7-
import ts from 'typescript';
7+
import ts from 'typescript-6';
88
import { generatedReference } from './plugins/generated-reference.ts';
99
import { cleanGeneratedApiMarkdown, mirrorApiLocale } from './plugins/mirror-api-locale.ts';
1010
import { rehypeTableCellBreaks } from './plugins/rehype-table-cell-breaks.ts';
@@ -192,8 +192,8 @@ export default defineConfig({
192192
plugins: [
193193
// TypeDoc reads packages/agent-bundle/dist declarations produced by the
194194
// package build. Twoslash still compiles documentation samples against
195-
// package sources. Both use the TypeScript 6 pin in website/package.json
196-
// because typedoc 0.28 peers on `<= 6.0.x`.
195+
// package sources. Both use the JavaScript compiler API from the
196+
// `typescript-6` alias; the website's `typescript` dependency is native.
197197
pluginTypeDoc({
198198
entryPoints: publicApiEntryPoints,
199199
outDir: generatedApiDir,

0 commit comments

Comments
 (0)