From 05f7ff01ab04e1b1536b601e4244985da9c29853 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Mar 2022 10:31:55 +0000 Subject: [PATCH 01/32] chore(deps-dev): Update mkdocs-git-revision-date-plugin requirement from ~=0.3.1 to ~=0.3.2 in /gh-pages (#3421) Updates the requirements on [mkdocs-git-revision-date-plugin](https://github.com/zhaoterryy/mkdocs-git-revision-date-plugin) to permit the latest version.
Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) Dependabot will merge this PR once it's up-to-date and CI passes on it, as requested by @RomainMuller. [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- gh-pages/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gh-pages/requirements-dev.txt b/gh-pages/requirements-dev.txt index 94f4a72d40..9d3d93db14 100644 --- a/gh-pages/requirements-dev.txt +++ b/gh-pages/requirements-dev.txt @@ -1,4 +1,4 @@ mkdocs~=1.2.3 mkdocs-awesome-pages-plugin~=2.7.0 mkdocs-material~=8.2.5 -mkdocs-git-revision-date-plugin~=0.3.1 +mkdocs-git-revision-date-plugin~=0.3.2 From c15aadafe13a6be21470ee72aa31c983347586ad Mon Sep 17 00:00:00 2001 From: Yathi <511386+yuth@users.noreply.github.com> Date: Mon, 21 Mar 2022 09:02:29 -0700 Subject: [PATCH 02/32] chore: update gitigonre to ignore build, coverage and jsii-outdir (#3427) --- 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 --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index ff4e271d69..85bbd6119b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,6 @@ dist/ *.tabl.json *.swp *.snk +build/ +coverage/ +jsii-outdir/ From 0705ef69c1b5755dff5e6b03d36cb3b2e1b84fe6 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Mon, 21 Mar 2022 14:46:18 -0400 Subject: [PATCH 03/32] chore: npm-check-updates && yarn upgrade (#3432) Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date. --- package.json | 8 +- packages/@jsii/go-runtime/package.json | 4 +- packages/@jsii/integ-test/package.json | 4 +- packages/@jsii/kernel/package.json | 4 +- packages/@jsii/runtime/package.json | 4 +- packages/@jsii/spec/package.json | 4 +- .../jsii-calc-base-of-base/package.json | 2 +- packages/@scope/jsii-calc-base/package.json | 2 +- packages/@scope/jsii-calc-lib/package.json | 2 +- packages/codemaker/package.json | 4 +- packages/jsii-calc/package.json | 4 +- packages/jsii-config/package.json | 4 +- packages/jsii-diff/package.json | 6 +- packages/jsii-pacmak/package.json | 4 +- packages/jsii-reflect/package.json | 4 +- packages/jsii-rosetta/package.json | 4 +- packages/jsii/package.json | 6 +- packages/oo-ascii-tree/package.json | 4 +- tools/jsii-compliance/package.json | 4 +- yarn.lock | 333 +++++++++--------- 20 files changed, 203 insertions(+), 208 deletions(-) diff --git a/package.json b/package.json index 23f975d850..e8122a89ed 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,10 @@ }, "devDependencies": { "@jest/types": "^27.5.1", - "@typescript-eslint/eslint-plugin": "^5.14.0", - "@typescript-eslint/parser": "^5.14.0", + "@typescript-eslint/eslint-plugin": "^5.15.0", + "@typescript-eslint/parser": "^5.15.0", "all-contributors-cli": "^6.20.0", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "eslint-config-prettier": "^8.5.0", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^2.5.0", @@ -28,7 +28,7 @@ "jest-circus": "^27.5.1", "jest-config": "^27.5.1", "lerna": "^4.0.0", - "prettier": "^2.5.1", + "prettier": "^2.6.0", "standard-version": "^9.3.2", "ts-jest": "^27.1.3", "ts-node": "^10.7.0", diff --git a/packages/@jsii/go-runtime/package.json b/packages/@jsii/go-runtime/package.json index 8a01051a58..105a9a5c5e 100644 --- a/packages/@jsii/go-runtime/package.json +++ b/packages/@jsii/go-runtime/package.json @@ -26,11 +26,11 @@ "@types/fs-extra": "^9.0.13", "@types/node": "^12.20.47", "codemaker": "^0.0.0", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "fs-extra": "^9.1.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.5.1", + "prettier": "^2.6.0", "ts-node": "^10.7.0", "typescript": "~3.9.10" } diff --git a/packages/@jsii/integ-test/package.json b/packages/@jsii/integ-test/package.json index b555a431f0..6a08e36faf 100644 --- a/packages/@jsii/integ-test/package.json +++ b/packages/@jsii/integ-test/package.json @@ -32,8 +32,8 @@ "@types/jest": "^27.4.1", "@types/node": "^12.20.47", "@types/tar": "^6.1.1", - "eslint": "^8.10.0", - "prettier": "^2.5.1", + "eslint": "^8.11.0", + "prettier": "^2.6.0", "typescript": "~3.9.10" } } diff --git a/packages/@jsii/kernel/package.json b/packages/@jsii/kernel/package.json index 47bb365016..ed346361a0 100644 --- a/packages/@jsii/kernel/package.json +++ b/packages/@jsii/kernel/package.json @@ -42,12 +42,12 @@ "@types/jest": "^27.4.1", "@types/node": "^12.20.47", "@types/tar": "^6.1.1", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "jest": "^27.5.1", "jest-expect-message": "^1.0.2", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.5.1", + "prettier": "^2.6.0", "ts-jest": "^27.1.3", "typescript": "~3.9.10" } diff --git a/packages/@jsii/runtime/package.json b/packages/@jsii/runtime/package.json index ae49cbce3c..e26e4d8b53 100644 --- a/packages/@jsii/runtime/package.json +++ b/packages/@jsii/runtime/package.json @@ -43,11 +43,11 @@ "@scope/jsii-calc-lib": "^0.0.0", "@types/jest": "^27.4.1", "@types/node": "^12.20.47", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "jest": "^27.5.1", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.5.1", + "prettier": "^2.6.0", "source-map-loader": "^3.0.1", "ts-jest": "^27.1.3", "typescript": "~3.9.10", diff --git a/packages/@jsii/spec/package.json b/packages/@jsii/spec/package.json index c9f85fe4d8..48405b4a29 100644 --- a/packages/@jsii/spec/package.json +++ b/packages/@jsii/spec/package.json @@ -36,10 +36,10 @@ "devDependencies": { "@types/jest": "^27.4.1", "@types/node": "^12.20.47", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "jest": "^27.5.1", "jsii-build-tools": "^0.0.0", - "prettier": "^2.5.1", + "prettier": "^2.6.0", "typescript": "~3.9.10", "typescript-json-schema": "^0.53.0" } diff --git a/packages/@scope/jsii-calc-base-of-base/package.json b/packages/@scope/jsii-calc-base-of-base/package.json index 834abf6770..cbcdda3fea 100644 --- a/packages/@scope/jsii-calc-base-of-base/package.json +++ b/packages/@scope/jsii-calc-base-of-base/package.json @@ -34,7 +34,7 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", - "prettier": "^2.5.1" + "prettier": "^2.6.0" }, "jsii": { "outdir": "dist", diff --git a/packages/@scope/jsii-calc-base/package.json b/packages/@scope/jsii-calc-base/package.json index 31879c1c8d..72d68e7b23 100644 --- a/packages/@scope/jsii-calc-base/package.json +++ b/packages/@scope/jsii-calc-base/package.json @@ -39,7 +39,7 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", - "prettier": "^2.5.1" + "prettier": "^2.6.0" }, "jsii": { "metadata": { diff --git a/packages/@scope/jsii-calc-lib/package.json b/packages/@scope/jsii-calc-lib/package.json index 0d4a0cab78..1736e9038a 100644 --- a/packages/@scope/jsii-calc-lib/package.json +++ b/packages/@scope/jsii-calc-lib/package.json @@ -43,7 +43,7 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", - "prettier": "^2.5.1" + "prettier": "^2.6.0" }, "jsii": { "outdir": "dist", diff --git a/packages/codemaker/package.json b/packages/codemaker/package.json index 5ef07c5976..dd7a6132b7 100644 --- a/packages/codemaker/package.json +++ b/packages/codemaker/package.json @@ -39,9 +39,9 @@ "@types/fs-extra": "^9.0.13", "@types/jest": "^27.4.1", "@types/node": "^12.20.47", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "jest": "^27.5.1", - "prettier": "^2.5.1", + "prettier": "^2.6.0", "typescript": "~3.9.10" } } diff --git a/packages/jsii-calc/package.json b/packages/jsii-calc/package.json index ba0f6c6063..2e90c29b25 100644 --- a/packages/jsii-calc/package.json +++ b/packages/jsii-calc/package.json @@ -52,11 +52,11 @@ }, "devDependencies": { "@types/node": "^12.20.47", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", - "prettier": "^2.5.1" + "prettier": "^2.6.0" }, "jsii": { "outdir": "dist", diff --git a/packages/jsii-config/package.json b/packages/jsii-config/package.json index 0a8cf06bff..a371d3109b 100644 --- a/packages/jsii-config/package.json +++ b/packages/jsii-config/package.json @@ -23,10 +23,10 @@ "@types/jest": "^27.4.1", "@types/node": "^12.20.47", "@types/yargs": "^17.0.9", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "jest": "^27.5.1", "jest-expect-message": "^1.0.2", - "prettier": "^2.5.1", + "prettier": "^2.6.0", "typescript": "~3.9.10" }, "dependencies": { diff --git a/packages/jsii-diff/package.json b/packages/jsii-diff/package.json index d054d558b3..6b49722781 100644 --- a/packages/jsii-diff/package.json +++ b/packages/jsii-diff/package.json @@ -37,7 +37,7 @@ "@jsii/spec": "^0.0.0", "fs-extra": "^9.1.0", "jsii-reflect": "^0.0.0", - "log4js": "^6.4.2", + "log4js": "^6.4.3", "typescript": "~3.9.10", "yargs": "^16.2.0" }, @@ -46,11 +46,11 @@ "@types/jest": "^27.4.1", "@types/node": "^12.20.47", "@types/tar-fs": "^2.0.1", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "jest": "^27.5.1", "jest-expect-message": "^1.0.2", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", - "prettier": "^2.5.1" + "prettier": "^2.6.0" } } diff --git a/packages/jsii-pacmak/package.json b/packages/jsii-pacmak/package.json index 6115bd74ff..0382c4410c 100644 --- a/packages/jsii-pacmak/package.json +++ b/packages/jsii-pacmak/package.json @@ -62,12 +62,12 @@ "@types/jest": "^27.4.1", "@types/node": "^12.20.47", "@types/semver": "^7.3.9", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "jest": "^27.5.1", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.5.1", + "prettier": "^2.6.0", "ts-jest": "^27.1.3", "typescript": "~3.9.10" }, diff --git a/packages/jsii-reflect/package.json b/packages/jsii-reflect/package.json index a8f02a73ad..49e18c414e 100644 --- a/packages/jsii-reflect/package.json +++ b/packages/jsii-reflect/package.json @@ -46,12 +46,12 @@ "@types/fs-extra": "^9.0.13", "@types/jest": "^27.4.1", "@types/node": "^12.20.47", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "jest": "^27.5.1", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.5.1", + "prettier": "^2.6.0", "typescript": "~3.9.10" } } diff --git a/packages/jsii-rosetta/package.json b/packages/jsii-rosetta/package.json index b054c85ede..2d93502a6a 100644 --- a/packages/jsii-rosetta/package.json +++ b/packages/jsii-rosetta/package.json @@ -23,12 +23,12 @@ "@types/node": "^12.20.47", "@types/workerpool": "^6.1.0", "@types/semver": "^7.3.9", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "jest": "^27.5.1", "jsii-build-tools": "0.0.0", "memory-streams": "^0.1.3", "mock-fs": "^5.1.2", - "prettier": "^2.5.1" + "prettier": "^2.6.0" }, "dependencies": { "@jsii/check-node": "0.0.0", diff --git a/packages/jsii/package.json b/packages/jsii/package.json index d5984b75e3..8117b38dd8 100644 --- a/packages/jsii/package.json +++ b/packages/jsii/package.json @@ -41,7 +41,7 @@ "chalk": "^4", "deep-equal": "^2.0.5", "fs-extra": "^9.1.0", - "log4js": "^6.4.2", + "log4js": "^6.4.3", "semver": "^7.3.5", "semver-intersect": "^1.4.0", "sort-json": "^2.0.1", @@ -57,11 +57,11 @@ "@types/node": "^12.20.47", "@types/semver": "^7.3.9", "clone": "^2.1.2", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "jest": "^27.5.1", "jest-expect-message": "^1.0.2", "jsii-build-tools": "^0.0.0", - "prettier": "^2.5.1", + "prettier": "^2.6.0", "ts-jest": "^27.1.3" } } diff --git a/packages/oo-ascii-tree/package.json b/packages/oo-ascii-tree/package.json index 55ae5704df..d36537a919 100644 --- a/packages/oo-ascii-tree/package.json +++ b/packages/oo-ascii-tree/package.json @@ -33,10 +33,10 @@ "devDependencies": { "@types/jest": "^27.4.1", "@types/node": "^12.20.47", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "jest": "^27.5.1", "jsii-build-tools": "^0.0.0", - "prettier": "^2.5.1", + "prettier": "^2.6.0", "typescript": "~3.9.10" } } diff --git a/tools/jsii-compliance/package.json b/tools/jsii-compliance/package.json index a6f5e60b1a..73a0a4c135 100644 --- a/tools/jsii-compliance/package.json +++ b/tools/jsii-compliance/package.json @@ -17,8 +17,8 @@ }, "devDependencies": { "@types/node": "^12.20.47", - "eslint": "^8.10.0", - "prettier": "^2.5.1", + "eslint": "^8.11.0", + "prettier": "^2.6.0", "ts-node": "^10.7.0", "typescript": "~3.9.10" } diff --git a/yarn.lock b/yarn.lock index 8291086ae9..ed2da25f75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,23 +16,23 @@ dependencies: "@babel/highlight" "^7.16.7" -"@babel/compat-data@^7.16.4": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.0.tgz#86850b8597ea6962089770952075dcaabb8dba34" - integrity sha512-392byTlpGWXMv4FbyWw3sAZ/FrW/DrwqLGXpy0mbyNe9Taqv1mg9yON5/o0cnr8XYCkFTZbC1eV+c+LAROgrng== +"@babel/compat-data@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.7.tgz#078d8b833fbbcc95286613be8c716cef2b519fa2" + integrity sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ== "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": - version "7.17.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.5.tgz#6cd2e836058c28f06a4ca8ee7ed955bbf37c8225" - integrity sha512-/BBMw4EvjmyquN5O+t5eh0+YqB3XXJkYD2cjKpYtWOfFy4lQ4UozNSmxAcWT8r2XtZs0ewG+zrfsqeR15i1ajA== + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.7.tgz#f7c28228c83cdf2dbd1b9baa06eaf9df07f0c2f9" + integrity sha512-djHlEfFHnSnTAcPb7dATbiM5HxGOP98+3JLBZtjRb5I7RXrw7kFRoG2dXM8cm3H+o11A8IFH/uprmJpwFynRNQ== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.3" - "@babel/helper-compilation-targets" "^7.16.7" - "@babel/helper-module-transforms" "^7.16.7" - "@babel/helpers" "^7.17.2" - "@babel/parser" "^7.17.3" + "@babel/generator" "^7.17.7" + "@babel/helper-compilation-targets" "^7.17.7" + "@babel/helper-module-transforms" "^7.17.7" + "@babel/helpers" "^7.17.7" + "@babel/parser" "^7.17.7" "@babel/template" "^7.16.7" "@babel/traverse" "^7.17.3" "@babel/types" "^7.17.0" @@ -42,21 +42,21 @@ json5 "^2.1.2" semver "^6.3.0" -"@babel/generator@^7.17.3", "@babel/generator@^7.7.2": - version "7.17.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.3.tgz#a2c30b0c4f89858cb87050c3ffdfd36bdf443200" - integrity sha512-+R6Dctil/MgUsZsZAkYgK+ADNSZzJRRy0TvY65T71z/CR854xHQ1EweBYXdfT+HNeN7w0cSJJEzgxZMv40pxsg== +"@babel/generator@^7.17.3", "@babel/generator@^7.17.7", "@babel/generator@^7.7.2": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.7.tgz#8da2599beb4a86194a3b24df6c085931d9ee45ad" + integrity sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w== dependencies: "@babel/types" "^7.17.0" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-compilation-targets@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz#06e66c5f299601e6c7da350049315e83209d551b" - integrity sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA== +"@babel/helper-compilation-targets@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz#a3c2924f5e5f0379b356d4cfb313d1414dc30e46" + integrity sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w== dependencies: - "@babel/compat-data" "^7.16.4" + "@babel/compat-data" "^7.17.7" "@babel/helper-validator-option" "^7.16.7" browserslist "^4.17.5" semver "^6.3.0" @@ -98,14 +98,14 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-module-transforms@^7.16.7": - version "7.17.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.6.tgz#3c3b03cc6617e33d68ef5a27a67419ac5199ccd0" - integrity sha512-2ULmRdqoOMpdvkbT8jONrZML/XALfzxlb052bldftkicAUy8AxSCkD5trDPQcwHNmolcl7wP6ehNqMlyUw6AaA== +"@babel/helper-module-transforms@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz#3943c7f777139e7954a5355c815263741a9c1cbd" + integrity sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw== dependencies: "@babel/helper-environment-visitor" "^7.16.7" "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-simple-access" "^7.16.7" + "@babel/helper-simple-access" "^7.17.7" "@babel/helper-split-export-declaration" "^7.16.7" "@babel/helper-validator-identifier" "^7.16.7" "@babel/template" "^7.16.7" @@ -117,12 +117,12 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5" integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA== -"@babel/helper-simple-access@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz#d656654b9ea08dbb9659b69d61063ccd343ff0f7" - integrity sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g== +"@babel/helper-simple-access@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367" + integrity sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA== dependencies: - "@babel/types" "^7.16.7" + "@babel/types" "^7.17.0" "@babel/helper-split-export-declaration@^7.16.7": version "7.16.7" @@ -141,13 +141,13 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== -"@babel/helpers@^7.17.2": - version "7.17.2" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.2.tgz#23f0a0746c8e287773ccd27c14be428891f63417" - integrity sha512-0Qu7RLR1dILozr/6M0xgj+DFPmi6Bnulgm9M8BVa9ZCWxDqlSnqt3cf8IDPB5m45sVXUZ0kuQAgUrdSFFH79fQ== +"@babel/helpers@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.7.tgz#6fc0a24280fd00026e85424bbfed4650e76d7127" + integrity sha512-TKsj9NkjJfTBxM7Phfy7kv6yYc4ZcOo+AaWGqQOKTPDOmcGkIFb5xNA746eKisQkm4yavUYh4InYM9S+VnO01w== dependencies: "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.0" + "@babel/traverse" "^7.17.3" "@babel/types" "^7.17.0" "@babel/highlight@^7.16.7": @@ -159,10 +159,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3": - version "7.17.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.3.tgz#b07702b982990bf6fdc1da5049a23fece4c5c3d0" - integrity sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3", "@babel/parser@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.7.tgz#fc19b645a5456c8d6fdb6cecd3c66c0173902800" + integrity sha512-bm3AQf45vR4gKggRfvJdYJ0gFLoCbsPxiFLSH6hTVYABptNHY6l9NrhnucVjQ/X+SPtLANT9lc0fFhikj+VBRA== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -256,9 +256,9 @@ "@babel/helper-plugin-utils" "^7.16.7" "@babel/runtime@^7.14.6", "@babel/runtime@^7.7.6": - version "7.17.2" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.2.tgz#66f68591605e59da47523c631416b18508779941" - integrity sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw== + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.7.tgz#a5f3328dc41ff39d803f311cfe17703418cf9825" + integrity sha512-L6rvG9GDxaLgFjg41K+5Yv9OMrU98sWe+Ykmc6FDJW/+vYZMhdOMKkISgzptMaERHvS2Y2lw9MDRm2gHhlQQoA== dependencies: regenerator-runtime "^0.13.4" @@ -271,7 +271,7 @@ "@babel/parser" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/traverse@^7.17.0", "@babel/traverse@^7.17.3", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.17.3", "@babel/traverse@^7.7.2": version "7.17.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57" integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw== @@ -313,20 +313,20 @@ "@cspotcode/source-map-consumer" "0.8.0" "@discoveryjs/json-ext@^0.5.0": - version "0.5.6" - resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz#d5e0706cf8c6acd8c6032f8d54070af261bbbb2f" - integrity sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA== + version "0.5.7" + resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" + integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== -"@eslint/eslintrc@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.0.tgz#7ce1547a5c46dfe56e1e45c3c9ed18038c721c6a" - integrity sha512-igm9SjJHNEJRiUnecP/1R5T3wKLEJ7pL6e2P+GUSfCd0dGjPYYZve08uzw8L2J8foVHFz+NGu12JxRcU2gGo6w== +"@eslint/eslintrc@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.1.tgz#8b5e1c49f4077235516bc9ec7d41378c0f69b8c6" + integrity sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ== dependencies: ajv "^6.12.4" debug "^4.3.2" espree "^9.3.1" globals "^13.9.0" - ignore "^4.0.6" + ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" minimatch "^3.0.4" @@ -1327,13 +1327,13 @@ "@octokit/types" "^6.0.3" "@octokit/core@^3.5.1": - version "3.5.1" - resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b" - integrity sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw== + version "3.6.0" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.6.0.tgz#3376cb9f3008d9b3d110370d90e0a1fcd5fe6085" + integrity sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q== dependencies: "@octokit/auth-token" "^2.4.4" "@octokit/graphql" "^4.5.8" - "@octokit/request" "^5.6.0" + "@octokit/request" "^5.6.3" "@octokit/request-error" "^2.0.5" "@octokit/types" "^6.0.3" before-after-hook "^2.2.0" @@ -1396,7 +1396,7 @@ deprecation "^2.0.0" once "^1.4.0" -"@octokit/request@^5.6.0": +"@octokit/request@^5.6.0", "@octokit/request@^5.6.3": version "5.6.3" resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0" integrity sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A== @@ -1597,9 +1597,9 @@ pretty-format "^27.0.0" "@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": - version "7.0.9" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" - integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== + version "7.0.10" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.10.tgz#9b05b7896166cd00e9cbd59864853abf65d9ac23" + integrity sha512-BLO9bBq59vW3fxCpD4o0N4U+DXsvwvIcl+jofw0frQo/GrBFC+/jRZj1E7kgp6dvTyNmA4y6JCV5Id/r3mNP5A== "@types/json5@^0.0.29": version "0.0.29" @@ -1726,14 +1726,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.14.0.tgz#5119b67152356231a0e24b998035288a9cd21335" - integrity sha512-ir0wYI4FfFUDfLcuwKzIH7sMVA+db7WYen47iRSaCGl+HMAZI9fpBwfDo45ZALD3A45ZGyHWDNLhbg8tZrMX4w== +"@typescript-eslint/eslint-plugin@^5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.15.0.tgz#c28ef7f2e688066db0b6a9d95fb74185c114fb9a" + integrity sha512-u6Db5JfF0Esn3tiAKELvoU5TpXVSkOpZ78cEGn/wXtT2RVqs2vkt4ge6N8cRCyw7YVKhmmLDbwI2pg92mlv7cA== dependencies: - "@typescript-eslint/scope-manager" "5.14.0" - "@typescript-eslint/type-utils" "5.14.0" - "@typescript-eslint/utils" "5.14.0" + "@typescript-eslint/scope-manager" "5.15.0" + "@typescript-eslint/type-utils" "5.15.0" + "@typescript-eslint/utils" "5.15.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -1741,69 +1741,69 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.14.0.tgz#7c79f898aa3cff0ceee6f1d34eeed0f034fb9ef3" - integrity sha512-aHJN8/FuIy1Zvqk4U/gcO/fxeMKyoSv/rS46UXMXOJKVsLQ+iYPuXNbpbH7cBLcpSbmyyFbwrniLx5+kutu1pw== +"@typescript-eslint/parser@^5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.15.0.tgz#95f603f8fe6eca7952a99bfeef9b85992972e728" + integrity sha512-NGAYP/+RDM2sVfmKiKOCgJYPstAO40vPAgACoWPO/+yoYKSgAXIFaBKsV8P0Cc7fwKgvj27SjRNX4L7f4/jCKQ== dependencies: - "@typescript-eslint/scope-manager" "5.14.0" - "@typescript-eslint/types" "5.14.0" - "@typescript-eslint/typescript-estree" "5.14.0" + "@typescript-eslint/scope-manager" "5.15.0" + "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/typescript-estree" "5.15.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.14.0.tgz#ea518962b42db8ed0a55152ea959c218cb53ca7b" - integrity sha512-LazdcMlGnv+xUc5R4qIlqH0OWARyl2kaP8pVCS39qSL3Pd1F7mI10DbdXeARcE62sVQE4fHNvEqMWsypWO+yEw== +"@typescript-eslint/scope-manager@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.15.0.tgz#d97afab5e0abf4018d1289bd711be21676cdd0ee" + integrity sha512-EFiZcSKrHh4kWk0pZaa+YNJosvKE50EnmN4IfgjkA3bTHElPtYcd2U37QQkNTqwMCS7LXeDeZzEqnsOH8chjSg== dependencies: - "@typescript-eslint/types" "5.14.0" - "@typescript-eslint/visitor-keys" "5.14.0" + "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/visitor-keys" "5.15.0" -"@typescript-eslint/type-utils@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.14.0.tgz#711f08105860b12988454e91df433567205a8f0b" - integrity sha512-d4PTJxsqaUpv8iERTDSQBKUCV7Q5yyXjqXUl3XF7Sd9ogNLuKLkxz82qxokqQ4jXdTPZudWpmNtr/JjbbvUixw== +"@typescript-eslint/type-utils@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.15.0.tgz#d2c02eb2bdf54d0a645ba3a173ceda78346cf248" + integrity sha512-KGeDoEQ7gHieLydujGEFLyLofipe9PIzfvA/41urz4hv+xVxPEbmMQonKSynZ0Ks2xDhJQ4VYjB3DnRiywvKDA== dependencies: - "@typescript-eslint/utils" "5.14.0" + "@typescript-eslint/utils" "5.15.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.14.0.tgz#96317cf116cea4befabc0defef371a1013f8ab11" - integrity sha512-BR6Y9eE9360LNnW3eEUqAg6HxS9Q35kSIs4rp4vNHRdfg0s+/PgHgskvu5DFTM7G5VKAVjuyaN476LCPrdA7Mw== +"@typescript-eslint/types@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.15.0.tgz#c7bdd103843b1abae97b5518219d3e2a0d79a501" + integrity sha512-yEiTN4MDy23vvsIksrShjNwQl2vl6kJeG9YkVJXjXZnkJElzVK8nfPsWKYxcsGWG8GhurYXP4/KGj3aZAxbeOA== -"@typescript-eslint/typescript-estree@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.14.0.tgz#78b7f7385d5b6f2748aacea5c9b7f6ae62058314" - integrity sha512-QGnxvROrCVtLQ1724GLTHBTR0lZVu13izOp9njRvMkCBgWX26PKvmMP8k82nmXBRD3DQcFFq2oj3cKDwr0FaUA== +"@typescript-eslint/typescript-estree@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.15.0.tgz#81513a742a9c657587ad1ddbca88e76c6efb0aac" + integrity sha512-Hb0e3dGc35b75xLzixM3cSbG1sSbrTBQDfIScqdyvrfJZVEi4XWAT+UL/HMxEdrJNB8Yk28SKxPLtAhfCbBInA== dependencies: - "@typescript-eslint/types" "5.14.0" - "@typescript-eslint/visitor-keys" "5.14.0" + "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/visitor-keys" "5.15.0" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.14.0.tgz#6c8bc4f384298cbbb32b3629ba7415f9f80dc8c4" - integrity sha512-EHwlII5mvUA0UsKYnVzySb/5EE/t03duUTweVy8Zqt3UQXBrpEVY144OTceFKaOe4xQXZJrkptCf7PjEBeGK4w== +"@typescript-eslint/utils@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.15.0.tgz#468510a0974d3ced8342f37e6c662778c277f136" + integrity sha512-081rWu2IPKOgTOhHUk/QfxuFog8m4wxW43sXNOMSCdh578tGJ1PAaWPsj42LOa7pguh173tNlMigsbrHvh/mtA== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.14.0" - "@typescript-eslint/types" "5.14.0" - "@typescript-eslint/typescript-estree" "5.14.0" + "@typescript-eslint/scope-manager" "5.15.0" + "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/typescript-estree" "5.15.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.14.0.tgz#1927005b3434ccd0d3ae1b2ecf60e65943c36986" - integrity sha512-yL0XxfzR94UEkjBqyymMLgCBdojzEuy/eim7N9/RIcTNxpJudAcqsU8eRyfzBbcEzGoPWfdM3AGak3cN08WOIw== +"@typescript-eslint/visitor-keys@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.15.0.tgz#5669739fbf516df060f978be6a6dce75855a8027" + integrity sha512-+vX5FKtgvyHbmIJdxMJ2jKm9z2BIlXJiuewI8dsDYMp5LzPUcuTT78Ya5iwvQg3VqSVdmxyM8Anj1Jeq7733ZQ== dependencies: - "@typescript-eslint/types" "5.14.0" + "@typescript-eslint/types" "5.15.0" eslint-visitor-keys "^3.0.0" "@webassemblyjs/ast@1.11.1": @@ -2345,12 +2345,12 @@ browser-process-hrtime@^1.0.0: integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browserslist@^4.14.5, browserslist@^4.17.5: - version "4.20.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.0.tgz#35951e3541078c125d36df76056e94738a52ebe9" - integrity sha512-bnpOoa+DownbciXj0jVGENf8VYQnE2LNWomhYuCsMmmx9Jd9lwq0WXODuwpSsp8AVdKM2/HorrzxAfbKvWTByQ== + version "4.20.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.2.tgz#567b41508757ecd904dab4d1c646c612cd3d4f88" + integrity sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA== dependencies: - caniuse-lite "^1.0.30001313" - electron-to-chromium "^1.4.76" + caniuse-lite "^1.0.30001317" + electron-to-chromium "^1.4.84" escalade "^3.1.1" node-releases "^2.0.2" picocolors "^1.0.0" @@ -2445,10 +2445,10 @@ camelcase@^6.2.0, camelcase@^6.3.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001313: - version "1.0.30001314" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001314.tgz#65c7f9fb7e4594fca0a333bec1d8939662377596" - integrity sha512-0zaSO+TnCHtHJIbpLroX7nsD+vYuOVjl3uzFbJO1wMVbuveJA0RK2WcQA9ZUIOiO0/ArMiMgHJLxfEZhQiC0kw== +caniuse-lite@^1.0.30001317: + version "1.0.30001317" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001317.tgz#0548fb28fd5bc259a70b8c1ffdbe598037666a1b" + integrity sha512-xIZLh8gBm4dqNX0gkzrBeyI86J2eCjWzYAs40q88smG844YIrN4tVQl/RhquHvKEKImWWFIVh1Lxe5n1G/N+GQ== case@^1.6.3: version "1.6.3" @@ -2950,10 +2950,10 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -date-format@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.4.tgz#b58036e29e74121fca3e1b3e0dc4a62c65faa233" - integrity sha512-/jyf4rhB17ge328HJuJjAcmRtCsGd+NDeAtahRBTaK6vSPR6MO5HlrAit3Nn7dVjaa6sowW0WXt8yQtLyZQFRg== +date-format@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.5.tgz#ba385f89782c6cb114cf45dfa4704c6bb29fca51" + integrity sha512-zBhRiN/M0gDxUoM2xRtzTjJzSg0XEi1ofYpF84PfXeS3hN2PsGxmc7jw3DNQtFlimRbMmob5FC3G0cJq6jQQpw== dateformat@^3.0.0: version "3.0.3" @@ -3205,10 +3205,10 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -electron-to-chromium@^1.4.76: - version "1.4.78" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.78.tgz#7a1cf853efafde2c4cf6e86facf3e5792d3541a5" - integrity sha512-o61+D/Lx7j/E0LIin/efOqeHpXhwi1TaQco9vUcRmr91m25SfZY6L5hWJDv/r+6kNjboFKgBw1LbfM0lbhuK6Q== +electron-to-chromium@^1.4.84: + version "1.4.85" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.85.tgz#a3666ba42147026b9f34d4d8d4caf0740e80f751" + integrity sha512-K9AsQ41WS2bjZUFpRWfvaS4RjEcRCamEkBJN1Z1TQILBfP1H8QnJ9ti0wiLiMv0sRjX3EHKzgs9jDnmGFx2jXg== emittery@^0.8.1: version "0.8.1" @@ -3439,12 +3439,12 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.10.0: - version "8.10.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.10.0.tgz#931be395eb60f900c01658b278e05b6dae47199d" - integrity sha512-tcI1D9lfVec+R4LE1mNDnzoJ/f71Kl/9Cv4nG47jOueCMBrCCKYXr4AUVS7go6mWYGFD4+EoN6+eXSrEbRzXVw== +eslint@^8.11.0: + version "8.11.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.11.0.tgz#88b91cfba1356fc10bb9eb592958457dfe09fb37" + integrity sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA== dependencies: - "@eslint/eslintrc" "^1.2.0" + "@eslint/eslintrc" "^1.2.1" "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" @@ -3958,9 +3958,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.6.0, globals@^13.9.0: - version "13.12.1" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.12.1.tgz#ec206be932e6c77236677127577aa8e50bf1c5cb" - integrity sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw== + version "13.13.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.13.0.tgz#ac32261060d8070e2719dd6998406e27d2b5727b" + integrity sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A== dependencies: type-fest "^0.20.2" @@ -4138,11 +4138,6 @@ ignore-walk@^3.0.3: dependencies: minimatch "^3.0.4" -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - ignore@^5.1.8, ignore@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" @@ -5280,16 +5275,16 @@ lodash@^4.11.2, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.7.0: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log4js@^6.4.2: - version "6.4.2" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.4.2.tgz#45ec783835acc525b397f52cf086e26994fe3b70" - integrity sha512-k80cggS2sZQLBwllpT1p06GtfvzMmSdUCkW96f0Hj83rKGJDAu2vZjt9B9ag2vx8Zz1IXzxoLgqvRJCdMKybGg== +log4js@^6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.4.3.tgz#8bddd981846873895bcc55c0961560c7214a8ad7" + integrity sha512-H/oQKcCVIhQ8zCtUh5aftdp9eRpGyVB1M5sKzAJ0i10q5jS+YXk133vtLgzT1RIoWMbIn7QD1LUto8a1hqh6gA== dependencies: - date-format "^4.0.4" + date-format "^4.0.5" debug "^4.3.3" flatted "^3.2.5" rfdc "^1.3.0" - streamroller "^3.0.4" + streamroller "^3.0.5" lower-case@^1.1.1: version "1.1.4" @@ -5430,17 +5425,17 @@ micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.19: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: - mime-db "1.51.0" + mime-db "1.52.0" mimic-fn@^2.1.0: version "2.1.0" @@ -6250,10 +6245,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" - integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== +prettier@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.0.tgz#12f8f504c4d8ddb76475f441337542fa799207d4" + integrity sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A== pretty-format@^27.0.0, pretty-format@^27.5.1: version "27.5.1" @@ -6998,12 +6993,12 @@ standard-version@^9.3.2: stringify-package "^1.0.1" yargs "^16.0.0" -streamroller@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.0.4.tgz#27ad87339d829483f89c5f33fd60ea6731e4183c" - integrity sha512-GI9NzeD+D88UFuIlJkKNDH/IsuR+qIN7Qh8EsmhoRZr9bQoehTraRgwtLUkZbpcAw+hLPfHOypmppz8YyGK68w== +streamroller@^3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.0.5.tgz#17e348dc2a662f9f325373549ab91d55316051ab" + integrity sha512-5uzTEUIi4OB5zy/H30kbUN/zpDNJsFUA+Z47ZL8EfrP93lcZvRLEqdbhdunEPa7CouuAzXXsHpCJ9dg90Umw7g== dependencies: - date-format "^4.0.4" + date-format "^4.0.5" debug "^4.3.3" fs-extra "^10.0.1" @@ -7246,9 +7241,9 @@ terser-webpack-plugin@^5.1.3: terser "^5.7.2" terser@^5.7.2: - version "5.12.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.12.0.tgz#728c6bff05f7d1dcb687d8eace0644802a9dae8a" - integrity sha512-R3AUhNBGWiFc77HXag+1fXpAxTAFRQTJemlJKjAgD9r8xXTpjNKqIXwHM/o7Rh+O0kUJtS3WQVdBeMKFk5sw9A== + version "5.12.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.12.1.tgz#4cf2ebed1f5bceef5c83b9f60104ac4a78b49e9c" + integrity sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ== dependencies: acorn "^8.5.0" commander "^2.20.0" @@ -7391,9 +7386,9 @@ ts-node@^10.2.1, ts-node@^10.7.0: yn "3.1.1" tsconfig-paths@^3.12.0, tsconfig-paths@^3.9.0: - version "3.13.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.13.0.tgz#f3e9b8f6876698581d94470c03c95b3a48c0e3d7" - integrity sha512-nWuffZppoaYK0vQ1SQmkSsQzJoHA4s6uzdb2waRpD806x9yfq153AdVsWz4je2qZcW+pENrMQXbGQ3sMCkXuhw== + version "3.14.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.0.tgz#4fcc48f9ccea8826c41b9ca093479de7f5018976" + integrity sha512-cg/1jAZoL57R39+wiw4u/SCC6Ic9Q5NqjBOb+9xISedOYurfog9ZNmKJSxAnb2m/5Bq4lE9lhUcau33Ml8DM0g== dependencies: "@types/json5" "^0.0.29" json5 "^1.0.1" @@ -7514,9 +7509,9 @@ typescript@~4.5.0: integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== uglify-js@^3.1.4: - version "3.15.2" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.15.2.tgz#1ed2c976f448063b1f87adb68c741be79959f951" - integrity sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A== + version "3.15.3" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.15.3.tgz#9aa82ca22419ba4c0137642ba0df800cb06e0471" + integrity sha512-6iCVm2omGJbsu3JWac+p6kUiOpg3wFO2f8lIXjfEb8RrmLjzog1wTPMmwKB7swfzzqxj9YM+sGUM++u1qN4qJg== uid-number@0.0.6: version "0.0.6" From ba99cbdf83a1ece3061829f5bb9c68c774785e5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 19:44:22 +0000 Subject: [PATCH 04/32] chore(deps): Bump actions/cache from 2 to 3 (#3436) Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
Release notes

Sourced from actions/cache's releases.

v3.0.0

v2.1.7

Support 10GB cache upload using the latest version 1.0.8 of @actions/cache

v2.1.6

v2.1.5

v2.1.4

v2.1.3

v2.1.2

v2.1.1

v2.1.0

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/cache&package-manager=github_actions&previous-version=2&new-version=3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/docker-images.yml | 2 +- .github/workflows/gh-pages.yml | 2 +- .github/workflows/main.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index 8db02b4518..666c2fc284 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -74,7 +74,7 @@ jobs: # We only restore GH cache if we are not going to publish the result (i.e: PR validation) - name: Set up layer cache if: steps.should-run.outputs.result == 'true' && github.event_name != 'push' - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ hashFiles('superchain/*') }}-${{ github.sha }} diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 8c71957679..3f6766ea5a 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -27,7 +27,7 @@ jobs: run: |- echo "::set-output name=pip-cache::$(python3 -m pip cache dir)" - name: Cache - uses: actions/cache@v2.1.6 + uses: actions/cache@v3 with: path: ${{ steps.cache-locations.outputs.pip-cache }} key: ${{ runner.os }}-${{ hashFiles('**/requirements-dev.txt') }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 401712ee0d..f43d0845a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,7 +61,7 @@ jobs: echo "::set-output name=pip-cache::$(python3 -m pip cache dir)" - name: Cache - uses: actions/cache@v2.1.6 + uses: actions/cache@v3 with: path: |- ${{ steps.cache-locations.outputs.pip-cache }} @@ -155,7 +155,7 @@ jobs: echo "::set-output name=pip-cache::$(python3 -m pip cache dir)" - name: Cache - uses: actions/cache@v2.1.6 + uses: actions/cache@v3 with: path: |- ${{ steps.cache-locations.outputs.pip-cache }} @@ -324,7 +324,7 @@ jobs: echo "::set-output name=pip-cache::$(python3 -m pip cache dir)" - name: Cache - uses: actions/cache@v2.1.6 + uses: actions/cache@v3 with: path: |- ${{ steps.cache-locations.outputs.pip-cache }} From 581abcceda7b84826a0f49732ae7f9c1911ccdf2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 20:56:37 +0000 Subject: [PATCH 05/32] chore(deps): Bump golang.org/x/tools from 0.1.9 to 0.1.10 in /packages/@jsii/go-runtime (#3430) Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.1.9 to 0.1.10.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/tools&package-manager=go_modules&previous-version=0.1.9&new-version=0.1.10)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- packages/@jsii/go-runtime/go.mod | 2 +- packages/@jsii/go-runtime/go.sum | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/@jsii/go-runtime/go.mod b/packages/@jsii/go-runtime/go.mod index 5099e3a5fb..2280d4124c 100644 --- a/packages/@jsii/go-runtime/go.mod +++ b/packages/@jsii/go-runtime/go.mod @@ -4,5 +4,5 @@ go 1.16 require ( golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 - golang.org/x/tools v0.1.9 + golang.org/x/tools v0.1.10 ) diff --git a/packages/@jsii/go-runtime/go.sum b/packages/@jsii/go-runtime/go.sum index b50c26931b..a0121607d0 100644 --- a/packages/@jsii/go-runtime/go.sum +++ b/packages/@jsii/go-runtime/go.sum @@ -2,13 +2,15 @@ github.com/yuin/goldmark v1.4.1 h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -17,17 +19,19 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.1.9 h1:j9KsMiaP1c3B0OTQGth0/k+miLGTgLsAFUCrF2vLcF8= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= From 541987673dd015e0264cf299b51998923556eb8d Mon Sep 17 00:00:00 2001 From: Mitchell Valine Date: Tue, 22 Mar 2022 14:31:17 -0700 Subject: [PATCH 06/32] feat: specify output directory for assemblies (#3437) Allows passing an option `outdir` option to `transliterateAssembly` command. This allows users to generate transliterated assemblies without polluting the package directory if so desired. Enables fixing of https://github.com/cdklabs/jsii-docgen/issues/390 --- 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 --- .../lib/commands/transliterate.ts | 9 +- .../test/commands/transliterate.test.ts | 109 ++++++++++++++++++ 2 files changed, 117 insertions(+), 1 deletion(-) diff --git a/packages/jsii-rosetta/lib/commands/transliterate.ts b/packages/jsii-rosetta/lib/commands/transliterate.ts index 5878c1d9ad..d6cb371d6d 100644 --- a/packages/jsii-rosetta/lib/commands/transliterate.ts +++ b/packages/jsii-rosetta/lib/commands/transliterate.ts @@ -32,6 +32,13 @@ export interface TransliterateAssemblyOptions { * @default - Only the default tablet (`.jsii.tabl.json`) files will be used. */ readonly tablet?: string; + + /** + * A directory to output translated assemblies to + * + * @default - assembly location + */ + readonly outdir?: string; } /** @@ -97,7 +104,7 @@ export async function transliterateAssembly( transliterateType(type, rosetta, language); } // eslint-disable-next-line no-await-in-loop - await writeJson(resolve(location, `${SPEC_FILE_NAME}.${language}`), result, { spaces: 2 }); + await writeJson(resolve(options?.outdir ?? location, `${SPEC_FILE_NAME}.${language}`), result, { spaces: 2 }); const then = new Date().getTime(); debug(`Done transliterating ${result.name}@${result.version} to ${language} after ${then - now} milliseconds`); } diff --git a/packages/jsii-rosetta/test/commands/transliterate.test.ts b/packages/jsii-rosetta/test/commands/transliterate.test.ts index c5693523f5..0924b5acd2 100644 --- a/packages/jsii-rosetta/test/commands/transliterate.test.ts +++ b/packages/jsii-rosetta/test/commands/transliterate.test.ts @@ -1391,3 +1391,112 @@ test('will read translations from cache even if they are dirty', async () => { await infusedAssembly.cleanup(); } }); + +test('will output to specified directory', async () => + withTemporaryDirectory(async (tmpDir) => { + // GIVEN + const compilationResult = await jsii.compileJsiiForTest({ + 'README.md': ` +# README +\`\`\`ts +const object: IInterface = new ClassName('this', 1337, { foo: 'bar' }); +object.property = EnumType.OPTION_A; +object.methodCall(); + +ClassName.staticMethod(EnumType.OPTION_B); +\`\`\` +`, + 'index.ts': ` +/** + * @example new ClassName('this', 1337, { property: EnumType.OPTION_B }); + */ +export enum EnumType { + /** + * @example new ClassName('this', 1337, { property: EnumType.OPTION_A }); + */ + OPTION_A = 1, + + /** + * @example new ClassName('this', 1337, { property: EnumType.OPTION_B }); + */ + OPTION_B = 2, +} + +export interface IInterface { + /** + * A property value. + * + * @example + * iface.property = EnumType.OPTION_B; + */ + property: EnumType; + + /** + * An instance method call. + * + * @example + * iface.methodCall(); + */ + methodCall(): void; +} + +export interface ClassNameProps { + readonly property?: EnumType; + readonly foo?: string; +} + +export class ClassName implements IInterface { + /** + * A static method. It can be invoked easily. + * + * @example ClassName.staticMethod(); + */ + public static staticMethod(_enm?: EnumType): void { + // ... + } + + public property: EnumType; + + /** + * Create a new instance of ClassName. + * + * @example new ClassName('this', 1337, { property: EnumType.OPTION_B }); + */ + public constructor(_this: string, _elite: number, props: ClassNameProps) { + this.property = props.property ?? EnumType.OPTION_A; + } + + public methodCall(): void { + // ... + } +}`, + }); + fs.writeJsonSync(path.join(tmpDir, SPEC_FILE_NAME), compilationResult.assembly, { + spaces: 2, + }); + for (const [file, content] of Object.entries(compilationResult.files)) { + fs.writeFileSync(path.resolve(tmpDir, file), content, 'utf-8'); + } + fs.mkdirSync(path.resolve(tmpDir, 'rosetta')); + fs.writeFileSync( + path.resolve(tmpDir, 'rosetta', 'default.ts-fixture'), + `import { EnumType, IInterface, ClassName } from '.';\ndeclare const iface: IInterface\n/// here`, + 'utf-8', + ); + + // WHEN + // create outdir + const outdir = path.resolve(tmpDir, 'out'); + fs.mkdirSync(outdir); + + await expect( + transliterateAssembly([tmpDir], Object.values(TargetLanguage), { + strict: true, + outdir, + }), + ).resolves.not.toThrow(); + + Object.values(TargetLanguage).forEach((lang) => { + expect(fs.statSync(path.join(outdir, `${SPEC_FILE_NAME}.${lang}`)).isFile()).toBe(true); + }); + })); From 426fbf9a62fbaed005a43bb582d6350a75027337 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Wed, 23 Mar 2022 13:02:46 -0400 Subject: [PATCH 07/32] chore: npm-check-updates && yarn upgrade (#3440) Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date. --- package.json | 6 +- packages/jsii-config/package.json | 2 +- packages/jsii-diff/package.json | 2 +- packages/jsii/package.json | 2 +- yarn.lock | 262 +++++++++++++++--------------- 5 files changed, 136 insertions(+), 138 deletions(-) diff --git a/package.json b/package.json index e8122a89ed..be280321aa 100644 --- a/package.json +++ b/package.json @@ -16,13 +16,13 @@ }, "devDependencies": { "@jest/types": "^27.5.1", - "@typescript-eslint/eslint-plugin": "^5.15.0", - "@typescript-eslint/parser": "^5.15.0", + "@typescript-eslint/eslint-plugin": "^5.16.0", + "@typescript-eslint/parser": "^5.16.0", "all-contributors-cli": "^6.20.0", "eslint": "^8.11.0", "eslint-config-prettier": "^8.5.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-import-resolver-typescript": "^2.5.0", + "eslint-import-resolver-typescript": "^2.7.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-prettier": "^4.0.0", "jest-circus": "^27.5.1", diff --git a/packages/jsii-config/package.json b/packages/jsii-config/package.json index a371d3109b..1f94ee6cd4 100644 --- a/packages/jsii-config/package.json +++ b/packages/jsii-config/package.json @@ -22,7 +22,7 @@ "@types/inquirer": "^8.2.0", "@types/jest": "^27.4.1", "@types/node": "^12.20.47", - "@types/yargs": "^17.0.9", + "@types/yargs": "^17.0.10", "eslint": "^8.11.0", "jest": "^27.5.1", "jest-expect-message": "^1.0.2", diff --git a/packages/jsii-diff/package.json b/packages/jsii-diff/package.json index 6b49722781..7b0a1e2810 100644 --- a/packages/jsii-diff/package.json +++ b/packages/jsii-diff/package.json @@ -37,7 +37,7 @@ "@jsii/spec": "^0.0.0", "fs-extra": "^9.1.0", "jsii-reflect": "^0.0.0", - "log4js": "^6.4.3", + "log4js": "^6.4.4", "typescript": "~3.9.10", "yargs": "^16.2.0" }, diff --git a/packages/jsii/package.json b/packages/jsii/package.json index 8117b38dd8..66a6f8533e 100644 --- a/packages/jsii/package.json +++ b/packages/jsii/package.json @@ -41,7 +41,7 @@ "chalk": "^4", "deep-equal": "^2.0.5", "fs-extra": "^9.1.0", - "log4js": "^6.4.3", + "log4js": "^6.4.4", "semver": "^7.3.5", "semver-intersect": "^1.4.0", "sort-json": "^2.0.1", diff --git a/yarn.lock b/yarn.lock index ed2da25f75..2263ef7c9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22,17 +22,17 @@ integrity sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ== "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.7.tgz#f7c28228c83cdf2dbd1b9baa06eaf9df07f0c2f9" - integrity sha512-djHlEfFHnSnTAcPb7dATbiM5HxGOP98+3JLBZtjRb5I7RXrw7kFRoG2dXM8cm3H+o11A8IFH/uprmJpwFynRNQ== + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.8.tgz#3dac27c190ebc3a4381110d46c80e77efe172e1a" + integrity sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.16.7" "@babel/generator" "^7.17.7" "@babel/helper-compilation-targets" "^7.17.7" "@babel/helper-module-transforms" "^7.17.7" - "@babel/helpers" "^7.17.7" - "@babel/parser" "^7.17.7" + "@babel/helpers" "^7.17.8" + "@babel/parser" "^7.17.8" "@babel/template" "^7.16.7" "@babel/traverse" "^7.17.3" "@babel/types" "^7.17.0" @@ -141,10 +141,10 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== -"@babel/helpers@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.7.tgz#6fc0a24280fd00026e85424bbfed4650e76d7127" - integrity sha512-TKsj9NkjJfTBxM7Phfy7kv6yYc4ZcOo+AaWGqQOKTPDOmcGkIFb5xNA746eKisQkm4yavUYh4InYM9S+VnO01w== +"@babel/helpers@^7.17.8": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.8.tgz#288450be8c6ac7e4e44df37bcc53d345e07bc106" + integrity sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw== dependencies: "@babel/template" "^7.16.7" "@babel/traverse" "^7.17.3" @@ -159,10 +159,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3", "@babel/parser@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.7.tgz#fc19b645a5456c8d6fdb6cecd3c66c0173902800" - integrity sha512-bm3AQf45vR4gKggRfvJdYJ0gFLoCbsPxiFLSH6hTVYABptNHY6l9NrhnucVjQ/X+SPtLANT9lc0fFhikj+VBRA== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3", "@babel/parser@^7.17.8": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.8.tgz#2817fb9d885dd8132ea0f8eb615a6388cca1c240" + integrity sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -256,9 +256,9 @@ "@babel/helper-plugin-utils" "^7.16.7" "@babel/runtime@^7.14.6", "@babel/runtime@^7.7.6": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.7.tgz#a5f3328dc41ff39d803f311cfe17703418cf9825" - integrity sha512-L6rvG9GDxaLgFjg41K+5Yv9OMrU98sWe+Ykmc6FDJW/+vYZMhdOMKkISgzptMaERHvS2Y2lw9MDRm2gHhlQQoA== + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.8.tgz#3e56e4aff81befa55ac3ac6a0967349fd1c5bca2" + integrity sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA== dependencies: regenerator-runtime "^0.13.4" @@ -1465,9 +1465,9 @@ integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": - version "7.1.18" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.18.tgz#1a29abcc411a9c05e2094c98f9a1b7da6cdf49f8" - integrity sha512-S7unDjm/C7z2A2R9NzfKCK1I+BAALDtxEmsJBwlB3EzNfb929ykjL++1CK9LO++EIp2fQrC8O+BwjKvz6UeDyQ== + version "7.1.19" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" + integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -1631,9 +1631,9 @@ "@types/node" "*" "@types/node@*": - version "17.0.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.21.tgz#864b987c0c68d07b4345845c3e63b75edd143644" - integrity sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ== + version "17.0.22" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.22.tgz#38b6c4b9b2f3ed9f2e376cce42a298fb2375251e" + integrity sha512-8FwbVoG4fy+ykY86XCAclKZDORttqE5/s7dyWZKLXTdv3vRy5HozBEinG5IqhvPXXzIZEcTVbuHlQEI6iuwcmw== "@types/node@^12.20.47": version "12.20.47" @@ -1719,21 +1719,21 @@ dependencies: "@types/yargs-parser" "*" -"@types/yargs@^17.0.9": - version "17.0.9" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.9.tgz#f1f931a4e5ae2c0134dea10f501088636a50b46a" - integrity sha512-Ci8+4/DOtkHRylcisKmVMtmVO5g7weUVCKcsu1sJvF1bn0wExTmbHmhFKj7AnEm0de800iovGhdSKzYnzbaHpg== +"@types/yargs@^17.0.10": + version "17.0.10" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.10.tgz#591522fce85d8739bca7b8bb90d048e4478d186a" + integrity sha512-gmEaFwpj/7f/ROdtIlci1R1VYU1J4j95m8T+Tj3iBgiBFKg1foE/PSl93bBd5T9LDXNPo8UlNN6W0qwD8O5OaA== dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.15.0.tgz#c28ef7f2e688066db0b6a9d95fb74185c114fb9a" - integrity sha512-u6Db5JfF0Esn3tiAKELvoU5TpXVSkOpZ78cEGn/wXtT2RVqs2vkt4ge6N8cRCyw7YVKhmmLDbwI2pg92mlv7cA== +"@typescript-eslint/eslint-plugin@^5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.16.0.tgz#78f246dd8d1b528fc5bfca99a8a64d4023a3d86d" + integrity sha512-SJoba1edXvQRMmNI505Uo4XmGbxCK9ARQpkvOd00anxzri9RNQk0DDCxD+LIl+jYhkzOJiOMMKYEHnHEODjdCw== dependencies: - "@typescript-eslint/scope-manager" "5.15.0" - "@typescript-eslint/type-utils" "5.15.0" - "@typescript-eslint/utils" "5.15.0" + "@typescript-eslint/scope-manager" "5.16.0" + "@typescript-eslint/type-utils" "5.16.0" + "@typescript-eslint/utils" "5.16.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -1741,69 +1741,69 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.15.0.tgz#95f603f8fe6eca7952a99bfeef9b85992972e728" - integrity sha512-NGAYP/+RDM2sVfmKiKOCgJYPstAO40vPAgACoWPO/+yoYKSgAXIFaBKsV8P0Cc7fwKgvj27SjRNX4L7f4/jCKQ== +"@typescript-eslint/parser@^5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.16.0.tgz#e4de1bde4b4dad5b6124d3da227347616ed55508" + integrity sha512-fkDq86F0zl8FicnJtdXakFs4lnuebH6ZADDw6CYQv0UZeIjHvmEw87m9/29nk2Dv5Lmdp0zQ3zDQhiMWQf/GbA== dependencies: - "@typescript-eslint/scope-manager" "5.15.0" - "@typescript-eslint/types" "5.15.0" - "@typescript-eslint/typescript-estree" "5.15.0" + "@typescript-eslint/scope-manager" "5.16.0" + "@typescript-eslint/types" "5.16.0" + "@typescript-eslint/typescript-estree" "5.16.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.15.0.tgz#d97afab5e0abf4018d1289bd711be21676cdd0ee" - integrity sha512-EFiZcSKrHh4kWk0pZaa+YNJosvKE50EnmN4IfgjkA3bTHElPtYcd2U37QQkNTqwMCS7LXeDeZzEqnsOH8chjSg== +"@typescript-eslint/scope-manager@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.16.0.tgz#7e7909d64bd0c4d8aef629cdc764b9d3e1d3a69a" + integrity sha512-P+Yab2Hovg8NekLIR/mOElCDPyGgFZKhGoZA901Yax6WR6HVeGLbsqJkZ+Cvk5nts/dAlFKm8PfL43UZnWdpIQ== dependencies: - "@typescript-eslint/types" "5.15.0" - "@typescript-eslint/visitor-keys" "5.15.0" + "@typescript-eslint/types" "5.16.0" + "@typescript-eslint/visitor-keys" "5.16.0" -"@typescript-eslint/type-utils@5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.15.0.tgz#d2c02eb2bdf54d0a645ba3a173ceda78346cf248" - integrity sha512-KGeDoEQ7gHieLydujGEFLyLofipe9PIzfvA/41urz4hv+xVxPEbmMQonKSynZ0Ks2xDhJQ4VYjB3DnRiywvKDA== +"@typescript-eslint/type-utils@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.16.0.tgz#b482bdde1d7d7c0c7080f7f2f67ea9580b9e0692" + integrity sha512-SKygICv54CCRl1Vq5ewwQUJV/8padIWvPgCxlWPGO/OgQLCijY9G7lDu6H+mqfQtbzDNlVjzVWQmeqbLMBLEwQ== dependencies: - "@typescript-eslint/utils" "5.15.0" + "@typescript-eslint/utils" "5.16.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.15.0.tgz#c7bdd103843b1abae97b5518219d3e2a0d79a501" - integrity sha512-yEiTN4MDy23vvsIksrShjNwQl2vl6kJeG9YkVJXjXZnkJElzVK8nfPsWKYxcsGWG8GhurYXP4/KGj3aZAxbeOA== +"@typescript-eslint/types@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.16.0.tgz#5827b011982950ed350f075eaecb7f47d3c643ee" + integrity sha512-oUorOwLj/3/3p/HFwrp6m/J2VfbLC8gjW5X3awpQJ/bSG+YRGFS4dpsvtQ8T2VNveV+LflQHjlLvB6v0R87z4g== -"@typescript-eslint/typescript-estree@5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.15.0.tgz#81513a742a9c657587ad1ddbca88e76c6efb0aac" - integrity sha512-Hb0e3dGc35b75xLzixM3cSbG1sSbrTBQDfIScqdyvrfJZVEi4XWAT+UL/HMxEdrJNB8Yk28SKxPLtAhfCbBInA== +"@typescript-eslint/typescript-estree@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.16.0.tgz#32259459ec62f5feddca66adc695342f30101f61" + integrity sha512-SE4VfbLWUZl9MR+ngLSARptUv2E8brY0luCdgmUevU6arZRY/KxYoLI/3V/yxaURR8tLRN7bmZtJdgmzLHI6pQ== dependencies: - "@typescript-eslint/types" "5.15.0" - "@typescript-eslint/visitor-keys" "5.15.0" + "@typescript-eslint/types" "5.16.0" + "@typescript-eslint/visitor-keys" "5.16.0" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.15.0.tgz#468510a0974d3ced8342f37e6c662778c277f136" - integrity sha512-081rWu2IPKOgTOhHUk/QfxuFog8m4wxW43sXNOMSCdh578tGJ1PAaWPsj42LOa7pguh173tNlMigsbrHvh/mtA== +"@typescript-eslint/utils@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.16.0.tgz#42218b459d6d66418a4eb199a382bdc261650679" + integrity sha512-iYej2ER6AwmejLWMWzJIHy3nPJeGDuCqf8Jnb+jAQVoPpmWzwQOfa9hWVB8GIQE5gsCv/rfN4T+AYb/V06WseQ== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.15.0" - "@typescript-eslint/types" "5.15.0" - "@typescript-eslint/typescript-estree" "5.15.0" + "@typescript-eslint/scope-manager" "5.16.0" + "@typescript-eslint/types" "5.16.0" + "@typescript-eslint/typescript-estree" "5.16.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.15.0.tgz#5669739fbf516df060f978be6a6dce75855a8027" - integrity sha512-+vX5FKtgvyHbmIJdxMJ2jKm9z2BIlXJiuewI8dsDYMp5LzPUcuTT78Ya5iwvQg3VqSVdmxyM8Anj1Jeq7733ZQ== +"@typescript-eslint/visitor-keys@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.16.0.tgz#f27dc3b943e6317264c7492e390c6844cd4efbbb" + integrity sha512-jqxO8msp5vZDhikTwq9ubyMHqZ67UIvawohr4qF3KhlpL7gzSjOd+8471H3nh5LyABkaI85laEKKU8SnGUK5/g== dependencies: - "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/types" "5.16.0" eslint-visitor-keys "^3.0.0" "@webassemblyjs/ast@1.11.1": @@ -2446,9 +2446,9 @@ camelcase@^6.2.0, camelcase@^6.3.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001317: - version "1.0.30001317" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001317.tgz#0548fb28fd5bc259a70b8c1ffdbe598037666a1b" - integrity sha512-xIZLh8gBm4dqNX0gkzrBeyI86J2eCjWzYAs40q88smG844YIrN4tVQl/RhquHvKEKImWWFIVh1Lxe5n1G/N+GQ== + version "1.0.30001319" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001319.tgz#eb4da4eb3ecdd409f7ba1907820061d56096e88f" + integrity sha512-xjlIAFHucBRSMUo1kb5D4LYgcN1M45qdKP++lhqowDpwJwGkpIRTt5qQqnhxjj1vHcI7nrJxWhCC1ATrCEBTcw== case@^1.6.3: version "1.6.3" @@ -2950,20 +2950,20 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -date-format@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.5.tgz#ba385f89782c6cb114cf45dfa4704c6bb29fca51" - integrity sha512-zBhRiN/M0gDxUoM2xRtzTjJzSg0XEi1ofYpF84PfXeS3hN2PsGxmc7jw3DNQtFlimRbMmob5FC3G0cJq6jQQpw== +date-format@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.6.tgz#f6138b8f17968df9815b3d101fc06b0523f066c5" + integrity sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw== dateformat@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" @@ -3206,9 +3206,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.4.84: - version "1.4.85" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.85.tgz#a3666ba42147026b9f34d4d8d4caf0740e80f751" - integrity sha512-K9AsQ41WS2bjZUFpRWfvaS4RjEcRCamEkBJN1Z1TQILBfP1H8QnJ9ti0wiLiMv0sRjX3EHKzgs9jDnmGFx2jXg== + version "1.4.90" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.90.tgz#4a518590f118828d54fff045728f547fef08143f" + integrity sha512-ZwKgSA0mQMyEhz+NR0F8dRzkrCLeHLzLkjx/CWf16+zV85hQ6meXPQbKanvhnpkYb7b2uJNj+enQJ/N877ND4Q== emittery@^0.8.1: version "0.8.1" @@ -3361,16 +3361,16 @@ eslint-import-resolver-node@^0.3.6: debug "^3.2.7" resolve "^1.20.0" -eslint-import-resolver-typescript@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.5.0.tgz#07661966b272d14ba97f597b51e1a588f9722f0a" - integrity sha512-qZ6e5CFr+I7K4VVhQu3M/9xGv9/YmwsEXrsm3nimw8vWaVHRDrQRp26BgCypTxBp3vUp4o5aVEJRiy0F2DFddQ== +eslint-import-resolver-typescript@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.7.0.tgz#1f9d391b636dccdbaa4a3b1a87eb9a8237e23963" + integrity sha512-MNHS3u5pebvROX4MjGP9coda589ZGfL1SqdxUV4kSrcclfDRWvNE2D+eljbnWVMvWDVRgT89nhscMHPKYGcObQ== dependencies: - debug "^4.3.1" - glob "^7.1.7" - is-glob "^4.0.1" - resolve "^1.20.0" - tsconfig-paths "^3.9.0" + debug "^4.3.4" + glob "^7.2.0" + is-glob "^4.0.3" + resolve "^1.22.0" + tsconfig-paths "^3.14.1" eslint-module-utils@^2.7.2: version "2.7.3" @@ -3940,7 +3940,7 @@ glob-to-regexp@^0.4.1: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7: +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7, glob@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== @@ -5057,11 +5057,9 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= json5@2.x, json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" + version "2.2.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" + integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== json5@^1.0.1: version "1.0.1" @@ -5275,16 +5273,16 @@ lodash@^4.11.2, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.7.0: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log4js@^6.4.3: - version "6.4.3" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.4.3.tgz#8bddd981846873895bcc55c0961560c7214a8ad7" - integrity sha512-H/oQKcCVIhQ8zCtUh5aftdp9eRpGyVB1M5sKzAJ0i10q5jS+YXk133vtLgzT1RIoWMbIn7QD1LUto8a1hqh6gA== +log4js@^6.4.4: + version "6.4.4" + resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.4.4.tgz#c9bc75569f3f40bba22fe1bd0677afa7a6a13bac" + integrity sha512-ncaWPsuw9Vl1CKA406hVnJLGQKy1OHx6buk8J4rE2lVW+NW5Y82G5/DIloO7NkqLOUtNPEANaWC1kZYVjXssPw== dependencies: - date-format "^4.0.5" - debug "^4.3.3" + date-format "^4.0.6" + debug "^4.3.4" flatted "^3.2.5" rfdc "^1.3.0" - streamroller "^3.0.5" + streamroller "^3.0.6" lower-case@^1.1.1: version "1.1.4" @@ -5463,10 +5461,10 @@ minimist-options@4.1.0: is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@>=1.2.2, minimist@^1.2.0, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== +minimist@>=1.2.2, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== minipass-collect@^1.0.2: version "1.0.2" @@ -5555,11 +5553,11 @@ mkdirp-infer-owner@^2.0.0: mkdirp "^1.0.3" mkdirp@^0.5.1, mkdirp@^0.5.5: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== dependencies: - minimist "^1.2.5" + minimist "^1.2.6" mkdirp@^1.0.3, mkdirp@^1.0.4: version "1.0.4" @@ -6589,7 +6587,7 @@ resolve.exports@^1.1.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@^1.10.0, resolve@^1.20.0, resolve@^1.9.0: +resolve@^1.10.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.9.0: version "1.22.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== @@ -6993,13 +6991,13 @@ standard-version@^9.3.2: stringify-package "^1.0.1" yargs "^16.0.0" -streamroller@^3.0.5: - version "3.0.5" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.0.5.tgz#17e348dc2a662f9f325373549ab91d55316051ab" - integrity sha512-5uzTEUIi4OB5zy/H30kbUN/zpDNJsFUA+Z47ZL8EfrP93lcZvRLEqdbhdunEPa7CouuAzXXsHpCJ9dg90Umw7g== +streamroller@^3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.0.6.tgz#52823415800ded79a49aa3f7712f50a422b97493" + integrity sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg== dependencies: - date-format "^4.0.5" - debug "^4.3.3" + date-format "^4.0.6" + debug "^4.3.4" fs-extra "^10.0.1" strict-uri-encode@^2.0.0: @@ -7385,14 +7383,14 @@ ts-node@^10.2.1, ts-node@^10.7.0: v8-compile-cache-lib "^3.0.0" yn "3.1.1" -tsconfig-paths@^3.12.0, tsconfig-paths@^3.9.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.0.tgz#4fcc48f9ccea8826c41b9ca093479de7f5018976" - integrity sha512-cg/1jAZoL57R39+wiw4u/SCC6Ic9Q5NqjBOb+9xISedOYurfog9ZNmKJSxAnb2m/5Bq4lE9lhUcau33Ml8DM0g== +tsconfig-paths@^3.12.0, tsconfig-paths@^3.14.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" + integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== dependencies: "@types/json5" "^0.0.29" json5 "^1.0.1" - minimist "^1.2.0" + minimist "^1.2.6" strip-bom "^3.0.0" tslib@^1.8.1, tslib@^1.9.0: @@ -8045,9 +8043,9 @@ yargs@^16.0.0, yargs@^16.2.0: yargs-parser "^20.2.2" yargs@^17.1.1: - version "17.3.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.3.1.tgz#da56b28f32e2fd45aefb402ed9c26f42be4c07b9" - integrity sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA== + version "17.4.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.4.0.tgz#9fc9efc96bd3aa2c1240446af28499f0e7593d00" + integrity sha512-WJudfrk81yWFSOkZYpAZx4Nt7V4xp7S/uJkX0CnxovMCt1wCE8LNftPpNuF9X/u9gN5nsD7ycYtRcDf2pL3UiA== dependencies: cliui "^7.0.2" escalade "^3.1.1" From 64432553218c4b75997bdabf6bfcfd496090bc7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Mar 2022 18:19:06 +0000 Subject: [PATCH 08/32] chore(deps): Bump peter-evans/create-pull-request from 3 to 4 (#3439) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 3 to 4.
Release notes

Sourced from peter-evans/create-pull-request's releases.

Create Pull Request v4.0.0

Breaking changes

  • The add-paths input no longer accepts -A as a valid value. When committing all new and modified files the add-paths input should be omitted.
  • If using self-hosted runners or GitHub Enterprise Server, there are minimum requirements for v4 to run. See "What's new" below for details.

What's new

  • Updated runtime to Node.js 16
    • The action now requires a minimum version of v2.285.0 for the Actions Runner.
    • If using GitHub Enterprise Server, the action requires GHES 3.4 or later.

What's Changed

New Contributors

Full Changelog: https://github.com/peter-evans/create-pull-request/compare/v3.14.0...v4.0.0

Create Pull Request v3.14.0

This release reverts a commit made to bump the runtime to node 16. It inadvertently caused an issue for users on GitHub Enterprise. Apologies. 🙇‍♂️

What's Changed

Full Changelog: https://github.com/peter-evans/create-pull-request/compare/v3.13.0...v3.14.0

Create Pull Request v3.13.0

What's Changed

New Contributors

Full Changelog: https://github.com/peter-evans/create-pull-request/compare/v3.12.1...v3.13.0

Create Pull Request v3.12.1

What's Changed

New Contributors

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=peter-evans/create-pull-request&package-manager=github_actions&previous-version=3&new-version=4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/yarn-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/yarn-upgrade.yml b/.github/workflows/yarn-upgrade.yml index a011507f43..9cc12c7fe9 100644 --- a/.github/workflows/yarn-upgrade.yml +++ b/.github/workflows/yarn-upgrade.yml @@ -127,7 +127,7 @@ jobs: run: '[ -s ${{ runner.temp }}/upgrade.patch ] && git apply ${{ runner.temp }}/upgrade.patch || echo "Empty patch. Skipping."' - name: Make Pull Request - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: # Git commit details author: 'AWS CDK Automation ' From 3274b6cb8c5a025c8877343423c1f101029ea0a5 Mon Sep 17 00:00:00 2001 From: andyan Date: Fri, 25 Mar 2022 02:41:58 +0800 Subject: [PATCH 09/32] fix: typo "though" -> "through" (#3419) --- 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 --- gh-pages/content/overview/runtime-architecture.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gh-pages/content/overview/runtime-architecture.md b/gh-pages/content/overview/runtime-architecture.md index 291eeffdab..b625de6dc2 100644 --- a/gh-pages/content/overview/runtime-architecture.md +++ b/gh-pages/content/overview/runtime-architecture.md @@ -101,7 +101,7 @@ describing the process arrangement that achieves this: !!! bug "Missing Feature" As shown on the diagram above, there is nothing connected to the *Core* process' `FD#0` (`STDIN`). This feature will be added in the future, but - currently this means *jsii* libraries have no way of accepting input though + currently this means *jsii* libraries have no way of accepting input through `STDIN`. The *Wrapper* process manages the *Core* process such that: From 3dfbd725385124909cb49e5a749704c4c331911e Mon Sep 17 00:00:00 2001 From: Chris Garvis Date: Thu, 24 Mar 2022 19:27:03 -0400 Subject: [PATCH 10/32] chore(docs): fix link to specification and adrs on homepage (#3442) --- gh-pages/content/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gh-pages/content/index.md b/gh-pages/content/index.md index fddae9b4f7..1820862bba 100644 --- a/gh-pages/content/index.md +++ b/gh-pages/content/index.md @@ -93,8 +93,8 @@ header bar: - The [Language Implementation](user-guides/language-support) is intended for developers who are looking to add support for a new *target language* in *jsii*. -- The [Specification](specification) provides detailed information on the internal components of *jsii*. -- The [Architecture Decision Records](adrs) contains the log of all architectural decisions made while developing the +- The [Specification](specification/1-introduction) provides detailed information on the internal components of *jsii*. +- The [Architecture Decision Records](decisions/introduction) contains the log of all architectural decisions made while developing the *jsii* project. ## How to contribute From 402bf7f92282ad372d516df5bec3f6f3b57f0a91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Mar 2022 11:06:39 +0000 Subject: [PATCH 11/32] chore(deps-dev): Bump mypy in /packages/jsii-pacmak/test/generated-code Bumps [mypy](https://github.com/python/mypy) from 0.941 to 0.942. - [Release notes](https://github.com/python/mypy/releases) - [Commits](https://github.com/python/mypy/compare/v0.941...v0.942) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/jsii-pacmak/test/generated-code/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jsii-pacmak/test/generated-code/requirements-dev.txt b/packages/jsii-pacmak/test/generated-code/requirements-dev.txt index 78c3042d5d..2f3b421b72 100644 --- a/packages/jsii-pacmak/test/generated-code/requirements-dev.txt +++ b/packages/jsii-pacmak/test/generated-code/requirements-dev.txt @@ -1 +1 @@ -mypy==0.941 +mypy==0.942 From 3a9ec9eb87d383d029b30948e0eef3be0d64bd38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 00:12:17 +0000 Subject: [PATCH 12/32] chore(deps-dev): Update mkdocs requirement from ~=1.2.3 to ~=1.3.0 in /gh-pages (#3446) Updates the requirements on [mkdocs](https://github.com/mkdocs/mkdocs) to permit the latest version.
Release notes

Sourced from mkdocs's releases.

1.3.0

Feature upgrades

  • ReadTheDocs theme updated from v0.4.1 to v1.0.0 according to upstream (#2585)

    The most notable changes:

    • New option logo: Rather than displaying the site_name in the title, one can specify a path to an image to display instead.
    • New option anonymize_ip for Google Analytics.
    • Dependencies were upgraded: jQuery upgraded to 3.6.0, Modernizr.js dropped, and others.

    See documentation of config options for the theme

  • Built-in themes now also support these languages:

  • Support custom directories to watch when running mkdocs serve (#2642)

    MkDocs by default watches the docs directory and the config file. Now there is a way to add more directories to watch for changes, either via the YAML watch key or the command line flag --watch.

    Normally MkDocs never reaches into any other directories (so this feature shouldn't be necessary), but some plugins and extensions may do so.

    See documentation.

  • New --no-history option for gh_deploy (#2594)

    Allows to discard the history of commits when deploying, and instead replace it with one root commit

Bug fixes

  • An XSS vulnerability when using the search function in built-in themes was fixed (#2791)

  • Setting the edit_uri option no longer erroneously adds a trailing slash to repo_url (#2733)

Miscellaneous

  • Breaking change: the pages config option that was deprecated for a very long time now causes an error when used (#2652)

    To fix the error, just change from pages to nav.

  • Performance optimization: during startup of MkDocs, code and dependencies of other commands will not be imported (#2714)

    The most visible effect of this is that dependencies of mkdocs serve will not be imported when mkdocs build is used.

  • Recursively validate nav (#2680)

    Validation of the nested nav structure has been reworked to report errors early and reliably. Some edge cases have been declared invalid.

Other small improvements; see commit log.

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- gh-pages/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gh-pages/requirements-dev.txt b/gh-pages/requirements-dev.txt index 9d3d93db14..434a6c39e3 100644 --- a/gh-pages/requirements-dev.txt +++ b/gh-pages/requirements-dev.txt @@ -1,4 +1,4 @@ -mkdocs~=1.2.3 +mkdocs~=1.3.0 mkdocs-awesome-pages-plugin~=2.7.0 mkdocs-material~=8.2.5 mkdocs-git-revision-date-plugin~=0.3.2 From a858962797d0caa85fe97567f3c48741c307e06b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 01:26:19 +0000 Subject: [PATCH 13/32] chore(deps-dev): Update mkdocs-material requirement from ~=8.2.5 to ~=8.2.8 in /gh-pages (#3447) Updates the requirements on [mkdocs-material](https://github.com/squidfunk/mkdocs-material) to permit the latest version.
Release notes

Sourced from mkdocs-material's releases.

mkdocs-material-8.2.8

  • Bumped MkDocs version to 1.3.0 to mitigate breaking changes in Jinja
  • Reverted Jinja version range limitation (added in 8.2.7)
  • Improved styling of annotations and fixed borders of code blocks in tabs
  • Added background color to code blocks in focused/hovered links
  • Added check in tags plugin whether tags overview page exists
  • Fixed #3744: Content tab indicator on wrong position when using back button
Changelog

Sourced from mkdocs-material's changelog.

mkdocs-material-8.2.8+insiders-4.12.0 (2022-03-27)

  • Added support for card grids and grid layouts
  • Fixed #3685: Annotations sometimes broken when using instant loading
  • Fixed #3742: Automatically add Mermaid.js when building for offline usage

mkdocs-material-8.2.8 (2022-03-27)

  • Bumped MkDocs version to 1.3.0 to mitigate breaking changes in Jinja
  • Reverted Jinja version range limitation (added in 8.2.7)
  • Improved styling of annotations and fixed borders of code blocks in tabs
  • Added background color to code blocks in focused/hovered links
  • Added check in tags plugin whether tags overview page exists
  • Fixed #3744: Content tab indicator on wrong position when using back button

mkdocs-material-8.2.7 (2022-03-24)

  • Temporarily limit Jinja version range to < 3.1 due to breaking changes

mkdocs-material-8.2.6 (2022-03-23)

  • Fixed #3695: Deprecation warning for unescaped backslashes in templates
  • Fixed #3696: Annotations not mounted in some Terraform code blocks
  • Fixed #3698: Annotations not mounted in long code blocks (8.2.5 regression)

mkdocs-material-8.2.5+insiders-4.11.0 (2022-03-06)

  • Added support for excluding external assets from privacy plugin

mkdocs-material-8.2.5 (2022-03-06)

  • Fixed #3596: Mermaid not working when headline with name 'Mermaid' present
  • Fixed #3643: Reduce time to render pages with thousands of code blocks
  • Fixed #3665: Missing styles for Mermaid.js flowcharts cluster labels

mkdocs-material-8.2.4+insiders-4.10.1 (2022-03-02)

  • Added missing build dependencies to Dockerfile
  • Fixed encoding issues in privacy plugin, now forcing UTF-8 encoding
  • Fixed #3624: Scroll to active navigation item unreliable in Firefox
  • Fixed #3642: Privacy plugin errors when font setting was omitted

mkdocs-material-8.2.4 (2022-03-02)

  • Fixed malformed Google Fonts URL when a font setting was omitted
  • Fixed #3648: Fixed specificity issue with admonitions in lists
  • Fixed #3653: Invalid outdated version banner URL when using instant loading

mkdocs-material-8.2.3+insiders-4.10.0 (2022-02-27)

... (truncated)

Commits
  • ce43e6a Prepare 8.2.8 release
  • e96f07a Added documentation for card grids
  • 7418e79 Updated screenshot
  • 7b1d1cc Bump ansi-regex from 4.1.0 to 4.1.1 (#3769)
  • c9f92b9 Reverted pinning of Jinja2 version
  • 6b91c8d Added background color to code blocks in hovered links
  • 71dd84a Improved styling of code annotations and fixed borders of code blocks in tabs
  • c7cc8f0 Formatting
  • dfba03f Raise error in tags plugin when tags file does not exist
  • 6322ece Merge branch 'master' of github.com:squidfunk/mkdocs-material
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- gh-pages/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gh-pages/requirements-dev.txt b/gh-pages/requirements-dev.txt index 434a6c39e3..2ba97549c5 100644 --- a/gh-pages/requirements-dev.txt +++ b/gh-pages/requirements-dev.txt @@ -1,4 +1,4 @@ mkdocs~=1.3.0 mkdocs-awesome-pages-plugin~=2.7.0 -mkdocs-material~=8.2.5 +mkdocs-material~=8.2.8 mkdocs-git-revision-date-plugin~=0.3.2 From 5b4b852c4550782d4f9777cbca7a65264bea49fe Mon Sep 17 00:00:00 2001 From: Yathi <511386+yuth@users.noreply.github.com> Date: Tue, 29 Mar 2022 11:53:51 -0700 Subject: [PATCH 14/32] feat: drop internal functions from Deprecation Error stack trace (#3426) JSII can throw Deprecation Error and fail compilation when a deprecated property, enum or method is being used when `JSII_DEPRECATED` environment variable is set to `fail`. The deprecation error is throw from `.warnings.jsii.js` generated file. When nested prop of enum is deprecated, the stack trace will contain lot of methods from `.warnings.jsii.js` and since the file is minimized, tools like Jest which try to be helpful by printing the line where the error is thrown shows a wall of text without much useful information. --- 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 --- .../lib/transforms/deprecation-warnings.ts | 299 ++++++++-- .../jsii/test/deprecation-warnings.test.ts | 515 ++++++++++++++++-- 2 files changed, 696 insertions(+), 118 deletions(-) diff --git a/packages/jsii/lib/transforms/deprecation-warnings.ts b/packages/jsii/lib/transforms/deprecation-warnings.ts index 6b19e65391..294ab34a36 100644 --- a/packages/jsii/lib/transforms/deprecation-warnings.ts +++ b/packages/jsii/lib/transforms/deprecation-warnings.ts @@ -13,6 +13,8 @@ const PARAMETER_NAME = 'p'; const NAMESPACE = 'jsiiDeprecationWarnings'; const LOCAL_ENUM_NAMESPACE = 'ns'; const VISITED_OBJECTS_SET_NAME = 'visitedObjects'; +const DEPRECATION_ERROR = 'DeprecationError'; +const GET_PROPERTY_DESCRIPTOR = 'getPropertyDescriptor'; export class DeprecationWarningsInjector { private transformers: ts.CustomTransformers = { @@ -34,35 +36,46 @@ export class DeprecationWarningsInjector { statements.push( ts.createExpressionStatement( ts.createCall( - ts.createIdentifier(`${VISITED_OBJECTS_SET_NAME}.add`), - [], + ts.createPropertyAccess( + ts.createIdentifier(VISITED_OBJECTS_SET_NAME), + 'add', + ), + undefined, [ts.createIdentifier(PARAMETER_NAME)], ), ), ); + const tryStatements = []; if (spec.isDeprecated(type) && spec.isEnumType(type)) { // The type is deprecated - statements.push( + tryStatements.push( createWarningFunctionCall(type.fqn, type.docs?.deprecated), ); isEmpty = false; } if (spec.isEnumType(type) && type.locationInModule?.filename) { - statements.push( + tryStatements.push( createEnumRequireStatement(type.locationInModule?.filename), ); - statements.push(createDuplicateEnumValuesCheck(type)); + tryStatements.push(createDuplicateEnumValuesCheck(type)); for (const member of Object.values(type.members ?? [])) { if (spec.isDeprecated(member)) { // The enum member is deprecated - const condition = ts.createIdentifier( - `${PARAMETER_NAME} === ${LOCAL_ENUM_NAMESPACE}.${type.name}.${member.name}`, + const condition = ts.createBinary( + ts.createIdentifier(PARAMETER_NAME), + ts.SyntaxKind.EqualsEqualsEqualsToken, + ts.createPropertyAccess( + ts.createPropertyAccess( + ts.createIdentifier(LOCAL_ENUM_NAMESPACE), + type.name, + ), + member.name, + ), ); - - statements.push( + tryStatements.push( createWarningFunctionCall( `${type.fqn}#${member.name}`, member.docs?.deprecated, @@ -78,26 +91,38 @@ export class DeprecationWarningsInjector { types, assembly, projectInfo, + undefined, + undefined, ); for (const [name, statement] of statementsByProp.entries()) { if (!excludedProps.has(name)) { - statements.push(statement); + tryStatements.push(statement); isEmpty = false; } } } + statements.push( - ts.createExpressionStatement( - ts.createCall( - ts.createIdentifier(`${VISITED_OBJECTS_SET_NAME}.delete`), - [], - [ts.createIdentifier(PARAMETER_NAME)], - ), + ts.createTry( + ts.createBlock(tryStatements), + undefined, + ts.createBlock([ + ts.createExpressionStatement( + ts.createCall( + ts.createPropertyAccess( + ts.createIdentifier(VISITED_OBJECTS_SET_NAME), + 'delete', + ), + undefined, + [ts.createIdentifier(PARAMETER_NAME)], + ), + ), + ]), ), ); - const parameter = ts.createParameter( + const paramValue = ts.createParameter( undefined, undefined, undefined, @@ -110,7 +135,7 @@ export class DeprecationWarningsInjector { undefined, functionName, undefined, - [parameter], + [paramValue], undefined, createFunctionBlock(isEmpty ? [] : statements), ); @@ -167,7 +192,12 @@ function processInterfaceType( const statement = createWarningFunctionCall( fqn, deprecatedDocs, - ts.createIdentifier(`"${prop.name}" in ${PARAMETER_NAME}`), + ts.createBinary( + ts.createStringLiteral(prop.name), + ts.SyntaxKind.InKeyword, + ts.createIdentifier(PARAMETER_NAME), + ), + undefined, ); statementsByProp.set(prop.name, statement); } else { @@ -254,7 +284,11 @@ function fnName(fqn: string): string { function createFunctionBlock(statements: ts.Statement[]): ts.Block { if (statements.length > 0) { const validation = ts.createIf( - ts.createIdentifier(`${PARAMETER_NAME} == null`), + ts.createBinary( + ts.createIdentifier(PARAMETER_NAME), + ts.SyntaxKind.EqualsEqualsToken, + ts.createNull(), + ), ts.createReturn(), ); return ts.createBlock([validation, ...statements], true); @@ -265,7 +299,7 @@ function createFunctionBlock(statements: ts.Statement[]): ts.Block { function createWarningFunctionCall( fqn: string, message = '', - condition?: ts.Identifier, + condition?: ts.Expression, includeNamespace = false, ): ts.Statement { const functionName = includeNamespace @@ -273,11 +307,10 @@ function createWarningFunctionCall( : WARNING_FUNCTION_NAME; const mainStatement = ts.createExpressionStatement( - ts.createCall( - ts.createIdentifier(functionName), - [], - [ts.createLiteral(fqn), ts.createLiteral(message)], - ), + ts.createCall(ts.createIdentifier(functionName), undefined, [ + ts.createLiteral(fqn), + ts.createLiteral(message), + ]), ); return condition ? ts.createIf(condition, mainStatement) : mainStatement; @@ -290,27 +323,54 @@ function generateWarningsFile( const names = [...functionDeclarations] .map((d) => d.name?.text) .filter(Boolean); - const exportedSymbols = [WARNING_FUNCTION_NAME, ...names].join(','); + const exportedSymbols = [ + WARNING_FUNCTION_NAME, + GET_PROPERTY_DESCRIPTOR, + DEPRECATION_ERROR, + ...names, + ].join(','); const functionText = `function ${WARNING_FUNCTION_NAME}(name, deprecationMessage) { const deprecated = process.env.JSII_DEPRECATED; const deprecationMode = ['warn', 'fail', 'quiet'].includes(deprecated) ? deprecated : 'warn'; - const message = \`\${name} is deprecated.\\n \${deprecationMessage}\\n This API will be removed in the next major release.\`; + const message = \`\${name} is deprecated.\\n \${deprecationMessage.trim()}\\n This API will be removed in the next major release.\`; switch (deprecationMode) { case "fail": - throw new DeprecationError(message); + throw new ${DEPRECATION_ERROR}(message); case "warn": console.warn("[WARNING]", message); break; } } -const ${VISITED_OBJECTS_SET_NAME} = new Set(); +function ${GET_PROPERTY_DESCRIPTOR}(obj, prop) { + const descriptor = Object.getOwnPropertyDescriptor(obj, prop); + if (descriptor) { + return descriptor; + } + const proto = Object.getPrototypeOf(obj); + const prototypeDescriptor = proto && getPropertyDescriptor(proto, prop); + if (prototypeDescriptor) { + return prototypeDescriptor; + } + return {}; +} + +const ${VISITED_OBJECTS_SET_NAME} = new WeakSet(); -class DeprecationError extends Error {} +class ${DEPRECATION_ERROR} extends Error { + constructor(...args) { + super(...args); + Object.defineProperty(this, 'name', { + configurable: false, + enumerable: true, + value: '${DEPRECATION_ERROR}', + writable: false, + }); + } +} module.exports = {${exportedSymbols}} -module.exports.DeprecationError = DeprecationError; `; const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); @@ -383,10 +443,16 @@ class Transformer { node.typeParameters, node.parameters, node.type, - ts.updateBlock( - node.body, - ts.createNodeArray([...statements, ...node.body.statements]), - ), + ts.updateBlock(node.body, [ + ...wrapWithRethrow( + statements, + ts.createPropertyAccess( + ts.createThis(), + node.name.getText(node.getSourceFile()), + ), + ), + ...node.body.statements, + ]), ) as any; } else if (ts.isGetAccessorDeclaration(node) && node.body != null) { const statements = this.getStatementsForDeclaration(node); @@ -399,10 +465,26 @@ class Transformer { node.name, node.parameters, node.type, - ts.updateBlock( - node.body, - ts.createNodeArray([...statements, ...node.body.statements]), - ), + ts.updateBlock(node.body, [ + ...wrapWithRethrow( + statements, + ts.createPropertyAccess( + ts.createCall( + ts.createPropertyAccess( + ts.createIdentifier(NAMESPACE), + GET_PROPERTY_DESCRIPTOR, + ), + undefined, + [ + ts.createThis(), + ts.createLiteral(node.name.getText(node.getSourceFile())), + ], + ), + 'get', + ), + ), + ...node.body.statements, + ]), ) as any; } else if (ts.isSetAccessorDeclaration(node) && node.body != null) { const statements = this.getStatementsForDeclaration(node); @@ -414,10 +496,26 @@ class Transformer { node.modifiers, node.name, node.parameters, - ts.updateBlock( - node.body, - ts.createNodeArray([...statements, ...node.body.statements]), - ), + ts.updateBlock(node.body, [ + ...wrapWithRethrow( + statements, + ts.createPropertyAccess( + ts.createCall( + ts.createPropertyAccess( + ts.createIdentifier(NAMESPACE), + GET_PROPERTY_DESCRIPTOR, + ), + undefined, + [ + ts.createThis(), + ts.createLiteral(node.name.getText(node.getSourceFile())), + ], + ), + 'set', + ), + ), + ...node.body.statements, + ]), ) as any; } else if (ts.isConstructorDeclaration(node) && node.body != null) { const statements = this.getStatementsForDeclaration(node); @@ -428,13 +526,26 @@ class Transformer { node.decorators, node.modifiers, node.parameters, - ts.updateBlock(node.body, insertStatements(node.body, statements)), + ts.updateBlock( + node.body, + insertStatements( + node.body, + wrapWithRethrow( + statements, + ts.createPropertyAccess(ts.createThis(), 'constructor'), + ), + ), + ), ) as any; } return this.visitEachChild(node); } + /** + * @param getOrSet for property accessors, determines which of the getter or + * setter should be used to get the caller function value. + */ private getStatementsForDeclaration( node: | ts.MethodDeclaration @@ -481,7 +592,6 @@ class Transformer { method: spec.Method | spec.Initializer, ) { const statements = createWarningStatementForElement(method, classType); - for (const parameter of Object.values(method.parameters ?? {})) { const parameterType = this.assembly.types && spec.isNamedTypeReference(parameter.type) @@ -492,11 +602,9 @@ class Transformer { const functionName = `${NAMESPACE}.${fnName(parameterType.fqn)}`; statements.push( ts.createExpressionStatement( - ts.createCall( - ts.createIdentifier(functionName), - [], - [ts.createIdentifier(parameter.name)], - ), + ts.createCall(ts.createIdentifier(functionName), undefined, [ + ts.createIdentifier(parameter.name), + ]), ), ); } @@ -615,14 +723,22 @@ function createTypeHandlerCall( parameter: string, ): ts.Statement { return ts.createIf( - ts.createIdentifier(`!${VISITED_OBJECTS_SET_NAME}.has(${parameter})`), - ts.createExpressionStatement( + ts.createPrefix( + ts.SyntaxKind.ExclamationToken, ts.createCall( - ts.createIdentifier(functionName), - [], + ts.createPropertyAccess( + ts.createIdentifier(VISITED_OBJECTS_SET_NAME), + ts.createIdentifier('has'), + ), + undefined, [ts.createIdentifier(parameter)], ), ), + ts.createExpressionStatement( + ts.createCall(ts.createIdentifier(functionName), undefined, [ + ts.createIdentifier(parameter), + ]), + ), ); } @@ -646,9 +762,16 @@ function createDuplicateEnumValuesCheck( ts.createPropertyAccess( ts.createCall( ts.createPropertyAccess( - ts.createCall(ts.createIdentifier('Object.values'), undefined, [ - ts.createIdentifier(`${LOCAL_ENUM_NAMESPACE}.${type.name}`), - ]), + ts.createCall( + ts.createPropertyAccess(ts.createIdentifier('Object'), 'values'), + undefined, + [ + ts.createPropertyAccess( + ts.createIdentifier(LOCAL_ENUM_NAMESPACE), + type.name, + ), + ], + ), ts.createIdentifier('filter'), ), undefined, @@ -676,6 +799,66 @@ function createDuplicateEnumValuesCheck( ); } +// We try-then-rethrow exceptions to avoid runtimes displaying an uncanny wall of text if the place +// where the error was thrown is webpacked. For example, jest somehow manages to capture the throw +// location and renders the source line (which may be the whole file) when bundled. +function wrapWithRethrow( + statements: ts.Statement[], + caller: ts.Expression, +): ts.Statement[] { + if (statements.length === 0) { + return statements; + } + return [ + ts.createTry( + ts.createBlock(statements), + ts.createCatchClause( + ts.createVariableDeclaration('error'), + ts.createBlock([ + // If this is a DeprecationError, trim its stack trace to surface level before re-throwing, + // so we don't carry out possibly confusing frames from injected code. That can be toggled + // off by setting JSII_DEBUG=1, so we can also diagnose in-injected code faults. + ts.createIf( + ts.createBinary( + ts.createBinary( + ts.createPropertyAccess( + ts.createPropertyAccess( + ts.createIdentifier('process'), + 'env', + ), + 'JSII_DEBUG', + ), + ts.SyntaxKind.ExclamationEqualsEqualsToken, + ts.createLiteral('1'), + ), + ts.SyntaxKind.AmpersandAmpersandToken, + ts.createBinary( + ts.createPropertyAccess(ts.createIdentifier('error'), 'name'), + ts.SyntaxKind.EqualsEqualsEqualsToken, + ts.createLiteral(DEPRECATION_ERROR), + ), + ), + ts.createBlock([ + ts.createExpressionStatement( + ts.createCall( + ts.createPropertyAccess( + ts.createIdentifier('Error'), + 'captureStackTrace', + ), + undefined, + [ts.createIdentifier('error'), caller], + ), + ), + ]), + ), + ts.createThrow(ts.createIdentifier('error')), + ]), + ), + undefined, + ), + ]; +} + /** * Force a path to be UNIXy (use `/` as a separator) * diff --git a/packages/jsii/test/deprecation-warnings.test.ts b/packages/jsii/test/deprecation-warnings.test.ts index 668d9a9e04..dc7fde7210 100644 --- a/packages/jsii/test/deprecation-warnings.test.ts +++ b/packages/jsii/test/deprecation-warnings.test.ts @@ -1,6 +1,7 @@ // eslint-disable-next-line import/no-extraneous-dependencies import * as fs from 'fs'; import * as path from 'path'; +import * as vm from 'vm'; import { compileJsiiForTest, HelperCompilationResult } from '../lib'; import { Compiler } from '../lib/compiler'; @@ -14,11 +15,11 @@ describe('Function generation', () => { addDeprecationWarnings: true, }); - expect(jsFile(result, '.warnings.jsii')).toMatch( + expect(jsFile(result, '.warnings.jsii')).toBe( `function print(name, deprecationMessage) { const deprecated = process.env.JSII_DEPRECATED; const deprecationMode = ["warn", "fail", "quiet"].includes(deprecated) ? deprecated : "warn"; - const message = \`\${name} is deprecated.\\n \${deprecationMessage}\\n This API will be removed in the next major release.\`; + const message = \`\${name} is deprecated.\\n \${deprecationMessage.trim()}\\n This API will be removed in the next major release.\`; switch (deprecationMode) { case "fail": throw new DeprecationError(message); @@ -27,11 +28,31 @@ describe('Function generation', () => { break; } } -const visitedObjects = new Set(); +function getPropertyDescriptor(obj, prop) { + const descriptor = Object.getOwnPropertyDescriptor(obj, prop); + if (descriptor) { + return descriptor; + } + const proto = Object.getPrototypeOf(obj); + const prototypeDescriptor = proto && getPropertyDescriptor(proto, prop); + if (prototypeDescriptor) { + return prototypeDescriptor; + } + return {}; +} +const visitedObjects = new WeakSet(); class DeprecationError extends Error { + constructor(...args) { + super(...args); + Object.defineProperty(this, "name", { + configurable: false, + enumerable: true, + value: "DeprecationError", + writable: false, + }); + } } -module.exports = { print }; -module.exports.DeprecationError = DeprecationError; +module.exports = { print, getPropertyDescriptor, DeprecationError }; `, ); }); @@ -91,11 +112,15 @@ function testpkg_Baz(p) { if (p == null) return; visitedObjects.add(p); - if (!visitedObjects.has(p.bar)) - testpkg_Bar(p.bar); - if (!visitedObjects.has(p.foo)) - testpkg_Foo(p.foo); - visitedObjects.delete(p); + try { + if (!visitedObjects.has(p.bar)) + testpkg_Bar(p.bar); + if (!visitedObjects.has(p.foo)) + testpkg_Foo(p.foo); + } + finally { + visitedObjects.delete(p); + } }`); }); @@ -143,9 +168,13 @@ function testpkg_Baz(p) { if (p == null) return; visitedObjects.add(p); - if (!visitedObjects.has(p.bar)) - testpkg_Bar(p.bar); - visitedObjects.delete(p); + try { + if (!visitedObjects.has(p.bar)) + testpkg_Bar(p.bar); + } + finally { + visitedObjects.delete(p); + } }`, ); }); @@ -162,7 +191,7 @@ function testpkg_Baz(p) { ); expect(jsFile(result, '.warnings.jsii')).toMatch( - `module.exports = { print, testpkg_Foo, testpkg_Bar, testpkg_Baz };`, + `module.exports = { print, getPropertyDescriptor, DeprecationError, testpkg_Foo, testpkg_Bar, testpkg_Baz };`, ); }); @@ -185,12 +214,16 @@ function testpkg_Baz(p) { if (p == null) return; visitedObjects.add(p); - const ns = require("./index.js"); - if (Object.values(ns.State).filter(x => x === p).length > 1) - return; - if (p === ns.State.OFF) - print("testpkg.State#OFF", "Use something else"); - visitedObjects.delete(p); + try { + const ns = require("./index.js"); + if (Object.values(ns.State).filter(x => x === p).length > 1) + return; + if (p === ns.State.OFF) + print("testpkg.State#OFF", "Use something else"); + } + finally { + visitedObjects.delete(p); + } } `); }); @@ -220,17 +253,25 @@ function testpkg_Baz(p) { if (p == null) return; visitedObjects.add(p); - if ("x" in p) - print("testpkg.Baz#x", "message from Baz"); - visitedObjects.delete(p); + try { + if ("x" in p) + print("testpkg.Baz#x", "message from Baz"); + } + finally { + visitedObjects.delete(p); + } }`); expect(warningsFileContent).toMatch(`function testpkg_Bar(p) { if (p == null) return; visitedObjects.add(p); - if ("x" in p) - print("testpkg.Bar#x", "message from Bar"); - visitedObjects.delete(p); + try { + if ("x" in p) + print("testpkg.Bar#x", "message from Bar"); + } + finally { + visitedObjects.delete(p); + } }`); // But a call for one of the instances of the property should also be generated in the base function @@ -238,9 +279,13 @@ function testpkg_Baz(p) { if (p == null) return; visitedObjects.add(p); - if ("x" in p) - print("testpkg.Baz#x", "message from Baz"); - visitedObjects.delete(p); + try { + if ("x" in p) + print("testpkg.Baz#x", "message from Baz"); + } + finally { + visitedObjects.delete(p); + } }`); }); @@ -289,11 +334,15 @@ function testpkg_Baz(p) { if (p == null) return; visitedObjects.add(p); - if ("bar" in p) - print("testpkg.Foo#bar", "kkkkkkkk"); - if (!visitedObjects.has(p.bar)) - testpkg_Bar(p.bar); - visitedObjects.delete(p); + try { + if ("bar" in p) + print("testpkg.Foo#bar", "kkkkkkkk"); + if (!visitedObjects.has(p.bar)) + testpkg_Bar(p.bar); + } + finally { + visitedObjects.delete(p); + } } `); }); @@ -315,11 +364,15 @@ function testpkg_Baz(p) { if (p == null) return; visitedObjects.add(p); - if ("bar" in p) - print("testpkg.Foo#bar", "use Bar instead"); - if ("baz" in p) - print("testpkg.Foo#baz", "use Bar instead"); - visitedObjects.delete(p); + try { + if ("bar" in p) + print("testpkg.Foo#bar", "use Bar instead"); + if ("baz" in p) + print("testpkg.Foo#baz", "use Bar instead"); + } + finally { + visitedObjects.delete(p); + } } `); }); @@ -420,26 +473,66 @@ describe('Call injections', () => { { addDeprecationWarnings: true }, ); - expect(jsFile(result)).toMatch( - 'bar() { jsiiDeprecationWarnings.print("testpkg.Foo#bar", "Use something else"); }', - ); + expect(jsFile(result)).toMatchInlineSnapshot(` + "\\"use strict\\"; + var _a; + Object.defineProperty(exports, \\"__esModule\\", { value: true }); + exports.Foo = void 0; + const jsiiDeprecationWarnings = require(\\"./.warnings.jsii.js\\"); + const JSII_RTTI_SYMBOL_1 = Symbol.for(\\"jsii.rtti\\"); + class Foo { + /** @deprecated Use something else */ + bar() { try { + jsiiDeprecationWarnings.print(\\"testpkg.Foo#bar\\", \\"Use something else\\"); + } + catch (error) { + if (process.env.JSII_DEBUG !== \\"1\\" && error.name === \\"DeprecationError\\") { + Error.captureStackTrace(error, this.bar); + } + throw error; + } } + } + exports.Foo = Foo; + _a = JSII_RTTI_SYMBOL_1; + Foo[_a] = { fqn: \\"testpkg.Foo\\", version: \\"0.0.1\\" }; + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFDSSxNQUFhLEdBQUc7SUFDZCxxQ0FBcUM7SUFDOUIsR0FBRzs7Ozs7Ozs7T0FBSTs7QUFGaEIsa0JBR0MiLCJzb3VyY2VzQ29udGVudCI6WyJcbiAgICBleHBvcnQgY2xhc3MgRm9vIHtcbiAgICAgIC8qKiBAZGVwcmVjYXRlZCBVc2Ugc29tZXRoaW5nIGVsc2UgKi9cbiAgICAgIHB1YmxpYyBiYXIoKXt9XG4gICAgfVxuICAiXX0=" + `); }); test('methods with parameters', async () => { const result = await compileJsiiForTest( ` - export interface A {readonly x: number;} - export class Foo { - public bar(a: A, b: number){return a.x + b;} - } - `, + export interface A {readonly x: number;} + export class Foo { + public bar(a: A, b: number){return a.x + b;} + }`, undefined /* callback */, { addDeprecationWarnings: true }, ); - expect(jsFile(result)).toMatch( - 'bar(a, b) { jsiiDeprecationWarnings.testpkg_A(a); return a.x + b; }', - ); + expect(jsFile(result)).toMatchInlineSnapshot(` + "\\"use strict\\"; + var _a; + Object.defineProperty(exports, \\"__esModule\\", { value: true }); + exports.Foo = void 0; + const jsiiDeprecationWarnings = require(\\"./.warnings.jsii.js\\"); + const JSII_RTTI_SYMBOL_1 = Symbol.for(\\"jsii.rtti\\"); + class Foo { + bar(a, b) { try { + jsiiDeprecationWarnings.testpkg_A(a); + } + catch (error) { + if (process.env.JSII_DEBUG !== \\"1\\" && error.name === \\"DeprecationError\\") { + Error.captureStackTrace(error, this.bar); + } + throw error; + } return a.x + b; } + } + exports.Foo = Foo; + _a = JSII_RTTI_SYMBOL_1; + Foo[_a] = { fqn: \\"testpkg.Foo\\", version: \\"0.0.1\\" }; + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFFUyxNQUFhLEdBQUc7SUFDUixHQUFHLENBQUMsQ0FBSSxFQUFFLENBQVM7Ozs7Ozs7O01BQUUsT0FBTyxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFDOztBQUQ3QyxrQkFFQyIsInNvdXJjZXNDb250ZW50IjpbIlxuICAgICAgICBleHBvcnQgaW50ZXJmYWNlIEEge3JlYWRvbmx5IHg6IG51bWJlcjt9XG4gICAgICAgICBleHBvcnQgY2xhc3MgRm9vIHtcbiAgICAgICAgICBwdWJsaWMgYmFyKGE6IEEsIGI6IG51bWJlcil7cmV0dXJuIGEueCArIGI7fVxuICAgICAgICAgfSJdfQ==" + `); }, 60000); test('deprecated getters', async () => { @@ -455,9 +548,33 @@ describe('Call injections', () => { { addDeprecationWarnings: true }, ); - expect(jsFile(result)).toMatch( - 'get x() { jsiiDeprecationWarnings.print("testpkg.Foo#x", "Use something else"); return this._x; }', - ); + expect(jsFile(result)).toMatchInlineSnapshot(` + "\\"use strict\\"; + var _a; + Object.defineProperty(exports, \\"__esModule\\", { value: true }); + exports.Foo = void 0; + const jsiiDeprecationWarnings = require(\\"./.warnings.jsii.js\\"); + const JSII_RTTI_SYMBOL_1 = Symbol.for(\\"jsii.rtti\\"); + class Foo { + constructor() { + this._x = 0; + } + /** @deprecated Use something else */ + get x() { try { + jsiiDeprecationWarnings.print(\\"testpkg.Foo#x\\", \\"Use something else\\"); + } + catch (error) { + if (process.env.JSII_DEBUG !== \\"1\\" && error.name === \\"DeprecationError\\") { + Error.captureStackTrace(error, jsiiDeprecationWarnings.getPropertyDescriptor(this, \\"x\\").get); + } + throw error; + } return this._x; } + } + exports.Foo = Foo; + _a = JSII_RTTI_SYMBOL_1; + Foo[_a] = { fqn: \\"testpkg.Foo\\", version: \\"0.0.1\\" }; + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFDSSxNQUFhLEdBQUc7SUFBaEI7UUFDVSxPQUFFLEdBQUcsQ0FBQyxDQUFDO0tBR2hCO0lBRkMscUNBQXFDO0lBQ3JDLElBQVcsQ0FBQzs7Ozs7Ozs7TUFBRyxPQUFPLElBQUksQ0FBQyxFQUFFLENBQUEsRUFBQzs7QUFIaEMsa0JBSUMiLCJzb3VyY2VzQ29udGVudCI6WyJcbiAgICBleHBvcnQgY2xhc3MgRm9vIHtcbiAgICAgIHByaXZhdGUgX3ggPSAwO1xuICAgICAgLyoqIEBkZXByZWNhdGVkIFVzZSBzb21ldGhpbmcgZWxzZSAqL1xuICAgICAgcHVibGljIGdldCB4KCl7cmV0dXJuIHRoaXMuX3h9XG4gICAgfVxuICAiXX0=" + `); }); test('deprecated setters', async () => { @@ -475,12 +592,45 @@ describe('Call injections', () => { { addDeprecationWarnings: true }, ); - expect(jsFile(result)).toMatch( - 'set x(_x) { jsiiDeprecationWarnings.print("testpkg.Foo#x", "Use something else"); this._x = _x; }', - ); + expect(jsFile(result)).toMatchInlineSnapshot(` + "\\"use strict\\"; + var _a; + Object.defineProperty(exports, \\"__esModule\\", { value: true }); + exports.Foo = void 0; + const jsiiDeprecationWarnings = require(\\"./.warnings.jsii.js\\"); + const JSII_RTTI_SYMBOL_1 = Symbol.for(\\"jsii.rtti\\"); + class Foo { + constructor() { + this._x = 0; + } + get x() { try { + jsiiDeprecationWarnings.print(\\"testpkg.Foo#x\\", \\"Use something else\\"); + } + catch (error) { + if (process.env.JSII_DEBUG !== \\"1\\" && error.name === \\"DeprecationError\\") { + Error.captureStackTrace(error, jsiiDeprecationWarnings.getPropertyDescriptor(this, \\"x\\").get); + } + throw error; + } return this._x; } + /** @deprecated Use something else */ + set x(_x) { try { + jsiiDeprecationWarnings.print(\\"testpkg.Foo#x\\", \\"Use something else\\"); + } + catch (error) { + if (process.env.JSII_DEBUG !== \\"1\\" && error.name === \\"DeprecationError\\") { + Error.captureStackTrace(error, jsiiDeprecationWarnings.getPropertyDescriptor(this, \\"x\\").set); + } + throw error; + } this._x = _x; } + } + exports.Foo = Foo; + _a = JSII_RTTI_SYMBOL_1; + Foo[_a] = { fqn: \\"testpkg.Foo\\", version: \\"0.0.1\\" }; + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFDSSxNQUFhLEdBQUc7SUFBaEI7UUFDVSxPQUFFLEdBQUcsQ0FBQyxDQUFDO0tBS2hCO0lBSkMsSUFBVyxDQUFDOzs7Ozs7OztNQUFHLE9BQU8sSUFBSSxDQUFDLEVBQUUsQ0FBQSxFQUFDO0lBRTlCLHFDQUFxQztJQUNyQyxJQUFXLENBQUMsQ0FBQyxFQUFVOzs7Ozs7OztNQUFHLElBQUksQ0FBQyxFQUFFLEdBQUcsRUFBRSxDQUFDLEVBQUM7O0FBTDFDLGtCQU1DIiwic291cmNlc0NvbnRlbnQiOlsiXG4gICAgZXhwb3J0IGNsYXNzIEZvbyB7XG4gICAgICBwcml2YXRlIF94ID0gMDtcbiAgICAgIHB1YmxpYyBnZXQgeCgpe3JldHVybiB0aGlzLl94fVxuXG4gICAgICAvKiogQGRlcHJlY2F0ZWQgVXNlIHNvbWV0aGluZyBlbHNlICovXG4gICAgICBwdWJsaWMgc2V0IHgoX3g6IG51bWJlcikge3RoaXMuX3ggPSBfeDt9XG4gICAgfVxuICAiXX0=" + `); }); - test('deprecated classes', async () => { + test('creates a new instance of error when test', async () => { const result = await compileJsiiForTest( ` ${DEPRECATED} @@ -492,9 +642,207 @@ describe('Call injections', () => { { addDeprecationWarnings: true }, ); - expect(jsFile(result)).toMatch( - 'constructor() { jsiiDeprecationWarnings.print("testpkg.Foo", "Use something else"); }', + expect(jsFile(result)).toMatchInlineSnapshot(` + "\\"use strict\\"; + var _a; + Object.defineProperty(exports, \\"__esModule\\", { value: true }); + exports.Foo = void 0; + const jsiiDeprecationWarnings = require(\\"./.warnings.jsii.js\\"); + const JSII_RTTI_SYMBOL_1 = Symbol.for(\\"jsii.rtti\\"); + /** @deprecated Use something else */ + class Foo { + constructor() { try { + jsiiDeprecationWarnings.print(\\"testpkg.Foo\\", \\"Use something else\\"); + } + catch (error) { + if (process.env.JSII_DEBUG !== \\"1\\" && error.name === \\"DeprecationError\\") { + Error.captureStackTrace(error, this.constructor); + } + throw error; + } } + } + exports.Foo = Foo; + _a = JSII_RTTI_SYMBOL_1; + Foo[_a] = { fqn: \\"testpkg.Foo\\", version: \\"0.0.1\\" }; + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFDSSxxQ0FBcUM7QUFDckMsTUFBYSxHQUFHO0lBQ2Q7Ozs7Ozs7O09BQWU7O0FBRGpCLGtCQUVDIiwic291cmNlc0NvbnRlbnQiOlsiXG4gICAgLyoqIEBkZXByZWNhdGVkIFVzZSBzb21ldGhpbmcgZWxzZSAqL1xuICAgIGV4cG9ydCBjbGFzcyBGb28ge1xuICAgICAgY29uc3RydWN0b3IoKXt9XG4gICAgfVxuICAiXX0=" + `); + }); +}); + +describe('thrown exceptions have the expected stack trace', () => { + test('constructor', async () => { + const compilation = await compileJsiiForTest( + ` + /** @deprecated for testing */ + export class DeprecatedConstructor { + public constructor() {} + } + + function test() { + new DeprecatedConstructor(); + } + + test(); + `, + undefined, + { addDeprecationWarnings: true }, + ); + const source = jsFile(compilation); + + const context = createVmContext(compilation); + try { + vm.runInContext(source, context, { filename: 'index.js' }); + // The above line should have resulted in a DeprecationError being thrown + expect(null).toBeInstanceOf(Error); + } catch (error) { + expect(error.stack.replace(process.cwd(), '')) + .toMatchInlineSnapshot(` + "index.js:16 + throw error; + ^ + + DeprecationError: testpkg.DeprecatedConstructor is deprecated. + for testing + This API will be removed in the next major release. + at test (index.js:23:5) + at index.js:25:1" + `); + } + }); + + test('getter', async () => { + const compilation = await compileJsiiForTest( + ` + export class DeprecatedConstructor { + /** @deprecated for testing */ + public get property() { + return 1337; + } + } + + function test() { + const subject = new DeprecatedConstructor(); + return subject.property; + } + + test(); + `, + undefined, + { addDeprecationWarnings: true }, + ); + const source = jsFile(compilation); + + const context = createVmContext(compilation); + try { + vm.runInContext(source, context, { filename: 'index.js' }); + // The above line should have resulted in a DeprecationError being thrown + expect(null).toBeInstanceOf(Error); + } catch (error) { + expect(error.stack.replace(process.cwd(), '')) + .toMatchInlineSnapshot(` + "index.js:17 + throw error; + ^ + + DeprecationError: testpkg.DeprecatedConstructor#property is deprecated. + for testing + This API will be removed in the next major release. + at test (index.js:27:20) + at index.js:29:1" + `); + } + }); + + test('setter', async () => { + const compilation = await compileJsiiForTest( + ` + export class DeprecatedConstructor { + private value = 1337; + + /** @deprecated for testing */ + public get property(): number { + return this.value; + } + + public set property(value: number) { + this.value = value; + } + } + + function test() { + const subject = new DeprecatedConstructor(); + subject.property = 42; + } + + test(); + `, + undefined, + { addDeprecationWarnings: true }, + ); + const source = jsFile(compilation); + + const context = createVmContext(compilation); + try { + vm.runInContext(source, context, { filename: 'index.js' }); + // The above line should have resulted in a DeprecationError being thrown + expect(null).toBeInstanceOf(Error); + } catch (error) { + expect(error.stack.replace(process.cwd(), '')) + .toMatchInlineSnapshot(` + "index.js:32 + throw error; + ^ + + DeprecationError: testpkg.DeprecatedConstructor#property is deprecated. + for testing + This API will be removed in the next major release. + at test (index.js:42:22) + at index.js:44:1" + `); + } + }); + + test('method', async () => { + const compilation = await compileJsiiForTest( + ` + export class DeprecatedConstructor { + /** @deprecated for testing */ + public deprecated(): void { + // Nothing to do + } + } + + function test() { + const subject = new DeprecatedConstructor(); + subject.deprecated(); + } + + test(); + `, + undefined, + { addDeprecationWarnings: true }, ); + const source = jsFile(compilation); + + const context = createVmContext(compilation); + try { + vm.runInContext(source, context, { filename: 'index.js' }); + // The above line should have resulted in a DeprecationError being thrown + expect(null).toBeInstanceOf(Error); + } catch (error) { + expect(error.stack.replace(process.cwd(), '')) + .toMatchInlineSnapshot(` + "index.js:17 + throw error; + ^ + + DeprecationError: testpkg.DeprecatedConstructor#deprecated is deprecated. + for testing + This API will be removed in the next major release. + at test (index.js:26:13) + at index.js:28:1" + `); + } }); }); @@ -503,7 +851,54 @@ function jsFile(result: HelperCompilationResult, baseName = 'index'): string { ([name]) => name === `${baseName}.js`, ); - return file![1]; + if (!file) { + throw new Error(`Could not find file with base name: ${baseName}`); + } + + return file[1]; +} + +function createVmContext(compilation: HelperCompilationResult) { + const context = vm.createContext({ + exports: {}, + process: { + env: { + JSII_DEPRECATED: 'fail', + }, + }, + // Bringing in a "fake" require(id) function that'll resolve relative paths + // to files within the compilation output, and module names using the + // regular require. When loading a file that was part of the compiler output, + // this emulates the situation that would be if the file had been through a + // bundler by turning all sequences of white spaces (new line included) into + // single spaces. + require: (id: string) => { + if (!id.startsWith('./')) { + // eslint-disable-next-line @typescript-eslint/no-require-imports + return require(id); + } + const code = jsFile(compilation, path.basename(id, '.js')) + // Pretend this has been webpack'd + .replace(/\s+/gm, ' '); + return vm.runInContext( + `(function(module){ + { + ${code} + } + return module.exports; + })({ exports: {} });`, + context, + { filename: id, lineOffset: -2, columnOffset: -4 }, + ); + }, + }); + + // Limit error stack traces to 2 frames... We don't need more for the sake of this test. This is + // important because past 2 levels, the stack frames will have entries that will be different on + // different versions of node, and that'll break our unit tests... + vm.runInContext('Error.stackTraceLimit = 2;', context); + + return context; } function resolveModuleDir(name: string) { From 54cebaa188a132ab764e2167c9ec5f9042588b47 Mon Sep 17 00:00:00 2001 From: Romain Marcadier Date: Tue, 29 Mar 2022 13:27:44 -0700 Subject: [PATCH 15/32] fix(rosetta): incorrect transliteration of map keys in python (#3449) The Python transliterator failed to properly account for maps when transliterating keys, resulting in name-mangling being applied on these when it should not have been. This PR adds a new `inMap` context entry to track whether a property assignment must be interpreted as a map key-value entry, or an actual keyword/value mapping; and in that case circumvents the mangling. Added a new test to verify that such map literals render appropriately using a key similar to that which caused #3448. Fixes #3448 --- 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 --- .all-contributorsrc | 9 +++++ README.md | 1 + .../__snapshots__/target-python.test.ts.snap | 3 +- packages/jsii-rosetta/lib/languages/python.ts | 37 +++++++++++++------ .../translations/expressions/map-literal.cs | 3 ++ .../translations/expressions/map-literal.go | 3 ++ .../translations/expressions/map-literal.java | 2 + .../translations/expressions/map-literal.py | 3 ++ .../translations/expressions/map-literal.ts | 3 ++ 9 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 packages/jsii-rosetta/test/translations/expressions/map-literal.cs create mode 100644 packages/jsii-rosetta/test/translations/expressions/map-literal.go create mode 100644 packages/jsii-rosetta/test/translations/expressions/map-literal.java create mode 100644 packages/jsii-rosetta/test/translations/expressions/map-literal.py create mode 100644 packages/jsii-rosetta/test/translations/expressions/map-literal.ts diff --git a/.all-contributorsrc b/.all-contributorsrc index ad598a8355..e351eece00 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1339,6 +1339,15 @@ "contributions": [ "bug" ] + }, + { + "login": "wendysophie", + "name": "wendysophie", + "avatar_url": "https://avatars.githubusercontent.com/u/54415551?v=4", + "profile": "https://github.com/wendysophie", + "contributions": [ + "bug" + ] } ], "repoType": "github", diff --git a/README.md b/README.md index 53df719a0c..b138de9f87 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
sullis

💻
vaneek

🐛 +
wendysophie

🐛 diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap index 806b543cfa..ffa402e6de 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap @@ -4544,8 +4544,7 @@ class DocumentedClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DocumentedCl x = 12 + 44 s1 = "string" - s2 = """string - with new newlines""" # see https://github.com/aws/jsii/issues/2569 + s2 = "string \\nwith new newlines" # see https://github.com/aws/jsii/issues/2569 s3 = """string with new lines""" diff --git a/packages/jsii-rosetta/lib/languages/python.ts b/packages/jsii-rosetta/lib/languages/python.ts index a42207ee0d..201ddd3fd0 100644 --- a/packages/jsii-rosetta/lib/languages/python.ts +++ b/packages/jsii-rosetta/lib/languages/python.ts @@ -72,6 +72,13 @@ interface PythonLanguageContext { */ readonly inClass?: boolean; + /** + * Whether the current property assignment is in the context of a map value. + * In this case, the keys should be strings (quoted where needed), and should + * not get mangled or case-converted. + */ + readonly inMap?: boolean; + /** * If we're in a method, what is it's name * @@ -415,7 +422,7 @@ export class PythonVisitor extends DefaultVisitor { } public keyValueObjectLiteralExpression(node: ts.ObjectLiteralExpression, context: PythonVisitorContext): OTree { - return this.renderObjectLiteralExpression('{', '}', false, node, context); + return this.renderObjectLiteralExpression('{', '}', false, node, context.updateContext({ inMap: true })); } public translateUnaryOperator(operator: ts.PrefixUnaryOperator) { @@ -451,19 +458,26 @@ export class PythonVisitor extends DefaultVisitor { const mid = context.currentContext.renderObjectLiteralAsKeywords ? '=' : ': '; // node.name is either an identifier or a string literal. The string literal - // needs to be converted differently. - let name = context.convert(node.name); - matchAst(node.name, nodeOfType('stringLiteral', ts.SyntaxKind.StringLiteral), (captured) => { - name = new OTree([mangleIdentifier(captured.stringLiteral.text)]); - }); + // needs to be converted differently depending on whether it needs to be a + // string or a keyword argument. + let name = ts.isStringLiteral(node.name) + ? new OTree([ + context.currentContext.inMap // If in map, don't mangle the keys + ? node.name.text + : mangleIdentifier(node.name.text), + ]) + : context.convert(node.name); // If this isn't a computed property, we must quote the key (unless it's rendered as a keyword) - if (!context.currentContext.renderObjectLiteralAsKeywords && !ts.isComputedPropertyName(node.name)) { + if ( + context.currentContext.inMap || + (!context.currentContext.renderObjectLiteralAsKeywords && !ts.isComputedPropertyName(node.name)) + ) { name = new OTree(['"', name, '"']); } return new OTree( - [name, mid, context.updateContext({ tailPositionArgument: false }).convert(node.initializer)], + [name, mid, context.updateContext({ inMap: false, tailPositionArgument: false }).convert(node.initializer)], [], { canBreakLine: true }, ); @@ -608,11 +622,10 @@ export class PythonVisitor extends DefaultVisitor { node: ts.StringLiteral | ts.NoSubstitutionTemplateLiteral, _context: PythonVisitorContext, ): OTree { - const rawText = node.text; - if (rawText.includes('\n')) { + if (node.getText(node.getSourceFile()).includes('\n')) { return new OTree([ '"""', - rawText + node.text // Escape all occurrences of back-slash once more .replace(/\\/g, '\\\\') // Escape only the first one in triple-quotes @@ -620,7 +633,7 @@ export class PythonVisitor extends DefaultVisitor { '"""', ]); } - return new OTree([JSON.stringify(rawText)]); + return new OTree([JSON.stringify(node.text)]); } public templateExpression(node: ts.TemplateExpression, context: PythonVisitorContext): OTree { diff --git a/packages/jsii-rosetta/test/translations/expressions/map-literal.cs b/packages/jsii-rosetta/test/translations/expressions/map-literal.cs new file mode 100644 index 0000000000..f2774c2ebd --- /dev/null +++ b/packages/jsii-rosetta/test/translations/expressions/map-literal.cs @@ -0,0 +1,3 @@ +IDictionary map = new Dictionary { + { "Access-Control-Allow-Origin", "\"*\"" } +}; diff --git a/packages/jsii-rosetta/test/translations/expressions/map-literal.go b/packages/jsii-rosetta/test/translations/expressions/map-literal.go new file mode 100644 index 0000000000..8fb89ba172 --- /dev/null +++ b/packages/jsii-rosetta/test/translations/expressions/map-literal.go @@ -0,0 +1,3 @@ +map := map[string]interface{}{ + "Access-Control-Allow-Origin": jsii.String("\"*\""), +} diff --git a/packages/jsii-rosetta/test/translations/expressions/map-literal.java b/packages/jsii-rosetta/test/translations/expressions/map-literal.java new file mode 100644 index 0000000000..15f79962ca --- /dev/null +++ b/packages/jsii-rosetta/test/translations/expressions/map-literal.java @@ -0,0 +1,2 @@ +Map map = Map.of( + "Access-Control-Allow-Origin", "\"*\""); diff --git a/packages/jsii-rosetta/test/translations/expressions/map-literal.py b/packages/jsii-rosetta/test/translations/expressions/map-literal.py new file mode 100644 index 0000000000..9564689d87 --- /dev/null +++ b/packages/jsii-rosetta/test/translations/expressions/map-literal.py @@ -0,0 +1,3 @@ +map = { + "Access-Control-Allow-Origin": "\"*\"" +} diff --git a/packages/jsii-rosetta/test/translations/expressions/map-literal.ts b/packages/jsii-rosetta/test/translations/expressions/map-literal.ts new file mode 100644 index 0000000000..658638b03c --- /dev/null +++ b/packages/jsii-rosetta/test/translations/expressions/map-literal.ts @@ -0,0 +1,3 @@ +const map: { [key: string]: unknown; } = { + 'Access-Control-Allow-Origin': '"*"', +}; From de4de6855228e855de2c93c44f88a731171eca0d Mon Sep 17 00:00:00 2001 From: Romain Marcadier Date: Tue, 29 Mar 2022 14:57:46 -0700 Subject: [PATCH 16/32] chore(jsii): revert to using Set (#3450) Not everything can be added to a WeakSet, in particular, only objects can be added there, no `undefined`, `null`, ... This is causing an integration test failure at the moment. --- 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 --- packages/jsii/lib/transforms/deprecation-warnings.ts | 2 +- packages/jsii/test/deprecation-warnings.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jsii/lib/transforms/deprecation-warnings.ts b/packages/jsii/lib/transforms/deprecation-warnings.ts index 294ab34a36..04775ddf91 100644 --- a/packages/jsii/lib/transforms/deprecation-warnings.ts +++ b/packages/jsii/lib/transforms/deprecation-warnings.ts @@ -356,7 +356,7 @@ function ${GET_PROPERTY_DESCRIPTOR}(obj, prop) { return {}; } -const ${VISITED_OBJECTS_SET_NAME} = new WeakSet(); +const ${VISITED_OBJECTS_SET_NAME} = new Set(); class ${DEPRECATION_ERROR} extends Error { constructor(...args) { diff --git a/packages/jsii/test/deprecation-warnings.test.ts b/packages/jsii/test/deprecation-warnings.test.ts index dc7fde7210..f945e8557b 100644 --- a/packages/jsii/test/deprecation-warnings.test.ts +++ b/packages/jsii/test/deprecation-warnings.test.ts @@ -40,7 +40,7 @@ function getPropertyDescriptor(obj, prop) { } return {}; } -const visitedObjects = new WeakSet(); +const visitedObjects = new Set(); class DeprecationError extends Error { constructor(...args) { super(...args); From 07b50a1fecee39ad95aefa7da7198187da3c444b Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 17:22:12 -0700 Subject: [PATCH 17/32] docs: add CommanderRoot as a contributor for code (#3451) Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 31 ++++++++++++++++--------------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index e351eece00..ff4dfce7e8 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1348,6 +1348,15 @@ "contributions": [ "bug" ] + }, + { + "login": "CommanderRoot", + "name": "CommanderRoot", + "avatar_url": "https://avatars.githubusercontent.com/u/4395417?v=4", + "profile": "https://github.com/CommanderRoot", + "contributions": [ + "code" + ] } ], "repoType": "github", diff --git a/README.md b/README.md index b138de9f87..2696d48872 100644 --- a/README.md +++ b/README.md @@ -92,140 +92,141 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Christopher Rybicki

📖 +
CommanderRoot

💻
Cory Hall

🐛
Cristian Măgherușan-Stanciu

🐛
CyrusNajmabadi

🐛 🤔
Damian Silbergleith

💻 🐛
Daniel Dinu

🐛 💻 -
Daniel Schroeder

🐛 💻 📖 🤔 🚧 +
Daniel Schroeder

🐛 💻 📖 🤔 🚧
Dave Slotnick

🐛
Donald Stufft

🐛 💻 🤔 👀
Dongie Agnir

💻 👀
Eduardo Rabelo

📖
Eduardo Sena S. Rosa

🐛
Elad Ben-Israel

🐛 💻 🤔 🚧 👀 📢 -
Eli Polonsky

🐛 💻 🤔 🚧 👀 +
Eli Polonsky

🐛 💻 🤔 🚧 👀
Eric Z. Beard

📆
Erik Karlsson

🐛
Eugene Kozlov

💻
Fabio Gentile

🐛
Florian Eitel

🤔
Graham Lea

🤔 👀 -
Hamza Assyad

🐛 💻 🤔 👀 +
Hamza Assyad

🐛 💻 🤔 👀
Hari Pachuveetil

📝 📖
Hsing-Hui Hsu

💻 📖 🤔 👀
Ikko Ashimine

📖
James

🐛 💻
James Kelley

🐛
James Mead

💻 -
James Siri

💻 🚧 +
James Siri

💻 🚧
Jason Del Ponte

🤔 👀
Jason Fulghum

🤔 📆 👀
Jerry Kindall

📖 🤔
Jimmy Gaussen

🤔
Johannes Weber

📖
Jon Steinich

🐛 🤔 💻 -
Joseph Lawson

👀 +
Joseph Lawson

👀
Joseph Martin

🐛
Junix

🐛
Justin Taylor

🐛
Kaizen Conroy

💻 🐛
Kaushik Borra

🐛
Kyle Thomson

💻 👀 -
Leandro Padua

🐛 +
Leandro Padua

🐛
Liang Zhou

🐛 💻
Madeline Kusters

💻 🐛
Maja S Bratseth

🐛
Marcos Diez

🐛
Mark Nielsen

💻
Matthew Bonig

🐛 📝 -
Matthew Pirocchi

💻 🤔 👀 +
Matthew Pirocchi

💻 🤔 👀
Meng Xin Zhu

🐛
Michael Neil

🚧
Mike Lane

🐛
Mitch Garnaat

🐛 💻 🤔 👀
Mitchell Valine

🐛 💻 🤔 🚧 👀
Mohamad Soufan

📖 -
Mykola Mogylenko

🐛 +
Mykola Mogylenko

🐛
Neta Nir

💻 🤔 🚧 👀
Nick Lynch

🐛 💻 🚧 👀
Niranjan Jayakar

🐛 💻 🤔 🚧 👀
Noah Litov

💻 🚧 👀
Otavio Macedo

💻 🐛
PIDZ - Bart

🤔 -
Peter Woodworth

🚧 +
Peter Woodworth

🚧
Petr Kacer

🐛
Petra Barus

💻
Philip Cali

🤔
Quentin Loos

🤔
Raphael

🐛
Richard H Boyd

🐛 -
Rico Huijbers

🐛 💻 🤔 🚧 👀 +
Rico Huijbers

🐛 💻 🤔 🚧 👀
Romain Marcadier

🐛 💻 🎨 🤔 🚧 👀 📝
SADIK KUZU

👀
SK

🤔
Sam Fink

💻 👀
Sam Goodwin

👀
Sebastian Korfmann

🐛 💻 🤔 -
Shane Witbeck

🤔 +
Shane Witbeck

🤔
Shiv Lakshminarayan

💻 🚧 👀
Somaya

💻 🤔 🚧 👀
The Gitter Badger

💻 🚧
Thomas Poignant

🐛
Thomas Steinbach

🐛
Thorsten Hoeger

💻 -
Tim Wagner

🐛 🤔 +
Tim Wagner

🐛 🤔
Tobias Lidskog

💻
Ty Coghlan

🐛
Tyler van Hensbergen

🤔
Vlad Hrybok

🐛
Vladimir Shchur

🐛
Yan Zhulanow

💻 -
Yigong Liu

🐛 🤔 +
Yigong Liu

🐛 🤔
Zach Bienenfeld

🐛
ajnarang

🤔
aniljava

💻
arnogeurts-sqills

🐛 💻
deccy-mcc

🐛
dependabot-preview[bot]

🐛 🚧 -
dependabot[bot]

🚧 +
dependabot[bot]

🚧
dheffx

🐛
gregswdl

🐛
guyroberts21

📖
mattBrzezinski

📖
mergify

🚧
mergify[bot]

🚧 -
seiyashima42

🐛 💻 📖 +
seiyashima42

🐛 💻 📖
sullis

💻
vaneek

🐛
wendysophie

🐛 From 2a09b81ce4fbe47e5708e42051dfe151e4cb7f77 Mon Sep 17 00:00:00 2001 From: CommanderRoot Date: Wed, 30 Mar 2022 03:45:03 +0200 Subject: [PATCH 18/32] chore: replace deprecated String.prototype.substr() (#3445) [String.prototype.substr()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) is deprecated so we replace it with [String.prototype.slice()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) which works similarily but isn't deprecated. .substr() probably isn't going away anytime soon but the change is trivial so it doesn't hurt to do it. --- 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 --- eslint-config.yaml | 1 + packages/@jsii/kernel/lib/serialization.ts | 4 ++-- packages/@jsii/runtime/lib/in-out.ts | 2 +- packages/codemaker/lib/case-utils.ts | 2 +- packages/jsii-pacmak/lib/targets/dotnet/dotnetdocgenerator.ts | 2 +- packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts | 2 +- packages/jsii-pacmak/lib/targets/java.ts | 2 +- packages/jsii-reflect/lib/source.ts | 2 +- packages/jsii-rosetta/lib/languages/csharp.ts | 2 +- packages/jsii-rosetta/lib/languages/java.ts | 2 +- packages/jsii-rosetta/lib/languages/python.ts | 2 +- packages/jsii-rosetta/lib/markdown/markdown-renderer.ts | 2 +- packages/jsii-rosetta/test/translations.test.ts | 2 +- packages/jsii/lib/docs.ts | 2 +- packages/jsii/lib/literate.ts | 2 +- 15 files changed, 16 insertions(+), 15 deletions(-) diff --git a/eslint-config.yaml b/eslint-config.yaml index 8c6c72d389..da28a00ad4 100644 --- a/eslint-config.yaml +++ b/eslint-config.yaml @@ -205,6 +205,7 @@ rules: 'no-restricted-properties': - error + - { property: "substr", message: "Use .slice instead of .substr." } 'no-return-await': - error diff --git a/packages/@jsii/kernel/lib/serialization.ts b/packages/@jsii/kernel/lib/serialization.ts index caec15fdc0..3b87bf2bc1 100644 --- a/packages/@jsii/kernel/lib/serialization.ts +++ b/packages/@jsii/kernel/lib/serialization.ts @@ -731,8 +731,8 @@ function deserializeEnum(value: WireEnum, lookup: SymbolLookup) { throw new Error(`Malformed enum value: ${JSON.stringify(value)}`); } - const typeName = enumLocator.substr(0, sep); - const valueName = enumLocator.substr(sep + 1); + const typeName = enumLocator.slice(0, sep); + const valueName = enumLocator.slice(sep + 1); const enumValue = lookup(typeName)[valueName]; if (enumValue === undefined) { diff --git a/packages/@jsii/runtime/lib/in-out.ts b/packages/@jsii/runtime/lib/in-out.ts index 41b4a9234d..b7a7e95635 100644 --- a/packages/@jsii/runtime/lib/in-out.ts +++ b/packages/@jsii/runtime/lib/in-out.ts @@ -61,7 +61,7 @@ export class InputOutput implements IInputOutput { // stip "> " from recorded requests if (reqLine.startsWith('> ')) { - reqLine = reqLine.substr(2); + reqLine = reqLine.slice(2); } const input = JSON.parse(reqLine); diff --git a/packages/codemaker/lib/case-utils.ts b/packages/codemaker/lib/case-utils.ts index c382477c27..bd609e340a 100644 --- a/packages/codemaker/lib/case-utils.ts +++ b/packages/codemaker/lib/case-utils.ts @@ -26,7 +26,7 @@ export function toSnakeCase(s: string, separator = '_'): string { return decamelize(s, { separator }); function ucfirst(str: string) { - return str.substr(0, 1).toUpperCase() + str.substr(1).toLowerCase(); + return str.slice(0, 1).toUpperCase() + str.slice(1).toLowerCase(); } } diff --git a/packages/jsii-pacmak/lib/targets/dotnet/dotnetdocgenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/dotnetdocgenerator.ts index 48337cdf20..d1cb2ea2f6 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/dotnetdocgenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/dotnetdocgenerator.ts @@ -204,7 +204,7 @@ export class DotNetDocGenerator { * Uppercase the first letter */ function ucFirst(x: string) { - return x.substr(0, 1).toUpperCase() + x.substr(1); + return x.slice(0, 1).toUpperCase() + x.slice(1); } function shouldMentionStability(s: spec.Stability) { diff --git a/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts index b781fa6551..45af4500e2 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts @@ -161,7 +161,7 @@ export class DotNetGenerator extends Generator { this.assembly.name, // Strip the `${assmName}.` prefix here, as the "assembly-relative" NS // is expected by `this.typeResolver.resovleNamespace`. - jsiiNs.substr(this.assembly.name.length + 1), + jsiiNs.slice(this.assembly.name.length + 1), ); this.emitNamespaceDocs(dotnetNs, jsiiNs, submodule); } diff --git a/packages/jsii-pacmak/lib/targets/java.ts b/packages/jsii-pacmak/lib/targets/java.ts index f7e6f737fd..da935cd0c3 100644 --- a/packages/jsii-pacmak/lib/targets/java.ts +++ b/packages/jsii-pacmak/lib/targets/java.ts @@ -3257,5 +3257,5 @@ function splitNamespace(ns: string): [string, string] { if (dot === -1) { return ['', ns]; } - return [ns.substr(0, dot), ns.substr(dot + 1)]; + return [ns.slice(0, dot), ns.slice(dot + 1)]; } diff --git a/packages/jsii-reflect/lib/source.ts b/packages/jsii-reflect/lib/source.ts index 1a93c4636c..b672aff99a 100644 --- a/packages/jsii-reflect/lib/source.ts +++ b/packages/jsii-reflect/lib/source.ts @@ -77,7 +77,7 @@ export function repositoryUrl( // Turn https://github.com/awslabs/aws-cdk.git -> https://github.com/awslabs/aws-cdk/blob/REF/filename#L - const prefix = repo.url.substr(0, repo.url.length - 4); + const prefix = repo.url.slice(0, -4); return `${prefix}/blob/${ref}/${loc.filename}#L${loc.line}`; } diff --git a/packages/jsii-rosetta/lib/languages/csharp.ts b/packages/jsii-rosetta/lib/languages/csharp.ts index 505843d97a..acca98b23b 100644 --- a/packages/jsii-rosetta/lib/languages/csharp.ts +++ b/packages/jsii-rosetta/lib/languages/csharp.ts @@ -689,7 +689,7 @@ export class CSharpVisitor extends DefaultVisitor { * Uppercase the first letter */ function ucFirst(x: string) { - return x.substr(0, 1).toUpperCase() + x.substr(1); + return x.slice(0, 1).toUpperCase() + x.slice(1); } /** diff --git a/packages/jsii-rosetta/lib/languages/java.ts b/packages/jsii-rosetta/lib/languages/java.ts index 97b4488980..778735731c 100644 --- a/packages/jsii-rosetta/lib/languages/java.ts +++ b/packages/jsii-rosetta/lib/languages/java.ts @@ -296,7 +296,7 @@ export class JavaVisitor extends DefaultVisitor { let renderedType = this.renderTypeNode(node.type, renderer); if (node.dotDotDotToken && renderedType.endsWith('[]')) { // Varargs. In Java, render this as `Element...` (instead of `Element[]` which is what we'll have gotten). - renderedType = `${renderedType.substr(0, renderedType.length - 2)}...`; + renderedType = `${renderedType.slice(0, -2)}...`; } return new OTree([renderedType, ' ', renderer.convert(node.name)]); diff --git a/packages/jsii-rosetta/lib/languages/python.ts b/packages/jsii-rosetta/lib/languages/python.ts index 201ddd3fd0..c4e1c02579 100644 --- a/packages/jsii-rosetta/lib/languages/python.ts +++ b/packages/jsii-rosetta/lib/languages/python.ts @@ -808,7 +808,7 @@ function mangleIdentifier(originalIdentifier: string) { return originalIdentifier; } // Turn into snake-case - const cased = originalIdentifier.replace(/[^A-Z][A-Z]/g, (m) => `${m[0].substr(0, 1)}_${m.substr(1).toLowerCase()}`); + const cased = originalIdentifier.replace(/[^A-Z][A-Z]/g, (m) => `${m[0].slice(0, 1)}_${m.slice(1).toLowerCase()}`); return IDENTIFIER_KEYWORDS.includes(cased) ? `${cased}_` : cased; } diff --git a/packages/jsii-rosetta/lib/markdown/markdown-renderer.ts b/packages/jsii-rosetta/lib/markdown/markdown-renderer.ts index f5a38db6fb..1610ad893c 100644 --- a/packages/jsii-rosetta/lib/markdown/markdown-renderer.ts +++ b/packages/jsii-rosetta/lib/markdown/markdown-renderer.ts @@ -74,7 +74,7 @@ export class MarkdownRenderer implements CommonMarkRenderer { const rendered = context.recurse(item); // Prefix the first line with a different text than subsequent lines - const prefixed = firstLinePrefix + prefixLines(hangingPrefix, rendered).substr(hangingPrefix.length); + const prefixed = firstLinePrefix + prefixLines(hangingPrefix, rendered).slice(hangingPrefix.length); items.push(prefixed); diff --git a/packages/jsii-rosetta/test/translations.test.ts b/packages/jsii-rosetta/test/translations.test.ts index e5f82bfacf..29ff2ba1c8 100644 --- a/packages/jsii-rosetta/test/translations.test.ts +++ b/packages/jsii-rosetta/test/translations.test.ts @@ -133,7 +133,7 @@ function stripCommonWhitespace(x: string) { /* eslint-disable-next-line @typescript-eslint/prefer-regexp-exec */ .map((l) => l.match(/(\s*)/)![1].length); const minWS = Math.min(...whitespaces); - return lines.map((l) => l.substr(minWS)).join('\n'); + return lines.map((l) => l.slice(minWS)).join('\n'); } function stripEmptyLines(x: string) { diff --git a/packages/jsii/lib/docs.ts b/packages/jsii/lib/docs.ts index dde213cdc2..9af1421c00 100644 --- a/packages/jsii/lib/docs.ts +++ b/packages/jsii/lib/docs.ts @@ -207,7 +207,7 @@ export function splitSummary( return [undefined, undefined]; } const summary = summaryLine(docBlock); - const remarks = uberTrim(docBlock.substr(summary.length)); + const remarks = uberTrim(docBlock.slice(summary.length)); return [endWithPeriod(noNewlines(summary.trim())), remarks]; } diff --git a/packages/jsii/lib/literate.ts b/packages/jsii/lib/literate.ts index 5d6b812989..3b0fed62e1 100644 --- a/packages/jsii/lib/literate.ts +++ b/packages/jsii/lib/literate.ts @@ -182,7 +182,7 @@ function stripCommonIndent(lines: string[]): string[] { const leadingWhitespace = /^(\s*)/; const indents = lines.map((l) => leadingWhitespace.exec(l)![1].length); const commonIndent = Math.min(...indents); - return lines.map((l) => l.substr(commonIndent)); + return lines.map((l) => l.slice(commonIndent)); } /** From 012d277e9e96ac1d82fee90a691dd47729b11afd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 02:53:33 +0000 Subject: [PATCH 19/32] chore(deps): Bump github.com/stretchr/testify from 1.7.0 to 1.7.1 in /packages/@jsii/go-runtime/jsii-runtime-go (#3431) Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.0 to 1.7.1.
Commits
  • 083ff1c Fixed didPanic to now detect panic(nil).
  • 1e36bfe Use cross Go version compatible build tag syntax
  • e798dc2 Add docs on 1.17 build tags
  • 83198c2 assert: guard CanConvert call in backward compatible wrapper
  • 087b655 assert: allow comparing time.Time
  • 7bcf74e fix msgAndArgs forwarding
  • c29de71 add tests for correct msgAndArgs forwarding
  • f87e2b2 Update builds
  • ab6dc32 fix linting errors in /assert package
  • edff5a0 fix funtion name
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/stretchr/testify&package-manager=go_modules&previous-version=1.7.0&new-version=1.7.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- packages/@jsii/go-runtime-test/project/go.mod | 2 +- packages/@jsii/go-runtime-test/project/go.sum | 4 ++-- packages/@jsii/go-runtime/jsii-runtime-go/go.mod | 2 +- packages/@jsii/go-runtime/jsii-runtime-go/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/@jsii/go-runtime-test/project/go.mod b/packages/@jsii/go-runtime-test/project/go.mod index 739b059c53..0164d9ba43 100644 --- a/packages/@jsii/go-runtime-test/project/go.mod +++ b/packages/@jsii/go-runtime-test/project/go.mod @@ -7,7 +7,7 @@ require ( github.com/aws/jsii/jsii-calc/go/jcb v0.0.0 github.com/aws/jsii/jsii-calc/go/jsiicalc/v3 v3.20.120 github.com/aws/jsii/jsii-calc/go/scopejsiicalclib v0.0.0 - github.com/stretchr/testify v1.7.0 + github.com/stretchr/testify v1.7.1 golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 golang.org/x/tools v0.1.0 ) diff --git a/packages/@jsii/go-runtime-test/project/go.sum b/packages/@jsii/go-runtime-test/project/go.sum index 57ec351287..485cdc2311 100644 --- a/packages/@jsii/go-runtime-test/project/go.sum +++ b/packages/@jsii/go-runtime-test/project/go.sum @@ -6,8 +6,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod index e406443fa2..58dac68c48 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 - github.com/stretchr/testify v1.7.0 + github.com/stretchr/testify v1.7.1 ) require ( diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum index 34dd278f55..a4aa7af91a 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum @@ -6,8 +6,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 25b99c4d85a9680e1324310882d83390d73de123 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Wed, 30 Mar 2022 12:04:28 -0400 Subject: [PATCH 20/32] chore: npm-check-updates && yarn upgrade (#3452) Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date. --- package.json | 10 +- packages/@jsii/go-runtime/package.json | 4 +- packages/@jsii/integ-test/package.json | 4 +- packages/@jsii/kernel/package.json | 6 +- packages/@jsii/runtime/package.json | 6 +- packages/@jsii/spec/package.json | 4 +- .../jsii-calc-base-of-base/package.json | 2 +- packages/@scope/jsii-calc-base/package.json | 2 +- packages/@scope/jsii-calc-lib/package.json | 2 +- packages/codemaker/package.json | 4 +- packages/jsii-calc/package.json | 4 +- packages/jsii-config/package.json | 6 +- packages/jsii-diff/package.json | 4 +- packages/jsii-pacmak/package.json | 6 +- packages/jsii-reflect/package.json | 4 +- packages/jsii-rosetta/package.json | 4 +- packages/jsii/package.json | 6 +- packages/oo-ascii-tree/package.json | 4 +- tools/jsii-compliance/package.json | 4 +- yarn.lock | 186 +++++++++--------- 20 files changed, 136 insertions(+), 136 deletions(-) diff --git a/package.json b/package.json index be280321aa..f18fa97f88 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,10 @@ }, "devDependencies": { "@jest/types": "^27.5.1", - "@typescript-eslint/eslint-plugin": "^5.16.0", - "@typescript-eslint/parser": "^5.16.0", + "@typescript-eslint/eslint-plugin": "^5.17.0", + "@typescript-eslint/parser": "^5.17.0", "all-contributors-cli": "^6.20.0", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "eslint-config-prettier": "^8.5.0", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^2.7.0", @@ -28,9 +28,9 @@ "jest-circus": "^27.5.1", "jest-config": "^27.5.1", "lerna": "^4.0.0", - "prettier": "^2.6.0", + "prettier": "^2.6.1", "standard-version": "^9.3.2", - "ts-jest": "^27.1.3", + "ts-jest": "^27.1.4", "ts-node": "^10.7.0", "typescript": "~3.9.10" }, diff --git a/packages/@jsii/go-runtime/package.json b/packages/@jsii/go-runtime/package.json index 105a9a5c5e..08bbd5fecb 100644 --- a/packages/@jsii/go-runtime/package.json +++ b/packages/@jsii/go-runtime/package.json @@ -26,11 +26,11 @@ "@types/fs-extra": "^9.0.13", "@types/node": "^12.20.47", "codemaker": "^0.0.0", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "fs-extra": "^9.1.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.6.0", + "prettier": "^2.6.1", "ts-node": "^10.7.0", "typescript": "~3.9.10" } diff --git a/packages/@jsii/integ-test/package.json b/packages/@jsii/integ-test/package.json index 6a08e36faf..efbce4c67e 100644 --- a/packages/@jsii/integ-test/package.json +++ b/packages/@jsii/integ-test/package.json @@ -32,8 +32,8 @@ "@types/jest": "^27.4.1", "@types/node": "^12.20.47", "@types/tar": "^6.1.1", - "eslint": "^8.11.0", - "prettier": "^2.6.0", + "eslint": "^8.12.0", + "prettier": "^2.6.1", "typescript": "~3.9.10" } } diff --git a/packages/@jsii/kernel/package.json b/packages/@jsii/kernel/package.json index ed346361a0..4034b7bf89 100644 --- a/packages/@jsii/kernel/package.json +++ b/packages/@jsii/kernel/package.json @@ -42,13 +42,13 @@ "@types/jest": "^27.4.1", "@types/node": "^12.20.47", "@types/tar": "^6.1.1", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "jest": "^27.5.1", "jest-expect-message": "^1.0.2", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.6.0", - "ts-jest": "^27.1.3", + "prettier": "^2.6.1", + "ts-jest": "^27.1.4", "typescript": "~3.9.10" } } diff --git a/packages/@jsii/runtime/package.json b/packages/@jsii/runtime/package.json index e26e4d8b53..083f9d79a1 100644 --- a/packages/@jsii/runtime/package.json +++ b/packages/@jsii/runtime/package.json @@ -43,13 +43,13 @@ "@scope/jsii-calc-lib": "^0.0.0", "@types/jest": "^27.4.1", "@types/node": "^12.20.47", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "jest": "^27.5.1", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.6.0", + "prettier": "^2.6.1", "source-map-loader": "^3.0.1", - "ts-jest": "^27.1.3", + "ts-jest": "^27.1.4", "typescript": "~3.9.10", "webpack": "^5.70.0", "webpack-cli": "^4.9.2" diff --git a/packages/@jsii/spec/package.json b/packages/@jsii/spec/package.json index 48405b4a29..4e86b40e5e 100644 --- a/packages/@jsii/spec/package.json +++ b/packages/@jsii/spec/package.json @@ -36,10 +36,10 @@ "devDependencies": { "@types/jest": "^27.4.1", "@types/node": "^12.20.47", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "jest": "^27.5.1", "jsii-build-tools": "^0.0.0", - "prettier": "^2.6.0", + "prettier": "^2.6.1", "typescript": "~3.9.10", "typescript-json-schema": "^0.53.0" } diff --git a/packages/@scope/jsii-calc-base-of-base/package.json b/packages/@scope/jsii-calc-base-of-base/package.json index cbcdda3fea..e9b6406c5e 100644 --- a/packages/@scope/jsii-calc-base-of-base/package.json +++ b/packages/@scope/jsii-calc-base-of-base/package.json @@ -34,7 +34,7 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", - "prettier": "^2.6.0" + "prettier": "^2.6.1" }, "jsii": { "outdir": "dist", diff --git a/packages/@scope/jsii-calc-base/package.json b/packages/@scope/jsii-calc-base/package.json index 72d68e7b23..04aead3af1 100644 --- a/packages/@scope/jsii-calc-base/package.json +++ b/packages/@scope/jsii-calc-base/package.json @@ -39,7 +39,7 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", - "prettier": "^2.6.0" + "prettier": "^2.6.1" }, "jsii": { "metadata": { diff --git a/packages/@scope/jsii-calc-lib/package.json b/packages/@scope/jsii-calc-lib/package.json index 1736e9038a..d38075367b 100644 --- a/packages/@scope/jsii-calc-lib/package.json +++ b/packages/@scope/jsii-calc-lib/package.json @@ -43,7 +43,7 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", - "prettier": "^2.6.0" + "prettier": "^2.6.1" }, "jsii": { "outdir": "dist", diff --git a/packages/codemaker/package.json b/packages/codemaker/package.json index dd7a6132b7..a99658d146 100644 --- a/packages/codemaker/package.json +++ b/packages/codemaker/package.json @@ -39,9 +39,9 @@ "@types/fs-extra": "^9.0.13", "@types/jest": "^27.4.1", "@types/node": "^12.20.47", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "jest": "^27.5.1", - "prettier": "^2.6.0", + "prettier": "^2.6.1", "typescript": "~3.9.10" } } diff --git a/packages/jsii-calc/package.json b/packages/jsii-calc/package.json index 2e90c29b25..edb981480d 100644 --- a/packages/jsii-calc/package.json +++ b/packages/jsii-calc/package.json @@ -52,11 +52,11 @@ }, "devDependencies": { "@types/node": "^12.20.47", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", - "prettier": "^2.6.0" + "prettier": "^2.6.1" }, "jsii": { "outdir": "dist", diff --git a/packages/jsii-config/package.json b/packages/jsii-config/package.json index 1f94ee6cd4..66d95995d9 100644 --- a/packages/jsii-config/package.json +++ b/packages/jsii-config/package.json @@ -19,14 +19,14 @@ "jsii-config": "bin/jsii-config" }, "devDependencies": { - "@types/inquirer": "^8.2.0", + "@types/inquirer": "^8.2.1", "@types/jest": "^27.4.1", "@types/node": "^12.20.47", "@types/yargs": "^17.0.10", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "jest": "^27.5.1", "jest-expect-message": "^1.0.2", - "prettier": "^2.6.0", + "prettier": "^2.6.1", "typescript": "~3.9.10" }, "dependencies": { diff --git a/packages/jsii-diff/package.json b/packages/jsii-diff/package.json index 7b0a1e2810..af9fa06d41 100644 --- a/packages/jsii-diff/package.json +++ b/packages/jsii-diff/package.json @@ -46,11 +46,11 @@ "@types/jest": "^27.4.1", "@types/node": "^12.20.47", "@types/tar-fs": "^2.0.1", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "jest": "^27.5.1", "jest-expect-message": "^1.0.2", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", - "prettier": "^2.6.0" + "prettier": "^2.6.1" } } diff --git a/packages/jsii-pacmak/package.json b/packages/jsii-pacmak/package.json index 0382c4410c..a6fb291867 100644 --- a/packages/jsii-pacmak/package.json +++ b/packages/jsii-pacmak/package.json @@ -62,13 +62,13 @@ "@types/jest": "^27.4.1", "@types/node": "^12.20.47", "@types/semver": "^7.3.9", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "jest": "^27.5.1", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.6.0", - "ts-jest": "^27.1.3", + "prettier": "^2.6.1", + "ts-jest": "^27.1.4", "typescript": "~3.9.10" }, "keywords": [ diff --git a/packages/jsii-reflect/package.json b/packages/jsii-reflect/package.json index 49e18c414e..437b5f2a38 100644 --- a/packages/jsii-reflect/package.json +++ b/packages/jsii-reflect/package.json @@ -46,12 +46,12 @@ "@types/fs-extra": "^9.0.13", "@types/jest": "^27.4.1", "@types/node": "^12.20.47", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "jest": "^27.5.1", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.6.0", + "prettier": "^2.6.1", "typescript": "~3.9.10" } } diff --git a/packages/jsii-rosetta/package.json b/packages/jsii-rosetta/package.json index 2d93502a6a..17ce767346 100644 --- a/packages/jsii-rosetta/package.json +++ b/packages/jsii-rosetta/package.json @@ -23,12 +23,12 @@ "@types/node": "^12.20.47", "@types/workerpool": "^6.1.0", "@types/semver": "^7.3.9", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "jest": "^27.5.1", "jsii-build-tools": "0.0.0", "memory-streams": "^0.1.3", "mock-fs": "^5.1.2", - "prettier": "^2.6.0" + "prettier": "^2.6.1" }, "dependencies": { "@jsii/check-node": "0.0.0", diff --git a/packages/jsii/package.json b/packages/jsii/package.json index 66a6f8533e..7bda12f57a 100644 --- a/packages/jsii/package.json +++ b/packages/jsii/package.json @@ -57,11 +57,11 @@ "@types/node": "^12.20.47", "@types/semver": "^7.3.9", "clone": "^2.1.2", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "jest": "^27.5.1", "jest-expect-message": "^1.0.2", "jsii-build-tools": "^0.0.0", - "prettier": "^2.6.0", - "ts-jest": "^27.1.3" + "prettier": "^2.6.1", + "ts-jest": "^27.1.4" } } diff --git a/packages/oo-ascii-tree/package.json b/packages/oo-ascii-tree/package.json index d36537a919..0411295795 100644 --- a/packages/oo-ascii-tree/package.json +++ b/packages/oo-ascii-tree/package.json @@ -33,10 +33,10 @@ "devDependencies": { "@types/jest": "^27.4.1", "@types/node": "^12.20.47", - "eslint": "^8.11.0", + "eslint": "^8.12.0", "jest": "^27.5.1", "jsii-build-tools": "^0.0.0", - "prettier": "^2.6.0", + "prettier": "^2.6.1", "typescript": "~3.9.10" } } diff --git a/tools/jsii-compliance/package.json b/tools/jsii-compliance/package.json index 73a0a4c135..1c00476235 100644 --- a/tools/jsii-compliance/package.json +++ b/tools/jsii-compliance/package.json @@ -17,8 +17,8 @@ }, "devDependencies": { "@types/node": "^12.20.47", - "eslint": "^8.11.0", - "prettier": "^2.6.0", + "eslint": "^8.12.0", + "prettier": "^2.6.1", "ts-node": "^10.7.0", "typescript": "~3.9.10" } diff --git a/yarn.lock b/yarn.lock index 2263ef7c9b..eedff01250 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1561,10 +1561,10 @@ dependencies: "@types/node" "*" -"@types/inquirer@^8.2.0": - version "8.2.0" - resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-8.2.0.tgz#b9566d048f5ff65159f2ed97aff45fe0f00b35ec" - integrity sha512-BNoMetRf3gmkpAlV5we+kxyZTle7YibdOntIZbU5pyIfMdcwy784KfeZDAcuyMznkh5OLa17RVXZOGA5LTlkgQ== +"@types/inquirer@^8.2.1": + version "8.2.1" + resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-8.2.1.tgz#28a139be3105a1175e205537e8ac10830e38dbf4" + integrity sha512-wKW3SKIUMmltbykg4I5JzCVzUhkuD9trD6efAmYgN2MrSntY0SMRQzEnD3mkyJ/rv9NLbTC7g3hKKE86YwEDLw== dependencies: "@types/through" "*" rxjs "^7.2.0" @@ -1597,9 +1597,9 @@ pretty-format "^27.0.0" "@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": - version "7.0.10" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.10.tgz#9b05b7896166cd00e9cbd59864853abf65d9ac23" - integrity sha512-BLO9bBq59vW3fxCpD4o0N4U+DXsvwvIcl+jofw0frQo/GrBFC+/jRZj1E7kgp6dvTyNmA4y6JCV5Id/r3mNP5A== + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== "@types/json5@^0.0.29": version "0.0.29" @@ -1631,9 +1631,9 @@ "@types/node" "*" "@types/node@*": - version "17.0.22" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.22.tgz#38b6c4b9b2f3ed9f2e376cce42a298fb2375251e" - integrity sha512-8FwbVoG4fy+ykY86XCAclKZDORttqE5/s7dyWZKLXTdv3vRy5HozBEinG5IqhvPXXzIZEcTVbuHlQEI6iuwcmw== + version "17.0.23" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.23.tgz#3b41a6e643589ac6442bdbd7a4a3ded62f33f7da" + integrity sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw== "@types/node@^12.20.47": version "12.20.47" @@ -1726,14 +1726,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.16.0.tgz#78f246dd8d1b528fc5bfca99a8a64d4023a3d86d" - integrity sha512-SJoba1edXvQRMmNI505Uo4XmGbxCK9ARQpkvOd00anxzri9RNQk0DDCxD+LIl+jYhkzOJiOMMKYEHnHEODjdCw== +"@typescript-eslint/eslint-plugin@^5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.17.0.tgz#704eb4e75039000531255672bf1c85ee85cf1d67" + integrity sha512-qVstvQilEd89HJk3qcbKt/zZrfBZ+9h2ynpAGlWjWiizA7m/MtLT9RoX6gjtpE500vfIg8jogAkDzdCxbsFASQ== dependencies: - "@typescript-eslint/scope-manager" "5.16.0" - "@typescript-eslint/type-utils" "5.16.0" - "@typescript-eslint/utils" "5.16.0" + "@typescript-eslint/scope-manager" "5.17.0" + "@typescript-eslint/type-utils" "5.17.0" + "@typescript-eslint/utils" "5.17.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -1741,69 +1741,69 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.16.0.tgz#e4de1bde4b4dad5b6124d3da227347616ed55508" - integrity sha512-fkDq86F0zl8FicnJtdXakFs4lnuebH6ZADDw6CYQv0UZeIjHvmEw87m9/29nk2Dv5Lmdp0zQ3zDQhiMWQf/GbA== +"@typescript-eslint/parser@^5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.17.0.tgz#7def77d5bcd8458d12d52909118cf3f0a45f89d5" + integrity sha512-aRzW9Jg5Rlj2t2/crzhA2f23SIYFlF9mchGudyP0uiD6SenIxzKoLjwzHbafgHn39dNV/TV7xwQkLfFTZlJ4ig== dependencies: - "@typescript-eslint/scope-manager" "5.16.0" - "@typescript-eslint/types" "5.16.0" - "@typescript-eslint/typescript-estree" "5.16.0" + "@typescript-eslint/scope-manager" "5.17.0" + "@typescript-eslint/types" "5.17.0" + "@typescript-eslint/typescript-estree" "5.17.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.16.0.tgz#7e7909d64bd0c4d8aef629cdc764b9d3e1d3a69a" - integrity sha512-P+Yab2Hovg8NekLIR/mOElCDPyGgFZKhGoZA901Yax6WR6HVeGLbsqJkZ+Cvk5nts/dAlFKm8PfL43UZnWdpIQ== +"@typescript-eslint/scope-manager@5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.17.0.tgz#4cea7d0e0bc0e79eb60cad431c89120987c3f952" + integrity sha512-062iCYQF/doQ9T2WWfJohQKKN1zmmXVfAcS3xaiialiw8ZUGy05Em6QVNYJGO34/sU1a7a+90U3dUNfqUDHr3w== dependencies: - "@typescript-eslint/types" "5.16.0" - "@typescript-eslint/visitor-keys" "5.16.0" + "@typescript-eslint/types" "5.17.0" + "@typescript-eslint/visitor-keys" "5.17.0" -"@typescript-eslint/type-utils@5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.16.0.tgz#b482bdde1d7d7c0c7080f7f2f67ea9580b9e0692" - integrity sha512-SKygICv54CCRl1Vq5ewwQUJV/8padIWvPgCxlWPGO/OgQLCijY9G7lDu6H+mqfQtbzDNlVjzVWQmeqbLMBLEwQ== +"@typescript-eslint/type-utils@5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.17.0.tgz#1c4549d68c89877662224aabb29fbbebf5fc9672" + integrity sha512-3hU0RynUIlEuqMJA7dragb0/75gZmwNwFf/QJokWzPehTZousP/MNifVSgjxNcDCkM5HI2K22TjQWUmmHUINSg== dependencies: - "@typescript-eslint/utils" "5.16.0" + "@typescript-eslint/utils" "5.17.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.16.0.tgz#5827b011982950ed350f075eaecb7f47d3c643ee" - integrity sha512-oUorOwLj/3/3p/HFwrp6m/J2VfbLC8gjW5X3awpQJ/bSG+YRGFS4dpsvtQ8T2VNveV+LflQHjlLvB6v0R87z4g== +"@typescript-eslint/types@5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.17.0.tgz#861ec9e669ffa2aa9b873dd4d28d9b1ce26d216f" + integrity sha512-AgQ4rWzmCxOZLioFEjlzOI3Ch8giDWx8aUDxyNw9iOeCvD3GEYAB7dxWGQy4T/rPVe8iPmu73jPHuaSqcjKvxw== -"@typescript-eslint/typescript-estree@5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.16.0.tgz#32259459ec62f5feddca66adc695342f30101f61" - integrity sha512-SE4VfbLWUZl9MR+ngLSARptUv2E8brY0luCdgmUevU6arZRY/KxYoLI/3V/yxaURR8tLRN7bmZtJdgmzLHI6pQ== +"@typescript-eslint/typescript-estree@5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.17.0.tgz#a7cba7dfc8f9cc2ac78c18584e684507df4f2488" + integrity sha512-X1gtjEcmM7Je+qJRhq7ZAAaNXYhTgqMkR10euC4Si6PIjb+kwEQHSxGazXUQXFyqfEXdkGf6JijUu5R0uceQzg== dependencies: - "@typescript-eslint/types" "5.16.0" - "@typescript-eslint/visitor-keys" "5.16.0" + "@typescript-eslint/types" "5.17.0" + "@typescript-eslint/visitor-keys" "5.17.0" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.16.0.tgz#42218b459d6d66418a4eb199a382bdc261650679" - integrity sha512-iYej2ER6AwmejLWMWzJIHy3nPJeGDuCqf8Jnb+jAQVoPpmWzwQOfa9hWVB8GIQE5gsCv/rfN4T+AYb/V06WseQ== +"@typescript-eslint/utils@5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.17.0.tgz#549a9e1d491c6ccd3624bc3c1b098f5cfb45f306" + integrity sha512-DVvndq1QoxQH+hFv+MUQHrrWZ7gQ5KcJzyjhzcqB1Y2Xes1UQQkTRPUfRpqhS8mhTWsSb2+iyvDW1Lef5DD7vA== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.16.0" - "@typescript-eslint/types" "5.16.0" - "@typescript-eslint/typescript-estree" "5.16.0" + "@typescript-eslint/scope-manager" "5.17.0" + "@typescript-eslint/types" "5.17.0" + "@typescript-eslint/typescript-estree" "5.17.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.16.0.tgz#f27dc3b943e6317264c7492e390c6844cd4efbbb" - integrity sha512-jqxO8msp5vZDhikTwq9ubyMHqZ67UIvawohr4qF3KhlpL7gzSjOd+8471H3nh5LyABkaI85laEKKU8SnGUK5/g== +"@typescript-eslint/visitor-keys@5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.17.0.tgz#52daae45c61b0211b4c81b53a71841911e479128" + integrity sha512-6K/zlc4OfCagUu7Am/BD5k8PSWQOgh34Nrv9Rxe2tBzlJ7uOeJ/h7ugCGDCeEZHT6k2CJBhbk9IsbkPI0uvUkA== dependencies: - "@typescript-eslint/types" "5.16.0" + "@typescript-eslint/types" "5.17.0" eslint-visitor-keys "^3.0.0" "@webassemblyjs/ast@1.11.1": @@ -2332,7 +2332,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^3.0.1: +braces@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -2446,9 +2446,9 @@ camelcase@^6.2.0, camelcase@^6.3.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001317: - version "1.0.30001319" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001319.tgz#eb4da4eb3ecdd409f7ba1907820061d56096e88f" - integrity sha512-xjlIAFHucBRSMUo1kb5D4LYgcN1M45qdKP++lhqowDpwJwGkpIRTt5qQqnhxjj1vHcI7nrJxWhCC1ATrCEBTcw== + version "1.0.30001322" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001322.tgz#2e4c09d11e1e8f852767dab287069a8d0c29d623" + integrity sha512-neRmrmIrCGuMnxGSoh+x7zYtQFFgnSY2jaomjU56sCkTA6JINqQrxutF459JpWcWRajvoyn95sOXq4Pqrnyjew== case@^1.6.3: version "1.6.3" @@ -3206,9 +3206,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.4.84: - version "1.4.90" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.90.tgz#4a518590f118828d54fff045728f547fef08143f" - integrity sha512-ZwKgSA0mQMyEhz+NR0F8dRzkrCLeHLzLkjx/CWf16+zV85hQ6meXPQbKanvhnpkYb7b2uJNj+enQJ/N877ND4Q== + version "1.4.101" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.101.tgz#71f3a10065146d7445ba5d4c06ba2cc063b0817a" + integrity sha512-XJH+XmJjACx1S7ASl/b//KePcda5ocPnFH2jErztXcIS8LpP0SE6rX8ZxiY5/RaDPnaF1rj0fPaHfppzb0e2Aw== emittery@^0.8.1: version "0.8.1" @@ -3263,9 +3263,9 @@ error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.18.5, es-abstract@^1.19.0, es-abstract@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" - integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== + version "1.19.2" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.2.tgz#8f7b696d8f15b167ae3640b4060670f3d054143f" + integrity sha512-gfSBJoZdlL2xRiOCy0g8gLMryhoe1TlimjzU99L/31Z8QEGIhVQI+EWwt5lT+AuU9SnorVupXFqqOGqGfsyO6w== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" @@ -3273,15 +3273,15 @@ es-abstract@^1.18.5, es-abstract@^1.19.0, es-abstract@^1.19.1: get-intrinsic "^1.1.1" get-symbol-description "^1.0.0" has "^1.0.3" - has-symbols "^1.0.2" + has-symbols "^1.0.3" internal-slot "^1.0.3" is-callable "^1.2.4" - is-negative-zero "^2.0.1" + is-negative-zero "^2.0.2" is-regex "^1.1.4" is-shared-array-buffer "^1.0.1" is-string "^1.0.7" - is-weakref "^1.0.1" - object-inspect "^1.11.0" + is-weakref "^1.0.2" + object-inspect "^1.12.0" object-keys "^1.1.1" object.assign "^4.1.2" string.prototype.trimend "^1.0.4" @@ -3439,10 +3439,10 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.11.0: - version "8.11.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.11.0.tgz#88b91cfba1356fc10bb9eb592958457dfe09fb37" - integrity sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA== +eslint@^8.12.0: + version "8.12.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.12.0.tgz#c7a5bd1cfa09079aae64c9076c07eada66a46e8e" + integrity sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q== dependencies: "@eslint/eslintrc" "^1.2.1" "@humanwhocodes/config-array" "^0.9.2" @@ -4026,7 +4026,7 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-symbols@^1.0.1, has-symbols@^1.0.2: +has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== @@ -4336,7 +4336,7 @@ is-map@^2.0.1, is-map@^2.0.2: resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== -is-negative-zero@^2.0.1: +is-negative-zero@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== @@ -4457,7 +4457,7 @@ is-weakmap@^2.0.1: resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== -is-weakref@^1.0.1: +is-weakref@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== @@ -5416,12 +5416,12 @@ merge2@^1.3.0, merge2@^1.4.1: integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== dependencies: - braces "^3.0.1" - picomatch "^2.2.3" + braces "^3.0.2" + picomatch "^2.3.1" mime-db@1.52.0: version "1.52.0" @@ -5852,7 +5852,7 @@ object-assign@^4.1.0: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-inspect@^1.11.0, object-inspect@^1.9.0: +object-inspect@^1.12.0, object-inspect@^1.9.0: version "1.12.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== @@ -6189,7 +6189,7 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.3: +picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -6243,10 +6243,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.0.tgz#12f8f504c4d8ddb76475f441337542fa799207d4" - integrity sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A== +prettier@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.1.tgz#d472797e0d7461605c1609808e27b80c0f9cfe17" + integrity sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A== pretty-format@^27.0.0, pretty-format@^27.5.1: version "27.5.1" @@ -7350,10 +7350,10 @@ trim-newlines@^3.0.0: resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== -ts-jest@^27.1.3: - version "27.1.3" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.3.tgz#1f723e7e74027c4da92c0ffbd73287e8af2b2957" - integrity sha512-6Nlura7s6uM9BVUAoqLH7JHyMXjz8gluryjpPXxr3IxZdAXnU6FhjvVLHFtfd1vsE1p8zD1OJfskkc0jhTSnkA== +ts-jest@^27.1.4: + version "27.1.4" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.4.tgz#84d42cf0f4e7157a52e7c64b1492c46330943e00" + integrity sha512-qjkZlVPWVctAezwsOD1OPzbZ+k7zA5z3oxII4dGdZo5ggX/PL7kvwTM0pXTr10fAtbiVpJaL3bWd502zAhpgSQ== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" From 7d93aa18ca4943a698a34836b369090400268b86 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 10:49:30 -0700 Subject: [PATCH 21/32] docs: add cgarvis as a contributor for doc (#3443) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: 🧑🏻‍💻 Romain Marcadier --- .all-contributorsrc | 9 +++++++++ README.md | 33 +++++++++++++++++---------------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index ff4dfce7e8..ae888416e5 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1357,6 +1357,15 @@ "contributions": [ "code" ] + }, + { + "login": "cgarvis", + "name": "Chris Garvis", + "avatar_url": "https://avatars.githubusercontent.com/u/213125?v=4", + "profile": "https://github.com/cgarvis", + "contributions": [ + "doc" + ] } ], "repoType": "github", diff --git a/README.md b/README.md index 2696d48872..f8dd3174f5 100644 --- a/README.md +++ b/README.md @@ -87,145 +87,146 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Camilo Bermúdez

🐛
Campion Fellin

💻
Carter Van Deuren

🐛 +
Chris Garvis

📖
Christophe Vico

🐛 -
Christopher Currie

💻 🤔 +
Christopher Currie

💻 🤔
Christopher Rybicki

📖
CommanderRoot

💻
Cory Hall

🐛
Cristian Măgherușan-Stanciu

🐛
CyrusNajmabadi

🐛 🤔
Damian Silbergleith

💻 🐛 -
Daniel Dinu

🐛 💻 +
Daniel Dinu

🐛 💻
Daniel Schroeder

🐛 💻 📖 🤔 🚧
Dave Slotnick

🐛
Donald Stufft

🐛 💻 🤔 👀
Dongie Agnir

💻 👀
Eduardo Rabelo

📖
Eduardo Sena S. Rosa

🐛 -
Elad Ben-Israel

🐛 💻 🤔 🚧 👀 📢 +
Elad Ben-Israel

🐛 💻 🤔 🚧 👀 📢
Eli Polonsky

🐛 💻 🤔 🚧 👀
Eric Z. Beard

📆
Erik Karlsson

🐛
Eugene Kozlov

💻
Fabio Gentile

🐛
Florian Eitel

🤔 -
Graham Lea

🤔 👀 +
Graham Lea

🤔 👀
Hamza Assyad

🐛 💻 🤔 👀
Hari Pachuveetil

📝 📖
Hsing-Hui Hsu

💻 📖 🤔 👀
Ikko Ashimine

📖
James

🐛 💻
James Kelley

🐛 -
James Mead

💻 +
James Mead

💻
James Siri

💻 🚧
Jason Del Ponte

🤔 👀
Jason Fulghum

🤔 📆 👀
Jerry Kindall

📖 🤔
Jimmy Gaussen

🤔
Johannes Weber

📖 -
Jon Steinich

🐛 🤔 💻 +
Jon Steinich

🐛 🤔 💻
Joseph Lawson

👀
Joseph Martin

🐛
Junix

🐛
Justin Taylor

🐛
Kaizen Conroy

💻 🐛
Kaushik Borra

🐛 -
Kyle Thomson

💻 👀 +
Kyle Thomson

💻 👀
Leandro Padua

🐛
Liang Zhou

🐛 💻
Madeline Kusters

💻 🐛
Maja S Bratseth

🐛
Marcos Diez

🐛
Mark Nielsen

💻 -
Matthew Bonig

🐛 📝 +
Matthew Bonig

🐛 📝
Matthew Pirocchi

💻 🤔 👀
Meng Xin Zhu

🐛
Michael Neil

🚧
Mike Lane

🐛
Mitch Garnaat

🐛 💻 🤔 👀
Mitchell Valine

🐛 💻 🤔 🚧 👀 -
Mohamad Soufan

📖 +
Mohamad Soufan

📖
Mykola Mogylenko

🐛
Neta Nir

💻 🤔 🚧 👀
Nick Lynch

🐛 💻 🚧 👀
Niranjan Jayakar

🐛 💻 🤔 🚧 👀
Noah Litov

💻 🚧 👀
Otavio Macedo

💻 🐛 -
PIDZ - Bart

🤔 +
PIDZ - Bart

🤔
Peter Woodworth

🚧
Petr Kacer

🐛
Petra Barus

💻
Philip Cali

🤔
Quentin Loos

🤔
Raphael

🐛 -
Richard H Boyd

🐛 +
Richard H Boyd

🐛
Rico Huijbers

🐛 💻 🤔 🚧 👀
Romain Marcadier

🐛 💻 🎨 🤔 🚧 👀 📝
SADIK KUZU

👀
SK

🤔
Sam Fink

💻 👀
Sam Goodwin

👀 -
Sebastian Korfmann

🐛 💻 🤔 +
Sebastian Korfmann

🐛 💻 🤔
Shane Witbeck

🤔
Shiv Lakshminarayan

💻 🚧 👀
Somaya

💻 🤔 🚧 👀
The Gitter Badger

💻 🚧
Thomas Poignant

🐛
Thomas Steinbach

🐛 -
Thorsten Hoeger

💻 +
Thorsten Hoeger

💻
Tim Wagner

🐛 🤔
Tobias Lidskog

💻
Ty Coghlan

🐛
Tyler van Hensbergen

🤔
Vlad Hrybok

🐛
Vladimir Shchur

🐛 -
Yan Zhulanow

💻 +
Yan Zhulanow

💻
Yigong Liu

🐛 🤔
Zach Bienenfeld

🐛
ajnarang

🤔
aniljava

💻
arnogeurts-sqills

🐛 💻
deccy-mcc

🐛 -
dependabot-preview[bot]

🐛 🚧 +
dependabot-preview[bot]

🐛 🚧
dependabot[bot]

🚧
dheffx

🐛
gregswdl

🐛
guyroberts21

📖
mattBrzezinski

📖
mergify

🚧 -
mergify[bot]

🚧 +
mergify[bot]

🚧
seiyashima42

🐛 💻 📖
sullis

💻
vaneek

🐛 From 2ae4a1e3e20fbff85836d51a673f3a9c1af0ceea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 14:24:36 -0700 Subject: [PATCH 22/32] chore(deps): Update pytest requirement from ~=7.0 to ~=7.1 in /packages/@jsii/python-runtime (#3420) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mitchell Valine Co-authored-by: 🧑🏻‍💻 Romain Marcadier Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- packages/@jsii/python-runtime/requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@jsii/python-runtime/requirements.txt b/packages/@jsii/python-runtime/requirements.txt index 23f655542c..a2a6ce96b9 100644 --- a/packages/@jsii/python-runtime/requirements.txt +++ b/packages/@jsii/python-runtime/requirements.txt @@ -2,7 +2,8 @@ black~=22.1 mypy==0.812 pip~=21.3 ; python_version < '3.7' pip~=22.0 ; python_version >= '3.7' -pytest~=7.0 +pytest~=7.0 ; python_version < '3.7' +pytest~=7.1 ; python_version >= '3.7' pytest-mypy~=0.9 setuptools~=59.6 wheel~=0.37 From 41a0b7079f1139a0d494b3473c1995d1c7a1da43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 15:36:40 -0700 Subject: [PATCH 23/32] chore(deps): Bump actions/setup-node from 2.5.1 to 3 (#3398) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .github/workflows/main.yml | 6 +++--- .github/workflows/yarn-upgrade.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f43d0845a2..7f2b2f0b8f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,7 +41,7 @@ jobs: java-version: '8' distribution: 'zulu' - name: Set up Node 12 - uses: actions/setup-node@v2.5.1 + uses: actions/setup-node@v3 with: cache: yarn node-version: '12' @@ -135,7 +135,7 @@ jobs: java-version: '8' distribution: 'zulu' - name: Set up Node 12 - uses: actions/setup-node@v2.5.1 + uses: actions/setup-node@v3 with: cache: yarn node-version: '12' @@ -303,7 +303,7 @@ jobs: java-version: ${{ matrix.java }} distribution: 'zulu' - name: Set up Node ${{ matrix.node }} - uses: actions/setup-node@v2.5.1 + uses: actions/setup-node@v3 with: cache: yarn node-version: ${{ matrix.node }} diff --git a/.github/workflows/yarn-upgrade.yml b/.github/workflows/yarn-upgrade.yml index 9cc12c7fe9..cd433b58d0 100644 --- a/.github/workflows/yarn-upgrade.yml +++ b/.github/workflows/yarn-upgrade.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v3 - name: Set up Node - uses: actions/setup-node@v2.5.1 + uses: actions/setup-node@v3 with: cache: yarn node-version: 12 From b191f60630d513449c6771de38d2d7fcbc8d7941 Mon Sep 17 00:00:00 2001 From: kellertk Date: Thu, 31 Mar 2022 15:14:18 -0700 Subject: [PATCH 24/32] feat: Standardize issue template for discussions --- .github/ISSUE_TEMPLATE/1-bug.md | 50 -------------- .github/ISSUE_TEMPLATE/2-feature-request.md | 49 -------------- .github/ISSUE_TEMPLATE/3-guidance.md | 41 ------------ .github/ISSUE_TEMPLATE/bug-report.yml | 73 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 6 ++ .github/ISSUE_TEMPLATE/documentation.yml | 23 +++++++ .github/ISSUE_TEMPLATE/feature-request.yml | 59 +++++++++++++++++ 7 files changed, 161 insertions(+), 140 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/1-bug.md delete mode 100644 .github/ISSUE_TEMPLATE/2-feature-request.md delete mode 100644 .github/ISSUE_TEMPLATE/3-guidance.md create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/documentation.yml create mode 100644 .github/ISSUE_TEMPLATE/feature-request.yml diff --git a/.github/ISSUE_TEMPLATE/1-bug.md b/.github/ISSUE_TEMPLATE/1-bug.md deleted file mode 100644 index 0ee6e7806e..0000000000 --- a/.github/ISSUE_TEMPLATE/1-bug.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: "\U0001F41B Bug Report" -about: Report a bug -labels: bug, needs-triage ---- - -## :bug: Bug Report - -### Affected Languages - -- [ ] `TypeScript` or `Javascript` -- [ ] `Python` -- [ ] `Java` -- [ ] .NET (`C#`, `F#`, ...) -- [ ] `Go` - -### General Information -* **JSII Version:** -* **Platform:** - -### What is the problem? - - -### Verbose Log - diff --git a/.github/ISSUE_TEMPLATE/2-feature-request.md b/.github/ISSUE_TEMPLATE/2-feature-request.md deleted file mode 100644 index b1b1221ea7..0000000000 --- a/.github/ISSUE_TEMPLATE/2-feature-request.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: "\U0001F680 Feature Request" -about: Request a new feature -labels: feature-request, needs-triage ---- - -## :rocket: Feature Request - -### Affected Languages - -- [ ] `TypeScript` or `Javascript` -- [ ] `Python` -- [ ] `Java` -- [ ] .NET (`C#`, `F#`, ...) -- [ ] `Go` - -### General Information -* **JSII Version:** -* **Platform:** - -* [ ] I may be able to implement this feature request - -* [ ] This feature might incur a breaking change - -### Description - - -### Proposed Solution - diff --git a/.github/ISSUE_TEMPLATE/3-guidance.md b/.github/ISSUE_TEMPLATE/3-guidance.md deleted file mode 100644 index 263485b119..0000000000 --- a/.github/ISSUE_TEMPLATE/3-guidance.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -name: "\U00002753 Guidance" -about: Ask a general guidance -labels: guidance, needs-triage ---- - -## :question: Guidance - - - -### Affected Languages - -- [ ] `TypeScript` or `Javascript` -- [ ] `Python` -- [ ] `Java` -- [ ] .NET (`C#`, `F#`, ...) -- [ ] `Go` - -### General Information -* **JSII Version:** -* **Platform:** - -### The Question - diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000000..7dbaee37a3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,73 @@ +--- +name: "🐛 Bug Report" +description: Report a bug +title: "(short issue description)" +labels: [bug, needs-triage] +assignees: [] +body: + - type: textarea + id: description + attributes: + label: Describe the bug + description: What is the problem? A clear and concise description of the bug. + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected Behavior + description: | + What did you expect to happen? + validations: + required: true + - type: textarea + id: current + attributes: + label: Current Behavior + description: | + What actually happened? + + Please include full errors, uncaught exceptions, stack traces, and relevant logs. + If service responses are relevant, please include wire logs. + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Reproduction Steps + description: | + Provide a self-contained, concise snippet of code that can be used to reproduce the issue. + For more complex issues provide a repo with the smallest sample that reproduces the bug. + + Avoid including business logic or unrelated code, it makes diagnosis more difficult. + The code sample should be an SSCCE. See http://sscce.org/ for details. In short, please provide a code sample that we can copy/paste, run and reproduce. + validations: + required: true + - type: textarea + id: solution + attributes: + label: Possible Solution + description: | + Suggest a fix/reason for the bug + validations: + required: false + - type: textarea + id: context + attributes: + label: Additional Information/Context + description: | + Anything else that might be relevant for troubleshooting this bug. Providing context helps us come up with a solution that is most useful in the real world. + validations: + required: false + - type: input + id: sdk-version + attributes: + label: SDK version used + validations: + required: true + - type: input + id: environment + attributes: + label: Environment details (OS name and version, etc.) + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..3811bfb3f1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,6 @@ +--- +blank_issues_enabled: false +contact_links: + - name: 💬 General Question + url: https://github.com/aws/jsii/discussions/categories/q-a + about: Please ask and answer questions as a discussion thread \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml new file mode 100644 index 0000000000..c068514d13 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -0,0 +1,23 @@ +--- +name: "📕 Documentation Issue" +description: Report an issue in the API Reference documentation or Developer Guide +title: "(short issue description)" +labels: [documentation, needs-triage] +assignees: [] +body: + - type: textarea + id: description + attributes: + label: Describe the issue + description: A clear and concise description of the issue. + validations: + required: true + + - type: textarea + id: links + attributes: + label: Links + description: | + Include links to affected documentation page(s). + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 0000000000..23c385d1ef --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,59 @@ +--- +name: 🚀 Feature Request +description: Suggest an idea for this project +title: "(short issue description)" +labels: [feature-request, needs-triage] +assignees: [] +body: + - type: textarea + id: description + attributes: + label: Describe the feature + description: A clear and concise description of the feature you are proposing. + validations: + required: true + - type: textarea + id: use-case + attributes: + label: Use Case + description: | + Why do you need this feature? For example: "I'm always frustrated when..." + validations: + required: true + - type: textarea + id: solution + attributes: + label: Proposed Solution + description: | + Suggest how to implement the addition or change. Please include prototype/workaround/sketch/reference implementation. + validations: + required: false + - type: textarea + id: other + attributes: + label: Other Information + description: | + Any alternative solutions or features you considered, a more detailed explanation, stack traces, related issues, links for context, etc. + validations: + required: false + - type: checkboxes + id: ack + attributes: + label: Acknowledgements + options: + - label: I may be able to implement this feature request + required: false + - label: This feature might incur a breaking change + required: false + - type: input + id: sdk-version + attributes: + label: CDK version used + validations: + required: true + - type: input + id: environment + attributes: + label: Environment details (OS name and version, etc.) + validations: + required: true From 2be1cdece4877add50fba39b8f86f70176dfe873 Mon Sep 17 00:00:00 2001 From: Romain Marcadier Date: Mon, 4 Apr 2022 19:06:34 +0200 Subject: [PATCH 25/32] chore: make `jsii` fully synchronous (#3467) With a sample set of 1, I have detemined that there is about 30% tax caused by asynchronous functions in the compiler. The `typescript` compiler itself is fully synchronous, and we basically moved to do the same, and this turns out reducing the amount of time wasted in the runloop and in promise bookeeping. Tested on `aws-cdk-lib`, it turns out to be reducing the compile time from ~142 seconds to ~100 seconds. --- 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 --- packages/@jsii/python-runtime/.gitignore | 3 +- .../@jsii/python-runtime/build-tools/deps.ts | 6 + packages/@jsii/python-runtime/pyproject.toml | 9 +- packages/jsii-calc/test/assembly.jsii | 6 +- packages/jsii-diff/test/diagnostics.test.ts | 28 +- packages/jsii-diff/test/util.ts | 25 +- .../__snapshots__/target-dotnet.test.ts.snap | 2 +- .../__snapshots__/target-java.test.ts.snap | 4 +- .../__snapshots__/target-python.test.ts.snap | 6 +- .../test/generated-code/examples.test.ts | 2 +- .../test/__snapshots__/jsii-tree.test.ts.snap | 2 +- .../test/__snapshots__/tree.test.ts.snap | 2 +- .../jsii-reflect/test/independent.test.ts | 4 +- .../jsii-reflect/test/type-system.test.ts | 32 +-- packages/jsii-reflect/test/util.ts | 10 +- .../test/commands/extract.test.ts | 48 ++-- .../jsii-rosetta/test/commands/infuse.test.ts | 4 +- .../test/commands/transliterate.test.ts | 12 +- .../test/commands/trim-cache.test.ts | 6 +- .../jsii-rosetta/test/jsii-imports.test.ts | 25 +- .../jsii-rosetta/test/jsii/assemblies.test.ts | 4 +- .../test/record-references.test.ts | 4 +- .../jsii-rosetta/test/syntax-counter.test.ts | 6 +- packages/jsii-rosetta/test/testutil.ts | 14 +- packages/jsii-rosetta/test/translate.test.ts | 6 +- packages/jsii/bin/jsii.ts | 21 +- packages/jsii/lib/assembler.ts | 258 ++++++++---------- packages/jsii/lib/compiler.ts | 73 +++-- packages/jsii/lib/emitter.ts | 2 +- packages/jsii/lib/helpers.ts | 94 +++---- packages/jsii/lib/literate.ts | 18 +- packages/jsii/lib/project-info.ts | 40 ++- packages/jsii/lib/utils.ts | 38 +-- packages/jsii/lib/validator.ts | 6 +- packages/jsii/test/compiler.test.ts | 62 ++--- packages/jsii/test/deprecated-remover.test.ts | 36 +-- .../jsii/test/deprecation-warnings.test.ts | 118 ++++---- packages/jsii/test/docs.test.ts | 76 +++--- packages/jsii/test/enums.test.ts | 12 +- packages/jsii/test/export-specifier.test.ts | 4 +- packages/jsii/test/hints.test.ts | 8 +- packages/jsii/test/literate.test.ts | 8 +- packages/jsii/test/negatives.test.ts | 43 ++- packages/jsii/test/project-info.test.ts | 79 +++--- packages/jsii/test/quirks.test.ts | 4 +- packages/jsii/test/submodules.test.ts | 42 +-- packages/jsii/test/symbol-identifiers.test.ts | 20 +- 47 files changed, 608 insertions(+), 724 deletions(-) diff --git a/packages/@jsii/python-runtime/.gitignore b/packages/@jsii/python-runtime/.gitignore index 1580fafb23..619524466b 100644 --- a/packages/@jsii/python-runtime/.gitignore +++ b/packages/@jsii/python-runtime/.gitignore @@ -12,6 +12,7 @@ __pycache__ .mypy_cache .pytest_cache -build +# Occasionally left behind by pip, transient (safe to delete) +build/ README.md diff --git a/packages/@jsii/python-runtime/build-tools/deps.ts b/packages/@jsii/python-runtime/build-tools/deps.ts index 299093e5ca..8646a311f3 100644 --- a/packages/@jsii/python-runtime/build-tools/deps.ts +++ b/packages/@jsii/python-runtime/build-tools/deps.ts @@ -1,5 +1,6 @@ #!/usr/bin/env npx ts-node +import { removeSync } from 'fs-extra'; import { join, resolve } from 'path'; import { venv, runCommand } from './_constants'; @@ -18,3 +19,8 @@ runCommand( ['-m', 'pip', 'install', '-r', resolve(__dirname, '..', 'requirements.txt')], { env }, ); + +// Sometimes, pip leaves a `build` directory behind, which can mess with mypy +// when run with `pytest --mypy`. This directory should be transient and so we +// simply clean it up here. +removeSync(resolve(__dirname, '..', 'build')); diff --git a/packages/@jsii/python-runtime/pyproject.toml b/packages/@jsii/python-runtime/pyproject.toml index 5ebecdc3bb..12bd6ac191 100644 --- a/packages/@jsii/python-runtime/pyproject.toml +++ b/packages/@jsii/python-runtime/pyproject.toml @@ -1,12 +1,11 @@ [build-system] -requires = [ - "pip~=20.2", - "setuptools~=50.3", - "wheel~=0.35", -] +requires = ["pip~=20.2", "setuptools~=50.3", "wheel~=0.35"] build-backend = 'setuptools.build_meta' [tool.black] target-version = ['py36', 'py37', 'py38'] include = '\.pyi?$' exclude = '\.(git|mypy_cache|env)' + +[tool.mypy] +ignore_missing_imports = true diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii index fa9482fec6..dd1e6075af 100644 --- a/packages/jsii-calc/test/assembly.jsii +++ b/packages/jsii-calc/test/assembly.jsii @@ -1128,10 +1128,10 @@ "primitive": "number" }, { - "fqn": "jsii-calc.Multiply" + "fqn": "@scope/jsii-calc-lib.Number" }, { - "fqn": "@scope/jsii-calc-lib.Number" + "fqn": "jsii-calc.Multiply" } ] } @@ -16931,5 +16931,5 @@ } }, "version": "3.20.120", - "fingerprint": "sqJBfFAp4Hg5OgntWB3IRyRS7mpPF7G3qoh4NYSDeSw=" + "fingerprint": "x8U5PHtkMg1Me8BU5rwy98qvqY6p+AhernFr4narjHc=" } diff --git a/packages/jsii-diff/test/diagnostics.test.ts b/packages/jsii-diff/test/diagnostics.test.ts index 54c5c63495..1f65b14f08 100644 --- a/packages/jsii-diff/test/diagnostics.test.ts +++ b/packages/jsii-diff/test/diagnostics.test.ts @@ -2,8 +2,8 @@ import { classifyDiagnostics, hasErrors } from '../lib/diagnostics'; import { compare } from './util'; // ---------------------------------------------------------------------- -test('experimental elements lead to warnings', async () => { - const mms = await compare( +test('experimental elements lead to warnings', () => { + const mms = compare( ` /** @experimental */ export class Foo1 { } @@ -21,8 +21,8 @@ test('experimental elements lead to warnings', async () => { }); // ---------------------------------------------------------------------- -test('external stability violations are reported as warnings', async () => { - const mms = await compare( +test('external stability violations are reported as warnings', () => { + const mms = compare( ` /** @stability external */ export class Foo1 { } @@ -40,8 +40,8 @@ test('external stability violations are reported as warnings', async () => { }); // ---------------------------------------------------------------------- -test('warnings can be turned into errors', async () => { - const mms = await compare( +test('warnings can be turned into errors', () => { + const mms = compare( ` /** @experimental */ export class Foo1 { } @@ -59,8 +59,8 @@ test('warnings can be turned into errors', async () => { }); // ---------------------------------------------------------------------- -test('external stability violations are never turned into errors', async () => { - const mms = await compare( +test('external stability violations are never turned into errors', () => { + const mms = compare( ` /** @stability external */ export class Foo1 { } @@ -78,8 +78,8 @@ test('external stability violations are never turned into errors', async () => { }); // ---------------------------------------------------------------------- -test('errors can be skipped', async () => { - const mms = await compare( +test('errors can be skipped', () => { + const mms = compare( ` export class Foo1 { } `, @@ -100,8 +100,8 @@ test('errors can be skipped', async () => { }); // ---------------------------------------------------------------------- -test('changing stable to experimental is breaking', async () => { - const mms = await compare( +test('changing stable to experimental is breaking', () => { + const mms = compare( ` /** @stable */ export class Foo1 { } @@ -128,8 +128,8 @@ test('changing stable to experimental is breaking', async () => { // ---------------------------------------------------------------------- -test('can make fields optional in output struct if it is marked @external', async () => { - const mms = await compare( +test('can make fields optional in output struct if it is marked @external', () => { + const mms = compare( ` /** @stability external */ export interface TheStruct { diff --git a/packages/jsii-diff/test/util.ts b/packages/jsii-diff/test/util.ts index e9442683d1..19708aba42 100644 --- a/packages/jsii-diff/test/util.ts +++ b/packages/jsii-diff/test/util.ts @@ -4,25 +4,25 @@ import * as reflect from 'jsii-reflect'; import { compareAssemblies } from '../lib'; import { Mismatches } from '../lib/types'; -export async function expectNoError(original: string, updated: string) { - const mms = await compare(original, updated); +export function expectNoError(original: string, updated: string) { + const mms = compare(original, updated); for (const msg of mms.messages()) { console.error(`- ${msg}`); } expect(mms.count).toBe(0); } -export async function expectError( +export function expectError( error: RegExp | undefined, original: string, updated: string, ) { if (error == null) { - await expectNoError(original, updated); + expectNoError(original, updated); return; } - const mms = await compare(original, updated); + const mms = compare(original, updated); expect(mms.count).not.toBe(0); const msgs = Array.from(mms.messages()); @@ -32,23 +32,14 @@ export async function expectError( } } -export async function compare( - original: string, - updated: string, -): Promise { +export function compare(original: string, updated: string): Mismatches { const ass1 = sourceToAssemblyHelper(original); - await expect(ass1).resolves.not.toThrowError(); const ts1 = new reflect.TypeSystem(); - const originalAssembly = ts1.addAssembly( - new reflect.Assembly(ts1, await ass1), - ); + const originalAssembly = ts1.addAssembly(new reflect.Assembly(ts1, ass1)); const ass2 = sourceToAssemblyHelper(updated); - await expect(ass2).resolves.not.toThrowError(); const ts2 = new reflect.TypeSystem(); - const updatedAssembly = ts2.addAssembly( - new reflect.Assembly(ts2, await ass2), - ); + const updatedAssembly = ts2.addAssembly(new reflect.Assembly(ts2, ass2)); return compareAssemblies(originalAssembly, updatedAssembly); } diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap index 0706c2d65d..8e3462db3f 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.ts.snap @@ -3580,7 +3580,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace set => SetInstanceProperty(value); } - [JsiiProperty(name: "unionProperty", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"string\\"},{\\"primitive\\":\\"number\\"},{\\"fqn\\":\\"jsii-calc.Multiply\\"},{\\"fqn\\":\\"@scope/jsii-calc-lib.Number\\"}]}}")] + [JsiiProperty(name: "unionProperty", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"string\\"},{\\"primitive\\":\\"number\\"},{\\"fqn\\":\\"@scope/jsii-calc-lib.Number\\"},{\\"fqn\\":\\"jsii-calc.Multiply\\"}]}}")] public virtual object UnionProperty { get => GetInstanceProperty()!; diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap index c53ae547ce..084edb15ee 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap @@ -4950,14 +4950,14 @@ public class AllTypes extends software.amazon.jsii.JsiiObject { /** */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) - public void setUnionProperty(final @org.jetbrains.annotations.NotNull software.amazon.jsii.tests.calculator.Multiply value) { + public void setUnionProperty(final @org.jetbrains.annotations.NotNull software.amazon.jsii.tests.calculator.lib.Number value) { software.amazon.jsii.Kernel.set(this, "unionProperty", java.util.Objects.requireNonNull(value, "unionProperty is required")); } /** */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) - public void setUnionProperty(final @org.jetbrains.annotations.NotNull software.amazon.jsii.tests.calculator.lib.Number value) { + public void setUnionProperty(final @org.jetbrains.annotations.NotNull software.amazon.jsii.tests.calculator.Multiply value) { software.amazon.jsii.Kernel.set(this, "unionProperty", java.util.Objects.requireNonNull(value, "unionProperty is required")); } diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap index ffa402e6de..40cb873524 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap @@ -2832,13 +2832,13 @@ class AllTypes(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.AllTypes"): @jsii.member(jsii_name="unionProperty") def union_property( self, - ) -> typing.Union[builtins.str, jsii.Number, "Multiply", scope.jsii_calc_lib.Number]: - return typing.cast(typing.Union[builtins.str, jsii.Number, "Multiply", scope.jsii_calc_lib.Number], jsii.get(self, "unionProperty")) + ) -> typing.Union[builtins.str, jsii.Number, scope.jsii_calc_lib.Number, "Multiply"]: + return typing.cast(typing.Union[builtins.str, jsii.Number, scope.jsii_calc_lib.Number, "Multiply"], jsii.get(self, "unionProperty")) @union_property.setter def union_property( self, - value: typing.Union[builtins.str, jsii.Number, "Multiply", scope.jsii_calc_lib.Number], + value: typing.Union[builtins.str, jsii.Number, scope.jsii_calc_lib.Number, "Multiply"], ) -> None: jsii.set(self, "unionProperty", value) diff --git a/packages/jsii-pacmak/test/generated-code/examples.test.ts b/packages/jsii-pacmak/test/generated-code/examples.test.ts index 54f7451663..9d478942e2 100644 --- a/packages/jsii-pacmak/test/generated-code/examples.test.ts +++ b/packages/jsii-pacmak/test/generated-code/examples.test.ts @@ -13,7 +13,7 @@ for (const name of fs.readdirSync(EXAMPLES_ROOT)) { const file = path.join(EXAMPLES_ROOT, name); test(name, async () => { const source = await fs.readFile(file, 'utf8'); - const compiled = await jsii.compileJsiiForTest(source); + const compiled = jsii.compileJsiiForTest(source); const targets: AssemblyTargets = { dotnet: { diff --git a/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap index 5aa58e66c2..a74e0b7e51 100644 --- a/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap @@ -631,7 +631,7 @@ exports[`jsii-tree --all 1`] = ` │ │ ├─┬ unionMapProperty property (stable) │ │ │ └── type: Map string | number | @scope/jsii-calc-lib.Number> │ │ ├─┬ unionProperty property (stable) - │ │ │ └── type: string | number | jsii-calc.Multiply | @scope/jsii-calc-lib.Number + │ │ │ └── type: string | number | @scope/jsii-calc-lib.Number | jsii-calc.Multiply │ │ ├─┬ unknownArrayProperty property (stable) │ │ │ └── type: Array │ │ ├─┬ unknownMapProperty property (stable) diff --git a/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap index e69a0d7e27..bf8838a7ff 100644 --- a/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap @@ -781,7 +781,7 @@ exports[`showAll 1`] = ` │ │ ├─┬ unionMapProperty property │ │ │ └── type: Map string | number | @scope/jsii-calc-lib.Number> │ │ ├─┬ unionProperty property - │ │ │ └── type: string | number | jsii-calc.Multiply | @scope/jsii-calc-lib.Number + │ │ │ └── type: string | number | @scope/jsii-calc-lib.Number | jsii-calc.Multiply │ │ ├─┬ unknownArrayProperty property │ │ │ └── type: Array │ │ ├─┬ unknownMapProperty property diff --git a/packages/jsii-reflect/test/independent.test.ts b/packages/jsii-reflect/test/independent.test.ts index b059ba88b5..fdbac01970 100644 --- a/packages/jsii-reflect/test/independent.test.ts +++ b/packages/jsii-reflect/test/independent.test.ts @@ -1,9 +1,9 @@ import * as reflect from '../lib'; import { assemblyFromSource } from './util'; -test('get full github source location for a class or method', async () => { +test('get full github source location for a class or method', () => { // WHEN - const assembly = await assemblyFromSource( + const assembly = assemblyFromSource( ` export class Foo { public bar() { diff --git a/packages/jsii-reflect/test/type-system.test.ts b/packages/jsii-reflect/test/type-system.test.ts index ef799095ab..0207c81b1f 100644 --- a/packages/jsii-reflect/test/type-system.test.ts +++ b/packages/jsii-reflect/test/type-system.test.ts @@ -203,8 +203,8 @@ test('Submodules can have a README', () => { ); }); -test('overridden member knows about both parent types', async () => { - const ts = await typeSystemFromSource(` +test('overridden member knows about both parent types', () => { + const ts = typeSystemFromSource(` export class Foo { public bar() { Array.isArray(3); @@ -256,8 +256,8 @@ describe('Stability', () => { // ---------------------------------------------------------------------- describe('lowest stability guarantee is advertised', () => { - test('when subclass is experimental', async () => { - const ts = await typeSystemFromSource(` + test('when subclass is experimental', () => { + const ts = typeSystemFromSource(` /** * @stable */ @@ -285,8 +285,8 @@ describe('Stability', () => { expect(method.docs.stability).toEqual(Stability.Experimental); }); - test('when method is experimental', async () => { - const ts = await typeSystemFromSource(` + test('when method is experimental', () => { + const ts = typeSystemFromSource(` /** * @stable */ @@ -321,8 +321,8 @@ describe('Stability', () => { expect(method.docs.stability).toEqual(Stability.Experimental); }); - test('when method is explicitly marked stable', async () => { - const ts = await typeSystemFromSource(` + test('when method is explicitly marked stable', () => { + const ts = typeSystemFromSource(` /** * @stable */ @@ -357,8 +357,8 @@ describe('Stability', () => { expect(method.docs.stability).toEqual(Stability.Experimental); }); - test('external stability', async () => { - const ts = await typeSystemFromSource(` + test('external stability', () => { + const ts = typeSystemFromSource(` /** * @stability external */ @@ -383,8 +383,8 @@ describe('Stability', () => { }); }); -test('TypeSystem.properties', async () => { - const ts = await typeSystemFromSource(` +test('TypeSystem.properties', () => { + const ts = typeSystemFromSource(` export namespace submodule { export class Foo { public readonly test = 'TEST'; @@ -397,8 +397,8 @@ test('TypeSystem.properties', async () => { expect(ts.properties).toHaveLength(2); }); -test('TypeSystem.methods', async () => { - const ts = await typeSystemFromSource(` +test('TypeSystem.methods', () => { + const ts = typeSystemFromSource(` export namespace submodule { export class Foo { public method(): void {} @@ -411,8 +411,8 @@ test('TypeSystem.methods', async () => { expect(ts.methods).toHaveLength(2); }); -test('Assembly allTypes includes submodule types', async () => { - const asm = await assemblyFromSource({ +test('Assembly allTypes includes submodule types', () => { + const asm = assemblyFromSource({ 'index.ts': 'export * as submod from "./submod";', 'submod.ts': `export class Foo {}`, }); diff --git a/packages/jsii-reflect/test/util.ts b/packages/jsii-reflect/test/util.ts index 575213a6a6..a1242a1c43 100644 --- a/packages/jsii-reflect/test/util.ts +++ b/packages/jsii-reflect/test/util.ts @@ -2,19 +2,19 @@ import { sourceToAssemblyHelper, MultipleSourceFiles, PackageInfo } from 'jsii'; import { Assembly, TypeSystem } from '../lib'; -export async function typeSystemFromSource( +export function typeSystemFromSource( source: string | MultipleSourceFiles, cb?: (obj: PackageInfo) => void, ) { - const asm = await assemblyFromSource(source, cb); + const asm = assemblyFromSource(source, cb); return asm.system; } -export async function assemblyFromSource( +export function assemblyFromSource( source: string | MultipleSourceFiles, cb?: (obj: PackageInfo) => void, -): Promise { - const ass = await sourceToAssemblyHelper(source, cb); +): Assembly { + const ass = sourceToAssemblyHelper(source, cb); const ts = new TypeSystem(); return ts.addAssembly(new Assembly(ts, ass)); } diff --git a/packages/jsii-rosetta/test/commands/extract.test.ts b/packages/jsii-rosetta/test/commands/extract.test.ts index 1fae776890..f85ce17322 100644 --- a/packages/jsii-rosetta/test/commands/extract.test.ts +++ b/packages/jsii-rosetta/test/commands/extract.test.ts @@ -34,9 +34,9 @@ const defaultExtractOptions = { }; let assembly: TestJsiiModule; -beforeEach(async () => { +beforeEach(() => { // Create an assembly in a temp directory - assembly = await TestJsiiModule.fromSource( + assembly = TestJsiiModule.fromSource( { 'index.ts': ` export class ClassA { @@ -57,7 +57,7 @@ beforeEach(async () => { ); }); -afterEach(async () => assembly.cleanup()); +afterEach(() => assembly.cleanup()); test('extract samples from test assembly', async () => { const cacheToFile = path.join(assembly.moduleDirectory, 'test.tabl.json'); @@ -267,7 +267,7 @@ describe('non-compiling cached examples', () => { let cacheToFile: string; beforeEach(async () => { // Create an assembly in a temp directory - otherAssembly = await TestJsiiModule.fromSource( + otherAssembly = TestJsiiModule.fromSource( { 'index.ts': ` export class ClassA { @@ -300,7 +300,7 @@ describe('non-compiling cached examples', () => { expect(tr?.snippet.didCompile).toBeFalsy(); }); - afterEach(async () => assembly.cleanup()); + afterEach(() => assembly.cleanup()); test('are ignored with strict mode', async () => { // second run of extract snippets should still evaluate the snippet @@ -333,7 +333,7 @@ describe('non-compiling cached examples', () => { test('do not ignore example strings', async () => { // Create an assembly in a temp directory - const otherAssembly = await TestJsiiModule.fromSource( + const otherAssembly = TestJsiiModule.fromSource( { 'index.ts': ` export class ClassA { @@ -363,14 +363,14 @@ test('do not ignore example strings', async () => { const tr = tablet.tryGetSnippet(tablet.snippetKeys[0]); expect(tr?.originalSource.source).toEqual('x'); } finally { - await otherAssembly.cleanup(); + otherAssembly.cleanup(); } }); describe('can find fqns via symbolId when ', () => { test('there is an outDir', async () => { const outDir = 'jsii-outDir'; - const otherAssembly = await createAssemblyWithDirectories(undefined, outDir); + const otherAssembly = createAssemblyWithDirectories(undefined, outDir); try { const outputFile = path.join(otherAssembly.moduleDirectory, 'test.tabl.json'); await extract.extractSnippets([otherAssembly.moduleDirectory], { @@ -382,14 +382,14 @@ describe('can find fqns via symbolId when ', () => { const tr = tablet.tryGetSnippet(tablet.snippetKeys[0]); expect(tr?.fqnsReferenced()).toEqual(['my_assembly.ClassA']); } finally { - await otherAssembly.cleanup(); + otherAssembly.cleanup(); } }); test('there is an outDir and rootDir', async () => { const outDir = 'jsii-outDir'; const rootDir = '.'; - const otherAssembly = await createAssemblyWithDirectories(rootDir, outDir); + const otherAssembly = createAssemblyWithDirectories(rootDir, outDir); try { const outputFile = path.join(otherAssembly.moduleDirectory, 'test.tabl.json'); await extract.extractSnippets([otherAssembly.moduleDirectory], { @@ -401,7 +401,7 @@ describe('can find fqns via symbolId when ', () => { const tr = tablet.tryGetSnippet(tablet.snippetKeys[0]); expect(tr?.fqnsReferenced()).toEqual(['my_assembly.ClassA']); } finally { - await otherAssembly.cleanup(); + otherAssembly.cleanup(); } }); }); @@ -438,8 +438,8 @@ test('extract and infuse in one command', async () => { describe('infused examples', () => { let infusedAssembly: TestJsiiModule; - beforeEach(async () => { - infusedAssembly = await TestJsiiModule.fromSource( + beforeEach(() => { + infusedAssembly = TestJsiiModule.fromSource( { 'index.ts': ` /** @@ -461,8 +461,8 @@ describe('infused examples', () => { ); }); - afterEach(async () => { - await infusedAssembly.cleanup(); + afterEach(() => { + infusedAssembly.cleanup(); }); test('always returned from cache', async () => { @@ -526,7 +526,7 @@ describe('infused examples', () => { test('can use additional dependencies from monorepo', async () => { logging.configure({ level: logging.Level.VERBOSE }); - const asm = await TestJsiiModule.fromSource( + const asm = TestJsiiModule.fromSource( { 'index.ts': ` /** @@ -555,8 +555,8 @@ test('can use additional dependencies from monorepo', async () => { ); try { // GIVEN - install some random other module - await asm.workspace.addDependency( - await compileJsiiForTest( + asm.workspace.addDependency( + compileJsiiForTest( { 'index.ts': 'export class SomeClass { }', }, @@ -576,12 +576,12 @@ test('can use additional dependencies from monorepo', async () => { await extract.extractSnippets([asm.moduleDirectory], defaultExtractOptions); // THEN -- did not throw an error } finally { - await asm.cleanup(); + asm.cleanup(); } }); test('can use additional dependencies from NPM', async () => { - const asm = await TestJsiiModule.fromSource( + const asm = TestJsiiModule.fromSource( { 'index.ts': ` /** @@ -613,12 +613,12 @@ test('can use additional dependencies from NPM', async () => { await extract.extractSnippets([asm.moduleDirectory], defaultExtractOptions); // THEN -- did not throw an error } finally { - await asm.cleanup(); + asm.cleanup(); } }); test('infused examples have no diagnostics', async () => { - const otherAssembly = await TestJsiiModule.fromSource( + const otherAssembly = TestJsiiModule.fromSource( { 'index.ts': ` /** @@ -651,7 +651,7 @@ test('infused examples have no diagnostics', async () => { expect(results.diagnostics).toEqual([]); } finally { - await otherAssembly.cleanup(); + otherAssembly.cleanup(); } }); @@ -662,7 +662,7 @@ class MockTranslator extends RosettaTranslator { } } -async function createAssemblyWithDirectories(rootDir?: string, outDir?: string) { +function createAssemblyWithDirectories(rootDir?: string, outDir?: string) { return TestJsiiModule.fromSource( { 'index.ts': ` diff --git a/packages/jsii-rosetta/test/commands/infuse.test.ts b/packages/jsii-rosetta/test/commands/infuse.test.ts index f8e8b7c316..d0a20ea54b 100644 --- a/packages/jsii-rosetta/test/commands/infuse.test.ts +++ b/packages/jsii-rosetta/test/commands/infuse.test.ts @@ -25,7 +25,7 @@ const TABLET_FILE = 'text.tabl.json'; let assembly: TestJsiiModule; beforeEach(async () => { // Create an assembly in a temp directory - assembly = await TestJsiiModule.fromSource( + assembly = TestJsiiModule.fromSource( { 'index.ts': ` export class ClassA { @@ -56,7 +56,7 @@ beforeEach(async () => { }); }); -afterEach(async () => assembly.cleanup()); +afterEach(() => assembly.cleanup()); test('examples are added in the assembly', async () => { await infuse([assembly.moduleDirectory]); diff --git a/packages/jsii-rosetta/test/commands/transliterate.test.ts b/packages/jsii-rosetta/test/commands/transliterate.test.ts index 0924b5acd2..c6797f4cbd 100644 --- a/packages/jsii-rosetta/test/commands/transliterate.test.ts +++ b/packages/jsii-rosetta/test/commands/transliterate.test.ts @@ -14,7 +14,7 @@ jest.setTimeout(60_000); test('single assembly, all languages', () => withTemporaryDirectory(async (tmpDir) => { // GIVEN - const compilationResult = await jsii.compileJsiiForTest({ + const compilationResult = jsii.compileJsiiForTest({ 'README.md': ` # README \`\`\`ts @@ -890,7 +890,7 @@ export class ClassName implements IInterface { test('single assembly, loose mode', () => withTemporaryDirectory(async (tmpDir) => { // GIVEN - const compilationResult = await jsii.compileJsiiForTest({ + const compilationResult = jsii.compileJsiiForTest({ 'README.md': ` # Missing literate source @@ -1249,7 +1249,7 @@ new SampleClass('omitted-literate'); test('single assembly with example metadata', () => withTemporaryDirectory(async (tmpDir) => { // GIVEN - const compilationResult = await jsii.compileJsiiForTest({ + const compilationResult = jsii.compileJsiiForTest({ 'index.ts': ` /** * @exampleMetadata fixture=custom @@ -1349,7 +1349,7 @@ export class ClassName implements IInterface { })); test('will read translations from cache even if they are dirty', async () => { - const infusedAssembly = await TestJsiiModule.fromSource( + const infusedAssembly = TestJsiiModule.fromSource( { 'index.ts': ` /** @@ -1388,14 +1388,14 @@ test('will read translations from cache even if they are dirty', async () => { const translated: Assembly = await fs.readJson(path.join(infusedAssembly.moduleDirectory, '.jsii.python')); expect(translated.types?.['my_assembly.ClassA'].docs?.example).toEqual('oops'); } finally { - await infusedAssembly.cleanup(); + infusedAssembly.cleanup(); } }); test('will output to specified directory', async () => withTemporaryDirectory(async (tmpDir) => { // GIVEN - const compilationResult = await jsii.compileJsiiForTest({ + const compilationResult = jsii.compileJsiiForTest({ 'README.md': ` # README \`\`\`ts diff --git a/packages/jsii-rosetta/test/commands/trim-cache.test.ts b/packages/jsii-rosetta/test/commands/trim-cache.test.ts index d5649356d6..27046cc301 100644 --- a/packages/jsii-rosetta/test/commands/trim-cache.test.ts +++ b/packages/jsii-rosetta/test/commands/trim-cache.test.ts @@ -16,9 +16,9 @@ const DUMMY_README = ` `; let assembly: TestJsiiModule; -beforeEach(async () => { +beforeEach(() => { // Create an assembly in a temp directory - assembly = await TestJsiiModule.fromSource( + assembly = TestJsiiModule.fromSource( { 'index.ts': ` export class ClassA { @@ -39,7 +39,7 @@ beforeEach(async () => { ); }); -afterEach(async () => assembly.cleanup()); +afterEach(() => assembly.cleanup()); test('trim-cache removes unused snippets', async () => { const cacheFile = path.join(assembly.moduleDirectory, 'dummy.tabl.json'); diff --git a/packages/jsii-rosetta/test/jsii-imports.test.ts b/packages/jsii-rosetta/test/jsii-imports.test.ts index 2cd61f9d86..d388b79e70 100644 --- a/packages/jsii-rosetta/test/jsii-imports.test.ts +++ b/packages/jsii-rosetta/test/jsii-imports.test.ts @@ -10,8 +10,8 @@ import { MultipleSources, TestJsiiModule, DUMMY_JSII_CONFIG } from './testutil'; describe('no submodule', () => { describe('top-level struct', () => { let module: TestJsiiModule; - beforeAll(async () => { - module = await makeJsiiModule({ withModule: false, nestedStruct: false }); + beforeAll(() => { + module = makeJsiiModule({ withModule: false, nestedStruct: false }); }); afterAll(() => module.cleanup()); @@ -103,8 +103,8 @@ describe('no submodule', () => { describe('nested struct', () => { let module: TestJsiiModule; - beforeAll(async () => { - module = await makeJsiiModule({ withModule: false, nestedStruct: true }); + beforeAll(() => { + module = makeJsiiModule({ withModule: false, nestedStruct: true }); }); afterAll(() => module.cleanup()); @@ -193,8 +193,8 @@ describe('no submodule', () => { describe('enum', () => { let module: TestJsiiModule; - beforeAll(async () => { - module = await TestJsiiModule.fromSource( + beforeAll(() => { + module = TestJsiiModule.fromSource( { 'index.ts': `export enum MyEnum { OPTION_A = 'a', OPTION_B = 'b' } @@ -320,8 +320,8 @@ describe('no submodule', () => { describe('with submodule', () => { describe('top-level struct', () => { let module: TestJsiiModule; - beforeAll(async () => { - module = await makeJsiiModule({ withModule: true, nestedStruct: false }); + beforeAll(() => { + module = makeJsiiModule({ withModule: true, nestedStruct: false }); }); afterAll(() => module.cleanup()); @@ -370,8 +370,8 @@ describe('with submodule', () => { describe('nested struct', () => { let module: TestJsiiModule; - beforeAll(async () => { - module = await makeJsiiModule({ withModule: true, nestedStruct: true }); + beforeAll(() => { + module = makeJsiiModule({ withModule: true, nestedStruct: true }); }); afterAll(() => module.cleanup()); @@ -419,10 +419,7 @@ describe('with submodule', () => { }); }); -async function makeJsiiModule(options: { - readonly withModule: boolean; - readonly nestedStruct: boolean; -}): Promise { +function makeJsiiModule(options: { readonly withModule: boolean; readonly nestedStruct: boolean }): TestJsiiModule { const nsRef = options.nestedStruct ? 'MyClass.' : ''; const nsDeclBegin = options.nestedStruct ? 'export namespace MyClass {\n' : ''; const nsDeclEnd = options.nestedStruct ? '}' : ''; diff --git a/packages/jsii-rosetta/test/jsii/assemblies.test.ts b/packages/jsii-rosetta/test/jsii/assemblies.test.ts index a5cf9d0d7a..0cc73b8597 100644 --- a/packages/jsii-rosetta/test/jsii/assemblies.test.ts +++ b/packages/jsii-rosetta/test/jsii/assemblies.test.ts @@ -234,7 +234,7 @@ test('Backwards compatibility with literate integ tests', async () => { }); test('rosetta fixture from submodule is preferred if it exists', async () => { - const jsiiModule = await TestJsiiModule.fromSource( + const jsiiModule = TestJsiiModule.fromSource( { 'index.ts': 'export * as submodule from "./submodule"', 'submodule.ts': ` @@ -268,6 +268,6 @@ test('rosetta fixture from submodule is preferred if it exists', async () => { expect(snippets[0].completeSource).toMatch(/^pick me/); } finally { - await jsiiModule.cleanup(); + jsiiModule.cleanup(); } }); diff --git a/packages/jsii-rosetta/test/record-references.test.ts b/packages/jsii-rosetta/test/record-references.test.ts index 72fd3d6bcc..db8e18f975 100644 --- a/packages/jsii-rosetta/test/record-references.test.ts +++ b/packages/jsii-rosetta/test/record-references.test.ts @@ -1,8 +1,8 @@ import { TestJsiiModule, DUMMY_JSII_CONFIG } from './testutil'; let assembly: TestJsiiModule; -beforeAll(async () => { - assembly = await TestJsiiModule.fromSource( +beforeAll(() => { + assembly = TestJsiiModule.fromSource( { 'index.ts': ` export class ClassA { diff --git a/packages/jsii-rosetta/test/syntax-counter.test.ts b/packages/jsii-rosetta/test/syntax-counter.test.ts index 2f3a424c26..003ba7bc7e 100644 --- a/packages/jsii-rosetta/test/syntax-counter.test.ts +++ b/packages/jsii-rosetta/test/syntax-counter.test.ts @@ -1,8 +1,8 @@ import { TestJsiiModule, DUMMY_JSII_CONFIG } from './testutil'; let assembly: TestJsiiModule; -beforeAll(async () => { - assembly = await TestJsiiModule.fromSource( +beforeAll(() => { + assembly = TestJsiiModule.fromSource( ` export class ClassA { public someMethod() { @@ -22,7 +22,7 @@ beforeAll(async () => { }, ); }); -afterAll(async () => assembly.cleanup()); +afterAll(() => assembly.cleanup()); test('generate syntax counter', () => { const translator = assembly.successfullyCompile(` diff --git a/packages/jsii-rosetta/test/testutil.ts b/packages/jsii-rosetta/test/testutil.ts index 1c3011da63..93a90c7606 100644 --- a/packages/jsii-rosetta/test/testutil.ts +++ b/packages/jsii-rosetta/test/testutil.ts @@ -19,16 +19,16 @@ export type MultipleSources = { [key: string]: string; 'index.ts': string }; * Compile a jsii module from source, and produce an environment in which it is available as a module */ export class TestJsiiModule { - public static async fromSource( + public static fromSource( source: string | MultipleSources, packageInfo: Partial & { name: string; main?: string; types?: string }, - ) { - const asm = await compileJsiiForTest(source, (pi) => { + ): TestJsiiModule { + const asm = compileJsiiForTest(source, (pi) => { Object.assign(pi, packageInfo); }); - const ws = await TestWorkspace.create(); - await ws.addDependency(asm); + const ws = TestWorkspace.create(); + ws.addDependency(asm); return new TestJsiiModule(asm.assembly, ws); } @@ -84,8 +84,8 @@ export class TestJsiiModule { await fs.writeJSON(path.join(this.moduleDirectory, '.jsii'), this.assembly); } - public async cleanup() { - await this.workspace.cleanup(); + public cleanup() { + this.workspace.cleanup(); } } diff --git a/packages/jsii-rosetta/test/translate.test.ts b/packages/jsii-rosetta/test/translate.test.ts index 766c8692ac..2eaf1b762f 100644 --- a/packages/jsii-rosetta/test/translate.test.ts +++ b/packages/jsii-rosetta/test/translate.test.ts @@ -184,9 +184,9 @@ test('refuse to translate object literal with function member in shorthand prope ); }); -test('declarations are translated correctly in all jsii languages', async () => { +test('declarations are translated correctly in all jsii languages', () => { // Create an assembly in a temp directory - const assembly = await TestJsiiModule.fromSource( + const assembly = TestJsiiModule.fromSource( { 'index.ts': ` export class ClassA { @@ -215,6 +215,6 @@ test('declarations are translated correctly in all jsii languages', async () => expect(ts.get(TargetLanguage.JAVA)?.source).toEqual(['import example.test.demo.*;', 'ClassA classA;'].join('\n')); expect(ts.get(TargetLanguage.CSHARP)?.source).toEqual(['using Example.Test.Demo;', 'ClassA classA;'].join('\n')); } finally { - await assembly.cleanup(); + assembly.cleanup(); } }); diff --git a/packages/jsii/bin/jsii.ts b/packages/jsii/bin/jsii.ts index a3bc2f301e..9e2a2845e9 100644 --- a/packages/jsii/bin/jsii.ts +++ b/packages/jsii/bin/jsii.ts @@ -14,7 +14,7 @@ import { enabledWarnings } from '../lib/warnings'; const warningTypes = Object.keys(enabledWarnings); -(async () => { +(() => { const argv = yargs .env('JSII') .command( @@ -90,7 +90,7 @@ const warningTypes = Object.keys(enabledWarnings); ); const { projectInfo, diagnostics: projectInfoDiagnostics } = - await loadProjectInfo(projectRoot); + loadProjectInfo(projectRoot); // disable all silenced warnings for (const key of argv['silence-warnings']) { @@ -117,7 +117,7 @@ const warningTypes = Object.keys(enabledWarnings); generateTypeScriptConfig: argv['generate-tsconfig'], }); - const emitResult = await (argv.watch ? compiler.watch() : compiler.emit()); + const emitResult = argv.watch ? compiler.watch() : compiler.emit(); const allDiagnostics = [...projectInfoDiagnostics, ...emitResult.diagnostics]; @@ -127,17 +127,14 @@ const warningTypes = Object.keys(enabledWarnings); if (emitResult.emitSkipped) { process.exitCode = 1; } -})().catch((e) => { - console.error(`Error: ${e.stack}`); - process.exitCode = -1; -}); +})(); function _configureLog4js(verbosity: number) { const stderrColor = !!process.stderr.isTTY; const stdoutColor = !!process.stdout.isTTY; log4js.addLayout('passThroughNoColor', () => { - return (loggingEvent) => stripAnsi(util.format(...loggingEvent.data)); + return (loggingEvent) => utils.stripAnsi(util.format(...loggingEvent.data)); }); log4js.configure({ @@ -180,11 +177,3 @@ function _configureLog4js(verbosity: number) { } } } - -const ANSI_REGEX = - // eslint-disable-next-line no-control-regex - /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; - -function stripAnsi(x: string): string { - return x.replace(ANSI_REGEX, ''); -} diff --git a/packages/jsii/lib/assembler.ts b/packages/jsii/lib/assembler.ts index 2ad44b60da..c9cef41169 100644 --- a/packages/jsii/lib/assembler.ts +++ b/packages/jsii/lib/assembler.ts @@ -142,7 +142,7 @@ export class Assembler implements Emitter { * * @return the result of the assembly emission. */ - public async emit(): Promise { + public emit(): ts.EmitResult { this._diagnostics = []; if (!this.projectInfo.description) { this._diagnostics.push( @@ -154,7 +154,7 @@ export class Assembler implements Emitter { JsiiDiagnostic.JSII_0002_PKG_MISSING_HOMEPAGE.createDetached(), ); } - const readme = await _loadReadme.call(this); + const readme = _loadReadme.call(this); if (readme == null) { this._diagnostics.push( JsiiDiagnostic.JSII_0003_MISSING_README.createDetached(), @@ -164,7 +164,6 @@ export class Assembler implements Emitter { this._types = {}; this._deferred = []; - const visitPromises = new Array>(); const sourceFile = this.program.getSourceFile(this.mainFile); @@ -175,7 +174,7 @@ export class Assembler implements Emitter { ), ); } else { - await this._registerDependenciesNamespaces(sourceFile); + this._registerDependenciesNamespaces(sourceFile); if (LOG.isTraceEnabled()) { LOG.trace( @@ -187,24 +186,18 @@ export class Assembler implements Emitter { const symbol = this._typeChecker.getSymbolAtLocation(sourceFile); if (symbol) { const moduleExports = this._typeChecker.getExportsOfModule(symbol); - await Promise.all( - moduleExports.map((item) => - this._registerNamespaces(item, this.projectInfo.projectRoot), - ), + moduleExports.map((item) => + this._registerNamespaces(item, this.projectInfo.projectRoot), ); for (const node of moduleExports) { - visitPromises.push( - this._visitNode( - node.declarations[0], - new EmitContext([], this.projectInfo.stability), - ), + this._visitNode( + node.declarations[0], + new EmitContext([], this.projectInfo.stability), ); } } } - await Promise.all(visitPromises); - this.callDeferredsInOrder(); // Skip emitting if any diagnostic message is an error @@ -284,11 +277,11 @@ export class Assembler implements Emitter { } const validator = new Validator(this.projectInfo, assembly); - const validationResult = await validator.emit(); + const validationResult = validator.emit(); if (!validationResult.emitSkipped) { const assemblyPath = path.join(this.projectInfo.projectRoot, '.jsii'); LOG.trace(`Emitting assembly: ${chalk.blue(assemblyPath)}`); - await fs.writeJson(assemblyPath, _fingerprint(assembly), { + fs.writeJsonSync(assemblyPath, _fingerprint(assembly), { encoding: 'utf8', spaces: 2, }); @@ -307,11 +300,11 @@ export class Assembler implements Emitter { delete this._diagnostics; } - async function _loadReadme(this: Assembler) { + function _loadReadme(this: Assembler) { // Search for `README.md` in a case-insensitive way - const fileName = (await fs.readdir(this.projectInfo.projectRoot)).find( - (file) => file.toLocaleLowerCase() === 'readme.md', - ); + const fileName = fs + .readdirSync(this.projectInfo.projectRoot) + .find((file) => file.toLocaleLowerCase() === 'readme.md'); if (fileName == null) { return undefined; } @@ -450,12 +443,12 @@ export class Assembler implements Emitter { * * @returns the FQN of the type, or some "unknown" marker. */ - private async _getFQN( + private _getFQN( type: ts.Type, typeAnnotationNode: ts.Node, typeUse: TypeUseKind, isThisType: boolean, - ): Promise { + ): string { const sym = symbolFromType(type, this._typeChecker); const typeDeclaration = sym.valueDeclaration ?? sym.declarations?.[0]; @@ -500,7 +493,7 @@ export class Assembler implements Emitter { return tsName; } const [, modulePath, typeName] = groups; - const pkg = await findPackageInfo(modulePath); + const pkg = findPackageInfo(modulePath); if (!pkg) { if (!hasError) { this._diagnostics.push( @@ -587,7 +580,7 @@ export class Assembler implements Emitter { * * @param entryPoint the main source file for the currently compiled module. */ - private async _registerDependenciesNamespaces(entryPoint: ts.SourceFile) { + private _registerDependenciesNamespaces(entryPoint: ts.SourceFile) { for (const assm of this.projectInfo.dependencyClosure) { const resolved = ts.resolveModuleName( assm.name, @@ -611,8 +604,7 @@ export class Assembler implements Emitter { const depRoot = packageRoot(resolved.resolvedModule.resolvedFileName); for (const symbol of this._typeChecker.getExportsOfModule(depMod)) { - // eslint-disable-next-line no-await-in-loop - await this._registerNamespaces(symbol, depRoot); + this._registerNamespaces(symbol, depRoot); } } @@ -625,10 +617,7 @@ export class Assembler implements Emitter { } } - private async _registerNamespaces( - symbol: ts.Symbol, - packageRoot: string, - ): Promise { + private _registerNamespaces(symbol: ts.Symbol, packageRoot: string): void { const declaration = symbol.valueDeclaration ?? symbol.declarations[0]; if (declaration == null) { // Nothing to do here... @@ -643,7 +632,7 @@ export class Assembler implements Emitter { // // No way to configure targets - const { fqn, fqnResolutionPrefix } = await qualifiedNameOf.call( + const { fqn, fqnResolutionPrefix } = qualifiedNameOf.call( this, symbol, true, @@ -655,7 +644,7 @@ export class Assembler implements Emitter { symbolId: symbolIdentifier(this._typeChecker, symbol), locationInModule: this.declarationLocation(declaration), }); - await this._addToSubmodule(symbol, symbol, packageRoot); + this._addToSubmodule(symbol, symbol, packageRoot); return; } if (!ts.isNamespaceExport(declaration)) { @@ -716,18 +705,15 @@ export class Assembler implements Emitter { ); } - const { fqn, fqnResolutionPrefix } = await qualifiedNameOf.call( - this, - symbol, - ); - const targets = await loadSubmoduleTargetConfig(sourceFile.fileName); + const { fqn, fqnResolutionPrefix } = qualifiedNameOf.call(this, symbol); + const targets = loadSubmoduleTargetConfig(sourceFile.fileName); // There is no need to process the README file for submodules that are // external (i.e: from a dependency), as these will not be emitted in the // assembly. That'd be wasted effort, and could fail if the README file // refers to literate examples that are not packaged in the dependency. const readme = packageRoot === this.projectInfo.projectRoot - ? await loadSubmoduleReadMe( + ? loadSubmoduleReadMe( sourceFile.fileName, this.projectInfo.projectRoot, ) @@ -741,14 +727,14 @@ export class Assembler implements Emitter { symbolId: symbolIdentifier(this._typeChecker, symbol), locationInModule: this.declarationLocation(declaration), }); - await this._addToSubmodule(symbol, sourceModule, packageRoot); + this._addToSubmodule(symbol, sourceModule, packageRoot); } - async function qualifiedNameOf( + function qualifiedNameOf( this: Assembler, sym: ts.Symbol, inlineNamespace = false, - ): Promise<{ fqn: string; fqnResolutionPrefix: string }> { + ): { fqn: string; fqnResolutionPrefix: string } { if (this._submoduleMap.has(sym)) { const parent = this._submodules.get(this._submoduleMap.get(sym)!)!; const fqn = `${parent.fqn}.${sym.name}`; @@ -763,7 +749,7 @@ export class Assembler implements Emitter { .getDeclarations()?.[0] ?.getSourceFile()?.fileName; const pkgInfo = symbolLocation - ? await findPackageInfo(symbolLocation) + ? findPackageInfo(symbolLocation) : undefined; const assemblyName: string = pkgInfo?.name ?? this.projectInfo.name; const fqn = `${assemblyName}.${sym.name}`; @@ -773,14 +759,14 @@ export class Assembler implements Emitter { }; } - async function loadSubmoduleTargetConfig( + function loadSubmoduleTargetConfig( submoduleMain: string, - ): Promise { + ): SubmoduleSpec['targets'] { const jsiirc = path.resolve(submoduleMain, '..', '.jsiirc.json'); - if (!(await fs.pathExists(jsiirc))) { + if (!fs.pathExistsSync(jsiirc)) { return undefined; } - const data = await fs.readJson(jsiirc); + const data = fs.readJsonSync(jsiirc); return data.targets; } @@ -793,10 +779,10 @@ export class Assembler implements Emitter { * If the submodule is loaded from a file, like `mymodule.[d.]ts`, we will load * `mymodule.README.md`. */ - async function loadSubmoduleReadMe( + function loadSubmoduleReadMe( submoduleMain: string, projectRoot: string, - ): Promise { + ): SubmoduleSpec['readme'] { const fileBase = path.basename(submoduleMain).replace(/(\.d)?\.ts$/, ''); const readMeName = fileBase === 'index' ? `README.md` : `${fileBase}.README.md`; @@ -814,7 +800,7 @@ export class Assembler implements Emitter { * @param moduleLike the module-like symbol bound to the submodule. * @param packageRoot the root of the package being traversed. */ - private async _addToSubmodule( + private _addToSubmodule( ns: ts.Symbol, moduleLike: ts.Symbol, packageRoot: string, @@ -879,14 +865,14 @@ export class Assembler implements Emitter { } if (type.symbol.exports) { // eslint-disable-next-line no-await-in-loop - await this._addToSubmodule(ns, symbol, packageRoot); + this._addToSubmodule(ns, symbol, packageRoot); } } else if (ts.isModuleDeclaration(decl)) { // eslint-disable-next-line no-await-in-loop - await this._registerNamespaces(symbol, packageRoot); + this._registerNamespaces(symbol, packageRoot); } else if (ts.isNamespaceExport(decl)) { // eslint-disable-next-line no-await-in-loop - await this._registerNamespaces(symbol, packageRoot); + this._registerNamespaces(symbol, packageRoot); } } } @@ -899,10 +885,7 @@ export class Assembler implements Emitter { * @param namePrefix the prefix for the types' namespaces */ // eslint-disable-next-line complexity - private async _visitNode( - node: ts.Declaration, - context: EmitContext, - ): Promise { + private _visitNode(node: ts.Declaration, context: EmitContext): spec.Type[] { if (ts.isNamespaceExport(node)) { // export * as ns from 'module'; // Note: the "ts.NamespaceExport" refers to the "export * as ns" part of @@ -921,11 +904,9 @@ export class Assembler implements Emitter { } const nsContext = context.appendNamespace(node.name.text); - const promises = new Array>(); - for (const child of this._typeChecker.getExportsOfModule(symbol)) { - promises.push(this._visitNode(child.declarations[0], nsContext)); - } - const allTypes = flattenPromises(promises); + const allTypes = this._typeChecker + .getExportsOfModule(symbol) + .flatMap((child) => this._visitNode(child.declarations[0], nsContext)); if (LOG.isTraceEnabled()) { LOG.trace( @@ -964,7 +945,7 @@ export class Assembler implements Emitter { // export class Name { ... } this._validateHeritageClauses(node.heritageClauses); - jsiiType = await this._visitClass( + jsiiType = this._visitClass( this._typeChecker.getTypeAtLocation(node), context, ); @@ -974,13 +955,13 @@ export class Assembler implements Emitter { } else if (ts.isInterfaceDeclaration(node) && _isExported(node)) { // export interface Name { ... } this._validateHeritageClauses(node.heritageClauses); - jsiiType = await this._visitInterface( + jsiiType = this._visitInterface( this._typeChecker.getTypeAtLocation(node), context, ); } else if (ts.isEnumDeclaration(node) && _isExported(node)) { // export enum Name { ... } - jsiiType = await this._visitEnum( + jsiiType = this._visitEnum( this._typeChecker.getTypeAtLocation(node), context, ); @@ -997,16 +978,14 @@ export class Assembler implements Emitter { ); } - const allTypesPromises = new Array>(); - for (const prop of this._typeChecker.getExportsOfModule(symbol)) { - allTypesPromises.push( + const allTypes = this._typeChecker + .getExportsOfModule(symbol) + .flatMap((prop) => this._visitNode( prop.declarations[0], context.appendNamespace(node.name.getText()), ), ); - } - const allTypes = await flattenPromises(allTypesPromises); if (LOG.isTraceEnabled()) { LOG.trace( @@ -1083,7 +1062,7 @@ export class Assembler implements Emitter { .map((exportedNode) => this._visitNode(exportedNode.declarations[0], nestedContext), ); - for (const nestedTypes of await Promise.all(visitedNodes)) { + for (const nestedTypes of visitedNodes) { for (const nestedType of nestedTypes) { if (nestedType.namespace !== nestedContext.namespace.join('.')) { this._diagnostics.push( @@ -1157,7 +1136,7 @@ export class Assembler implements Emitter { }; } - private async _processBaseInterfaces(fqn: string, baseTypes?: ts.Type[]) { + private _processBaseInterfaces(fqn: string, baseTypes?: ts.Type[]) { const erasedBases = new Array(); if (!baseTypes) { return { erasedBases }; @@ -1184,12 +1163,12 @@ export class Assembler implements Emitter { processBaseTypes(baseTypes); - const typeRefs = Array.from(baseInterfaces).map(async (iface) => { + const typeRefs = Array.from(baseInterfaces).map((iface) => { const decl = iface.symbol.valueDeclaration; - const typeRef = await this._typeReference(iface, decl, 'base interface'); + const typeRef = this._typeReference(iface, decl, 'base interface'); return { decl, typeRef }; }); - for (const { decl, typeRef } of await Promise.all(typeRefs)) { + for (const { decl, typeRef } of typeRefs) { if (!spec.isNamedTypeReference(typeRef)) { this._diagnostics.push( JsiiDiagnostic.JSII_3005_TYPE_USED_AS_INTERFACE.create(decl, typeRef), @@ -1218,10 +1197,10 @@ export class Assembler implements Emitter { } // eslint-disable-next-line complexity - private async _visitClass( + private _visitClass( type: ts.Type, ctx: EmitContext, - ): Promise { + ): spec.ClassType | undefined { if (LOG.isTraceEnabled()) { LOG.trace( `Processing class: ${chalk.gray(ctx.namespace.join('.'))}.${chalk.cyan( @@ -1284,7 +1263,7 @@ export class Assembler implements Emitter { } // eslint-disable-next-line no-await-in-loop - const ref = await this._typeReference( + const ref = this._typeReference( base, type.symbol.valueDeclaration, 'base class', @@ -1354,7 +1333,7 @@ export class Assembler implements Emitter { clause.types.map((t) => this._getTypeFromTypeNode(t)), ), ); - for (const { interfaces } of await Promise.all(baseInterfaces)) { + for (const { interfaces } of baseInterfaces) { for (const ifc of interfaces ?? []) { allInterfaces.add(ifc.fqn); } @@ -1443,7 +1422,7 @@ export class Assembler implements Emitter { ts.isMethodSignature(memberDecl) ) { // eslint-disable-next-line no-await-in-loop - await this._visitMethod( + this._visitMethod( member, jsiiType, ctx.replaceStability(jsiiType.docs?.stability), @@ -1455,7 +1434,7 @@ export class Assembler implements Emitter { ts.isAccessor(memberDecl) ) { // eslint-disable-next-line no-await-in-loop - await this._visitProperty( + this._visitProperty( member, jsiiType, ctx.replaceStability(jsiiType.docs?.stability), @@ -1501,7 +1480,7 @@ export class Assembler implements Emitter { jsiiType.initializer.parameters ?? []; jsiiType.initializer.parameters.push( // eslint-disable-next-line no-await-in-loop - await this._toParameter( + this._toParameter( param, ctx.replaceStability(jsiiType.docs?.stability), ), @@ -1536,7 +1515,7 @@ export class Assembler implements Emitter { !this._isPrivateOrInternal(param) ) { // eslint-disable-next-line no-await-in-loop - await this._visitProperty( + this._visitProperty( param, jsiiType, memberEmitContext, @@ -1713,10 +1692,10 @@ export class Assembler implements Emitter { return true; } - private async _visitEnum( + private _visitEnum( type: ts.Type, ctx: EmitContext, - ): Promise { + ): spec.EnumType | undefined { if (LOG.isTraceEnabled()) { LOG.trace( `Processing enum: ${chalk.gray(ctx.namespace.join('.'))}.${chalk.cyan( @@ -1741,7 +1720,7 @@ export class Assembler implements Emitter { } if (_hasInternalJsDocTag(symbol)) { - return Promise.resolve(undefined); + return undefined; } this._warnAboutReservedWords(symbol); @@ -1785,7 +1764,7 @@ export class Assembler implements Emitter { decl, ); - return Promise.resolve(jsiiType); + return jsiiType; } /** @@ -1859,10 +1838,10 @@ export class Assembler implements Emitter { } } - private async _visitInterface( + private _visitInterface( type: ts.Type, ctx: EmitContext, - ): Promise { + ): spec.InterfaceType | undefined { if (LOG.isTraceEnabled()) { LOG.trace( `Processing interface: ${chalk.gray( @@ -1895,7 +1874,7 @@ export class Assembler implements Emitter { type.symbol.declarations[0] as ts.InterfaceDeclaration, ); - const { interfaces, erasedBases } = await this._processBaseInterfaces( + const { interfaces, erasedBases } = this._processBaseInterfaces( fqn, type.getBaseTypes(), ); @@ -1925,7 +1904,7 @@ export class Assembler implements Emitter { ts.isMethodSignature(member.valueDeclaration) ) { // eslint-disable-next-line no-await-in-loop - await this._visitMethod( + this._visitMethod( member, jsiiType, ctx.replaceStability(jsiiType.docs?.stability), @@ -1938,7 +1917,7 @@ export class Assembler implements Emitter { ts.isAccessor(member.valueDeclaration) ) { // eslint-disable-next-line no-await-in-loop - await this._visitProperty( + this._visitProperty( member, jsiiType, ctx.replaceStability(jsiiType.docs?.stability), @@ -2083,7 +2062,7 @@ export class Assembler implements Emitter { return _sortMembers(jsiiType); } - private async _visitMethod( + private _visitMethod( symbol: ts.Symbol, type: spec.ClassType | spec.InterfaceType, ctx: EmitContext, @@ -2138,10 +2117,9 @@ export class Assembler implements Emitter { } this._warnAboutReservedWords(symbol); - const parameters = await Promise.all( - signature.getParameters().map((p) => this._toParameter(p, ctx)), - ); - + const parameters = signature + .getParameters() + .map((p) => this._toParameter(p, ctx)); const returnType = signature.getReturnType(); const method: spec.Method = bindings.setMethodRelatedNode( { @@ -2151,11 +2129,7 @@ export class Assembler implements Emitter { protected: _isProtected(symbol) || undefined, returns: _isVoid(returnType) ? undefined - : await this._optionalValue( - returnType, - declaration.name, - 'return type', - ), + : this._optionalValue(returnType, declaration.name, 'return type'), async: _isPromise(returnType) || undefined, static: _isStatic(symbol) || undefined, locationInModule: this.declarationLocation(declaration), @@ -2238,7 +2212,7 @@ export class Assembler implements Emitter { } } - private async _visitProperty( + private _visitProperty( symbol: ts.Symbol, type: spec.ClassType | spec.InterfaceType, ctx: EmitContext, @@ -2296,11 +2270,11 @@ export class Assembler implements Emitter { const property: spec.Property = bindings.setPropertyRelatedNode( { - ...(await this._optionalValue( + ...this._optionalValue( this._typeChecker.getTypeOfSymbolAtLocation(symbol, signature), signature.name, 'property type', - )), + ), abstract: _isAbstract(symbol, type) || undefined, name: symbol.name, protected: _isProtected(symbol) || undefined, @@ -2352,10 +2326,10 @@ export class Assembler implements Emitter { type.properties.push(property); } - private async _toParameter( + private _toParameter( paramSymbol: ts.Symbol, ctx: EmitContext, - ): Promise { + ): spec.Parameter { if (LOG.isTraceEnabled()) { LOG.trace(`Processing parameter: ${chalk.cyan(paramSymbol.name)}`); } @@ -2366,11 +2340,11 @@ export class Assembler implements Emitter { const parameter: spec.Parameter = bindings.setParameterRelatedNode( { - ...(await this._optionalValue( + ...this._optionalValue( this._typeChecker.getTypeAtLocation(paramDeclaration), paramDeclaration.name, 'parameter type', - )), + ), name: paramSymbol.name, variadic: paramDeclaration.dotDotDotToken && true, }, @@ -2396,12 +2370,12 @@ export class Assembler implements Emitter { return parameter; } - private async _typeReference( + private _typeReference( type: ts.Type, declaration: ts.Node, purpose: TypeUseKind, - ): Promise { - const optionalValue = await this._optionalValue(type, declaration, purpose); + ): spec.TypeReference { + const optionalValue = this._optionalValue(type, declaration, purpose); if (optionalValue.optional) { this._diagnostics.push( JsiiDiagnostic.JSII_3999_INCOHERENT_TYPE_MODEL.create( @@ -2413,11 +2387,11 @@ export class Assembler implements Emitter { return optionalValue.type; } - private async _optionalValue( + private _optionalValue( type: ts.Type, declaration: ts.Node, purpose: TypeUseKind, - ): Promise { + ): spec.OptionalValue { const isThisType = _isThisType(type, this._typeChecker); if (type.isLiteral() && _isEnumLike(type)) { @@ -2443,11 +2417,11 @@ export class Assembler implements Emitter { } if (type.symbol.name === 'Array') { - return { type: await _arrayType.call(this) }; + return { type: _arrayType.call(this) }; } if (type.symbol.name === '__type' && type.symbol.members) { - return { type: await _mapType.call(this) }; + return { type: _mapType.call(this) }; } if (type.symbol.escapedName === 'Promise') { @@ -2459,7 +2433,7 @@ export class Assembler implements Emitter { return { type: spec.CANONICAL_ANY }; } return { - type: await this._typeReference( + type: this._typeReference( typeRef.typeArguments[0], declaration, purpose, @@ -2468,17 +2442,15 @@ export class Assembler implements Emitter { } return { - type: { fqn: await this._getFQN(type, declaration, purpose, isThisType) }, + type: { fqn: this._getFQN(type, declaration, purpose, isThisType) }, }; - async function _arrayType( - this: Assembler, - ): Promise { + function _arrayType(this: Assembler): spec.CollectionTypeReference { const typeRef = type as ts.TypeReference; let elementtype: spec.TypeReference; if (typeRef.typeArguments?.length === 1) { - elementtype = await this._typeReference( + elementtype = this._typeReference( typeRef.typeArguments[0], declaration, 'list element type', @@ -2504,13 +2476,11 @@ export class Assembler implements Emitter { }; } - async function _mapType( - this: Assembler, - ): Promise { + function _mapType(this: Assembler): spec.CollectionTypeReference { let elementtype: spec.TypeReference; const objectType = type.getStringIndexType(); if (objectType) { - elementtype = await this._typeReference( + elementtype = this._typeReference( objectType, declaration, 'map element type', @@ -2564,7 +2534,7 @@ export class Assembler implements Emitter { return undefined; } - async function _unionType(this: Assembler): Promise { + function _unionType(this: Assembler): spec.OptionalValue { const types = new Array(); let optional: boolean | undefined; @@ -2574,11 +2544,7 @@ export class Assembler implements Emitter { continue; } // eslint-disable-next-line no-await-in-loop - const resolvedType = await this._typeReference( - subType, - declaration, - purpose, - ); + const resolvedType = this._typeReference(subType, declaration, purpose); if (types.find((ref) => deepEqual(ref, resolvedType)) != null) { continue; } @@ -3164,14 +3130,6 @@ class EmitContext { } } -async function flattenPromises(promises: Array>): Promise { - const result = new Array(); - for (const subset of await Promise.all(promises)) { - result.push(...subset); - } - return result; -} - function inferRootDir(program: ts.Program): string | undefined { const directories = program .getRootFileNames() @@ -3240,12 +3198,10 @@ function isSingleValuedEnum( return false; } -async function findPackageInfo( - fromDir: string, -): Promise { +function findPackageInfo(fromDir: string): PackageJson | undefined { const filePath = path.join(fromDir, 'package.json'); - if (await fs.pathExists(filePath)) { - return fs.readJson(filePath); + if (fs.pathExistsSync(filePath)) { + return fs.readJsonSync(filePath); } const parent = path.dirname(fromDir); if (parent === fromDir) { @@ -3374,18 +3330,18 @@ function isUnder(file: string, dir: string): boolean { return !relative.startsWith(path.sep) && !relative.startsWith('..'); } -async function loadAndRenderReadme(readmePath: string, projectRoot: string) { - if (!(await fs.pathExists(readmePath))) { +function loadAndRenderReadme(readmePath: string, projectRoot: string) { + if (!fs.pathExistsSync(readmePath)) { return undefined; } return { - markdown: ( - await literate.includeAndRenderExamples( - await literate.loadFromFile(readmePath), + markdown: literate + .includeAndRenderExamples( + literate.loadFromFile(readmePath), literate.fileSystemLoader(path.dirname(readmePath)), projectRoot, ) - ).join('\n'), + .join('\n'), }; } diff --git a/packages/jsii/lib/compiler.ts b/packages/jsii/lib/compiler.ts index 9b2447312b..bbc43ea227 100644 --- a/packages/jsii/lib/compiler.ts +++ b/packages/jsii/lib/compiler.ts @@ -107,8 +107,8 @@ export class Compiler implements Emitter { * * @param files can be specified to override the standard source code location logic. Useful for example when testing "negatives". */ - public async emit(...files: string[]): Promise { - await this._prepareForBuild(...files); + public emit(...files: string[]): ts.EmitResult { + this._prepareForBuild(...files); return this._buildOnce(); } @@ -118,18 +118,16 @@ export class Compiler implements Emitter { * * @internal */ - public async watch( - opts: NonBlockingWatchOptions, - ): Promise>; + public watch(opts: NonBlockingWatchOptions): ts.Watch; /** * Watches for file-system changes and dynamically recompiles the project as needed. In blocking mode, this results * in a never-resolving promise. */ - public async watch(): Promise; - public async watch( + public watch(): never; + public watch( opts?: NonBlockingWatchOptions, - ): Promise | never> { - await this._prepareForBuild(); + ): ts.Watch | never { + this._prepareForBuild(); const pi = this.options.projectInfo; const projectRoot = pi.projectRoot; @@ -160,8 +158,8 @@ export class Compiler implements Emitter { // cause an unhandled promise rejection warning, but that's not a big deal. // // eslint-disable-next-line @typescript-eslint/no-misused-promises - host.afterProgramCreate = async (builderProgram) => { - const emitResult = await this._consumeProgram( + host.afterProgramCreate = (builderProgram) => { + const emitResult = this._consumeProgram( builderProgram.getProgram(), host.getDefaultLibLocation!(), ); @@ -176,7 +174,7 @@ export class Compiler implements Emitter { orig.call(host, builderProgram); } if (opts?.compilationComplete) { - await opts.compilationComplete(emitResult); + opts.compilationComplete(emitResult); } }; const watch = ts.createWatchProgram(host); @@ -186,7 +184,7 @@ export class Compiler implements Emitter { return watch; } // In blocking mode, returns a never-resolving promise. - return new Promise(() => null); + return undefined as never; } /** @@ -195,16 +193,16 @@ export class Compiler implements Emitter { * * @param files the files that were specified as input in the CLI invocation. */ - private async _prepareForBuild(...files: string[]) { - await this.buildTypeScriptConfig(); - await this.writeTypeScriptConfig(); + private _prepareForBuild(...files: string[]) { + this.buildTypeScriptConfig(); + this.writeTypeScriptConfig(); this.rootFiles = this.determineSources(files); } /** * Do a single build */ - private async _buildOnce(): Promise { + private _buildOnce(): ts.EmitResult { if (!this.compilerHost.getDefaultLibLocation) { throw new Error( 'No default library location was found on the TypeScript compiler host!', @@ -233,10 +231,7 @@ export class Compiler implements Emitter { ); } - private async _consumeProgram( - program: ts.Program, - stdlib: string, - ): Promise { + private _consumeProgram(program: ts.Program, stdlib: string): ts.EmitResult { const diagnostics = [...ts.getPreEmitDiagnostics(program)]; let hasErrors = false; @@ -256,7 +251,7 @@ export class Compiler implements Emitter { }); try { - const assmEmit = await assembler.emit(); + const assmEmit = assembler.emit(); if ( !hasErrors && (assmEmit.emitSkipped || @@ -329,10 +324,10 @@ export class Compiler implements Emitter { * * This is the object that will be written to disk. */ - private async buildTypeScriptConfig() { + private buildTypeScriptConfig() { let references: string[] | undefined; if (this.projectReferences) { - references = await this.findProjectReferences(); + references = this.findProjectReferences(); } const pi = this.options.projectInfo; @@ -378,15 +373,15 @@ export class Compiler implements Emitter { * * @return the fully qualified path to the `tsconfig.json` file */ - private async writeTypeScriptConfig(): Promise { + private writeTypeScriptConfig(): void { const commentKey = '_generated_by_jsii_'; const commentValue = 'Generated by jsii - safe to delete, and ideally should be in .gitignore'; (this.typescriptConfig as any)[commentKey] = commentValue; - if (await fs.pathExists(this.configPath)) { - const currentConfig = await fs.readJson(this.configPath); + if (fs.pathExistsSync(this.configPath)) { + const currentConfig = fs.readJsonSync(this.configPath); if (!(commentKey in currentConfig)) { throw new Error( `A '${this.configPath}' file that was not generated by jsii is in ${this.options.projectInfo.projectRoot}. Aborting instead of overwriting.`, @@ -418,7 +413,7 @@ export class Compiler implements Emitter { }; LOG.debug(`Creating or updating ${chalk.blue(this.configPath)}`); - await fs.writeJson(this.configPath, outputConfig, { + fs.writeJsonSync(this.configPath, outputConfig, { encoding: 'utf8', spaces: 2, }); @@ -454,7 +449,7 @@ export class Compiler implements Emitter { * if there's an "index" tsconfig.json of all projects somewhere up the directory * tree) */ - private async findProjectReferences(): Promise { + private findProjectReferences(): string[] { const pkg = this.options.projectInfo.packageJson; const ret = new Array(); @@ -473,10 +468,8 @@ export class Compiler implements Emitter { ); } - for (const tsconfigFile of await Promise.all( - Array.from(dependencyNames).map((depName) => - this.findMonorepoPeerTsconfig(depName), - ), + for (const tsconfigFile of Array.from(dependencyNames).map((depName) => + this.findMonorepoPeerTsconfig(depName), )) { if (!tsconfigFile) { continue; @@ -552,9 +545,7 @@ export class Compiler implements Emitter { * * Returns undefined if no such tsconfig could be found. */ - private async findMonorepoPeerTsconfig( - depName: string, - ): Promise { + private findMonorepoPeerTsconfig(depName: string): string | undefined { // eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires const { builtinModules } = require('module'); if ((builtinModules ?? []).includes(depName)) { @@ -563,18 +554,18 @@ export class Compiler implements Emitter { } try { - const depDir = await utils.findDependencyDirectory( + const depDir = utils.findDependencyDirectory( depName, this.options.projectInfo.projectRoot, ); const dep = path.join(depDir, 'tsconfig.json'); - if (!(await fs.pathExists(dep))) { + if (!fs.pathExistsSync(dep)) { return undefined; } // Resolve symlinks, to check if this is a monorepo peer - const dependencyRealPath = await fs.realpath(dep); + const dependencyRealPath = fs.realpathSync(dep); if (dependencyRealPath.split(path.sep).includes('node_modules')) { return undefined; } @@ -625,9 +616,7 @@ export interface NonBlockingWatchOptions { /** * This hook gets invoked when a compilation cycle (complete with Assembler execution) completes. */ - readonly compilationComplete: ( - emitResult: ts.EmitResult, - ) => void | Promise; + readonly compilationComplete: (emitResult: ts.EmitResult) => void; } function _pathOfLibraries( diff --git a/packages/jsii/lib/emitter.ts b/packages/jsii/lib/emitter.ts index e917178aaa..cb030d5d60 100644 --- a/packages/jsii/lib/emitter.ts +++ b/packages/jsii/lib/emitter.ts @@ -9,5 +9,5 @@ export interface Emitter { * * @return the result of attempting to emit stuff. */ - emit(): Promise; + emit(): ts.EmitResult; } diff --git a/packages/jsii/lib/helpers.ts b/packages/jsii/lib/helpers.ts index 5f5bd579cc..4e3300310f 100644 --- a/packages/jsii/lib/helpers.ts +++ b/packages/jsii/lib/helpers.ts @@ -35,11 +35,11 @@ export type MultipleSourceFiles = { * @param options accepts a callback for historical reasons but really expects to * take an options object. */ -export async function sourceToAssemblyHelper( +export function sourceToAssemblyHelper( source: string | MultipleSourceFiles, options?: TestCompilationOptions | ((obj: PackageJson) => void), -): Promise { - return (await compileJsiiForTest(source, options)).assembly; +): spec.Assembly { + return compileJsiiForTest(source, options).assembly; } export interface HelperCompilationResult { @@ -68,11 +68,11 @@ export interface HelperCompilationResult { * @param options accepts a callback for historical reasons but really expects to * take an options object. */ -export async function compileJsiiForTest( +export function compileJsiiForTest( source: string | { 'index.ts': string; [name: string]: string }, options?: TestCompilationOptions | ((obj: PackageJson) => void), compilerOptions?: Omit, -): Promise { +): HelperCompilationResult { if (typeof source === 'string') { source = { 'index.ts': source }; } @@ -84,14 +84,12 @@ export async function compileJsiiForTest( // Easiest way to get the source into the compiler is to write it to disk somewhere. // I guess we could make an in-memory compiler host but that seems like work... - return inSomeLocation(async () => { - await Promise.all( - Object.entries(source).map(async ([fileName, content]) => { - await fs.mkdirp(path.dirname(fileName)); - return fs.writeFile(fileName, content, { encoding: 'utf-8' }); - }), - ); - const { projectInfo, packageJson } = await makeProjectInfo( + return inSomeLocation(() => { + Object.entries(source).forEach(([fileName, content]) => { + fs.mkdirpSync(path.dirname(fileName)); + fs.writeFileSync(fileName, content, { encoding: 'utf-8' }); + }); + const { projectInfo, packageJson } = makeProjectInfo( 'index.ts', typeof options === 'function' ? options @@ -106,7 +104,7 @@ export async function compileJsiiForTest( projectInfo, ...compilerOptions, }); - const emitResult = await compiler.emit(); + const emitResult = compiler.emit(); const errors = emitResult.diagnostics.filter( (d) => d.category === DiagnosticCategory.Error, @@ -118,7 +116,7 @@ export async function compileJsiiForTest( if (errors.length > 0 || emitResult.emitSkipped) { throw new Error('There were compiler errors'); } - const assembly = await fs.readJSON('.jsii', { encoding: 'utf-8' }); + const assembly = fs.readJsonSync('.jsii', { encoding: 'utf-8' }); const files: Record = {}; for (const filename of Object.keys(source)) { @@ -130,14 +128,14 @@ export async function compileJsiiForTest( } // eslint-disable-next-line no-await-in-loop - files[jsFile] = await fs.readFile(jsFile, { encoding: 'utf-8' }); + files[jsFile] = fs.readFileSync(jsFile, { encoding: 'utf-8' }); // eslint-disable-next-line no-await-in-loop - files[dtsFile] = await fs.readFile(dtsFile, { encoding: 'utf-8' }); + files[dtsFile] = fs.readFileSync(dtsFile, { encoding: 'utf-8' }); const warningsFileName = '.warnings.jsii.js'; if (fs.existsSync(warningsFileName)) { // eslint-disable-next-line no-await-in-loop - files[warningsFileName] = await fs.readFile(warningsFileName, { + files[warningsFileName] = fs.readFileSync(warningsFileName, { encoding: 'utf-8', }); } @@ -147,23 +145,23 @@ export async function compileJsiiForTest( }); } -async function inTempDir(block: () => Promise): Promise { +function inTempDir(block: () => T): T { const origDir = process.cwd(); - const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'jsii')); + const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'jsii')); process.chdir(tmpDir); - const ret = await block(); + const ret = block(); process.chdir(origDir); - await fs.remove(tmpDir); + fs.removeSync(tmpDir); return ret; } function inOtherDir(dir: string) { // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint - return async (block: () => Promise): Promise => { + return (block: () => T): T => { const origDir = process.cwd(); process.chdir(dir); try { - return await block(); + return block(); } finally { process.chdir(origDir); } @@ -179,10 +177,10 @@ function inOtherDir(dir: string) { * Most consistent behavior seems to be to write a package.json to disk and * then calling the same functions as the CLI would. */ -async function makeProjectInfo( +function makeProjectInfo( types: string, - cb?: (obj: PackageJson) => Promise | void, -): Promise<{ projectInfo: ProjectInfo; packageJson: PackageJson }> { + cb?: (obj: PackageJson) => void, +): { projectInfo: ProjectInfo; packageJson: PackageJson } { const packageJson: PackageJson = { types, main: types.replace(/(?:\.d)?\.ts(x?)/, '.js$1'), @@ -195,18 +193,16 @@ async function makeProjectInfo( }; if (cb) { - await cb(packageJson); + cb(packageJson); } - await fs.writeJson('package.json', packageJson, { + fs.writeJsonSync('package.json', packageJson, { encoding: 'utf-8', replacer: (_: string, v: any) => v, spaces: 2, }); - const { projectInfo } = await loadProjectInfo( - path.resolve(process.cwd(), '.'), - ); + const { projectInfo } = loadProjectInfo(path.resolve(process.cwd(), '.')); return { projectInfo, packageJson }; } export interface TestCompilationOptions { @@ -245,25 +241,21 @@ export class TestWorkspace { * * Creates a temporary directory, don't forget to call cleanUp */ - public static async create(): Promise { - const tmpDir = await fs.mkdtemp( - path.join(os.tmpdir(), 'jsii-testworkspace'), - ); - await fs.ensureDir(tmpDir); + public static create(): TestWorkspace { + const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'jsii-testworkspace')); + fs.ensureDirSync(tmpDir); return new TestWorkspace(tmpDir); } /** * Execute a block with a temporary workspace */ - public static async withWorkspace( - block: (ws: TestWorkspace) => A | Promise, - ): Promise { - const ws = await TestWorkspace.create(); + public static withWorkspace(block: (ws: TestWorkspace) => A): A { + const ws = TestWorkspace.create(); try { - return await block(ws); + return block(ws); } finally { - await ws.cleanup(); + ws.cleanup(); } } @@ -274,7 +266,7 @@ export class TestWorkspace { /** * Add a test-compiled jsii assembly as a dependency */ - public async addDependency(dependencyAssembly: HelperCompilationResult) { + public addDependency(dependencyAssembly: HelperCompilationResult) { if (this.installed.has(dependencyAssembly.assembly.name)) { throw new Error( `A dependency with name '${dependencyAssembly.assembly.name}' was already installed. Give one a different name.`, @@ -293,10 +285,10 @@ export class TestWorkspace { 'node_modules', dependencyAssembly.assembly.name, ); - await fs.ensureDir(modDir); + fs.ensureDirSync(modDir); - await fs.writeJSON(path.join(modDir, '.jsii'), dependencyAssembly.assembly); - await fs.writeJSON( + fs.writeJsonSync(path.join(modDir, '.jsii'), dependencyAssembly.assembly); + fs.writeJsonSync( path.join(modDir, 'package.json'), dependencyAssembly.packageJson, ); @@ -305,9 +297,9 @@ export class TestWorkspace { dependencyAssembly.files, )) { // eslint-disable-next-line no-await-in-loop - await fs.ensureDir(path.dirname(path.join(modDir, fileName))); + fs.ensureDirSync(path.dirname(path.join(modDir, fileName))); // eslint-disable-next-line no-await-in-loop - await fs.writeFile(path.join(modDir, fileName), fileContents); + fs.writeFileSync(path.join(modDir, fileName), fileContents); } } @@ -318,8 +310,8 @@ export class TestWorkspace { return path.join(this.rootDirectory, 'node_modules', name); } - public async cleanup() { - await fs.remove(this.rootDirectory); + public cleanup() { + fs.removeSync(this.rootDirectory); } } diff --git a/packages/jsii/lib/literate.ts b/packages/jsii/lib/literate.ts index 3b0fed62e1..c4edde4717 100644 --- a/packages/jsii/lib/literate.ts +++ b/packages/jsii/lib/literate.ts @@ -76,9 +76,7 @@ export interface LoadedFile { readonly lines: string[]; } -export type FileLoader = ( - relativePath: string, -) => LoadedFile | Promise; +export type FileLoader = (relativePath: string) => LoadedFile; /** * Given MarkDown source, find source files to include and render @@ -88,11 +86,11 @@ export type FileLoader = ( * * [example](test/integ.bucket.ts) */ -export async function includeAndRenderExamples( +export function includeAndRenderExamples( lines: string[], loader: FileLoader, projectRoot: string, -): Promise { +): string[] { const ret: string[] = []; const regex = /^\[([^\]]*)\]\(([^)]+\.lit\.ts)\)/i; @@ -102,7 +100,7 @@ export async function includeAndRenderExamples( // Found an include const filename = m[2]; // eslint-disable-next-line no-await-in-loop - const { lines: source, fullPath } = await loader(filename); + const { lines: source, fullPath } = loader(filename); // 'lit' source attribute will make snippet compiler know to extract the same source // Needs to be relative to the project root. const imported = typescriptSourceToMarkdown(source, [ @@ -120,8 +118,8 @@ export async function includeAndRenderExamples( /** * Load a file into a string array */ -export async function loadFromFile(fileName: string): Promise { - const content = await fs.readFile(fileName, { encoding: 'utf-8' }); +export function loadFromFile(fileName: string): string[] { + const content = fs.readFileSync(fileName, { encoding: 'utf-8' }); return contentToLines(content); } @@ -136,9 +134,9 @@ export function contentToLines(content: string): string[] { * Return a file system loader given a base directory */ export function fileSystemLoader(directory: string): FileLoader { - return async (fileName) => { + return (fileName) => { const fullPath = path.resolve(directory, fileName); - return { fullPath, lines: await loadFromFile(fullPath) }; + return { fullPath, lines: loadFromFile(fullPath) }; }; } diff --git a/packages/jsii/lib/project-info.ts b/packages/jsii/lib/project-info.ts index 8f0e6611f7..9c0af8a8ef 100644 --- a/packages/jsii/lib/project-info.ts +++ b/packages/jsii/lib/project-info.ts @@ -64,12 +64,10 @@ export interface ProjectInfoResult { readonly diagnostics: readonly ts.Diagnostic[]; } -export async function loadProjectInfo( - projectRoot: string, -): Promise { +export function loadProjectInfo(projectRoot: string): ProjectInfoResult { const packageJsonPath = path.join(projectRoot, 'package.json'); // eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-require-imports - const pkg = await fs.readJson(packageJsonPath); + const pkg = fs.readJsonSync(packageJsonPath); const diagnostics: ts.Diagnostic[] = []; @@ -127,7 +125,7 @@ export async function loadProjectInfo( const peerDependencies: Record = pkg.peerDependencies ?? {}; const resolver = new DependencyResolver(); - const resolved = await resolver.discoverDependencyTree(projectRoot, { + const resolved = resolver.discoverDependencyTree(projectRoot, { ...dependencies, ...peerDependencies, }); @@ -245,14 +243,14 @@ class DependencyResolver { * * Return the resolved jsii dependency paths */ - public async discoverDependencyTree( + public discoverDependencyTree( root: string, dependencies: Record, - ): Promise> { + ): Record { const ret: Record = {}; for (const [name, declaration] of Object.entries(dependencies)) { // eslint-disable-next-line no-await-in-loop - const resolved = await this.resolveDependency(root, name, declaration); + const resolved = this.resolveDependency(root, name, declaration); const actualVersion = resolved.dependencyInfo.assembly.version; if (!semver.satisfies(actualVersion, declaration)) { @@ -288,11 +286,7 @@ class DependencyResolver { return Array.from(closure.values()); } - private async resolveDependency( - root: string, - name: string, - declaration: string, - ) { + private resolveDependency(root: string, name: string, declaration: string) { const { version: versionString, localPackage } = _resolveVersion( declaration, root, @@ -303,27 +297,27 @@ class DependencyResolver { `Invalid semver expression for ${name}: ${versionString}`, ); } - const jsiiFile = await _tryResolveAssembly(name, localPackage, root); + const jsiiFile = _tryResolveAssembly(name, localPackage, root); LOG.debug(`Resolved dependency ${name} to ${jsiiFile}`); return { resolvedVersion: versionString, resolvedFile: jsiiFile, - dependencyInfo: await this.loadAssemblyAndRecurse(jsiiFile), + dependencyInfo: this.loadAssemblyAndRecurse(jsiiFile), }; } - private async loadAssemblyAndRecurse(jsiiFile: string) { + private loadAssemblyAndRecurse(jsiiFile: string) { // Only recurse if we haven't seen this assembly yet if (this.cache.has(jsiiFile)) { return this.cache.get(jsiiFile)!; } // eslint-disable-next-line no-await-in-loop - const assembly = await this.loadAssembly(jsiiFile); + const assembly = this.loadAssembly(jsiiFile); // Continue loading any dependencies declared in the asm const resolvedDependencies = assembly.dependencies - ? await this.discoverDependencyTree( + ? this.discoverDependencyTree( path.dirname(jsiiFile), assembly.dependencies, ) @@ -340,9 +334,9 @@ class DependencyResolver { /** * Load a JSII filename and validate it; cached to avoid redundant loads of the same JSII assembly */ - private async loadAssembly(jsiiFileName: string): Promise { + private loadAssembly(jsiiFileName: string): spec.Assembly { try { - return await fs.readJson(jsiiFileName); + return fs.readJsonSync(jsiiFileName); } catch (e) { throw new Error(`Error loading ${jsiiFileName}: ${e}`); } @@ -394,11 +388,11 @@ function _toRepository(value: any): { }; } -async function _tryResolveAssembly( +function _tryResolveAssembly( mod: string, localPackage: string | undefined, searchPath: string, -): Promise { +): string { if (localPackage) { const result = path.join(localPackage, '.jsii'); if (!fs.existsSync(result)) { @@ -407,7 +401,7 @@ async function _tryResolveAssembly( return result; } try { - const dependencyDir = await findDependencyDirectory(mod, searchPath); + const dependencyDir = findDependencyDirectory(mod, searchPath); return path.join(dependencyDir, '.jsii'); } catch (e) { throw new Error( diff --git a/packages/jsii/lib/utils.ts b/packages/jsii/lib/utils.ts index 947ec86237..af3303172c 100644 --- a/packages/jsii/lib/utils.ts +++ b/packages/jsii/lib/utils.ts @@ -172,7 +172,7 @@ export function parseRepository(value: string): { url: string } { * (This code is duplicated among jsii/jsii-pacmak/jsii-reflect. Changes should be done in all * 3 locations, and we should unify these at some point: https://github.com/aws/jsii/issues/3236) */ -export async function findDependencyDirectory( +export function findDependencyDirectory( dependencyName: string, searchStart: string, ) { @@ -184,7 +184,7 @@ export async function findDependencyDirectory( // Search up from the given directory, looking for a package.json that matches // the dependency name (so we don't accidentally find stray 'package.jsons'). - const depPkgJsonPath = await findPackageJsonUp( + const depPkgJsonPath = findPackageJsonUp( dependencyName, path.dirname(entryPoint), ); @@ -204,15 +204,11 @@ export async function findDependencyDirectory( * (This code is duplicated among jsii/jsii-pacmak/jsii-reflect. Changes should be done in all * 3 locations, and we should unify these at some point: https://github.com/aws/jsii/issues/3236) */ -export async function findPackageJsonUp( - packageName: string, - directory: string, -) { - return findUp(directory, async (dir) => { +export function findPackageJsonUp(packageName: string, directory: string) { + return findUp(directory, (dir) => { const pjFile = path.join(dir, 'package.json'); return ( - (await fs.pathExists(pjFile)) && - (await fs.readJson(pjFile)).name === packageName + fs.pathExistsSync(pjFile) && fs.readJsonSync(pjFile).name === packageName ); }); } @@ -225,25 +221,11 @@ export async function findPackageJsonUp( * (This code is duplicated among jsii/jsii-pacmak/jsii-reflect. Changes should be done in all * 3 locations, and we should unify these at some point: https://github.com/aws/jsii/issues/3236) */ -export function findUp( - directory: string, - pred: (dir: string) => Promise, -): Promise; export function findUp( directory: string, pred: (dir: string) => boolean, -): string | undefined; -// eslint-disable-next-line @typescript-eslint/promise-function-async -export function findUp( - directory: string, - pred: ((dir: string) => boolean) | ((dir: string) => Promise), -): Promise | string | undefined { +): string | undefined { const result = pred(directory); - if (isPromise(result)) { - return result.then((thisDirectory) => - thisDirectory ? directory : recurse(), - ); - } return result ? directory : recurse(); @@ -256,6 +238,10 @@ export function findUp( } } -function isPromise(x: A | Promise): x is Promise { - return typeof x === 'object' && (x as any).then; +const ANSI_REGEX = + // eslint-disable-next-line no-control-regex + /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; + +export function stripAnsi(x: string): string { + return x.replace(ANSI_REGEX, ''); } diff --git a/packages/jsii/lib/validator.ts b/packages/jsii/lib/validator.ts index 878703c8a7..cf26248270 100644 --- a/packages/jsii/lib/validator.ts +++ b/packages/jsii/lib/validator.ts @@ -21,7 +21,7 @@ export class Validator implements Emitter { public readonly assembly: spec.Assembly, ) {} - public async emit(): Promise { + public emit(): ts.EmitResult { this._diagnostics = []; for (const validation of Validator.VALIDATIONS) { @@ -29,12 +29,12 @@ export class Validator implements Emitter { } try { - return await Promise.resolve({ + return { diagnostics: this._diagnostics, emitSkipped: this._diagnostics.some( (diag) => diag.category === ts.DiagnosticCategory.Error, ), - }); + }; } finally { // Clearing ``this._diagnostics`` to allow contents to be garbage-collected. delete this._diagnostics; diff --git a/packages/jsii/test/compiler.test.ts b/packages/jsii/test/compiler.test.ts index 6e56673839..5335215da4 100644 --- a/packages/jsii/test/compiler.test.ts +++ b/packages/jsii/test/compiler.test.ts @@ -1,10 +1,10 @@ import { - ensureDir, - mkdtemp, - remove, - writeFile, - readFile, - readJson, + ensureDirSync, + mkdtempSync, + removeSync, + writeFileSync, + readFileSync, + readJsonSync, } from 'fs-extra'; import { tmpdir } from 'os'; import { join } from 'path'; @@ -14,8 +14,8 @@ import { ProjectInfo } from '../lib/project-info'; describe(Compiler, () => { describe('generated tsconfig', () => { - test('default is tsconfig.json', async () => { - const sourceDir = await mkdtemp( + test('default is tsconfig.json', () => { + const sourceDir = mkdtempSync( join(tmpdir(), 'jsii-compiler-watch-mode-'), ); @@ -23,15 +23,15 @@ describe(Compiler, () => { projectInfo: _makeProjectInfo(sourceDir, 'index.d.ts'), }); - await compiler.emit(); + compiler.emit(); - expect(await readJson(join(sourceDir, 'tsconfig.json'), 'utf-8')).toEqual( + expect(readJsonSync(join(sourceDir, 'tsconfig.json'), 'utf-8')).toEqual( expectedTypeScriptConfig(), ); }); - test('file name can be customized', async () => { - const sourceDir = await mkdtemp( + test('file name can be customized', () => { + const sourceDir = mkdtempSync( join(tmpdir(), 'jsii-compiler-watch-mode-'), ); @@ -40,10 +40,10 @@ describe(Compiler, () => { generateTypeScriptConfig: 'tsconfig.jsii.json', }); - await compiler.emit(); + compiler.emit(); expect( - await readJson(join(sourceDir, 'tsconfig.jsii.json'), 'utf-8'), + readJsonSync(join(sourceDir, 'tsconfig.jsii.json'), 'utf-8'), ).toEqual(expectedTypeScriptConfig()); }); }); @@ -52,14 +52,12 @@ describe(Compiler, () => { // This can be a little slow, allowing 15 seconds maximum here (default is 5 seconds) jest.setTimeout(15_000); - const sourceDir = await mkdtemp( - join(tmpdir(), 'jsii-compiler-watch-mode-'), - ); + const sourceDir = mkdtempSync(join(tmpdir(), 'jsii-compiler-watch-mode-')); try { - await writeFile(join(sourceDir, 'index.ts'), 'export class MarkerA {}'); + writeFileSync(join(sourceDir, 'index.ts'), 'export class MarkerA {}'); // Intentionally using lower case name - it should be case-insensitive - await writeFile(join(sourceDir, 'readme.md'), '# Test Package'); + writeFileSync(join(sourceDir, 'readme.md'), '# Test Package'); const compiler = new Compiler({ projectInfo: _makeProjectInfo(sourceDir, 'index.d.ts'), @@ -74,23 +72,23 @@ describe(Compiler, () => { onWatchClosed = ok; onWatchFailed = ko; }); - const watch = await compiler.watch({ + const watch = compiler.watch({ nonBlocking: true, // Ignore diagnostics reporting (not to pollute test console output) reportDiagnostics: () => null, // Ignore watch status reporting (not to pollute test console output) reportWatchStatus: () => null, // Verify everything goes according to plan - compilationComplete: async (emitResult) => { + compilationComplete: (emitResult) => { try { expect(emitResult.emitSkipped).toBeFalsy(); - const output = await readFile(join(sourceDir, '.jsii'), { + const output = readFileSync(join(sourceDir, '.jsii'), { encoding: 'utf-8', }); if (firstCompilation) { firstCompilation = false; expect(output).toContain('"MarkerA"'); - await writeFile( + writeFileSync( join(sourceDir, 'index.ts'), 'export class MarkerB {}', ); @@ -108,23 +106,23 @@ describe(Compiler, () => { }); await watchClosed; } finally { - await remove(sourceDir); + removeSync(sourceDir); } }); - test('rootDir is added to assembly', async () => { + test('rootDir is added to assembly', () => { const outDir = 'jsii-outdir'; const rootDir = 'jsii-rootdir'; - const sourceDir = await mkdtemp(join(tmpdir(), 'jsii-tmpdir')); - await ensureDir(join(sourceDir, rootDir)); + const sourceDir = mkdtempSync(join(tmpdir(), 'jsii-tmpdir')); + ensureDirSync(join(sourceDir, rootDir)); try { - await writeFile( + writeFileSync( join(sourceDir, rootDir, 'index.ts'), 'export class MarkerA {}', ); // Intentionally using lower case name - it should be case-insensitive - await writeFile(join(sourceDir, rootDir, 'readme.md'), '# Test Package'); + writeFileSync(join(sourceDir, rootDir, 'readme.md'), '# Test Package'); const compiler = new Compiler({ projectInfo: { @@ -138,16 +136,16 @@ describe(Compiler, () => { projectReferences: false, }); - await compiler.emit(); + compiler.emit(); - const assembly = await readJson(join(sourceDir, '.jsii'), 'utf-8'); + const assembly = readJsonSync(join(sourceDir, '.jsii'), 'utf-8'); expect(assembly.metadata).toEqual( expect.objectContaining({ tscRootDir: rootDir, }), ); } finally { - await remove(sourceDir); + removeSync(sourceDir); } }); }); diff --git a/packages/jsii/test/deprecated-remover.test.ts b/packages/jsii/test/deprecated-remover.test.ts index 63964fbe9b..920d228384 100644 --- a/packages/jsii/test/deprecated-remover.test.ts +++ b/packages/jsii/test/deprecated-remover.test.ts @@ -6,8 +6,8 @@ import { compileJsiiForTest, HelperCompilationResult } from '../lib'; const DEPRECATED = '/** @deprecated stripped */'; -test('produces correct output', async () => { - const result = await compileJsiiForTest( +test('produces correct output', () => { + const result = compileJsiiForTest( MULTI_FILE_EXAMPLE, undefined /* callback */, { stripDeprecated: true }, @@ -153,8 +153,8 @@ test('produces correct output', async () => { `); }); -test('cross-file deprecated heritage', async () => { - const result = await compileJsiiForTest( +test('cross-file deprecated heritage', () => { + const result = compileJsiiForTest( { 'index.ts': ` import { IDeprecated } from './deprecated'; @@ -188,12 +188,12 @@ test('cross-file deprecated heritage', async () => { }); describe('stripDeprecatedAllowList', () => { - test('strips all if all FQNs are present in the allowList', async () => { - const tmpDir = await fs.mkdtemp( + test('strips all if all FQNs are present in the allowList', () => { + const tmpDir = fs.mkdtempSync( path.join(os.tmpdir(), 'jsiideprecatedremover'), ); const stripDeprecatedAllowListFile = path.join(tmpDir, 'allowList'); - await fs.writeFile( + fs.writeFileSync( stripDeprecatedAllowListFile, [ 'testpkg.IDeprecatedInterface', @@ -207,12 +207,12 @@ describe('stripDeprecatedAllowList', () => { 'utf8', ); - const resultWithoutAllowList = await compileJsiiForTest( + const resultWithoutAllowList = compileJsiiForTest( MULTI_FILE_EXAMPLE, undefined /* callback */, { stripDeprecated: true }, ); - const resultWithAllowList = await compileJsiiForTest( + const resultWithAllowList = compileJsiiForTest( MULTI_FILE_EXAMPLE, undefined /* callback */, { stripDeprecated: true, stripDeprecatedAllowListFile }, @@ -226,20 +226,20 @@ describe('stripDeprecatedAllowList', () => { ); }); - test('strips none if the allowList is empty', async () => { - const tmpDir = await fs.mkdtemp( + test('strips none if the allowList is empty', () => { + const tmpDir = fs.mkdtempSync( path.join(os.tmpdir(), 'jsiideprecatedremover'), ); const stripDeprecatedAllowListFile = path.join(tmpDir, 'allowList'); // Valid but empty file - await fs.writeFile(stripDeprecatedAllowListFile, '', 'utf8'); + fs.writeFileSync(stripDeprecatedAllowListFile, '', 'utf8'); - const resultNoStrip = await compileJsiiForTest( + const resultNoStrip = compileJsiiForTest( MULTI_FILE_EXAMPLE, undefined /* callback */, { stripDeprecated: false }, ); - const resultStripEmpty = await compileJsiiForTest( + const resultStripEmpty = compileJsiiForTest( MULTI_FILE_EXAMPLE, undefined /* callback */, { stripDeprecated: true, stripDeprecatedAllowListFile }, @@ -253,12 +253,12 @@ describe('stripDeprecatedAllowList', () => { ); }); - test('strips only allowlisted items if subset is present', async () => { - const tmpDir = await fs.mkdtemp( + test('strips only allowlisted items if subset is present', () => { + const tmpDir = fs.mkdtempSync( path.join(os.tmpdir(), 'jsiideprecatedremover'), ); const stripDeprecatedAllowListFile = path.join(tmpDir, 'allowList'); - await fs.writeFile( + fs.writeFileSync( stripDeprecatedAllowListFile, [ 'testpkg.IDeprecatedInterface', @@ -268,7 +268,7 @@ describe('stripDeprecatedAllowList', () => { 'utf8', ); - const result = await compileJsiiForTest( + const result = compileJsiiForTest( MULTI_FILE_EXAMPLE, undefined /* callback */, { stripDeprecated: true, stripDeprecatedAllowListFile }, diff --git a/packages/jsii/test/deprecation-warnings.test.ts b/packages/jsii/test/deprecation-warnings.test.ts index f945e8557b..cd62370f31 100644 --- a/packages/jsii/test/deprecation-warnings.test.ts +++ b/packages/jsii/test/deprecation-warnings.test.ts @@ -10,8 +10,8 @@ import { loadProjectInfo } from '../lib/project-info'; const DEPRECATED = '/** @deprecated Use something else */'; describe('Function generation', () => { - test('generates the print function', async () => { - const result = await compileJsiiForTest(``, undefined /* callback */, { + test('generates the print function', () => { + const result = compileJsiiForTest(``, undefined /* callback */, { addDeprecationWarnings: true, }); @@ -57,8 +57,8 @@ module.exports = { print, getPropertyDescriptor, DeprecationError }; ); }); - test('generates a function for each type', async () => { - const result = await compileJsiiForTest( + test('generates a function for each type', () => { + const result = compileJsiiForTest( ` export interface Foo {} export interface Bar {} @@ -78,8 +78,8 @@ function testpkg_Baz(p) { ); }); - test('generates metadata', async () => { - const result = await compileJsiiForTest( + test('generates metadata', () => { + const result = compileJsiiForTest( ` export interface Foo {} export interface Bar {} @@ -93,8 +93,8 @@ function testpkg_Baz(p) { ).toBe(true); }); - test('for each non-primitive property, generates a call', async () => { - const result = await compileJsiiForTest( + test('for each non-primitive property, generates a call', () => { + const result = compileJsiiForTest( ` export interface Foo {} export interface Bar {} @@ -124,8 +124,8 @@ function testpkg_Baz(p) { }`); }); - test('generates empty functions for interfaces', async () => { - const result = await compileJsiiForTest( + test('generates empty functions for interfaces', () => { + const result = compileJsiiForTest( ` export interface IFoo { bar(): string; @@ -139,8 +139,8 @@ function testpkg_Baz(p) { }`); }); - test('generates empty functions for classes', async () => { - const result = await compileJsiiForTest( + test('generates empty functions for classes', () => { + const result = compileJsiiForTest( ` export class Foo { bar() {return 0}; @@ -154,8 +154,8 @@ function testpkg_Baz(p) { }`); }); - test('generates calls for recursive types', async () => { - const result = await compileJsiiForTest( + test('generates calls for recursive types', () => { + const result = compileJsiiForTest( ` export interface Bar {readonly bar?: Bar} `, @@ -179,8 +179,8 @@ function testpkg_Baz(p) { ); }); - test('generates exports for all the functions', async () => { - const result = await compileJsiiForTest( + test('generates exports for all the functions', () => { + const result = compileJsiiForTest( ` export interface Foo {} export interface Bar {} @@ -195,8 +195,8 @@ function testpkg_Baz(p) { ); }); - test('generates functions for enums', async () => { - const result = await compileJsiiForTest( + test('generates functions for enums', () => { + const result = compileJsiiForTest( ` export enum State { ON, @@ -228,8 +228,8 @@ function testpkg_Baz(p) { `); }); - test('generates calls for deprecated inherited properties', async () => { - const result = await compileJsiiForTest( + test('generates calls for deprecated inherited properties', () => { + const result = compileJsiiForTest( ` export interface Baz { /** @deprecated message from Baz */ @@ -289,8 +289,8 @@ function testpkg_Baz(p) { }`); }); - test('skips properties that are deprecated in one supertype but not the other', async () => { - const result = await compileJsiiForTest( + test('skips properties that are deprecated in one supertype but not the other', () => { + const result = compileJsiiForTest( ` export interface Baz { readonly x: string; @@ -312,8 +312,8 @@ function testpkg_Baz(p) { }`); }); - test('generates calls for types with deprecated properties', async () => { - const result = await compileJsiiForTest( + test('generates calls for types with deprecated properties', () => { + const result = compileJsiiForTest( ` export interface Bar { readonly x: string; @@ -347,8 +347,8 @@ function testpkg_Baz(p) { `); }); - test('generates calls for each property of a deprecated type', async () => { - const result = await compileJsiiForTest( + test('generates calls for each property of a deprecated type', () => { + const result = compileJsiiForTest( ` /** @deprecated use Bar instead */ export interface Foo { @@ -377,16 +377,16 @@ function testpkg_Baz(p) { `); }); - test('generates calls for types in other assemblies', async () => { + test('generates calls for types in other assemblies', () => { const calcBaseOfBaseRoot = resolveModuleDir( '@scope/jsii-calc-base-of-base', ); const calcBaseRoot = resolveModuleDir('@scope/jsii-calc-base'); const calcLibRoot = resolveModuleDir('@scope/jsii-calc-lib'); - await compile(calcBaseOfBaseRoot, false); - await compile(calcBaseRoot, true); - await compile(calcLibRoot, true); + compile(calcBaseOfBaseRoot, false); + compile(calcBaseRoot, true); + compile(calcLibRoot, true); const warningsFile = loadWarningsFile(calcBaseRoot); // jsii-calc-base was compiled with warnings. So we expect to see handlers for its types in the warnings file @@ -396,14 +396,14 @@ function testpkg_Baz(p) { expect(warningsFile).not.toMatch('_scope_jsii_calc_base_of_base'); // Recompiling without deprecation warning to leave the packages in a clean state - await compile(calcBaseRoot, false); - await compile(calcLibRoot, false); + compile(calcBaseRoot, false); + compile(calcLibRoot, false); }, 120000); }); describe('Call injections', () => { - test('does not add warnings by default', async () => { - const result = await compileJsiiForTest( + test('does not add warnings by default', () => { + const result = compileJsiiForTest( ` export class Foo { ${DEPRECATED} @@ -418,8 +418,8 @@ describe('Call injections', () => { ).toBeFalsy(); }); - test('generates a require statement', async () => { - const result = await compileJsiiForTest( + test('generates a require statement', () => { + const result = compileJsiiForTest( { 'index.ts': `export * from './some/folder/source'`, 'some/folder/source.ts': ` @@ -441,8 +441,8 @@ describe('Call injections', () => { ); }, 60000); - test('does not generate a require statement when no calls were injected', async () => { - const result = await compileJsiiForTest( + test('does not generate a require statement when no calls were injected', () => { + const result = compileJsiiForTest( { 'index.ts': `export * from './some/folder/handler'`, 'some/folder/handler.ts': ` @@ -461,8 +461,8 @@ describe('Call injections', () => { ); }, 60000); - test('deprecated methods', async () => { - const result = await compileJsiiForTest( + test('deprecated methods', () => { + const result = compileJsiiForTest( ` export class Foo { ${DEPRECATED} @@ -499,8 +499,8 @@ describe('Call injections', () => { `); }); - test('methods with parameters', async () => { - const result = await compileJsiiForTest( + test('methods with parameters', () => { + const result = compileJsiiForTest( ` export interface A {readonly x: number;} export class Foo { @@ -535,8 +535,8 @@ describe('Call injections', () => { `); }, 60000); - test('deprecated getters', async () => { - const result = await compileJsiiForTest( + test('deprecated getters', () => { + const result = compileJsiiForTest( ` export class Foo { private _x = 0; @@ -577,8 +577,8 @@ describe('Call injections', () => { `); }); - test('deprecated setters', async () => { - const result = await compileJsiiForTest( + test('deprecated setters', () => { + const result = compileJsiiForTest( ` export class Foo { private _x = 0; @@ -630,8 +630,8 @@ describe('Call injections', () => { `); }); - test('creates a new instance of error when test', async () => { - const result = await compileJsiiForTest( + test('creates a new instance of error when test', () => { + const result = compileJsiiForTest( ` ${DEPRECATED} export class Foo { @@ -670,8 +670,8 @@ describe('Call injections', () => { }); describe('thrown exceptions have the expected stack trace', () => { - test('constructor', async () => { - const compilation = await compileJsiiForTest( + test('constructor', () => { + const compilation = compileJsiiForTest( ` /** @deprecated for testing */ export class DeprecatedConstructor { @@ -710,8 +710,8 @@ describe('thrown exceptions have the expected stack trace', () => { } }); - test('getter', async () => { - const compilation = await compileJsiiForTest( + test('getter', () => { + const compilation = compileJsiiForTest( ` export class DeprecatedConstructor { /** @deprecated for testing */ @@ -753,8 +753,8 @@ describe('thrown exceptions have the expected stack trace', () => { } }); - test('setter', async () => { - const compilation = await compileJsiiForTest( + test('setter', () => { + const compilation = compileJsiiForTest( ` export class DeprecatedConstructor { private value = 1337; @@ -802,8 +802,8 @@ describe('thrown exceptions have the expected stack trace', () => { } }); - test('method', async () => { - const compilation = await compileJsiiForTest( + test('method', () => { + const compilation = compileJsiiForTest( ` export class DeprecatedConstructor { /** @deprecated for testing */ @@ -905,15 +905,15 @@ function resolveModuleDir(name: string) { return path.dirname(require.resolve(`${name}/package.json`)); } -async function compile(projectRoot: string, addDeprecationWarnings: boolean) { - const { projectInfo } = await loadProjectInfo(projectRoot); +function compile(projectRoot: string, addDeprecationWarnings: boolean) { + const { projectInfo } = loadProjectInfo(projectRoot); const compiler = new Compiler({ projectInfo, addDeprecationWarnings, }); - await compiler.emit(); + compiler.emit(); } function loadWarningsFile(projectRoot: string) { diff --git a/packages/jsii/test/docs.test.ts b/packages/jsii/test/docs.test.ts index b772d2c8ff..54b251d3ad 100644 --- a/packages/jsii/test/docs.test.ts +++ b/packages/jsii/test/docs.test.ts @@ -6,8 +6,8 @@ import { sourceToAssemblyHelper as compile } from '../lib'; jest.setTimeout(60_000); // ---------------------------------------------------------------------- -test('extract summary line from doc block, ends with a period', async () => { - const assembly = await compile(` +test('extract summary line from doc block, ends with a period', () => { + const assembly = compile(` /** * Hello this is the documentation for this class */ @@ -22,8 +22,8 @@ test('extract summary line from doc block, ends with a period', async () => { }); // ---------------------------------------------------------------------- -test('extract remarks from whitespace-separated doc block', async () => { - const assembly = await compile(` +test('extract remarks from whitespace-separated doc block', () => { + const assembly = compile(` /** * Hello this is the documentation for this class. * @@ -42,8 +42,8 @@ test('extract remarks from whitespace-separated doc block', async () => { }); // ---------------------------------------------------------------------- -test('separate long doc comment into summary and remarks', async () => { - const assembly = await compile(` +test('separate long doc comment into summary and remarks', () => { + const assembly = compile(` /** * Lots of people enjoy writing very long captions here. I think it's because they * copy/paste them out of CloudFormation, which has a tendency to just have one @@ -63,8 +63,8 @@ test('separate long doc comment into summary and remarks', async () => { }); // ---------------------------------------------------------------------- -test('separate non-space but newline terminated docs into summary&remarks', async () => { - const assembly = await compile(` +test('separate non-space but newline terminated docs into summary&remarks', () => { + const assembly = compile(` /** * Lots of people enjoy writing very long captions here. * I think it's because they copy/paste them out of CloudFormation, @@ -85,8 +85,8 @@ test('separate non-space but newline terminated docs into summary&remarks', asyn }); // ---------------------------------------------------------------------- -test('dont add period to summary that ends in exclamation mark', async () => { - const assembly = await compile(` +test('dont add period to summary that ends in exclamation mark', () => { + const assembly = compile(` /** * I'm happy about this class! */ @@ -101,8 +101,8 @@ test('dont add period to summary that ends in exclamation mark', async () => { }); // ---------------------------------------------------------------------- -test('parse method docs', async () => { - const assembly = await compile(` +test('parse method docs', () => { + const assembly = compile(` export class Foo { /** * Do the foo @@ -119,8 +119,8 @@ test('parse method docs', async () => { }); // ---------------------------------------------------------------------- -test('associate parameter comments with right parameter', async () => { - const assembly = await compile(` +test('associate parameter comments with right parameter', () => { + const assembly = compile(` export class Foo { /** * Do the foo @@ -139,8 +139,8 @@ test('associate parameter comments with right parameter', async () => { }); // ---------------------------------------------------------------------- -test('read example', async () => { - const assembly = await compile(` +test('read example', () => { + const assembly = compile(` export class Foo { /** * Do the foo @@ -162,8 +162,8 @@ test('read example', async () => { }); // ---------------------------------------------------------------------- -test('read default value', async () => { - const assembly = await compile(` +test('read default value', () => { + const assembly = compile(` export interface Foo { /** * The foo we're talking about @@ -180,8 +180,8 @@ test('read default value', async () => { }); // ---------------------------------------------------------------------- -test('read "see" annotation', async () => { - const assembly = await compile(` +test('read "see" annotation', () => { + const assembly = compile(` /** * @see http://lmgtfy.com/ */ @@ -193,8 +193,8 @@ test('read "see" annotation', async () => { }); // ---------------------------------------------------------------------- -test('read "returns" annotation', async () => { - const assembly = await compile(` +test('read "returns" annotation', () => { + const assembly = compile(` export class Foo { /** * Do the foo @@ -211,8 +211,8 @@ test('read "returns" annotation', async () => { }); // ---------------------------------------------------------------------- -test('can haz deprecated', async () => { - const assembly = await compile(` +test('can haz deprecated', () => { + const assembly = compile(` export class Foo { /** * Do the foo @@ -231,8 +231,8 @@ test('can haz deprecated', async () => { }); // ---------------------------------------------------------------------- -test('can mark stable', async () => { - const assembly = await compile(` +test('can mark stable', () => { + const assembly = compile(` /** * Rock solid Foo * @@ -248,8 +248,8 @@ test('can mark stable', async () => { }); // ---------------------------------------------------------------------- -test('can mark experimental', async () => { - const assembly = await compile(` +test('can mark experimental', () => { + const assembly = compile(` /** * Slightly less solid Foo * @@ -266,8 +266,8 @@ test('can mark experimental', async () => { // ---------------------------------------------------------------------- -test('can mark external', async () => { - const assembly = await compile(` +test('can mark external', () => { + const assembly = compile(` /** * @stability external */ @@ -286,8 +286,8 @@ test('can mark external', async () => { }); // ---------------------------------------------------------------------- -test('can mark subclassable', async () => { - const assembly = await compile(` +test('can mark subclassable', () => { + const assembly = compile(` /** * Become this Foo * @@ -303,8 +303,8 @@ test('can mark subclassable', async () => { }); // ---------------------------------------------------------------------- -test('can add arbitrary tags', async () => { - const assembly = await compile(` +test('can add arbitrary tags', () => { + const assembly = compile(` /** * @boop */ @@ -318,7 +318,7 @@ test('can add arbitrary tags', async () => { }); // ---------------------------------------------------------------------- -test('stability is inherited from parent type', async () => { +test('stability is inherited from parent type', () => { const stabilities = [ ['@deprecated Not good no more', Stability.Deprecated], ['@experimental', Stability.Experimental], @@ -327,7 +327,7 @@ test('stability is inherited from parent type', async () => { for (const [tag, stability] of stabilities) { // eslint-disable-next-line no-await-in-loop - const assembly = await compile(` + const assembly = compile(` /** * ${tag} */ @@ -354,8 +354,8 @@ test('stability is inherited from parent type', async () => { }); // ---------------------------------------------------------------------- -test('@example can contain @ sign', async () => { - const assembly = await compile(` +test('@example can contain @ sign', () => { + const assembly = compile(` /** * An IAM role to associate with the instance profile assigned to this Auto Scaling Group. * diff --git a/packages/jsii/test/enums.test.ts b/packages/jsii/test/enums.test.ts index 7cae6cb00e..0c4252603c 100644 --- a/packages/jsii/test/enums.test.ts +++ b/packages/jsii/test/enums.test.ts @@ -3,8 +3,8 @@ import { EnumType } from '@jsii/spec'; import { sourceToAssemblyHelper } from '../lib'; // ---------------------------------------------------------------------- -test('test parsing enum with two members and no values', async () => { - const assembly = await sourceToAssemblyHelper(` +test('test parsing enum with two members and no values', () => { + const assembly = sourceToAssemblyHelper(` export enum Foo { BAR, BAZ @@ -23,8 +23,8 @@ test('test parsing enum with two members and no values', async () => { }); // ---------------------------------------------------------------------- -test('test parsing enum with two members and assigned values', async () => { - const assembly = await sourceToAssemblyHelper(` +test('test parsing enum with two members and assigned values', () => { + const assembly = sourceToAssemblyHelper(` export enum Foo { BAR = 'Bar', BAZ = 'Baz' @@ -44,8 +44,8 @@ test('test parsing enum with two members and assigned values', async () => { // ---------------------------------------------------------------------- -test('enums can have a mix of letters and number', async () => { - const assembly = await sourceToAssemblyHelper(` +test('enums can have a mix of letters and number', () => { + const assembly = sourceToAssemblyHelper(` export enum Foo { Q5X, IB3M, diff --git a/packages/jsii/test/export-specifier.test.ts b/packages/jsii/test/export-specifier.test.ts index cc0391fcc0..db2129b62a 100644 --- a/packages/jsii/test/export-specifier.test.ts +++ b/packages/jsii/test/export-specifier.test.ts @@ -1,7 +1,7 @@ import { sourceToAssemblyHelper } from '../lib'; -test('export { Foo } from "./foo"', async () => { - const assembly = await sourceToAssemblyHelper({ +test('export { Foo } from "./foo"', () => { + const assembly = sourceToAssemblyHelper({ 'index.ts': 'export { Foo } from "./foo";', 'foo.ts': 'export class Foo { private constructor() {} }', }); diff --git a/packages/jsii/test/hints.test.ts b/packages/jsii/test/hints.test.ts index 0df21078ca..f9c9a5b4f7 100644 --- a/packages/jsii/test/hints.test.ts +++ b/packages/jsii/test/hints.test.ts @@ -3,8 +3,8 @@ import { InterfaceType, TypeKind } from '@jsii/spec'; import { sourceToAssemblyHelper } from '../lib'; describe('@struct', () => { - test('causes behavioral-named interfaces to be structs', async () => { - const assembly = await sourceToAssemblyHelper(` + test('causes behavioral-named interfaces to be structs', () => { + const assembly = sourceToAssemblyHelper(` /** @struct */ export interface IPSet { readonly cidr: string; @@ -17,8 +17,8 @@ describe('@struct', () => { ); }); - test('can be used on any struct', async () => { - const assembly = await sourceToAssemblyHelper(` + test('can be used on any struct', () => { + const assembly = sourceToAssemblyHelper(` /** @struct */ export interface Struct { readonly cidr: string; diff --git a/packages/jsii/test/literate.test.ts b/packages/jsii/test/literate.test.ts index d34bd549ef..d0d289c3e7 100644 --- a/packages/jsii/test/literate.test.ts +++ b/packages/jsii/test/literate.test.ts @@ -90,7 +90,7 @@ test('can add inline MarkDown', () => { ); }); -test('can do example inclusion', async () => { +test('can do example inclusion', () => { const inputMarkDown = [ 'This is a preamble', '[included here](test/something.lit.ts)', @@ -105,11 +105,7 @@ test('can do example inclusion', async () => { }; }; - const rendered = await includeAndRenderExamples( - inputMarkDown, - fakeLoader, - '.', - ); + const rendered = includeAndRenderExamples(inputMarkDown, fakeLoader, '.'); expect(rendered).toEqual([ 'This is a preamble', diff --git a/packages/jsii/test/negatives.test.ts b/packages/jsii/test/negatives.test.ts index a53d3b5f44..fb47463cdf 100644 --- a/packages/jsii/test/negatives.test.ts +++ b/packages/jsii/test/negatives.test.ts @@ -24,8 +24,8 @@ for (const source of fs.readdirSync(SOURCE_DIR)) { const filePath = path.join(SOURCE_DIR, source); test( source.replace(/neg\.(.+)\.ts/, '$1'), - async () => { - const { strict, stripDeprecated } = await _getPragmas(filePath); + () => { + const { strict, stripDeprecated } = _getPragmas(filePath); // Change in dir, so relative paths are processed correctly. process.chdir(SOURCE_DIR); @@ -35,7 +35,7 @@ for (const source of fs.readdirSync(SOURCE_DIR)) { failOnWarnings: strict, stripDeprecated, }); - const emitResult = await compiler.emit(path.join(SOURCE_DIR, source)); + const emitResult = compiler.emit(path.join(SOURCE_DIR, source)); expect(emitResult.emitSkipped).toBeTruthy(); @@ -57,23 +57,17 @@ for (const source of fs.readdirSync(SOURCE_DIR)) { ).toMatchSnapshot(); // Cleaning up... - return Promise.all( - (await fs.readdir(SOURCE_DIR)).map((file) => { - const promises = new Array>(); - if ( - file.startsWith('neg.') && - (file.endsWith('.d.ts') || file.endsWith('.js')) - ) { - promises.push(fs.remove(path.join(SOURCE_DIR, file))); - } - promises.push( - fs.remove(path.join(SOURCE_DIR, '.jsii')), - fs.remove(path.join(SOURCE_DIR, 'tsconfig.json')), - fs.remove(path.join(SOURCE_DIR, '.build')), - ); - return Promise.all(promises); - }), - ); + fs.readdirSync(SOURCE_DIR).forEach((file) => { + if ( + file.startsWith('neg.') && + (file.endsWith('.d.ts') || file.endsWith('.js')) + ) { + fs.removeSync(path.join(SOURCE_DIR, file)); + } + fs.removeSync(path.join(SOURCE_DIR, '.jsii')); + fs.removeSync(path.join(SOURCE_DIR, 'tsconfig.json')); + fs.removeSync(path.join(SOURCE_DIR, '.build')); + }); }, 50000, ); @@ -81,10 +75,11 @@ for (const source of fs.readdirSync(SOURCE_DIR)) { const STRICT_MARKER = '///!STRICT!'; const STRIP_DEPRECATED_MARKER = '///!STRIP_DEPRECATED!'; -async function _getPragmas( - file: string, -): Promise<{ strict: boolean; stripDeprecated: boolean }> { - const data = await fs.readFile(file, { encoding: 'utf8' }); +function _getPragmas(file: string): { + strict: boolean; + stripDeprecated: boolean; +} { + const data = fs.readFileSync(file, { encoding: 'utf8' }); const lines = data.split('\n'); const strict = lines.some((line) => line.startsWith(STRICT_MARKER)); const stripDeprecated = lines.some((line) => diff --git a/packages/jsii/test/project-info.test.ts b/packages/jsii/test/project-info.test.ts index bf106243f1..ad68d5d81f 100644 --- a/packages/jsii/test/project-info.test.ts +++ b/packages/jsii/test/project-info.test.ts @@ -30,8 +30,8 @@ const BASE_PROJECT = { describe('loadProjectInfo', () => { test('loads valid project', () => - _withTestProject(async (projectRoot) => { - const { projectInfo: info } = await loadProjectInfo(projectRoot); + _withTestProject((projectRoot) => { + const { projectInfo: info } = loadProjectInfo(projectRoot); expect(info.name).toBe(BASE_PROJECT.name); expect(info.version).toBe(BASE_PROJECT.version); expect(info.description).toBe(BASE_PROJECT.description); @@ -61,8 +61,8 @@ describe('loadProjectInfo', () => { test('loads valid project (UNLICENSED)', () => _withTestProject( - async (projectRoot) => { - const { projectInfo: info } = await loadProjectInfo(projectRoot); + (projectRoot) => { + const { projectInfo: info } = loadProjectInfo(projectRoot); expect(info?.license).toBe('UNLICENSED'); }, (info) => { @@ -72,8 +72,8 @@ describe('loadProjectInfo', () => { test('loads valid project (using bundleDependencies)', () => _withTestProject( - async (projectRoot) => { - const { projectInfo: info } = await loadProjectInfo(projectRoot); + (projectRoot) => { + const { projectInfo: info } = loadProjectInfo(projectRoot); expect(info.bundleDependencies).toEqual({ bundled: '^1.2.3' }); }, (info) => { @@ -84,8 +84,8 @@ describe('loadProjectInfo', () => { test('loads valid project (using bundledDependencies)', () => _withTestProject( - async (projectRoot) => { - const { projectInfo: info } = await loadProjectInfo(projectRoot); + (projectRoot) => { + const { projectInfo: info } = loadProjectInfo(projectRoot); expect(info.bundleDependencies).toEqual({ bundled: '^1.2.3' }); }, (info) => { @@ -97,8 +97,8 @@ describe('loadProjectInfo', () => { test('loads valid project (with contributors)', () => { const contributors = [{ name: 'foo', email: 'nobody@amazon.com' }]; return _withTestProject( - async (projectRoot) => { - const { projectInfo: info } = await loadProjectInfo(projectRoot); + (projectRoot) => { + const { projectInfo: info } = loadProjectInfo(projectRoot); expect(info?.contributors?.map(_stripUndefined)).toEqual( contributors.map((c) => ({ ...c, roles: ['contributor'] })), ); @@ -110,7 +110,7 @@ describe('loadProjectInfo', () => { test('rejects un-declared dependency in bundleDependencies', () => _withTestProject( (projectRoot) => - expect(loadProjectInfo(projectRoot)).rejects.toThrow( + expect(() => loadProjectInfo(projectRoot)).toThrow( /not declared in "dependencies"/i, ), (info) => { @@ -121,7 +121,7 @@ describe('loadProjectInfo', () => { test('rejects invalid license', () => _withTestProject( (projectRoot) => - expect(loadProjectInfo(projectRoot)).rejects.toThrow( + expect(() => loadProjectInfo(projectRoot)).toThrow( /invalid license identifier/i, ), (info) => { @@ -132,7 +132,7 @@ describe('loadProjectInfo', () => { test('rejects incompatible dependency version', () => _withTestProject( (projectRoot) => - expect(loadProjectInfo(projectRoot)).rejects.toThrow( + expect(() => loadProjectInfo(projectRoot)).toThrow( /declared dependency on version .+ but version .+ was found/i, ), (info) => { @@ -144,7 +144,7 @@ describe('loadProjectInfo', () => { test('missing peerDependencies are allowed', () => _withTestProject( (projectRoot) => - expect(loadProjectInfo(projectRoot)).resolves.toEqual( + expect(loadProjectInfo(projectRoot)).toEqual( expect.objectContaining({ diagnostics: [], }), @@ -157,7 +157,7 @@ describe('loadProjectInfo', () => { test('warns if peerDependency misses a matching devDependency', () => _withTestProject( (projectRoot) => - expect(loadProjectInfo(projectRoot)).resolves.toEqual( + expect(loadProjectInfo(projectRoot)).toEqual( expect.objectContaining({ diagnostics: [expect.objectContaining({ jsiiCode: 6 })], }), @@ -170,7 +170,7 @@ describe('loadProjectInfo', () => { test('warns if peerDependency has a devDependency on the wrong version', () => _withTestProject( (projectRoot) => - expect(loadProjectInfo(projectRoot)).resolves.toEqual( + expect(loadProjectInfo(projectRoot)).toEqual( expect.objectContaining({ diagnostics: [expect.objectContaining({ jsiiCode: 6 })], }), @@ -184,7 +184,7 @@ describe('loadProjectInfo', () => { test('no warnings if devDependency point version matches peerDependency range', () => _withTestProject( (projectRoot) => - expect(loadProjectInfo(projectRoot)).resolves.toEqual( + expect(loadProjectInfo(projectRoot)).toEqual( expect.objectContaining({ diagnostics: [], }), @@ -198,8 +198,8 @@ describe('loadProjectInfo', () => { describe('_loadDiagnostics', () => { test('diagnostic categories are correctly detected', () => { return _withTestProject( - async (projectRoot) => { - const { projectInfo: info } = await loadProjectInfo(projectRoot); + (projectRoot) => { + const { projectInfo: info } = loadProjectInfo(projectRoot); expect(info.diagnostics).toBeDefined(); const diagnostics = info.diagnostics!; expect(Object.keys(diagnostics).sort()).toEqual([ @@ -230,7 +230,7 @@ describe('loadProjectInfo', () => { test('invalid category is rejected', () => { return _withTestProject( (projectRoot) => - expect(loadProjectInfo(projectRoot)).rejects.toThrow( + expect(() => loadProjectInfo(projectRoot)).toThrow( /Invalid category/, ), (info) => { @@ -291,11 +291,11 @@ const TEST_DEP_DEP_ASSEMBLY: spec.Assembly = { * * @return the result of executing ``cb``. */ -async function _withTestProject( - cb: (projectRoot: string) => T | Promise, +function _withTestProject( + cb: (projectRoot: string) => T, gremlin?: (packageInfo: any) => void, -): Promise { - const tmpdir = await fs.mkdtemp( +): T { + const tmpdir = fs.mkdtempSync( path.join(os.tmpdir(), path.basename(__filename)), ); try { @@ -303,53 +303,50 @@ async function _withTestProject( if (gremlin) { gremlin(packageInfo); } - await fs.writeJson(path.join(tmpdir, 'package.json'), packageInfo, { + fs.writeJsonSync(path.join(tmpdir, 'package.json'), packageInfo, { spaces: 2, }); - await fs.writeFile( + fs.writeFileSync( path.join(tmpdir, 'index.js'), '// There ought to be some javascript', ); - await fs.writeFile( + fs.writeFileSync( path.join(tmpdir, 'index.ts'), '// There ought to be some typescript', ); - await fs.writeFile( + fs.writeFileSync( path.join(tmpdir, 'index.d.ts'), '// There ought to be some typescript definitions', ); const jsiiTestDep = path.join(tmpdir, 'node_modules', 'jsii-test-dep'); - await writeNpmPackageSkeleton(jsiiTestDep); + writeNpmPackageSkeleton(jsiiTestDep); - await fs.writeJson(path.join(jsiiTestDep, '.jsii'), TEST_DEP_ASSEMBLY); + fs.writeJsonSync(path.join(jsiiTestDep, '.jsii'), TEST_DEP_ASSEMBLY); const jsiiTestDepDep = path.join( jsiiTestDep, 'node_modules', 'jsii-test-dep-dep', ); - await writeNpmPackageSkeleton(jsiiTestDepDep); - await fs.writeJson( - path.join(jsiiTestDepDep, '.jsii'), - TEST_DEP_DEP_ASSEMBLY, - ); + writeNpmPackageSkeleton(jsiiTestDepDep); + fs.writeJsonSync(path.join(jsiiTestDepDep, '.jsii'), TEST_DEP_DEP_ASSEMBLY); - return await cb(tmpdir); + return cb(tmpdir); } finally { - await fs.remove(tmpdir); + fs.removeSync(tmpdir); } } /** * Write a package.json and an index.js so the package is mostly well-formed */ -async function writeNpmPackageSkeleton(directory: string) { - await fs.mkdirs(directory); - await fs.writeJson(path.join(directory, 'package.json'), { +function writeNpmPackageSkeleton(directory: string) { + fs.mkdirsSync(directory); + fs.writeJsonSync(path.join(directory, 'package.json'), { name: path.basename(directory), }); - await fs.writeFile( + fs.writeFileSync( path.join(directory, 'index.js'), '// There should be some JS', ); diff --git a/packages/jsii/test/quirks.test.ts b/packages/jsii/test/quirks.test.ts index 86f56085ff..4a43b49c0e 100644 --- a/packages/jsii/test/quirks.test.ts +++ b/packages/jsii/test/quirks.test.ts @@ -1,8 +1,8 @@ import { sourceToAssemblyHelper } from '../lib'; // ---------------------------------------------------------------------- -test('trailing semicolon after method is correctly ignored', async () => { - const assembly = await sourceToAssemblyHelper(` +test('trailing semicolon after method is correctly ignored', () => { + const assembly = sourceToAssemblyHelper(` export class Foo { private readonly initialized: boolean; diff --git a/packages/jsii/test/submodules.test.ts b/packages/jsii/test/submodules.test.ts index 244e5e8d58..beeedc4bc5 100644 --- a/packages/jsii/test/submodules.test.ts +++ b/packages/jsii/test/submodules.test.ts @@ -8,8 +8,8 @@ import { compileJsiiForTest, } from '../lib'; -test('submodules loaded from directories can have a README', async () => { - const assembly = await sourceToAssemblyHelper({ +test('submodules loaded from directories can have a README', () => { + const assembly = sourceToAssemblyHelper({ 'index.ts': 'export * as submodule from "./subdir"', 'subdir/index.ts': 'export class Foo { }', 'subdir/README.md': 'This is the README', @@ -24,8 +24,8 @@ test('submodules loaded from directories can have a README', async () => { ); }); -test('submodules loaded from files can have a README', async () => { - const assembly = await sourceToAssemblyHelper({ +test('submodules loaded from files can have a README', () => { + const assembly = sourceToAssemblyHelper({ 'index.ts': 'export * as submodule from "./submod"', 'submod.ts': 'export class Foo { }', 'submod.README.md': 'This is the README', @@ -40,8 +40,8 @@ test('submodules loaded from files can have a README', async () => { ); }); -test('submodules loaded from directories can have targets', async () => { - const assembly = await sourceToAssemblyHelper({ +test('submodules loaded from directories can have targets', () => { + const assembly = sourceToAssemblyHelper({ 'index.ts': 'export * as submodule from "./subdir"', 'subdir/index.ts': 'export class Foo { }', 'subdir/.jsiirc.json': JSON.stringify({ @@ -60,8 +60,8 @@ test('submodules loaded from directories can have targets', async () => { ); }); -test('submodule READMEs can have literate source references', async () => { - const assembly = await sourceToAssemblyHelper({ +test('submodule READMEs can have literate source references', () => { + const assembly = sourceToAssemblyHelper({ 'index.ts': 'export * as submodule from "./subdir"', 'subdir/index.ts': 'export class Foo { }', 'subdir/README.md': @@ -89,7 +89,7 @@ type ImportStyle = 'directly' | 'as namespace' | 'with alias'; test.each(['directly', 'as namespace', 'with alias'] as ImportStyle[])( 'can reference submodule types, importing %s', (importStyle) => - TestWorkspace.withWorkspace(async (ws) => { + TestWorkspace.withWorkspace((ws) => { // There are 2 import styles: // // import { submodule } from 'lib'; @@ -98,7 +98,7 @@ test.each(['directly', 'as namespace', 'with alias'] as ImportStyle[])( // We need to support both import styles. // Dependency that exports a submodule - await ws.addDependency(await makeDependencyWithSubmodule()); + ws.addDependency(makeDependencyWithSubmodule()); let importStatement; let prefix; @@ -120,7 +120,7 @@ test.each(['directly', 'as namespace', 'with alias'] as ImportStyle[])( // Main library that imports the submodule class directly // Use the type in all possible positions - const result = await compileJsiiForTest( + const result = compileJsiiForTest( { 'index.ts': ` ${importStatement}; @@ -174,7 +174,7 @@ test.each(['directly', 'as namespace', 'with alias'] as ImportStyle[])( test.each(['directly', 'as namespace', 'with alias'] as ImportStyle[])( 'can reference nested types in submodules, importing %s', (importStyle) => - TestWorkspace.withWorkspace(async (ws) => { + TestWorkspace.withWorkspace((ws) => { // There are 2 import styles: // // import { submodule } from 'lib'; @@ -183,7 +183,7 @@ test.each(['directly', 'as namespace', 'with alias'] as ImportStyle[])( // We need to support both import styles. // Dependency that exports a submodule - await ws.addDependency(await makeDependencyWithSubmoduleAndNamespace()); + ws.addDependency(makeDependencyWithSubmoduleAndNamespace()); let importStatement; let prefix; @@ -204,7 +204,7 @@ test.each(['directly', 'as namespace', 'with alias'] as ImportStyle[])( // Main library that imports the submodule class directly // Use the type in all possible positions - const result = await compileJsiiForTest( + const result = compileJsiiForTest( { 'index.ts': ` ${importStatement}; @@ -258,22 +258,22 @@ test.each(['directly', 'as namespace', 'with alias'] as ImportStyle[])( // Backwards compatibility test, for versions of libraries compiled before jsii 1.39.0 // which introduced the symbol identifier table test('will detect types from submodules even if the symbol identifier table is missing', () => - TestWorkspace.withWorkspace(async (ws) => { - await ws.addDependency(await makeDependencyWithSubmodule()); + TestWorkspace.withWorkspace((ws) => { + ws.addDependency(makeDependencyWithSubmodule()); // Strip the symbolidentifiers from the assembly const asmFile = path.join(ws.dependencyDir('testpkg'), '.jsii'); - const asm: spec.Assembly = await fs.readJson(asmFile); + const asm: spec.Assembly = fs.readJsonSync(asmFile); for (const mod of Object.values(asm.submodules ?? {})) { delete mod.symbolId; } for (const type of Object.values(asm.types ?? {})) { delete type.symbolId; } - await fs.writeJson(asmFile, asm); + fs.writeJsonSync(asmFile, asm); // We can still use those types if we have a full-library import - await compileJsiiForTest( + compileJsiiForTest( { 'index.ts': ` import { submodule } from 'testpkg'; @@ -293,7 +293,7 @@ test('will detect types from submodules even if the symbol identifier table is m ); })); -async function makeDependencyWithSubmodule() { +function makeDependencyWithSubmodule() { return compileJsiiForTest({ 'index.ts': 'export * as submodule from "./subdir"', 'subdir/index.ts': [ @@ -305,7 +305,7 @@ async function makeDependencyWithSubmodule() { }); } -async function makeDependencyWithSubmoduleAndNamespace() { +function makeDependencyWithSubmoduleAndNamespace() { return compileJsiiForTest({ 'index.ts': 'export * as submodule from "./subdir"', 'subdir/index.ts': [ diff --git a/packages/jsii/test/symbol-identifiers.test.ts b/packages/jsii/test/symbol-identifiers.test.ts index 04a6a83c80..b1e90a55c4 100644 --- a/packages/jsii/test/symbol-identifiers.test.ts +++ b/packages/jsii/test/symbol-identifiers.test.ts @@ -1,7 +1,7 @@ import { compileJsiiForTest, normalizePath } from '../lib'; -test('Symbol map is generated', async () => { - const result = await compileJsiiForTest( +test('Symbol map is generated', () => { + const result = compileJsiiForTest( { 'index.ts': ` export * from './some/nested/file'; @@ -29,8 +29,8 @@ test('Symbol map is generated', async () => { expect(types['testpkg.Baz'].symbolId).toEqual('some/nested/file:Baz'); }); -test('Symbol id for single-value enum correctly identifies enum', async () => { - const result = await compileJsiiForTest( +test('Symbol id for single-value enum correctly identifies enum', () => { + const result = compileJsiiForTest( { 'index.ts': ` export enum SomeEnum { @@ -46,8 +46,8 @@ test('Symbol id for single-value enum correctly identifies enum', async () => { expect(types['testpkg.SomeEnum'].symbolId).toEqual('index:SomeEnum'); }); -test('Module declarations are included in symbolId', async () => { - const result = await compileJsiiForTest( +test('Module declarations are included in symbolId', () => { + const result = compileJsiiForTest( { 'index.ts': ` export class Foo { @@ -69,8 +69,8 @@ test('Module declarations are included in symbolId', async () => { expect(types['testpkg.Foo.Bar'].symbolId).toEqual('index:Foo.Bar'); }); -test('Submodules also have symbol identifiers', async () => { - const result = await compileJsiiForTest( +test('Submodules also have symbol identifiers', () => { + const result = compileJsiiForTest( { 'index.ts': `export * as submod from './submodule';`, 'submodule.ts': ` @@ -89,8 +89,8 @@ test('Submodules also have symbol identifiers', async () => { ); }); -test('Submodules also have symbol identifiers', async () => { - const result = await compileJsiiForTest( +test('Submodules also have symbol identifiers', () => { + const result = compileJsiiForTest( { 'index.ts': ` export namespace cookie { From 11b3ec88213781396e9261562c05faae68aa083c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 18:04:05 +0000 Subject: [PATCH 26/32] chore(deps): Update black requirement from ~=22.1 to ~=22.3 in /packages/@jsii/python-runtime (#3471) Updates the requirements on [black](https://github.com/psf/black) to permit the latest version.
Release notes

Sourced from black's releases.

22.3.0

Preview style

  • Code cell separators #%% are now standardised to # %% (#2919)
  • Remove unnecessary parentheses from except statements (#2939)
  • Remove unnecessary parentheses from tuple unpacking in for loops (#2945)
  • Avoid magic-trailing-comma in single-element subscripts (#2942)

Configuration

  • Do not format __pypackages__ directories by default (#2836)
  • Add support for specifying stable version with --required-version (#2832).
  • Avoid crashing when the user has no homedir (#2814)
  • Avoid crashing when md5 is not available (#2905)
  • Fix handling of directory junctions on Windows (#2904)

Documentation

  • Update pylint config documentation (#2931)

Integrations

  • Move test to disable plugin in Vim/Neovim, which speeds up loading (#2896)

Output

  • In verbose, mode, log when Black is using user-level config (#2861)

Packaging

  • Fix Black to work with Click 8.1.0 (#2966)
  • On Python 3.11 and newer, use the standard library's tomllib instead of tomli (#2903)
  • black-primer, the deprecated internal devtool, has been removed and copied to a separate repository (#2924)

Parser

  • Black can now parse starred expressions in the target of for and async for statements, e.g for item in *items_1, *items_2: pass (#2879).
Changelog

Sourced from black's changelog.

22.3.0

Preview style

  • Code cell separators #%% are now standardised to # %% (#2919)
  • Remove unnecessary parentheses from except statements (#2939)
  • Remove unnecessary parentheses from tuple unpacking in for loops (#2945)
  • Avoid magic-trailing-comma in single-element subscripts (#2942)

Configuration

  • Do not format __pypackages__ directories by default (#2836)
  • Add support for specifying stable version with --required-version (#2832).
  • Avoid crashing when the user has no homedir (#2814)
  • Avoid crashing when md5 is not available (#2905)
  • Fix handling of directory junctions on Windows (#2904)

Documentation

  • Update pylint config documentation (#2931)

Integrations

  • Move test to disable plugin in Vim/Neovim, which speeds up loading (#2896)

Output

  • In verbose, mode, log when Black is using user-level config (#2861)

Packaging

  • Fix Black to work with Click 8.1.0 (#2966)
  • On Python 3.11 and newer, use the standard library's tomllib instead of tomli (#2903)
  • black-primer, the deprecated internal devtool, has been removed and copied to a separate repository (#2924)

Parser

  • Black can now parse starred expressions in the target of for and async for statements, e.g for item in *items_1, *items_2: pass (#2879).

22.1.0

At long last, Black is no longer a beta product! This is the first non-beta release and the first release covered by our new stability policy.

Highlights

... (truncated)

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- packages/@jsii/python-runtime/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@jsii/python-runtime/requirements.txt b/packages/@jsii/python-runtime/requirements.txt index a2a6ce96b9..19a7bcad39 100644 --- a/packages/@jsii/python-runtime/requirements.txt +++ b/packages/@jsii/python-runtime/requirements.txt @@ -1,4 +1,4 @@ -black~=22.1 +black~=22.3 mypy==0.812 pip~=21.3 ; python_version < '3.7' pip~=22.0 ; python_version >= '3.7' From f61f99066504a5d3ae60633376aa70088c28eed9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 19:12:52 +0000 Subject: [PATCH 27/32] chore(deps): Update cattrs requirement from <1.11,>=1.8 to >=1.8,<22.2 in /packages/@jsii/python-runtime (#3470) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates the requirements on [cattrs](https://github.com/python-attrs/cattrs) to permit the latest version.
Changelog

Sourced from cattrs's changelog.

22.1.0 (2022-04-03)

  • cattrs now uses the CalVer versioning convention.
  • cattrs now has a detailed validation mode, which is enabled by default. Learn more here <https://cattrs.readthedocs.io/en/latest/validation.html>_. The old behavior can be restored by creating the converter with detailed_validation=False.
  • attrs and dataclass structuring is now ~25% faster.
  • Fix an issue structuring bare typing.List s on Pythons lower than 3.9. ([#209](https://github.com/python-attrs/cattrs/issues/209) <https://github.com/python-attrs/cattrs/issues/209>_)
  • Fix structuring of non-parametrized containers like list/dict/... on Pythons lower than 3.9. ([#218](https://github.com/python-attrs/cattrs/issues/218) <https://github.com/python-attrs/cattrs/issues/218>_)
  • Fix structuring bare typing.Tuple on Pythons lower than 3.9. ([#218](https://github.com/python-attrs/cattrs/issues/218) <https://github.com/python-attrs/cattrs/issues/218>_)
  • Fix a wrong AttributeError of an missing __parameters__ attribute. This could happen when inheriting certain generic classes – for example typing.* classes are affected. ([#217](https://github.com/python-attrs/cattrs/issues/217) <https://github.com/python-attrs/cattrs/issues/217>_)
  • Fix structuring of enum.Enum instances in typing.Literal types. ([#231](https://github.com/python-attrs/cattrs/issues/231) <https://github.com/python-attrs/cattrs/pull/231>_)
  • Fix unstructuring all tuples - unannotated, variable-length, homogenous and heterogenous - to list. ([#226](https://github.com/python-attrs/cattrs/issues/226) <https://github.com/python-attrs/cattrs/issues/226>_)
  • For forbid_extra_keys raise custom ForbiddenExtraKeyError instead of generic Exception. ([#225](https://github.com/python-attrs/cattrs/issues/225) <https://github.com/python-attrs/cattrs/pull/225>_)
  • All preconf converters now support loads and dumps directly. See an example here <https://cattrs.readthedocs.io/en/latest/preconf.html>_.
  • Fix mappings with byte keys for the orjson, bson and tomlkit converters. ([#241](https://github.com/python-attrs/cattrs/issues/241) <https://github.com/python-attrs/cattrs/issues/241>_)

1.10.0 (2022-01-04)

  • Add PEP 563 (string annotations) support for dataclasses. ([#195](https://github.com/python-attrs/cattrs/issues/195) <https://github.com/python-attrs/cattrs/issues/195>_)
  • Fix handling of dictionaries with string Enum keys for bson, orjson, and tomlkit.
  • Rename the cattr.gen.make_dict_unstructure_fn.omit_if_default parameter to _cattrs_omit_if_default, for consistency. The omit_if_default parameters to GenConverter and override are unchanged.
  • Following the changes in attrs 21.3.0, add a cattrs package mirroring the existing cattr package. Both package names may be used as desired, and the cattr package isn't going away.

1.9.0 (2021-12-06)

  • Python 3.10 support, including support for the new union syntax (A | B vs Union[A, B]).
  • The GenConverter can now properly structure generic classes with generic collection fields. ([#149](https://github.com/python-attrs/cattrs/issues/149) <https://github.com/python-attrs/cattrs/issues/149>_)
  • omit=True now also affects generated structuring functions. ([#166](https://github.com/python-attrs/cattrs/issues/166) <https://github.com/python-attrs/cattrs/issues/166>_)
  • cattr.gen.{make_dict_structure_fn, make_dict_unstructure_fn} now resolve type annotations automatically when PEP 563 is used. ([#169](https://github.com/python-attrs/cattrs/issues/169) <https://github.com/python-attrs/cattrs/issues/169>_)
  • Protocols are now unstructured as their runtime types. ([#177](https://github.com/python-attrs/cattrs/issues/177) <https://github.com/python-attrs/cattrs/pull/177>_)
  • Fix an issue generating structuring functions with renaming and _cattrs_forbid_extra_keys=True. ([#190](https://github.com/python-attrs/cattrs/issues/190) <https://github.com/python-attrs/cattrs/issues/190>_)

1.8.0 (2021-08-13)

  • Fix GenConverter mapping structuring for unannotated dicts on Python 3.8.

... (truncated)

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- packages/@jsii/python-runtime/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@jsii/python-runtime/setup.py b/packages/@jsii/python-runtime/setup.py index 440c5e9305..e61844806e 100644 --- a/packages/@jsii/python-runtime/setup.py +++ b/packages/@jsii/python-runtime/setup.py @@ -32,7 +32,7 @@ install_requires=[ "attrs~=21.2", "cattrs~=1.0.0 ; python_version < '3.7'", - "cattrs>=1.8,<1.11 ; python_version >= '3.7'", + "cattrs>=1.8,<22.2 ; python_version >= '3.7'", "importlib_resources ; python_version < '3.7'", "python-dateutil", "typing_extensions>=3.7,<5.0", From 7395f62fc489de8e4fcbfe19f4b59fbf93b9e5d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Apr 2022 12:30:15 +0000 Subject: [PATCH 28/32] chore(deps-dev): Update twine requirement from ~=3.8.0 to ~=4.0.0 in /packages/jsii-pacmak/lib/targets/python (#3469) Updates the requirements on [twine](https://github.com/pypa/twine) to permit the latest version.
Changelog

Sourced from twine's changelog.

Twine 4.0.0 (2022-03-31)

Features ^^^^^^^^

  • Drop support for Python 3.6. ([#869](https://github.com/pypa/twine/issues/869) <https://github.com/pypa/twine/issues/869>_)
  • Use Rich to add color to upload output. ([#851](https://github.com/pypa/twine/issues/851) <https://github.com/pypa/twine/issues/851>_)
  • Use Rich to add color to check output. ([#874](https://github.com/pypa/twine/issues/874) <https://github.com/pypa/twine/issues/874>_)
  • Use Rich instead of tqdm for upload progress bar. ([#877](https://github.com/pypa/twine/issues/877) <https://github.com/pypa/twine/issues/877>_)

Bugfixes ^^^^^^^^

  • Remove Twine's dependencies from the User-Agent header when uploading. ([#871](https://github.com/pypa/twine/issues/871) <https://github.com/pypa/twine/issues/871>_)
  • Improve detection of disabled BLAKE2 hashing due to FIPS mode. ([#879](https://github.com/pypa/twine/issues/879) <https://github.com/pypa/twine/issues/879>_)
  • Restore warning for missing long_description. ([#887](https://github.com/pypa/twine/issues/887) <https://github.com/pypa/twine/issues/887>_)

Twine 3.8.0 (2022-02-02)

Features ^^^^^^^^

  • Add --verbose logging for querying keyring credentials. ([#849](https://github.com/pypa/twine/issues/849) <https://github.com/pypa/twine/issues/849>_)
  • Log all upload responses with --verbose. ([#859](https://github.com/pypa/twine/issues/859) <https://github.com/pypa/twine/issues/859>_)
  • Show more helpful error message for invalid metadata. ([#861](https://github.com/pypa/twine/issues/861) <https://github.com/pypa/twine/issues/861>_)

Bugfixes ^^^^^^^^

  • Require a recent version of urllib3. ([#858](https://github.com/pypa/twine/issues/858) <https://github.com/pypa/twine/issues/858>_)

Twine 3.7.1 (2021-12-07)

Improved Documentation ^^^^^^^^^^^^^^^^^^^^^^

  • Fix broken link to packaging tutorial. ([#844](https://github.com/pypa/twine/issues/844) <https://github.com/pypa/twine/issues/844>_)

Twine 3.7.0 (2021-12-01)

Features

... (truncated)

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- packages/jsii-pacmak/lib/targets/python/requirements-dev.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt b/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt index 530b8a4098..23614b89c5 100644 --- a/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt +++ b/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt @@ -6,4 +6,5 @@ setuptools~=59.6.0 # build-system wheel~=0.37.1 # build-system -twine~=3.8.0 +twine~=3.8.0 ; python_version < '3.7' +twine~=4.0.0 ; python_version >= '3.7' From 6c0074f6d92a914b1273aec8bf271cc71e53660d Mon Sep 17 00:00:00 2001 From: Romain Marcadier Date: Tue, 5 Apr 2022 18:56:54 +0200 Subject: [PATCH 29/32] chore: cache the results of `findPackageInfo` (#3473) Profiling showed that `findPackageInfo` was one of the top contributors to compiler duration, as it was reading the same (large) files over and over again. It also incurred additional GC churn (as those duplicated large data blobs would need to be recclaimed). This change adds a memoization map around this call to avoid re-reading those files during a single compiler pass, which reduces GC overhead as well as file IO overhead. Additionally, replaced a few occurrences of `Record` with `Map`, as those incur much less GC churn (in relation to hidden classes). --- 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 --- packages/jsii/lib/assembler.ts | 76 ++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/packages/jsii/lib/assembler.ts b/packages/jsii/lib/assembler.ts index c9cef41169..df760f05bc 100644 --- a/packages/jsii/lib/assembler.ts +++ b/packages/jsii/lib/assembler.ts @@ -48,7 +48,11 @@ export class Assembler implements Emitter { private _diagnostics = new Array(); private _deferred = new Array(); - private _types: { [fqn: string]: spec.Type } = {}; + private readonly _types = new Map(); + private readonly _packageInfoCache = new Map< + string, + PackageJson | undefined + >(); /** Map of Symbol to namespace export Symbol */ private readonly _submoduleMap = new Map(); @@ -143,7 +147,6 @@ export class Assembler implements Emitter { * @return the result of the assembly emission. */ public emit(): ts.EmitResult { - this._diagnostics = []; if (!this.projectInfo.description) { this._diagnostics.push( JsiiDiagnostic.JSII_0001_PKG_MISSING_DESCRIPTION.createDetached(), @@ -162,9 +165,6 @@ export class Assembler implements Emitter { } const docs = _loadDocs.call(this); - this._types = {}; - this._deferred = []; - const sourceFile = this.program.getSourceFile(this.mainFile); if (sourceFile == null) { @@ -207,13 +207,11 @@ export class Assembler implements Emitter { ) != null ) { LOG.debug('Skipping emit due to errors.'); - // Clearing ``this._types`` to allow contents to be garbage-collected. - delete this._types; try { return { diagnostics: this._diagnostics, emitSkipped: true }; } finally { // Clearing ``this._diagnostics`` to allow contents to be garbage-collected. - delete this._diagnostics; + this._afterEmit(); } } @@ -241,7 +239,7 @@ export class Assembler implements Emitter { toDependencyClosure(this.projectInfo.dependencyClosure), ), bundled: this.projectInfo.bundleDependencies, - types: this._types, + types: Object.fromEntries(this._types), submodules: noEmptyDict(toSubmoduleDeclarations(this.mySubmodules())), targets: this.projectInfo.targets, metadata: { @@ -293,11 +291,7 @@ export class Assembler implements Emitter { emitSkipped: validationResult.emitSkipped, }; } finally { - // Clearing ``this._types`` to allow contents to be garbage-collected. - delete this._types; - - // Clearing ``this._diagnostics`` to allow contents to be garbage-collected. - delete this._diagnostics; + this._afterEmit(); } function _loadReadme(this: Assembler) { @@ -322,6 +316,15 @@ export class Assembler implements Emitter { } } + private _afterEmit() { + this._diagnostics = []; + this._deferred = []; + this._types.clear(); + this._submoduleMap.clear(); + this._submodules.clear(); + this._packageInfoCache.clear(); + } + /** * Defer a callback until a (set of) types are available * @@ -395,7 +398,7 @@ export class Assembler implements Emitter { const [assm] = ref.split('.'); let type; if (assm === this.projectInfo.name) { - type = this._types[ref]; + type = this._types.get(ref); } else { const assembly = this.projectInfo.dependencyClosure.find( (dep) => dep.name === assm, @@ -493,7 +496,7 @@ export class Assembler implements Emitter { return tsName; } const [, modulePath, typeName] = groups; - const pkg = findPackageInfo(modulePath); + const pkg = this.findPackageInfo(modulePath); if (!pkg) { if (!hasError) { this._diagnostics.push( @@ -749,7 +752,7 @@ export class Assembler implements Emitter { .getDeclarations()?.[0] ?.getSourceFile()?.fileName; const pkgInfo = symbolLocation - ? findPackageInfo(symbolLocation) + ? this.findPackageInfo(symbolLocation) : undefined; const assemblyName: string = pkgInfo?.name ?? this.projectInfo.name; const fqn = `${assemblyName}.${sym.name}`; @@ -1050,7 +1053,7 @@ export class Assembler implements Emitter { )}`, ); } - this._types[jsiiType.fqn] = jsiiType; + this._types.set(jsiiType.fqn, jsiiType); jsiiType.locationInModule = this.declarationLocation(node); const type = this._typeChecker.getTypeAtLocation(node); @@ -2674,6 +2677,31 @@ export class Assembler implements Emitter { m.fqn.startsWith(`${this.projectInfo.name}.`), ); } + + private findPackageInfo(fromDir: string): PackageJson | undefined { + if (this._packageInfoCache.has(fromDir)) { + return this._packageInfoCache.get(fromDir); + } + + const packageInfo = _findPackageInfo.call(this, fromDir); + this._packageInfoCache.set(fromDir, packageInfo); + return packageInfo; + + function _findPackageInfo( + this: Assembler, + fromDir: string, + ): PackageJson | undefined { + const filePath = path.join(fromDir, 'package.json'); + if (fs.pathExistsSync(filePath)) { + return fs.readJsonSync(filePath); + } + const parent = path.dirname(fromDir); + if (parent === fromDir) { + return undefined; + } + return this.findPackageInfo(parent); + } + } } export interface AssemblerOptions { @@ -3198,18 +3226,6 @@ function isSingleValuedEnum( return false; } -function findPackageInfo(fromDir: string): PackageJson | undefined { - const filePath = path.join(fromDir, 'package.json'); - if (fs.pathExistsSync(filePath)) { - return fs.readJsonSync(filePath); - } - const parent = path.dirname(fromDir); - if (parent === fromDir) { - return undefined; - } - return findPackageInfo(parent); -} - /** * Checks is the provided type is "this" (as a type annotation). * From e9d99a06b7b06da2e87d1bf4e2101a0ff5cf3dc9 Mon Sep 17 00:00:00 2001 From: Mitchell Valine Date: Thu, 7 Apr 2022 02:14:15 -0700 Subject: [PATCH 30/32] feat: expose unknownSnippets config (#3475) Exposes the `unknownSnippets` configuration option on `transliterateAssembly` to allow callers to choose how to handle snippets missing from the tablet file. --- packages/jsii-rosetta/lib/commands/transliterate.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/jsii-rosetta/lib/commands/transliterate.ts b/packages/jsii-rosetta/lib/commands/transliterate.ts index d6cb371d6d..5f7c6e87f9 100644 --- a/packages/jsii-rosetta/lib/commands/transliterate.ts +++ b/packages/jsii-rosetta/lib/commands/transliterate.ts @@ -39,6 +39,13 @@ export interface TransliterateAssemblyOptions { * @default - assembly location */ readonly outdir?: string; + + /** + * Whether or not to live-convert samples + * + * @default UnknownSnippetMode.FAIL + */ + readonly unknownSnippets?: UnknownSnippetMode; } /** @@ -74,7 +81,7 @@ export async function transliterateAssembly( // Now do a regular "tablet reader" cycle, expecting everything to be translated already, // and therefore it doesn't matter that we do this all in a single-threaded loop. const rosetta = new RosettaTabletReader({ - unknownSnippets: UnknownSnippetMode.FAIL, + unknownSnippets: options?.unknownSnippets ?? UnknownSnippetMode.FAIL, targetLanguages, prefixDisclaimer: true, }); From a242536d209b836c3b90a79f1ca85d409a803709 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Thu, 7 Apr 2022 04:20:30 -0700 Subject: [PATCH 31/32] chore: npm-check-updates && yarn upgrade (#3474) Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date. --- package.json | 10 +- packages/@jsii/go-runtime/package.json | 2 +- packages/@jsii/integ-test/package.json | 2 +- packages/@jsii/kernel/package.json | 2 +- packages/@jsii/runtime/package.json | 4 +- packages/@jsii/spec/package.json | 2 +- .../jsii-calc-base-of-base/package.json | 2 +- packages/@scope/jsii-calc-base/package.json | 2 +- packages/@scope/jsii-calc-lib/package.json | 2 +- packages/codemaker/package.json | 2 +- packages/jsii-calc/package.json | 2 +- packages/jsii-config/package.json | 2 +- packages/jsii-diff/package.json | 2 +- packages/jsii-pacmak/package.json | 4 +- .../__snapshots__/examples.test.ts.snap | 4 +- .../__snapshots__/target-java.test.ts.snap | 8 +- packages/jsii-reflect/package.json | 2 +- packages/jsii-rosetta/package.json | 4 +- packages/jsii/package.json | 4 +- packages/oo-ascii-tree/package.json | 2 +- tools/jsii-compliance/package.json | 2 +- yarn.lock | 194 +++++++++--------- 22 files changed, 131 insertions(+), 129 deletions(-) diff --git a/package.json b/package.json index f18fa97f88..5ac28efed4 100644 --- a/package.json +++ b/package.json @@ -16,19 +16,19 @@ }, "devDependencies": { "@jest/types": "^27.5.1", - "@typescript-eslint/eslint-plugin": "^5.17.0", - "@typescript-eslint/parser": "^5.17.0", + "@typescript-eslint/eslint-plugin": "^5.18.0", + "@typescript-eslint/parser": "^5.18.0", "all-contributors-cli": "^6.20.0", "eslint": "^8.12.0", "eslint-config-prettier": "^8.5.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-import-resolver-typescript": "^2.7.0", - "eslint-plugin-import": "^2.25.4", + "eslint-import-resolver-typescript": "^2.7.1", + "eslint-plugin-import": "^2.26.0", "eslint-plugin-prettier": "^4.0.0", "jest-circus": "^27.5.1", "jest-config": "^27.5.1", "lerna": "^4.0.0", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "standard-version": "^9.3.2", "ts-jest": "^27.1.4", "ts-node": "^10.7.0", diff --git a/packages/@jsii/go-runtime/package.json b/packages/@jsii/go-runtime/package.json index 08bbd5fecb..37b13f0eaa 100644 --- a/packages/@jsii/go-runtime/package.json +++ b/packages/@jsii/go-runtime/package.json @@ -30,7 +30,7 @@ "fs-extra": "^9.1.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "ts-node": "^10.7.0", "typescript": "~3.9.10" } diff --git a/packages/@jsii/integ-test/package.json b/packages/@jsii/integ-test/package.json index efbce4c67e..14b307216d 100644 --- a/packages/@jsii/integ-test/package.json +++ b/packages/@jsii/integ-test/package.json @@ -33,7 +33,7 @@ "@types/node": "^12.20.47", "@types/tar": "^6.1.1", "eslint": "^8.12.0", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "typescript": "~3.9.10" } } diff --git a/packages/@jsii/kernel/package.json b/packages/@jsii/kernel/package.json index 4034b7bf89..cafd88ab1f 100644 --- a/packages/@jsii/kernel/package.json +++ b/packages/@jsii/kernel/package.json @@ -47,7 +47,7 @@ "jest-expect-message": "^1.0.2", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "ts-jest": "^27.1.4", "typescript": "~3.9.10" } diff --git a/packages/@jsii/runtime/package.json b/packages/@jsii/runtime/package.json index 083f9d79a1..d62c8c4ac2 100644 --- a/packages/@jsii/runtime/package.json +++ b/packages/@jsii/runtime/package.json @@ -47,11 +47,11 @@ "jest": "^27.5.1", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "source-map-loader": "^3.0.1", "ts-jest": "^27.1.4", "typescript": "~3.9.10", - "webpack": "^5.70.0", + "webpack": "^5.71.0", "webpack-cli": "^4.9.2" } } diff --git a/packages/@jsii/spec/package.json b/packages/@jsii/spec/package.json index 4e86b40e5e..eade316882 100644 --- a/packages/@jsii/spec/package.json +++ b/packages/@jsii/spec/package.json @@ -39,7 +39,7 @@ "eslint": "^8.12.0", "jest": "^27.5.1", "jsii-build-tools": "^0.0.0", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "typescript": "~3.9.10", "typescript-json-schema": "^0.53.0" } diff --git a/packages/@scope/jsii-calc-base-of-base/package.json b/packages/@scope/jsii-calc-base-of-base/package.json index e9b6406c5e..55627d2f54 100644 --- a/packages/@scope/jsii-calc-base-of-base/package.json +++ b/packages/@scope/jsii-calc-base-of-base/package.json @@ -34,7 +34,7 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", - "prettier": "^2.6.1" + "prettier": "^2.6.2" }, "jsii": { "outdir": "dist", diff --git a/packages/@scope/jsii-calc-base/package.json b/packages/@scope/jsii-calc-base/package.json index 04aead3af1..9352f4435c 100644 --- a/packages/@scope/jsii-calc-base/package.json +++ b/packages/@scope/jsii-calc-base/package.json @@ -39,7 +39,7 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", - "prettier": "^2.6.1" + "prettier": "^2.6.2" }, "jsii": { "metadata": { diff --git a/packages/@scope/jsii-calc-lib/package.json b/packages/@scope/jsii-calc-lib/package.json index d38075367b..eb0f3a1a53 100644 --- a/packages/@scope/jsii-calc-lib/package.json +++ b/packages/@scope/jsii-calc-lib/package.json @@ -43,7 +43,7 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", - "prettier": "^2.6.1" + "prettier": "^2.6.2" }, "jsii": { "outdir": "dist", diff --git a/packages/codemaker/package.json b/packages/codemaker/package.json index a99658d146..49ba8c09f5 100644 --- a/packages/codemaker/package.json +++ b/packages/codemaker/package.json @@ -41,7 +41,7 @@ "@types/node": "^12.20.47", "eslint": "^8.12.0", "jest": "^27.5.1", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "typescript": "~3.9.10" } } diff --git a/packages/jsii-calc/package.json b/packages/jsii-calc/package.json index edb981480d..a3ddebb5d3 100644 --- a/packages/jsii-calc/package.json +++ b/packages/jsii-calc/package.json @@ -56,7 +56,7 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", - "prettier": "^2.6.1" + "prettier": "^2.6.2" }, "jsii": { "outdir": "dist", diff --git a/packages/jsii-config/package.json b/packages/jsii-config/package.json index 66d95995d9..520bd55728 100644 --- a/packages/jsii-config/package.json +++ b/packages/jsii-config/package.json @@ -26,7 +26,7 @@ "eslint": "^8.12.0", "jest": "^27.5.1", "jest-expect-message": "^1.0.2", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "typescript": "~3.9.10" }, "dependencies": { diff --git a/packages/jsii-diff/package.json b/packages/jsii-diff/package.json index af9fa06d41..16c68444a6 100644 --- a/packages/jsii-diff/package.json +++ b/packages/jsii-diff/package.json @@ -51,6 +51,6 @@ "jest-expect-message": "^1.0.2", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", - "prettier": "^2.6.1" + "prettier": "^2.6.2" } } diff --git a/packages/jsii-pacmak/package.json b/packages/jsii-pacmak/package.json index a6fb291867..353c1f469d 100644 --- a/packages/jsii-pacmak/package.json +++ b/packages/jsii-pacmak/package.json @@ -47,7 +47,7 @@ "jsii-reflect": "^0.0.0", "jsii-rosetta": "^0.0.0", "semver": "^7.3.5", - "spdx-license-list": "^6.4.0", + "spdx-license-list": "^6.5.0", "xmlbuilder": "^15.1.1", "yargs": "^16.2.0" }, @@ -67,7 +67,7 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "ts-jest": "^27.1.4", "typescript": "~3.9.10" }, diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.ts.snap index ba54e825bd..07b399c846 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.ts.snap @@ -500,7 +500,7 @@ exports[`diamond-struct-parameter.ts: /java/pom.xml 1`] = ` Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 repo An OSI-approved license @@ -1999,7 +1999,7 @@ exports[`nested-types.ts: /java/pom.xml 1`] = ` Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 repo An OSI-approved license diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap index 084edb15ee..c15f524ba5 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-java.test.ts.snap @@ -252,7 +252,7 @@ exports[`Generated code for "@scope/jsii-calc-base": /java/pom.xml 1`] = Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 repo An OSI-approved license @@ -975,7 +975,7 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": /java/pom.x Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 repo An OSI-approved license @@ -1668,7 +1668,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /java/pom.xml 1`] = Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 repo An OSI-approved license @@ -4113,7 +4113,7 @@ exports[`Generated code for "jsii-calc": /java/pom.xml 1`] = ` Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 repo An OSI-approved license diff --git a/packages/jsii-reflect/package.json b/packages/jsii-reflect/package.json index 437b5f2a38..9f6c1f7593 100644 --- a/packages/jsii-reflect/package.json +++ b/packages/jsii-reflect/package.json @@ -51,7 +51,7 @@ "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "typescript": "~3.9.10" } } diff --git a/packages/jsii-rosetta/package.json b/packages/jsii-rosetta/package.json index 17ce767346..7ebfe9d65d 100644 --- a/packages/jsii-rosetta/package.json +++ b/packages/jsii-rosetta/package.json @@ -28,7 +28,7 @@ "jsii-build-tools": "0.0.0", "memory-streams": "^0.1.3", "mock-fs": "^5.1.2", - "prettier": "^2.6.1" + "prettier": "^2.6.2" }, "dependencies": { "@jsii/check-node": "0.0.0", @@ -37,7 +37,7 @@ "fs-extra": "^9.1.0", "typescript": "~3.9.10", "sort-json": "^2.0.1", - "@xmldom/xmldom": "^0.8.1", + "@xmldom/xmldom": "^0.8.2", "workerpool": "^6.2.0", "yargs": "^16.2.0", "semver": "^7.3.5", diff --git a/packages/jsii/package.json b/packages/jsii/package.json index 7bda12f57a..f36a13a236 100644 --- a/packages/jsii/package.json +++ b/packages/jsii/package.json @@ -45,7 +45,7 @@ "semver": "^7.3.5", "semver-intersect": "^1.4.0", "sort-json": "^2.0.1", - "spdx-license-list": "^6.4.0", + "spdx-license-list": "^6.5.0", "typescript": "~3.9.10", "yargs": "^16.2.0" }, @@ -61,7 +61,7 @@ "jest": "^27.5.1", "jest-expect-message": "^1.0.2", "jsii-build-tools": "^0.0.0", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "ts-jest": "^27.1.4" } } diff --git a/packages/oo-ascii-tree/package.json b/packages/oo-ascii-tree/package.json index 0411295795..da2c6a9512 100644 --- a/packages/oo-ascii-tree/package.json +++ b/packages/oo-ascii-tree/package.json @@ -36,7 +36,7 @@ "eslint": "^8.12.0", "jest": "^27.5.1", "jsii-build-tools": "^0.0.0", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "typescript": "~3.9.10" } } diff --git a/tools/jsii-compliance/package.json b/tools/jsii-compliance/package.json index 1c00476235..6b4e3caee2 100644 --- a/tools/jsii-compliance/package.json +++ b/tools/jsii-compliance/package.json @@ -18,7 +18,7 @@ "devDependencies": { "@types/node": "^12.20.47", "eslint": "^8.12.0", - "prettier": "^2.6.1", + "prettier": "^2.6.2", "ts-node": "^10.7.0", "typescript": "~3.9.10" } diff --git a/yarn.lock b/yarn.lock index eedff01250..000674d993 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1726,14 +1726,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.17.0.tgz#704eb4e75039000531255672bf1c85ee85cf1d67" - integrity sha512-qVstvQilEd89HJk3qcbKt/zZrfBZ+9h2ynpAGlWjWiizA7m/MtLT9RoX6gjtpE500vfIg8jogAkDzdCxbsFASQ== - dependencies: - "@typescript-eslint/scope-manager" "5.17.0" - "@typescript-eslint/type-utils" "5.17.0" - "@typescript-eslint/utils" "5.17.0" +"@typescript-eslint/eslint-plugin@^5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.18.0.tgz#950df411cec65f90d75d6320a03b2c98f6c3af7d" + integrity sha512-tzrmdGMJI/uii9/V6lurMo4/o+dMTKDH82LkNjhJ3adCW22YQydoRs5MwTiqxGF9CSYxPxQ7EYb4jLNlIs+E+A== + dependencies: + "@typescript-eslint/scope-manager" "5.18.0" + "@typescript-eslint/type-utils" "5.18.0" + "@typescript-eslint/utils" "5.18.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -1741,69 +1741,69 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.17.0.tgz#7def77d5bcd8458d12d52909118cf3f0a45f89d5" - integrity sha512-aRzW9Jg5Rlj2t2/crzhA2f23SIYFlF9mchGudyP0uiD6SenIxzKoLjwzHbafgHn39dNV/TV7xwQkLfFTZlJ4ig== +"@typescript-eslint/parser@^5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.18.0.tgz#2bcd4ff21df33621df33e942ccb21cb897f004c6" + integrity sha512-+08nYfurBzSSPndngnHvFw/fniWYJ5ymOrn/63oMIbgomVQOvIDhBoJmYZ9lwQOCnQV9xHGvf88ze3jFGUYooQ== dependencies: - "@typescript-eslint/scope-manager" "5.17.0" - "@typescript-eslint/types" "5.17.0" - "@typescript-eslint/typescript-estree" "5.17.0" + "@typescript-eslint/scope-manager" "5.18.0" + "@typescript-eslint/types" "5.18.0" + "@typescript-eslint/typescript-estree" "5.18.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.17.0.tgz#4cea7d0e0bc0e79eb60cad431c89120987c3f952" - integrity sha512-062iCYQF/doQ9T2WWfJohQKKN1zmmXVfAcS3xaiialiw8ZUGy05Em6QVNYJGO34/sU1a7a+90U3dUNfqUDHr3w== +"@typescript-eslint/scope-manager@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.18.0.tgz#a7d7b49b973ba8cebf2a3710eefd457ef2fb5505" + integrity sha512-C0CZML6NyRDj+ZbMqh9FnPscg2PrzSaVQg3IpTmpe0NURMVBXlghGZgMYqBw07YW73i0MCqSDqv2SbywnCS8jQ== dependencies: - "@typescript-eslint/types" "5.17.0" - "@typescript-eslint/visitor-keys" "5.17.0" + "@typescript-eslint/types" "5.18.0" + "@typescript-eslint/visitor-keys" "5.18.0" -"@typescript-eslint/type-utils@5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.17.0.tgz#1c4549d68c89877662224aabb29fbbebf5fc9672" - integrity sha512-3hU0RynUIlEuqMJA7dragb0/75gZmwNwFf/QJokWzPehTZousP/MNifVSgjxNcDCkM5HI2K22TjQWUmmHUINSg== +"@typescript-eslint/type-utils@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.18.0.tgz#62dbfc8478abf36ba94a90ddf10be3cc8e471c74" + integrity sha512-vcn9/6J5D6jtHxpEJrgK8FhaM8r6J1/ZiNu70ZUJN554Y3D9t3iovi6u7JF8l/e7FcBIxeuTEidZDR70UuCIfA== dependencies: - "@typescript-eslint/utils" "5.17.0" + "@typescript-eslint/utils" "5.18.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.17.0.tgz#861ec9e669ffa2aa9b873dd4d28d9b1ce26d216f" - integrity sha512-AgQ4rWzmCxOZLioFEjlzOI3Ch8giDWx8aUDxyNw9iOeCvD3GEYAB7dxWGQy4T/rPVe8iPmu73jPHuaSqcjKvxw== +"@typescript-eslint/types@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.18.0.tgz#4f0425d85fdb863071680983853c59a62ce9566e" + integrity sha512-bhV1+XjM+9bHMTmXi46p1Led5NP6iqQcsOxgx7fvk6gGiV48c6IynY0apQb7693twJDsXiVzNXTflhplmaiJaw== -"@typescript-eslint/typescript-estree@5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.17.0.tgz#a7cba7dfc8f9cc2ac78c18584e684507df4f2488" - integrity sha512-X1gtjEcmM7Je+qJRhq7ZAAaNXYhTgqMkR10euC4Si6PIjb+kwEQHSxGazXUQXFyqfEXdkGf6JijUu5R0uceQzg== +"@typescript-eslint/typescript-estree@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.18.0.tgz#6498e5ee69a32e82b6e18689e2f72e4060986474" + integrity sha512-wa+2VAhOPpZs1bVij9e5gyVu60ReMi/KuOx4LKjGx2Y3XTNUDJgQ+5f77D49pHtqef/klglf+mibuHs9TrPxdQ== dependencies: - "@typescript-eslint/types" "5.17.0" - "@typescript-eslint/visitor-keys" "5.17.0" + "@typescript-eslint/types" "5.18.0" + "@typescript-eslint/visitor-keys" "5.18.0" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.17.0.tgz#549a9e1d491c6ccd3624bc3c1b098f5cfb45f306" - integrity sha512-DVvndq1QoxQH+hFv+MUQHrrWZ7gQ5KcJzyjhzcqB1Y2Xes1UQQkTRPUfRpqhS8mhTWsSb2+iyvDW1Lef5DD7vA== +"@typescript-eslint/utils@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.18.0.tgz#27fc84cf95c1a96def0aae31684cb43a37e76855" + integrity sha512-+hFGWUMMri7OFY26TsOlGa+zgjEy1ssEipxpLjtl4wSll8zy85x0GrUSju/FHdKfVorZPYJLkF3I4XPtnCTewA== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.17.0" - "@typescript-eslint/types" "5.17.0" - "@typescript-eslint/typescript-estree" "5.17.0" + "@typescript-eslint/scope-manager" "5.18.0" + "@typescript-eslint/types" "5.18.0" + "@typescript-eslint/typescript-estree" "5.18.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.17.0.tgz#52daae45c61b0211b4c81b53a71841911e479128" - integrity sha512-6K/zlc4OfCagUu7Am/BD5k8PSWQOgh34Nrv9Rxe2tBzlJ7uOeJ/h7ugCGDCeEZHT6k2CJBhbk9IsbkPI0uvUkA== +"@typescript-eslint/visitor-keys@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.18.0.tgz#c7c07709823804171d569017f3b031ced7253e60" + integrity sha512-Hf+t+dJsjAKpKSkg3EHvbtEpFFb/1CiOHnvI8bjHgOD4/wAw3gKrA0i94LrbekypiZVanJu3McWJg7rWDMzRTg== dependencies: - "@typescript-eslint/types" "5.17.0" + "@typescript-eslint/types" "5.18.0" eslint-visitor-keys "^3.0.0" "@webassemblyjs/ast@1.11.1": @@ -1944,10 +1944,10 @@ resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.6.1.tgz#0de2875ac31b46b6c5bb1ae0a7d7f0ba5678dffe" integrity sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw== -"@xmldom/xmldom@^0.8.1": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.1.tgz#70c239275fc6d6a84e41b9a8d623a93c0d59b6b4" - integrity sha512-4wOae+5N2RZ+CZXd9ZKwkaDi55IxrSTOjHpxTvQQ4fomtOJmqVxbmICA9jE1jvnqNhpfgz8cnfFagG86wV/xLQ== +"@xmldom/xmldom@^0.8.2": + version "0.8.2" + resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.2.tgz#b695ff674e8216efa632a3d36ad51ae9843380c0" + integrity sha512-+R0juSseERyoPvnBQ/cZih6bpF7IpCXlWbHRoCRzYzqpz6gWHOgf8o4MOEf6KBVuOyqU+gCNLkCWVIJAro8XyQ== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -2446,9 +2446,9 @@ camelcase@^6.2.0, camelcase@^6.3.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001317: - version "1.0.30001322" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001322.tgz#2e4c09d11e1e8f852767dab287069a8d0c29d623" - integrity sha512-neRmrmIrCGuMnxGSoh+x7zYtQFFgnSY2jaomjU56sCkTA6JINqQrxutF459JpWcWRajvoyn95sOXq4Pqrnyjew== + version "1.0.30001325" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001325.tgz#2b4ad19b77aa36f61f2eaf72e636d7481d55e606" + integrity sha512-sB1bZHjseSjDtijV1Hb7PB2Zd58Kyx+n/9EotvZ4Qcz2K3d0lWB8dB4nb8wN/TsOGFq3UuAm0zQZNQ4SoR7TrQ== case@^1.6.3: version "1.6.3" @@ -3206,9 +3206,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.4.84: - version "1.4.101" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.101.tgz#71f3a10065146d7445ba5d4c06ba2cc063b0817a" - integrity sha512-XJH+XmJjACx1S7ASl/b//KePcda5ocPnFH2jErztXcIS8LpP0SE6rX8ZxiY5/RaDPnaF1rj0fPaHfppzb0e2Aw== + version "1.4.104" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.104.tgz#60973b0a7d398efa877196e8ccb0c93d48b918d8" + integrity sha512-2kjoAyiG7uMyGRM9mx25s3HAzmQG2ayuYXxsFmYugHSDcwxREgLtscZvbL1JcW9S/OemeQ3f/SG6JhDwpnCclQ== emittery@^0.8.1: version "0.8.1" @@ -3361,10 +3361,10 @@ eslint-import-resolver-node@^0.3.6: debug "^3.2.7" resolve "^1.20.0" -eslint-import-resolver-typescript@^2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.7.0.tgz#1f9d391b636dccdbaa4a3b1a87eb9a8237e23963" - integrity sha512-MNHS3u5pebvROX4MjGP9coda589ZGfL1SqdxUV4kSrcclfDRWvNE2D+eljbnWVMvWDVRgT89nhscMHPKYGcObQ== +eslint-import-resolver-typescript@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.7.1.tgz#a90a4a1c80da8d632df25994c4c5fdcdd02b8751" + integrity sha512-00UbgGwV8bSgUv34igBDbTOtKhqoRMy9bFjNehT40bXg6585PNIct8HhXZ0SybqB9rWtXj9crcku8ndDn/gIqQ== dependencies: debug "^4.3.4" glob "^7.2.0" @@ -3372,7 +3372,7 @@ eslint-import-resolver-typescript@^2.7.0: resolve "^1.22.0" tsconfig-paths "^3.14.1" -eslint-module-utils@^2.7.2: +eslint-module-utils@^2.7.3: version "2.7.3" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz#ad7e3a10552fdd0642e1e55292781bd6e34876ee" integrity sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ== @@ -3380,24 +3380,24 @@ eslint-module-utils@^2.7.2: debug "^3.2.7" find-up "^2.1.0" -eslint-plugin-import@^2.25.4: - version "2.25.4" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz#322f3f916a4e9e991ac7af32032c25ce313209f1" - integrity sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA== +eslint-plugin-import@^2.26.0: + version "2.26.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b" + integrity sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA== dependencies: array-includes "^3.1.4" array.prototype.flat "^1.2.5" debug "^2.6.9" doctrine "^2.1.0" eslint-import-resolver-node "^0.3.6" - eslint-module-utils "^2.7.2" + eslint-module-utils "^2.7.3" has "^1.0.3" - is-core-module "^2.8.0" + is-core-module "^2.8.1" is-glob "^4.0.3" - minimatch "^3.0.4" + minimatch "^3.1.2" object.values "^1.1.5" - resolve "^1.20.0" - tsconfig-paths "^3.12.0" + resolve "^1.22.0" + tsconfig-paths "^3.14.1" eslint-plugin-prettier@^4.0.0: version "4.0.0" @@ -3977,9 +3977,9 @@ globby@^11.0.2, globby@^11.0.4: slash "^3.0.0" graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4, graceful-fs@^4.2.9: - version "4.2.9" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" - integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== + version "4.2.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" + integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== handlebars@^4.7.7: version "4.7.7" @@ -4283,7 +4283,7 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.5.0, is-core-module@^2.8.0, is-core-module@^2.8.1: +is-core-module@^2.5.0, is-core-module@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== @@ -4342,9 +4342,9 @@ is-negative-zero@^2.0.2: integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== is-number-object@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" - integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== dependencies: has-tostringtag "^1.0.0" @@ -4399,9 +4399,11 @@ is-set@^2.0.1, is-set@^2.0.2: integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== is-shared-array-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" - integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== + dependencies: + call-bind "^1.0.2" is-ssh@^1.3.0: version "1.3.3" @@ -5445,7 +5447,7 @@ min-indent@^1.0.0: resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== -minimatch@^3.0.4: +minimatch@^3.0.4, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -6243,10 +6245,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.1.tgz#d472797e0d7461605c1609808e27b80c0f9cfe17" - integrity sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A== +prettier@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" + integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== pretty-format@^27.0.0, pretty-format@^27.5.1: version "27.5.1" @@ -6904,10 +6906,10 @@ spdx-license-ids@^3.0.0: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz#50c0d8c40a14ec1bf449bae69a0ea4685a9d9f95" integrity sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g== -spdx-license-list@^6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/spdx-license-list/-/spdx-license-list-6.4.0.tgz#9850c3699c1d35745285607d064d2a5145049d12" - integrity sha512-4BxgJ1IZxTJuX1YxMGu2cRYK46Bk9zJNTK2/R0wNZR0cm+6SVl26/uG7FQmQtxoJQX1uZ0EpTi2L7zvMLboaBA== +spdx-license-list@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/spdx-license-list/-/spdx-license-list-6.5.0.tgz#1624b9cd6c517ff8d697610e6c22d7f5b7c63d28" + integrity sha512-28O9GgFrMg2Wp8tVML0Zk+fnXaECy7UbB6pxo+93whHay/nqPyEdM07Cx6B4+j2pniUZTYr57OaIOyNTxsTwtw== split-on-first@^1.0.0: version "1.1.0" @@ -7383,7 +7385,7 @@ ts-node@^10.2.1, ts-node@^10.7.0: v8-compile-cache-lib "^3.0.0" yn "3.1.1" -tsconfig-paths@^3.12.0, tsconfig-paths@^3.14.1: +tsconfig-paths@^3.14.1: version "3.14.1" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== @@ -7726,10 +7728,10 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.70.0: - version "5.70.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.70.0.tgz#3461e6287a72b5e6e2f4872700bc8de0d7500e6d" - integrity sha512-ZMWWy8CeuTTjCxbeaQI21xSswseF2oNOwc70QSKNePvmxE7XW36i7vpBMYZFAUHPwQiEbNGCEYIOOlyRbdGmxw== +webpack@^5.71.0: + version "5.71.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.71.0.tgz#b01fcf379570b8c5ee06ca06c829ca168c951884" + integrity sha512-g4dFT7CFG8LY0iU5G8nBL6VlkT21Z7dcYDpJAEJV5Q1WLb9UwnFbrem1k7K52ILqEmomN7pnzWFxxE6SlDY56A== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^0.0.51" From 53957a97e119cdf62152000e620c95090c2da509 Mon Sep 17 00:00:00 2001 From: AWS CDK Team Date: Fri, 8 Apr 2022 11:24:35 +0000 Subject: [PATCH 32/32] chore(release): 1.56.0 --- CHANGELOG.md | 16 ++++++++++++++++ lerna.json | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a810d20e0..a04c2578b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.56.0](https://github.com/aws/jsii/compare/v1.55.1...v1.56.0) (2022-04-08) + + +### Features + +* drop internal functions from Deprecation Error stack trace ([#3426](https://github.com/aws/jsii/issues/3426)) ([5b4b852](https://github.com/aws/jsii/commit/5b4b852c4550782d4f9777cbca7a65264bea49fe)) +* expose unknownSnippets config ([#3475](https://github.com/aws/jsii/issues/3475)) ([e9d99a0](https://github.com/aws/jsii/commit/e9d99a06b7b06da2e87d1bf4e2101a0ff5cf3dc9)) +* specify output directory for assemblies ([#3437](https://github.com/aws/jsii/issues/3437)) ([5419876](https://github.com/aws/jsii/commit/541987673dd015e0264cf299b51998923556eb8d)) +* Standardize issue template for discussions ([b191f60](https://github.com/aws/jsii/commit/b191f60630d513449c6771de38d2d7fcbc8d7941)) + + +### Bug Fixes + +* **rosetta:** incorrect transliteration of map keys in python ([#3449](https://github.com/aws/jsii/issues/3449)) ([54cebaa](https://github.com/aws/jsii/commit/54cebaa188a132ab764e2167c9ec5f9042588b47)), closes [#3448](https://github.com/aws/jsii/issues/3448) [#3448](https://github.com/aws/jsii/issues/3448) +* typo "though" -> "through" ([#3419](https://github.com/aws/jsii/issues/3419)) ([3274b6c](https://github.com/aws/jsii/commit/3274b6cb8c5a025c8877343423c1f101029ea0a5)) + ## [1.55.1](https://github.com/aws/jsii/compare/v1.55.0...v1.55.1) (2022-03-16) ## [1.55.0](https://github.com/aws/jsii/compare/v1.54.0...v1.55.0) (2022-03-10) diff --git a/lerna.json b/lerna.json index a31db48016..4083613ea3 100644 --- a/lerna.json +++ b/lerna.json @@ -10,5 +10,5 @@ "rejectCycles": true } }, - "version": "1.55.1" + "version": "1.56.0" }