Skip to content

Commit c74ae77

Browse files
Upgrade to TypeScript 5.0, get typechecking working but build still broken
Need to make some decisions about whether/how to emit CJS modules, because as long as we have verbatimModuleSyntax enabled, we cannot use the typical `export const = "x"` format, and tsc-multi rewriting is also now breaking for this on v5, and patching it to do the rewrites may be non trivial since it can involve shifting large blocks of code. Alternatively we could just not opt into the flag, in which case we should also restore the `isolatedModules` flag (which was removed as redunant). See: * https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#verbatimmodulesyntax * microsoft/TypeScript#52203 * tommy351/tsc-multi#19
1 parent f502e0d commit c74ae77

File tree

12 files changed

+43
-41
lines changed

12 files changed

+43
-41
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"prettier": "2.7.1",
1717
"rimraf": "3.0.2",
1818
"tsc-multi": "0.6.1",
19-
"typescript": "4.9.5",
19+
"typescript": "5.0.2",
2020
"undici": "5.10.0",
2121
"verdaccio": "5.13.1",
2222
"vitest": "0.22.1",

packages/base-db/base-db.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { Plugin } from "./plugin-bindings";
22
import {
3-
WithPluginRegistry,
3+
type WithPluginRegistry,
44
PluginRegistry,
5-
PluggableInterfaceShape,
6-
PluginList,
7-
ExtractPlugin,
5+
type PluggableInterfaceShape,
6+
type PluginList,
7+
type ExtractPlugin,
88
} from "./plugin-registry";
99

1010
import {

packages/base-db/plugin-registry.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import type {
55
NotEqual,
66
} from "@madatdata/test-helpers/type-test-utils";
77
import {
8-
PluginList,
8+
type PluginList,
99
PluginRegistry,
10-
WithPluginRegistry,
10+
type WithPluginRegistry,
1111
} from "./plugin-registry";
1212

1313
type SomeKindOfChampionPlugin = {

packages/client-http/client-http.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import {
66
type Database,
77
type Host,
88
type UnknownCredential,
9-
UnknownRowShape,
10-
ExecutionResultWithObjectShapedRows,
11-
ExecutionResultWithArrayShapedRows,
12-
UnknownArrayShape,
13-
UnknownObjectShape,
9+
type UnknownRowShape,
10+
type ExecutionResultWithObjectShapedRows,
11+
type ExecutionResultWithArrayShapedRows,
12+
type UnknownArrayShape,
13+
type UnknownObjectShape,
1414
} from "@madatdata/base-client";
1515

1616
export interface WebBridgeResponse<RowShape extends UnknownRowShape> {

packages/db-seafowl/db-seafowl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
type ExportPlugin,
88
type ExtractPlugin,
99
type PluginList,
10-
WithOptionsInterface,
10+
type WithOptionsInterface,
1111
} from "@madatdata/base-db";
1212

1313
// TODO: This sould be injected in the constructor as the actual plugin map

packages/db-splitgraph/db-splitgraph.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import {
22
BaseDb,
33
type DbOptions,
44
type DbPluggableInterface,
5-
WithPluginRegistry,
6-
ImportPlugin,
7-
ExportPlugin,
8-
PluginList,
9-
ExtractPlugin,
5+
type WithPluginRegistry,
6+
type ImportPlugin,
7+
type ExportPlugin,
8+
type PluginList,
9+
type ExtractPlugin,
1010
type WithOptionsInterface,
1111
} from "@madatdata/base-db";
1212

packages/db-splitgraph/plugins/exporters/export-query-plugin.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { ExportPlugin, WithOptionsInterface } from "@madatdata/base-db";
22
import { SplitgraphGraphQLClient } from "../../gql-client/splitgraph-graphql-client";
3-
import { ExportFormat, ExportJobOutput } from "../../gql-client/unified-types";
3+
import {
4+
ExportFormat,
5+
type ExportJobOutput,
6+
} from "../../gql-client/unified-types";
47
import { Retryable, BackOffPolicy } from "typescript-retry-decorator";
58

69
import { gql } from "graphql-request";

packages/yeet/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
"yeet-debug": "yarn run esno --inspect-brk=127.0.0.1:9229 start.ts"
88
},
99
"dependencies": {
10-
"@rushstack/ts-command-line": "4.12.1",
10+
"@rushstack/ts-command-line": "4.13.2",
1111
"chalk": "5.0.1",
1212
"esno": "0.16.3",
1313
"playwright": "1.23.2",
14-
"typescript": "4.9.5"
14+
"typescript": "5.0.2"
1515
},
1616
"devDependencies": {
1717
"@types/node": "18.7.13"

tsconfig.base-noncomposite-esno.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"noEmit": true,
55
"emitDeclarationOnly": false,
6-
"module": "commonjs"
6+
"module": "commonjs",
7+
"verbatimModuleSyntax": false
78
}
89
}

