Skip to content

Commit e248df4

Browse files
authored
chore: upgrade typescript to 5.8 (#4871)
Upgrade typescript version. Some small (type only) code changes were required relating to type inference. Fixes a number of npm warnings I noticed by replacing `npm run <script>` with `yarn <script>` which makes more sense to stay in the same package manager ecosystem. Fixed some jsii warnings in pacmak test packages. --- 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 49b5d3a commit e248df4

File tree

38 files changed

+167
-92
lines changed

38 files changed

+167
-92
lines changed

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"prettier": "^3.6.2",
3838
"standard-version": "^9.5.0",
3939
"ts-node": "^10.9.2",
40-
"typescript": "~4.7.4"
40+
"typescript": "5.8.x"
4141
},
4242
"repository": {
4343
"type": "git",
@@ -55,8 +55,5 @@
5555
"**/@fixtures/jsii-calc-bundled/**",
5656
"**/typescript"
5757
]
58-
},
59-
"resolutions": {
60-
"@types/yargs": "17.0.19"
6158
}
6259
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"./run": "./lib/run.js"
2828
},
2929
"scripts": {
30-
"build": "tsc --build && npm run lint",
30+
"build": "tsc --build && yarn lint",
3131
"watch": "tsc --build -w",
3232
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .js,.ts --ignore-path=.gitignore",
3333
"lint:fix": "yarn lint --fix",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
"types": "lib/index.d.ts",
2626
"scripts": {
2727
"gen": "bash ./generate.sh",
28-
"build": "npm run gen && tsc --build && bash ./build.sh",
28+
"build": "yarn gen && tsc --build && bash ./build.sh",
2929
"test": "bash ./test.sh",
30-
"test:update": "UPDATE_DIFF=1 npm run test"
30+
"test:update": "UPDATE_DIFF=1 yarn test"
3131
},
3232
"devDependencies": {
3333
"@jsii/dotnet-runtime": "^0.0.0",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
"types": "lib/index.d.ts",
3232
"scripts": {
3333
"gen": "bash ./generate.sh",
34-
"build": "npm run gen && tsc --build && dotnet build --force -c Release src/Amazon.JSII.Runtime.sln",
34+
"build": "yarn gen && tsc --build && dotnet build --force -c Release src/Amazon.JSII.Runtime.sln",
3535
"dist-clean": "rm -rf dist && dotnet clean -c Release src/Amazon.JSII.Runtime.sln",
3636
"test": "dotnet test -c Release src/Amazon.JSII.Runtime.sln",
37-
"test:update": "UPDATE_DIFF=1 npm run test",
37+
"test:update": "UPDATE_DIFF=1 yarn test",
3838
"package": "package-dotnet src/Amazon.JSII.Runtime.sln && package-private"
3939
},
4040
"devDependencies": {

packages/@jsii/go-runtime-test/build-tools/gen-calc.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ const genRoot = join(__dirname, '..', 'jsii-calc');
99

1010
removeSync(genRoot);
1111
runCommand(
12-
'npx',
12+
'node_modules/.bin/jsii-pacmak',
1313
[
14-
'jsii-pacmak',
1514
'-t',
1615
'go',
1716
'-v',

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"description": "",
66
"main": "lib/index.js",
77
"scripts": {
8-
"build": "tsc --build && npm run gen:rt",
8+
"build": "tsc --build && yarn gen:rt",
99
"gen:rt": "node build-tools/gen.js",
10-
"generate": "npm run gen:rt",
10+
"generate": "yarn gen:rt",
1111
"package": "build-tools/package.sh && package-private",
1212
"doc": "cd jsii-runtime-go && go run golang.org/x/tools/cmd/godoc",
1313
"fmt": "cd jsii-runtime-go && go run golang.org/x/tools/cmd/goimports -w .",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"scripts": {
2626
"build": "bash ./generate.sh",
2727
"test": "node ./user.xml.t.js > ./project/user.xml && cd project && mvn -B test --settings=user.xml -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false",
28-
"test:update": "UPDATE_DIFF=1 npm run test"
28+
"test:update": "UPDATE_DIFF=1 yarn test"
2929
},
3030
"devDependencies": {
3131
"@jsii/java-runtime": "^0.0.0",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"types": "lib/index.d.ts",
2626
"scripts": {
2727
"gen": "bash ./generate.sh",
28-
"build": "tsc --build && npm run gen && cd project && mvn -version && mvn -B deploy -D altDeploymentRepository=local::default::file://${PWD}/../maven-repo --settings=user.xml -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false",
28+
"build": "tsc --build && yarn gen && cd project && mvn -version && mvn -B deploy -D altDeploymentRepository=local::default::file://${PWD}/../maven-repo --settings=user.xml -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false",
2929
"dist-clean": "rm -rf dist maven-repo && cd project && mvn -B clean --settings=user.xml",
3030
"test": "echo 'Tests are run as part of the build target'",
31-
"test:update": "UPDATE_DIFF=1 npm run test",
31+
"test:update": "UPDATE_DIFF=1 yarn test",
3232
"package": "package-java && package-private"
3333
},
3434
"devDependencies": {

packages/@jsii/kernel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"main": "lib/index.js",
2323
"types": "lib/index.d.ts",
2424
"scripts": {
25-
"build": "tsc --build && npm run lint",
25+
"build": "tsc --build && yarn lint",
2626
"watch": "tsc --build -w",
2727
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .js,.ts --ignore-path=.gitignore",
2828
"lint:fix": "yarn lint --fix",

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
"generate": "ts-node build-tools/gen.ts",
2626
"deps": "ts-node build-tools/deps.ts",
2727
"dist-clean": "rm -rf dist",
28-
"build": "cp ../../../README.md . && rm -f jsii-*.whl && npm run generate && npm run deps && npm run lint",
28+
"build": "cp ../../../README.md . && rm -f jsii-*.whl && yarn generate && yarn deps && yarn lint",
2929
"lint": "ts-node build-tools/venv.ts black .",
3030
"package": "package-python && package-private",
31-
"test": "npm run test:gen && npm run test:run:typeguard-2 && npm run test:run:typeguard-3 && npm run test:run:typeguard-4 && npm run test:types",
32-
"test:gen": "npm run deps && ts-node build-tools/gen-calc.ts",
31+
"test": "yarn test:gen && yarn test:run:typeguard-2 && yarn test:run:typeguard-3 && yarn test:run:typeguard-4 && yarn test:types",
32+
"test:gen": "yarn deps && ts-node build-tools/gen-calc.ts",
3333
"test:run:typeguard-2": "ts-node build-tools/venv.ts python -m pip install typeguard==2.13.3 && ts-node build-tools/venv.ts py.test -v --mypy",
3434
"test:run:typeguard-3": "ts-node build-tools/venv.ts python -m pip install typeguard==3.0.2 && ts-node build-tools/venv.ts py.test -v --mypy",
3535
"test:run:typeguard-4": "ts-node build-tools/venv.ts python -m pip install typeguard==4.3.0 && ts-node build-tools/venv.ts py.test -v --mypy",
3636
"test:types": "pyright -p .",
37-
"test:update": "UPDATE_DIFF=1 npm run test"
37+
"test:update": "UPDATE_DIFF=1 yarn test"
3838
},
3939
"dependencies": {
4040
"@jsii/runtime": "^0.0.0"

0 commit comments

Comments
 (0)