From 28052aacf612319f1cc0d08ad57bbbdcc1b435e3 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Fri, 26 Apr 2024 22:13:13 +0100 Subject: [PATCH] chore: align all versions of typescript, jsii & jsii-rosetta to 5.4 (#29974) ### Reason for this change There were a number of inconsistencies with the versions used for typescript, jsii & jsii-rosetta in this repository. Also the automated updater was incorrectly updating jsii minor versions. I did some digging and turns out because `jsii` was at `5.4.x` already, we are already using TypeScript 5.4 for most critical paths. So I went ahead and aligned all TS version on that. ### Description of changes Manually align all versions of typescript, jsii & jsii-rosetta. Fixed the update workflow to only update patch version for these three packages. Includes changes from #29978 until that is merged, and this PR is rebased. ### Description of how you validated changes Run through the test pipeline. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .github/workflows/yarn-upgrade.yml | 10 +-- package.json | 5 +- packages/aws-cdk-lib/package.json | 2 +- packages/awslint/package.json | 2 +- tools/@aws-cdk/cdk-build-tools/package.json | 5 +- tools/@aws-cdk/eslint-plugin/package.json | 2 +- tools/@aws-cdk/lazify/package.json | 4 +- tools/@aws-cdk/node-bundle/package.json | 4 +- tools/@aws-cdk/pkglint/package.json | 2 +- tools/@aws-cdk/prlint/package.json | 2 +- tools/@aws-cdk/yarn-cling/package.json | 2 +- yarn.lock | 69 ++++++--------------- 12 files changed, 38 insertions(+), 71 deletions(-) diff --git a/.github/workflows/yarn-upgrade.yml b/.github/workflows/yarn-upgrade.yml index dc037202423fd..c2fe94062d081 100644 --- a/.github/workflows/yarn-upgrade.yml +++ b/.github/workflows/yarn-upgrade.yml @@ -13,7 +13,6 @@ jobs: contents: read runs-on: ubuntu-latest steps: - - name: Check Out uses: actions/checkout@v4 @@ -53,16 +52,17 @@ jobs: # Upgrade special cases: # - Various `@types/*` packages need to be pinned to specific versions due to breaking changes in minor upgrades https://github.com/DefinitelyTyped/DefinitelyTyped/issues/64266 # - `typescript` is not semantically versioned, so we only upgrade the patch version + # - `jsii`, `jsii-rosetta` is not semantically versioned and needs to be upgrades alongside typescript # - `constructs` because we need to stay in control of the minimum compatible version # - `aws-sdk-mock` because of breaking changes in type exports https://github.com/dwyl/aws-sdk-mock/pull/260. We are not respecting `@ts-ignore`. # - `@aws-cdk/aws-service-spec` and `@aws-cdk/service-spec-types` have their own update workflow run: |- # Upgrade dependencies at repository root - ncu --upgrade --filter=typescript --target=patch - ncu --upgrade --reject=@types/node,@types/prettier,constructs,typescript --target=minor + ncu --upgrade --filter=jsii,jsii-rosetta,typescript --target=patch + ncu --upgrade --reject=@types/node,@types/prettier,constructs,jsii,jsii-rosetta,typescript --target=minor # Upgrade all the packages - lerna exec --parallel ncu -- --upgrade --filter=typescript --target=patch - lerna exec --parallel ncu -- --upgrade --reject='@types/conventional-commits-parser,@types/node,@types/prettier,constructs,typescript,aws-sdk-mock,@aws-sdk/*,@aws-cdk/aws-service-spec,@aws-cdk/service-spec-types,${{ steps.list-packages.outputs.list }}' --target=minor + lerna exec --parallel ncu -- --upgrade --filter=jsii,jsii-rosetta,typescript --target=patch + lerna exec --parallel ncu -- --upgrade --reject='@types/conventional-commits-parser,@types/node,@types/prettier,constructs,jsii,jsii-rosetta,typescript,aws-sdk-mock,@aws-sdk/*,@aws-cdk/aws-service-spec,@aws-cdk/service-spec-types,${{ steps.list-packages.outputs.list }}' --target=minor # Upgrade package.json files in init templates for pj in $(find packages/aws-cdk/lib/init-templates -name package.json); do (cd $(dirname $pj) && ncu --upgrade --reject='constructs,${{ steps.list-packages.outputs.list }}') diff --git a/package.json b/package.json index c511d639131c6..f2b270e93dad5 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@types/prettier": "2.6.0", "@yarnpkg/lockfile": "^1.1.0", "aws-sdk-js-codemod": "^0.28.2", - "cdk-generate-synthetic-examples": "^0.1.309", + "cdk-generate-synthetic-examples": "^0.2.0", "conventional-changelog-cli": "^2.2.2", "fs-extra": "^9.1.0", "graceful-fs": "^4.2.11", @@ -28,7 +28,6 @@ "jsii-diff": "1.97.0", "jsii-pacmak": "1.97.0", "jsii-reflect": "1.97.0", - "jsii-rosetta": "~5.4.2", "lerna": "^8.1.2", "nx": "^18.3.1", "patch-package": "^6.5.1", @@ -36,7 +35,7 @@ "standard-version": "^9.5.0", "ts-jest": "^29.1.2", "ts-node": "^10.9.2", - "typescript": "~5.1.6" + "typescript": "~5.4.5" }, "resolutions": { "colors": "1.4.0", diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 40bbff2be61ef..2bab74bb40802 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -183,7 +183,7 @@ "sinon": "^9.2.4", "ts-mock-imports": "^1.3.8", "ts-node": "^10.9.2", - "typescript": "~5.1.6", + "typescript": "~5.4.5", "typescript-json-schema": "^0.63.0" }, "peerDependencies": { diff --git a/packages/awslint/package.json b/packages/awslint/package.json index 469b11a7ea3a1..b09950719f81b 100644 --- a/packages/awslint/package.json +++ b/packages/awslint/package.json @@ -39,7 +39,7 @@ "eslint-plugin-import": "^2.29.1", "eslint-plugin-jest": "^24.7.0", "jest": "^29.7.0", - "typescript": "~5.1.6" + "typescript": "~5.4.5" }, "repository": { "type": "git", diff --git a/tools/@aws-cdk/cdk-build-tools/package.json b/tools/@aws-cdk/cdk-build-tools/package.json index be482129710cb..5aeea5635c107 100644 --- a/tools/@aws-cdk/cdk-build-tools/package.json +++ b/tools/@aws-cdk/cdk-build-tools/package.json @@ -60,14 +60,15 @@ "glob": "^7.2.3", "jest": "^29.7.0", "jest-junit": "^13.2.0", - "jsii": "~5.4.3", + "jsii": "~5.4.6", + "jsii-rosetta": "~5.4.6", "jsii-pacmak": "1.97.0", "jsii-reflect": "1.97.0", "markdownlint-cli": "^0.39.0", "nyc": "^15.1.0", "semver": "^7.6.0", "ts-jest": "^29.1.2", - "typescript": "~5.1.6", + "typescript": "~5.4.5", "yargs": "^16.2.0" }, "keywords": [ diff --git a/tools/@aws-cdk/eslint-plugin/package.json b/tools/@aws-cdk/eslint-plugin/package.json index 4b310380f1efd..fd53d24b13694 100644 --- a/tools/@aws-cdk/eslint-plugin/package.json +++ b/tools/@aws-cdk/eslint-plugin/package.json @@ -19,7 +19,7 @@ "@types/jest": "^29.5.12", "@types/estree": "*", "jest": "^29.7.0", - "typescript": "~5.1.6" + "typescript": "~5.4.5" }, "dependencies": { "@typescript-eslint/parser": "^6.21.0", diff --git a/tools/@aws-cdk/lazify/package.json b/tools/@aws-cdk/lazify/package.json index dc88425423955..e2113599a542a 100644 --- a/tools/@aws-cdk/lazify/package.json +++ b/tools/@aws-cdk/lazify/package.json @@ -20,7 +20,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "jest": "^29", "ts-jest": "^29", - "typescript": "^4.5.5", + "typescript": "~5.4.5", "cjs-module-lexer": "^1.2.3" }, "dependencies": { @@ -30,4 +30,4 @@ }, "main": "lib/index.js", "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/tools/@aws-cdk/node-bundle/package.json b/tools/@aws-cdk/node-bundle/package.json index 83c71114c626b..c48d0be3fec42 100644 --- a/tools/@aws-cdk/node-bundle/package.json +++ b/tools/@aws-cdk/node-bundle/package.json @@ -28,7 +28,7 @@ "npm-check-updates": "^16", "standard-version": "^9", "ts-jest": "^29", - "typescript": "^4.5.5" + "typescript": "~5.4.5" }, "dependencies": { "esbuild": "^0.20.2", @@ -87,4 +87,4 @@ }, "types": "lib/index.d.ts", "private": true -} \ No newline at end of file +} diff --git a/tools/@aws-cdk/pkglint/package.json b/tools/@aws-cdk/pkglint/package.json index f67b1e2636f91..1c6e5c3c30efc 100644 --- a/tools/@aws-cdk/pkglint/package.json +++ b/tools/@aws-cdk/pkglint/package.json @@ -51,7 +51,7 @@ "eslint-plugin-import": "^2.29.1", "eslint-plugin-jest": "^24.7.0", "jest": "^29.7.0", - "typescript": "~5.1.6" + "typescript": "~5.4.5" }, "nozem": { "ostools": [ diff --git a/tools/@aws-cdk/prlint/package.json b/tools/@aws-cdk/prlint/package.json index cc73800813d20..a3e16a36692ab 100644 --- a/tools/@aws-cdk/prlint/package.json +++ b/tools/@aws-cdk/prlint/package.json @@ -25,7 +25,7 @@ "@types/jest": "^29.5.12", "jest": "^29.7.0", "make-runnable": "^1.4.1", - "typescript": "~5.1.6", + "typescript": "~5.4.5", "eslint": "^7.32.0", "eslint-import-resolver-node": "^0.3.9", "eslint-import-resolver-typescript": "^2.7.1", diff --git a/tools/@aws-cdk/yarn-cling/package.json b/tools/@aws-cdk/yarn-cling/package.json index 58171289d6934..513bd5a36d0d7 100644 --- a/tools/@aws-cdk/yarn-cling/package.json +++ b/tools/@aws-cdk/yarn-cling/package.json @@ -43,7 +43,7 @@ "@types/semver": "^7.5.8", "@types/yarnpkg__lockfile": "^1.1.9", "jest": "^29.7.0", - "typescript": "~5.1.6" + "typescript": "~5.4.5" }, "dependencies": { "@yarnpkg/lockfile": "^1.1.0", diff --git a/yarn.lock b/yarn.lock index a69e825f134bd..e172a12c8fc64 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6882,16 +6882,13 @@ cdk-from-cfn@^0.156.0: resolved "https://registry.npmjs.org/cdk-from-cfn/-/cdk-from-cfn-0.156.0.tgz#921134095983db664bd68556463dcde115d73cdb" integrity sha512-nYK6SCC4yOPPxkPbrg23d6wTiu6Mtms5dWPI9kymwblpcXfIr+YaoiVlvlT9CFyyddGugG7AaTA6UN7U9LUOAg== -cdk-generate-synthetic-examples@^0.1.309: - version "0.1.309" - resolved "https://registry.npmjs.org/cdk-generate-synthetic-examples/-/cdk-generate-synthetic-examples-0.1.309.tgz#16b3520f43b7853ccb96eddad5efda7e87a405dd" - integrity sha512-QoBhKAvIBCbH9+Z8zRLleR4+m/8+mwTYju1nZ5jZ8AOaNxO1XHNXDtU7GnNGce8oGwqo+hyoFVpEKSDdd5AqJg== +cdk-generate-synthetic-examples@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/cdk-generate-synthetic-examples/-/cdk-generate-synthetic-examples-0.2.0.tgz#019d4a2a9fa0fdab0b8d48b0426c0fa0ea8b5183" + integrity sha512-FaVV/TkTwIz9PUkG1+aT1DB13877jreoGbaud1W9bYY4F6u52DT7LqjLkvgETP8OKYTKqqUP+OikxmLt/OQ3aw== dependencies: "@jsii/spec" "^1.97.0" - fs-extra "^10.1.0" - jsii "^1.97.0" jsii-reflect "^1.97.0" - jsii-rosetta "^1.97.0" yargs "^17.7.2" cdk8s-plus-27@2.7.88: @@ -10895,10 +10892,10 @@ jsii-rosetta@^1.97.0: workerpool "^6.5.1" yargs "^16.2.0" -jsii-rosetta@~5.4.2: - version "5.4.2" - resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-5.4.2.tgz#ba51a331f4a5c42892d3b6d5766f7e4b83afd282" - integrity sha512-Bo+8lLuRQ0YiXiNImJ6XLrmAY/GzildnYd1B5MLlc+IpjbgFbynhFIyGjYAVf4+/VLFJRoOCJtZ40sM+ua8Ecw== +jsii-rosetta@~5.4.6: + version "5.4.6" + resolved "https://registry.npmjs.org/jsii-rosetta/-/jsii-rosetta-5.4.6.tgz#ada3dd6218acb0e5960dbfc15e8b1f67e045ede8" + integrity sha512-RyTtc3hJmmrpbiWCLVvgHfy0Is4PWIYDy+Al6/d1xwZDq64DHJU6yU+H99SgL7LRLLwDyCod2QqRmZ1VIywwcQ== dependencies: "@jsii/check-node" "1.97.0" "@jsii/spec" "^1.97.0" @@ -10914,7 +10911,7 @@ jsii-rosetta@~5.4.2: workerpool "^6.5.1" yargs "^17.7.2" -jsii@1.97.0, jsii@^1.97.0: +jsii@1.97.0: version "1.97.0" resolved "https://registry.npmjs.org/jsii/-/jsii-1.97.0.tgz#5ceee9f1b4715b82e37ec5a24b509336d8ebef83" integrity sha512-C3GA2Q50DkHnFozg7HKel7ZaBMCUKb/dzgH2ykfrbuJ/C/KebkPkqY/XRf95zGB42mzagPfawSLDFQiGGueQ9w== @@ -10933,10 +10930,10 @@ jsii@1.97.0, jsii@^1.97.0: typescript "~3.9.10" yargs "^16.2.0" -jsii@~5.4.0, jsii@~5.4.3: - version "5.4.3" - resolved "https://registry.npmjs.org/jsii/-/jsii-5.4.3.tgz#dedac3cc9f1d209193f1388dcf9e55c142ff4a8d" - integrity sha512-+alxW2wfBQBCjesy2kvMl6yML8m7hD/buIkVVQNSGt0R0ObhsLvlanS2lRWpNkdfVtDnNk/ke5UFmMSfJ/vy0Q== +jsii@~5.4.0, jsii@~5.4.6: + version "5.4.6" + resolved "https://registry.npmjs.org/jsii/-/jsii-5.4.6.tgz#5389695696d7d8fc8e34942c6efef97ef0236fe0" + integrity sha512-Ohqz39ecBfmL/Pd5nnkERnikyOoZmNdqoSqedl+yXATM+js7XLlUGgQ+BdBXaO0rzQU2AEQ40C0COtF0jFXw4A== dependencies: "@jsii/check-node" "1.97.0" "@jsii/spec" "^1.97.0" @@ -14805,16 +14802,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@*, string-width@^1.0.1, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3, string-width@^5.0.1, string-width@^5.1.2: +"string-width-cjs@npm:string-width@^4.2.0", string-width@*, string-width@^1.0.1, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3, string-width@^5.0.1, string-width@^5.1.2: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -14892,7 +14880,7 @@ stringify-package@^1.0.1: resolved "https://registry.npmjs.org/stringify-package/-/stringify-package-1.0.1.tgz#e5aa3643e7f74d0f28628b72f3dad5cecfc3ba85" integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -14906,13 +14894,6 @@ strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -15468,7 +15449,7 @@ typescript-json-schema@^0.63.0: typescript "~5.1.0" yargs "^17.1.1" -"typescript@>=3 < 6", typescript@~5.4: +"typescript@>=3 < 6", typescript@~5.4, typescript@~5.4.5: version "5.4.5" resolved "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== @@ -15478,17 +15459,12 @@ typescript@^3.9.10, typescript@^3.9.5, typescript@^3.9.7, typescript@~3.9.10: resolved "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== -typescript@^4.5.5: - version "4.9.5" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" - integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== - typescript@next: version "5.5.0-dev.20240417" resolved "https://registry.npmjs.org/typescript/-/typescript-5.5.0-dev.20240417.tgz#2558a2442be5b8541ce8168c53fb5ef4ee3c4995" integrity sha512-BjMYWxzDLRaNlnnMC/NHf0uUIZEnw5VLe7q0h7hEi5Q4H1XoIDdjBjk6stBS2nj6R/HrsdEqhWdPz6+DLx+sRw== -typescript@~5.1.0, typescript@~5.1.6: +typescript@~5.1.0: version "5.1.6" resolved "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== @@ -15898,7 +15874,7 @@ workerpool@^6.5.1: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -15916,15 +15892,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"