tsconfig.base.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
"module": "esnext",
1717
"moduleResolution": "node",
1818
"resolveJsonModule": true,
19-
"isolatedModules": true,
2019
"jsx": "react-jsx",
2120
"noUnusedLocals": true,
2221
"noUnusedParameters": true,
2322
"noFallthroughCasesInSwitch": true,
2423
"noPropertyAccessFromIndexSignature": true,
25-
"importsNotUsedAsValues": "error",
24+
"verbatimModuleSyntax": true,
2625
"incremental": true,
2726
"baseUrl": ".",
2827
"composite": true,

tsconfig.build-base.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"extends": "./tsconfig.base.json",
44
"compilerOptions": {
55
"emitDeclarationOnly": false,
6-
"resolveJsonModule": false,
7-
"isolatedModules": false
6+
"resolveJsonModule": false
87
}
98
}

yarn.lock

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,7 +1783,7 @@ __metadata:
17831783
prettier: 2.7.1
17841784
rimraf: 3.0.2
17851785
tsc-multi: 0.6.1
1786-
typescript: 4.9.5
1786+
typescript: 5.0.2
17871787
undici: 5.10.0
17881788
verdaccio: 5.13.1
17891789
vitest: 0.22.1
@@ -1832,12 +1832,12 @@ __metadata:
18321832
version: 0.0.0-use.local
18331833
resolution: "@madatdata/yeet@workspace:packages/yeet"
18341834
dependencies:
1835-
"@rushstack/ts-command-line": 4.12.1
1835+
"@rushstack/ts-command-line": 4.13.2
18361836
"@types/node": 18.7.13
18371837
chalk: 5.0.1
18381838
esno: 0.16.3
18391839
playwright: 1.23.2
1840-
typescript: 4.9.5
1840+
typescript: 5.0.2
18411841
languageName: unknown
18421842
linkType: soft
18431843

@@ -1930,15 +1930,15 @@ __metadata:
19301930
languageName: node
19311931
linkType: hard
19321932

1933-
"@rushstack/ts-command-line@npm:4.12.1":
1934-
version: 4.12.1
1935-
resolution: "@rushstack/ts-command-line@npm:4.12.1"
1933+
"@rushstack/ts-command-line@npm:4.13.2":
1934+
version: 4.13.2
1935+
resolution: "@rushstack/ts-command-line@npm:4.13.2"
19361936
dependencies:
19371937
"@types/argparse": 1.0.38
19381938
argparse: ~1.0.9
19391939
colors: ~1.2.1
19401940
string-argv: ~0.3.1
1941-
checksum: e9479bd001f4f206d207c867ec7b91444727cf8a1c685dac7589c6a33b54f47200deabc450d6831a1cc38501f0322eb7003c1f78f1fa43230541c4b7ddc4718d
1941+
checksum: 3938e533e08d5cf4007a651d1aab658a7a60d6136a56414e2370b64434657a5d5a9eff442da4ddc260d5e6dc90f82428de64dbcfa1285e9ae176629f7fcd821d
19421942
languageName: node
19431943
linkType: hard
19441944

@@ -9153,23 +9153,23 @@ __metadata:
91539153
languageName: node
91549154
linkType: hard
91559155

9156-
"typescript@npm:4.9.5":
9157-
version: 4.9.5
9158-
resolution: "typescript@npm:4.9.5"
9156+
"typescript@npm:5.0.2":
9157+
version: 5.0.2
9158+
resolution: "typescript@npm:5.0.2"
91599159
bin:
91609160
tsc: bin/tsc
91619161
tsserver: bin/tsserver
9162-
checksum: ee000bc26848147ad423b581bd250075662a354d84f0e06eb76d3b892328d8d4440b7487b5a83e851b12b255f55d71835b008a66cbf8f255a11e4400159237db
9162+
checksum: bef1dcd166acfc6934b2ec4d72f93edb8961a5fab36b8dd2aaf6f4f4cd5c0210f2e0850aef4724f3b4913d5aef203a94a28ded731b370880c8bcff7e4ff91fc1
91639163
languageName: node
91649164
linkType: hard
91659165

9166-
"typescript@patch:typescript@4.9.5#~builtin<compat/typescript>":
9167-
version: 4.9.5
9168-
resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin<compat/typescript>::version=4.9.5&hash=f456af"
9166+
"typescript@patch:typescript@5.0.2#~builtin<compat/typescript>":
9167+
version: 5.0.2
9168+
resolution: "typescript@patch:typescript@npm%3A5.0.2#~builtin<compat/typescript>::version=5.0.2&hash=f456af"
91699169
bin:
91709170
tsc: bin/tsc
91719171
tsserver: bin/tsserver
9172-
checksum: 2eee5c37cad4390385db5db5a8e81470e42e8f1401b0358d7390095d6f681b410f2c4a0c496c6ff9ebd775423c7785cdace7bcdad76c7bee283df3d9718c0f20
9172+
checksum: bdbf3d0aac0d6cf010fbe0536753dc19f278eb4aba88140dcd25487dfe1c56ca8b33abc0dcd42078790a939b08ebc4046f3e9bb961d77d3d2c3cfa9829da4d53
91739173
languageName: node
91749174
linkType: hard
91759175

0 commit comments

Comments
 (0)