Skip to content

Commit 825e8c8

Browse files
committed
refactor: bump minimum TypeScript version to 5.4. (#1773)
1 parent 4ff4014 commit 825e8c8

9 files changed

Lines changed: 15 additions & 61 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ jobs:
235235
fail-fast: false
236236
matrix:
237237
typescript-version: [
238-
~5.3.0, # 20.11.2023 https://devblogs.microsoft.com/typescript/announcing-typescript-5-3/
239238
~5.4.0, # 6.3.2024 https://devblogs.microsoft.com/typescript/announcing-typescript-5-4/
240239
~5.8.0, # 28.2.2025 https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/ https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/ https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/ https://devblogs.microsoft.com/typescript/announcing-typescript-5-8/
241240
~5.9.0, # 1.8.2025 https://devblogs.microsoft.com/typescript/announcing-typescript-5-9/
@@ -268,15 +267,12 @@ jobs:
268267
run: |
269268
TS_VERSION="${{ matrix.typescript-version }}"
270269
echo "TS_VERSION=$TS_VERSION" >> $GITHUB_ENV
271-
TSD_VERSION=$(echo '{"~5.3.0":"0.30.7", "~5.4.0":"0.31.2", "~5.8.0":"0.32.0", "~5.9.0":"0.33.0"}' | jq -r --arg key "$TS_VERSION" '.[$key]')
270+
TSD_VERSION=$(echo '{"~5.4.0":"0.31.2", "~5.8.0":"0.32.0", "~5.9.0":"0.33.0"}' | jq -r --arg key "$TS_VERSION" '.[$key]')
272271
echo "TSD_VERSION=$TSD_VERSION" >> $GITHUB_ENV
273272
274273
- name: Install Typescript (${{ env.TS_VERSION }}) and TSD (${{ env.TSD_VERSION }})
275274
run: pnpm i -D typescript@${{ env.TS_VERSION }} tsd@${{ env.TSD_VERSION }}
276275

277-
- name: Exclude non-backward compatible tests
278-
run: pnpm script:exclude-test-files-for-backwards-compat
279-
280276
- name: Run tests with older TypeScript version
281277
run: pnpm test:typings && pnpm test:node:build
282278

outdated-typescript.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { KyselyTypeError } from './dist/cjs/util/type-error'
22

3-
declare const Kysely: KyselyTypeError<'The installed TypeScript version is outdated and cannot guarantee type-safety with Kysely. Please upgrade to version 5.3 or newer.'>
4-
declare const RawBuilder: KyselyTypeError<'The installed TypeScript version is outdated and cannot guarantee type-safety with Kysely. Please upgrade to version 5.3 or newer.'>
5-
declare const sql: KyselyTypeError<'The installed TypeScript version is outdated and cannot guarantee type-safety with Kysely. Please upgrade to version 5.3 or newer.'>
3+
declare const Kysely: KyselyTypeError<'The installed TypeScript version is outdated and cannot guarantee type-safety with Kysely. Please upgrade to version 5.4 or newer.'>
4+
declare const RawBuilder: KyselyTypeError<'The installed TypeScript version is outdated and cannot guarantee type-safety with Kysely. Please upgrade to version 5.4 or newer.'>
5+
declare const sql: KyselyTypeError<'The installed TypeScript version is outdated and cannot guarantee type-safety with Kysely. Please upgrade to version 5.4 or newer.'>

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"main": "dist/cjs/index.js",
3232
"module": "dist/esm/index.js",
3333
"typesVersions": {
34-
"<5.3": {
34+
"<5.4": {
3535
"*": [
3636
"outdated-typescript.d.ts"
3737
]
@@ -46,7 +46,7 @@
4646
],
4747
"exports": {
4848
".": {
49-
"types@<5.3": "./outdated-typescript.d.ts",
49+
"types@<5.4": "./outdated-typescript.d.ts",
5050
"import": "./dist/esm/index.js",
5151
"require": "./dist/cjs/index.js",
5252
"default": "./dist/cjs/index.js"
@@ -124,11 +124,11 @@
124124
"@types/better-sqlite3": "7.6.13",
125125
"@types/chai": "5.2.3",
126126
"@types/chai-as-promised": "8.0.2",
127-
"@types/prototype-pollution-vulnerable-lodash.merge-dont-upgrade": "npm:@types/lodash.merge@4.6.1",
128127
"@types/mocha": "10.0.10",
129128
"@types/node": "25.5.0",
130129
"@types/pg": "8.20.0",
131130
"@types/pg-cursor": "2.7.2",
131+
"@types/prototype-pollution-vulnerable-lodash.merge-dont-upgrade": "npm:@types/lodash.merge@4.6.1",
132132
"@types/semver": "7.7.1",
133133
"@types/sinon": "21.0.0",
134134
"better-sqlite3": "12.8.0",
@@ -140,12 +140,12 @@
140140
"mocha": "11.7.5",
141141
"mysql2": "3.20.0",
142142
"pathe": "2.0.3",
143-
"prototype-pollution-vulnerable-lodash.merge-dont-upgrade": "npm:lodash.merge@4.6.1",
144143
"pg": "8.20.0",
145144
"pg-cursor": "2.19.0",
146145
"pkg-types": "2.3.0",
147146
"playwright": "1.58.2",
148147
"prettier": "3.8.1",
148+
"prototype-pollution-vulnerable-lodash.merge-dont-upgrade": "npm:lodash.merge@4.6.1",
149149
"semver": "7.7.4",
150150
"sinon": "21.0.3",
151151
"std-env": "4.0.0",

pnpm-lock.yaml

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

scripts/exclude-test-files-for-backwards-compat.mts

Lines changed: 0 additions & 22 deletions
This file was deleted.

site/docs/getting-started/_prerequisites.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
- [TypeScript](https://www.typescriptlang.org/)
2-
- Minimum supported version [5.3](https://devblogs.microsoft.com/typescript/announcing-typescript-5.3).
3-
- For even more type-safety and accurate inference, use version [5.4](https://devblogs.microsoft.com/typescript/announcing-typescript-5-4/#notable-behavioral-changes) or later.
2+
- Minimum supported version [5.4](https://devblogs.microsoft.com/typescript/announcing-typescript-5.4).
43
- For improved compilation performance, use version [5.9](https://devblogs.microsoft.com/typescript/announcing-typescript-5-9/#cache-instantiations-on-mappers) or later.
54
- You must enable `strict` mode in your `tsconfig.json` file's `compilerOptions`:
65

test/outdated-ts/outdated-ts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Kysely, RawBuilder, sql } from 'kysely'
22
import { KyselyTypeError } from '../../src/util/type-error'
33

44
function expectOutdatedTSError(
5-
_: KyselyTypeError<'The installed TypeScript version is outdated and cannot guarantee type-safety with Kysely. Please upgrade to version 5.3 or newer.'>,
5+
_: KyselyTypeError<'The installed TypeScript version is outdated and cannot guarantee type-safety with Kysely. Please upgrade to version 5.4 or newer.'>,
66
): void {}
77

88
expectOutdatedTSError(Kysely)

test/outdated-ts/package-lock.json

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

test/outdated-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"kysely": "file:../../"
1515
},
1616
"devDependencies": {
17-
"typescript": "5.2.x"
17+
"typescript": "5.3.x"
1818
}
1919
}

0 commit comments

Comments
 (0)