Skip to content

Commit 4acff2c

Browse files
authored
chore: build all packages with TypeScript 4.6 (#3549)
Use TypeScript 4.6 for building all packages, but continue to use TypeScript 3.9 in the compiler and rosetta in order to avoid introducing breaking changes. Moved several "universal" devDependencies all the way to the root of the mono-repository to minimize changes when updating these (`@types/jest`, `jest`, `eslint`, etc...). Some code changes were required due to the breaking changes introduced between TypeScript 3.9 and 4.6, but nothing particularly substantial. There seems to be an odd interaction between webpack and actually importing `node:process`, so the `jsii/runtime` package switched to using the global `process` value instead of importing the module. --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
1 parent 9fd3c71 commit 4acff2c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+805
-1116
lines changed

jest.config.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,15 @@ export function overriddenConfig(overrides: Config.InitialOptions) {
5858
...Object.keys(original),
5959
...Object.keys(override),
6060
]);
61+
62+
// TypeScript appears to choke if we do the "as any" in the same
63+
// expression as the key access, so we delcare surrogate varibales...
64+
const originalAsAny = original as any;
65+
const overrideAsAny = override as any;
66+
6167
for (const key of Array.from(allKeys).sort()) {
62-
const originalValue: unknown = (original as any)[key];
63-
const overrideValue: unknown = (override as any)[key];
68+
const originalValue: unknown = originalAsAny[key];
69+
const overrideValue: unknown = overrideAsAny[key];
6470
if (originalValue == null) {
6571
result[key] = overrideValue;
6672
} else if (overrideValue == null) {

package.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,27 @@
1515
"compliance": "(cd tools/jsii-compliance && yarn report)"
1616
},
1717
"devDependencies": {
18-
"@jest/types": "^27.5.1",
19-
"@typescript-eslint/eslint-plugin": "^5.23.0",
20-
"@typescript-eslint/parser": "^5.23.0",
18+
"@jest/types": "^28.1.0",
19+
"@types/jest": "^27.5.1",
20+
"@types/node": "^12.20.51",
21+
"@typescript-eslint/eslint-plugin": "^5.25.0",
22+
"@typescript-eslint/parser": "^5.25.0",
2123
"all-contributors-cli": "^6.20.0",
2224
"eslint": "^8.15.0",
2325
"eslint-config-prettier": "^8.5.0",
2426
"eslint-import-resolver-node": "^0.3.6",
2527
"eslint-import-resolver-typescript": "^2.7.1",
2628
"eslint-plugin-import": "^2.26.0",
2729
"eslint-plugin-prettier": "^4.0.0",
28-
"jest-circus": "^27.5.1",
29-
"jest-config": "^27.5.1",
30+
"jest": "^28.1.0",
31+
"jest-circus": "^28.1.0",
32+
"jest-config": "^28.1.0",
33+
"jest-expect-message": "^1.0.2",
3034
"lerna": "^4.0.0",
3135
"prettier": "^2.6.2",
32-
"standard-version": "^9.3.2",
36+
"standard-version": "^9.5.0",
3337
"ts-node": "^10.7.0",
34-
"typescript": "~3.9.10"
38+
"typescript": "~4.6.4"
3539
},
3640
"repository": {
3741
"type": "git",
@@ -48,5 +52,8 @@
4852
"**/@fixtures/jsii-calc-bundled",
4953
"**/@fixtures/jsii-calc-bundled/**"
5054
]
55+
},
56+
"resolutions": {
57+
"@types/prettier": "2.6.0"
5158
}
5259
}

packages/@jsii/benchmarks/bin/benchmark.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ interface ResultsJson {
3737

3838
(async () => {
3939
/* eslint-disable-next-line @typescript-eslint/await-thenable */
40-
const argv = yargs
40+
const argv = await yargs
4141
.command('$0', 'Runs jsii benchmark tests and displays results', (argv) =>
4242
argv.option('output', {
4343
type: 'string',

packages/@jsii/benchmarks/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@
1212
},
1313
"devDependencies": {
1414
"@types/glob": "^7.2.0",
15-
"eslint": "^8.15.0",
16-
"glob": "^8.0.1",
17-
"jsii-calc": "^3.20.120",
18-
"prettier": "^2.6.2",
19-
"typescript": "~3.9.10"
15+
"glob": "^8.0.1"
2016
},
2117
"scripts": {
2218
"build": "tsc --build && npm run lint",

packages/@jsii/check-node/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040
"semver": "^7.3.7"
4141
},
4242
"devDependencies": {
43-
"@types/chalk": "^2.2.0",
44-
"@types/jest": "^27.5.0",
45-
"@types/node": "^12.20.51",
46-
"jest": "^27.5.1"
43+
"@types/chalk": "^2.2.0"
4744
}
4845
}

packages/@jsii/dotnet-runtime-test/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131
},
3232
"devDependencies": {
3333
"@jsii/dotnet-runtime": "^0.0.0",
34-
"@types/node": "^12.20.51",
3534
"jsii-calc": "^3.20.120",
36-
"jsii-pacmak": "^0.0.0",
37-
"typescript": "~3.9.10"
35+
"jsii-pacmak": "^0.0.0"
3836
}
3937
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=d47431ca_002Dca0b_002D43c9_002D8da0_002Ddd234b4d01fd/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from &amp;lt;Amazon.JSII.Runtime.IntegrationTests&amp;gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;
3+
&lt;Project Location="/Users/rmuller/Development/aws/jsii/packages/@jsii/dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests" Presentation="&amp;lt;Amazon.JSII.Runtime.IntegrationTests&amp;gt;" /&gt;
4+
&lt;/SessionState&gt;</s:String></wpf:ResourceDictionary>

packages/@jsii/dotnet-runtime/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@
3939
},
4040
"devDependencies": {
4141
"@jsii/runtime": "^0.0.0",
42-
"@types/node": "^12.20.51",
4342
"@types/semver": "^7.3.9",
4443
"jsii-build-tools": "^0.0.0",
45-
"semver": "^7.3.7",
46-
"typescript": "~3.9.10"
44+
"semver": "^7.3.7"
4745
}
4846
}

packages/@jsii/go-runtime-test/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"jsii-pacmak": "^0.0.0"
2020
},
2121
"dependencies": {
22-
"fs-extra": "^9.1.0",
22+
"fs-extra": "^10.1.0",
2323
"@jsii/go-runtime": "^0.0.0"
2424
}
2525
}

packages/@jsii/go-runtime/package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,9 @@
2424
},
2525
"devDependencies": {
2626
"@types/fs-extra": "^9.0.13",
27-
"@types/node": "^12.20.51",
2827
"codemaker": "^0.0.0",
29-
"eslint": "^8.15.0",
30-
"fs-extra": "^9.1.0",
28+
"fs-extra": "^10.1.0",
3129
"jsii-build-tools": "^0.0.0",
32-
"jsii-calc": "^3.20.120",
33-
"prettier": "^2.6.2",
34-
"ts-node": "^10.7.0",
35-
"typescript": "~3.9.10"
30+
"jsii-calc": "^3.20.120"
3631
}
3732
}

0 commit comments

Comments
 (0)