Skip to content

Commit ca83879

Browse files
chore: upgrade TypeScript to ^5.8.0 across workspace (prep for tsgo) (#4187)
Bumps the workspace onto TypeScript `^5.8.0` as preparatory work for adopting the [TypeScript Native Preview (`tsgo`)](https://github.com/microsoft/typescript-go) compiler in a follow-up PR. `tsc --build` remains the source of truth for emit. ## Changes * Unify TypeScript version at `^5.8.0` across the workspace * A few typing fixes as a result of the version upgrade * Bump `typedoc` from `^0.26.11` to `^0.28.19` for latest TS version support * Exclude `typedoc` output directory from graphiql's tsconfig ## Follow-ups * A separate PR will introduce `@typescript/native-preview`, parallel `check:tsgo` / `types:check:tsgo` scripts, a CI parity job, and VSCode LSP configuration. * `tsconfig` improvements, i.e. `verbatimModuleSyntax: true` - Type-checking test files 👀
1 parent a518b42 commit ca83879

File tree

15 files changed

+131
-244
lines changed

15 files changed

+131
-244
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'graphql-language-service-server': patch
3+
---
4+
5+
Bump required TypeScript runtime dependency from `^5.3.3` to `^5.8.0`. This is preparatory work for adopting the TypeScript Native Preview (tsgo) compiler in a follow-up change, which tracks TypeScript 5.8 semantics. In practice `^5.3.3` already resolved to TS 5.8+ for most consumers; the new floor only affects consumers who pin TypeScript to 5.3–5.7 via resolutions or overrides.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@
120120
"rimraf": "^3.0.2",
121121
"ts-jest": "^27.1.5",
122122
"turbo": "^2.5.2",
123-
"typedoc": "^0.26.11",
124-
"typescript": "^4.6.3",
123+
"typedoc": "^0.28.19",
124+
"typescript": "^5.8.0",
125125
"vitest": "^2.1.9",
126126
"wgutils": "^1.2.5",
127127
"wsrun": "^5.2.4"

packages/cm6-graphql/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@lezer/highlight": "^1.0.0",
3232
"@lezer/lr": "^1.0.0",
3333
"graphql": "^16.9.0",
34-
"typescript": "^4.6.3"
34+
"typescript": "^5.8.0"
3535
},
3636
"peerDependencies": {
3737
"@codemirror/autocomplete": "^6.0.0",

packages/codemirror-graphql/src/utils/info-addon.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@
1010
import CodeMirror from 'codemirror';
1111
import { GraphQLInfoOptions } from '../info';
1212

13+
// CodeMirror's option system accepts the option value as the declared shape,
14+
// a boolean to enable/disable with defaults, or a function used as the render
15+
// helper. The handler below handles all three cases, so the parameter types
16+
// are widened accordingly.
17+
type GraphQLInfoOptionValue = GraphQLInfoOptions | boolean | (() => string);
18+
1319
CodeMirror.defineOption(
1420
'info',
1521
false,
1622
(
1723
cm: CodeMirror.Editor,
18-
options: GraphQLInfoOptions,
19-
old?: GraphQLInfoOptions,
24+
options: GraphQLInfoOptionValue,
25+
old?: GraphQLInfoOptionValue,
2026
) => {
2127
if (old && old !== CodeMirror.Init) {
2228
const oldOnMouseOver = cm.state.info.onMouseOver;
@@ -33,7 +39,7 @@ CodeMirror.defineOption(
3339
},
3440
);
3541

36-
function createState(options: GraphQLInfoOptions) {
42+
function createState(options: GraphQLInfoOptionValue) {
3743
return {
3844
options:
3945
options instanceof Function

packages/graphiql-plugin-code-exporter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"graphql": "^16.9.0",
4848
"react": "^19.1.0",
4949
"react-dom": "^19.1.0",
50-
"typescript": "^4.6.3",
50+
"typescript": "^5.8.0",
5151
"vite": "^6.3.4",
5252
"vite-plugin-dts": "^4.0.1"
5353
}

packages/graphiql-plugin-explorer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"graphql": "^16.9.0",
4747
"react": "^19.1.0",
4848
"react-dom": "^19.1.0",
49-
"typescript": "^4.6.3",
49+
"typescript": "^5.8.0",
5050
"vite": "^6.3.4",
5151
"vite-plugin-dts": "^4.0.1",
5252
"vite-plugin-svgr": "^4.3.0"

packages/graphiql-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"graphql": "^16.9.0",
7979
"react": "^19.1.0",
8080
"react-dom": "^19.1.0",
81-
"typescript": "^4.6.3",
81+
"typescript": "^5.8.0",
8282
"vite": "^6.3.4",
8383
"vite-plugin-dts": "^4.5.3",
8484
"vite-plugin-svgr": "^4.3.0"

packages/graphiql-react/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"jsx": "react-jsx",
1717
"declaration": true,
1818
"noUncheckedIndexedAccess": true,
19-
"importsNotUsedAsValues": "error",
2019
"types": ["vitest/globals", "@testing-library/jest-dom"]
2120
}
2221
}

packages/graphiql/cypress/support/commands.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Cypress.Commands.add(
9090
)
9191
.eq(0)
9292
.should(element => {
93-
const actual = normalizeMonacoWhitespace(element.get(0).textContent!);
93+
const actual = normalizeMonacoWhitespace(element.get(0).textContent);
9494
const expected = JSON.stringify(variables, null, 2);
9595
expect(actual).to.equal(expected);
9696
});
@@ -114,7 +114,7 @@ Cypress.Commands.add(
114114
)
115115
.eq(1)
116116
.should(element => {
117-
const actual = normalizeMonacoWhitespace(element.get(0).textContent!);
117+
const actual = normalizeMonacoWhitespace(element.get(0).textContent);
118118
const expected = headersString;
119119
expect(actual).to.equal(expected);
120120
});
@@ -144,7 +144,7 @@ function normalizeMonacoWhitespace(str: string): string {
144144

145145
Cypress.Commands.add('containQueryResult', expected => {
146146
cy.get('section.result-window').should(element => {
147-
const actual = normalizeMonacoWhitespace(element.get(0).textContent!);
147+
const actual = normalizeMonacoWhitespace(element.get(0).textContent);
148148
expect(actual).to.contain(expected);
149149
});
150150
});

packages/graphiql/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"react": "^19.1.0",
7575
"react-dom": "^19.1.0",
7676
"start-server-and-test": "^1.10.11",
77-
"typescript": "^4.6.3",
77+
"typescript": "^5.8.0",
7878
"vite": "^6.3.4",
7979
"vite-plugin-dts": "^4.5.3",
8080
"vitest-canvas-mock": "0.3.3"

0 commit comments

Comments
 (0)