diff --git a/.all-contributorsrc b/.all-contributorsrc index d9fba3b00f..9bc4df0f96 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1166,7 +1166,9 @@ "avatar_url": "https://avatars.githubusercontent.com/u/1112056?v=4", "profile": "https://ansgar.dev", "contributions": [ - "maintenance" + "maintenance", + "code", + "bug" ] }, { @@ -1300,6 +1302,16 @@ "contributions": [ "doc" ] + }, + { + "login": "arnogeurts-sqills", + "name": "arnogeurts-sqills", + "avatar_url": "https://avatars.githubusercontent.com/u/79304871?v=4", + "profile": "https://github.com/arnogeurts-sqills", + "contributions": [ + "bug", + "code" + ] } ], "repoType": "github", diff --git a/.devcontainer.json b/.devcontainer.json new file mode 100644 index 0000000000..96182dcfe2 --- /dev/null +++ b/.devcontainer.json @@ -0,0 +1,21 @@ +{ + "name": "Dev Container Definition - AWS JSII", + "build": { + "dockerfile": "superchain/Dockerfile", + "context": ".", + "target": "superchain", + "args": { + "BUILDPLATFORM": "linux/amd64", + "TARGETPLATFORM": "linux/amd64", + "BUILD_TIMESTAMP": "unknown", + "REGISTRY": "docker.io/library", + "COMMIT_ID": "head" + } + }, + "containerUser": "root", + "remoteUser": "root", + "postCreateCommand": "yarn install && yarn build", + "extensions": [ + "dbaeumer.vscode-eslint@2.1.5" + ] +} diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..f53c86acbe --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +.env +maven-repo diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 1206e3fe61..8f7497006d 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -14,9 +14,10 @@ jobs: auto-approve: if: contains(github.event.pull_request.labels.*.name, 'auto-approve') permissions: + actions: write pull-requests: write runs-on: ubuntu-latest steps: - - uses: hmarr/auto-approve-action@v2.1.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file + - run: gh pr review --approve ${{ github.event.pull_request.number }} -R ${{ github.repository }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fab3dfd957..d5754248f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -213,7 +213,7 @@ jobs: dotnet: ['3.1.x'] go: ['1.16'] java: ['8'] - node: ['12', '14', '16'] + node: ['12', '14', '16', '17'] os: [ubuntu-latest] python: ['3.6'] # Add specific combinations to be tested against "node 12" (to restrict cardinality) diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index 1619f8bc4c..71d3d0842b 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -10,9 +10,10 @@ jobs: if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]' runs-on: ubuntu-latest permissions: - pull-requests: write + actions: write issues: write + pull-requests: write steps: - run: gh pr edit ${{ github.event.pull_request.number }} --add-label "auto-approve" -R ${{ github.repository }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.AUTO_APPROVE_GITHUB_TOKEN }} diff --git a/.mergify/config.yml b/.mergify/config.yml index 8c6c3f928b..87f4fabe87 100644 --- a/.mergify/config.yml +++ b/.mergify/config.yml @@ -11,6 +11,7 @@ queue_rules: - status-success~=^Test \(.* node 12 .*$ - status-success~=^Test \(.* node 14 .*$ - status-success~=^Test \(.* node 16 .*$ + - status-success~=^Test \(.* node 17 .*$ # One test for each supported dotnet version - status-success~=^Test \(.* dotnet 3\.1\.x .*$ - status-success~=^Test \(.* dotnet 5\.0\.x .*$ @@ -60,6 +61,7 @@ pull_request_rules: - status-success~=^Test \(.* node 12 .*$ - status-success~=^Test \(.* node 14 .*$ - status-success~=^Test \(.* node 16 .*$ + - status-success~=^Test \(.* node 17 .*$ # One test for each supported dotnet version - status-success~=^Test \(.* dotnet 3\.1\.x .*$ - status-success~=^Test \(.* dotnet 5\.0\.x .*$ @@ -109,6 +111,7 @@ pull_request_rules: - status-success~=^Test \(.* node 12 .*$ - status-success~=^Test \(.* node 14 .*$ - status-success~=^Test \(.* node 16 .*$ + - status-success~=^Test \(.* node 17 .*$ # One test for each supported dotnet version - status-success~=^Test \(.* dotnet 3\.1\.x .*$ - status-success~=^Test \(.* dotnet 5\.0\.x .*$ @@ -158,6 +161,7 @@ pull_request_rules: - status-success~=^Test \(.* node 12 .*$ - status-success~=^Test \(.* node 14 .*$ - status-success~=^Test \(.* node 16 .*$ + - status-success~=^Test \(.* node 17 .*$ # One test for each supported dotnet version - status-success~=^Test \(.* dotnet 3\.1\.x .*$ - status-success~=^Test \(.* dotnet 5\.0\.x .*$ @@ -202,4 +206,4 @@ pull_request_rules: [Conventional Commits]: https://www.conventionalcommits.org conditions: - - -status-success=Semantic Pull Request + - status-failure=Semantic Pull Request diff --git a/CHANGELOG.md b/CHANGELOG.md index f5acad7315..138090c7b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,32 @@ 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.53.0](https://github.com/aws/jsii/compare/v1.52.1...v1.53.0) (2022-02-09) + + +### Features + +* add configuration for Visual Studio Code ([#3309](https://github.com/aws/jsii/issues/3309)) ([3edf74c](https://github.com/aws/jsii/commit/3edf74cdc6486f35352aec5c98bf5a01657a1209)) +* **go:** add UnsafeCast function ([#3316](https://github.com/aws/jsii/issues/3316)) ([19da85e](https://github.com/aws/jsii/commit/19da85e57e544761b83c6c0dfc4bc3432ce4a2b3)) +* **go:** Use type registry to find the correct target type for JSII Proxy ([#3354](https://github.com/aws/jsii/issues/3354)) ([75d94ef](https://github.com/aws/jsii/commit/75d94effb71bcbdb0ab30c9b468024e0939d2084)), closes [#3353](https://github.com/aws/jsii/issues/3353) [#2819](https://github.com/aws/jsii/issues/2819) +* **rosetta:** Rosetta manages dependencies automatically ([#3269](https://github.com/aws/jsii/issues/3269)) ([f0b811b](https://github.com/aws/jsii/commit/f0b811b5642e1093a0b59b170a70df258df39fab)) + + +### Bug Fixes + +* **dontet:** excessive overrides generated ([#3355](https://github.com/aws/jsii/issues/3355)) ([5460d66](https://github.com/aws/jsii/commit/5460d66f2db6441f7d8cfc849d16f89d3548b82a)) +* **go:** replace uses of CanConvert to Type.AssignableTo ([#3373](https://github.com/aws/jsii/issues/3373)) ([ae4ea62](https://github.com/aws/jsii/commit/ae4ea624ad4bcac7da90734ed385b0716375ee5d)) +* **go:** unable to reuse instances between child/parent interfaces ([#3321](https://github.com/aws/jsii/issues/3321)) ([70be636](https://github.com/aws/jsii/commit/70be636e2eb3e5144dab16cae62162420a4fe5a8)) +* **jsii:** breaks due to faulty version of `colors` ([#3328](https://github.com/aws/jsii/issues/3328)) ([13c0737](https://github.com/aws/jsii/commit/13c073793a9fc5b45cad93801634ce6397a2e007)) +* **jsii:** compiler allows inheriting interface-violating members ([#3343](https://github.com/aws/jsii/issues/3343)) ([b5037b9](https://github.com/aws/jsii/commit/b5037b9adf74c1978f1fd940921ce6c2050c297b)), closes [#3342](https://github.com/aws/jsii/issues/3342) +* **jsii:** excessive overrides declarations registered ([#3375](https://github.com/aws/jsii/issues/3375)) ([64a5984](https://github.com/aws/jsii/commit/64a598487f81339e63a0aec5f7428eb99b6c7eb1)) +* **jsii:** submodule READMEs don't have literate examples ([#3347](https://github.com/aws/jsii/issues/3347)) ([5769771](https://github.com/aws/jsii/commit/576977133bd9ea0997d9bc1dd114c9407d9b5b12)), closes [aws/aws-cdk#18589](https://github.com/aws/aws-cdk/issues/18589) +* **kernel:** kernel's private object annotations are enumerable ([#3339](https://github.com/aws/jsii/issues/3339)) ([d361c7b](https://github.com/aws/jsii/commit/d361c7bdb2d269e6fcc9c06e55d23e8fe19859a5)) +* **pacmak:** greatly reduce go code-gen memory footprint ([#3362](https://github.com/aws/jsii/issues/3362)) ([77b520f](https://github.com/aws/jsii/commit/77b520fb47989bd0dbc0c5af53a17eba0c54a439)) +* **python:** cannot call a method that takes an empty struct ([#3372](https://github.com/aws/jsii/issues/3372)) ([c36b67c](https://github.com/aws/jsii/commit/c36b67cbcd125f6b89bedf7be4ebc8fa30e1ba90)), closes [#2846](https://github.com/aws/jsii/issues/2846) +* remove the "comments rewriter" ([#3368](https://github.com/aws/jsii/issues/3368)) ([50dd3b0](https://github.com/aws/jsii/commit/50dd3b051727a64950165efc191d554831812447)) +* **superchain:** failure to download PowerShell ([#3340](https://github.com/aws/jsii/issues/3340)) ([59eaaa3](https://github.com/aws/jsii/commit/59eaaa33734bc44d31c483cb81dc5c70b1e24dd8)) + ## [1.52.1](https://github.com/aws/jsii/compare/v1.52.0...v1.52.1) (2022-01-09) diff --git a/README.md b/README.md index 68acb33c44..f0785ac458 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Andy Slezak

💻 -
Ansgar Mertens

🚧 +
Ansgar Mertens

🚧 💻 🐛
Anshul Guleria

🤔
Ari Palo

🤔
Armaan Tobaccowalla

🐛 @@ -208,15 +208,16 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
aniljava

💻 +
arnogeurts-sqills

🐛 💻
deccy-mcc

🐛
dependabot-preview[bot]

🐛 🚧
dependabot[bot]

🚧
dheffx

🐛
gregswdl

🐛
guyroberts21

📖 -
mattBrzezinski

📖 +
mattBrzezinski

📖
mergify

🚧
mergify[bot]

🚧
seiyashima42

🐛 💻 📖 diff --git a/gh-pages/content/specification/6-compliance-report.md b/gh-pages/content/specification/6-compliance-report.md index 82aec9f08e..ee54cee7a2 100644 --- a/gh-pages/content/specification/6-compliance-report.md +++ b/gh-pages/content/specification/6-compliance-report.md @@ -5,7 +5,7 @@ This section details the current state of each language binding with respect to our standard compliance suite. -| number | test | java (99.16%) | golang (78.15%) | Dotnet | Python | +| number | test | java (98.33%) | golang (79.17%) | Dotnet | Python | | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------------------------------------------- | ------ | ------ | | 1 | asyncOverrides_overrideCallsSuper | 🟢 | [🔴](https://github.com/aws/jsii/issues/2670) | ⭕ | ⭕ | | 2 | [arrayReturnedByMethodCanBeRead]("Array created in the kernel can be queried for its elements") | 🟢 | 🟢 | ⭕ | ⭕ | @@ -42,7 +42,7 @@ This section details the current state of each language binding with respect to | 33 | testLiteralInterface | 🟢 | 🟢 | ⭕ | ⭕ | | 34 | structs_nonOptionalhashCode | 🟢 | ⚪ | ⭕ | ⭕ | | 35 | propertyOverrides_set_throws | 🟢 | 🟢 | ⭕ | ⭕ | -| 36 | canLeverageIndirectInterfacePolymorphism | 🟢 | [🔴](https://github.com/aws/jsii/issues/2688) | ⭕ | ⭕ | +| 36 | canLeverageIndirectInterfacePolymorphism | 🟢 | 🟢 | ⭕ | ⭕ | | 37 | fluentApi | 🟢 | ⚪ | ⭕ | ⭕ | | 38 | staticListInClassCanBeReadCorrectly | 🟢 | 🟢 | ⭕ | ⭕ | | 39 | mapReturnedByMethodCannotBeModified | 🟢 | ⚪ | ⭕ | ⭕ | @@ -126,3 +126,4 @@ This section details the current state of each language binding with respect to | 117 | testInterfaces | 🟢 | 🟢 | ⭕ | ⭕ | | 118 | [callbackParameterIsInterface]("Validates pure interfaces can be passed to callbacks") | ⭕ | 🟢 | ⭕ | ⭕ | | 119 | [classCanBeUsedWhenNotExpressedlyLoaded]("Validates that types not explicitly loaded by the user can safely be returned by JS code") | 🟢 | 🟢 | ⭕ | ⭕ | +| 120 | [downcasting]("Ensures unsafe-cast features work as expected") | ⭕ | 🟢 | ⭕ | ⭕ | diff --git a/gh-pages/content/user-guides/lib-user/language-specific/go.md b/gh-pages/content/user-guides/lib-user/language-specific/go.md index 137632ffaf..fefc82d2ac 100644 --- a/gh-pages/content/user-guides/lib-user/language-specific/go.md +++ b/gh-pages/content/user-guides/lib-user/language-specific/go.md @@ -198,3 +198,62 @@ func (c *childClass) SetConcreteProperty(v string) { c.AbstractBaseClass.SetConcreteProperty(strings.ToUpper(v)) } ``` + +## Unchecked conversions using `UnsafeCast` + +Developers may occasionally need to down-cast a value in order to leverage some +other interface it implements. This happens in cases where the runtime is unable +to determine the complete dynamic type of a value returned by a function, which +happens for example when the TypeScript version of that function returns `any`, +`unknown`, or a union of several types (which cannot be represented in go). + +In such cases, traditional go type assertions may not always produce the +expected result. Instead, the library that exposes these functions should also +expose type-checking utilities (e.g: `Stack.isStack(thing: any): boolean`) that +developers can use to guard an unchecked conversion, which in Go is performed +using `UnsafeCast`. + +The `UnsafeCast` function expects two arguments the original value, and a +pointer to a variable of the desired interface type. + +!!! warning + The `UnsafeCast` function may **panic** if: + + - the provided original value was not obtained through a function exported + from a jsii package. + - the provided pointer is not to a value typed as an interface exported from + a jsii package. + + If the original value does, in fact, not implement the target interface + type, undefined behavior will occur as a result of using functions of that + interface. + +An example use of the `UnsafeCast` feature is when using [AWS CDK escape hatches]: + +```go hl_lines="15-20" +package main + +import ( + "github.com/aws/aws-cdk-go/awscdk/v2" + "github.com/aws/aws-cdk-go/awscdk/v2/awssns" + "github.com/aws/jsii-runtime-go" +) + +func main() { + app := awscdk.NewApp(nil) + stack := awscdk.NewStack(app, jsii.String("TestStack"), nil) + + topic := awssns.NewTopic(stack, jsii.String("MyTopic"), nil) + + // We know that topic.Node().DefaultChild() is a awssns.CfnTopic + var cfn_topic awssns.CfnTopic + // We perform the conversion into cfn_topic + jsii.UnsafeCast(topic.Node().DefaultChild(), &cfn_topic) + // Then we use the conversion result + cfn_topic.SetDisplayName(jsii.String("Overridden Display Name")) + + app.Synth(nil) +} +``` + +[AWS CDK escape hatches]: https://docs.aws.amazon.com/cdk/v2/guide/cfn_layer.html diff --git a/gh-pages/requirements-dev.txt b/gh-pages/requirements-dev.txt index c82f2e4ced..552a0d7832 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.6.0 -mkdocs-material~=8.1.4 +mkdocs-material~=8.1.10 mkdocs-git-revision-date-plugin~=0.3.1 diff --git a/lerna.json b/lerna.json index 523be48e3b..c3c86a8445 100644 --- a/lerna.json +++ b/lerna.json @@ -10,5 +10,5 @@ "rejectCycles": true } }, - "version": "1.52.1" + "version": "1.53.0" } diff --git a/package.json b/package.json index de84acee6b..294ed1a8c5 100644 --- a/package.json +++ b/package.json @@ -16,21 +16,21 @@ }, "devDependencies": { "@jest/types": "^27.4.2", - "@typescript-eslint/eslint-plugin": "^5.8.1", - "@typescript-eslint/parser": "^5.8.1", + "@typescript-eslint/eslint-plugin": "^5.10.2", + "@typescript-eslint/parser": "^5.10.2", "all-contributors-cli": "^6.20.0", - "eslint": "^8.5.0", + "eslint": "^8.8.0", "eslint-config-prettier": "^8.3.0", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^2.5.0", - "eslint-plugin-import": "^2.25.3", + "eslint-plugin-import": "^2.25.4", "eslint-plugin-prettier": "^4.0.0", - "jest-circus": "^27.4.5", - "jest-config": "^27.4.5", + "jest-circus": "^27.4.6", + "jest-config": "^27.4.7", "lerna": "^4.0.0", "prettier": "^2.5.1", "standard-version": "^9.3.2", - "ts-jest": "^27.1.2", + "ts-jest": "^27.1.3", "ts-node": "^10.4.0", "typescript": "~3.9.10" }, diff --git a/packages/@jsii/Directory.Build.targets b/packages/@jsii/Directory.Build.targets index b2b6ca0bf2..184b8c3538 100644 --- a/packages/@jsii/Directory.Build.targets +++ b/packages/@jsii/Directory.Build.targets @@ -11,7 +11,7 @@ - + diff --git a/packages/@jsii/check-node/package.json b/packages/@jsii/check-node/package.json index 465df1906e..e0e540e143 100644 --- a/packages/@jsii/check-node/package.json +++ b/packages/@jsii/check-node/package.json @@ -41,8 +41,8 @@ }, "devDependencies": { "@types/chalk": "^2.2.0", - "@types/jest": "^27.0.3", - "@types/node": "^12.20.39", - "jest": "^27.4.5" + "@types/jest": "^27.4.0", + "@types/node": "^12.20.43", + "jest": "^27.4.7" } } diff --git a/packages/@jsii/check-node/src/constants.ts b/packages/@jsii/check-node/src/constants.ts index 9b634ff7c7..a0a3e84306 100644 --- a/packages/@jsii/check-node/src/constants.ts +++ b/packages/@jsii/check-node/src/constants.ts @@ -63,5 +63,7 @@ export const VERSION_SUPPORT: { readonly [range: string]: SupportLevel } = { '^15.0.0-0': SupportLevel.END_OF_LIFE, '<16.3.0': SupportLevel.UNSUPPORTED, '^16.3.0': SupportLevel.SUPPORTED, + '<17.3.0': SupportLevel.UNSUPPORTED, + '^17.3.0': SupportLevel.SUPPORTED, // Anything else will be treated as SupportLevel.UNTESTED. }; diff --git a/packages/@jsii/dotnet-runtime-test/package.json b/packages/@jsii/dotnet-runtime-test/package.json index 177351a629..91b3165ef8 100644 --- a/packages/@jsii/dotnet-runtime-test/package.json +++ b/packages/@jsii/dotnet-runtime-test/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@jsii/dotnet-runtime": "^0.0.0", - "@types/node": "^12.20.39", + "@types/node": "^12.20.43", "jsii-calc": "^3.20.120", "jsii-pacmak": "^0.0.0", "typescript": "~3.9.10" diff --git a/packages/@jsii/dotnet-runtime/package.json b/packages/@jsii/dotnet-runtime/package.json index ee61ce23dd..325ce1bce3 100644 --- a/packages/@jsii/dotnet-runtime/package.json +++ b/packages/@jsii/dotnet-runtime/package.json @@ -39,7 +39,7 @@ }, "devDependencies": { "@jsii/runtime": "^0.0.0", - "@types/node": "^12.20.39", + "@types/node": "^12.20.43", "@types/semver": "^7.3.9", "jsii-build-tools": "^0.0.0", "semver": "^7.3.5", diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DeputyBase.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DeputyBase.cs index 5d77f36cb5..99d9e3c1f8 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DeputyBase.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/DeputyBase.cs @@ -76,7 +76,7 @@ IEnumerable GetMethodOverrides() var inheritedAttribute = method.GetAttribute(); var uninheritedAttribute = method.GetAttribute(false); - if ((inheritedAttribute != null && uninheritedAttribute == null) || uninheritedAttribute?.IsOverride == true) + if (inheritedAttribute != null && uninheritedAttribute == null) { yield return new Override(method: (inheritedAttribute ?? uninheritedAttribute)!.Name); } @@ -93,7 +93,7 @@ IEnumerable GetPropertyOverrides() var inheritedAttribute = property.GetAttribute(); var uninheritedAttribute = property.GetAttribute(false); - if ((inheritedAttribute != null && uninheritedAttribute == null) || uninheritedAttribute?.IsOverride == true) + if (inheritedAttribute != null && uninheritedAttribute == null) { yield return new Override(property: (inheritedAttribute ?? uninheritedAttribute)!.Name); } diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiMethodAttribute.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiMethodAttribute.cs index f757f657c8..19d8537d37 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiMethodAttribute.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiMethodAttribute.cs @@ -12,6 +12,7 @@ public JsiiMethodAttribute( string? returnsJson = null, string? parametersJson = null, bool isAsync = false, + // Unused, retained for backwards-compatibility bool isOverride = false) { Name = name ?? throw new ArgumentNullException(nameof(name)); @@ -23,7 +24,6 @@ public JsiiMethodAttribute( : JsonConvert.DeserializeObject(parametersJson) ?? throw new ArgumentException("Invalid JSON descriptor", nameof(parametersJson)); IsAsync = isAsync; - IsOverride = isOverride; } public string Name { get; } @@ -34,7 +34,5 @@ public JsiiMethodAttribute( public bool IsAsync { get; } - - public bool IsOverride { get; } } -} \ No newline at end of file +} diff --git a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiPropertyAttribute.cs b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiPropertyAttribute.cs index dfddd5233b..9d451d853c 100644 --- a/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiPropertyAttribute.cs +++ b/packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Deputy/JsiiPropertyAttribute.cs @@ -7,14 +7,18 @@ namespace Amazon.JSII.Runtime.Deputy [AttributeUsage(AttributeTargets.Property)] public sealed class JsiiPropertyAttribute : Attribute, IOptionalValue { - public JsiiPropertyAttribute(string name, string typeJson, bool isOptional = false, bool isOverride = false) + public JsiiPropertyAttribute( + string name, + string typeJson, + bool isOptional = false, + // Unused, retained for backwards-compatibility + bool isOverride = false) { Name = name ?? throw new ArgumentNullException(nameof(name)); Type = JsonConvert.DeserializeObject(typeJson ?? throw new ArgumentNullException(nameof(typeJson))) ?? throw new ArgumentException("Invalid JSON descriptor", nameof(typeJson)); IsOptional = isOptional; - IsOverride = isOverride; } public string Name { get; } @@ -22,7 +26,5 @@ public JsiiPropertyAttribute(string name, string typeJson, bool isOptional = fal public TypeReference Type { get; } public bool IsOptional { get; } - - public bool IsOverride { get; } } -} \ No newline at end of file +} diff --git a/packages/@jsii/go-runtime-test/project/compliance_test.go b/packages/@jsii/go-runtime-test/project/compliance_test.go index bc2f1c1247..529f596476 100644 --- a/packages/@jsii/go-runtime-test/project/compliance_test.go +++ b/packages/@jsii/go-runtime-test/project/compliance_test.go @@ -1462,7 +1462,6 @@ func (suite *ComplianceSuite) TestCanLeverageIndirectInterfacePolymorphism() { require := suite.Require() require.Equal(float64(1337), *provider.ProvideAsClass().Value()) - suite.FailTest("Unable to reuse instances between parent/child interfaces", "https://github.com/aws/jsii/issues/2688") require.Equal(float64(1337), *provider.ProvideAsInterface().Value()) require.Equal("to implement", *provider.ProvideAsInterface().Verb()) } @@ -1645,6 +1644,16 @@ func (suite *ComplianceSuite) TestClassCanBeUsedWhenNotExpressedlyLoaded() { cdk16625.New().Test() } +func (suite *ComplianceSuite) TestDownCasting() { + require := suite.Require() + + anyValue := calc.SomeTypeJsii976_ReturnAnonymous() + var realValue calc.IReturnJsii976 + + jsii.UnsafeCast(anyValue, &realValue) + + require.Equal(realValue.Foo(), jsii.Number(1337)) +} // required to make `go test` recognize the suite. func TestComplianceSuite(t *testing.T) { diff --git a/packages/@jsii/go-runtime-test/project/go.mod b/packages/@jsii/go-runtime-test/project/go.mod index a71db58144..739b059c53 100644 --- a/packages/@jsii/go-runtime-test/project/go.mod +++ b/packages/@jsii/go-runtime-test/project/go.mod @@ -1,6 +1,6 @@ module github.com/aws/jsii/go-runtime-test -go 1.15 +go 1.17 require ( github.com/aws/jsii-runtime-go v0.0.0 @@ -12,6 +12,17 @@ require ( golang.org/x/tools v0.1.0 ) +require ( + github.com/Masterminds/semver/v3 v3.1.1 // indirect + github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2 v2.1.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/mod v0.3.0 // indirect + golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect +) + replace ( github.com/aws/jsii-runtime-go => ../../go-runtime/jsii-runtime-go github.com/aws/jsii/jsii-calc/go/jcb => ../jsii-calc/go/jcb diff --git a/packages/@jsii/go-runtime-test/project/go.sum b/packages/@jsii/go-runtime-test/project/go.sum index ceb0e37170..57ec351287 100644 --- a/packages/@jsii/go-runtime-test/project/go.sum +++ b/packages/@jsii/go-runtime-test/project/go.sum @@ -1,7 +1,8 @@ github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= @@ -39,5 +40,6 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1N golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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 h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/packages/@jsii/go-runtime-test/project/internal/cdk16625/cdk16625.go b/packages/@jsii/go-runtime-test/project/internal/cdk16625/cdk16625.go index aef3945a2a..05452a537d 100644 --- a/packages/@jsii/go-runtime-test/project/internal/cdk16625/cdk16625.go +++ b/packages/@jsii/go-runtime-test/project/internal/cdk16625/cdk16625.go @@ -11,7 +11,7 @@ func New() abc.Cdk16625 { return c } -type cdk16625 struct{ +type cdk16625 struct { abc.Cdk16625 } diff --git a/packages/@jsii/go-runtime-test/project/tools.go b/packages/@jsii/go-runtime-test/project/tools.go index c8bdab1fff..73d81778ef 100644 --- a/packages/@jsii/go-runtime-test/project/tools.go +++ b/packages/@jsii/go-runtime-test/project/tools.go @@ -1,3 +1,4 @@ +//go:build tools // +build tools // Package tools contains the necessary statements to ensure tool dependencies diff --git a/packages/@jsii/go-runtime/go.mod b/packages/@jsii/go-runtime/go.mod index 7230730946..5099e3a5fb 100644 --- a/packages/@jsii/go-runtime/go.mod +++ b/packages/@jsii/go-runtime/go.mod @@ -1,8 +1,8 @@ module github.com/aws/jsii -go 1.15 +go 1.16 require ( golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 - golang.org/x/tools v0.1.8 + golang.org/x/tools v0.1.9 ) diff --git a/packages/@jsii/go-runtime/go.sum b/packages/@jsii/go-runtime/go.sum index aa8273a5d7..b50c26931b 100644 --- a/packages/@jsii/go-runtime/go.sum +++ b/packages/@jsii/go-runtime/go.sum @@ -26,8 +26,8 @@ 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.8 h1:P1HhGGuLW4aAclzjtmJdf0mJOjVUZUzOTqkAkWL+l6w= -golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +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/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= diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/cast.go b/packages/@jsii/go-runtime/jsii-runtime-go/cast.go new file mode 100644 index 0000000000..102e4bfba4 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/cast.go @@ -0,0 +1,59 @@ +package jsii + +import ( + "fmt" + "reflect" + + "github.com/aws/jsii-runtime-go/internal/kernel" +) + +// UnsafeCast converts the given interface value to the desired target interface +// pointer. Panics if the from value is not a jsii proxy object, or if the to +// value is not a pointer to an interface type. +func UnsafeCast(from interface{}, into interface{}) { + rinto := reflect.ValueOf(into) + if rinto.Kind() != reflect.Ptr { + panic(fmt.Errorf("Second argument to UnsafeCast must be a pointer to an interface. Received %s", rinto.Type().String())) + } + rinto = rinto.Elem() + if rinto.Kind() != reflect.Interface { + panic(fmt.Errorf("Second argument to UnsafeCast must be a pointer to an interface. Received pointer to %s", rinto.Type().String())) + } + + rfrom := reflect.ValueOf(from) + + // If rfrom is essentially nil, set into to nil and return. + if !rfrom.IsValid() || rfrom.IsZero() { + null := reflect.Zero(rinto.Type()) + rinto.Set(null) + return + } + // Interfaces may present as a pointer to an implementing struct, and that's fine... + if rfrom.Kind() != reflect.Interface && rfrom.Kind() != reflect.Ptr { + panic(fmt.Errorf("First argument to UnsafeCast must be an interface value. Received %s", rfrom.Type().String())) + } + + // If rfrom can be directly converted to rinto, just do it. + if rfrom.Type().AssignableTo(rinto.Type()) { + rfrom = rfrom.Convert(rinto.Type()) + rinto.Set(rfrom) + return + } + + client := kernel.GetClient() + if objID, found := client.FindObjectRef(rfrom); found { + // Ensures the value is initialized properly. Panics if the target value is not a jsii interface type. + client.Types().InitJsiiProxy(rinto, rinto.Type()) + + // If the target type is a behavioral interface, add it to the ObjectRef.Interfaces list. + if fqn, found := client.Types().InterfaceFQN(rinto.Type()); found { + objID.Interfaces = append(objID.Interfaces, fqn) + } + + // Make the new value an alias to the old value. + client.RegisterInstance(rinto, objID) + return + } + + panic(fmt.Errorf("First argument to UnsafeCast must be a jsii proxy value. Received %s", rfrom.String())) +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/cast_test.go b/packages/@jsii/go-runtime/jsii-runtime-go/cast_test.go new file mode 100644 index 0000000000..09ff1ffeef --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/cast_test.go @@ -0,0 +1,101 @@ +package jsii + +import ( + "reflect" + "testing" + + "github.com/aws/jsii-runtime-go/internal/api" + "github.com/aws/jsii-runtime-go/internal/kernel" +) + +type MockInterfaceABase interface { + MockMethodABase(_ float64) +} + +type mockABase struct { + _ int // padding +} + +func (m *mockABase) MockMethodABase(_ float64) {} + +type MockInterfaceA interface { + MockInterfaceABase + MockMethodA(_ string) +} + +func NewMockInterfaceA() MockInterfaceA { + return &mockA{mockABase{}} +} + +type mockA struct { + mockABase +} + +func (m *mockA) MockMethodA(_ string) {} + +type MockInterfaceB interface { + MockMethodB(_ int) +} + +func NewMockInterfaceB() MockInterfaceB { + return &mockB{} +} + +type mockB struct { + _ int // Padding +} + +func (m *mockB) MockMethodB(_ int) {} + +func TestNilSource(t *testing.T) { + // Make "into" not nil to ensure the cast function overwrites it. + into := NewMockInterfaceB() + UnsafeCast(nil, &into) + + if into != nil { + t.Fail() + } +} + +func TestSourceAndTargetAreTheSame(t *testing.T) { + into := NewMockInterfaceB() + original := into + UnsafeCast(into, &into) + + if into != original { + t.Fail() + } +} + +func TestTargetIsSubclassOfSource(t *testing.T) { + from := NewMockInterfaceA() + var into MockInterfaceABase + UnsafeCast(from, &into) + + if into != from { + t.Fail() + } +} + +func TestRegistersAlias(t *testing.T) { + client := kernel.GetClient() + + objid := api.ObjectRef{InstanceID: "Object@1337#42"} + from := NewMockInterfaceA() + client.RegisterInstance(reflect.ValueOf(from), objid) + + var into MockInterfaceB + client.Types().RegisterInterface(api.FQN("mock.InterfaceB"), reflect.TypeOf(&into).Elem(), []api.Override{}, func() interface{} { return NewMockInterfaceB() }) + + UnsafeCast(from, &into) + + if into == nil { + t.Fail() + } + + if refid, found := client.FindObjectRef(reflect.ValueOf(into)); !found { + t.Fail() + } else if refid.InstanceID != objid.InstanceID { + t.Fail() + } +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod index 4545261637..e406443fa2 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod @@ -7,4 +7,9 @@ require ( github.com/stretchr/testify v1.7.0 ) +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect +) + retract v1.27.0 diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum index 46621f39b3..34dd278f55 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum @@ -1,14 +1,15 @@ github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= 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= 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 h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client.go index d0f4eeeec7..944e420644 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/client.go @@ -95,29 +95,35 @@ func (c *Client) Types() *typeregistry.TypeRegistry { return types } -func (c *Client) RegisterInstance(instance reflect.Value, instanceID string) error { - return c.objects.Register(instance, instanceID) +func (c *Client) RegisterInstance(instance reflect.Value, objectRef api.ObjectRef) error { + return c.objects.Register(instance, objectRef) } func (c *Client) request(req kernelRequester, res kernelResponder) error { return c.process.Request(req, res) } -func (c *Client) FindObjectRef(obj reflect.Value) (string, bool) { +func (c *Client) FindObjectRef(obj reflect.Value) (ref api.ObjectRef, found bool) { + ref = api.ObjectRef{} + found = false + switch obj.Kind() { case reflect.Struct: // Structs can be checked only if they are addressable, meaning // they are obtained from fields of an addressable struct. if !obj.CanAddr() { - return "", false + return } obj = obj.Addr() fallthrough case reflect.Interface, reflect.Ptr: - return c.objects.InstanceID(obj) + if ref.InstanceID, found = c.objects.InstanceID(obj); found { + ref.Interfaces = c.objects.Interfaces(ref.InstanceID) + } + return default: // Other types cannot possibly be object references! - return "", false + return } } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go index 97be302f36..2897f89efa 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go @@ -63,15 +63,21 @@ func (c *Client) castAndSetToPtr(ptr reflect.Value, data reflect.Value) { return } + targetType := ptr.Type() + if typ, ok := c.Types().FindType(ref.TypeFQN()); ok && typ.AssignableTo(ptr.Type()) { + // Specialize the return type to be the dynamic value type + targetType = typ + } + // If it's currently tracked, return the current instance - if object, ok := c.objects.GetObject(ref.InstanceID); ok { + if object, ok := c.objects.GetObjectAs(ref.InstanceID, targetType); ok { ptr.Set(object) return } // If return data is jsii object references, add to objects table. - if err := c.Types().InitJsiiProxy(ptr); err == nil { - if err = c.RegisterInstance(ptr, ref.InstanceID); err != nil { + if err := c.Types().InitJsiiProxy(ptr, targetType); err == nil { + if err = c.RegisterInstance(ptr, ref); err != nil { panic(err) } } else { @@ -157,7 +163,7 @@ func (c *Client) CastPtrToRef(dataVal reflect.Value) interface{} { case reflect.Interface, reflect.Ptr: if valref, valHasRef := c.FindObjectRef(dataVal); valHasRef { - return api.ObjectRef{InstanceID: valref} + return valref } // In case we got a pointer to a map, slice, enum, ... diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/manage-object.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/manage-object.go index c755c83cb1..7c0e6416ab 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/manage-object.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/manage-object.go @@ -26,7 +26,7 @@ func (c *Client) ManageObject(v reflect.Value) (ref api.ObjectRef, err error) { }) if err == nil { - if err = c.objects.Register(v, resp.InstanceID); err == nil { + if err = c.objects.Register(v, api.ObjectRef{InstanceID: resp.InstanceID, Interfaces: interfaces}); err == nil { ref.InstanceID = resp.InstanceID } } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/objectstore.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/objectstore.go index 6944056a7f..0fae5652a4 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/objectstore.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/objectstore/objectstore.go @@ -3,8 +3,14 @@ package objectstore import ( "fmt" "reflect" + + "github.com/aws/jsii-runtime-go/internal/api" ) +// stringSet is a set of strings, implemented as a map from string to an +// arbitrary 0-width value. +type stringSet map[string]struct{} + // ObjectStore tracks object instances for which an identifier has been // associated. Object to instanceID association is tracked using the object // memory address (aka pointer value) in order to not have issues with go's @@ -16,17 +22,31 @@ type ObjectStore struct { // passed to the Register method. objectToID map[uintptr]string - // idToObject associates an instanceID with the reflect.Value that - // represents the top-level object that was registered with the instanceID - // via the Register method. + // idToObject associates an instanceID with the first reflect.Value instance + // that represents the top-level object that was registered with the + // instanceID first via the Register method. idToObject map[string]reflect.Value + + // idToObjects associates an instanceID with the reflect.Value instances that + // represent the top-level objects that were registered with the instanceID + // via the Register method. + idToObjects map[string]map[reflect.Value]struct{} + + // idToInterfaces associates an instanceID with the set of interfaces that it + // is known to implement. + // + // Incorrect use of the UnsafeCast function may result in an instance's + // interface list containing interfaces that it does not actually implement. + idToInterfaces map[string]stringSet } // New initializes a new ObjectStore. func New() *ObjectStore { return &ObjectStore{ - objectToID: make(map[uintptr]string), - idToObject: make(map[string]reflect.Value), + objectToID: make(map[uintptr]string), + idToObject: make(map[string]reflect.Value), + idToObjects: make(map[string]map[reflect.Value]struct{}), + idToInterfaces: make(map[string]stringSet), } } @@ -42,7 +62,7 @@ func New() *ObjectStore { // // The call is idempotent: calling Register again with the same value and // instanceID does not result in an error. -func (o *ObjectStore) Register(value reflect.Value, instanceID string) error { +func (o *ObjectStore) Register(value reflect.Value, objectRef api.ObjectRef) error { var err error if value, err = canonicalValue(value); err != nil { return err @@ -50,40 +70,77 @@ func (o *ObjectStore) Register(value reflect.Value, instanceID string) error { ptr := value.Pointer() if existing, found := o.objectToID[ptr]; found { - if existing == instanceID { + if existing == objectRef.InstanceID { + o.mergeInterfaces(objectRef) return nil } - return fmt.Errorf("attempting to register %s as %s, but it was already registered as %s", value, instanceID, existing) + return fmt.Errorf("attempting to register %s as %s, but it was already registered as %s", value, objectRef.InstanceID, existing) } aliases := findAliases(value) - if existing, found := o.idToObject[instanceID]; found { - if existing == value { + if existing, found := o.idToObjects[objectRef.InstanceID]; found { + if _, found := existing[value]; found { + o.mergeInterfaces(objectRef) return nil } // Value already exists (e.g: a constructor made a callback with "this" - // passed as an argument). We make the current value an alias of the new + // passed as an argument). We make the current value(s) an alias of the new // one. - aliases = append(aliases, existing) + for existing := range existing { + aliases = append(aliases, existing) + } } for _, alias := range aliases { ptr := alias.Pointer() - if existing, found := o.objectToID[ptr]; found && existing != instanceID { - return fmt.Errorf("value %s is embedded in %s which has ID %s, but was already assigned %s", alias.String(), value.String(), instanceID, existing) + if existing, found := o.objectToID[ptr]; found && existing != objectRef.InstanceID { + return fmt.Errorf("value %s is embedded in %s which has ID %s, but was already assigned %s", alias.String(), value.String(), objectRef.InstanceID, existing) } } - o.objectToID[ptr] = instanceID - o.idToObject[instanceID] = value + o.objectToID[ptr] = objectRef.InstanceID + // Only add to idToObject if this is the first time this InstanceID is registered + if _, found := o.idToObject[objectRef.InstanceID]; !found { + o.idToObject[objectRef.InstanceID] = value + } + if _, found := o.idToObjects[objectRef.InstanceID]; !found { + o.idToObjects[objectRef.InstanceID] = make(map[reflect.Value]struct{}) + } + o.idToObjects[objectRef.InstanceID][value] = struct{}{} for _, alias := range aliases { - o.objectToID[alias.Pointer()] = instanceID + o.objectToID[alias.Pointer()] = objectRef.InstanceID } + o.mergeInterfaces(objectRef) + return nil } +// mergeInterfaces adds all interfaces carried by the provided objectRef to the +// tracking set for the objectRef's InstanceID. Does nothing if no interfaces +// are designated on the objectRef. +func (o *ObjectStore) mergeInterfaces(objectRef api.ObjectRef) { + // If we don't have interfaces, we have nothing to do... + if objectRef.Interfaces == nil { + return + } + + // Find or create the interface list for the relevant InstanceID + var interfaces stringSet + if list, found := o.idToInterfaces[objectRef.InstanceID]; found { + interfaces = list + } else { + interfaces = make(stringSet) + o.idToInterfaces[objectRef.InstanceID] = interfaces + } + + // Add any missing interface to the list. + for _, iface := range objectRef.Interfaces { + interfaces[string(iface)] = struct{}{} + } +} + // InstanceID attempts to determine the instanceID associated with the provided // value, if any. Returns the existing instanceID and a boolean informing // whether an instanceID was already found or not. @@ -99,6 +156,23 @@ func (o *ObjectStore) InstanceID(value reflect.Value) (instanceID string, found return } +// Interfaces returns the set of interfaces associated with the provided +// instanceID. +// +// It returns a nil slice in case the instancceID is invalid, or if it does not +// have any associated interfaces. +func (o *ObjectStore) Interfaces(instanceID string) []api.FQN { + if set, found := o.idToInterfaces[instanceID]; found { + interfaces := make([]api.FQN, 0, len(set)) + for iface := range set { + interfaces = append(interfaces, api.FQN(iface)) + } + return interfaces + } else { + return nil + } +} + // GetObject attempts to retrieve the object value associated with the given // instanceID. Returns the existing value and a boolean informing whether a // value was associated with this instanceID or not. @@ -110,6 +184,27 @@ func (o *ObjectStore) GetObject(instanceID string) (value reflect.Value, found b return } +// GetObjectAs attempts to retrieve the object value associated with the given +// instanceID, compatible with the given type. Returns the existing value and a +// boolean informing whether a value was associated with this instanceID and +// compatible with this type or not. +// +// The GetObjectAs method is safe to call with an instanceID that was never +// registered with the ObjectStore. +func (o *ObjectStore) GetObjectAs(instanceID string, typ reflect.Type) (value reflect.Value, found bool) { + found = false + if values, exists := o.idToObjects[instanceID]; exists { + for value = range values { + if value.Type().AssignableTo(typ) { + value = value.Convert(typ) + found = true + return + } + } + } + return +} + // canonicalValue ensures the same reference is always considered for object // identity (especially in maps), so that we don't get surprised by pointer to // struct versus struct value versus opaque interface value, etc... diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/registration.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/registration.go index aab2ab3d9b..c1245762ca 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/registration.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/registration.go @@ -96,7 +96,12 @@ func (t *TypeRegistry) RegisterInterface(fqn api.FQN, iface reflect.Type, overri return fmt.Errorf("another type was already registered with %s: %v", fqn, existing) } + if existing, exists := t.typeToInterfaceFQN[iface]; exists && existing != fqn { + return fmt.Errorf("anoter FQN was already registered with %v: %s", iface, existing) + } + t.fqnToType[fqn] = registeredType{iface, interfaceType} + t.typeToInterfaceFQN[iface] = fqn t.proxyMakers[iface] = maker // Skipping registration if there are no members, as this would have no use. diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/typeregistry.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/typeregistry.go index 50d969e25d..98af846ec3 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/typeregistry.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/typeregistry.go @@ -26,6 +26,10 @@ type TypeRegistry struct { // enum FQN (e.g. "jsii-calc.StringEnum") typeToEnumFQN map[reflect.Type]api.FQN + // typeToInterfaceFQN maps Go interface type ("SomeInterface") to the + // corresponding jsii interface FQN (e.g: "jsii-calc.SomeInterface") + typeToInterfaceFQN map[reflect.Type]api.FQN + // structInfo maps registered struct types to all their fields. structInfo map[reflect.Type]registeredStruct @@ -39,14 +43,23 @@ type TypeRegistry struct { // New creates a new type registry. func New() *TypeRegistry { - return &TypeRegistry{ - fqnToType: make(map[api.FQN]registeredType), - fqnToEnumMember: make(map[string]interface{}), - typeToEnumFQN: make(map[reflect.Type]api.FQN), - structInfo: make(map[reflect.Type]registeredStruct), - proxyMakers: make(map[reflect.Type]func() interface{}), - typeMembers: make(map[api.FQN][]api.Override), + registry := TypeRegistry{ + fqnToType: make(map[api.FQN]registeredType), + fqnToEnumMember: make(map[string]interface{}), + typeToEnumFQN: make(map[reflect.Type]api.FQN), + typeToInterfaceFQN: make(map[reflect.Type]api.FQN), + structInfo: make(map[reflect.Type]registeredStruct), + proxyMakers: make(map[reflect.Type]func() interface{}), + typeMembers: make(map[api.FQN][]api.Override), + } + + // Ensure we can initialize proxies for `interface{}` when a method returns `any`. + registry.proxyMakers[reflect.TypeOf((*interface{})(nil)).Elem()] = func() interface{} { + type object struct{ _ int } // Padded so it's not 0-sized + return &object{} } + + return ®istry } // StructFields returns the list of fields associated with a jsii struct type, @@ -76,9 +89,7 @@ func (t *TypeRegistry) FindType(fqn api.FQN) (typ reflect.Type, ok bool) { // InitJsiiProxy initializes a jsii proxy value at the provided pointer. It // returns an error if the pointer does not have a value of a registered // proxyable type (that is, a class or interface type). -func (t *TypeRegistry) InitJsiiProxy(val reflect.Value) error { - valType := val.Type() - +func (t *TypeRegistry) InitJsiiProxy(val reflect.Value, valType reflect.Type) error { switch valType.Kind() { case reflect.Interface: if maker, ok := t.proxyMakers[valType]; ok { @@ -102,7 +113,7 @@ func (t *TypeRegistry) InitJsiiProxy(val reflect.Value) error { if !field.Anonymous { return fmt.Errorf("refusing to initialize non-anonymous field %s of %v", field.Name, val) } - if err := t.InitJsiiProxy(val.Field(i)); err != nil { + if err := t.InitJsiiProxy(val.Field(i), field.Type); err != nil { return err } } @@ -146,3 +157,8 @@ func (t *TypeRegistry) TryRenderEnumRef(value reflect.Value) (ref *api.EnumRef, return } + +func (t *TypeRegistry) InterfaceFQN(typ reflect.Type) (fqn api.FQN, found bool) { + fqn, found = t.typeToInterfaceFQN[typ] + return +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/runtime/runtime.go b/packages/@jsii/go-runtime/jsii-runtime-go/runtime/runtime.go index 94ef2c2ba2..00878c4ccd 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/runtime/runtime.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/runtime/runtime.go @@ -2,10 +2,11 @@ package runtime import ( "fmt" - "github.com/aws/jsii-runtime-go/internal/api" - "github.com/aws/jsii-runtime-go/internal/kernel" "reflect" "strings" + + "github.com/aws/jsii-runtime-go/internal/api" + "github.com/aws/jsii-runtime-go/internal/kernel" ) // FQN represents a fully-qualified type name in the jsii type system. @@ -101,7 +102,7 @@ func RegisterStruct(fqn FQN, strct reflect.Type) { // element of it is not a registered jsii interface or class type). func InitJsiiProxy(ptr interface{}) { ptrVal := reflect.ValueOf(ptr).Elem() - if err := kernel.GetClient().Types().InitJsiiProxy(ptrVal); err != nil { + if err := kernel.GetClient().Types().InitJsiiProxy(ptrVal, ptrVal.Type()); err != nil { panic(err) } } @@ -126,7 +127,7 @@ func Create(fqn FQN, args []interface{}, inst interface{}) { if !fieldVal.IsNil() { continue } - if err := client.Types().InitJsiiProxy(fieldVal); err != nil { + if err := client.Types().InitJsiiProxy(fieldVal, fieldVal.Type()); err != nil { panic(err) } @@ -135,7 +136,7 @@ func Create(fqn FQN, args []interface{}, inst interface{}) { if !fieldVal.IsZero() { continue } - if err := client.Types().InitJsiiProxy(fieldVal); err != nil { + if err := client.Types().InitJsiiProxy(fieldVal, fieldVal.Type()); err != nil { panic(err) } } @@ -185,7 +186,7 @@ func Create(fqn FQN, args []interface{}, inst interface{}) { panic(err) } - if err = client.RegisterInstance(instVal, res.InstanceID); err != nil { + if err = client.RegisterInstance(instVal, api.ObjectRef{InstanceID: res.InstanceID, Interfaces: interfaces}); err != nil { panic(err) } } @@ -196,7 +197,7 @@ func Invoke(obj interface{}, method string, args []interface{}, ret interface{}) client := kernel.GetClient() // Find reference to class instance in client - refid, found := client.FindObjectRef(reflect.ValueOf(obj)) + ref, found := client.FindObjectRef(reflect.ValueOf(obj)) if !found { panic("No Object Found") @@ -205,9 +206,7 @@ func Invoke(obj interface{}, method string, args []interface{}, ret interface{}) res, err := client.Invoke(kernel.InvokeProps{ Method: method, Arguments: convertArguments(args), - ObjRef: api.ObjectRef{ - InstanceID: refid, - }, + ObjRef: ref, }) if err != nil { @@ -222,7 +221,7 @@ func InvokeVoid(obj interface{}, method string, args []interface{}) { client := kernel.GetClient() // Find reference to class instance in client - refid, found := client.FindObjectRef(reflect.ValueOf(obj)) + ref, found := client.FindObjectRef(reflect.ValueOf(obj)) if !found { panic("No Object Found") @@ -231,7 +230,7 @@ func InvokeVoid(obj interface{}, method string, args []interface{}) { _, err := client.Invoke(kernel.InvokeProps{ Method: method, Arguments: convertArguments(args), - ObjRef: api.ObjectRef{InstanceID: refid}, + ObjRef: ref, }) if err != nil { @@ -278,7 +277,7 @@ func Get(obj interface{}, property string, ret interface{}) { client := kernel.GetClient() // Find reference to class instance in client - refid, found := client.FindObjectRef(reflect.ValueOf(obj)) + ref, found := client.FindObjectRef(reflect.ValueOf(obj)) if !found { panic(fmt.Errorf("no object reference found for %v", obj)) @@ -286,9 +285,7 @@ func Get(obj interface{}, property string, ret interface{}) { res, err := client.Get(kernel.GetProps{ Property: property, - ObjRef: api.ObjectRef{ - InstanceID: refid, - }, + ObjRef: ref, }) if err != nil { @@ -321,7 +318,7 @@ func Set(obj interface{}, property string, value interface{}) { client := kernel.GetClient() // Find reference to class instance in client - refid, found := client.FindObjectRef(reflect.ValueOf(obj)) + ref, found := client.FindObjectRef(reflect.ValueOf(obj)) if !found { panic("No Object Found") @@ -330,9 +327,7 @@ func Set(obj interface{}, property string, value interface{}) { _, err := client.Set(kernel.SetProps{ Property: property, Value: client.CastPtrToRef(reflect.ValueOf(value)), - ObjRef: api.ObjectRef{ - InstanceID: refid, - }, + ObjRef: ref, }) if err != nil { diff --git a/packages/@jsii/go-runtime/package.json b/packages/@jsii/go-runtime/package.json index 210c9cb84b..cc3c38ca84 100644 --- a/packages/@jsii/go-runtime/package.json +++ b/packages/@jsii/go-runtime/package.json @@ -24,9 +24,9 @@ }, "devDependencies": { "@types/fs-extra": "^9.0.13", - "@types/node": "^12.20.39", + "@types/node": "^12.20.43", "codemaker": "^0.0.0", - "eslint": "^8.5.0", + "eslint": "^8.8.0", "fs-extra": "^9.1.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", diff --git a/packages/@jsii/integ-test/package.json b/packages/@jsii/integ-test/package.json index c16d5a23cb..6531bc4071 100644 --- a/packages/@jsii/integ-test/package.json +++ b/packages/@jsii/integ-test/package.json @@ -20,7 +20,7 @@ "@octokit/rest": "^18.12.0", "dotenv": "^8.6.0", "fs-extra": "^9.1.0", - "jest": "^27.4.5", + "jest": "^27.4.7", "jsii": "^0.0.0", "jsii-pacmak": "^0.0.0", "jsii-rosetta": "^0.0.0", @@ -29,10 +29,10 @@ "devDependencies": { "@types/dotenv": "^8.2.0", "@types/fs-extra": "^9.0.13", - "@types/jest": "^27.0.3", - "@types/node": "^12.20.39", + "@types/jest": "^27.4.0", + "@types/node": "^12.20.43", "@types/tar": "^6.1.1", - "eslint": "^8.5.0", + "eslint": "^8.8.0", "prettier": "^2.5.1", "typescript": "~3.9.10" } diff --git a/packages/@jsii/java-runtime/package.json b/packages/@jsii/java-runtime/package.json index c5d61198e4..9739c5b49e 100644 --- a/packages/@jsii/java-runtime/package.json +++ b/packages/@jsii/java-runtime/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@jsii/runtime": "^0.0.0", - "@types/node": "^12.20.39", + "@types/node": "^12.20.43", "jsii-build-tools": "^0.0.0", "typescript": "~3.9.10" } diff --git a/packages/@jsii/kernel/lib/api.ts b/packages/@jsii/kernel/lib/api.ts index 44b9cb488a..b339a4716b 100644 --- a/packages/@jsii/kernel/lib/api.ts +++ b/packages/@jsii/kernel/lib/api.ts @@ -7,9 +7,6 @@ export const TOKEN_STRUCT = '$jsii.struct'; export interface ObjRef { readonly [TOKEN_REF]: string; -} - -export interface AnnotatedObjRef extends ObjRef { [TOKEN_INTERFACES]?: readonly string[]; } @@ -138,8 +135,7 @@ export interface CreateRequest { readonly overrides?: Override[]; } -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface CreateResponse extends AnnotatedObjRef {} +export type CreateResponse = ObjRef; export interface DelRequest { readonly objref: ObjRef; diff --git a/packages/@jsii/kernel/lib/kernel.ts b/packages/@jsii/kernel/lib/kernel.ts index d6f5f220d8..de6518ec5b 100644 --- a/packages/@jsii/kernel/lib/kernel.ts +++ b/packages/@jsii/kernel/lib/kernel.ts @@ -965,7 +965,7 @@ export class Kernel { interfaces: string[] = [], ): spec.Method | undefined { for (const fqn of [classFqn, ...interfaces]) { - if (fqn === 'Object') { + if (fqn === wire.EMPTY_OBJECT_FQN) { continue; } const typeinfo = this._typeInfoForFqn(fqn); diff --git a/packages/@jsii/kernel/lib/objects.ts b/packages/@jsii/kernel/lib/objects.ts index 305d93ccb3..a72ee20d4b 100644 --- a/packages/@jsii/kernel/lib/objects.ts +++ b/packages/@jsii/kernel/lib/objects.ts @@ -34,7 +34,7 @@ export function jsiiTypeFqn(obj: any): string | undefined { * * This is to retain object identity across invocations. */ -export function objectReference(obj: unknown): api.AnnotatedObjRef | undefined { +export function objectReference(obj: unknown): api.ObjRef | undefined { // If this object as already returned if ((obj as any)[OBJID_SYMBOL]) { return { @@ -52,9 +52,35 @@ type ManagedObject = { }; function tagObject(obj: unknown, objid: string, interfaces?: string[]) { - const managed = obj as ManagedObject; - managed[OBJID_SYMBOL] = objid; - managed[IFACES_SYMBOL] = interfaces; + const privateField: Omit = { + // Make sure the field does not show in `JSON.stringify` outputs, and is not + // copied by splat expressions (`{...obj}`), as this would be problematic. + // See https://github.com/aws/aws-cdk/issues/17876 for an example of the + // consequences this could have. + enumerable: false, + // Probably not necessary, but allow the property to be re-configured (it + // would be good to make this `false` in the future, but might cause weird + // bugs, so not doing it now...) + configurable: true, + writable: true, + }; + + // Log a warning in case we are re-tagging this value, so we can hopefully + // discover about the bugs we'd have if we did not make it configurable nor + // writable. + if (Object.prototype.hasOwnProperty.call(obj, OBJID_SYMBOL)) { + console.error( + `[jsii/kernel] WARNING: object ${JSON.stringify( + obj as any, + )} was already tagged as ${(obj as any)[OBJID_SYMBOL]}!`, + ); + } + + Object.defineProperty(obj, OBJID_SYMBOL, { ...privateField, value: objid }); + Object.defineProperty(obj, IFACES_SYMBOL, { + ...privateField, + value: interfaces, + }); } /** @@ -92,7 +118,7 @@ export class ObjectTable { obj: unknown, fqn: string, interfaces?: string[], - ): api.AnnotatedObjRef { + ): api.ObjRef { if (fqn === undefined) { throw new Error('FQN cannot be undefined'); } @@ -104,6 +130,16 @@ export class ObjectTable { for (const iface of existingRef[api.TOKEN_INTERFACES] ?? []) { allIfaces.add(iface); } + // Note - obj[INTERFACES_SYMBOL] should already have been declared as a + // private property by a previous call to tagObject at this stage. + if (!Object.prototype.hasOwnProperty.call(obj, IFACES_SYMBOL)) { + console.error( + `[jsii/kernel] WARNING: referenced object ${ + existingRef[api.TOKEN_REF] + } does not have the ${String(IFACES_SYMBOL)} property!`, + ); + } + this.objects[existingRef[api.TOKEN_REF]].interfaces = (obj as any)[IFACES_SYMBOL] = existingRef[api.TOKEN_INTERFACES] = @@ -135,6 +171,26 @@ export class ObjectTable { if (!obj) { throw new Error(`Object ${objid} not found`); } + + // If there are "additional" interfaces declared on the objref, merge them + // into the returned object. This is used to support client-side forced + // down-casting (a.k.a: unsafe casting). We do NOT register the extra + // interfaces here so that if the client provided an interface that is + // actually not implemented, we aren't "poisoning" our state with that + // incorrect information. + const additionalInterfaces = objref[api.TOKEN_INTERFACES]; + if (additionalInterfaces != null && additionalInterfaces.length > 0) { + return { + ...obj, + interfaces: [ + ...(obj.interfaces ?? []), + // We append at the end so "registered" interface information has + // precedence over client-declared ones. + ...additionalInterfaces, + ], + }; + } + return obj; } diff --git a/packages/@jsii/kernel/lib/serialization.ts b/packages/@jsii/kernel/lib/serialization.ts index c1295613d6..caec15fdc0 100644 --- a/packages/@jsii/kernel/lib/serialization.ts +++ b/packages/@jsii/kernel/lib/serialization.ts @@ -420,7 +420,7 @@ export const SERIALIZERS: { [k: string]: Serializer } = { */ host.debug('Returning value type by reference'); - return host.objects.registerObject(value, 'Object', [ + return host.objects.registerObject(value, EMPTY_OBJECT_FQN, [ (optionalValue.type as spec.NamedTypeReference).fqn, ]); }, @@ -520,7 +520,7 @@ export const SERIALIZERS: { [k: string]: Serializer } = { : undefined; const jsiiType = jsiiTypeFqn(value) ?? - (spec.isClassType(expectedType) ? expectedType.fqn : 'Object'); + (spec.isClassType(expectedType) ? expectedType.fqn : EMPTY_OBJECT_FQN); return host.objects.registerObject(value, jsiiType, interfaces); }, diff --git a/packages/@jsii/kernel/package.json b/packages/@jsii/kernel/package.json index 45df2bb1f7..8188dbba33 100644 --- a/packages/@jsii/kernel/package.json +++ b/packages/@jsii/kernel/package.json @@ -39,16 +39,16 @@ "@scope/jsii-calc-base": "^0.0.0", "@scope/jsii-calc-lib": "^0.0.0", "@types/fs-extra": "^9.0.13", - "@types/jest": "^27.0.3", - "@types/node": "^12.20.39", + "@types/jest": "^27.4.0", + "@types/node": "^12.20.43", "@types/tar": "^6.1.1", - "eslint": "^8.5.0", - "jest": "^27.4.5", + "eslint": "^8.8.0", + "jest": "^27.4.7", "jest-expect-message": "^1.0.2", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", "prettier": "^2.5.1", - "ts-jest": "^27.1.2", + "ts-jest": "^27.1.3", "typescript": "~3.9.10" } } diff --git a/packages/@jsii/kernel/test/objects.test.ts b/packages/@jsii/kernel/test/objects.test.ts new file mode 100644 index 0000000000..2d11966e1c --- /dev/null +++ b/packages/@jsii/kernel/test/objects.test.ts @@ -0,0 +1,26 @@ +import { ObjectTable } from '../lib/objects'; + +const mockResolve = jest.fn(); + +test('can spread registered objects without consequences', () => { + const subject = new ObjectTable(mockResolve); + + const obj = { foo: 'bar', baz: 1337 }; + const objRef = subject.registerObject(obj, 'Object'); + + const copy = { ...obj, foo: undefined, baz: undefined }; + const copyRef = subject.registerObject(copy, 'Object'); + + expect(objRef).not.toEqual(copyRef); +}); + +test('registered objects have clean JSON.Stringify', () => { + const subject = new ObjectTable(mockResolve); + + const obj = { foo: 'bar', baz: 1337 }; + const expected = JSON.stringify(obj); + + subject.registerObject(obj, 'Object'); + + expect(JSON.stringify(obj)).toEqual(expected); +}); diff --git a/packages/@jsii/python-runtime/requirements.txt b/packages/@jsii/python-runtime/requirements.txt index 1f0bcade04..23f655542c 100644 --- a/packages/@jsii/python-runtime/requirements.txt +++ b/packages/@jsii/python-runtime/requirements.txt @@ -1,8 +1,9 @@ -black~=21.12b0 +black~=22.1 mypy==0.812 -pip~=21.3 -pytest~=6.2 -pytest-mypy~=0.8 +pip~=21.3 ; python_version < '3.7' +pip~=22.0 ; python_version >= '3.7' +pytest~=7.0 +pytest-mypy~=0.9 setuptools~=59.6 wheel~=0.37 diff --git a/packages/@jsii/python-runtime/src/jsii/__init__.py b/packages/@jsii/python-runtime/src/jsii/__init__.py index 108813ac3d..4d8e0c8f28 100644 --- a/packages/@jsii/python-runtime/src/jsii/__init__.py +++ b/packages/@jsii/python-runtime/src/jsii/__init__.py @@ -1,3 +1,4 @@ +import sys from typing import Union from .__meta__ import __version__, __jsii_runtime_version__ @@ -35,6 +36,15 @@ stats = kernel.stats +if sys.version_info < (3, 7): + from platform import python_version + import warnings + + warnings.warn( + f"WARNING: You are using python release {python_version()}, which has reached end-of-life! Support for EOL Python releases may be dropped in the future. Please consider upgrading to Python >= 3.7 as soon as possible.", + ) + + __all__ = [ "__version__", "__jsii_runtime_version__", diff --git a/packages/@jsii/python-runtime/src/jsii/_kernel/__init__.py b/packages/@jsii/python-runtime/src/jsii/_kernel/__init__.py index 95959e7f62..0d41d13b28 100644 --- a/packages/@jsii/python-runtime/src/jsii/_kernel/__init__.py +++ b/packages/@jsii/python-runtime/src/jsii/_kernel/__init__.py @@ -169,7 +169,7 @@ def _make_reference_for_native(kernel, d): from .._runtime import python_jsii_mapping mapping = python_jsii_mapping(d) - if mapping: # This means we are handling a data_type (aka Struct) + if mapping is not None: # This means we are handling a data_type (aka Struct) return { "$jsii.struct": { "fqn": typeFqn, diff --git a/packages/@jsii/python-runtime/tests/test_compliance.py b/packages/@jsii/python-runtime/tests/test_compliance.py index 28f2ddf590..df52bfbe58 100644 --- a/packages/@jsii/python-runtime/tests/test_compliance.py +++ b/packages/@jsii/python-runtime/tests/test_compliance.py @@ -338,7 +338,7 @@ def test_getSetPrimitiveProperties(): assert number.double_value == 40 assert Negate(Add(Number(20), Number(10))).value == -30 assert Multiply(Add(Number(5), Number(5)), Number(2)).value == 20 - assert Power(Number(3), Number(4)).value == 3 ** 4 + assert Power(Number(3), Number(4)).value == 3**4 assert Power(Number(999), Number(1)).value == 999 assert Power(Number(999), Number(0)).value == 1 @@ -353,7 +353,7 @@ def test_callMethods(): assert calc.value == 20 calc.pow(5) - assert calc.value == 20 ** 5 + assert calc.value == 20**5 calc.neg() assert calc.value == -3_200_000 @@ -451,7 +451,7 @@ def test_unionProperties(): calc3.union_property = Power(Number(10), Number(3)) assert isinstance(calc3.union_property, Power) - assert calc3.read_union_value() == 10 ** 3 + assert calc3.read_union_value() == 10**3 def test_subclassing(): diff --git a/packages/@jsii/runtime/package.json b/packages/@jsii/runtime/package.json index 55095f6ca5..252d001b26 100644 --- a/packages/@jsii/runtime/package.json +++ b/packages/@jsii/runtime/package.json @@ -41,17 +41,17 @@ "devDependencies": { "@scope/jsii-calc-base": "^0.0.0", "@scope/jsii-calc-lib": "^0.0.0", - "@types/jest": "^27.0.3", - "@types/node": "^12.20.39", - "eslint": "^8.5.0", - "jest": "^27.4.5", + "@types/jest": "^27.4.0", + "@types/node": "^12.20.43", + "eslint": "^8.8.0", + "jest": "^27.4.7", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", "prettier": "^2.5.1", - "source-map-loader": "^3.0.0", - "ts-jest": "^27.1.2", + "source-map-loader": "^3.0.1", + "ts-jest": "^27.1.3", "typescript": "~3.9.10", - "webpack": "^5.65.0", - "webpack-cli": "^4.9.1" + "webpack": "^5.68.0", + "webpack-cli": "^4.9.2" } } diff --git a/packages/@jsii/spec/lib/configuration.ts b/packages/@jsii/spec/lib/configuration.ts index ca5e9fffec..16355fea82 100644 --- a/packages/@jsii/spec/lib/configuration.ts +++ b/packages/@jsii/spec/lib/configuration.ts @@ -171,5 +171,9 @@ export interface PackageJson { */ devDependencies?: Record; + bundleDependencies?: string[]; + + bundledDependencies?: string[]; + [key: string]: unknown; } diff --git a/packages/@jsii/spec/package.json b/packages/@jsii/spec/package.json index 3347248ef9..3eaacc3c70 100644 --- a/packages/@jsii/spec/package.json +++ b/packages/@jsii/spec/package.json @@ -34,13 +34,13 @@ "jsonschema": "^1.4.0" }, "devDependencies": { - "@types/jest": "^27.0.3", - "@types/node": "^12.20.39", - "eslint": "^8.5.0", - "jest": "^27.4.5", + "@types/jest": "^27.4.0", + "@types/node": "^12.20.43", + "eslint": "^8.8.0", + "jest": "^27.4.7", "jsii-build-tools": "^0.0.0", "prettier": "^2.5.1", "typescript": "~3.9.10", - "typescript-json-schema": "^0.52.0" + "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 ac98f4d102..edd5ec374e 100644 --- a/packages/@scope/jsii-calc-base-of-base/package.json +++ b/packages/@scope/jsii-calc-base-of-base/package.json @@ -30,7 +30,7 @@ "test:update": "npm run build && UPDATE_DIFF=1 npm run test" }, "devDependencies": { - "@types/node": "^12.20.39", + "@types/node": "^12.20.43", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", diff --git a/packages/@scope/jsii-calc-base/package.json b/packages/@scope/jsii-calc-base/package.json index ed0747078d..3df53b4a32 100644 --- a/packages/@scope/jsii-calc-base/package.json +++ b/packages/@scope/jsii-calc-base/package.json @@ -35,7 +35,7 @@ "@scope/jsii-calc-base-of-base": "^2.1.1" }, "devDependencies": { - "@types/node": "^12.20.39", + "@types/node": "^12.20.43", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", diff --git a/packages/@scope/jsii-calc-lib/package.json b/packages/@scope/jsii-calc-lib/package.json index 0134988c7c..9a8f0b0423 100644 --- a/packages/@scope/jsii-calc-lib/package.json +++ b/packages/@scope/jsii-calc-lib/package.json @@ -39,7 +39,7 @@ "@scope/jsii-calc-base-of-base": "^2.1.1" }, "devDependencies": { - "@types/node": "^12.20.39", + "@types/node": "^12.20.43", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", diff --git a/packages/codemaker/package.json b/packages/codemaker/package.json index dd1865963a..ec665fbbc6 100644 --- a/packages/codemaker/package.json +++ b/packages/codemaker/package.json @@ -31,16 +31,16 @@ "package": "rm -fr dist/js && mkdir -p dist/js && mv $(npm pack) dist/js" }, "dependencies": { - "camelcase": "^6.2.1", + "camelcase": "^6.3.0", "decamelize": "^5.0.1", "fs-extra": "^9.1.0" }, "devDependencies": { "@types/fs-extra": "^9.0.13", - "@types/jest": "^27.0.3", - "@types/node": "^12.20.39", - "eslint": "^8.5.0", - "jest": "^27.4.5", + "@types/jest": "^27.4.0", + "@types/node": "^12.20.43", + "eslint": "^8.8.0", + "jest": "^27.4.7", "prettier": "^2.5.1", "typescript": "~3.9.10" } diff --git a/packages/jsii-calc/lib/index.ts b/packages/jsii-calc/lib/index.ts index 397ce7a103..663b1aa0b8 100644 --- a/packages/jsii-calc/lib/index.ts +++ b/packages/jsii-calc/lib/index.ts @@ -8,6 +8,7 @@ export * from './nested-class'; export * from './stability'; export * from './submodules'; export * from './container-types'; +export * from './indirect-implementation'; export * as submodule from './submodule'; export * as onlystatic from './only-static'; diff --git a/packages/jsii-calc/lib/indirect-implementation.ts b/packages/jsii-calc/lib/indirect-implementation.ts new file mode 100644 index 0000000000..e8ed2b4948 --- /dev/null +++ b/packages/jsii-calc/lib/indirect-implementation.ts @@ -0,0 +1,22 @@ +export interface IIndirectlyImplemented { + readonly property: string; + method(): number; +} + +export abstract class BaseClass { + public readonly property = 'YES'; + + protected constructor() {} + + public method(): number { + return 1337; + } +} + +export class FullCombo extends BaseClass implements IIndirectlyImplemented { + private constructor() { + super(); + } + + // Obtains implementation of IIndirectlyImplemented from BaseClass +} diff --git a/packages/jsii-calc/package.json b/packages/jsii-calc/package.json index 45c610370d..452e158d81 100644 --- a/packages/jsii-calc/package.json +++ b/packages/jsii-calc/package.json @@ -33,7 +33,7 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { - "build": "jsii --project-references --silence-warnings reserved-word && npm run lint && jsii-rosetta --compile", + "build": "jsii --project-references --silence-warnings reserved-word && npm run lint && jsii-rosetta --compile --verbose", "watch": "jsii --project-references -w", "lint": "eslint . --ext .js,.ts --ignore-path=.gitignore", "lint:fix": "yarn lint --fix", @@ -51,8 +51,8 @@ "@scope/jsii-calc-lib": "^0.0.0" }, "devDependencies": { - "@types/node": "^12.20.39", - "eslint": "^8.5.0", + "@types/node": "^12.20.43", + "eslint": "^8.8.0", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-rosetta": "^0.0.0", diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii index 213c90a2fd..fa9482fec6 100644 --- a/packages/jsii-calc/test/assembly.jsii +++ b/packages/jsii-calc/test/assembly.jsii @@ -208,7 +208,7 @@ "jsii-calc.cdk16625": { "locationInModule": { "filename": "lib/index.ts", - "line": 23 + "line": 24 }, "symbolId": "lib/cdk16625/index:" }, @@ -229,28 +229,28 @@ "jsii-calc.module2530": { "locationInModule": { "filename": "lib/index.ts", - "line": 20 + "line": 21 }, "symbolId": "lib/module2530/index:" }, "jsii-calc.module2617": { "locationInModule": { "filename": "lib/index.ts", - "line": 16 + "line": 17 }, "symbolId": "lib/module2617/index:" }, "jsii-calc.module2647": { "locationInModule": { "filename": "lib/index.ts", - "line": 15 + "line": 16 }, "symbolId": "lib/module2647/index:" }, "jsii-calc.module2689": { "locationInModule": { "filename": "lib/index.ts", - "line": 17 + "line": 18 }, "symbolId": "lib/module2689/index:" }, @@ -285,7 +285,7 @@ "jsii-calc.module2692": { "locationInModule": { "filename": "lib/index.ts", - "line": 19 + "line": 20 }, "symbolId": "lib/module2692/index:" }, @@ -306,21 +306,21 @@ "jsii-calc.module2700": { "locationInModule": { "filename": "lib/index.ts", - "line": 21 + "line": 22 }, "symbolId": "lib/module2700/index:" }, "jsii-calc.module2702": { "locationInModule": { "filename": "lib/index.ts", - "line": 18 + "line": 19 }, "symbolId": "lib/module2702/index:" }, "jsii-calc.nodirect": { "locationInModule": { "filename": "lib/index.ts", - "line": 14 + "line": 15 }, "symbolId": "lib/no-direct-types/index:" }, @@ -341,14 +341,14 @@ "jsii-calc.onlystatic": { "locationInModule": { "filename": "lib/index.ts", - "line": 13 + "line": 14 }, "symbolId": "lib/only-static/index:" }, "jsii-calc.submodule": { "locationInModule": { "filename": "lib/index.ts", - "line": 12 + "line": 13 }, "readme": { "markdown": "Read you, read me\n=================\n\nThis is the readme of the `jsii-calc.submodule` module.\n" @@ -761,7 +761,7 @@ { "docs": { "stability": "stable", - "summary": "(deprecated) String representation of the value." + "summary": "String representation of the value." }, "locationInModule": { "filename": "lib/calculator.ts", @@ -781,7 +781,7 @@ { "docs": { "stability": "stable", - "summary": "(deprecated) The value." + "summary": "The value." }, "immutable": true, "locationInModule": { @@ -1652,6 +1652,63 @@ "name": "AugmentableClass", "symbolId": "lib/compliance:AugmentableClass" }, + "jsii-calc.BaseClass": { + "abstract": true, + "assembly": "jsii-calc", + "docs": { + "stability": "stable" + }, + "fqn": "jsii-calc.BaseClass", + "initializer": { + "docs": { + "stability": "stable" + }, + "locationInModule": { + "filename": "lib/indirect-implementation.ts", + "line": 9 + } + }, + "kind": "class", + "locationInModule": { + "filename": "lib/indirect-implementation.ts", + "line": 6 + }, + "methods": [ + { + "docs": { + "stability": "stable" + }, + "locationInModule": { + "filename": "lib/indirect-implementation.ts", + "line": 11 + }, + "name": "method", + "returns": { + "type": { + "primitive": "number" + } + } + } + ], + "name": "BaseClass", + "properties": [ + { + "docs": { + "stability": "stable" + }, + "immutable": true, + "locationInModule": { + "filename": "lib/indirect-implementation.ts", + "line": 7 + }, + "name": "property", + "type": { + "primitive": "string" + } + } + ], + "symbolId": "lib/indirect-implementation:BaseClass" + }, "jsii-calc.BaseJsii976": { "assembly": "jsii-calc", "docs": { @@ -1772,7 +1829,7 @@ { "docs": { "stability": "stable", - "summary": "(deprecated) Say hello!" + "summary": "Say hello!" }, "locationInModule": { "filename": "lib/calculator.ts", @@ -4764,7 +4821,7 @@ { "docs": { "stability": "stable", - "summary": "(deprecated) Say hello!" + "summary": "Say hello!" }, "locationInModule": { "filename": "lib/compliance.ts", @@ -5652,6 +5709,24 @@ ], "symbolId": "lib/stability:ExternalStruct" }, + "jsii-calc.FullCombo": { + "assembly": "jsii-calc", + "base": "jsii-calc.BaseClass", + "docs": { + "stability": "stable" + }, + "fqn": "jsii-calc.FullCombo", + "interfaces": [ + "jsii-calc.IIndirectlyImplemented" + ], + "kind": "class", + "locationInModule": { + "filename": "lib/indirect-implementation.ts", + "line": 16 + }, + "name": "FullCombo", + "symbolId": "lib/indirect-implementation:FullCombo" + }, "jsii-calc.GiveMeStructs": { "assembly": "jsii-calc", "docs": { @@ -6335,6 +6410,55 @@ "name": "IFriendlyRandomGenerator", "symbolId": "lib/calculator:IFriendlyRandomGenerator" }, + "jsii-calc.IIndirectlyImplemented": { + "assembly": "jsii-calc", + "docs": { + "stability": "stable" + }, + "fqn": "jsii-calc.IIndirectlyImplemented", + "kind": "interface", + "locationInModule": { + "filename": "lib/indirect-implementation.ts", + "line": 1 + }, + "methods": [ + { + "abstract": true, + "docs": { + "stability": "stable" + }, + "locationInModule": { + "filename": "lib/indirect-implementation.ts", + "line": 3 + }, + "name": "method", + "returns": { + "type": { + "primitive": "number" + } + } + } + ], + "name": "IIndirectlyImplemented", + "properties": [ + { + "abstract": true, + "docs": { + "stability": "stable" + }, + "immutable": true, + "locationInModule": { + "filename": "lib/indirect-implementation.ts", + "line": 2 + }, + "name": "property", + "type": { + "primitive": "string" + } + } + ], + "symbolId": "lib/indirect-implementation:IIndirectlyImplemented" + }, "jsii-calc.IInterfaceImplementedByAbstractClass": { "assembly": "jsii-calc", "docs": { @@ -9364,7 +9488,7 @@ { "docs": { "stability": "stable", - "summary": "(deprecated) String representation of the value." + "summary": "String representation of the value." }, "locationInModule": { "filename": "lib/calculator.ts", @@ -9384,7 +9508,7 @@ { "docs": { "stability": "stable", - "summary": "(deprecated) The value." + "summary": "The value." }, "immutable": true, "locationInModule": { @@ -9471,7 +9595,7 @@ { "docs": { "stability": "stable", - "summary": "(deprecated) Say hello!" + "summary": "Say hello!" }, "locationInModule": { "filename": "lib/calculator.ts", @@ -9488,7 +9612,7 @@ { "docs": { "stability": "stable", - "summary": "(deprecated) String representation of the value." + "summary": "String representation of the value." }, "locationInModule": { "filename": "lib/calculator.ts", @@ -9508,7 +9632,7 @@ { "docs": { "stability": "stable", - "summary": "(deprecated) The value." + "summary": "The value." }, "immutable": true, "locationInModule": { @@ -14787,7 +14911,7 @@ { "docs": { "stability": "stable", - "summary": "(deprecated) String representation of the value." + "summary": "String representation of the value." }, "locationInModule": { "filename": "lib/calculator.ts", @@ -14825,7 +14949,7 @@ { "docs": { "stability": "stable", - "summary": "(deprecated) The value." + "summary": "The value." }, "immutable": true, "locationInModule": { @@ -15075,7 +15199,7 @@ { "docs": { "stability": "stable", - "summary": "(deprecated) Say hello!" + "summary": "Say hello!" }, "locationInModule": { "filename": "lib/module2647/index.ts", @@ -16807,5 +16931,5 @@ } }, "version": "3.20.120", - "fingerprint": "w6AJ35Nh9lBusQyMGP28WJp5MNbg527uO9TsHaP+DiE=" + "fingerprint": "sqJBfFAp4Hg5OgntWB3IRyRS7mpPF7G3qoh4NYSDeSw=" } diff --git a/packages/jsii-config/package.json b/packages/jsii-config/package.json index 19e2fd15ef..96cef65cfb 100644 --- a/packages/jsii-config/package.json +++ b/packages/jsii-config/package.json @@ -19,12 +19,12 @@ "jsii-config": "bin/jsii-config" }, "devDependencies": { - "@types/inquirer": "^8.1.3", - "@types/jest": "^27.0.3", - "@types/node": "^12.20.39", + "@types/inquirer": "^8.2.0", + "@types/jest": "^27.4.0", + "@types/node": "^12.20.43", "@types/yargs": "^17.0.8", - "eslint": "^8.5.0", - "jest": "^27.4.5", + "eslint": "^8.8.0", + "jest": "^27.4.7", "jest-expect-message": "^1.0.2", "prettier": "^2.5.1", "typescript": "~3.9.10" diff --git a/packages/jsii-diff/package.json b/packages/jsii-diff/package.json index 728bc74242..6bf7233948 100644 --- a/packages/jsii-diff/package.json +++ b/packages/jsii-diff/package.json @@ -37,17 +37,17 @@ "@jsii/spec": "^0.0.0", "fs-extra": "^9.1.0", "jsii-reflect": "^0.0.0", - "log4js": "^6.3.0", + "log4js": "^6.4.1", "typescript": "~3.9.10", "yargs": "^16.2.0" }, "devDependencies": { "@types/fs-extra": "^9.0.13", - "@types/jest": "^27.0.3", - "@types/node": "^12.20.39", + "@types/jest": "^27.4.0", + "@types/node": "^12.20.43", "@types/tar-fs": "^2.0.1", - "eslint": "^8.5.0", - "jest": "^27.4.5", + "eslint": "^8.8.0", + "jest": "^27.4.7", "jest-expect-message": "^1.0.2", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", diff --git a/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts index fa15aa74ed..b781fa6551 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts @@ -942,7 +942,7 @@ export class DotNetGenerator extends Generator { if (prop.optional) { this.code.line('[JsiiOptional]'); } - this.dotnetRuntimeGenerator.emitAttributesForProperty(prop, datatype); + this.dotnetRuntimeGenerator.emitAttributesForProperty(prop); let isOverrideKeyWord = ''; let isVirtualKeyWord = ''; diff --git a/packages/jsii-pacmak/lib/targets/dotnet/dotnetruntimegenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/dotnetruntimegenerator.ts index df0e5244c1..ce16482130 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/dotnetruntimegenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/dotnetruntimegenerator.ts @@ -78,8 +78,6 @@ export class DotNetRuntimeGenerator { cls: spec.ClassType | spec.InterfaceType, method: spec.Method /*, emitForProxyOrDatatype: boolean = false*/, ): void { - const isOverride = - spec.isClassType(cls) && method.overrides ? ', isOverride: true' : ''; const isAsync = spec.isClassType(cls) && method.async ? ', isAsync: true' : ''; const parametersJson = method.parameters @@ -92,7 +90,7 @@ export class DotNetRuntimeGenerator { .replace(/"/g, '\\"') .replace(/\\{2}"/g, 'test')}"` : ''; - const jsiiAttribute = `[JsiiMethod(name: "${method.name}"${returnsJson}${parametersJson}${isAsync}${isOverride})]`; + const jsiiAttribute = `[JsiiMethod(name: "${method.name}"${returnsJson}${parametersJson}${isAsync})]`; this.code.line(jsiiAttribute); this.emitDeprecatedAttributeIfNecessary(method); } @@ -100,20 +98,15 @@ export class DotNetRuntimeGenerator { /** * Emits the proper jsii .NET attribute for a property * - * Ex: [JsiiProperty(name: "foo", typeJson: "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}", isOptional: true, isOverride: true)] + * Ex: [JsiiProperty(name: "foo", typeJson: "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}", isOptional: true)] */ - public emitAttributesForProperty( - prop: spec.Property, - datatype = false, - ): void { - // If we are on a datatype then we want the property to override in Jsii - const isJsiiOverride = datatype ? ', isOverride: true' : ''; + public emitAttributesForProperty(prop: spec.Property): void { const isOptionalJsii = prop.optional ? ', isOptional: true' : ''; const jsiiAttribute = `[JsiiProperty(name: "${prop.name}", ` + `typeJson: "${JSON.stringify(prop.type) .replace(/"/g, '\\"') - .replace(/\\{2}"/g, 'test')}"${isOptionalJsii}${isJsiiOverride})]`; + .replace(/\\{2}"/g, 'test')}"${isOptionalJsii})]`; this.code.line(jsiiAttribute); this.emitDeprecatedAttributeIfNecessary(prop); } diff --git a/packages/jsii-pacmak/lib/targets/go/package.ts b/packages/jsii-pacmak/lib/targets/go/package.ts index 7cd7759a64..d5acbe5972 100644 --- a/packages/jsii-pacmak/lib/targets/go/package.ts +++ b/packages/jsii-pacmak/lib/targets/go/package.ts @@ -41,7 +41,7 @@ export abstract class Package { public readonly submodules: InternalPackage[]; public readonly types: GoType[]; - private readonly embeddedTypes: { [fqn: string]: EmbeddedType } = {}; + private readonly embeddedTypes = new Map(); public constructor( private readonly typeSpec: readonly Type[], @@ -158,7 +158,7 @@ export abstract class Package { }; } - const exists = this.embeddedTypes[type.fqn]; + const exists = this.embeddedTypes.get(type.fqn); if (exists) { return exists; } @@ -169,14 +169,15 @@ export abstract class Package { const slug = original.replace(/[^A-Za-z0-9]/g, ''); const aliasName = `Type__${slug}`; - this.embeddedTypes[type.fqn] = { + const embeddedType: EmbeddedType = { foriegnTypeName: original, foriegnType: typeref, fieldName: aliasName, embed: `${INTERNAL_PACKAGE_NAME}.${aliasName}`, }; + this.embeddedTypes.set(type.fqn, embeddedType); - return this.resolveEmbeddedType(type); + return embeddedType; } protected emitHeader(code: CodeMaker) { @@ -272,9 +273,7 @@ export abstract class Package { } private emitInternal(context: EmitContext) { - const aliases = Object.values(this.embeddedTypes); - - if (aliases.length === 0) { + if (this.embeddedTypes.size === 0) { return; } @@ -287,7 +286,7 @@ export abstract class Package { const imports = new Set(); - for (const alias of aliases) { + for (const alias of this.embeddedTypes.values()) { if (!alias.foriegnType) { continue; } @@ -303,7 +302,7 @@ export abstract class Package { } code.close(')'); - for (const alias of aliases) { + for (const alias of this.embeddedTypes.values()) { code.line(`type ${alias.fieldName} = ${alias.foriegnTypeName}`); } @@ -322,7 +321,13 @@ export class RootPackage extends Package { private readonly readme?: ReadmeFile; private readonly versionFile: VersionFile; - public constructor(assembly: Assembly) { + // This cache of root packages is shared across all root packages derived created by this one (via dependencies). + private readonly rootPackageCache: Map; + + public constructor( + assembly: Assembly, + rootPackageCache = new Map(), + ) { const goConfig = assembly.targets?.go ?? {}; const packageName = goPackageNameForAssembly(assembly); const filePath = ''; @@ -338,6 +343,9 @@ export class RootPackage extends Package { version, ); + this.rootPackageCache = rootPackageCache; + this.rootPackageCache.set(assembly.name, this); + this.assembly = assembly; this.version = version; this.versionFile = new VersionFile(this.version); @@ -423,7 +431,9 @@ export class RootPackage extends Package { */ public get packageDependencies(): RootPackage[] { return this.assembly.dependencies.map( - (dep) => new RootPackage(dep.assembly), + (dep) => + this.rootPackageCache.get(dep.assembly.name) ?? + new RootPackage(dep.assembly, this.rootPackageCache), ); } diff --git a/packages/jsii-pacmak/lib/targets/go/runtime/emit-arguments.ts b/packages/jsii-pacmak/lib/targets/go/runtime/emit-arguments.ts index a83e0e8b24..7a88e05d28 100644 --- a/packages/jsii-pacmak/lib/targets/go/runtime/emit-arguments.ts +++ b/packages/jsii-pacmak/lib/targets/go/runtime/emit-arguments.ts @@ -19,7 +19,7 @@ export function emitArguments( if (argsList.length === 0) { return undefined; } - if (parameters[parameters.length - 1].parameter.variadic) { + if (parameters[parameters.length - 1].isVariadic) { // For variadic methods, we must build up the []interface{} slice by hand, // as there would not be any implicit conversion happening when passing // the variadic argument as a splat to the append function... diff --git a/packages/jsii-pacmak/lib/targets/go/types/class.ts b/packages/jsii-pacmak/lib/targets/go/types/class.ts index 142bd1edd4..95c9371038 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/class.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/class.ts @@ -23,7 +23,7 @@ import { GoMethod, GoProperty, GoTypeMember } from './type-member'; /* * GoClass wraps a Typescript class as a Go custom struct type */ -export class GoClass extends GoType { +export class GoClass extends GoType { public readonly methods: ClassMethod[]; public readonly staticMethods: StaticMethod[]; public readonly properties: GoProperty[]; @@ -34,7 +34,7 @@ export class GoClass extends GoType { private readonly initializer?: GoClassConstructor; - public constructor(pkg: Package, public type: ClassType) { + public constructor(pkg: Package, type: ClassType) { super(pkg, type); const methods = new Array(); diff --git a/packages/jsii-pacmak/lib/targets/go/types/enum.ts b/packages/jsii-pacmak/lib/targets/go/types/enum.ts index ea5ff70c5a..d98dd058d1 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/enum.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/enum.ts @@ -7,10 +7,10 @@ import { Package } from '../package'; import { JSII_RT_ALIAS } from '../runtime'; import { GoType } from './go-type'; -export class Enum extends GoType { +export class Enum extends GoType { private readonly members: readonly GoEnumMember[]; - public constructor(pkg: Package, public type: EnumType) { + public constructor(pkg: Package, type: EnumType) { super(pkg, type); this.members = type.members.map((mem) => new GoEnumMember(this, mem)); diff --git a/packages/jsii-pacmak/lib/targets/go/types/go-type-reference.ts b/packages/jsii-pacmak/lib/targets/go/types/go-type-reference.ts index 6f3d0c9dda..c163bd5109 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/go-type-reference.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/go-type-reference.ts @@ -47,6 +47,7 @@ type TypeMap = */ export class GoTypeRef { private _typeMap?: TypeMap; + public constructor( public readonly root: Package, public readonly reference: TypeReference, @@ -126,18 +127,18 @@ export class GoTypeRef { switch (this.typeMap.type) { case 'interface': if (this.type?.pkg) { - ret.push(this.type?.pkg); + ret.push(this.type.pkg); } break; case 'array': case 'map': - ret.push(...(this.typeMap.value.dependencies ?? [])); + ret.push(...this.typeMap.value.dependencies); break; case 'union': for (const t of this.typeMap.value) { - ret.push(...(t.dependencies ?? [])); + ret.push(...t.dependencies); } break; diff --git a/packages/jsii-pacmak/lib/targets/go/types/go-type.ts b/packages/jsii-pacmak/lib/targets/go/types/go-type.ts index 7ccbe2f9c8..fc33aa968d 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/go-type.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/go-type.ts @@ -8,12 +8,12 @@ import { JSII_RT_ALIAS } from '../runtime'; import { GoClass } from './class'; import { GoInterface } from './interface'; -export abstract class GoType { +export abstract class GoType { public readonly name: string; public readonly fqn: string; public readonly proxyName: string; - public constructor(public pkg: Package, public type: Type) { + public constructor(public readonly pkg: Package, public readonly type: T) { this.name = type.name; // Prefix with the nesting parent name(s), using an _ delimiter. diff --git a/packages/jsii-pacmak/lib/targets/go/types/interface.ts b/packages/jsii-pacmak/lib/targets/go/types/interface.ts index bd24c151d0..f2e6db9e52 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/interface.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/interface.ts @@ -11,13 +11,13 @@ import { GoType } from './go-type'; import { GoTypeRef } from './go-type-reference'; import { GoMethod, GoProperty } from './type-member'; -export class GoInterface extends GoType { +export class GoInterface extends GoType { public readonly methods: InterfaceMethod[]; public readonly reimplementedMethods?: readonly InterfaceMethod[]; public readonly properties: InterfaceProperty[]; public readonly reimplementedProperties?: readonly InterfaceProperty[]; - public constructor(pkg: Package, public type: InterfaceType) { + public constructor(pkg: Package, type: InterfaceType) { super(pkg, type); this.methods = type.ownMethods @@ -191,8 +191,6 @@ export class GoInterface extends GoType { } class InterfaceProperty extends GoProperty { - public readonly reference?: GoTypeRef; - public constructor( public readonly parent: GoInterface, public readonly property: Property, @@ -201,10 +199,7 @@ class InterfaceProperty extends GoProperty { } public get returnType(): string { - return ( - this.reference?.scopedReference(this.parent.pkg) ?? - this.property.type.toString() - ); + return this.reference.scopedReference(this.parent.pkg); } public emit({ code, documenter }: EmitContext) { diff --git a/packages/jsii-pacmak/lib/targets/go/types/struct.ts b/packages/jsii-pacmak/lib/targets/go/types/struct.ts index a1424b9497..5bf17162d0 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/struct.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/struct.ts @@ -13,10 +13,10 @@ import { GoProperty } from './type-member'; /* * Struct wraps a JSII datatype interface aka, structs */ -export class Struct extends GoType { +export class Struct extends GoType { private readonly properties: readonly GoProperty[]; - public constructor(parent: Package, public readonly type: InterfaceType) { + public constructor(parent: Package, type: InterfaceType) { super(parent, type); assert( diff --git a/packages/jsii-pacmak/lib/targets/go/types/type-member.ts b/packages/jsii-pacmak/lib/targets/go/types/type-member.ts index 78c61dc69b..bf4930a588 100644 --- a/packages/jsii-pacmak/lib/targets/go/types/type-member.ts +++ b/packages/jsii-pacmak/lib/targets/go/types/type-member.ts @@ -1,8 +1,15 @@ -import { Callable, Method, Parameter, Property } from 'jsii-reflect'; +import { + Callable, + Method, + Parameter, + Property, + TypeReference, +} from 'jsii-reflect'; import { jsiiToPascalCase } from '../../../naming-util'; import { SpecialDependencies } from '../dependencies'; import { EmitContext } from '../emit-context'; +import { Package } from '../package'; import { GetProperty, JSII_RT_ALIAS, SetProperty } from '../runtime'; import { substituteReservedWords } from '../util'; @@ -26,7 +33,6 @@ export interface GoTypeMember { */ export class GoProperty implements GoTypeMember { public readonly name: string; - public readonly reference?: GoTypeRef; public readonly immutable: boolean; public constructor( @@ -35,10 +41,10 @@ export class GoProperty implements GoTypeMember { ) { this.name = jsiiToPascalCase(this.property.name); this.immutable = property.immutable; + } - if (property.type) { - this.reference = new GoTypeRef(parent.pkg.root, property.type); - } + public get reference(): GoTypeRef { + return new GoTypeRef(this.parent.pkg.root, this.property.type); } public get specialDependencies(): SpecialDependencies { @@ -143,7 +149,6 @@ export class GoProperty implements GoTypeMember { export abstract class GoMethod implements GoTypeMember { public readonly name: string; - public readonly reference?: GoTypeRef; public readonly parameters: GoParameter[]; public constructor( @@ -151,9 +156,6 @@ export abstract class GoMethod implements GoTypeMember { public readonly method: Callable, ) { this.name = jsiiToPascalCase(method.name); - if (Method.isMethod(method) && method.returns.type) { - this.reference = new GoTypeRef(parent.pkg.root, method.returns.type); - } this.parameters = this.method.parameters.map( (param) => new GoParameter(parent, param), ); @@ -163,6 +165,13 @@ export abstract class GoMethod implements GoTypeMember { public abstract get specialDependencies(): SpecialDependencies; + public get reference(): GoTypeRef | undefined { + if (Method.isMethod(this.method) && this.method.returns.type) { + return new GoTypeRef(this.parent.pkg.root, this.method.returns.type); + } + return undefined; + } + public get returnsRef(): boolean { if ( this.reference?.type?.type.isClassType() || @@ -197,18 +206,23 @@ export abstract class GoMethod implements GoTypeMember { export class GoParameter { public readonly name: string; - public readonly reference: GoTypeRef; + public readonly isVariadic: boolean; + private readonly type: TypeReference; + private readonly pkg: Package; - public constructor( - public parent: GoClass | GoInterface, - public readonly parameter: Parameter, - ) { + public constructor(parent: GoClass | GoInterface, parameter: Parameter) { this.name = substituteReservedWords(parameter.name); - this.reference = new GoTypeRef(parent.pkg.root, parameter.type); + this.isVariadic = parameter.variadic; + this.type = parameter.type; + this.pkg = parent.pkg; + } + + public get reference(): GoTypeRef { + return new GoTypeRef(this.pkg.root, this.type); } public toString(): string { - const paramType = this.reference.scopedReference(this.parent.pkg); - return `${this.name} ${this.parameter.variadic ? '...' : ''}${paramType}`; + const paramType = this.reference.scopedReference(this.pkg); + return `${this.name} ${this.isVariadic ? '...' : ''}${paramType}`; } } diff --git a/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt b/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt index 028ff319b4..530b8a4098 100644 --- a/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt +++ b/packages/jsii-pacmak/lib/targets/python/requirements-dev.txt @@ -6,4 +6,4 @@ setuptools~=59.6.0 # build-system wheel~=0.37.1 # build-system -twine~=3.7.1 +twine~=3.8.0 diff --git a/packages/jsii-pacmak/package.json b/packages/jsii-pacmak/package.json index 33332db349..bf49dfac7b 100644 --- a/packages/jsii-pacmak/package.json +++ b/packages/jsii-pacmak/package.json @@ -59,16 +59,16 @@ "@types/clone": "^2.1.1", "@types/commonmark": "^0.27.5", "@types/fs-extra": "^9.0.13", - "@types/jest": "^27.0.3", - "@types/node": "^12.20.39", + "@types/jest": "^27.4.0", + "@types/node": "^12.20.43", "@types/semver": "^7.3.9", - "eslint": "^8.5.0", - "jest": "^27.4.5", + "eslint": "^8.8.0", + "jest": "^27.4.7", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", "prettier": "^2.5.1", - "ts-jest": "^27.1.2", + "ts-jest": "^27.1.3", "typescript": "~3.9.10" }, "keywords": [ 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 24cd0361f9..ba54e825bd 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 @@ -114,14 +114,14 @@ namespace Example.Test.Demo [JsiiByValue(fqn: "testpkg.Baz")] public class Baz_ : Example.Test.Demo.IBaz { - [JsiiProperty(name: "baz", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOverride: true)] + [JsiiProperty(name: "baz", typeJson: "{\\"primitive\\":\\"boolean\\"}")] public bool Baz { get; set; } - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] public double Foo { get; @@ -129,7 +129,7 @@ namespace Example.Test.Demo } [JsiiOptional] - [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? Bar { get; @@ -186,7 +186,7 @@ namespace Example.Test.Demo [JsiiByValue(fqn: "testpkg.Foo")] public class Foo_ : Example.Test.Demo.IFoo { - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] public double Foo { get; @@ -209,7 +209,7 @@ namespace Example.Test.Demo [JsiiByValue(fqn: "testpkg.FooBar")] public class FooBar : Example.Test.Demo.IFooBar { - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] public double Foo { get; @@ -217,7 +217,7 @@ namespace Example.Test.Demo } [JsiiOptional] - [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? Bar { get; @@ -1592,7 +1592,7 @@ namespace Example.Test.Demo [JsiiByValue(fqn: "testpkg.Namespace1.Foo")] public class Foo : Example.Test.Demo.Namespace1.IFoo { - [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Bar { get; 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 48f7cdd035..0706c2d65d 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 @@ -127,14 +127,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace [JsiiByValue(fqn: "@scope/jsii-calc-base.BaseProps")] public class BaseProps : Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace.IBaseProps { - [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Bar { get; set; } - [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-base-of-base.Very\\"}", isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-base-of-base.Very\\"}")] public Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very Foo { get; @@ -733,7 +733,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace [JsiiByValue(fqn: "@scope/jsii-calc-base-of-base.VeryBaseProps")] public class VeryBaseProps : Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.IVeryBaseProps { - [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-base-of-base.Very\\"}", isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-base-of-base.Very\\"}")] public Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very Foo { get; @@ -1125,7 +1125,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// Stability: Deprecated /// [JsiiOptional] - [JsiiProperty(name: "hoistedTop", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "hoistedTop", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] [System.Obsolete()] public string? HoistedTop { @@ -1137,7 +1137,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// Stability: Deprecated /// [JsiiOptional] - [JsiiProperty(name: "left", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "left", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] [System.Obsolete()] public double? Left { @@ -1166,7 +1166,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// Stability: Deprecated /// [JsiiOptional] - [JsiiProperty(name: "hoistedTop", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "hoistedTop", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] [System.Obsolete()] public string? HoistedTop { @@ -1178,7 +1178,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// Stability: Deprecated /// [JsiiOptional] - [JsiiProperty(name: "right", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "right", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] [System.Obsolete()] public bool? Right { @@ -1808,7 +1808,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// /// Stability: Deprecated /// - [JsiiProperty(name: "anumber", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + [JsiiProperty(name: "anumber", typeJson: "{\\"primitive\\":\\"number\\"}")] [System.Obsolete()] public double Anumber { @@ -1820,7 +1820,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// /// Stability: Deprecated /// - [JsiiProperty(name: "astring", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "astring", typeJson: "{\\"primitive\\":\\"string\\"}")] [System.Obsolete()] public string Astring { @@ -1832,7 +1832,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// Stability: Deprecated /// [JsiiOptional] - [JsiiProperty(name: "firstOptional", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "firstOptional", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}", isOptional: true)] [System.Obsolete()] public string[]? FirstOptional { @@ -2031,7 +2031,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// /// Stability: Deprecated /// - [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] [System.Obsolete()] public override abstract string ToString(); @@ -2063,7 +2063,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// /// Stability: Deprecated /// - [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] [System.Obsolete()] public override string ToString() { @@ -2094,7 +2094,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// Stability: Deprecated /// [JsiiOptional] - [JsiiProperty(name: "optional1", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "optional1", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] [System.Obsolete()] public string? Optional1 { @@ -2106,7 +2106,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// Stability: Deprecated /// [JsiiOptional] - [JsiiProperty(name: "optional2", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "optional2", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] [System.Obsolete()] public double? Optional2 { @@ -2118,7 +2118,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace /// Stability: Deprecated /// [JsiiOptional] - [JsiiProperty(name: "optional3", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "optional3", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] [System.Obsolete()] public bool? Optional3 { @@ -2397,7 +2397,7 @@ namespace Amazon.JSII.Tests.CustomSubmoduleName /// /// Stability: Deprecated /// - [JsiiProperty(name: "name", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "name", typeJson: "{\\"primitive\\":\\"string\\"}")] [System.Obsolete()] public string Name { @@ -2428,7 +2428,7 @@ namespace Amazon.JSII.Tests.CustomSubmoduleName /// /// Stability: Deprecated /// - [JsiiProperty(name: "key", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "key", typeJson: "{\\"primitive\\":\\"string\\"}")] [System.Obsolete()] public string Key { @@ -2439,7 +2439,7 @@ namespace Amazon.JSII.Tests.CustomSubmoduleName /// /// Stability: Deprecated /// - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"any\\"}", isOverride: true)] + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"any\\"}")] [System.Obsolete()] public object Value { @@ -2743,6 +2743,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 AnonymousImplementationProvider.cs ┃ ┣━ 📄 AsyncVirtualMethods.cs ┃ ┣━ 📄 AugmentableClass.cs + ┃ ┣━ 📄 BaseClass.cs ┃ ┣━ 📄 BaseJsii976.cs ┃ ┣━ 📄 Bell.cs ┃ ┣━ 📄 BinaryOperation.cs @@ -2809,6 +2810,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 ExternalClass.cs ┃ ┣━ 📄 ExternalEnum.cs ┃ ┣━ 📄 ExternalStruct.cs + ┃ ┣━ 📄 FullCombo.cs ┃ ┣━ 📄 GiveMeStructs.cs ┃ ┣━ 📄 Greetee.cs ┃ ┣━ 📄 GreetingAugmenter.cs @@ -2842,6 +2844,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 IFriendlyRandomGenerator.cs ┃ ┣━ 📄 IGreetee.cs ┃ ┣━ 📄 IImplictBaseOfBase.cs + ┃ ┣━ 📄 IIndirectlyImplemented.cs ┃ ┣━ 📄 IInterfaceImplementedByAbstractClass.cs ┃ ┣━ 📄 IInterfaceThatShouldNotBeADataType.cs ┃ ┣━ 📄 IInterfaceWithInternal.cs @@ -3411,14 +3414,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { } - /// (deprecated) String representation of the value. - [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + /// String representation of the value. + [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public override string ToString() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; } - /// (deprecated) The value. + /// The value. [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] public override double Value { @@ -3769,13 +3772,13 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { } - [JsiiMethod(name: "provideAsClass", returnsJson: "{\\"type\\":{\\"fqn\\":\\"jsii-calc.Implementation\\"}}", isOverride: true)] + [JsiiMethod(name: "provideAsClass", returnsJson: "{\\"type\\":{\\"fqn\\":\\"jsii-calc.Implementation\\"}}")] public virtual Amazon.JSII.Tests.CalculatorNamespace.Implementation ProvideAsClass() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; } - [JsiiMethod(name: "provideAsInterface", returnsJson: "{\\"type\\":{\\"fqn\\":\\"jsii-calc.IAnonymouslyImplementMe\\"}}", isOverride: true)] + [JsiiMethod(name: "provideAsInterface", returnsJson: "{\\"type\\":{\\"fqn\\":\\"jsii-calc.IAnonymouslyImplementMe\\"}}")] public virtual Amazon.JSII.Tests.CalculatorNamespace.IAnonymouslyImplementMe ProvideAsInterface() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; @@ -3904,6 +3907,58 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseClass.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.BaseClass), fullyQualifiedName: "jsii-calc.BaseClass")] + public abstract class BaseClass : DeputyBase + { + protected BaseClass(): base(new DeputyProps(System.Array.Empty())) + { + } + + /// Used by jsii to construct an instance of this class from a Javascript-owned object reference + /// The Javascript-owned object reference + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected BaseClass(ByRefValue reference): base(reference) + { + } + + /// Used by jsii to construct an instance of this class from DeputyProps + /// The deputy props + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected BaseClass(DeputyProps props): base(props) + { + } + + [JsiiMethod(name: "method", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}")] + public virtual double Method() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } + + [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}")] + public virtual string Property + { + get => GetInstanceProperty()!; + } + + [JsiiTypeProxy(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.BaseClass), fullyQualifiedName: "jsii-calc.BaseClass")] + internal sealed class _Proxy : Amazon.JSII.Tests.CalculatorNamespace.BaseClass + { + private _Proxy(ByRefValue reference): base(reference) + { + } + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseJsii976.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -3964,7 +4019,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { } - [JsiiMethod(name: "ring", isOverride: true)] + [JsiiMethod(name: "ring")] public virtual void Ring() { InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); @@ -4013,8 +4068,8 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { } - /// (deprecated) Say hello! - [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + /// Say hello! + [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public virtual string Hello() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; @@ -4057,7 +4112,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// /// Stability: Deprecated /// - [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] [System.Obsolete()] public override string ToString() { @@ -4286,7 +4341,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Default: 0 /// [JsiiOptional] - [JsiiProperty(name: "initialValue", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "initialValue", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] public double? InitialValue { get; @@ -4298,7 +4353,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Default: none /// [JsiiOptional] - [JsiiProperty(name: "maximumValue", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "maximumValue", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] public double? MaximumValue { get; @@ -4408,7 +4463,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Cdk16625.Donotimport /// Not quite random, but it'll do. /// 1337 - [JsiiMethod(name: "next", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}", isOverride: true)] + [JsiiMethod(name: "next", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}")] public virtual double Next() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; @@ -4430,14 +4485,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.ChildStruct982")] public class ChildStruct982 : Amazon.JSII.Tests.CalculatorNamespace.IChildStruct982 { - [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"number\\"}")] public double Bar { get; set; } - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Foo { get; @@ -4902,8 +4957,8 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Composition { } - /// (deprecated) String representation of the value. - [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + /// String representation of the value. + [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public override string ToString() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; @@ -4919,7 +4974,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Composition get; } - /// (deprecated) The value. + /// The value. [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] public override double Value { @@ -5048,7 +5103,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace public class ConfusingToJacksonStruct : Amazon.JSII.Tests.CalculatorNamespace.IConfusingToJacksonStruct { [JsiiOptional] - [JsiiProperty(name: "unionProperty", typeJson: "{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"@scope/jsii-calc-lib.IFriendly\\"},{\\"collection\\":{\\"elementtype\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"@scope/jsii-calc-lib.IFriendly\\"},{\\"fqn\\":\\"jsii-calc.AbstractClass\\"}]}},\\"kind\\":\\"array\\"}}]}}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "unionProperty", typeJson: "{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"@scope/jsii-calc-lib.IFriendly\\"},{\\"collection\\":{\\"elementtype\\":{\\"union\\":{\\"types\\":[{\\"fqn\\":\\"@scope/jsii-calc-lib.IFriendly\\"},{\\"fqn\\":\\"jsii-calc.AbstractClass\\"}]}},\\"kind\\":\\"array\\"}}]}}", isOptional: true)] public object? UnionProperty { get; @@ -5376,21 +5431,21 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.ContainerProps")] public class ContainerProps : Amazon.JSII.Tests.CalculatorNamespace.IContainerProps { - [JsiiProperty(name: "arrayProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"array\\"}}", isOverride: true)] + [JsiiProperty(name: "arrayProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"array\\"}}")] public Amazon.JSII.Tests.CalculatorNamespace.IDummyObj[] ArrayProp { get; set; } - [JsiiProperty(name: "objProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}", isOverride: true)] + [JsiiProperty(name: "objProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}")] public System.Collections.Generic.IDictionary ObjProp { get; set; } - [JsiiProperty(name: "recordProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}", isOverride: true)] + [JsiiProperty(name: "recordProp", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"jsii-calc.DummyObj\\"},\\"kind\\":\\"map\\"}}")] public System.Collections.Generic.IDictionary RecordProp { get; @@ -5720,7 +5775,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// /// Stability: Deprecated /// - [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] [System.Obsolete("well, yeah")] public string ReadonlyProperty { @@ -5816,14 +5871,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.DerivedStruct")] public class DerivedStruct : Amazon.JSII.Tests.CalculatorNamespace.IDerivedStruct { - [JsiiProperty(name: "anotherRequired", typeJson: "{\\"primitive\\":\\"date\\"}", isOverride: true)] + [JsiiProperty(name: "anotherRequired", typeJson: "{\\"primitive\\":\\"date\\"}")] public System.DateTime AnotherRequired { get; set; } - [JsiiProperty(name: "bool", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOverride: true)] + [JsiiProperty(name: "bool", typeJson: "{\\"primitive\\":\\"boolean\\"}")] public bool Bool { get; @@ -5831,7 +5886,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } /// An example of a non primitive property. - [JsiiProperty(name: "nonPrimitive", typeJson: "{\\"fqn\\":\\"jsii-calc.DoubleTrouble\\"}", isOverride: true)] + [JsiiProperty(name: "nonPrimitive", typeJson: "{\\"fqn\\":\\"jsii-calc.DoubleTrouble\\"}")] public Amazon.JSII.Tests.CalculatorNamespace.DoubleTrouble NonPrimitive { get; @@ -5840,7 +5895,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// This is optional. [JsiiOptional] - [JsiiProperty(name: "anotherOptional", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.NumericValue\\"},\\"kind\\":\\"map\\"}}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "anotherOptional", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.NumericValue\\"},\\"kind\\":\\"map\\"}}", isOptional: true)] public System.Collections.Generic.IDictionary? AnotherOptional { get; @@ -5848,7 +5903,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "optionalAny", typeJson: "{\\"primitive\\":\\"any\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "optionalAny", typeJson: "{\\"primitive\\":\\"any\\"}", isOptional: true)] public object? OptionalAny { get; @@ -5856,7 +5911,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "optionalArray", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "optionalArray", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}", isOptional: true)] public string[]? OptionalArray { get; @@ -5867,7 +5922,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// /// Stability: Deprecated /// - [JsiiProperty(name: "anumber", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + [JsiiProperty(name: "anumber", typeJson: "{\\"primitive\\":\\"number\\"}")] [System.Obsolete()] public double Anumber { @@ -5879,7 +5934,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// /// Stability: Deprecated /// - [JsiiProperty(name: "astring", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "astring", typeJson: "{\\"primitive\\":\\"string\\"}")] [System.Obsolete()] public string Astring { @@ -5891,7 +5946,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Stability: Deprecated /// [JsiiOptional] - [JsiiProperty(name: "firstOptional", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "firstOptional", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"string\\"},\\"kind\\":\\"array\\"}}", isOptional: true)] [System.Obsolete()] public string[]? FirstOptional { @@ -5914,7 +5969,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace public class DiamondBottom : Amazon.JSII.Tests.CalculatorNamespace.IDiamondBottom { [JsiiOptional] - [JsiiProperty(name: "bottom", typeJson: "{\\"primitive\\":\\"date\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "bottom", typeJson: "{\\"primitive\\":\\"date\\"}", isOptional: true)] public System.DateTime? Bottom { get; @@ -5925,7 +5980,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Stability: Deprecated /// [JsiiOptional] - [JsiiProperty(name: "hoistedTop", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "hoistedTop", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] [System.Obsolete()] public string? HoistedTop { @@ -5937,7 +5992,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Stability: Deprecated /// [JsiiOptional] - [JsiiProperty(name: "left", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "left", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] [System.Obsolete()] public double? Left { @@ -5949,7 +6004,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Stability: Deprecated /// [JsiiOptional] - [JsiiProperty(name: "right", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "right", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] [System.Obsolete()] public bool? Right { @@ -5973,7 +6028,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.DiamondInheritanceBaseLevelStruct")] public class DiamondInheritanceBaseLevelStruct : Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceBaseLevelStruct { - [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] public string BaseLevelProperty { get; @@ -5996,14 +6051,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.DiamondInheritanceFirstMidLevelStruct")] public class DiamondInheritanceFirstMidLevelStruct : Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceFirstMidLevelStruct { - [JsiiProperty(name: "firstMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "firstMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] public string FirstMidLevelProperty { get; set; } - [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] public string BaseLevelProperty { get; @@ -6026,14 +6081,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.DiamondInheritanceSecondMidLevelStruct")] public class DiamondInheritanceSecondMidLevelStruct : Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceSecondMidLevelStruct { - [JsiiProperty(name: "secondMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "secondMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] public string SecondMidLevelProperty { get; set; } - [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] public string BaseLevelProperty { get; @@ -6056,28 +6111,28 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.DiamondInheritanceTopLevelStruct")] public class DiamondInheritanceTopLevelStruct : Amazon.JSII.Tests.CalculatorNamespace.IDiamondInheritanceTopLevelStruct { - [JsiiProperty(name: "topLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "topLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] public string TopLevelProperty { get; set; } - [JsiiProperty(name: "firstMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "firstMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] public string FirstMidLevelProperty { get; set; } - [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "baseLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] public string BaseLevelProperty { get; set; } - [JsiiProperty(name: "secondMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "secondMidLevelProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] public string SecondMidLevelProperty { get; @@ -6368,15 +6423,15 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { } - /// (deprecated) Say hello! - [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + /// Say hello! + [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public virtual string Hello() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; } /// Returns another random number. - [JsiiMethod(name: "next", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}", isOverride: true)] + [JsiiMethod(name: "next", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}")] public virtual double Next() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; @@ -6398,7 +6453,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.DummyObj")] public class DummyObj : Amazon.JSII.Tests.CalculatorNamespace.IDummyObj { - [JsiiProperty(name: "example", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "example", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Example { get; @@ -6679,7 +6734,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace public class EraseUndefinedHashValuesOptions : Amazon.JSII.Tests.CalculatorNamespace.IEraseUndefinedHashValuesOptions { [JsiiOptional] - [JsiiProperty(name: "option1", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "option1", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? Option1 { get; @@ -6687,7 +6742,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "option2", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "option2", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? Option2 { get; @@ -6812,7 +6867,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// /// Stability: Experimental /// - [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] public string ReadonlyProperty { get; @@ -6873,14 +6928,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.ExtendsInternalInterface")] public class ExtendsInternalInterface : Amazon.JSII.Tests.CalculatorNamespace.IExtendsInternalInterface { - [JsiiProperty(name: "boom", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOverride: true)] + [JsiiProperty(name: "boom", typeJson: "{\\"primitive\\":\\"boolean\\"}")] public bool Boom { get; set; } - [JsiiProperty(name: "prop", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "prop", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Prop { get; @@ -7005,7 +7060,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// /// External: true /// - [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] public string ReadonlyProperty { get; @@ -7016,6 +7071,34 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/FullCombo.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.FullCombo), fullyQualifiedName: "jsii-calc.FullCombo")] + public class FullCombo : Amazon.JSII.Tests.CalculatorNamespace.BaseClass, Amazon.JSII.Tests.CalculatorNamespace.IIndirectlyImplemented + { + /// Used by jsii to construct an instance of this class from a Javascript-owned object reference + /// The Javascript-owned object reference + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected FullCombo(ByRefValue reference): base(reference) + { + } + + /// Used by jsii to construct an instance of this class from DeputyProps + /// The deputy props + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + protected FullCombo(DeputyProps props): base(props) + { + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -7091,7 +7174,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Default: world /// [JsiiOptional] - [JsiiProperty(name: "name", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "name", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? Name { get; @@ -8694,6 +8777,48 @@ namespace Amazon.JSII.Tests.CalculatorNamespace `; +exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIndirectlyImplemented.cs 1`] = ` +using Amazon.JSII.Runtime.Deputy; + +#pragma warning disable CS0672,CS0809,CS1591 + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterface(nativeType: typeof(IIndirectlyImplemented), fullyQualifiedName: "jsii-calc.IIndirectlyImplemented")] + public interface IIndirectlyImplemented + { + [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}")] + string Property + { + get; + } + [JsiiMethod(name: "method", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}")] + double Method(); + + [JsiiTypeProxy(nativeType: typeof(IIndirectlyImplemented), fullyQualifiedName: "jsii-calc.IIndirectlyImplemented")] + internal sealed class _Proxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IIndirectlyImplemented + { + private _Proxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}")] + public string Property + { + get => GetInstanceProperty()!; + } + + [JsiiMethod(name: "method", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}")] + public double Method() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; + } + } + } +} + +`; + exports[`Generated code for "jsii-calc": /dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceImplementedByAbstractClass.cs 1`] = ` using Amazon.JSII.Runtime.Deputy; @@ -10883,7 +11008,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { } - [JsiiMethod(name: "visible", isOverride: true)] + [JsiiMethod(name: "visible")] public virtual void Visible() { InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); @@ -10976,21 +11101,21 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.ImplictBaseOfBase")] public class ImplictBaseOfBase : Amazon.JSII.Tests.CalculatorNamespace.IImplictBaseOfBase { - [JsiiProperty(name: "goo", typeJson: "{\\"primitive\\":\\"date\\"}", isOverride: true)] + [JsiiProperty(name: "goo", typeJson: "{\\"primitive\\":\\"date\\"}")] public System.DateTime Goo { get; set; } - [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Bar { get; set; } - [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-base-of-base.Very\\"}", isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"@scope/jsii-calc-base-of-base.Very\\"}")] public Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very Foo { get; @@ -11029,7 +11154,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { } - [JsiiMethod(name: "ciao", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [JsiiMethod(name: "ciao", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public virtual string Ciao() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; @@ -11147,7 +11272,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClas [JsiiByValue(fqn: "jsii-calc.InterfaceInNamespaceIncludesClasses.Hello")] public class Hello : Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceIncludesClasses.IHello { - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] public double Foo { get; @@ -11204,7 +11329,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceOnlyInterfac [JsiiByValue(fqn: "jsii-calc.InterfaceInNamespaceOnlyInterface.Hello")] public class Hello : Amazon.JSII.Tests.CalculatorNamespace.InterfaceInNamespaceOnlyInterface.IHello { - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] public double Foo { get; @@ -12291,7 +12416,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.LevelOne.PropBooleanValue")] public class PropBooleanValue : Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropBooleanValue { - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOverride: true)] + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"boolean\\"}")] public bool Value { get; @@ -12326,7 +12451,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.LevelOne.PropProperty")] public class PropProperty : Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropProperty { - [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.LevelOne.PropBooleanValue\\"}", isOverride: true)] + [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.LevelOne.PropBooleanValue\\"}")] public Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropBooleanValue Prop { get; @@ -12350,7 +12475,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.LevelOneProps")] public class LevelOneProps : Amazon.JSII.Tests.CalculatorNamespace.ILevelOneProps { - [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.LevelOne.PropProperty\\"}", isOverride: true)] + [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.LevelOne.PropProperty\\"}")] public Amazon.JSII.Tests.CalculatorNamespace.LevelOne.IPropProperty Prop { get; @@ -12379,7 +12504,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Default: 80 /// [JsiiOptional] - [JsiiProperty(name: "containerPort", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "containerPort", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] public double? ContainerPort { get; @@ -12400,7 +12525,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Default: 256 /// [JsiiOptional] - [JsiiProperty(name: "cpu", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "cpu", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? Cpu { get; @@ -12427,7 +12552,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Default: 512 /// [JsiiOptional] - [JsiiProperty(name: "memoryMiB", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "memoryMiB", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? MemoryMiB { get; @@ -12439,7 +12564,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Default: true /// [JsiiOptional] - [JsiiProperty(name: "publicLoadBalancer", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "publicLoadBalancer", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] public bool? PublicLoadBalancer { get; @@ -12451,7 +12576,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Default: false /// [JsiiOptional] - [JsiiProperty(name: "publicTasks", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "publicTasks", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] public bool? PublicTasks { get; @@ -12632,8 +12757,8 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Module2647 { } - /// (deprecated) Say hello! - [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + /// Say hello! + [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public virtual string Hello() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; @@ -12839,14 +12964,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Module2689.Structs [JsiiByValue(fqn: "jsii-calc.module2689.structs.MyStruct")] public class MyStruct : Amazon.JSII.Tests.CalculatorNamespace.Module2689.Structs.IMyStruct { - [JsiiProperty(name: "baseMap", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"@scope/jsii-calc-base.BaseProps\\"},\\"kind\\":\\"map\\"}}", isOverride: true)] + [JsiiProperty(name: "baseMap", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"@scope/jsii-calc-base.BaseProps\\"},\\"kind\\":\\"map\\"}}")] public System.Collections.Generic.IDictionary BaseMap { get; set; } - [JsiiProperty(name: "numbers", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.Number\\"},\\"kind\\":\\"array\\"}}", isOverride: true)] + [JsiiProperty(name: "numbers", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"fqn\\":\\"@scope/jsii-calc-lib.Number\\"},\\"kind\\":\\"array\\"}}")] public Amazon.JSII.Tests.CalculatorNamespace.LibNamespace.Number[] Numbers { get; @@ -12869,7 +12994,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Module2692.Submodule1 [JsiiByValue(fqn: "jsii-calc.module2692.submodule1.Bar")] public class Bar : Amazon.JSII.Tests.CalculatorNamespace.Module2692.Submodule1.IBar { - [JsiiProperty(name: "bar1", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "bar1", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Bar1 { get; @@ -12926,7 +13051,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Module2692.Submodule2 [JsiiByValue(fqn: "jsii-calc.module2692.submodule2.Bar")] public class Bar : Amazon.JSII.Tests.CalculatorNamespace.Module2692.Submodule2.IBar { - [JsiiProperty(name: "bar2", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "bar2", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Bar2 { get; @@ -12949,21 +13074,21 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Module2692.Submodule2 [JsiiByValue(fqn: "jsii-calc.module2692.submodule2.Foo")] public class Foo : Amazon.JSII.Tests.CalculatorNamespace.Module2692.Submodule2.IFoo { - [JsiiProperty(name: "foo2", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "foo2", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Foo2 { get; set; } - [JsiiProperty(name: "bar2", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "bar2", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Bar2 { get; set; } - [JsiiProperty(name: "bar1", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "bar1", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Bar1 { get; @@ -13082,7 +13207,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Module2700 { } - [JsiiMethod(name: "bar", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [JsiiMethod(name: "bar", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public virtual string Bar() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; @@ -13206,7 +13331,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Module2702 { } - [JsiiMethod(name: "bazMethod", isOverride: true)] + [JsiiMethod(name: "bazMethod")] public virtual void BazMethod() { InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); @@ -13320,13 +13445,13 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Module2702 { } - [JsiiMethod(name: "bar", isOverride: true)] + [JsiiMethod(name: "bar")] public virtual void Bar() { InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); } - [JsiiMethod(name: "foo", isOverride: true)] + [JsiiMethod(name: "foo")] public virtual void Foo() { InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); @@ -13370,7 +13495,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Module2702 { } - [JsiiMethod(name: "constructMethod", isOverride: true)] + [JsiiMethod(name: "constructMethod")] public virtual void ConstructMethod() { InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); @@ -13608,7 +13733,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Module2702 { } - [JsiiMethod(name: "resourceMethod", isOverride: true)] + [JsiiMethod(name: "resourceMethod")] public virtual void ResourceMethod() { InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); @@ -13660,7 +13785,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Module2702 { } - [JsiiMethod(name: "vpcMethod", isOverride: true)] + [JsiiMethod(name: "vpcMethod")] public virtual void VpcMethod() { InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); @@ -13703,34 +13828,34 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } /// Say farewell. - [JsiiMethod(name: "farewell", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [JsiiMethod(name: "farewell", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public virtual string Farewell() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; } /// Say goodbye. - [JsiiMethod(name: "goodbye", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [JsiiMethod(name: "goodbye", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public virtual string Goodbye() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; } /// Returns another random number. - [JsiiMethod(name: "next", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}", isOverride: true)] + [JsiiMethod(name: "next", returnsJson: "{\\"type\\":{\\"primitive\\":\\"number\\"}}")] public virtual double Next() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; } - /// (deprecated) String representation of the value. - [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + /// String representation of the value. + [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public override string ToString() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; } - /// (deprecated) The value. + /// The value. [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] public override double Value { @@ -13810,34 +13935,34 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } /// Say farewell. - [JsiiMethod(name: "farewell", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [JsiiMethod(name: "farewell", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public virtual string Farewell() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; } /// Say goodbye. - [JsiiMethod(name: "goodbye", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [JsiiMethod(name: "goodbye", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public virtual string Goodbye() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; } - /// (deprecated) Say hello! - [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + /// Say hello! + [JsiiMethod(name: "hello", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public virtual string Hello() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; } - /// (deprecated) String representation of the value. - [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + /// String representation of the value. + [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] public override string ToString() { return InvokeInstanceMethod(new System.Type[]{}, new object[]{})!; } - /// (deprecated) The value. + /// The value. [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"number\\"}")] public override double Value { @@ -13895,7 +14020,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace public class NestedStruct : Amazon.JSII.Tests.CalculatorNamespace.INestedStruct { /// When provided, must be > 0. - [JsiiProperty(name: "numberProp", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + [JsiiProperty(name: "numberProp", typeJson: "{\\"primitive\\":\\"number\\"}")] public double NumberProp { get; @@ -14117,7 +14242,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.NullShouldBeTreatedAsUndefinedData")] public class NullShouldBeTreatedAsUndefinedData : Amazon.JSII.Tests.CalculatorNamespace.INullShouldBeTreatedAsUndefinedData { - [JsiiProperty(name: "arrayWithThreeElementsAndUndefinedAsSecondArgument", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"any\\"},\\"kind\\":\\"array\\"}}", isOverride: true)] + [JsiiProperty(name: "arrayWithThreeElementsAndUndefinedAsSecondArgument", typeJson: "{\\"collection\\":{\\"elementtype\\":{\\"primitive\\":\\"any\\"},\\"kind\\":\\"array\\"}}")] public object[] ArrayWithThreeElementsAndUndefinedAsSecondArgument { get; @@ -14125,7 +14250,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "thisShouldBeUndefined", typeJson: "{\\"primitive\\":\\"any\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "thisShouldBeUndefined", typeJson: "{\\"primitive\\":\\"any\\"}", isOptional: true)] public object? ThisShouldBeUndefined { get; @@ -14458,7 +14583,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace public class OptionalStruct : Amazon.JSII.Tests.CalculatorNamespace.IOptionalStruct { [JsiiOptional] - [JsiiProperty(name: "field", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "field", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? Field { get; @@ -14631,7 +14756,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.ParentStruct982")] public class ParentStruct982 : Amazon.JSII.Tests.CalculatorNamespace.IParentStruct982 { - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Foo { get; @@ -15256,7 +15381,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.PythonSelf [JsiiByValue(fqn: "jsii-calc.PythonSelf.StructWithSelf")] public class StructWithSelf : Amazon.JSII.Tests.CalculatorNamespace.PythonSelf.IStructWithSelf { - [JsiiProperty(name: "self", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "self", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Self { get; @@ -15381,7 +15506,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace public class RootStruct : Amazon.JSII.Tests.CalculatorNamespace.IRootStruct { /// May not be empty. - [JsiiProperty(name: "stringProp", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "stringProp", typeJson: "{\\"primitive\\":\\"string\\"}")] public string StringProp { get; @@ -15389,7 +15514,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "nestedStruct", typeJson: "{\\"fqn\\":\\"jsii-calc.NestedStruct\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "nestedStruct", typeJson: "{\\"fqn\\":\\"jsii-calc.NestedStruct\\"}", isOptional: true)] public Amazon.JSII.Tests.CalculatorNamespace.INestedStruct? NestedStruct { get; @@ -15498,7 +15623,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace public class SecondLevelStruct : Amazon.JSII.Tests.CalculatorNamespace.ISecondLevelStruct { /// It's long and required. - [JsiiProperty(name: "deeperRequiredProp", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "deeperRequiredProp", typeJson: "{\\"primitive\\":\\"string\\"}")] public string DeeperRequiredProp { get; @@ -15507,7 +15632,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// It's long, but you'll almost never pass it. [JsiiOptional] - [JsiiProperty(name: "deeperOptionalProp", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "deeperOptionalProp", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? DeeperOptionalProp { get; @@ -15696,14 +15821,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.SmellyStruct")] public class SmellyStruct : Amazon.JSII.Tests.CalculatorNamespace.ISmellyStruct { - [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "property", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Property { get; set; } - [JsiiProperty(name: "yetAnoterOne", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOverride: true)] + [JsiiProperty(name: "yetAnoterOne", typeJson: "{\\"primitive\\":\\"boolean\\"}")] public bool YetAnoterOne { get; @@ -15842,7 +15967,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.StableStruct")] public class StableStruct : Amazon.JSII.Tests.CalculatorNamespace.IStableStruct { - [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "readonlyProperty", typeJson: "{\\"primitive\\":\\"string\\"}")] public string ReadonlyProperty { get; @@ -15922,7 +16047,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { } - [JsiiMethod(name: "method", isOverride: true)] + [JsiiMethod(name: "method")] public static new void Method() { InvokeStaticVoidMethod(typeof(Amazon.JSII.Tests.CalculatorNamespace.StaticHelloChild), new System.Type[]{}, new object[]{}); @@ -16163,7 +16288,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.StructA")] public class StructA : Amazon.JSII.Tests.CalculatorNamespace.IStructA { - [JsiiProperty(name: "requiredString", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "requiredString", typeJson: "{\\"primitive\\":\\"string\\"}")] public string RequiredString { get; @@ -16171,7 +16296,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "optionalNumber", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "optionalNumber", typeJson: "{\\"primitive\\":\\"number\\"}", isOptional: true)] public double? OptionalNumber { get; @@ -16179,7 +16304,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "optionalString", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "optionalString", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? OptionalString { get; @@ -16203,7 +16328,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.StructB")] public class StructB : Amazon.JSII.Tests.CalculatorNamespace.IStructB { - [JsiiProperty(name: "requiredString", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "requiredString", typeJson: "{\\"primitive\\":\\"string\\"}")] public string RequiredString { get; @@ -16211,7 +16336,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "optionalBoolean", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "optionalBoolean", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] public bool? OptionalBoolean { get; @@ -16219,7 +16344,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "optionalStructA", typeJson: "{\\"fqn\\":\\"jsii-calc.StructA\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "optionalStructA", typeJson: "{\\"fqn\\":\\"jsii-calc.StructA\\"}", isOptional: true)] public Amazon.JSII.Tests.CalculatorNamespace.IStructA? OptionalStructA { get; @@ -16246,7 +16371,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.StructParameterType")] public class StructParameterType : Amazon.JSII.Tests.CalculatorNamespace.IStructParameterType { - [JsiiProperty(name: "scope", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "scope", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Scope { get; @@ -16254,7 +16379,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "props", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "props", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOptional: true)] public bool? Props { get; @@ -16363,7 +16488,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace public class StructWithEnum : Amazon.JSII.Tests.CalculatorNamespace.IStructWithEnum { /// An enum value. - [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"jsii-calc.StringEnum\\"}", isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"fqn\\":\\"jsii-calc.StringEnum\\"}")] public Amazon.JSII.Tests.CalculatorNamespace.StringEnum Foo { get; @@ -16375,7 +16500,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// Default: AllTypesEnum.YOUR_ENUM_VALUE /// [JsiiOptional] - [JsiiProperty(name: "bar", typeJson: "{\\"fqn\\":\\"jsii-calc.AllTypesEnum\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "bar", typeJson: "{\\"fqn\\":\\"jsii-calc.AllTypesEnum\\"}", isOptional: true)] public Amazon.JSII.Tests.CalculatorNamespace.AllTypesEnum? Bar { get; @@ -16398,7 +16523,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.StructWithJavaReservedWords")] public class StructWithJavaReservedWords : Amazon.JSII.Tests.CalculatorNamespace.IStructWithJavaReservedWords { - [JsiiProperty(name: "default", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "default", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Default { get; @@ -16406,7 +16531,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "assert", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "assert", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? Assert { get; @@ -16414,7 +16539,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "result", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "result", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? Result { get; @@ -16422,7 +16547,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "that", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "that", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? That { get; @@ -16479,7 +16604,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.BackReferences [JsiiByValue(fqn: "jsii-calc.submodule.back_references.MyClassReference")] public class MyClassReference : Amazon.JSII.Tests.CalculatorNamespace.Submodule.BackReferences.IMyClassReference { - [JsiiProperty(name: "reference", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.MyClass\\"}", isOverride: true)] + [JsiiProperty(name: "reference", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.MyClass\\"}")] public Amazon.JSII.Tests.CalculatorNamespace.Submodule.MyClass Reference { get; @@ -16697,14 +16822,14 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child public class KwargsProps : Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.IKwargsProps { [JsiiOptional] - [JsiiProperty(name: "extra", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "extra", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? Extra { get; set; } - [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.child.SomeEnum\\"}", isOverride: true)] + [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.child.SomeEnum\\"}")] public Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.SomeEnum Prop { get; @@ -16787,7 +16912,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child [JsiiByValue(fqn: "jsii-calc.submodule.child.SomeStruct")] public class SomeStruct : Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.ISomeStruct { - [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.child.SomeEnum\\"}", isOverride: true)] + [JsiiProperty(name: "prop", typeJson: "{\\"fqn\\":\\"jsii-calc.submodule.child.SomeEnum\\"}")] public Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.SomeEnum Prop { get; @@ -16810,7 +16935,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child [JsiiByValue(fqn: "jsii-calc.submodule.child.Structure")] public class Structure : Amazon.JSII.Tests.CalculatorNamespace.Submodule.Child.IStructure { - [JsiiProperty(name: "bool", typeJson: "{\\"primitive\\":\\"boolean\\"}", isOverride: true)] + [JsiiProperty(name: "bool", typeJson: "{\\"primitive\\":\\"boolean\\"}")] public bool Bool { get; @@ -16837,7 +16962,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule [JsiiByValue(fqn: "jsii-calc.submodule.Default")] public class Default : Amazon.JSII.Tests.CalculatorNamespace.Submodule.IDefault { - [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"primitive\\":\\"number\\"}")] public double Foo { get; @@ -17165,7 +17290,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace.Submodule.Param [JsiiByValue(fqn: "jsii-calc.submodule.param.SpecialParameter")] public class SpecialParameter : Amazon.JSII.Tests.CalculatorNamespace.Submodule.Param.ISpecialParameter { - [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "value", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Value { get; @@ -17327,7 +17452,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace public class SupportsNiceJavaBuilderProps : Amazon.JSII.Tests.CalculatorNamespace.ISupportsNiceJavaBuilderProps { /// Some number, like 42. - [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"number\\"}", isOverride: true)] + [JsiiProperty(name: "bar", typeJson: "{\\"primitive\\":\\"number\\"}")] public double Bar { get; @@ -17339,7 +17464,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// But here we are, doing it like we didn't care. /// [JsiiOptional] - [JsiiProperty(name: "id", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "id", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? Id { get; @@ -17649,7 +17774,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace public class TopLevelStruct : Amazon.JSII.Tests.CalculatorNamespace.ITopLevelStruct { /// This is a required field. - [JsiiProperty(name: "required", typeJson: "{\\"primitive\\":\\"string\\"}", isOverride: true)] + [JsiiProperty(name: "required", typeJson: "{\\"primitive\\":\\"string\\"}")] public string Required { get; @@ -17657,7 +17782,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } /// A union to really stress test our serialization. - [JsiiProperty(name: "secondLevel", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"number\\"},{\\"fqn\\":\\"jsii-calc.SecondLevelStruct\\"}]}}", isOverride: true)] + [JsiiProperty(name: "secondLevel", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"number\\"},{\\"fqn\\":\\"jsii-calc.SecondLevelStruct\\"}]}}")] public object SecondLevel { get; @@ -17666,7 +17791,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// You don't have to pass this. [JsiiOptional] - [JsiiProperty(name: "optional", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "optional", typeJson: "{\\"primitive\\":\\"string\\"}", isOptional: true)] public string? Optional { get; @@ -17852,7 +17977,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// /// Stability: Deprecated /// - [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}", isOverride: true)] + [JsiiMethod(name: "toString", returnsJson: "{\\"type\\":{\\"primitive\\":\\"string\\"}}")] [System.Obsolete()] public override string ToString() { @@ -17876,7 +18001,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace [JsiiByValue(fqn: "jsii-calc.UnionProperties")] public class UnionProperties : Amazon.JSII.Tests.CalculatorNamespace.IUnionProperties { - [JsiiProperty(name: "bar", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"string\\"},{\\"primitive\\":\\"number\\"},{\\"fqn\\":\\"jsii-calc.AllTypes\\"}]}}", isOverride: true)] + [JsiiProperty(name: "bar", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"string\\"},{\\"primitive\\":\\"number\\"},{\\"fqn\\":\\"jsii-calc.AllTypes\\"}]}}")] public object Bar { get; @@ -17884,7 +18009,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace } [JsiiOptional] - [JsiiProperty(name: "foo", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"string\\"},{\\"primitive\\":\\"number\\"}]}}", isOptional: true, isOverride: true)] + [JsiiProperty(name: "foo", typeJson: "{\\"union\\":{\\"types\\":[{\\"primitive\\":\\"string\\"},{\\"primitive\\":\\"number\\"}]}}", isOptional: true)] public object? Foo { get; diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap index 8a5013518a..198cf3c1b8 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap @@ -2603,7 +2603,7 @@ func (j *jsiiProxy_CompositeOperation) SetStringStyle(val CompositeOperation_Com ) } -// (deprecated) String representation of the value. +// String representation of the value. func (c *jsiiProxy_CompositeOperation) ToString() *string { var returns *string @@ -3366,7 +3366,7 @@ func NewAdd_Override(a Add, lhs scopejsiicalclib.NumericValue, rhs scopejsiicalc ) } -// (deprecated) Say hello! +// Say hello! func (a *jsiiProxy_Add) Hello() *string { var returns *string @@ -3380,7 +3380,7 @@ func (a *jsiiProxy_Add) Hello() *string { return returns } -// (deprecated) String representation of the value. +// String representation of the value. func (a *jsiiProxy_Add) ToString() *string { var returns *string @@ -4224,6 +4224,50 @@ func (a *jsiiProxy_AugmentableClass) MethodTwo() { ) } +type BaseClass interface { + Property() *string + Method() *float64 +} + +// The jsii proxy struct for BaseClass +type jsiiProxy_BaseClass struct { + _ byte // padding +} + +func (j *jsiiProxy_BaseClass) Property() *string { + var returns *string + _jsii_.Get( + j, + "property", + &returns, + ) + return returns +} + + +func NewBaseClass_Override(b BaseClass) { + _init_.Initialize() + + _jsii_.Create( + "jsii-calc.BaseClass", + nil, // no parameters + b, + ) +} + +func (b *jsiiProxy_BaseClass) Method() *float64 { + var returns *float64 + + _jsii_.Invoke( + b, + "method", + nil, // no parameters + &returns, + ) + + return returns +} + type BaseJsii976 interface { } @@ -4379,7 +4423,7 @@ func NewBinaryOperation_Override(b BinaryOperation, lhs scopejsiicalclib.Numeric ) } -// (deprecated) Say hello! +// Say hello! func (b *jsiiProxy_BinaryOperation) Hello() *string { var returns *string @@ -4744,7 +4788,7 @@ func (c *jsiiProxy_Calculator) ReadUnionValue() *float64 { return returns } -// (deprecated) String representation of the value. +// String representation of the value. func (c *jsiiProxy_Calculator) ToString() *string { var returns *string @@ -6663,7 +6707,7 @@ func NewDoubleTrouble_Override(d DoubleTrouble) { ) } -// (deprecated) Say hello! +// Say hello! func (d *jsiiProxy_DoubleTrouble) Hello() *string { var returns *string @@ -7275,6 +7319,43 @@ type ExternalStruct struct { ReadonlyProperty *string \`json:"readonlyProperty" yaml:"readonlyProperty"\` } +type FullCombo interface { + BaseClass + IIndirectlyImplemented + Property() *string + Method() *float64 +} + +// The jsii proxy struct for FullCombo +type jsiiProxy_FullCombo struct { + jsiiProxy_BaseClass + jsiiProxy_IIndirectlyImplemented +} + +func (j *jsiiProxy_FullCombo) Property() *string { + var returns *string + _jsii_.Get( + j, + "property", + &returns, + ) + return returns +} + + +func (f *jsiiProxy_FullCombo) Method() *float64 { + var returns *float64 + + _jsii_.Invoke( + f, + "method", + nil, // no parameters + &returns, + ) + + return returns +} + type GiveMeStructs interface { StructLiteral() *scopejsiicalclib.StructWithOnlyOptionals DerivedToFirst(derived *DerivedStruct) *scopejsiicalclib.MyFirstStruct @@ -7804,6 +7885,39 @@ func (i *jsiiProxy_IFriendlyRandomGenerator) Next() *float64 { return returns } +type IIndirectlyImplemented interface { + Method() *float64 + Property() *string +} + +// The jsii proxy for IIndirectlyImplemented +type jsiiProxy_IIndirectlyImplemented struct { + _ byte // padding +} + +func (i *jsiiProxy_IIndirectlyImplemented) Method() *float64 { + var returns *float64 + + _jsii_.Invoke( + i, + "method", + nil, // no parameters + &returns, + ) + + return returns +} + +func (j *jsiiProxy_IIndirectlyImplemented) Property() *string { + var returns *string + _jsii_.Get( + j, + "property", + &returns, + ) + return returns +} + // awslabs/jsii#220 Abstract return type. type IInterfaceImplementedByAbstractClass interface { PropFromInterface() *string @@ -10399,7 +10513,7 @@ func (m *jsiiProxy_Multiply) Goodbye() *string { return returns } -// (deprecated) Say hello! +// Say hello! func (m *jsiiProxy_Multiply) Hello() *string { var returns *string @@ -10427,7 +10541,7 @@ func (m *jsiiProxy_Multiply) Next() *float64 { return returns } -// (deprecated) String representation of the value. +// String representation of the value. func (m *jsiiProxy_Multiply) ToString() *string { var returns *string @@ -10547,7 +10661,7 @@ func (n *jsiiProxy_Negate) Goodbye() *string { return returns } -// (deprecated) Say hello! +// Say hello! func (n *jsiiProxy_Negate) Hello() *string { var returns *string @@ -10561,7 +10675,7 @@ func (n *jsiiProxy_Negate) Hello() *string { return returns } -// (deprecated) String representation of the value. +// String representation of the value. func (n *jsiiProxy_Negate) ToString() *string { var returns *string @@ -11568,7 +11682,7 @@ func (j *jsiiProxy_Power) SetStringStyle(val composition.CompositeOperation_Comp ) } -// (deprecated) String representation of the value. +// String representation of the value. func (p *jsiiProxy_Power) ToString() *string { var returns *string @@ -13148,7 +13262,7 @@ func (j *jsiiProxy_Sum) SetStringStyle(val composition.CompositeOperation_Compos ) } -// (deprecated) String representation of the value. +// String representation of the value. func (s *jsiiProxy_Sum) ToString() *string { var returns *string @@ -14683,6 +14797,17 @@ func init() { return &jsiiProxy_AugmentableClass{} }, ) + _jsii_.RegisterClass( + "jsii-calc.BaseClass", + reflect.TypeOf((*BaseClass)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + }, + func() interface{} { + return &jsiiProxy_BaseClass{} + }, + ) _jsii_.RegisterClass( "jsii-calc.BaseJsii976", reflect.TypeOf((*BaseJsii976)(nil)).Elem(), @@ -15210,6 +15335,20 @@ func init() { "jsii-calc.ExternalStruct", reflect.TypeOf((*ExternalStruct)(nil)).Elem(), ) + _jsii_.RegisterClass( + "jsii-calc.FullCombo", + reflect.TypeOf((*FullCombo)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + }, + func() interface{} { + j := jsiiProxy_FullCombo{} + _jsii_.InitJsiiProxy(&j.jsiiProxy_BaseClass) + _jsii_.InitJsiiProxy(&j.jsiiProxy_IIndirectlyImplemented) + return &j + }, + ) _jsii_.RegisterClass( "jsii-calc.GiveMeStructs", reflect.TypeOf((*GiveMeStructs)(nil)).Elem(), @@ -15371,6 +15510,17 @@ func init() { return &j }, ) + _jsii_.RegisterInterface( + "jsii-calc.IIndirectlyImplemented", + reflect.TypeOf((*IIndirectlyImplemented)(nil)).Elem(), + []_jsii_.Member{ + _jsii_.MemberMethod{JsiiMethod: "method", GoMethod: "Method"}, + _jsii_.MemberProperty{JsiiProperty: "property", GoGetter: "Property"}, + }, + func() interface{} { + return &jsiiProxy_IIndirectlyImplemented{} + }, + ) _jsii_.RegisterInterface( "jsii-calc.IInterfaceImplementedByAbstractClass", reflect.TypeOf((*IInterfaceImplementedByAbstractClass)(nil)).Elem(), @@ -16936,7 +17086,7 @@ func (e *jsiiProxy_ExtendAndImplement) Foo(obj jcb.IBaseInterface) { ) } -// (deprecated) Say hello! +// Say hello! func (e *jsiiProxy_ExtendAndImplement) Hello() *string { var returns *string 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 ad5c61affa..c53ae547ce 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 @@ -3591,6 +3591,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 AnonymousImplementationProvider.java ┃ ┣━ 📄 AsyncVirtualMethods.java ┃ ┣━ 📄 AugmentableClass.java + ┃ ┣━ 📄 BaseClass.java ┃ ┣━ 📄 BaseJsii976.java ┃ ┣━ 📄 Bell.java ┃ ┣━ 📄 BinaryOperation.java @@ -3657,6 +3658,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 ExternalClass.java ┃ ┣━ 📄 ExternalEnum.java ┃ ┣━ 📄 ExternalStruct.java + ┃ ┣━ 📄 FullCombo.java ┃ ┣━ 📄 GiveMeStructs.java ┃ ┣━ 📄 Greetee.java ┃ ┣━ 📄 GreetingAugmenter.java @@ -3672,6 +3674,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` ┃ ┣━ 📄 IExternalInterface.java ┃ ┣━ 📄 IFriendlier.java ┃ ┣━ 📄 IFriendlyRandomGenerator.java + ┃ ┣━ 📄 IIndirectlyImplemented.java ┃ ┣━ 📄 IInterfaceImplementedByAbstractClass.java ┃ ┣━ 📄 IInterfaceThatShouldNotBeADataType.java ┃ ┣━ 📄 IInterfaceWithInternal.java @@ -4661,7 +4664,7 @@ public class Add extends software.amazon.jsii.tests.calculator.BinaryOperation { } /** - * (deprecated) String representation of the value. + * String representation of the value. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override @@ -4670,7 +4673,7 @@ public class Add extends software.amazon.jsii.tests.calculator.BinaryOperation { } /** - * (deprecated) The value. + * The value. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @@ -5377,6 +5380,59 @@ public class AugmentableClass extends software.amazon.jsii.JsiiObject { `; +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/BaseClass.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.BaseClass") +public abstract class BaseClass extends software.amazon.jsii.JsiiObject { + + protected BaseClass(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + + protected BaseClass(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { + super(initializationMode); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + protected BaseClass() { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public @org.jetbrains.annotations.NotNull java.lang.Number method() { + return software.amazon.jsii.Kernel.call(this, "method", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public @org.jetbrains.annotations.NotNull java.lang.String getProperty() { + return software.amazon.jsii.Kernel.get(this, "property", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); + } + + /** + * A proxy class which represents a concrete javascript instance of this type. + */ + @software.amazon.jsii.Internal + private static final class Jsii$Proxy extends software.amazon.jsii.tests.calculator.BaseClass { + protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + } +} + +`; + exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/BaseJsii976.java 1`] = ` package software.amazon.jsii.tests.calculator; @@ -5489,7 +5545,7 @@ public abstract class BinaryOperation extends software.amazon.jsii.tests.calcula } /** - * (deprecated) Say hello! + * Say hello! */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override @@ -9436,7 +9492,7 @@ public class DoubleTrouble extends software.amazon.jsii.JsiiObject implements so } /** - * (deprecated) Say hello! + * Say hello! */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override @@ -10615,6 +10671,27 @@ public interface ExternalStruct extends software.amazon.jsii.JsiiSerializable { `; +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/FullCombo.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.FullCombo") +public class FullCombo extends software.amazon.jsii.tests.calculator.BaseClass implements software.amazon.jsii.tests.calculator.IIndirectlyImplemented { + + protected FullCombo(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + + protected FullCombo(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { + super(initializationMode); + } +} + +`; + exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/GiveMeStructs.java 1`] = ` package software.amazon.jsii.tests.calculator; @@ -11815,6 +11892,79 @@ public interface IFriendlyRandomGenerator extends software.amazon.jsii.JsiiSeria `; +exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/IIndirectlyImplemented.java 1`] = ` +package software.amazon.jsii.tests.calculator; + +/** + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.IIndirectlyImplemented") +@software.amazon.jsii.Jsii.Proxy(IIndirectlyImplemented.Jsii$Proxy.class) +@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) +public interface IIndirectlyImplemented extends software.amazon.jsii.JsiiSerializable { + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @org.jetbrains.annotations.NotNull java.lang.String getProperty(); + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @org.jetbrains.annotations.NotNull java.lang.Number method(); + + /** + * A proxy class which represents a concrete javascript instance of this type. + */ + @software.amazon.jsii.Internal + final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements software.amazon.jsii.tests.calculator.IIndirectlyImplemented.Jsii$Default { + protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + + /** + */ + @Override + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + public final @org.jetbrains.annotations.NotNull java.lang.String getProperty() { + return software.amazon.jsii.Kernel.get(this, "property", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @Override + public final @org.jetbrains.annotations.NotNull java.lang.Number method() { + return software.amazon.jsii.Kernel.call(this, "method", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); + } + } + + /** + * Internal default implementation for {@link IIndirectlyImplemented}. + */ + @software.amazon.jsii.Internal + interface Jsii$Default extends IIndirectlyImplemented { + + /** + */ + @Override + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + default @org.jetbrains.annotations.NotNull java.lang.String getProperty() { + return software.amazon.jsii.Kernel.get(this, "property", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); + } + + /** + */ + @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) + @Override + default @org.jetbrains.annotations.NotNull java.lang.Number method() { + return software.amazon.jsii.Kernel.call(this, "method", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); + } + } +} + +`; + exports[`Generated code for "jsii-calc": /java/src/main/java/software/amazon/jsii/tests/calculator/IInterfaceImplementedByAbstractClass.java 1`] = ` package software.amazon.jsii.tests.calculator; @@ -15876,7 +16026,7 @@ public class Multiply extends software.amazon.jsii.tests.calculator.BinaryOperat } /** - * (deprecated) String representation of the value. + * String representation of the value. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override @@ -15885,7 +16035,7 @@ public class Multiply extends software.amazon.jsii.tests.calculator.BinaryOperat } /** - * (deprecated) The value. + * The value. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @@ -15943,7 +16093,7 @@ public class Negate extends software.amazon.jsii.tests.calculator.UnaryOperation } /** - * (deprecated) Say hello! + * Say hello! */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override @@ -15952,7 +16102,7 @@ public class Negate extends software.amazon.jsii.tests.calculator.UnaryOperation } /** - * (deprecated) String representation of the value. + * String representation of the value. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override @@ -15961,7 +16111,7 @@ public class Negate extends software.amazon.jsii.tests.calculator.UnaryOperation } /** - * (deprecated) The value. + * The value. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @@ -21939,7 +22089,7 @@ public abstract class CompositeOperation extends software.amazon.jsii.tests.calc } /** - * (deprecated) String representation of the value. + * String representation of the value. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override @@ -21956,7 +22106,7 @@ public abstract class CompositeOperation extends software.amazon.jsii.tests.calc public abstract @org.jetbrains.annotations.NotNull software.amazon.jsii.tests.calculator.lib.NumericValue getExpression(); /** - * (deprecated) The value. + * The value. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @@ -22526,7 +22676,7 @@ public class ExtendAndImplement extends software.amazon.jsii.tests.calculator.li } /** - * (deprecated) Say hello! + * Say hello! */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override @@ -25674,6 +25824,7 @@ jsii-calc.AmbiguousParameters=software.amazon.jsii.tests.calculator.AmbiguousPar jsii-calc.AnonymousImplementationProvider=software.amazon.jsii.tests.calculator.AnonymousImplementationProvider jsii-calc.AsyncVirtualMethods=software.amazon.jsii.tests.calculator.AsyncVirtualMethods jsii-calc.AugmentableClass=software.amazon.jsii.tests.calculator.AugmentableClass +jsii-calc.BaseClass=software.amazon.jsii.tests.calculator.BaseClass jsii-calc.BaseJsii976=software.amazon.jsii.tests.calculator.BaseJsii976 jsii-calc.Bell=software.amazon.jsii.tests.calculator.Bell jsii-calc.BinaryOperation=software.amazon.jsii.tests.calculator.BinaryOperation @@ -25733,6 +25884,7 @@ jsii-calc.ExtendsInternalInterface=software.amazon.jsii.tests.calculator.Extends jsii-calc.ExternalClass=software.amazon.jsii.tests.calculator.ExternalClass jsii-calc.ExternalEnum=software.amazon.jsii.tests.calculator.ExternalEnum jsii-calc.ExternalStruct=software.amazon.jsii.tests.calculator.ExternalStruct +jsii-calc.FullCombo=software.amazon.jsii.tests.calculator.FullCombo jsii-calc.GiveMeStructs=software.amazon.jsii.tests.calculator.GiveMeStructs jsii-calc.Greetee=software.amazon.jsii.tests.calculator.Greetee jsii-calc.GreetingAugmenter=software.amazon.jsii.tests.calculator.GreetingAugmenter @@ -25748,6 +25900,7 @@ jsii-calc.IExtendsPrivateInterface=software.amazon.jsii.tests.calculator.IExtend jsii-calc.IExternalInterface=software.amazon.jsii.tests.calculator.IExternalInterface jsii-calc.IFriendlier=software.amazon.jsii.tests.calculator.IFriendlier jsii-calc.IFriendlyRandomGenerator=software.amazon.jsii.tests.calculator.IFriendlyRandomGenerator +jsii-calc.IIndirectlyImplemented=software.amazon.jsii.tests.calculator.IIndirectlyImplemented jsii-calc.IInterfaceImplementedByAbstractClass=software.amazon.jsii.tests.calculator.IInterfaceImplementedByAbstractClass jsii-calc.IInterfaceThatShouldNotBeADataType=software.amazon.jsii.tests.calculator.IInterfaceThatShouldNotBeADataType jsii-calc.IInterfaceWithInternal=software.amazon.jsii.tests.calculator.IInterfaceWithInternal 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 f618f261c7..806b543cfa 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 @@ -3017,6 +3017,27 @@ class AugmentableClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Augmentable return typing.cast(None, jsii.invoke(self, "methodTwo", [])) +class BaseClass(metaclass=jsii.JSIIAbstractClass, jsii_type="jsii-calc.BaseClass"): + def __init__(self) -> None: + jsii.create(self.__class__, self, []) + + @jsii.member(jsii_name="method") + def method(self) -> jsii.Number: + return typing.cast(jsii.Number, jsii.invoke(self, "method", [])) + + @builtins.property # type: ignore[misc] + @jsii.member(jsii_name="property") + def property(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "property")) + + +class _BaseClassProxy(BaseClass): + pass + +# Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class +typing.cast(typing.Any, BaseClass).__jsii_proxy_class__ = lambda : _BaseClassProxy + + class BaseJsii976(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.BaseJsii976"): def __init__(self) -> None: jsii.create(self.__class__, self, []) @@ -3044,7 +3065,7 @@ class BinaryOperation( @jsii.member(jsii_name="hello") def hello(self) -> builtins.str: - '''(deprecated) Say hello!''' + '''Say hello!''' return typing.cast(builtins.str, jsii.invoke(self, "hello", [])) @builtins.property # type: ignore[misc] @@ -5645,6 +5666,34 @@ class _IFriendlierProxy( typing.cast(typing.Any, IFriendlier).__jsii_proxy_class__ = lambda : _IFriendlierProxy +@jsii.interface(jsii_type="jsii-calc.IIndirectlyImplemented") +class IIndirectlyImplemented(typing_extensions.Protocol): + @builtins.property # type: ignore[misc] + @jsii.member(jsii_name="property") + def property(self) -> builtins.str: + ... + + @jsii.member(jsii_name="method") + def method(self) -> jsii.Number: + ... + + +class _IIndirectlyImplementedProxy: + __jsii_type__: typing.ClassVar[str] = "jsii-calc.IIndirectlyImplemented" + + @builtins.property # type: ignore[misc] + @jsii.member(jsii_name="property") + def property(self) -> builtins.str: + return typing.cast(builtins.str, jsii.get(self, "property")) + + @jsii.member(jsii_name="method") + def method(self) -> jsii.Number: + return typing.cast(jsii.Number, jsii.invoke(self, "method", [])) + +# Adding a "__jsii_proxy_class__(): typing.Type" function to the interface +typing.cast(typing.Any, IIndirectlyImplemented).__jsii_proxy_class__ = lambda : _IIndirectlyImplementedProxy + + @jsii.interface(jsii_type="jsii-calc.IInterfaceImplementedByAbstractClass") class IInterfaceImplementedByAbstractClass(typing_extensions.Protocol): '''awslabs/jsii#220 Abstract return type.''' @@ -7154,13 +7203,13 @@ class Multiply( @jsii.member(jsii_name="toString") def to_string(self) -> builtins.str: - '''(deprecated) String representation of the value.''' + '''String representation of the value.''' return typing.cast(builtins.str, jsii.invoke(self, "toString", [])) @builtins.property # type: ignore[misc] @jsii.member(jsii_name="value") def value(self) -> jsii.Number: - '''(deprecated) The value.''' + '''The value.''' return typing.cast(jsii.Number, jsii.get(self, "value")) @@ -9547,13 +9596,13 @@ class Add(BinaryOperation, metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Add"): @jsii.member(jsii_name="toString") def to_string(self) -> builtins.str: - '''(deprecated) String representation of the value.''' + '''String representation of the value.''' return typing.cast(builtins.str, jsii.invoke(self, "toString", [])) @builtins.property # type: ignore[misc] @jsii.member(jsii_name="value") def value(self) -> jsii.Number: - '''(deprecated) The value.''' + '''The value.''' return typing.cast(jsii.Number, jsii.get(self, "value")) @@ -9758,6 +9807,11 @@ class ClassWithPrivateConstructorAndAutomaticProperties( jsii.set(self, "readWriteString", value) +@jsii.implements(IIndirectlyImplemented) +class FullCombo(BaseClass, metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.FullCombo"): + pass + + @jsii.interface(jsii_type="jsii-calc.IFriendlyRandomGenerator") class IFriendlyRandomGenerator( IRandomNumberGenerator, @@ -9906,18 +9960,18 @@ class Negate(UnaryOperation, metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Negat @jsii.member(jsii_name="hello") def hello(self) -> builtins.str: - '''(deprecated) Say hello!''' + '''Say hello!''' return typing.cast(builtins.str, jsii.invoke(self, "hello", [])) @jsii.member(jsii_name="toString") def to_string(self) -> builtins.str: - '''(deprecated) String representation of the value.''' + '''String representation of the value.''' return typing.cast(builtins.str, jsii.invoke(self, "toString", [])) @builtins.property # type: ignore[misc] @jsii.member(jsii_name="value") def value(self) -> jsii.Number: - '''(deprecated) The value.''' + '''The value.''' return typing.cast(jsii.Number, jsii.get(self, "value")) @@ -9976,7 +10030,7 @@ class DoubleTrouble(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DoubleTrouble" @jsii.member(jsii_name="hello") def hello(self) -> builtins.str: - '''(deprecated) Say hello!''' + '''Say hello!''' return typing.cast(builtins.str, jsii.invoke(self, "hello", [])) @jsii.member(jsii_name="next") @@ -9998,6 +10052,7 @@ __all__ = [ "AnonymousImplementationProvider", "AsyncVirtualMethods", "AugmentableClass", + "BaseClass", "BaseJsii976", "Bell", "BinaryOperation", @@ -10055,6 +10110,7 @@ __all__ = [ "ExternalClass", "ExternalEnum", "ExternalStruct", + "FullCombo", "GiveMeStructs", "Greetee", "GreetingAugmenter", @@ -10070,6 +10126,7 @@ __all__ = [ "IExternalInterface", "IFriendlier", "IFriendlyRandomGenerator", + "IIndirectlyImplemented", "IInterfaceImplementedByAbstractClass", "IInterfaceThatShouldNotBeADataType", "IInterfaceWithInternal", @@ -10417,7 +10474,7 @@ class CompositeOperation( @jsii.member(jsii_name="toString") def to_string(self) -> builtins.str: - '''(deprecated) String representation of the value.''' + '''String representation of the value.''' return typing.cast(builtins.str, jsii.invoke(self, "toString", [])) @builtins.property # type: ignore[misc] @@ -10433,7 +10490,7 @@ class CompositeOperation( @builtins.property # type: ignore[misc] @jsii.member(jsii_name="value") def value(self) -> jsii.Number: - '''(deprecated) The value.''' + '''The value.''' return typing.cast(jsii.Number, jsii.get(self, "value")) @builtins.property # type: ignore[misc] @@ -10803,7 +10860,7 @@ class ExtendAndImplement( @jsii.member(jsii_name="hello") def hello(self) -> builtins.str: - '''(deprecated) Say hello!''' + '''Say hello!''' return typing.cast(builtins.str, jsii.invoke(self, "hello", [])) @jsii.member(jsii_name="localMethod") diff --git a/packages/jsii-pacmak/test/generated-code/requirements-dev.txt b/packages/jsii-pacmak/test/generated-code/requirements-dev.txt index efc630cf1d..57f68db256 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.930 +mypy==0.931 diff --git a/packages/jsii-reflect/bin/jsii-tree.ts b/packages/jsii-reflect/bin/jsii-tree.ts index 619174661d..07bf2faa25 100644 --- a/packages/jsii-reflect/bin/jsii-tree.ts +++ b/packages/jsii-reflect/bin/jsii-tree.ts @@ -1,6 +1,6 @@ import '@jsii/check-node/run'; -import * as colors from 'colors/safe'; +import * as chalk from 'chalk'; import * as yargs from 'yargs'; import { TypeSystem, TypeSystemTree } from '../lib'; @@ -109,6 +109,6 @@ async function main() { } main().catch((e) => { - console.log(colors.red(e)); + console.log(chalk.red(e)); process.exit(1); }); diff --git a/packages/jsii-reflect/lib/tree.ts b/packages/jsii-reflect/lib/tree.ts index 4e8a976eca..6533c509fa 100644 --- a/packages/jsii-reflect/lib/tree.ts +++ b/packages/jsii-reflect/lib/tree.ts @@ -1,5 +1,6 @@ import { Stability } from '@jsii/spec'; -import * as colors from 'colors/safe'; +// eslint-disable-next-line @typescript-eslint/no-require-imports +import chalk = require('chalk'); import { AsciiTree } from 'oo-ascii-tree'; import { Assembly } from './assembly'; @@ -98,7 +99,7 @@ export class TypeSystemTree extends AsciiTree { class AssemblyNode extends AsciiTree { public constructor(assembly: Assembly, options: TypeSystemTreeOptions) { - super(colors.green(assembly.name)); + super(chalk.green(assembly.name)); if (options.dependencies && assembly.dependencies.length > 0) { const deps = new TitleNode('dependencies'); @@ -129,7 +130,7 @@ class AssemblyNode extends AsciiTree { class SubmoduleNode extends AsciiTree { public constructor(submodule: Submodule, options: TypeSystemTreeOptions) { - super(colors.green(submodule.name)); + super(chalk.green(submodule.name)); const submodules = submodule.submodules; if (submodules.length > 0) { @@ -154,7 +155,7 @@ class MethodNode extends AsciiTree { public constructor(method: Method, options: TypeSystemTreeOptions) { const args = method.parameters.map((p) => p.name).join(','); super( - `${maybeStatic(method)}${method.name}(${args}) ${colors.gray( + `${maybeStatic(method)}${method.name}(${args}) ${chalk.gray( 'method', )}${describeStability(method, options)}`, ); @@ -197,7 +198,7 @@ class InitializerNode extends AsciiTree { public constructor(initializer: Initializer, options: TypeSystemTreeOptions) { const args = initializer.parameters.map((p) => p.name).join(','); super( - `${initializer.name}(${args}) ${colors.gray( + `${initializer.name}(${args}) ${chalk.gray( 'initializer', )}${describeStability(initializer, options)}`, ); @@ -236,7 +237,7 @@ class ParameterNode extends AsciiTree { class PropertyNode extends AsciiTree { public constructor(property: Property, options: TypeSystemTreeOptions) { super( - `${maybeStatic(property)}${property.name} ${colors.gray( + `${maybeStatic(property)}${property.name} ${chalk.gray( 'property', )}${describeStability(property, options)}`, ); @@ -277,14 +278,14 @@ class OptionalValueNode extends AsciiTree { if (asPromise) { type = `Promise<${type}>`; } - super(`${colors.underline(name)}: ${type}`); + super(`${chalk.underline(name)}: ${type}`); } } class ClassNode extends AsciiTree { public constructor(type: ClassType, options: TypeSystemTreeOptions) { super( - `${colors.gray('class')} ${colors.cyan(type.name)}${describeStability( + `${chalk.gray('class')} ${chalk.cyan(type.name)}${describeStability( type, options, )}`, @@ -320,7 +321,7 @@ class ClassNode extends AsciiTree { class InterfaceNode extends AsciiTree { public constructor(type: InterfaceType, options: TypeSystemTreeOptions) { super( - `${colors.gray('interface')} ${colors.cyan(type.name)}${describeStability( + `${chalk.gray('interface')} ${chalk.cyan(type.name)}${describeStability( type, options, )}`, @@ -346,7 +347,7 @@ class InterfaceNode extends AsciiTree { class EnumNode extends AsciiTree { public constructor(enumType: EnumType, options: TypeSystemTreeOptions) { super( - `${colors.gray('enum')} ${colors.cyan(enumType.name)}${describeStability( + `${chalk.gray('enum')} ${chalk.cyan(enumType.name)}${describeStability( enumType, options, )}`, @@ -368,13 +369,13 @@ class DependencyNode extends AsciiTree { class TitleNode extends AsciiTree { public constructor(name: string, children: AsciiTree[] = []) { - super(colors.underline(name), ...children); + super(chalk.underline(name), ...children); } } class KeyValueNode extends AsciiTree { public constructor(key: string, value: any) { - super(`${colors.underline(key)}: ${value}`); + super(`${chalk.underline(key)}: ${value}`); } } @@ -382,7 +383,7 @@ class TextNode extends AsciiTree {} class FlagNode extends AsciiTree { public constructor(flag: string) { - super(colors.italic(flag)); + super(chalk.italic(flag)); } } @@ -390,21 +391,15 @@ class FlagNode extends AsciiTree { * Invokes `block` with colors enabled/disabled and reverts to old value afterwards. */ function withColors(enabled: boolean, block: () => void) { - const oldEnabled = colors.enabled; + const oldLevel = chalk.level; try { - if (enabled) { - colors.enable(); - } else { - colors.disable(); + if (!enabled) { + chalk.level = 0; // No colors at all } block(); } finally { - if (oldEnabled) { - colors.enable(); - } else { - colors.disable(); - } + chalk.level = oldLevel; } } @@ -418,13 +413,13 @@ function describeStability( switch (thing.docs.stability) { case Stability.Stable: - return ` (${colors.green('stable')})`; + return ` (${chalk.green('stable')})`; case Stability.External: - return ` (${colors.green('external')})`; + return ` (${chalk.green('external')})`; case Stability.Experimental: - return ` (${colors.yellow('experimental')})`; + return ` (${chalk.yellow('experimental')})`; case Stability.Deprecated: - return ` (${colors.red('deprecated')})`; + return ` (${chalk.red('deprecated')})`; default: return ''; } @@ -439,5 +434,5 @@ function maybeStatic(mem: Property | Method) { isStatic = !!mem.static; } - return isStatic ? `${colors.grey('static')} ` : ''; + return isStatic ? `${chalk.grey('static')} ` : ''; } diff --git a/packages/jsii-reflect/package.json b/packages/jsii-reflect/package.json index c19454e36d..851d569b13 100644 --- a/packages/jsii-reflect/package.json +++ b/packages/jsii-reflect/package.json @@ -36,7 +36,7 @@ "dependencies": { "@jsii/check-node": "0.0.0", "@jsii/spec": "^0.0.0", - "colors": "1.4.0", + "chalk": "^4", "fs-extra": "^9.1.0", "oo-ascii-tree": "^0.0.0", "yargs": "^16.2.0" @@ -44,10 +44,10 @@ "devDependencies": { "@scope/jsii-calc-lib": "^0.0.0", "@types/fs-extra": "^9.0.13", - "@types/jest": "^27.0.3", - "@types/node": "^12.20.39", - "eslint": "^8.5.0", - "jest": "^27.4.5", + "@types/jest": "^27.4.0", + "@types/node": "^12.20.43", + "eslint": "^8.8.0", + "jest": "^27.4.7", "jsii": "^0.0.0", "jsii-build-tools": "^0.0.0", "jsii-calc": "^3.20.120", 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 c669dc5c8b..5aa58e66c2 100644 --- a/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/jsii-tree.test.ts.snap @@ -718,6 +718,14 @@ exports[`jsii-tree --all 1`] = ` │ │ │ └── returns: void │ │ └─┬ methodTwo() method (stable) │ │ └── returns: void + │ ├─┬ class BaseClass (stable) + │ │ └─┬ members + │ │ ├── () initializer (stable) + │ │ ├─┬ method() method (stable) + │ │ │ └── returns: number + │ │ └─┬ property property (stable) + │ │ ├── immutable + │ │ └── type: string │ ├─┬ class BaseJsii976 (stable) │ │ └─┬ members │ │ └── () initializer (stable) @@ -1252,6 +1260,10 @@ exports[`jsii-tree --all 1`] = ` │ │ │ └── type: string │ │ └─┬ mutableProperty property (stable) │ │ └── type: Optional + │ ├─┬ class FullCombo (stable) + │ │ ├── base: BaseClass + │ │ ├── interfaces: IIndirectlyImplemented + │ │ └── members │ ├─┬ class GiveMeStructs (stable) │ │ └─┬ members │ │ ├── () initializer (stable) @@ -2612,6 +2624,15 @@ exports[`jsii-tree --all 1`] = ` │ │ │ ├── IRandomNumberGenerator │ │ │ └── IFriendly │ │ └── members + │ ├─┬ interface IIndirectlyImplemented (stable) + │ │ └─┬ members + │ │ ├─┬ method() method (stable) + │ │ │ ├── abstract + │ │ │ └── returns: number + │ │ └─┬ property property (stable) + │ │ ├── abstract + │ │ ├── immutable + │ │ └── type: string │ ├─┬ interface IInterfaceImplementedByAbstractClass (stable) │ │ └─┬ members │ │ └─┬ propFromInterface property (stable) @@ -3416,6 +3437,7 @@ exports[`jsii-tree --inheritance 1`] = ` │ │ └── interfaces: IAnonymousImplementationProvider │ ├── class AsyncVirtualMethods │ ├── class AugmentableClass + │ ├── class BaseClass │ ├── class BaseJsii976 │ ├─┬ class Bell │ │ └── interfaces: IBell @@ -3463,6 +3485,9 @@ exports[`jsii-tree --inheritance 1`] = ` │ ├── class ExperimentalClass │ ├── class ExportedBaseClass │ ├── class ExternalClass + │ ├─┬ class FullCombo + │ │ ├── base: BaseClass + │ │ └── interfaces: IIndirectlyImplemented │ ├── class GiveMeStructs │ ├── class GreetingAugmenter │ ├── class ImplementInternalInterface @@ -3607,6 +3632,7 @@ exports[`jsii-tree --inheritance 1`] = ` │ │ └─┬ interfaces │ │ ├── IRandomNumberGenerator │ │ └── IFriendly + │ ├── interface IIndirectlyImplemented │ ├── interface IInterfaceImplementedByAbstractClass │ ├─┬ interface IInterfaceThatShouldNotBeADataType │ │ └─┬ interfaces @@ -4098,6 +4124,11 @@ exports[`jsii-tree --members 1`] = ` │ │ ├── () initializer │ │ ├── methodOne() method │ │ └── methodTwo() method + │ ├─┬ class BaseClass + │ │ └─┬ members + │ │ ├── () initializer + │ │ ├── method() method + │ │ └── property property │ ├─┬ class BaseJsii976 │ │ └─┬ members │ │ └── () initializer @@ -4312,6 +4343,8 @@ exports[`jsii-tree --members 1`] = ` │ │ ├── method() method │ │ ├── readonlyProperty property │ │ └── mutableProperty property + │ ├─┬ class FullCombo + │ │ └── members │ ├─┬ class GiveMeStructs │ │ └─┬ members │ │ ├── () initializer @@ -4908,6 +4941,10 @@ exports[`jsii-tree --members 1`] = ` │ │ └── goodbye() method │ ├─┬ interface IFriendlyRandomGenerator │ │ └── members + │ ├─┬ interface IIndirectlyImplemented + │ │ └─┬ members + │ │ ├── method() method + │ │ └── property property │ ├─┬ interface IInterfaceImplementedByAbstractClass │ │ └─┬ members │ │ └── propFromInterface property @@ -5397,6 +5434,7 @@ exports[`jsii-tree --types 1`] = ` │ ├── class AnonymousImplementationProvider │ ├── class AsyncVirtualMethods │ ├── class AugmentableClass + │ ├── class BaseClass │ ├── class BaseJsii976 │ ├── class Bell │ ├── class BinaryOperation @@ -5435,6 +5473,7 @@ exports[`jsii-tree --types 1`] = ` │ ├── class ExperimentalClass │ ├── class ExportedBaseClass │ ├── class ExternalClass + │ ├── class FullCombo │ ├── class GiveMeStructs │ ├── class GreetingAugmenter │ ├── class ImplementInternalInterface @@ -5543,6 +5582,7 @@ exports[`jsii-tree --types 1`] = ` │ ├── interface IExternalInterface │ ├── interface IFriendlier │ ├── interface IFriendlyRandomGenerator + │ ├── interface IIndirectlyImplemented │ ├── interface IInterfaceImplementedByAbstractClass │ ├── interface IInterfaceThatShouldNotBeADataType │ ├── interface IInterfaceWithInternal diff --git a/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap index 3cfc31f733..e69a0d7e27 100644 --- a/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/tree.test.ts.snap @@ -868,6 +868,14 @@ exports[`showAll 1`] = ` │ │ │ └── returns: void │ │ └─┬ methodTwo() method │ │ └── returns: void + │ ├─┬ class BaseClass + │ │ └─┬ members + │ │ ├── () initializer + │ │ ├─┬ method() method + │ │ │ └── returns: number + │ │ └─┬ property property + │ │ ├── immutable + │ │ └── type: string │ ├─┬ class BaseJsii976 │ │ └─┬ members │ │ └── () initializer @@ -1402,6 +1410,10 @@ exports[`showAll 1`] = ` │ │ │ └── type: string │ │ └─┬ mutableProperty property │ │ └── type: Optional + │ ├─┬ class FullCombo + │ │ ├── base: BaseClass + │ │ ├── interfaces: IIndirectlyImplemented + │ │ └── members │ ├─┬ class GiveMeStructs │ │ └─┬ members │ │ ├── () initializer @@ -2762,6 +2774,15 @@ exports[`showAll 1`] = ` │ │ │ ├── IRandomNumberGenerator │ │ │ └── IFriendly │ │ └── members + │ ├─┬ interface IIndirectlyImplemented + │ │ └─┬ members + │ │ ├─┬ method() method + │ │ │ ├── abstract + │ │ │ └── returns: number + │ │ └─┬ property property + │ │ ├── abstract + │ │ ├── immutable + │ │ └── type: string │ ├─┬ interface IInterfaceImplementedByAbstractClass │ │ └─┬ members │ │ └─┬ propFromInterface property @@ -3579,6 +3600,7 @@ exports[`types 1`] = ` │ ├── class AnonymousImplementationProvider │ ├── class AsyncVirtualMethods │ ├── class AugmentableClass + │ ├── class BaseClass │ ├── class BaseJsii976 │ ├── class Bell │ ├── class BinaryOperation @@ -3617,6 +3639,7 @@ exports[`types 1`] = ` │ ├── class ExperimentalClass │ ├── class ExportedBaseClass │ ├── class ExternalClass + │ ├── class FullCombo │ ├── class GiveMeStructs │ ├── class GreetingAugmenter │ ├── class ImplementInternalInterface @@ -3725,6 +3748,7 @@ exports[`types 1`] = ` │ ├── interface IExternalInterface │ ├── interface IFriendlier │ ├── interface IFriendlyRandomGenerator + │ ├── interface IIndirectlyImplemented │ ├── interface IInterfaceImplementedByAbstractClass │ ├── interface IInterfaceThatShouldNotBeADataType │ ├── interface IInterfaceWithInternal diff --git a/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap b/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap index f2b4fcd0ae..193d887b35 100644 --- a/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap +++ b/packages/jsii-reflect/test/__snapshots__/type-system.test.ts.snap @@ -33,6 +33,7 @@ Array [ "jsii-calc.AnonymousImplementationProvider", "jsii-calc.AsyncVirtualMethods", "jsii-calc.AugmentableClass", + "jsii-calc.BaseClass", "jsii-calc.BaseJsii976", "jsii-calc.Bell", "jsii-calc.BinaryOperation", @@ -73,6 +74,7 @@ Array [ "jsii-calc.ExperimentalClass", "jsii-calc.ExportedBaseClass", "jsii-calc.ExternalClass", + "jsii-calc.FullCombo", "jsii-calc.GiveMeStructs", "jsii-calc.GreetingAugmenter", "jsii-calc.ImplementInternalInterface", diff --git a/packages/jsii-reflect/test/jsii-tree.test.ts b/packages/jsii-reflect/test/jsii-tree.test.ts index 5e2112a0a3..f5ff07412a 100644 --- a/packages/jsii-reflect/test/jsii-tree.test.ts +++ b/packages/jsii-reflect/test/jsii-tree.test.ts @@ -26,7 +26,7 @@ async function jsiiTree(...args: string[]) { process.execPath, ...process.execArgv, path.join(__dirname, '..', 'bin', 'jsii-tree'), - args.join(' '), + ...args, '--no-colors', path.dirname(require.resolve('jsii-calc/package.json')), ].join(' '); diff --git a/packages/jsii-rosetta/README.md b/packages/jsii-rosetta/README.md index 7b1e32c7a8..6139d4b9cb 100644 --- a/packages/jsii-rosetta/README.md +++ b/packages/jsii-rosetta/README.md @@ -44,20 +44,14 @@ someObject.someMethod('foo', { ### Enforcing correct examples By default, Rosetta will accept non-compiling examples. If you set -`jsii.metadata.jsii.rosetta.strict` to `true` in your `package.json`, +`jsiiRosetta.strict` to `true` in your `package.json`, the Rosetta command will fail if any example contains an error: ```js /// package.json { - "jsii": { - "metadata": { - "jsii": { - "rosetta": { - "strict": true - } - } - } + "jsiiRosetta": { + "strict": true } } ``` @@ -114,6 +108,32 @@ To specify fixtures in an `@example` block, use an accompanying `@exampleMetadat */ ```` +### Dependencies + +When compiling examples, Rosetta will make sure your package itself and all of +its `dependencies` and `peerDependencies` are available in the dependency +closure that your examples will be compiled in. + +If there are packages you want to use in an example that should *not* be part +of your package's dependencies, declare them in `jsiiRosetta.exampleDependencies` +in your `package.json`: + +```js +/// package.json +{ + "jsiiRosetta": { + "exampleDependencies": { + "@some-other/package": "^1.2.3", + "@yet-another/package": "*", + } + } +} +``` + +You can also set up a directory with correct dependencies yourself, and pass +`--directory` when running `jsii-rosetta extract`. We recommend using the +automatic closure building mechanism and specifying `exampleDependencies` though. + ## Rosetta for package publishers This section describes how Rosetta integrates into your build process. diff --git a/packages/jsii-rosetta/bin/jsii-rosetta.ts b/packages/jsii-rosetta/bin/jsii-rosetta.ts index 39df072af2..0d2948ac0e 100644 --- a/packages/jsii-rosetta/bin/jsii-rosetta.ts +++ b/packages/jsii-rosetta/bin/jsii-rosetta.ts @@ -238,20 +238,13 @@ function main() { args.fail = args.f = true; } - // Easiest way to get a fixed working directory (for sources) in is to - // chdir, since underneath the in-memory layer we're using a regular TS - // compilerhost. Have to make all file references absolute before we chdir - // though. const absAssemblies = (args.ASSEMBLY.length > 0 ? args.ASSEMBLY : ['.']).map((x) => path.resolve(x)); const absCacheFrom = fmap(args.cache ?? args['cache-from'], path.resolve); const absCacheTo = fmap(args.cache ?? args['cache-to'] ?? args.output, path.resolve); - if (args.directory) { - process.chdir(args.directory); - } - const extractOptions: ExtractOptions = { + compilationDirectory: args.directory, includeCompilerDiagnostics: !!args.compile, validateAssemblies: args['validate-assemblies'], only: args.include, diff --git a/packages/jsii-rosetta/lib/commands/coverage.ts b/packages/jsii-rosetta/lib/commands/coverage.ts index d7fb57b0d9..d223e41262 100644 --- a/packages/jsii-rosetta/lib/commands/coverage.ts +++ b/packages/jsii-rosetta/lib/commands/coverage.ts @@ -7,7 +7,7 @@ export async function checkCoverage(assemblyLocations: readonly string[]): Promi logging.info(`Loading ${assemblyLocations.length} assemblies`); const assemblies = await loadAssemblies(assemblyLocations, false); - const snippets = Array.from(allTypeScriptSnippets(assemblies, true)); + const snippets = Array.from(await allTypeScriptSnippets(assemblies, true)); const translator = new RosettaTranslator({ assemblies: assemblies.map((a) => a.assembly), diff --git a/packages/jsii-rosetta/lib/commands/extract.ts b/packages/jsii-rosetta/lib/commands/extract.ts index 2d0105af59..949c2007e7 100644 --- a/packages/jsii-rosetta/lib/commands/extract.ts +++ b/packages/jsii-rosetta/lib/commands/extract.ts @@ -44,6 +44,14 @@ export interface ExtractOptions { */ readonly writeToImplicitTablets?: boolean; + /** + * What directory to compile the samples in + * + * @default - Rosetta manages the compilation directory + * @deprecated Samples declare their own dependencies instead + */ + readonly compilationDirectory?: string; + /** * Make a translator (just for testing) */ @@ -88,7 +96,7 @@ export async function extractSnippets( logging.info(`Loading ${assemblyLocations.length} assemblies`); const assemblies = await loadAssemblies(assemblyLocations, options.validateAssemblies ?? false); - let snippets = Array.from(allTypeScriptSnippets(assemblies, options.loose)); + let snippets = Array.from(await allTypeScriptSnippets(assemblies, options.loose)); if (only.length > 0) { snippets = filterSnippets(snippets, only); } diff --git a/packages/jsii-rosetta/lib/commands/infuse.ts b/packages/jsii-rosetta/lib/commands/infuse.ts index 4820309c9e..183977b3d8 100644 --- a/packages/jsii-rosetta/lib/commands/infuse.ts +++ b/packages/jsii-rosetta/lib/commands/infuse.ts @@ -75,7 +75,7 @@ export async function infuse(assemblyLocations: string[], options?: InfuseOption } availableTranslations.addTablets(...Object.values(defaultTablets)); - const { translationsByFqn, originalsByKey } = availableSnippetsPerFqn(assemblies, availableTranslations); + const { translationsByFqn, originalsByKey } = await availableSnippetsPerFqn(assemblies, availableTranslations); const additionalOutputTablet = options?.cacheToFile ? await LanguageTablet.fromOptionalFile(options?.cacheToFile) @@ -244,10 +244,10 @@ function insertExample( * * Returns a map of fqns to a list of keys that represent snippets that include the fqn. */ -function availableSnippetsPerFqn(asms: readonly LoadedAssembly[], translationsTablet: LanguageTablet) { +async function availableSnippetsPerFqn(asms: readonly LoadedAssembly[], translationsTablet: LanguageTablet) { const ret = new DefaultRecord(); - const originalsByKey = indexBy(allTypeScriptSnippets(asms), snippetKey); + const originalsByKey = indexBy(await allTypeScriptSnippets(asms), snippetKey); const translations = Object.keys(originalsByKey) .map((key) => translationsTablet.tryGetSnippet(key)) diff --git a/packages/jsii-rosetta/lib/commands/transliterate.ts b/packages/jsii-rosetta/lib/commands/transliterate.ts index ea6904a683..5878c1d9ad 100644 --- a/packages/jsii-rosetta/lib/commands/transliterate.ts +++ b/packages/jsii-rosetta/lib/commands/transliterate.ts @@ -6,6 +6,7 @@ import { TargetLanguage } from '../languages'; import { debug } from '../logging'; import { RosettaTabletReader, UnknownSnippetMode } from '../rosetta-reader'; import { typeScriptSnippetFromVisibleSource, ApiLocation } from '../snippet'; +import { Mutable } from '../util'; import { extractSnippets } from './extract'; export interface TransliterateAssemblyOptions { @@ -136,7 +137,6 @@ async function loadAssemblies( return result; } -type Mutable = { -readonly [K in keyof T]: Mutable }; type AssemblyLoader = () => Promise>; function transliterateType(type: Type, rosetta: RosettaTabletReader, language: TargetLanguage): void { diff --git a/packages/jsii-rosetta/lib/commands/trim-cache.ts b/packages/jsii-rosetta/lib/commands/trim-cache.ts index f22ce4aa81..de87328489 100644 --- a/packages/jsii-rosetta/lib/commands/trim-cache.ts +++ b/packages/jsii-rosetta/lib/commands/trim-cache.ts @@ -20,7 +20,7 @@ export async function trimCache(options: TrimCacheOptions): Promise { logging.info(`Loading ${options.assemblyLocations.length} assemblies`); const assemblies = await loadAssemblies(options.assemblyLocations, false); - const snippets = Array.from(allTypeScriptSnippets(assemblies)); + const snippets = Array.from(await allTypeScriptSnippets(assemblies)); const original = await LanguageTablet.fromFile(options.cacheFile); const updated = new LanguageTablet(); diff --git a/packages/jsii-rosetta/lib/find-utils.ts b/packages/jsii-rosetta/lib/find-utils.ts new file mode 100644 index 0000000000..77c29907cd --- /dev/null +++ b/packages/jsii-rosetta/lib/find-utils.ts @@ -0,0 +1,82 @@ +import * as fs from 'fs-extra'; +import * as path from 'path'; + +/** + * Find the directory that contains a given dependency, identified by its 'package.json', from a starting search directory + * + * (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(dependencyName: string, searchStart: string) { + // Explicitly do not use 'require("dep/package.json")' because that will fail if the + // package does not export that particular file. + const entryPoint = require.resolve(dependencyName, { + paths: [searchStart], + }); + + // 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(dependencyName, path.dirname(entryPoint)); + + if (!depPkgJsonPath) { + throw new Error(`Could not find dependency '${dependencyName}' from '${searchStart}'`); + } + + return depPkgJsonPath; +} + +/** + * Find the package.json for a given package upwards from the given directory + * + * (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) => { + const pjFile = path.join(dir, 'package.json'); + return (await fs.pathExists(pjFile)) && (await fs.readJson(pjFile)).name === packageName; + }); +} + +/** + * Find a directory up the tree from a starting directory matching a condition + * + * Will return `undefined` if no directory matches + * + * (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 | Promise, +): Promise | string | undefined { + const result = pred(directory); + if (result instanceof Promise) { + return result.then((thisDirectory) => (thisDirectory ? directory : recurse())); + } + + return result ? directory : recurse(); + + function recurse() { + const parent = path.dirname(directory); + if (parent === directory) { + return undefined; + } + return findUp(parent, pred as any); + } +} + +/** + * Whether the given dependency is a built-in + * + * Some dependencies that occur in `package.json` are also built-ins in modern Node + * versions (most egregious example: 'punycode'). Detect those and filter them out. + */ +export function isBuiltinModule(depName: string) { + // eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires + const { builtinModules } = require('module'); + return (builtinModules ?? []).includes(depName); +} diff --git a/packages/jsii-rosetta/lib/jsii/assemblies.ts b/packages/jsii-rosetta/lib/jsii/assemblies.ts index 68c63cd855..f9edbb06a6 100644 --- a/packages/jsii-rosetta/lib/jsii/assemblies.ts +++ b/packages/jsii-rosetta/lib/jsii/assemblies.ts @@ -3,6 +3,7 @@ import * as crypto from 'crypto'; import * as fs from 'fs-extra'; import * as path from 'path'; +import { findDependencyDirectory, isBuiltinModule } from '../find-utils'; import { fixturize } from '../fixtures'; import { extractTypescriptSnippetsFromMarkdown } from '../markdown/extract-snippets'; import { @@ -12,6 +13,7 @@ import { SnippetParameters, ApiLocation, parseMetadataLine, + CompilationDependency, INITIALIZER_METHOD_NAME, } from '../snippet'; import { enforcesStrictMode } from '../strict'; @@ -37,9 +39,17 @@ const sortJson = require('sort-json'); */ export const EXAMPLE_METADATA_JSDOCTAG = 'exampleMetadata'; +interface RosettaPackageJson extends spec.PackageJson { + readonly jsiiRosetta?: { + readonly strict?: boolean; + readonly exampleDependencies?: Record; + }; +} + export interface LoadedAssembly { readonly assembly: spec.Assembly; readonly directory: string; + readonly packageJson?: RosettaPackageJson; } /** @@ -57,10 +67,15 @@ export async function loadAssemblies( return loadAssembly(path.join(location, '.jsii')); } - return { - assembly: await loadAssemblyFromFile(location, validateAssemblies), - directory: path.dirname(location), - }; + const directory = path.dirname(location); + const pjLocation = path.join(directory, 'package.json'); + + const [assembly, packageJson] = await Promise.all([ + loadAssemblyFromFile(location, validateAssemblies), + (await fs.pathExists(pjLocation)) ? fs.readJSON(pjLocation, { encoding: 'utf-8' }) : Promise.resolve(undefined), + ]); + + return { assembly, directory, packageJson }; } } @@ -171,36 +186,50 @@ export function allSnippetSources(assembly: spec.Assembly): AssemblySnippetSourc } } -export function allTypeScriptSnippets(assemblies: readonly LoadedAssembly[], loose = false): TypeScriptSnippet[] { - const ret = new Array(); - - for (const { assembly, directory } of assemblies) { - const strict = enforcesStrictMode(assembly); - for (const source of allSnippetSources(assembly)) { - switch (source.type) { - case 'example': - // If an example is an infused example, we do not care about compiler errors. - // We are relying on the tablet cache to have this example stored already. - const [strictForExample, looseForExample] = - source.metadata?.infused !== undefined ? [false, true] : [strict, loose]; - const location = { api: source.location, field: { field: 'example' } } as const; - const snippet = updateParameters(typeScriptSnippetFromSource(source.source, location, strictForExample), { - [SnippetParameters.$PROJECT_DIRECTORY]: directory, - ...source.metadata, - }); - ret.push(fixturize(snippet, looseForExample)); - break; - case 'markdown': - for (const snippet of extractTypescriptSnippetsFromMarkdown(source.markdown, source.location, strict)) { - const withDirectory = updateParameters(snippet, { - [SnippetParameters.$PROJECT_DIRECTORY]: directory, - }); - ret.push(fixturize(withDirectory, loose)); - } - } - } - } - return ret; +export async function allTypeScriptSnippets( + assemblies: readonly LoadedAssembly[], + loose = false, +): Promise { + return Promise.all( + assemblies + .flatMap((loaded) => allSnippetSources(loaded.assembly).map((source) => ({ source, loaded }))) + .flatMap(({ source, loaded }) => { + switch (source.type) { + case 'example': + return [ + { + snippet: updateParameters( + typeScriptSnippetFromSource( + source.source, + { api: source.location, field: { field: 'example' } }, + isStrict(loaded), + ), + source.metadata ?? {}, + ), + loaded, + }, + ]; + case 'markdown': + return extractTypescriptSnippetsFromMarkdown(source.markdown, source.location, isStrict(loaded)).map( + (snippet) => ({ snippet, loaded }), + ); + } + }) + .map(async ({ snippet, loaded }) => { + const isInfused = snippet.parameters?.infused != null; + + // Ignore fixturization errors if requested on this command, or if the snippet was infused + const ignoreFixtureErrors = loose || isInfused; + + // Also if the snippet was infused: switch off 'strict' mode if it was set + if (isInfused) { + snippet = { ...snippet, strict: false }; + } + + snippet = await withDependencies(loaded, withProjectDirectory(loaded.directory, snippet)); + return fixturize(snippet, ignoreFixtureErrors); + }), + ); } /** @@ -318,3 +347,75 @@ export function findContainingSubmodule(assembly: spec.Assembly, fqn: string): s } return undefined; } + +function withProjectDirectory(dir: string, snippet: TypeScriptSnippet) { + return updateParameters(snippet, { + [SnippetParameters.$PROJECT_DIRECTORY]: dir, + }); +} + +/** + * Return a TypeScript snippet with dependencies added + * + * The dependencies will be taken from the package.json, and will consist of: + * + * - The package itself + * - The package's dependencies and peerDependencies + * - Any additional dependencies declared in `jsiiRosetta.exampleDependencies`. + */ +async function withDependencies(asm: LoadedAssembly, snippet: TypeScriptSnippet): Promise { + const compilationDependencies: Record = {}; + + compilationDependencies[asm.assembly.name] = { + type: 'concrete', + resolvedDirectory: await fs.realpath(asm.directory), + }; + + Object.assign( + compilationDependencies, + mkDict( + await Promise.all( + Object.keys({ ...asm.packageJson?.dependencies, ...asm.packageJson?.peerDependencies }) + .filter((name) => !isBuiltinModule(name)) + .filter( + (name) => + !asm.packageJson?.bundledDependencies?.includes(name) && + !asm.packageJson?.bundleDependencies?.includes(name), + ) + .map( + async (name) => + [ + name, + { + type: 'concrete', + resolvedDirectory: await fs.realpath(await findDependencyDirectory(name, asm.directory)), + }, + ] as const, + ), + ), + ), + ); + + Object.assign( + compilationDependencies, + mkDict( + Object.entries(asm.packageJson?.jsiiRosetta?.exampleDependencies ?? {}).map( + ([name, versionRange]) => [name, { type: 'symbolic', versionRange }] as const, + ), + ), + ); + + return { + ...snippet, + compilationDependencies, + }; +} + +/** + * Whether samples in the assembly should be treated as strict + * + * True if the strict flag is found in the package.json (modern) or the assembly itself (legacy). + */ +function isStrict(loaded: LoadedAssembly) { + return loaded.packageJson?.jsiiRosetta?.strict ?? enforcesStrictMode(loaded.assembly); +} diff --git a/packages/jsii-rosetta/lib/jsii/packages.ts b/packages/jsii-rosetta/lib/jsii/packages.ts index 9aa5e2ec61..b1daae3fa6 100644 --- a/packages/jsii-rosetta/lib/jsii/packages.ts +++ b/packages/jsii-rosetta/lib/jsii/packages.ts @@ -1,45 +1,4 @@ import * as spec from '@jsii/spec'; -import * as fs from 'fs'; -import * as path from 'path'; - -/** - * Resolve a package name in an example to a JSII assembly - * - * We assume we've changed directory to the directory where we need to resolve from. - */ -export function resolvePackage(packageName: string) { - try { - const resolved = require.resolve(`${packageName}/package.json`, { - paths: [process.cwd()], - }); - // eslint-disable-next-line @typescript-eslint/no-require-imports - return require(resolved); - } catch { - return undefined; - } -} - -/** - * Find an enclosing package.json file given a filename - * - * Will return `undefined` if a package.json could not be found. - */ -export function findPackageJson(fileName: string) { - // eslint-disable-next-line no-constant-condition - while (true) { - const candidatePath = path.join(fileName, 'package.json'); - if (fs.existsSync(candidatePath)) { - // eslint-disable-next-line @typescript-eslint/no-require-imports - return require(path.resolve(candidatePath)); - } - - const parent = path.dirname(fileName); - if (parent === fileName) { - return undefined; - } - fileName = parent; - } -} export function jsiiTargetParameter(target: spec.Targetable, field: string) { const path = field.split('.'); diff --git a/packages/jsii-rosetta/lib/rosetta-reader.ts b/packages/jsii-rosetta/lib/rosetta-reader.ts index 77f981c800..f8e4b80d0a 100644 --- a/packages/jsii-rosetta/lib/rosetta-reader.ts +++ b/packages/jsii-rosetta/lib/rosetta-reader.ts @@ -162,7 +162,7 @@ export class RosettaTabletReader { // Inventarize the snippets from this assembly, but only if there's a chance // we're going to need them. if (this.unknownSnippets === UnknownSnippetMode.TRANSLATE) { - for (const tsnip of allTypeScriptSnippets([{ assembly, directory: assemblyDir }], this.loose)) { + for (const tsnip of await allTypeScriptSnippets([{ assembly, directory: assemblyDir }], this.loose)) { this.extractedSnippets.set(snippetKey(tsnip), tsnip); } } diff --git a/packages/jsii-rosetta/lib/rosetta-translator.ts b/packages/jsii-rosetta/lib/rosetta-translator.ts index 047db93de0..e1914165f4 100644 --- a/packages/jsii-rosetta/lib/rosetta-translator.ts +++ b/packages/jsii-rosetta/lib/rosetta-translator.ts @@ -1,9 +1,11 @@ import * as spec from '@jsii/spec'; +import * as fs from 'fs-extra'; import { TypeFingerprinter } from './jsii/fingerprinting'; import { TARGET_LANGUAGES } from './languages'; import * as logging from './logging'; import { TypeScriptSnippet, completeSource } from './snippet'; +import { collectDependencies, validateAvailableDependencies, prepareDependencyDirectory } from './snippet-dependencies'; import { snippetKey } from './tablets/key'; import { LanguageTablet, TranslatedSnippet } from './tablets/tablets'; import { translateAll, TranslateAllResult } from './translate_all'; @@ -154,14 +156,49 @@ export class RosettaTranslator { }; } - public async translateAll(snippets: TypeScriptSnippet[], addToTablet = true): Promise { - const result = await translateAll(snippets, this.includeCompilerDiagnostics); + public async translateAll(snippets: TypeScriptSnippet[], addToTablet?: boolean): Promise; + public async translateAll(snippets: TypeScriptSnippet[], options?: TranslateAllOptions): Promise; + public async translateAll( + snippets: TypeScriptSnippet[], + optionsOrAddToTablet?: boolean | TranslateAllOptions, + ): Promise { + const options = + optionsOrAddToTablet && typeof optionsOrAddToTablet === 'object' + ? optionsOrAddToTablet + : { addToTablet: optionsOrAddToTablet }; + + const exampleDependencies = collectDependencies(snippets); + + let compilationDirectory; + let cleanCompilationDir = false; + if (options?.compilationDirectory) { + // If the user provided a directory, we're going to trust-but-confirm. + await validateAvailableDependencies(options.compilationDirectory, exampleDependencies); + compilationDirectory = options.compilationDirectory; + } else { + compilationDirectory = await prepareDependencyDirectory(exampleDependencies); + cleanCompilationDir = true; + } + + const origDir = process.cwd(); + // Easiest way to get a fixed working directory (for sources) in is to chdir + process.chdir(compilationDirectory); + + let result; + try { + result = await translateAll(snippets, this.includeCompilerDiagnostics); + } finally { + process.chdir(origDir); + if (cleanCompilationDir) { + await fs.remove(compilationDirectory); + } + } const fingerprinted = result.translatedSnippets.map((snippet) => snippet.withFingerprint(this.fingerprinter.fingerprintAll(snippet.fqnsReferenced())), ); - if (addToTablet) { + if (options?.addToTablet ?? true) { for (const translation of fingerprinted) { this.tablet.addSnippet(translation); } @@ -261,3 +298,15 @@ export interface ReadFromCacheResults { readonly dirtyTypesCount: number; readonly dirtyDidntCompile: number; } + +export interface TranslateAllOptions { + /** + * @default - Create a temporary directory with all necessary packages + */ + readonly compilationDirectory?: string; + + /** + * @default true + */ + readonly addToTablet?: boolean; +} diff --git a/packages/jsii-rosetta/lib/snippet-dependencies.ts b/packages/jsii-rosetta/lib/snippet-dependencies.ts new file mode 100644 index 0000000000..a21ace6710 --- /dev/null +++ b/packages/jsii-rosetta/lib/snippet-dependencies.ts @@ -0,0 +1,246 @@ +import * as cp from 'child_process'; +import * as fastGlob from 'fast-glob'; +import * as fs from 'fs-extra'; +import * as os from 'os'; +import * as path from 'path'; +import * as semver from 'semver'; +import { intersect } from 'semver-intersect'; + +import { findDependencyDirectory, findUp } from './find-utils'; +import * as logging from './logging'; +import { TypeScriptSnippet, CompilationDependency } from './snippet'; +import { mkDict, formatList } from './util'; + +/** + * Collect the dependencies of a bunch of snippets together in one declaration + * + * We assume here the dependencies will not conflict. + */ +export function collectDependencies(snippets: TypeScriptSnippet[]) { + const ret: Record = {}; + for (const snippet of snippets) { + for (const [name, source] of Object.entries(snippet.compilationDependencies ?? {})) { + ret[name] = resolveConflict(name, source, ret[name]); + } + } + return ret; +} + +function resolveConflict( + name: string, + a: CompilationDependency, + b: CompilationDependency | undefined, +): CompilationDependency { + if (!b) { + return a; + } + + if (a.type === 'concrete' && b.type === 'concrete') { + if (b.resolvedDirectory !== a.resolvedDirectory) { + throw new Error(`Dependency conflict: ${name} can be either ${a.resolvedDirectory} or ${b.resolvedDirectory}`); + } + return a; + } + + if (a.type === 'symbolic' && b.type === 'symbolic') { + // Intersect the ranges + return { + type: 'symbolic', + versionRange: intersect(a.versionRange, b.versionRange), + }; + } + + if (a.type === 'concrete' && b.type === 'symbolic') { + const concreteVersion: string = fs.readJsonSync(path.join(a.resolvedDirectory, 'package.json')).version; + + if (!semver.satisfies(concreteVersion, b.versionRange)) { + throw new Error( + `Dependency conflict: ${name} expected to match ${b.versionRange} but found ${concreteVersion} at ${a.resolvedDirectory}`, + ); + } + + return a; + } + + if (a.type === 'symbolic' && b.type === 'concrete') { + // Reverse roles so we fall into the previous case + return resolveConflict(name, b, a); + } + + throw new Error('Cases should have been exhaustive'); +} + +/** + * Check that the directory we were given has all the necessary dependencies in it + * + * It's a warning if this is not true, not an error. + */ +export async function validateAvailableDependencies(directory: string, deps: Record) { + const failures = await Promise.all( + Object.entries(deps).flatMap(async ([name, _dep]) => { + try { + await findDependencyDirectory(name, directory); + return []; + } catch { + return [name]; + } + }), + ); + + if (failures.length > 0) { + logging.warn( + `${directory}: packages necessary to compile examples missing from supplied directory: ${failures.join(', ')}`, + ); + } +} + +/** + * Prepare a temporary directory with symlinks to all the dependencies we need. + * + * - Symlinks the concrete dependencies + * - Tries to first find the symbolic dependencies in a potential monorepo that might be present + * (try both `lerna` and `yarn` monorepos). + * - Installs the remaining symbolic dependencies using 'npm'. + */ +export async function prepareDependencyDirectory(deps: Record): Promise { + const concreteDirs = Object.values(deps) + .filter(isConcrete) + .map((x) => x.resolvedDirectory); + const monorepoPackages = await scanMonoRepos(concreteDirs); + + const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'rosetta')); + logging.info(`Preparing dependency closure at ${tmpDir}`); + + // Resolved symbolic packages against monorepo + const resolvedDeps = mkDict( + Object.entries(deps).map(([name, dep]) => [ + name, + dep.type === 'concrete' + ? dep + : ((monorepoPackages[name] + ? { type: 'concrete', resolvedDirectory: monorepoPackages[name] } + : dep) as CompilationDependency), + ]), + ); + + // Use 'npm install' only for the symbolic packages. For the concrete packages, + // npm is going to try and find transitive dependencies as well and it won't know + // about monorepos. + const symbolicInstalls = Object.entries(resolvedDeps).flatMap(([name, dep]) => + isSymbolic(dep) ? [`${name}@${dep.versionRange}`] : [], + ); + const linkedInstalls = mkDict( + Object.entries(resolvedDeps).flatMap(([name, dep]) => + isConcrete(dep) ? [[name, dep.resolvedDirectory] as const] : [], + ), + ); + + // Run 'npm install' on it + if (symbolicInstalls.length > 0) { + logging.debug(`Installing example dependencies: ${symbolicInstalls.join(' ')}`); + cp.execSync(`npm install ${symbolicInstalls.join(' ')}`, { cwd: tmpDir, encoding: 'utf-8' }); + } + + // Symlink the rest + if (Object.keys(linkedInstalls).length > 0) { + logging.debug(`Symlinking example dependencies: ${Object.values(linkedInstalls).join(' ')}`); + const modDir = path.join(tmpDir, 'node_modules'); + await Promise.all( + Object.entries(linkedInstalls).map(async ([name, source]) => { + const target = path.join(modDir, name); + if (!(await fs.pathExists(target))) { + // Package could be namespaced, so ensure the namespace dir exists + await fs.mkdirp(path.dirname(target)); + await fs.symlink(source, target, 'dir'); + } + }), + ); + } + + return tmpDir; +} + +/** + * Map package name to directory + */ +async function scanMonoRepos(startingDirs: readonly string[]): Promise> { + const globs = new Set(); + for (const dir of startingDirs) { + // eslint-disable-next-line no-await-in-loop + setExtend(globs, await findMonoRepoGlobs(dir)); + } + + if (globs.size === 0) { + return {}; + } + + logging.debug(`Monorepo package sources: ${Array.from(globs).join(', ')}`); + + const packageDirectories = await fastGlob(Array.from(globs).map(windowsToUnix), { onlyDirectories: true }); + const results = mkDict( + ( + await Promise.all( + packageDirectories.map(async (directory) => { + const pjLocation = path.join(directory, 'package.json'); + return (await fs.pathExists(pjLocation)) + ? [[(await fs.readJson(pjLocation)).name as string, directory] as const] + : []; + }), + ) + ).flat(), + ); + + logging.debug(`Found ${Object.keys(results).length} packages in monorepo: ${formatList(Object.keys(results))}`); + return results; +} + +async function findMonoRepoGlobs(startingDir: string): Promise> { + const ret = new Set(); + + // Lerna monorepo + const lernaJsonDir = await findUp(startingDir, async (dir) => fs.pathExists(path.join(dir, 'lerna.json'))); + if (lernaJsonDir) { + const lernaJson = await fs.readJson(path.join(lernaJsonDir, 'lerna.json')); + for (const glob of lernaJson?.packages ?? []) { + ret.add(path.join(lernaJsonDir, glob)); + } + } + + // Yarn monorepo + const yarnWsDir = await findUp( + startingDir, + async (dir) => + (await fs.pathExists(path.join(dir, 'package.json'))) && + (await fs.readJson(path.join(dir, 'package.json')))?.workspaces !== undefined, + ); + if (yarnWsDir) { + const yarnWs = await fs.readJson(path.join(yarnWsDir, 'package.json')); + for (const glob of yarnWs.workspaces?.packages ?? []) { + ret.add(path.join(yarnWsDir, glob)); + } + } + + return ret; +} + +function isSymbolic(x: CompilationDependency): x is Extract { + return x.type === 'symbolic'; +} + +function isConcrete(x: CompilationDependency): x is Extract { + return x.type === 'concrete'; +} + +function setExtend(xs: Set, ys: Set) { + for (const y of ys) { + xs.add(y); + } + return xs; +} + +/** + * Necessary for fastGlob + */ +function windowsToUnix(x: string) { + return x.replace(/\\/g, '/'); +} diff --git a/packages/jsii-rosetta/lib/snippet.ts b/packages/jsii-rosetta/lib/snippet.ts index 0b4348ba9b..33a7753ac4 100644 --- a/packages/jsii-rosetta/lib/snippet.ts +++ b/packages/jsii-rosetta/lib/snippet.ts @@ -30,8 +30,22 @@ export interface TypeScriptSnippet { * @default false */ readonly strict?: boolean; + + /** + * Dependencies necessary to compile this snippet + * + * Value is a regular { name -> semver } map like NPM's `dependencies`, + * `devDependencies` etc. + * + * @default none + */ + readonly compilationDependencies?: Record; } +export type CompilationDependency = + | { readonly type: 'concrete'; readonly resolvedDirectory: string } + | { readonly type: 'symbolic'; readonly versionRange: string }; + /** * Description of a location where the snippet is found * @@ -279,6 +293,20 @@ export enum SnippetParameters { */ LITERATE_SOURCE = 'lit', + /** + * This snippet has been infused + * + * This means it has been copied from a different location, and potentially + * even from a different assembly. If so, we can't expect it to compile in + * the future, and if doesn't, we ignore the errors. + * + * N.B: this shouldn't make a difference in normal operation, as the `infuse` + * command will duplicate the translation to the target tablet. This only + * matters if we remove the tablet and try to re-extract an assembly with + * infused examples from somewher else. + */ + INFUSED = 'infused', + /** * What directory to resolve fixtures in for this snippet (system parameter) * diff --git a/packages/jsii-rosetta/lib/tablets/tablets.ts b/packages/jsii-rosetta/lib/tablets/tablets.ts index 85c515ffa4..40fd85f0d4 100644 --- a/packages/jsii-rosetta/lib/tablets/tablets.ts +++ b/packages/jsii-rosetta/lib/tablets/tablets.ts @@ -4,7 +4,7 @@ import * as path from 'path'; import { TargetLanguage } from '../languages'; import * as logging from '../logging'; import { TypeScriptSnippet, SnippetLocation, completeSource } from '../snippet'; -import { mapValues } from '../util'; +import { mapValues, Mutable } from '../util'; import { snippetKey } from './key'; import { TabletSchema, TranslatedSnippetSchema, ORIGINAL_SNIPPET_KEY } from './schema'; @@ -282,5 +282,3 @@ export interface Translation { language: string; didCompile?: boolean; } - -type Mutable = { -readonly [P in keyof T]: Mutable }; diff --git a/packages/jsii-rosetta/lib/util.ts b/packages/jsii-rosetta/lib/util.ts index 93ba9d7fd6..d35dd1d375 100644 --- a/packages/jsii-rosetta/lib/util.ts +++ b/packages/jsii-rosetta/lib/util.ts @@ -24,6 +24,12 @@ export function printDiagnostics(diags: readonly RosettaDiagnostic[], stream: No } } +export function formatList(xs: string[], n = 5) { + const tooMany = xs.length - n; + + return tooMany > 0 ? `${xs.slice(0, n).join(', ')} (and ${tooMany} more)` : xs.join(', '); +} + export const StrictBrand = 'jsii.strict'; interface MaybeStrictDiagnostic { readonly [StrictBrand]?: boolean; @@ -206,6 +212,8 @@ export function indexBy(xs: A[], fn: (x: A) => string): Record { return mkDict(xs.map((x) => [fn(x), x] as const)); } +export type Mutable = { -readonly [P in keyof T]: Mutable }; + export function commentToken(language: string) { // This is future-proofed a bit, but don't read too much in this... switch (language) { diff --git a/packages/jsii-rosetta/package.json b/packages/jsii-rosetta/package.json index ebf15f9842..d1d36fb666 100644 --- a/packages/jsii-rosetta/package.json +++ b/packages/jsii-rosetta/package.json @@ -18,12 +18,13 @@ "devDependencies": { "@types/commonmark": "^0.27.5", "@types/fs-extra": "^9.0.13", - "@types/jest": "^27.0.3", + "@types/jest": "^27.4.0", "@types/mock-fs": "^4.13.1", - "@types/node": "^12.20.39", + "@types/node": "^12.20.43", "@types/workerpool": "^6.1.0", - "eslint": "^8.5.0", - "jest": "^27.4.5", + "@types/semver": "^7.3.9", + "eslint": "^8.8.0", + "jest": "^27.4.7", "jsii-build-tools": "0.0.0", "memory-streams": "^0.1.3", "mock-fs": "^5.1.2", @@ -37,8 +38,11 @@ "typescript": "~3.9.10", "sort-json": "^2.0.0", "@xmldom/xmldom": "^0.8.0", - "workerpool": "^6.1.5", + "workerpool": "^6.2.0", "yargs": "^16.2.0", + "semver": "^7.3.5", + "semver-intersect": "^1.4.0", + "fast-glob": "^3.2.7", "jsii": "0.0.0" }, "license": "Apache-2.0", diff --git a/packages/jsii-rosetta/test/commands/extract.test.ts b/packages/jsii-rosetta/test/commands/extract.test.ts index 51406b4629..1fae776890 100644 --- a/packages/jsii-rosetta/test/commands/extract.test.ts +++ b/packages/jsii-rosetta/test/commands/extract.test.ts @@ -1,4 +1,5 @@ import * as fs from 'fs-extra'; +import { compileJsiiForTest } from 'jsii'; import * as path from 'path'; import { @@ -12,8 +13,11 @@ import { import * as extract from '../../lib/commands/extract'; import { loadAssemblies } from '../../lib/jsii/assemblies'; import { TARGET_LANGUAGES } from '../../lib/languages'; +import * as logging from '../../lib/logging'; import { TestJsiiModule, DUMMY_JSII_CONFIG, testSnippetLocation } from '../testutil'; +jest.setTimeout(30_000); + const DUMMY_README = ` Here is an example of how to use ClassA: @@ -440,8 +444,8 @@ describe('infused examples', () => { 'index.ts': ` /** * ClassA - * - * @exampleMetadata infused + * + * @exampleMetadata infused * @example x */ export class ClassA { @@ -520,13 +524,106 @@ describe('infused examples', () => { }); }); +test('can use additional dependencies from monorepo', async () => { + logging.configure({ level: logging.Level.VERBOSE }); + const asm = await TestJsiiModule.fromSource( + { + 'index.ts': ` + /** + * Class to hold values + * + * @example + * import { ValueHolder } from 'my_assembly'; + * import { SomeClass } from 'otherModule'; + * new ValueHolder(new SomeClass()); + */ + export class ValueHolder { + constructor(public readonly theValue: any) { } + } + `, + }, + { + name: 'my_assembly', + jsii: DUMMY_JSII_CONFIG, + jsiiRosetta: { + exampleDependencies: { + // This relies on the fact that Rosetta will find the package in the monorepo + otherModule: '*', + }, + }, + }, + ); + try { + // GIVEN - install some random other module + await asm.workspace.addDependency( + await compileJsiiForTest( + { + 'index.ts': 'export class SomeClass { }', + }, + { + packageJson: { + name: 'otherModule', + }, + }, + ), + ); + // GIVEN - a lerna.json that would find that package + await fs.writeJson(path.join(asm.workspaceDirectory, 'lerna.json'), { + packages: ['node_modules/*'], + }); + + // WHEN + await extract.extractSnippets([asm.moduleDirectory], defaultExtractOptions); + // THEN -- did not throw an error + } finally { + await asm.cleanup(); + } +}); + +test('can use additional dependencies from NPM', async () => { + const asm = await TestJsiiModule.fromSource( + { + 'index.ts': ` + /** + * Class to hold values + * + * @example + * import { ValueHolder } from 'my_assembly'; + * import { ConstructOrder } from 'constructs'; + * new ValueHolder(ConstructOrder.PREORDER); + */ + export class ValueHolder { + constructor(public readonly theValue: any) { } + } + `, + }, + { + name: 'my_assembly', + jsii: DUMMY_JSII_CONFIG, + jsiiRosetta: { + exampleDependencies: { + // This relies on the fact that Rosetta will find the package in the monorepo + constructs: '^10.0.0', + }, + }, + }, + ); + try { + // WHEN + await extract.extractSnippets([asm.moduleDirectory], defaultExtractOptions); + // THEN -- did not throw an error + } finally { + await asm.cleanup(); + } +}); + test('infused examples have no diagnostics', async () => { const otherAssembly = await TestJsiiModule.fromSource( { 'index.ts': ` /** * ClassA - * + * * @exampleMetadata infused * @example x */ diff --git a/packages/jsii-rosetta/test/commands/infuse.test.ts b/packages/jsii-rosetta/test/commands/infuse.test.ts index 8962d0522f..f8e8b7c316 100644 --- a/packages/jsii-rosetta/test/commands/infuse.test.ts +++ b/packages/jsii-rosetta/test/commands/infuse.test.ts @@ -8,6 +8,8 @@ import { infuse, DEFAULT_INFUSION_RESULTS_NAME } from '../../lib/commands/infuse import { loadAssemblies } from '../../lib/jsii/assemblies'; import { TestJsiiModule, DUMMY_JSII_CONFIG } from '../testutil'; +jest.setTimeout(30_000); + const DUMMY_README = ` Here is an example of how to use ClassA: diff --git a/packages/jsii-rosetta/test/jsii/assemblies.test.ts b/packages/jsii-rosetta/test/jsii/assemblies.test.ts index 97878d9a9f..a5cf9d0d7a 100644 --- a/packages/jsii-rosetta/test/jsii/assemblies.test.ts +++ b/packages/jsii-rosetta/test/jsii/assemblies.test.ts @@ -8,9 +8,9 @@ import { SnippetParameters } from '../../lib/snippet'; import { TestJsiiModule, DUMMY_JSII_CONFIG } from '../testutil'; import { fakeAssembly } from './fake-assembly'; -test('Extract snippet from README', () => { +test('Extract snippet from README', async () => { const snippets = Array.from( - allTypeScriptSnippets([ + await allTypeScriptSnippets([ { assembly: fakeAssembly({ readme: { @@ -25,9 +25,9 @@ test('Extract snippet from README', () => { expect(snippets[0].visibleSource).toEqual('someExample();'); }); -test('Extract snippet from submodule READMEs', () => { +test('Extract snippet from submodule READMEs', async () => { const snippets = Array.from( - allTypeScriptSnippets([ + await allTypeScriptSnippets([ { assembly: fakeAssembly({ submodules: { @@ -46,9 +46,9 @@ test('Extract snippet from submodule READMEs', () => { expect(snippets[0].visibleSource).toEqual('someExample();'); }); -test('Extract snippet from type docstring', () => { +test('Extract snippet from type docstring', async () => { const snippets = Array.from( - allTypeScriptSnippets([ + await allTypeScriptSnippets([ { assembly: fakeAssembly({ types: { @@ -72,9 +72,9 @@ test('Extract snippet from type docstring', () => { expect(snippets[0].visibleSource).toEqual('someExample();'); }); -test('Snippet can include fixture', () => { +test('Snippet can include fixture', async () => { const snippets = Array.from( - allTypeScriptSnippets([ + await allTypeScriptSnippets([ { assembly: fakeAssembly({ readme: { @@ -109,9 +109,9 @@ test('Snippet can include fixture', () => { `); }); -test('Use fixture from example', () => { +test('Use fixture from example', async () => { const snippets = Array.from( - allTypeScriptSnippets([ + await allTypeScriptSnippets([ { assembly: fakeAssembly({ types: { @@ -148,9 +148,9 @@ test('Use fixture from example', () => { expect(snippets[0].visibleSource).toEqual('someExample();'); }); -test('Fixture allows use of import statements', () => { +test('Fixture allows use of import statements', async () => { const snippets = Array.from( - allTypeScriptSnippets([ + await allTypeScriptSnippets([ { assembly: fakeAssembly({ types: { @@ -198,14 +198,14 @@ test('Fixture allows use of import statements', () => { ); }); -test('Backwards compatibility with literate integ tests', () => { +test('Backwards compatibility with literate integ tests', async () => { mockfs({ '/package/test/integ.example.lit.ts': '# Some literate source file', }); try { const snippets = Array.from( - allTypeScriptSnippets([ + await allTypeScriptSnippets([ { assembly: fakeAssembly({ readme: { @@ -262,7 +262,9 @@ test('rosetta fixture from submodule is preferred if it exists', async () => { 'dont pick me\n/// here', ); - const snippets = allTypeScriptSnippets([{ assembly: jsiiModule.assembly, directory: jsiiModule.moduleDirectory }]); + const snippets = await allTypeScriptSnippets([ + { assembly: jsiiModule.assembly, directory: jsiiModule.moduleDirectory }, + ]); expect(snippets[0].completeSource).toMatch(/^pick me/); } finally { diff --git a/packages/jsii-rosetta/test/testutil.ts b/packages/jsii-rosetta/test/testutil.ts index 953ae3c5fa..1c3011da63 100644 --- a/packages/jsii-rosetta/test/testutil.ts +++ b/packages/jsii-rosetta/test/testutil.ts @@ -35,7 +35,7 @@ export class TestJsiiModule { public readonly moduleDirectory: string; public readonly workspaceDirectory: string; - private constructor(public readonly assembly: spec.Assembly, private readonly workspace: TestWorkspace) { + private constructor(public readonly assembly: spec.Assembly, public readonly workspace: TestWorkspace) { this.moduleDirectory = workspace.dependencyDir(assembly.name); this.workspaceDirectory = workspace.rootDirectory; } diff --git a/packages/jsii-rosetta/vendor/semver-intersect.d.ts b/packages/jsii-rosetta/vendor/semver-intersect.d.ts new file mode 100644 index 0000000000..c7f919bcf7 --- /dev/null +++ b/packages/jsii-rosetta/vendor/semver-intersect.d.ts @@ -0,0 +1,13 @@ +/// Hand-written declaration for the semver-intersect module +declare module 'semver-intersect' { + /** + * Computes the intersection between multiple semver ranges. + * + * @param ranges the ranges for which the intersection is requested. + * + * @returns the intersection of `ranges`. + * + * @throws Error if the intersection is empty. + */ + function intersect(...ranges: string[]): string; +} diff --git a/packages/jsii/lib/assembler.ts b/packages/jsii/lib/assembler.ts index a33a98d509..0516411258 100644 --- a/packages/jsii/lib/assembler.ts +++ b/packages/jsii/lib/assembler.ts @@ -1,7 +1,7 @@ import * as spec from '@jsii/spec'; import { PackageJson } from '@jsii/spec'; import * as Case from 'case'; -import * as colors from 'colors/safe'; +import * as chalk from 'chalk'; import * as crypto from 'crypto'; // eslint-disable-next-line @typescript-eslint/no-require-imports import deepEqual = require('deep-equal'); @@ -13,7 +13,6 @@ import * as ts from 'typescript'; import { getReferencedDocParams, parseSymbolDocumentation, - renderSymbolDocumentation, TypeSystemHints, } from './docs'; import { Emitter } from './emitter'; @@ -26,7 +25,6 @@ import { symbolIdentifier } from './symbol-id'; import { DeprecatedRemover } from './transforms/deprecated-remover'; import { DeprecationWarningsInjector } from './transforms/deprecation-warnings'; import { RuntimeTypeInfoInjector } from './transforms/runtime-info'; -import { TsCommentReplacer } from './transforms/ts-comment-replacer'; import { combinedTransformers } from './transforms/utils'; import { Validator } from './validator'; import { SHORT_VERSION, VERSION } from './version'; @@ -41,7 +39,6 @@ const LOG = log4js.getLogger('jsii/assembler'); * The JSII Assembler consumes a ``ts.Program`` instance and emits a JSII assembly. */ export class Assembler implements Emitter { - private readonly commentReplacer = new TsCommentReplacer(); private readonly runtimeTypeInfoInjector: RuntimeTypeInfoInjector; private readonly deprecatedRemover?: DeprecatedRemover; private readonly warningsInjector?: DeprecationWarningsInjector; @@ -132,7 +129,6 @@ export class Assembler implements Emitter { return combinedTransformers( this.deprecatedRemover?.customTransformers ?? {}, this.runtimeTypeInfoInjector.makeTransformers(), - this.commentReplacer.makeTransformers(), this.warningsInjector?.customTransformers ?? {}, ); } @@ -183,7 +179,7 @@ export class Assembler implements Emitter { if (LOG.isTraceEnabled()) { LOG.trace( - `Processing source file: ${colors.blue( + `Processing source file: ${chalk.blue( path.relative(this.projectInfo.projectRoot, sourceFile.fileName), )}`, ); @@ -291,7 +287,7 @@ export class Assembler implements Emitter { const validationResult = await validator.emit(); if (!validationResult.emitSkipped) { const assemblyPath = path.join(this.projectInfo.projectRoot, '.jsii'); - LOG.trace(`Emitting assembly: ${colors.blue(assemblyPath)}`); + LOG.trace(`Emitting assembly: ${chalk.blue(assemblyPath)}`); await fs.writeJson(assemblyPath, _fingerprint(assembly), { encoding: 'utf8', spaces: 2, @@ -320,11 +316,7 @@ export class Assembler implements Emitter { return undefined; } const readmePath = path.join(this.projectInfo.projectRoot, fileName); - const renderedLines = await literate.includeAndRenderExamples( - await literate.loadFromFile(readmePath), - literate.fileSystemLoader(this.projectInfo.projectRoot), - ); - return { markdown: renderedLines.join('\n') }; + return loadAndRenderReadme(readmePath, this.projectInfo.projectRoot); } function _loadDocs(this: Assembler): spec.Docs | undefined { @@ -729,7 +721,10 @@ export class Assembler implements Emitter { symbol, ); const targets = await loadSubmoduleTargetConfig(sourceFile.fileName); - const readme = await loadSubmoduleReadMe(sourceFile.fileName); + const readme = await loadSubmoduleReadMe( + sourceFile.fileName, + this.projectInfo.projectRoot, + ); this._submodules.set(symbol, { fqn, @@ -793,18 +788,13 @@ export class Assembler implements Emitter { */ async function loadSubmoduleReadMe( submoduleMain: string, + projectRoot: string, ): Promise { const fileBase = path.basename(submoduleMain).replace(/(\.d)?\.ts$/, ''); const readMeName = fileBase === 'index' ? `README.md` : `${fileBase}.README.md`; const fullPath = path.join(path.dirname(submoduleMain), readMeName); - - if (!(await fs.pathExists(fullPath))) { - return undefined; - } - return { - markdown: await fs.readFile(fullPath, { encoding: 'utf-8' }), - }; + return loadAndRenderReadme(fullPath, projectRoot); } } @@ -917,7 +907,7 @@ export class Assembler implements Emitter { if (LOG.isTraceEnabled()) { LOG.trace( - `Entering submodule: ${colors.cyan( + `Entering submodule: ${chalk.cyan( [...context.namespace, symbol.name].join('.'), )}`, ); @@ -932,7 +922,7 @@ export class Assembler implements Emitter { if (LOG.isTraceEnabled()) { LOG.trace( - `Leaving submodule: ${colors.cyan( + `Leaving submodule: ${chalk.cyan( [...context.namespace, symbol.name].join('.'), )}`, ); @@ -994,7 +984,7 @@ export class Assembler implements Emitter { if (LOG.isTraceEnabled()) { LOG.trace( - `Entering namespace: ${colors.cyan( + `Entering namespace: ${chalk.cyan( [...context.namespace, name].join('.'), )}`, ); @@ -1013,7 +1003,7 @@ export class Assembler implements Emitter { if (LOG.isTraceEnabled()) { LOG.trace( - `Leaving namespace: ${colors.cyan( + `Leaving namespace: ${chalk.cyan( [...context.namespace, name].join('.'), )}`, ); @@ -1069,7 +1059,7 @@ export class Assembler implements Emitter { if (LOG.isInfoEnabled()) { LOG.info( - `Registering JSII ${colors.magenta(jsiiType.kind)}: ${colors.green( + `Registering JSII ${chalk.magenta(jsiiType.kind)}: ${chalk.green( jsiiType.fqn, )}`, ); @@ -1227,9 +1217,9 @@ export class Assembler implements Emitter { ): Promise { if (LOG.isTraceEnabled()) { LOG.trace( - `Processing class: ${colors.gray( - ctx.namespace.join('.'), - )}.${colors.cyan(type.symbol.name)}`, + `Processing class: ${chalk.gray(ctx.namespace.join('.'))}.${chalk.cyan( + type.symbol.name, + )}`, ); } @@ -1274,7 +1264,7 @@ export class Assembler implements Emitter { // erased, and identify the closest exported base class, should there be one. while (base && this._isPrivateOrInternal(base.symbol)) { LOG.debug( - `Base class of ${colors.green(jsiiType.fqn)} named ${colors.green( + `Base class of ${chalk.green(jsiiType.fqn)} named ${chalk.green( base.symbol.name, )} is not exported, erasing it...`, ); @@ -1526,11 +1516,6 @@ export class Assembler implements Emitter { constructor, memberEmitContext, ).docs; - this.overrideDocComment( - constructor, - jsiiType.initializer.docs, - paramDocs(jsiiType.initializer.parameters), - ); } // Process constructor-based property declarations even if constructor is private @@ -1579,8 +1564,6 @@ export class Assembler implements Emitter { this._verifyNoStaticMixing(jsiiType, type.symbol.valueDeclaration); - this.overrideDocComment(type.getSymbol(), jsiiType?.docs); - return _sortMembers(jsiiType); } @@ -1688,7 +1671,7 @@ export class Assembler implements Emitter { if (_isPrivate(symbol)) { LOG.trace( - `${colors.cyan( + `${chalk.cyan( symbol.name, )} is marked "private", or is an unexported type declaration`, ); @@ -1729,7 +1712,7 @@ export class Assembler implements Emitter { ): Promise { if (LOG.isTraceEnabled()) { LOG.trace( - `Processing enum: ${colors.gray(ctx.namespace.join('.'))}.${colors.cyan( + `Processing enum: ${chalk.gray(ctx.namespace.join('.'))}.${chalk.cyan( type.symbol.name, )}`, ); @@ -1781,7 +1764,6 @@ export class Assembler implements Emitter { kind: spec.TypeKind.Enum, members: members.map((m) => { const { docs } = this._visitDocumentation(m.symbol, typeContext); - this.overrideDocComment(m.symbol, docs); return { name: m.symbol.name, docs }; }), name: symbol.name, @@ -1796,8 +1778,6 @@ export class Assembler implements Emitter { decl, ); - this.overrideDocComment(type.getSymbol(), jsiiType?.docs); - return Promise.resolve(jsiiType); } @@ -1827,12 +1807,10 @@ export class Assembler implements Emitter { _findHint(decl, 'struct')!, 'struct', 'interfaces with only readonly properties', - ) - .addRelatedInformation( - ts.getNameOfDeclaration(decl) ?? decl, - 'The annotated declaration is here', - ) - .preformat(this.projectInfo.projectRoot), + ).addRelatedInformation( + ts.getNameOfDeclaration(decl) ?? decl, + 'The annotated declaration is here', + ), ); // Clean up the bad hint... delete (result.hints as any).struct; @@ -1880,9 +1858,9 @@ export class Assembler implements Emitter { ): Promise { if (LOG.isTraceEnabled()) { LOG.trace( - `Processing interface: ${colors.gray( + `Processing interface: ${chalk.gray( ctx.namespace.join('.'), - )}.${colors.cyan(type.symbol.name)}`, + )}.${chalk.cyan(type.symbol.name)}`, ); } @@ -1984,27 +1962,15 @@ export class Assembler implements Emitter { jsiiType.datatype = true; } else if (hints.struct) { this._diagnostics.push( - jsiiType.methods!.reduce( - (diag, mthod) => { - const node = bindings.getMethodRelatedNode(mthod); - return node - ? diag.addRelatedInformation( - ts.getNameOfDeclaration(node) ?? node, - `A method is declared here`, - ) - : diag; - }, - JsiiDiagnostic.JSII_7001_ILLEGAL_HINT.create( - _findHint(declaration, 'struct')!, - 'struct', - 'interfaces with only readonly properties', - ) - .addRelatedInformation( - ts.getNameOfDeclaration(declaration) ?? declaration, - 'The annotated declartion is here', - ) - .preformat(this.projectInfo.projectRoot), - ), + jsiiType.methods!.reduce((diag, mthod) => { + const node = bindings.getMethodRelatedNode(mthod); + return node + ? diag.addRelatedInformation( + ts.getNameOfDeclaration(node) ?? node, + `A method is declared here`, + ) + : diag; + }, JsiiDiagnostic.JSII_7001_ILLEGAL_HINT.create(_findHint(declaration, 'struct')!, 'struct', 'interfaces with only readonly properties').addRelatedInformation(ts.getNameOfDeclaration(declaration) ?? declaration, 'The annotated declartion is here')), ); } @@ -2107,8 +2073,6 @@ export class Assembler implements Emitter { checkNoIntersection, ); - this.overrideDocComment(type.getSymbol(), jsiiType?.docs); - return _sortMembers(jsiiType); } @@ -2120,7 +2084,7 @@ export class Assembler implements Emitter { ) { if (LOG.isTraceEnabled()) { LOG.trace( - `Processing method: ${colors.green(type.fqn)}#${colors.cyan( + `Processing method: ${chalk.green(type.fqn)}#${chalk.cyan( symbol.name, )}`, ); @@ -2241,14 +2205,13 @@ export class Assembler implements Emitter { ) != null ) { LOG.trace( - `Dropping re-declaration of ${colors.green(type.fqn)}#${colors.cyan( + `Dropping re-declaration of ${chalk.green(type.fqn)}#${chalk.cyan( method.name, )}`, ); return; } type.methods.push(method); - this.overrideDocComment(symbol, method.docs, paramDocs(method.parameters)); } private _warnAboutReservedWords(symbol: ts.Symbol) { @@ -2285,7 +2248,7 @@ export class Assembler implements Emitter { if (LOG.isTraceEnabled()) { LOG.trace( - `Processing property: ${colors.green(type.fqn)}#${colors.cyan( + `Processing property: ${chalk.green(type.fqn)}#${chalk.cyan( symbol.name, )}`, ); @@ -2373,14 +2336,13 @@ export class Assembler implements Emitter { ) != null ) { LOG.trace( - `Dropping re-declaration of ${colors.green(type.fqn)}#${colors.cyan( + `Dropping re-declaration of ${chalk.green(type.fqn)}#${chalk.cyan( property.name, )}`, ); return; } type.properties.push(property); - this.overrideDocComment(symbol, property.docs); } private async _toParameter( @@ -2388,7 +2350,7 @@ export class Assembler implements Emitter { ctx: EmitContext, ): Promise { if (LOG.isTraceEnabled()) { - LOG.trace(`Processing parameter: ${colors.cyan(paramSymbol.name)}`); + LOG.trace(`Processing parameter: ${chalk.cyan(paramSymbol.name)}`); } const paramDeclaration = paramSymbol.valueDeclaration as ts.ParameterDeclaration; @@ -2730,71 +2692,6 @@ export class Assembler implements Emitter { this.runtimeTypeInfoInjector.registerClassFqn(clazz, fqn); } - /** - * From the given JSIIDocs, re-render the TSDoc comment for the Node - * - * We may change the documentation a little, so that the doc comment that gets - * written is not necessarily exactly the same as the docs that go into the - * JSII manifest. - * - * This makes it possible for the code doc comments to highlight things - * slighly differently from the API Reference, and makes sure we don't - * duplicate information. - * - * Unless the docs got changed, this yields the same output back as the one that - * we originally saw (modulo whitespace changes). - */ - private overrideDocComment( - symbol?: ts.Symbol, - docs?: spec.Docs, - parameters?: Record, - ) { - if (!docs || !symbol) { - return; - } - - docs = this.docCommentDocs(docs); - - // Some symbols have multiple declarations (for example, a class + interface - // mixins, or a property declartaion + constructor argument). - // - // We DON'T wwant to put the doc comment on the constructor argument, because it - // looks silly there. - for (const decl of symbol.getDeclarations() ?? []) { - if (ts.isParameter(decl)) { - continue; - } - - this.commentReplacer.overrideNodeDocComment( - decl, - renderSymbolDocumentation(docs, parameters), - ); - } - } - - /** - * Return a potentially new set of Docs, for rendering back to a TypeScript doc comment - * - * We put the "(experimental)"/"(deprecated)" status into the doc - * comment summary, so that it's presented front and center. - */ - private docCommentDocs(docs: Readonly): spec.Docs { - // Modify the summary if this API element has a special stability - if (docs.stability === spec.Stability.Experimental && docs.summary) { - return { - ...docs, - summary: `(experimental) ${docs.summary}`, - }; - } - if (docs.stability === spec.Stability.Deprecated && docs.summary) { - return { - ...docs, - summary: `(deprecated) ${docs.summary}`, - }; - } - return docs; - } - /** * Return only those submodules from the submodules list that are submodules inside this * assembly. @@ -3350,18 +3247,6 @@ async function findPackageInfo( return findPackageInfo(parent); } -function paramDocs( - params?: readonly spec.Parameter[], -): Record { - const ret: Record = {}; - for (const param of params ?? []) { - if (param.docs) { - ret[param.name] = param.docs; - } - } - return ret; -} - /** * Checks is the provided type is "this" (as a type annotation). * @@ -3481,3 +3366,19 @@ function isUnder(file: string, dir: string): boolean { const relative = path.relative(dir, file); return !relative.startsWith(path.sep) && !relative.startsWith('..'); } + +async function loadAndRenderReadme(readmePath: string, projectRoot: string) { + if (!(await fs.pathExists(readmePath))) { + return undefined; + } + + return { + markdown: ( + await literate.includeAndRenderExamples( + await literate.loadFromFile(readmePath), + literate.fileSystemLoader(path.dirname(readmePath)), + projectRoot, + ) + ).join('\n'), + }; +} diff --git a/packages/jsii/lib/compiler.ts b/packages/jsii/lib/compiler.ts index 55829de2e2..9259ec16c6 100644 --- a/packages/jsii/lib/compiler.ts +++ b/packages/jsii/lib/compiler.ts @@ -1,5 +1,5 @@ import * as Case from 'case'; -import * as colors from 'colors/safe'; +import * as chalk from 'chalk'; import * as fs from 'fs-extra'; import * as log4js from 'log4js'; import * as path from 'path'; @@ -413,7 +413,7 @@ export class Compiler implements Emitter { }, }; - LOG.debug(`Creating or updating ${colors.blue(this.configPath)}`); + LOG.debug(`Creating or updating ${chalk.blue(this.configPath)}`); await fs.writeJson(this.configPath, outputConfig, { encoding: 'utf8', spaces: 2, diff --git a/packages/jsii/lib/docs.ts b/packages/jsii/lib/docs.ts index 05bff439a1..dde213cdc2 100644 --- a/packages/jsii/lib/docs.ts +++ b/packages/jsii/lib/docs.ts @@ -68,70 +68,6 @@ export function parseSymbolDocumentation( return parseDocParts(comment, tags); } -/** - * Render JSIIDocs back to a TSDoc block - */ -export function renderSymbolDocumentation( - docs: spec.Docs, - parameters?: Record, -): string { - const lines: string[] = []; - if (docs.summary) { - lines.push(docs.summary); - lines.push(''); - } - if (docs.remarks) { - lines.push(...docs.remarks.split('\n')); - lines.push(''); - } - - for (const [name, docs] of Object.entries(parameters ?? {})) { - tag('param', `${name} ${docs.summary ?? ''}`); - } - tag(DocTag.RETURNS, docs.returns); - tag(DocTag.DEFAULT, docs.default); - tag(DocTag.SEE, docs.see); - if (docs.subclassable) { - tag(DocTag.SUBCLASSABLE, ''); - } - - switch (docs.stability) { - case spec.Stability.Deprecated: - tag('deprecated', docs.deprecated ?? ''); - break; - case spec.Stability.Experimental: - tag('experimental', ''); - break; - case spec.Stability.External: - tag('external', ''); - break; - default: - tag('stability', docs.stability); - } - - for (const [k, v] of Object.entries(docs.custom ?? {})) { - tag(k, v); - } - - if (docs.example) { - lines.push('@example'); - lines.push(''); - lines.push(...docs.example.split('\n')); - } - - while (lines.length > 0 && lines[lines.length - 1] === '') { - lines.pop(); - } - - return lines.join('\n'); - - function tag(tagName: string, value: string | undefined) { - if (value !== undefined) { - lines.push(`@${tagName} ${value}`.trim()); - } - } -} - /** * Return the list of parameter names that are referenced in the docstring for this symbol */ diff --git a/packages/jsii/lib/helpers.ts b/packages/jsii/lib/helpers.ts index 37e09040b4..5f5bd579cc 100644 --- a/packages/jsii/lib/helpers.ts +++ b/packages/jsii/lib/helpers.ts @@ -217,11 +217,15 @@ export interface TestCompilationOptions { /** * Parts of projectInfo to override (package name etc) + * + * @deprecated Prefer using `packageJson` instead. */ readonly projectInfo?: Partial; /** * Parts of projectInfo to override (package name etc) + * + * @default - Use some default values */ readonly packageJson?: Partial; } diff --git a/packages/jsii/lib/jsii-diagnostic.ts b/packages/jsii/lib/jsii-diagnostic.ts index c78b4ccfd2..272ac9bffc 100644 --- a/packages/jsii/lib/jsii-diagnostic.ts +++ b/packages/jsii/lib/jsii-diagnostic.ts @@ -523,7 +523,7 @@ export class JsiiDiagnostic implements ts.Diagnostic { newOptional = false, oldOptional = false, ) => - `"${newElement}" turns ${ + `"${newElement}" turns ${ newOptional ? 'optional' : 'required' } when ${action}. Make it ${oldOptional ? 'optional' : 'required'}`, name: 'language-compatibility/override-changes-prop-optional', @@ -534,12 +534,12 @@ export class JsiiDiagnostic implements ts.Diagnostic { formatter: ( newElement: string, action: string, - newMutable = false, - oldMutable = false, + newReadonly = false, + oldReadonly = false, ) => `"${newElement}" turns ${ - newMutable ? 'mutable' : 'readonly' - } when ${action}. Make it ${oldMutable ? 'mutable' : 'readonly'}`, + newReadonly ? 'readonly' : 'mutable' + } when ${action}. Make it ${oldReadonly ? 'readonly' : 'mutable'}`, name: 'language-compatibility/override-changes-mutability', }); @@ -862,6 +862,30 @@ export class JsiiDiagnostic implements ts.Diagnostic { return this; } + /** + * Adds related information to this `JsiiDiagnostic` instance if the provided + * `node` is defined. + * + * @param node the node to bind as related information, or `undefined`. + * @param message the message to attach to the related information. + * + * @returns `this` + */ + public maybeAddRelatedInformation( + node: ts.Node | undefined, + message: JsiiDiagnostic['messageText'], + ): this { + if (node == null) { + return this; + } + this.relatedInformation.push( + JsiiDiagnostic.JSII_9999_RELATED_INFO.create(node, message), + ); + // Clearing out #formatted, as this would no longer be the correct string. + this.#formatted = undefined; + return this; + } + /** * Formats this diagnostic with color and context if possible, and returns it. * The formatted diagnostic is cached, so that it can be re-used. This is @@ -875,16 +899,6 @@ export class JsiiDiagnostic implements ts.Diagnostic { } return this.#formatted; } - - /** - * Ensures the formatted diagnostic is prepared for later re-use. - * - * @returns `this` - */ - public preformat(projectRoot: string): this { - this.format(projectRoot); - return this; - } } export type DiagnosticMessageFormatter = ( diff --git a/packages/jsii/lib/literate.ts b/packages/jsii/lib/literate.ts index 2ebf048708..5d6b812989 100644 --- a/packages/jsii/lib/literate.ts +++ b/packages/jsii/lib/literate.ts @@ -71,7 +71,14 @@ export function typescriptSourceToMarkdown( return markdownLines; } -export type FileLoader = (relativePath: string) => string[] | Promise; +export interface LoadedFile { + readonly fullPath: string; + readonly lines: string[]; +} + +export type FileLoader = ( + relativePath: string, +) => LoadedFile | Promise; /** * Given MarkDown source, find source files to include and render @@ -84,6 +91,7 @@ export type FileLoader = (relativePath: string) => string[] | Promise; export async function includeAndRenderExamples( lines: string[], loader: FileLoader, + projectRoot: string, ): Promise { const ret: string[] = []; @@ -94,9 +102,12 @@ export async function includeAndRenderExamples( // Found an include const filename = m[2]; // eslint-disable-next-line no-await-in-loop - const source = await loader(filename); + const { lines: source, fullPath } = await loader(filename); // 'lit' source attribute will make snippet compiler know to extract the same source - const imported = typescriptSourceToMarkdown(source, [`lit=${filename}`]); + // Needs to be relative to the project root. + const imported = typescriptSourceToMarkdown(source, [ + `lit=${toUnixPath(path.relative(projectRoot, fullPath))}`, + ]); ret.push(...imported); } else { ret.push(line); @@ -125,7 +136,10 @@ export function contentToLines(content: string): string[] { * Return a file system loader given a base directory */ export function fileSystemLoader(directory: string): FileLoader { - return (fileName) => loadFromFile(path.resolve(directory, fileName)); + return async (fileName) => { + const fullPath = path.resolve(directory, fileName); + return { fullPath, lines: await loadFromFile(fullPath) }; + }; } const RELEVANT_TAG = '/// !show'; @@ -215,3 +229,7 @@ function markdownify( } } } + +function toUnixPath(x: string) { + return x.replace(/\\/g, '/'); +} diff --git a/packages/jsii/lib/node-bindings.ts b/packages/jsii/lib/node-bindings.ts index ae7721577f..625e062716 100644 --- a/packages/jsii/lib/node-bindings.ts +++ b/packages/jsii/lib/node-bindings.ts @@ -22,6 +22,13 @@ const setter = (object: T, node: ts.Node): T => { return object; }; +export function setRelatedNode( + object: any, + node: T, +) { + return STORAGE.set(object, node); +} + export const setClassRelatedNode: ( object: spec.ClassType, node: ts.ClassDeclaration, diff --git a/packages/jsii/lib/transforms/ts-comment-replacer.ts b/packages/jsii/lib/transforms/ts-comment-replacer.ts deleted file mode 100644 index 33a33af409..0000000000 --- a/packages/jsii/lib/transforms/ts-comment-replacer.ts +++ /dev/null @@ -1,133 +0,0 @@ -import * as ts from 'typescript'; - -/** - * Machinery to replace physical doc comments in the AST with synthetic ones - * - * We use this to slightly tweak the comment blocks that we emit to the .js - * and .d.ts files. - * - * The process is as follows: - * - * - Iterate over all nodes of the AST. Do the analysis that we require, remember - * the Nodes we want to replace the comments of in a table. - * - When we're ready to emit JS/DTS, use transforms to replace the physical with - * synthetic comments by looking up the visited Nodes in the table. - * - During transformation, we are given a "shadow copy" (?) of the actual node, - * so we need to resolve it to the OriginalNode (which is the one that the assembler - * saw) -- note that only _original_ nodes have SourceFiles attached. - * - * It must be done this way because: - * - * - Comments don't have a node in the AST. Instead, comments are called "trivia" - * and are discovered by _scanning the source file between two token positions_ - * in an on-demand fashion. - * - The only way to "add" comments to a node is to call addSyntheticComment, - * which remembers the comment we'd like to emit on the EmitNode of the corresponding - * AST Node (the printer will respect this SyntheticComment when printing everything - * back out again). - * - EmitNodes are used for bookkeeping, and are cleared between different passes of - * the compiler. We can therefore not add the synthetic comments in the assembler - * pass, we have to be able to do it on-demand in a special "transform" pass. - */ -export class TsCommentReplacer { - private readonly nodes = new Map(); - - /** - * Override the doc comment of an AST node - */ - public overrideNodeDocComment(node: ts.Node, docstring: string): void { - this.nodes.set(node, { contents: docstring }); - } - - /** - * Return the set of Transformers to be used in TSC's program.emit() - */ - public makeTransformers(): ts.CustomTransformers { - // eslint-disable-next-line @typescript-eslint/no-this-alias - const self = this; - - const transformerFactory = (ctx: ts.TransformationContext) => { - return (input: T): T => { - if (ts.isSourceFile(input)) { - return replaceSourceFile(input) as T; - } - // I don't know what a Bundle is but seems we don't need it - return input; - }; - - function replaceSourceFile(source: ts.SourceFile): ts.SourceFile { - return ts.visitEachChild(source, visitor, ctx); - - function visitor(node: ts.Node): ts.Node { - const handled = self.handleNode(node, source); - return ts.visitEachChild(handled, visitor, ctx); - } - } - }; - - return { - // This needs to be here to properly transform .js generation - before: [transformerFactory], - // This needs to be here to properly transform .d.ts generation - afterDeclarations: [transformerFactory], - }; - } - - private handleNode(node: T, source: ts.SourceFile): T { - const original = ts.getOriginalNode(node); - const doOverride = this.nodes.get(original); - - if (doOverride) { - whiteoutLeadingComments(original, source); - this.addTsdocComment(node, doOverride.contents); - } - return node; - } - - /** - * Add a synthetic comment formatted like a TSDoc block - * - * A multiline trivia comment looks like "/ * (...content...) * / (newline?)". - * - * The TypeScript printer will take care of indentation. - */ - private addTsdocComment(node: ts.Node, text: string) { - const lines = text.trim().split('\n'); - - // eslint-disable-next-line prettier/prettier - const commentContents = ['*\n', ...lines.map((l) => ` * ${l}\n`), ` `].join( - '', - ); - - ts.addSyntheticLeadingComment( - node, - ts.SyntaxKind.MultiLineCommentTrivia, - commentContents, - true, - ); - } -} - -interface NodeDocs { - readonly contents: string; -} - -/** - * In the given source file, replace the extent of the trivia with whitespace - * - * This will make it invisible when the printer calls getLeadingTrivia(), - * which will make it not render it out again. The only comments that - * will be rendered after this will be synthetic comments. - */ -function whiteoutLeadingComments(node: ts.Node, source: ts.SourceFile) { - let text = source.getFullText(); - ts.forEachLeadingCommentRange(text, node.getFullStart(), (pos, end, kind) => { - if (kind === ts.SyntaxKind.MultiLineCommentTrivia) { - text = text.slice(0, pos).padEnd(end, ' ') + text.slice(end); - } - }); - if (source.text !== text) { - source.text = text; - (source as any).lineMap = (ts as any).computeLineStarts(text); - } -} diff --git a/packages/jsii/lib/validator.ts b/packages/jsii/lib/validator.ts index a357844780..878703c8a7 100644 --- a/packages/jsii/lib/validator.ts +++ b/packages/jsii/lib/validator.ts @@ -1,4 +1,5 @@ import * as spec from '@jsii/spec'; +import * as assert from 'assert'; import * as Case from 'case'; // eslint-disable-next-line @typescript-eslint/no-require-imports import deepEqual = require('deep-equal'); @@ -231,19 +232,68 @@ function _defaultValidations(): ValidationFunction[] { spec.isClassOrInterfaceType(type) && (type.interfaces?.length ?? 0) > 0 ) { - for (const method of type.methods ?? []) { - // Overrides "win" over implementations - if (method.overrides) { - continue; - } + for (const method of _allImplementations(type, (t) => t.methods)) { _validateMethodImplementation(method, type); } - for (const property of type.properties ?? []) { + for (const property of _allImplementations(type, (t) => t.properties)) { _validatePropertyImplementation(property, type); } } } + /** + * Lists all "implementations" from the given type, using the provided + * implementation getter. Note that abstract members may be part of the + * result (in particular, if `type` is an interface type, or if it's an + * abstract class with unimplemented members) -- I just couldn't come up + * with a name that actually describes this. + * + * @param type the type which implemented members are needed. + * @param getter the getter to obtain methods or properties from the type. + * + * @returns a list of members (possibly empty, always defined) + */ + function _allImplementations( + type: spec.ClassType | spec.InterfaceType, + getter: (type: spec.ClassType | spec.InterfaceType) => T[] | undefined, + ): T[] { + const result = new Array(); + const known = new Set(); + + for (const member of getter(type) ?? []) { + result.push(member); + known.add(member.name); + } + + if (spec.isClassType(type) && type.base) { + // We have a parent class, collect their concrete members, too (recursively)... + const base = _dereference(type.base, assembly, validator); + assert(base != null && spec.isClassType(base)); + for (const member of _allImplementations(base, getter)) { + if (known.has(member.name)) { + continue; + } + // The member is copied, so that its `overrides` property won't be + // altered, since this member is "borrowed" from a parent type. We + // only check it, but should not record `overrides` relationships to + // it as those could be invalid per the parent type (i.e: the parent + // member may not be able to implement an interface, if that type does + // not actually declare implementing that). + const memberCopy = { ...member }; + // Forward the related node if there's one, so diagnostics are bound. + const node = bindings.getRelatedNode(member); + if (node != null) { + bindings.setRelatedNode(memberCopy, node); + } + + result.push(memberCopy); + known.add(member.name); + } + } + + return result; + } + function _validateMethodOverride( method: spec.Method, type: spec.ClassType, @@ -336,7 +386,9 @@ function _defaultValidations(): ValidationFunction[] { `${type.fqn}#${method.name}`, `implementing ${ifaceType.fqn}`, ); - method.overrides = iface; + // We won't replace a previous overrides declaration from a method override, as those have + // higher precedence than an initial implementation. + method.overrides = method.overrides ?? iface; return true; } if (_validateMethodImplementation(method, ifaceType)) { @@ -376,7 +428,9 @@ function _defaultValidations(): ValidationFunction[] { `${type.fqn}#${property.name}`, `implementing ${ifaceType.fqn}`, ); - property.overrides = ifaceType.fqn; + // We won't replace a previous overrides declaration from a property override, as those + // have higher precedence than an initial implementation. + property.overrides = property.overrides ?? ifaceType.fqn; return true; } if (_validatePropertyImplementation(property, ifaceType)) { @@ -472,45 +526,79 @@ function _defaultValidations(): ValidationFunction[] { label: string, action: string, ) { + const actualNode = bindings.getPropertyRelatedNode(actual); + const expectedNode = bindings.getPropertyRelatedNode(expected); if (!!expected.protected !== !!actual.protected) { const expVisibility = expected.protected ? 'protected' : 'public'; const actVisibility = actual.protected ? 'protected' : 'public'; diagnostic( - JsiiDiagnostic.JSII_5002_OVERRIDE_CHANGES_VISIBILITY.createDetached( + JsiiDiagnostic.JSII_5002_OVERRIDE_CHANGES_VISIBILITY.create( + actualNode?.modifiers?.find( + (mod) => + mod.kind === ts.SyntaxKind.PublicKeyword || + mod.kind === ts.SyntaxKind.ProtectedKeyword, + ) ?? declarationName(actualNode), label, action, actVisibility, expVisibility, + ).maybeAddRelatedInformation( + expectedNode?.modifiers?.find( + (mod) => + mod.kind === ts.SyntaxKind.PublicKeyword || + mod.kind === ts.SyntaxKind.ProtectedKeyword, + ) ?? declarationName(expectedNode), + 'The implemented delcaration is here.', ), ); } if (!deepEqual(expected.type, actual.type)) { diagnostic( - JsiiDiagnostic.JSII_5004_OVERRIDE_CHANGES_PROP_TYPE.createDetached( + JsiiDiagnostic.JSII_5004_OVERRIDE_CHANGES_PROP_TYPE.create( + actualNode?.type ?? declarationName(actualNode), label, action, actual.type, expected.type, + ).maybeAddRelatedInformation( + expectedNode?.type ?? declarationName(expectedNode), + 'The implemented delcaration is here.', ), ); } if (expected.immutable !== actual.immutable) { diagnostic( - JsiiDiagnostic.JSII_5010_OVERRIDE_CHANGES_MUTABILITY.createDetached( + JsiiDiagnostic.JSII_5010_OVERRIDE_CHANGES_MUTABILITY.create( + actualNode?.modifiers?.find( + (mod) => mod.kind === ts.SyntaxKind.ReadonlyKeyword, + ) ?? declarationName(actualNode), label, action, actual.immutable, expected.immutable, + ).maybeAddRelatedInformation( + expectedNode?.modifiers?.find( + (mod) => mod.kind === ts.SyntaxKind.ReadonlyKeyword, + ) ?? declarationName(expectedNode), + 'The implemented delcaration is here.', ), ); } if (expected.optional !== actual.optional) { diagnostic( - JsiiDiagnostic.JSII_5009_OVERRIDE_CHANGES_PROP_OPTIONAL.createDetached( + JsiiDiagnostic.JSII_5009_OVERRIDE_CHANGES_PROP_OPTIONAL.create( + actualNode?.questionToken ?? + actualNode?.type ?? + declarationName(actualNode), label, action, actual.optional, expected.optional, + ).maybeAddRelatedInformation( + expectedNode?.questionToken ?? + expectedNode?.type ?? + declarationName(expectedNode), + 'The implemented delcaration is here.', ), ); } @@ -725,3 +813,26 @@ function _isEmpty(array: undefined | any[]): array is undefined { function isConstantCase(x: string) { return !/[^A-Z0-9_]/.exec(x); } + +/** + * Obtains the name of the given declaration, if it has one, or returns the declaration itself. + * This function is meant to be used as a convenience to obtain the `ts.Node` to bind a + * `JsiiDianostic` instance on. + * + * It may return `undefined` but is typed as `ts.Node` so that it is easier to use with + * `JsiiDiagnostic` factories. + * + * @param decl the declaration which name is needed. + * + * @returns the name of the declaration if it has one, or the declaration itself. Might return + * `undefined` if the provided declaration is undefined. + */ +function declarationName( + decl: ts.Declaration | ts.Expression | undefined, +): ts.Node { + if (decl == null) { + // Pretend we returned a node - this is used to create diagnostics, worst case it'll be unbound. + return decl as any; + } + return ts.getNameOfDeclaration(decl) ?? decl; +} diff --git a/packages/jsii/package.json b/packages/jsii/package.json index a4f236482c..f869bdc6d0 100644 --- a/packages/jsii/package.json +++ b/packages/jsii/package.json @@ -38,10 +38,10 @@ "@jsii/check-node": "0.0.0", "@jsii/spec": "^0.0.0", "case": "^1.6.3", - "colors": "1.4.0", + "chalk": "^4", "deep-equal": "^2.0.5", "fs-extra": "^9.1.0", - "log4js": "^6.3.0", + "log4js": "^6.4.1", "semver": "^7.3.5", "semver-intersect": "^1.4.0", "sort-json": "^2.0.0", @@ -53,15 +53,15 @@ "@types/clone": "^2.1.1", "@types/deep-equal": "^1.0.1", "@types/fs-extra": "^9.0.13", - "@types/jest": "^27.0.3", - "@types/node": "^12.20.39", + "@types/jest": "^27.4.0", + "@types/node": "^12.20.43", "@types/semver": "^7.3.9", "clone": "^2.1.2", - "eslint": "^8.5.0", - "jest": "^27.4.5", + "eslint": "^8.8.0", + "jest": "^27.4.7", "jest-expect-message": "^1.0.2", "jsii-build-tools": "^0.0.0", "prettier": "^2.5.1", - "ts-jest": "^27.1.2" + "ts-jest": "^27.1.3" } } diff --git a/packages/jsii/test/__snapshots__/negatives.test.ts.snap b/packages/jsii/test/__snapshots__/negatives.test.ts.snap index 9eaa50f870..cb26c92bcb 100644 --- a/packages/jsii/test/__snapshots__/negatives.test.ts.snap +++ b/packages/jsii/test/__snapshots__/negatives.test.ts.snap @@ -90,7 +90,15 @@ neg.double-interface-members-method.ts:4:1 - error JSII5015: Interface "jsii.IB" `; exports[`downgrade-to-readonly 1`] = ` -error JSII5010: "jsii.Implementation#property" turns mutable when implementing jsii.IInterface. Make it readonly +neg.downgrade-to-readonly.ts:8:24 - error JSII5010: "jsii.Implementation#property" turns readonly when implementing jsii.IInterface. Make it mutable + +8 constructor(public readonly property: string) {} + ~~~~~~~~ + + neg.downgrade-to-readonly.ts:4:5 + 4 property: string; + ~~~~~~~~ + The implemented delcaration is here. `; @@ -223,12 +231,28 @@ error JSII5006: "jsii.Something#takeSomething" changes the type of parameter "_a `; exports[`implementation-changes-types.4 1`] = ` -error JSII5004: "jsii.SomethingImpl#something" changes the property type to "jsii.Subclass" when implementing jsii.ISomething. Change it to "jsii.Superclass" +neg.implementation-changes-types.4.ts:9:21 - error JSII5004: "jsii.SomethingImpl#something" changes the property type to "jsii.Subclass" when implementing jsii.ISomething. Change it to "jsii.Superclass" + +9 public something: Subclass = new Subclass(); + ~~~~~~~~ + + neg.implementation-changes-types.4.ts:5:14 + 5 something: Superclass; + ~~~~~~~~~~ + The implemented delcaration is here. `; exports[`implementation-changes-types.5 1`] = ` -error JSII5004: "jsii.ISomethingElse#something" changes the property type to "jsii.Subclass" when implementing jsii.ISomething. Change it to "jsii.Superclass" +neg.implementation-changes-types.5.ts:14:21 - error JSII5004: "jsii.ISomethingElse#something" changes the property type to "jsii.Subclass" when implementing jsii.ISomething. Change it to "jsii.Superclass" + +14 public something: Subclass = new Subclass(); + ~~~~~~~~ + + neg.implementation-changes-types.5.ts:5:14 + 5 something: Superclass; + ~~~~~~~~~~ + The implemented delcaration is here. `; @@ -248,17 +272,41 @@ error JSII5008: "jsii.Implementor#method" turns parameter "_optional" required w `; exports[`implementing-property-changes-optionality 1`] = ` -error JSII5009: "jsii.Implementor#property" turns required when implementing jsii.IInterface. Make it optional +neg.implementing-property-changes-optionality.ts:7:20 - error JSII5009: "jsii.Implementor#property" turns required when implementing jsii.IInterface. Make it optional + +7 public property: string; + ~~~~~~ + + neg.implementing-property-changes-optionality.ts:3:11 + 3 property?: string; + ~ + The implemented delcaration is here. `; exports[`implementing-property-changes-optionality.1 1`] = ` -error JSII5009: "jsii.Implementor#property" turns required when overriding jsii.AbstractClass. Make it optional +neg.implementing-property-changes-optionality.1.ts:7:20 - error JSII5009: "jsii.Implementor#property" turns required when overriding jsii.AbstractClass. Make it optional + +7 public property: string; + ~~~~~~ + + neg.implementing-property-changes-optionality.1.ts:3:27 + 3 public abstract property?: string; + ~ + The implemented delcaration is here. `; exports[`implementing-property-changes-optionality.2 1`] = ` -error JSII5009: "jsii.Implementor#property" turns required when overriding jsii.ParentClass. Make it optional +neg.implementing-property-changes-optionality.2.ts:7:20 - error JSII5009: "jsii.Implementor#property" turns required when overriding jsii.ParentClass. Make it optional + +7 public property: string; + ~~~~~~ + + neg.implementing-property-changes-optionality.2.ts:3:18 + 3 public property?: string = undefined; + ~ + The implemented delcaration is here. `; @@ -294,12 +342,41 @@ error JSII5006: "jsii.SomethingSpecific#takeSomething" changes the type of param `; exports[`inheritance-changes-types.4 1`] = ` -error JSII5004: "jsii.SomethingSpecific#something" changes the property type to "jsii.Subclass" when overriding jsii.SomethingUnspecific. Change it to "jsii.Superclass" +neg.inheritance-changes-types.4.ts:9:21 - error JSII5004: "jsii.SomethingSpecific#something" changes the property type to "jsii.Subclass" when overriding jsii.SomethingUnspecific. Change it to "jsii.Superclass" + +9 public something: Subclass = new Subclass(); + ~~~~~~~~ + + neg.inheritance-changes-types.4.ts:5:10 + 5 public something = new Superclass(); + ~~~~~~~~~ + The implemented delcaration is here. `; exports[`inheritance-changes-types.5 1`] = ` -error JSII5004: "jsii.SomethingElse#something" changes the property type to "jsii.Subclass" when overriding jsii.SomethingBase. Change it to "jsii.Superclass" +neg.inheritance-changes-types.5.ts:14:21 - error JSII5004: "jsii.SomethingElse#something" changes the property type to "jsii.Subclass" when overriding jsii.SomethingBase. Change it to "jsii.Superclass" + +14 public something: Subclass = new Subclass(); + ~~~~~~~~ + + neg.inheritance-changes-types.5.ts:5:21 + 5 public something: Superclass = new Superclass(); + ~~~~~~~~~~ + The implemented delcaration is here. + +`; + +exports[`inheritance-changes-types.from-base 1`] = ` +neg.inheritance-changes-types.from-base.ts:6:30 - error JSII5009: "jsii.HasRequiredProperty#optionalProperty" turns required when implementing jsii.IHasOptionalProperty. Make it optional + +6 readonly optionalProperty: number; // Does not implement IHasOptionalProperty.optionalProperty + ~~~~~~ + + neg.inheritance-changes-types.from-base.ts:2:28 + 2 readonly optionalProperty?: number; + ~ + The implemented delcaration is here. `; @@ -527,8 +604,16 @@ neg.omit.4.ts:8:7 - error JSII1003: Only string-indexed map types are supported `; exports[`override-changes-visibility 1`] = ` +neg.override-changes-visibility.ts:14:3 - error JSII5002: "jsii.ChildClass#property" changes visibility to public when overriding jsii.BaseClass. Change it to protected + +14 public readonly property?: string; + ~~~~~~ + + neg.override-changes-visibility.ts:5:3 + 5 protected readonly property?: string; + ~~~~~~~~~ + The implemented delcaration is here. error JSII5002: "jsii.ChildClass#method" changes visibility to public when overriding jsii.BaseClass. Change it to protected -error JSII5002: "jsii.ChildClass#property" changes visibility to public when overriding jsii.BaseClass. Change it to protected `; @@ -758,17 +843,17 @@ neg.struct-hint-on-enum.ts:4:4 - error JSII7001: Illegal use of "@struct" hint. `; exports[`struct-hint-with-methods 1`] = ` -neg.struct-hint-with-methods.ts:1:72 - error JSII7001: Illegal use of "@struct" hint. It is only valid on interfaces with only readonly properties. +neg.struct-hint-with-methods.ts:4:4 - error JSII7001: Illegal use of "@struct" hint. It is only valid on interfaces with only readonly properties. -1 - +4 * @struct + ~~~~~~~ - neg.struct-hint-with-methods.ts:2:18 - 2 export interface INotAStruct { + neg.struct-hint-with-methods.ts:6:18 + 6 export interface INotAStruct { ~~~~~~~~~~~ The annotated declartion is here - neg.struct-hint-with-methods.ts:3:3 - 3 method(): void; + neg.struct-hint-with-methods.ts:7:3 + 7 method(): void; ~~~~~~ A method is declared here diff --git a/packages/jsii/test/deprecated-remover.test.ts b/packages/jsii/test/deprecated-remover.test.ts index 302909834d..63964fbe9b 100644 --- a/packages/jsii/test/deprecated-remover.test.ts +++ b/packages/jsii/test/deprecated-remover.test.ts @@ -275,247 +275,233 @@ describe('stripDeprecatedAllowList', () => { ); expect(result.assembly.types).toMatchInlineSnapshot(` - Object { - "testpkg.Deprecated": Object { - "assembly": "testpkg", - "base": "testpkg.Retained", - "docs": Object { - "deprecated": "stripped", - "stability": "deprecated", - }, - "fqn": "testpkg.Deprecated", - "initializer": Object {}, - "interfaces": Array [ - "testpkg.IRetainedInterface", - ], - "kind": "class", - "locationInModule": Object { - "filename": "mixed.ts", - "line": 10, - }, - "name": "Deprecated", - "symbolId": "mixed:Deprecated", - }, - "testpkg.DeprecatedClass": Object { - "assembly": "testpkg", - "docs": Object { - "deprecated": "stripped", - "stability": "deprecated", - }, - "fqn": "testpkg.DeprecatedClass", - "initializer": Object {}, - "kind": "class", - "locationInModule": Object { - "filename": "deprecated.ts", - "line": 5, - }, - "name": "DeprecatedClass", - "symbolId": "deprecated:DeprecatedClass", - }, - "testpkg.DeprecatedEnum": Object { - "assembly": "testpkg", - "docs": Object { - "deprecated": "stripped", - "stability": "deprecated", - }, - "fqn": "testpkg.DeprecatedEnum", - "kind": "enum", - "locationInModule": Object { - "filename": "enums.ts", - "line": 8, - }, - "members": Array [ Object { - "docs": Object { - "stability": "deprecated", + "testpkg.Deprecated": Object { + "assembly": "testpkg", + "base": "testpkg.Retained", + "docs": Object { + "deprecated": "stripped", + "stability": "deprecated", + }, + "fqn": "testpkg.Deprecated", + "initializer": Object {}, + "interfaces": Array [ + "testpkg.IRetainedInterface", + ], + "kind": "class", + "locationInModule": Object { + "filename": "mixed.ts", + "line": 10, + }, + "name": "Deprecated", + "symbolId": "mixed:Deprecated", }, - "name": "VALUE_ONE", - }, - Object { - "docs": Object { - "stability": "deprecated", + "testpkg.DeprecatedClass": Object { + "assembly": "testpkg", + "docs": Object { + "deprecated": "stripped", + "stability": "deprecated", + }, + "fqn": "testpkg.DeprecatedClass", + "initializer": Object {}, + "kind": "class", + "locationInModule": Object { + "filename": "deprecated.ts", + "line": 5, + }, + "name": "DeprecatedClass", + "symbolId": "deprecated:DeprecatedClass", }, - "name": "VALUE_TWO", - }, - ], - "name": "DeprecatedEnum", - "symbolId": "enums:DeprecatedEnum", - }, - "testpkg.GrandChild": Object { - "assembly": "testpkg", - "base": "testpkg.Deprecated", - "fqn": "testpkg.GrandChild", - "initializer": Object {}, - "kind": "class", - "locationInModule": Object { - "filename": "mixed.ts", - "line": 11, - }, - "methods": Array [ - Object { - "locationInModule": Object { - "filename": "mixed.ts", - "line": 12, + "testpkg.DeprecatedEnum": Object { + "assembly": "testpkg", + "docs": Object { + "deprecated": "stripped", + "stability": "deprecated", + }, + "fqn": "testpkg.DeprecatedEnum", + "kind": "enum", + "locationInModule": Object { + "filename": "enums.ts", + "line": 8, + }, + "members": Array [ + Object { + "docs": Object { + "stability": "deprecated", + }, + "name": "VALUE_ONE", + }, + Object { + "docs": Object { + "stability": "deprecated", + }, + "name": "VALUE_TWO", + }, + ], + "name": "DeprecatedEnum", + "symbolId": "enums:DeprecatedEnum", }, - "name": "retainedMethod", - }, - ], - "name": "GrandChild", - "symbolId": "mixed:GrandChild", - }, - "testpkg.IRetainedInterface": Object { - "assembly": "testpkg", - "fqn": "testpkg.IRetainedInterface", - "kind": "interface", - "locationInModule": Object { - "filename": "retained.ts", - "line": 2, - }, - "name": "IRetainedInterface", - "symbolId": "retained:IRetainedInterface", - }, - "testpkg.Retained": Object { - "abstract": true, - "assembly": "testpkg", - "fqn": "testpkg.Retained", - "initializer": Object {}, - "kind": "class", - "locationInModule": Object { - "filename": "mixed.ts", - "line": 4, - }, - "name": "Retained", - "properties": Array [ - Object { - "docs": Object { - "deprecated": "stripped", - "stability": "deprecated", + "testpkg.GrandChild": Object { + "assembly": "testpkg", + "base": "testpkg.Deprecated", + "fqn": "testpkg.GrandChild", + "initializer": Object {}, + "kind": "class", + "locationInModule": Object { + "filename": "mixed.ts", + "line": 11, + }, + "methods": Array [ + Object { + "locationInModule": Object { + "filename": "mixed.ts", + "line": 12, + }, + "name": "retainedMethod", + }, + ], + "name": "GrandChild", + "symbolId": "mixed:GrandChild", }, - "immutable": true, - "locationInModule": Object { - "filename": "mixed.ts", - "line": 6, + "testpkg.IRetainedInterface": Object { + "assembly": "testpkg", + "fqn": "testpkg.IRetainedInterface", + "kind": "interface", + "locationInModule": Object { + "filename": "retained.ts", + "line": 2, + }, + "name": "IRetainedInterface", + "symbolId": "retained:IRetainedInterface", }, - "name": "deprecated", - "type": Object { - "primitive": "number", + "testpkg.Retained": Object { + "abstract": true, + "assembly": "testpkg", + "fqn": "testpkg.Retained", + "initializer": Object {}, + "kind": "class", + "locationInModule": Object { + "filename": "mixed.ts", + "line": 4, + }, + "name": "Retained", + "properties": Array [ + Object { + "docs": Object { + "deprecated": "stripped", + "stability": "deprecated", + }, + "immutable": true, + "locationInModule": Object { + "filename": "mixed.ts", + "line": 6, + }, + "name": "deprecated", + "type": Object { + "primitive": "number", + }, + }, + Object { + "immutable": true, + "locationInModule": Object { + "filename": "mixed.ts", + "line": 7, + }, + "name": "retained", + "type": Object { + "primitive": "string", + }, + }, + ], + "symbolId": "mixed:Retained", }, - }, - Object { - "immutable": true, - "locationInModule": Object { - "filename": "mixed.ts", - "line": 7, + "testpkg.RetainedClass": Object { + "assembly": "testpkg", + "fqn": "testpkg.RetainedClass", + "initializer": Object {}, + "kind": "class", + "locationInModule": Object { + "filename": "retained.ts", + "line": 3, + }, + "name": "RetainedClass", + "symbolId": "retained:RetainedClass", }, - "name": "retained", - "type": Object { - "primitive": "string", + "testpkg.SomeEnum": Object { + "assembly": "testpkg", + "fqn": "testpkg.SomeEnum", + "kind": "enum", + "locationInModule": Object { + "filename": "enums.ts", + "line": 2, + }, + "members": Array [ + Object { + "name": "VALUE_RETAINED", + }, + ], + "name": "SomeEnum", + "symbolId": "enums:SomeEnum", }, - }, - ], - "symbolId": "mixed:Retained", - }, - "testpkg.RetainedClass": Object { - "assembly": "testpkg", - "fqn": "testpkg.RetainedClass", - "initializer": Object {}, - "kind": "class", - "locationInModule": Object { - "filename": "retained.ts", - "line": 3, - }, - "name": "RetainedClass", - "symbolId": "retained:RetainedClass", - }, - "testpkg.SomeEnum": Object { - "assembly": "testpkg", - "fqn": "testpkg.SomeEnum", - "kind": "enum", - "locationInModule": Object { - "filename": "enums.ts", - "line": 2, - }, - "members": Array [ - Object { - "name": "VALUE_RETAINED", - }, - ], - "name": "SomeEnum", - "symbolId": "enums:SomeEnum", - }, - } - `); + } + `); expect(declFilesSnapshot(result)).toMatchInlineSnapshot(` - "////////////////// - /// index.d.ts /// - export * from './deprecated'; - export * from './retained'; - export * from './enums'; - export { Deprecated, GrandChild, Retained } from './mixed'; - ////////////////// - - - /////////////////////// - /// deprecated.d.ts /// - /** - * @deprecated stripped - */ - export declare class DeprecatedClass { - } - /////////////////////// - - - ///////////////////// - /// retained.d.ts /// - export interface IRetainedInterface { - } - export declare class RetainedClass { - } - ///////////////////// - - - ////////////////// - /// enums.d.ts /// - export declare enum SomeEnum { - VALUE_RETAINED = 0 - } - /** - * @deprecated stripped - */ - export declare enum DeprecatedEnum { - /** - * @deprecated - */ - VALUE_ONE = 0, - /** - * @deprecated - */ - VALUE_TWO = 1 - } - ////////////////// - - - ////////////////// - /// mixed.d.ts /// - import { IRetainedInterface } from './retained'; - export declare abstract class Retained { - /** - * @deprecated stripped - */ - readonly deprecated = 1337; - readonly retained = \\"YEAH\\"; - } - /** - * @deprecated stripped - */ - export declare class Deprecated extends Retained implements IRetainedInterface { - } - export declare class GrandChild extends Deprecated { - retainedMethod(): void; - } - ////////////////// - " - `); + "////////////////// + /// index.d.ts /// + export * from './deprecated'; + export * from './retained'; + export * from './enums'; + export { Deprecated, GrandChild, Retained } from './mixed'; + ////////////////// + + + /////////////////////// + /// deprecated.d.ts /// + /** @deprecated stripped */ + export declare class DeprecatedClass { + } + /////////////////////// + + + ///////////////////// + /// retained.d.ts /// + export interface IRetainedInterface { + } + export declare class RetainedClass { + } + ///////////////////// + + + ////////////////// + /// enums.d.ts /// + export declare enum SomeEnum { + VALUE_RETAINED = 0 + } + /** @deprecated stripped */ + export declare enum DeprecatedEnum { + VALUE_ONE = 0, + VALUE_TWO = 1 + } + ////////////////// + + + ////////////////// + /// mixed.d.ts /// + import { IRetainedInterface } from './retained'; + export declare abstract class Retained { + /** @deprecated stripped */ + readonly deprecated = 1337; + readonly retained = \\"YEAH\\"; + } + /** @deprecated stripped */ + export declare class Deprecated extends Retained implements IRetainedInterface { + } + export declare class GrandChild extends Deprecated { + retainedMethod(): void; + } + ////////////////// + " + `); }); }); diff --git a/packages/jsii/test/docs.test.ts b/packages/jsii/test/docs.test.ts index 07654f4fc7..b772d2c8ff 100644 --- a/packages/jsii/test/docs.test.ts +++ b/packages/jsii/test/docs.test.ts @@ -1,8 +1,7 @@ import * as spec from '@jsii/spec'; import { Stability } from '@jsii/spec'; -import { sourceToAssemblyHelper as compile, compileJsiiForTest } from '../lib'; -import { renderSymbolDocumentation } from '../lib/docs'; +import { sourceToAssemblyHelper as compile } from '../lib'; jest.setTimeout(60_000); @@ -371,125 +370,3 @@ test('@example can contain @ sign', async () => { const classType = assembly.types!['testpkg.Foo'] as spec.ClassType; expect(classType.docs!.example).toBe("import * as x from '@banana';"); }); - -// ---------------------------------------------------------------------- - -test('@experimental status is reflected in generated docstring', async () => { - const result = await compileJsiiForTest(` - /** - * Here is a fresh class - * - * @experimental - */ - export class Foo { - } - `); - - expect(result.files['index.js']).toContain( - lines( - '/**', - ' * (experimental) Here is a fresh class.', - ' *', - ' * @experimental', - ' */', - 'class Foo {', - '}', - ), - ); - - expect(result.files['index.d.ts']).toContain( - lines( - '/**', - ' * (experimental) Here is a fresh class.', - ' *', - ' * @experimental', - ' */', - 'export declare class Foo {', - '}', - ), - ); -}); - -// ---------------------------------------------------------------------- - -test('@deprecated status is reflected in generated docstring', async () => { - const result = await compileJsiiForTest(` - /** - * Here is an old class - * - * @deprecated Use something else - */ - export class Fogey { - } - `); - - expect(result.files['index.js']).toContain( - lines( - '/**', - ' * (deprecated) Here is an old class.', - ' *', - ' * @deprecated Use something else', - ' */', - 'class Fogey {', - '}', - ), - ); - - expect(result.files['index.d.ts']).toContain( - lines( - '/**', - ' * (deprecated) Here is an old class.', - ' *', - ' * @deprecated Use something else', - ' */', - 'export declare class Fogey {', - '}', - ), - ); -}); - -// ---------------------------------------------------------------------- - -test('Rendering jsii docs back to a doc comment', () => { - expect( - renderSymbolDocumentation({ - summary: 'This is the summary', - remarks: 'You can use this\nor not, as you see fit.', - default: 'thas a default value', - see: 'https://some.url/', - subclassable: true, - returns: 'A value', - example: 'print("a thing");', - custom: { - sing: 'whenyourewinning', - }, - }), - ).toEqual( - lines( - 'This is the summary', - '', - 'You can use this', - 'or not, as you see fit.', - '', - '@returns A value', - '@default thas a default value', - '@see https://some.url/', - '@subclassable', - '@sing whenyourewinning', - '@example', - '', - 'print("a thing");', - ), - ); -}); - -// ---------------------------------------------------------------------- - -function lines(...ls: string[]) { - return indented(0, ...ls); -} - -function indented(indent: number, ...lines: string[]) { - const prefix = ' '.repeat(indent); - return lines.map((l) => `${prefix}${l}`).join('\n'); -} diff --git a/packages/jsii/test/literate.test.ts b/packages/jsii/test/literate.test.ts index 74d44ddf5d..d34bd549ef 100644 --- a/packages/jsii/test/literate.test.ts +++ b/packages/jsii/test/literate.test.ts @@ -99,10 +99,17 @@ test('can do example inclusion', async () => { const fakeLoader = (fileName: string) => { expect(fileName).toBe('test/something.lit.ts'); - return ['const x = 1;', '/// This is how we print x', 'console.log(x);']; + return { + fullPath: fileName, + lines: ['const x = 1;', '/// This is how we print x', 'console.log(x);'], + }; }; - const rendered = await includeAndRenderExamples(inputMarkDown, fakeLoader); + const rendered = await includeAndRenderExamples( + inputMarkDown, + fakeLoader, + '.', + ); expect(rendered).toEqual([ 'This is a preamble', diff --git a/packages/jsii/test/negatives/neg.inheritance-changes-types.from-base.ts b/packages/jsii/test/negatives/neg.inheritance-changes-types.from-base.ts new file mode 100644 index 0000000000..266e392b10 --- /dev/null +++ b/packages/jsii/test/negatives/neg.inheritance-changes-types.from-base.ts @@ -0,0 +1,15 @@ +export interface IHasOptionalProperty { + readonly optionalProperty?: number; +} + +export abstract class HasRequiredPropertyBase { + readonly optionalProperty: number; // Does not implement IHasOptionalProperty.optionalProperty + + protected constructor(value: number) { + this.optionalProperty = value; + } +} + +export class HasRequiredProperty extends HasRequiredPropertyBase implements IHasOptionalProperty { + // Inherits optionalProperty from HasRequiredPropertyBase, but does not implement IHasOptionalProperty correctly. +} diff --git a/packages/jsii/test/submodules.test.ts b/packages/jsii/test/submodules.test.ts index a924a24137..244e5e8d58 100644 --- a/packages/jsii/test/submodules.test.ts +++ b/packages/jsii/test/submodules.test.ts @@ -60,6 +60,30 @@ test('submodules loaded from directories can have targets', async () => { ); }); +test('submodule READMEs can have literate source references', async () => { + const assembly = await sourceToAssemblyHelper({ + 'index.ts': 'export * as submodule from "./subdir"', + 'subdir/index.ts': 'export class Foo { }', + 'subdir/README.md': + 'This is the README\n\n[includable](./test/includeme.lit.ts)', + 'subdir/test/includeme.lit.ts': '// Include me', + }); + + expect(assembly.submodules!['testpkg.submodule']).toEqual( + expect.objectContaining({ + readme: { + markdown: [ + 'This is the README', + '', + '```ts lit=subdir/test/includeme.lit.ts', + '// Include me', + '```', + ].join('\n'), + }, + }), + ); +}); + type ImportStyle = 'directly' | 'as namespace' | 'with alias'; test.each(['directly', 'as namespace', 'with alias'] as ImportStyle[])( diff --git a/packages/oo-ascii-tree/package.json b/packages/oo-ascii-tree/package.json index 906a64df29..abe65c16c3 100644 --- a/packages/oo-ascii-tree/package.json +++ b/packages/oo-ascii-tree/package.json @@ -31,10 +31,10 @@ "package": "package-js" }, "devDependencies": { - "@types/jest": "^27.0.3", - "@types/node": "^12.20.39", - "eslint": "^8.5.0", - "jest": "^27.4.5", + "@types/jest": "^27.4.0", + "@types/node": "^12.20.43", + "eslint": "^8.8.0", + "jest": "^27.4.7", "jsii-build-tools": "^0.0.0", "prettier": "^2.5.1", "typescript": "~3.9.10" diff --git a/superchain/Dockerfile b/superchain/Dockerfile index 25525320ca..f087b55d4f 100644 --- a/superchain/Dockerfile +++ b/superchain/Dockerfile @@ -25,7 +25,11 @@ ARG BUILDPLATFORM ARG TARGETPLATFORM # We require a couple of tools to be available in order to work here... -RUN apt-get update && apt-get install -y curl gpg tar zsh +RUN echo "deb http://deb.debian.org/debian buster-backports main" > /etc/apt/sources.list.d/buster-backports.list \ + && apt-get update \ + && apt-get install -y gpg tar zsh \ + # We need a "recent" (>= 7.71) version of curl for --retry-all-errors, so we get it from backports... + && apt-get install -y -t buster-backports curl # We'll be using zsh substitutions, so ensuring this is the shell we use SHELL ["/bin/zsh", "-c"] @@ -56,17 +60,18 @@ RUN DOTNET_VERSION=$(curl -fSsL "${DOTNET_FEED}/Sdk/${DOTNET_CHANNEL}/latest.ver # Prepare PowerShell LTS distribution ENV POWERSHELL_RELEASES="https://github.com/PowerShell/PowerShell/releases" -RUN POWERSHELL_RELEASE=$(curl -fSsL "https://aka.ms/powershell-release?tag=lts" -o /dev/null -w %{url_effective}) \ +RUN POWERSHELL_RELEASE=$(curl -X GET -fSsIL "https://aka.ms/powershell-release?tag=lts" -o /dev/null \ + --retry 5 --retry-all-errors -w %{url_effective}) \ && POWERSHELL_VERSION=${POWERSHELL_RELEASE#${POWERSHELL_RELEASES}/tag/v} \ && ASSET="powershell-${POWERSHELL_VERSION}-linux-${${TARGETPLATFORM#linux/}/amd64/x64}.tar.gz" \ - && curl -fSsL "${POWERSHELL_RELEASES}/download/v${POWERSHELL_VERSION}/${ASSET}" \ - -o /tmp/powershell.tar.gz \ + && curl -fSsL "${POWERSHELL_RELEASES}/download/v${POWERSHELL_VERSION}/${ASSET}" --retry 5 --retry-all-errors \ + -o /tmp/powershell.tar.gz \ && mkdir -p /opt/microsoft/powershell \ && tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell \ && chmod +x /opt/microsoft/powershell/pwsh # Prepare Go distribution -ARG GO_VERSION="1.16.7" +ARG GO_VERSION="1.17.5" RUN curl -fSsL "https://golang.org/dl/go${GO_VERSION}.linux-${TARGETPLATFORM#linux/}.tar.gz" -o /tmp/go.tar.gz \ && mkdir -p /opt/golang/go \ && tar -xzf /tmp/go.tar.gz -C /opt/golang/go --strip-components=1 diff --git a/superchain/README.md b/superchain/README.md index 79e56fd767..e254208469 100644 --- a/superchain/README.md +++ b/superchain/README.md @@ -16,7 +16,7 @@ SDK | Version `Javascript` | `node >= 12.7.0` OR `node >= 14.16.0` OR `node >= 16.0.0` with `npm >= 6.14.11` (see [NodeJS and NPM](#nodejs-and-npm)) `PowerShell` | `pwsh >= 7.1.3` `Python 3` | `python3 >= 3.7.4` with `pip3 >= 20.0.2` -`Go` | `go >= 1.16` +`Go` | `go >= 1.17` ## Image tags diff --git a/tools/jsii-compliance/package.json b/tools/jsii-compliance/package.json index edef95835a..ff333be0cf 100644 --- a/tools/jsii-compliance/package.json +++ b/tools/jsii-compliance/package.json @@ -16,8 +16,8 @@ "tablemark": "^2.0.0" }, "devDependencies": { - "@types/node": "^12.20.39", - "eslint": "^8.5.0", + "@types/node": "^12.20.43", + "eslint": "^8.8.0", "prettier": "^2.5.1", "ts-node": "^10.4.0", "typescript": "~3.9.10" diff --git a/tools/jsii-compliance/suite.ts b/tools/jsii-compliance/suite.ts index ba895b6706..d32d9b849a 100644 --- a/tools/jsii-compliance/suite.ts +++ b/tools/jsii-compliance/suite.ts @@ -510,6 +510,10 @@ export const suite: schema.Suite = { { name: 'classCanBeUsedWhenNotExpressedlyLoaded', description: 'Validates that types not explicitly loaded by the user can safely be returned by JS code', + }, + { + name: 'downcasting', + description: 'Ensures unsafe-cast features work as expected', } ], }; diff --git a/yarn.lock b/yarn.lock index 6bcde7d335..b833de421f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,32 +2,32 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" - integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA== - dependencies: - "@babel/highlight" "^7.16.0" - -"@babel/compat-data@^7.16.0": - version "7.16.4" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" - integrity sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q== - -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.7.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.5.tgz#924aa9e1ae56e1e55f7184c8bf073a50d8677f5c" - integrity sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ== - dependencies: - "@babel/code-frame" "^7.16.0" - "@babel/generator" "^7.16.5" - "@babel/helper-compilation-targets" "^7.16.3" - "@babel/helper-module-transforms" "^7.16.5" - "@babel/helpers" "^7.16.5" - "@babel/parser" "^7.16.5" - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.5" - "@babel/types" "^7.16.0" +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" + integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== + dependencies: + "@babel/highlight" "^7.16.7" + +"@babel/compat-data@^7.16.4": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.8.tgz#31560f9f29fdf1868de8cb55049538a1b9732a60" + integrity sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q== + +"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": + version "7.16.12" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.12.tgz#5edc53c1b71e54881315923ae2aedea2522bb784" + integrity sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.16.8" + "@babel/helper-compilation-targets" "^7.16.7" + "@babel/helper-module-transforms" "^7.16.7" + "@babel/helpers" "^7.16.7" + "@babel/parser" "^7.16.12" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.16.10" + "@babel/types" "^7.16.8" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -35,127 +35,127 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.16.5", "@babel/generator@^7.7.2": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.5.tgz#26e1192eb8f78e0a3acaf3eede3c6fc96d22bedf" - integrity sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA== +"@babel/generator@^7.16.8", "@babel/generator@^7.7.2": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.8.tgz#359d44d966b8cd059d543250ce79596f792f2ebe" + integrity sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.16.8" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-compilation-targets@^7.16.3": - version "7.16.3" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz#5b480cd13f68363df6ec4dc8ac8e2da11363cbf0" - integrity sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA== +"@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== dependencies: - "@babel/compat-data" "^7.16.0" - "@babel/helper-validator-option" "^7.14.5" + "@babel/compat-data" "^7.16.4" + "@babel/helper-validator-option" "^7.16.7" browserslist "^4.17.5" semver "^6.3.0" -"@babel/helper-environment-visitor@^7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz#f6a7f38b3c6d8b07c88faea083c46c09ef5451b8" - integrity sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-function-name@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481" - integrity sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog== - dependencies: - "@babel/helper-get-function-arity" "^7.16.0" - "@babel/template" "^7.16.0" - "@babel/types" "^7.16.0" - -"@babel/helper-get-function-arity@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa" - integrity sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-hoist-variables@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a" - integrity sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-module-imports@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz#90538e60b672ecf1b448f5f4f5433d37e79a3ec3" - integrity sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-module-transforms@^7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.5.tgz#530ebf6ea87b500f60840578515adda2af470a29" - integrity sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ== - dependencies: - "@babel/helper-environment-visitor" "^7.16.5" - "@babel/helper-module-imports" "^7.16.0" - "@babel/helper-simple-access" "^7.16.0" - "@babel/helper-split-export-declaration" "^7.16.0" - "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.5" - "@babel/types" "^7.16.0" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.5", "@babel/helper-plugin-utils@^7.8.0": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.5.tgz#afe37a45f39fce44a3d50a7958129ea5b1a5c074" - integrity sha512-59KHWHXxVA9K4HNF4sbHCf+eJeFe0Te/ZFGqBT4OjXhrwvA04sGfaEGsVTdsjoszq0YTP49RC9UKe5g8uN2RwQ== - -"@babel/helper-simple-access@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz#21d6a27620e383e37534cf6c10bba019a6f90517" - integrity sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-split-export-declaration@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" - integrity sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-validator-identifier@^7.15.7": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" - integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== - -"@babel/helper-validator-option@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" - integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== - -"@babel/helpers@^7.16.5": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.5.tgz#29a052d4b827846dd76ece16f565b9634c554ebd" - integrity sha512-TLgi6Lh71vvMZGEkFuIxzaPsyeYCHQ5jJOOX1f0xXn0uciFuE8cEk0wyBquMcCxBXZ5BJhE2aUB7pnWTD150Tw== - dependencies: - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.5" - "@babel/types" "^7.16.0" - -"@babel/highlight@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" - integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== - dependencies: - "@babel/helper-validator-identifier" "^7.15.7" +"@babel/helper-environment-visitor@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7" + integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-function-name@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" + integrity sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA== + dependencies: + "@babel/helper-get-function-arity" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/types" "^7.16.7" + +"@babel/helper-get-function-arity@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" + integrity sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-hoist-variables@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" + integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-module-imports@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" + integrity sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-module-transforms@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz#7665faeb721a01ca5327ddc6bba15a5cb34b6a41" + integrity sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng== + dependencies: + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-module-imports" "^7.16.7" + "@babel/helper-simple-access" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/helper-validator-identifier" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.16.7" + "@babel/types" "^7.16.7" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.8.0": + version "7.16.7" + 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== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-split-export-declaration@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" + integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== + dependencies: + "@babel/types" "^7.16.7" + +"@babel/helper-validator-identifier@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" + integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== + +"@babel/helper-validator-option@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" + integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== + +"@babel/helpers@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.7.tgz#7e3504d708d50344112767c3542fc5e357fffefc" + integrity sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw== + dependencies: + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.16.7" + "@babel/types" "^7.16.7" + +"@babel/highlight@^7.16.7": + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" + integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== + dependencies: + "@babel/helper-validator-identifier" "^7.16.7" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.0", "@babel/parser@^7.16.5", "@babel/parser@^7.7.2": - version "7.16.6" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.6.tgz#8f194828193e8fa79166f34a4b4e52f3e769a314" - integrity sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.10", "@babel/parser@^7.16.12", "@babel/parser@^7.16.7": + version "7.16.12" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.12.tgz#9474794f9a650cf5e2f892444227f98e28cdf8b6" + integrity sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -242,50 +242,50 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.5.tgz#f47a33e4eee38554f00fb6b2f894fa1f5649b0b3" - integrity sha512-/d4//lZ1Vqb4mZ5xTep3dDK888j7BGM/iKqBmndBaoYAFPlPKrGU608VVBz5JeyAb6YQDjRu1UKqj86UhwWVgw== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz#39c9b55ee153151990fb038651d58d3fd03f98f8" + integrity sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A== dependencies: - "@babel/helper-plugin-utils" "^7.16.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/runtime@^7.14.6", "@babel/runtime@^7.7.6": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.5.tgz#7f3e34bf8bdbbadf03fbb7b1ea0d929569c9487a" - integrity sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.7.tgz#03ff99f64106588c9c403c6ecb8c3bafbbdff1fa" + integrity sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.16.0", "@babel/template@^7.3.3": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6" - integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A== - dependencies: - "@babel/code-frame" "^7.16.0" - "@babel/parser" "^7.16.0" - "@babel/types" "^7.16.0" - -"@babel/traverse@^7.1.0", "@babel/traverse@^7.16.5", "@babel/traverse@^7.7.2": - version "7.16.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.5.tgz#d7d400a8229c714a59b87624fc67b0f1fbd4b2b3" - integrity sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ== - dependencies: - "@babel/code-frame" "^7.16.0" - "@babel/generator" "^7.16.5" - "@babel/helper-environment-visitor" "^7.16.5" - "@babel/helper-function-name" "^7.16.0" - "@babel/helper-hoist-variables" "^7.16.0" - "@babel/helper-split-export-declaration" "^7.16.0" - "@babel/parser" "^7.16.5" - "@babel/types" "^7.16.0" +"@babel/template@^7.16.7", "@babel/template@^7.3.3": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" + integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/parser" "^7.16.7" + "@babel/types" "^7.16.7" + +"@babel/traverse@^7.16.10", "@babel/traverse@^7.16.7", "@babel/traverse@^7.7.2": + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.10.tgz#448f940defbe95b5a8029975b051f75993e8239f" + integrity sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.16.8" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-hoist-variables" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/parser" "^7.16.10" + "@babel/types" "^7.16.8" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.16.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" - integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== +"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.8.tgz#0ba5da91dd71e0a4e7781a30f22770831062e3c1" + integrity sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg== dependencies: - "@babel/helper-validator-identifier" "^7.15.7" + "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -334,9 +334,9 @@ integrity sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw== "@humanwhocodes/config-array@^0.9.2": - version "0.9.2" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914" - integrity sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA== + version "0.9.3" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.3.tgz#f2564c744b387775b436418491f15fce6601f63e" + integrity sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" @@ -368,27 +368,27 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.4.2.tgz#7a95612d38c007ddb528ee446fe5e5e785e685ce" - integrity sha512-xknHThRsPB/To1FUbi6pCe43y58qFC03zfb6R7fDb/FfC7k2R3i1l+izRBJf8DI46KhYGRaF14Eo9A3qbBoixg== +"@jest/console@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.4.6.tgz#0742e6787f682b22bdad56f9db2a8a77f6a86107" + integrity sha512-jauXyacQD33n47A44KrlOVeiXHEXDqapSdfb9kTekOchH/Pd18kBIO1+xxJQRLuG+LUuljFCwTG92ra4NW7SpA== dependencies: "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.4.2" + jest-message-util "^27.4.6" jest-util "^27.4.2" slash "^3.0.0" -"@jest/core@^27.4.5": - version "27.4.5" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.5.tgz#cae2dc34259782f4866c6606c3b480cce920ed4c" - integrity sha512-3tm/Pevmi8bDsgvo73nX8p/WPng6KWlCyScW10FPEoN1HU4pwI83tJ3TsFvi1FfzsjwUlMNEPowgb/rPau/LTQ== +"@jest/core@^27.4.7": + version "27.4.7" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.7.tgz#84eabdf42a25f1fa138272ed229bcf0a1b5e6913" + integrity sha512-n181PurSJkVMS+kClIFSX/LLvw9ExSb+4IMtD6YnfxZVerw9ANYtW0bPrm0MJu2pfe9SY9FJ9FtQ+MdZkrZwjg== dependencies: - "@jest/console" "^27.4.2" - "@jest/reporters" "^27.4.5" - "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.5" + "@jest/console" "^27.4.6" + "@jest/reporters" "^27.4.6" + "@jest/test-result" "^27.4.6" + "@jest/transform" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" ansi-escapes "^4.2.1" @@ -397,63 +397,63 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.4.2" - jest-config "^27.4.5" - jest-haste-map "^27.4.5" - jest-message-util "^27.4.2" + jest-config "^27.4.7" + jest-haste-map "^27.4.6" + jest-message-util "^27.4.6" jest-regex-util "^27.4.0" - jest-resolve "^27.4.5" - jest-resolve-dependencies "^27.4.5" - jest-runner "^27.4.5" - jest-runtime "^27.4.5" - jest-snapshot "^27.4.5" + jest-resolve "^27.4.6" + jest-resolve-dependencies "^27.4.6" + jest-runner "^27.4.6" + jest-runtime "^27.4.6" + jest-snapshot "^27.4.6" jest-util "^27.4.2" - jest-validate "^27.4.2" - jest-watcher "^27.4.2" + jest-validate "^27.4.6" + jest-watcher "^27.4.6" micromatch "^4.0.4" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.4.4": - version "27.4.4" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.4.4.tgz#66ebebc79673d84aad29d2bb70a8c51e6c29bb4d" - integrity sha512-q+niMx7cJgt/t/b6dzLOh4W8Ef/8VyKG7hxASK39jakijJzbFBGpptx3RXz13FFV7OishQ9lTbv+dQ5K3EhfDQ== +"@jest/environment@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.4.6.tgz#1e92885d64f48c8454df35ed9779fbcf31c56d8b" + integrity sha512-E6t+RXPfATEEGVidr84WngLNWZ8ffCPky8RqqRK6u1Bn0LK92INe0MDttyPl/JOzaq92BmDzOeuqk09TvM22Sg== dependencies: - "@jest/fake-timers" "^27.4.2" + "@jest/fake-timers" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" - jest-mock "^27.4.2" + jest-mock "^27.4.6" -"@jest/fake-timers@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.4.2.tgz#d217f86c3ba2027bf29e0b731fd0cb761a72d093" - integrity sha512-f/Xpzn5YQk5adtqBgvw1V6bF8Nx3hY0OIRRpCvWcfPl0EAjdqWPdhH3t/3XpiWZqtjIEHDyMKP9ajpva1l4Zmg== +"@jest/fake-timers@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.4.6.tgz#e026ae1671316dbd04a56945be2fa251204324e8" + integrity sha512-mfaethuYF8scV8ntPpiVGIHQgS0XIALbpY2jt2l7wb/bvq4Q5pDLk4EP4D7SAvYT1QrPOPVZAtbdGAOOyIgs7A== dependencies: "@jest/types" "^27.4.2" "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.4.2" - jest-mock "^27.4.2" + jest-message-util "^27.4.6" + jest-mock "^27.4.6" jest-util "^27.4.2" -"@jest/globals@^27.4.4": - version "27.4.4" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.4.4.tgz#fe501a80c23ea2dab585c42be2a519bb5e38530d" - integrity sha512-bqpqQhW30BOreXM8bA8t8JbOQzsq/WnPTnBl+It3UxAD9J8yxEAaBEylHx1dtBapAr/UBk8GidXbzmqnee8tYQ== +"@jest/globals@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.4.6.tgz#3f09bed64b0fd7f5f996920258bd4be8f52f060a" + integrity sha512-kAiwMGZ7UxrgPzu8Yv9uvWmXXxsy0GciNejlHvfPIfWkSxChzv6bgTS3YqBkGuHcis+ouMFI2696n2t+XYIeFw== dependencies: - "@jest/environment" "^27.4.4" + "@jest/environment" "^27.4.6" "@jest/types" "^27.4.2" - expect "^27.4.2" + expect "^27.4.6" -"@jest/reporters@^27.4.5": - version "27.4.5" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.4.5.tgz#e229acca48d18ea39e805540c1c322b075ae63ad" - integrity sha512-3orsG4vi8zXuBqEoy2LbnC1kuvkg1KQUgqNxmxpQgIOQEPeV0onvZu+qDQnEoX8qTQErtqn/xzcnbpeTuOLSiA== +"@jest/reporters@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.4.6.tgz#b53dec3a93baf9b00826abf95b932de919d6d8dd" + integrity sha512-+Zo9gV81R14+PSq4wzee4GC2mhAN9i9a7qgJWL90Gpx7fHYkWpTBvwWNZUXvJByYR9tAVBdc8VxDWqfJyIUrIQ== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.4.2" - "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.5" + "@jest/console" "^27.4.6" + "@jest/test-result" "^27.4.6" + "@jest/transform" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" @@ -462,14 +462,14 @@ glob "^7.1.2" graceful-fs "^4.2.4" istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^4.0.3" + istanbul-lib-instrument "^5.1.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.0.2" - jest-haste-map "^27.4.5" - jest-resolve "^27.4.5" + istanbul-reports "^3.1.3" + jest-haste-map "^27.4.6" + jest-resolve "^27.4.6" jest-util "^27.4.2" - jest-worker "^27.4.5" + jest-worker "^27.4.6" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -485,43 +485,43 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.4.2.tgz#05fd4a5466ec502f3eae0b39dff2b93ea4d5d9ec" - integrity sha512-kr+bCrra9jfTgxHXHa2UwoQjxvQk3Am6QbpAiJ5x/50LW8llOYrxILkqY0lZRW/hu8FXesnudbql263+EW9iNA== +"@jest/test-result@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.4.6.tgz#b3df94c3d899c040f602cea296979844f61bdf69" + integrity sha512-fi9IGj3fkOrlMmhQqa/t9xum8jaJOOAi/lZlm6JXSc55rJMXKHxNDN1oCP39B0/DhNOa2OMupF9BcKZnNtXMOQ== dependencies: - "@jest/console" "^27.4.2" + "@jest/console" "^27.4.6" "@jest/types" "^27.4.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.4.5": - version "27.4.5" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.4.5.tgz#1d7e026844d343b60d2ca7fd82c579a17b445d7d" - integrity sha512-n5woIn/1v+FT+9hniymHPARA9upYUmfi5Pw9ewVwXCDlK4F5/Gkees9v8vdjGdAIJ2MPHLHodiajLpZZanWzEQ== +"@jest/test-sequencer@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.4.6.tgz#447339b8a3d7b5436f50934df30854e442a9d904" + integrity sha512-3GL+nsf6E1PsyNsJuvPyIz+DwFuCtBdtvPpm/LMXVkBJbdFvQYCDpccYT56qq5BGniXWlE81n2qk1sdXfZebnw== dependencies: - "@jest/test-result" "^27.4.2" + "@jest/test-result" "^27.4.6" graceful-fs "^4.2.4" - jest-haste-map "^27.4.5" - jest-runtime "^27.4.5" + jest-haste-map "^27.4.6" + jest-runtime "^27.4.6" -"@jest/transform@^27.4.5": - version "27.4.5" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.4.5.tgz#3dfe2e3680cd4aa27356172bf25617ab5b94f195" - integrity sha512-PuMet2UlZtlGzwc6L+aZmR3I7CEBpqadO03pU40l2RNY2fFJ191b9/ITB44LNOhVtsyykx0OZvj0PCyuLm7Eew== +"@jest/transform@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.4.6.tgz#153621940b1ed500305eacdb31105d415dc30231" + integrity sha512-9MsufmJC8t5JTpWEQJ0OcOOAXaH5ioaIX6uHVBLBMoCZPfKKQF+EqP8kACAvCZ0Y1h2Zr3uOccg8re+Dr5jxyw== dependencies: "@babel/core" "^7.1.0" "@jest/types" "^27.4.2" - babel-plugin-istanbul "^6.0.0" + babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.4.5" + jest-haste-map "^27.4.6" jest-regex-util "^27.4.0" jest-util "^27.4.2" micromatch "^4.0.4" - pirates "^4.0.1" + pirates "^4.0.4" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" @@ -1372,15 +1372,15 @@ once "^1.4.0" "@octokit/request@^5.6.0": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.2.tgz#1aa74d5da7b9e04ac60ef232edd9a7438dcf32d8" - integrity sha512-je66CvSEVf0jCpRISxkUcCa0UkxmFs6eGDRSbfJtAVwbLH5ceqF+YEyC8lj8ystKyZTy8adWr0qmkY52EfOeLA== + version "5.6.3" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0" + integrity sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A== dependencies: "@octokit/endpoint" "^6.0.1" "@octokit/request-error" "^2.1.0" "@octokit/types" "^6.16.1" is-plain-object "^5.0.0" - node-fetch "^2.6.1" + node-fetch "^2.6.7" universal-user-agent "^6.0.0" "@octokit/rest@^18.1.0", "@octokit/rest@^18.12.0": @@ -1440,9 +1440,9 @@ integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": - version "7.1.17" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.17.tgz#f50ac9d20d64153b510578d84f9643f9a3afbe64" - integrity sha512-6zzkezS9QEIL8yCBvXWxPTJPNuMeECJVxSOhxNY/jfq9LxOTHivaYTqr37n9LknWWRTIkzqH2UilS5QFvfa90A== + 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== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -1502,17 +1502,17 @@ dotenv "*" "@types/eslint-scope@^3.7.0": - version "3.7.2" - resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.2.tgz#11e96a868c67acf65bf6f11d10bb89ea71d5e473" - integrity sha512-TzgYCWoPiTeRg6RQYgtuW7iODtVoKu3RVL72k3WohqhjfaOLK5Mg2T4Tg1o2bSfu0vPkoI48wdQFv5b/Xe04wQ== + version "3.7.3" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.3.tgz#125b88504b61e3c8bc6f870882003253005c3224" + integrity sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g== dependencies: "@types/eslint" "*" "@types/estree" "*" "@types/eslint@*": - version "8.2.1" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.2.1.tgz#13f3d69bac93c2ae008019c28783868d0a1d6605" - integrity sha512-UP9rzNn/XyGwb5RQ2fok+DzcIRIYwc16qTXse5+Smsy8MOIccCChT15KAwnsgQx4PzJkaMq4myFyZ4CL5TjhIQ== + version "8.4.1" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.1.tgz#c48251553e8759db9e656de3efc846954ac32304" + integrity sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -1536,10 +1536,10 @@ dependencies: "@types/node" "*" -"@types/inquirer@^8.1.3": - version "8.1.3" - resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-8.1.3.tgz#dfda4c97cdbe304e4dceb378a80f79448ea5c8fe" - integrity sha512-AayK4ZL5ssPzR1OtnOLGAwpT0Dda3Xi/h1G0l1oJDNrowp7T1423q4Zb8/emr7tzRlCy4ssEri0LWVexAqHyKQ== +"@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== dependencies: "@types/through" "*" rxjs "^7.2.0" @@ -1563,10 +1563,10 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.3.tgz#0cf9dfe9009e467f70a342f0f94ead19842a783a" - integrity sha512-cmmwv9t7gBYt7hNKH5Spu7Kuu/DotGa+Ff+JGRKZ4db5eh8PnKS4LuebJ3YLUoyOyIHraTGyULn23YtEAm0VSg== +"@types/jest@^27.4.0": + version "27.4.0" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.4.0.tgz#037ab8b872067cae842a320841693080f9cb84ed" + integrity sha512-gHl8XuC1RZ8H2j5sHv/JqsaxXkDDM9iDOgu0Wp8sjs4u/snb2PVehyWXJPr+ORA0RPpgw231mnutWI1+0hgjIQ== dependencies: jest-diff "^27.0.0" pretty-format "^27.0.0" @@ -1592,9 +1592,9 @@ integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== "@types/minipass@*": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@types/minipass/-/minipass-3.1.0.tgz#616dcc2205982d4c720f4c7e9a9fddc497245273" - integrity sha512-b2yPKwCrB8x9SB65kcCistMoe3wrYnxxt5rJSZ1kprw0uOXvhuKi9kTQ746Y+Pbqoh+9C0N4zt0ztmTnG9yg7A== + version "3.1.2" + resolved "https://registry.yarnpkg.com/@types/minipass/-/minipass-3.1.2.tgz#e2d7f9df0698aff421dcf145b4fc05b8183b9030" + integrity sha512-foLGjgrJkUjLG/o2t2ymlZGEoBNBa/TfoUZ7oCTkOjP1T43UGBJspovJou/l3ZuHvye2ewR5cZNtp2zyWgILMA== dependencies: "@types/node" "*" @@ -1606,19 +1606,19 @@ "@types/node" "*" "@types/node@*": - version "17.0.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.5.tgz#57ca67ec4e57ad9e4ef5a6bab48a15387a1c83e0" - integrity sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw== + version "17.0.14" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.14.tgz#33b9b94f789a8fedd30a68efdbca4dbb06b61f20" + integrity sha512-SbjLmERksKOGzWzPNuW7fJM7fk3YXVTFiZWB/Hs99gwhk+/dnrQRPBQjPW9aO+fi1tAffi9PrwFvsmOKmDTyng== -"@types/node@^12.20.39": - version "12.20.39" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.39.tgz#ef3cb119eaba80e9f1012c78b9384a7489a18bf6" - integrity sha512-U7PMwkDmc3bnL0e4U8oA0POpi1vfsYDc+DEUS2+rPxm9NlLcW1dBa5JcRhO633PoPUcCSWMNXrMsqhmAVEo+IQ== +"@types/node@^12.20.43": + version "12.20.43" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.43.tgz#6cf47894da4a4748c62fccf720ba269e1b1ff5a4" + integrity sha512-HCfJdaYqJX3BCzeihgZrD7b85Cu05OC/GVJ4kEYIflwUs4jbnUlLLWoq7hw1LBcdvUyehO+gr6P5JQ895/2ZfA== "@types/node@^16.9.2": - version "16.11.17" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.17.tgz#ae146499772e33fc6382e1880bc567e41a528586" - integrity sha512-C1vTZME8cFo8uxY2ui41xcynEotVkczIVI5AjLmy5pkpBv/FtG+jhtOlfcPysI8VRVwoOMv6NJm44LGnoMSWkw== + version "16.11.22" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.22.tgz#e704150225bfc4195f8ce68a7ac8da02b753549a" + integrity sha512-DYNtJWauMQ9RNpesl4aVothr97/tIJM8HbyOXJ0AYT1Z2bEjLHyfjOBPAQQVMLf8h3kSShYfNk8Wnto8B2zHUA== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -1631,9 +1631,9 @@ integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== "@types/prettier@^2.1.5": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.2.tgz#4c62fae93eb479660c3bd93f9d24d561597a8281" - integrity sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA== + version "2.4.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.3.tgz#a3c65525b91fca7da00ab1a3ac2b5a2a4afbffbf" + integrity sha512-QzSuZMBuG5u8HqYz01qtMdg/Jfctlnvj1z/lYnIDXs/golxw0fxtRAHd9KrzjR7Yxz1qVeI00o0kiO3PmVdJ9w== "@types/semver@^7.3.9": version "7.3.9" @@ -1701,13 +1701,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.1.tgz#97dfaa39f38e99f86801fdf34f9f1bed66704258" - integrity sha512-wTZ5oEKrKj/8/366qTM366zqhIKAp6NCMweoRONtfuC07OAU9nVI2GZZdqQ1qD30WAAtcPdkH+npDwtRFdp4Rw== +"@typescript-eslint/eslint-plugin@^5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.2.tgz#f8c1d59fc37bd6d9d11c97267fdfe722c4777152" + integrity sha512-4W/9lLuE+v27O/oe7hXJKjNtBLnZE8tQAFpapdxwSVHqtmIoPB1gph3+ahNwVuNL37BX7YQHyGF9Xv6XCnIX2Q== dependencies: - "@typescript-eslint/experimental-utils" "5.8.1" - "@typescript-eslint/scope-manager" "5.8.1" + "@typescript-eslint/scope-manager" "5.10.2" + "@typescript-eslint/type-utils" "5.10.2" + "@typescript-eslint/utils" "5.10.2" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -1715,60 +1716,69 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.1.tgz#01861eb2f0749f07d02db342b794145a66ed346f" - integrity sha512-fbodVnjIDU4JpeXWRDsG5IfIjYBxEvs8EBO8W1+YVdtrc2B9ppfof5sZhVEDOtgTfFHnYQJDI8+qdqLYO4ceww== +"@typescript-eslint/parser@^5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.10.2.tgz#b6076d27cc5499ce3f2c625f5ccde946ecb7db9a" + integrity sha512-JaNYGkaQVhP6HNF+lkdOr2cAs2wdSZBoalE22uYWq8IEv/OVH0RksSGydk+sW8cLoSeYmC+OHvRyv2i4AQ7Czg== dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.8.1" - "@typescript-eslint/types" "5.8.1" - "@typescript-eslint/typescript-estree" "5.8.1" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" + "@typescript-eslint/scope-manager" "5.10.2" + "@typescript-eslint/types" "5.10.2" + "@typescript-eslint/typescript-estree" "5.10.2" + debug "^4.3.2" -"@typescript-eslint/parser@^5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.8.1.tgz#380f5f1e596b540059998aa3fc80d78f0f9b0d0a" - integrity sha512-K1giKHAjHuyB421SoXMXFHHVI4NdNY603uKw92++D3qyxSeYvC10CBJ/GE5Thpo4WTUvu1mmJI2/FFkz38F2Gw== +"@typescript-eslint/scope-manager@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz#92c0bc935ec00f3d8638cdffb3d0e70c9b879639" + integrity sha512-39Tm6f4RoZoVUWBYr3ekS75TYgpr5Y+X0xLZxXqcZNDWZdJdYbKd3q2IR4V9y5NxxiPu/jxJ8XP7EgHiEQtFnw== dependencies: - "@typescript-eslint/scope-manager" "5.8.1" - "@typescript-eslint/types" "5.8.1" - "@typescript-eslint/typescript-estree" "5.8.1" - debug "^4.3.2" + "@typescript-eslint/types" "5.10.2" + "@typescript-eslint/visitor-keys" "5.10.2" -"@typescript-eslint/scope-manager@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.8.1.tgz#7fc0604f7ade8833e4d42cebaa1e2debf8b932e4" - integrity sha512-DGxJkNyYruFH3NIZc3PwrzwOQAg7vvgsHsHCILOLvUpupgkwDZdNq/cXU3BjF4LNrCsVg0qxEyWasys5AiJ85Q== +"@typescript-eslint/type-utils@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.2.tgz#ad5acdf98a7d2ab030bea81f17da457519101ceb" + integrity sha512-uRKSvw/Ccs5FYEoXW04Z5VfzF2iiZcx8Fu7DGIB7RHozuP0VbKNzP1KfZkHBTM75pCpsWxIthEH1B33dmGBKHw== dependencies: - "@typescript-eslint/types" "5.8.1" - "@typescript-eslint/visitor-keys" "5.8.1" + "@typescript-eslint/utils" "5.10.2" + debug "^4.3.2" + tsutils "^3.21.0" -"@typescript-eslint/types@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.1.tgz#04c6b49ebc8c99238238a6b8b43f2fc613983b5a" - integrity sha512-L/FlWCCgnjKOLefdok90/pqInkomLnAcF9UAzNr+DSqMC3IffzumHTQTrINXhP1gVp9zlHiYYjvozVZDPleLcA== +"@typescript-eslint/types@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.2.tgz#604d15d795c4601fffba6ecb4587ff9fdec68ce8" + integrity sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w== -"@typescript-eslint/typescript-estree@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.1.tgz#a592855be688e7b729a1e9411d7d74ec992ed6ef" - integrity sha512-26lQ8l8tTbG7ri7xEcCFT9ijU5Fk+sx/KRRyyzCv7MQ+rZZlqiDPtMKWLC8P7o+dtCnby4c+OlxuX1tp8WfafQ== +"@typescript-eslint/typescript-estree@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz#810906056cd3ddcb35aa333fdbbef3713b0fe4a7" + integrity sha512-WHHw6a9vvZls6JkTgGljwCsMkv8wu8XU8WaYKeYhxhWXH/atZeiMW6uDFPLZOvzNOGmuSMvHtZKd6AuC8PrwKQ== dependencies: - "@typescript-eslint/types" "5.8.1" - "@typescript-eslint/visitor-keys" "5.8.1" + "@typescript-eslint/types" "5.10.2" + "@typescript-eslint/visitor-keys" "5.10.2" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.1.tgz#58a2c566265d5511224bc316149890451c1bbab0" - integrity sha512-SWgiWIwocK6NralrJarPZlWdr0hZnj5GXHIgfdm8hNkyKvpeQuFyLP6YjSIe9kf3YBIfU6OHSZLYkQ+smZwtNg== +"@typescript-eslint/utils@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.2.tgz#1fcd37547c32c648ab11aea7173ec30060ee87a8" + integrity sha512-vuJaBeig1NnBRkf7q9tgMLREiYD7zsMrsN1DA3wcoMDvr3BTFiIpKjGiYZoKPllfEwN7spUjv7ZqD+JhbVjEPg== + dependencies: + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.10.2" + "@typescript-eslint/types" "5.10.2" + "@typescript-eslint/typescript-estree" "5.10.2" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/visitor-keys@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz#fdbf272d8e61c045d865bd6c8b41bea73d222f3d" + integrity sha512-zHIhYGGGrFJvvyfwHk5M08C5B5K4bewkm+rrvNTKk1/S15YHR+SA/QUF8ZWscXSfEaB8Nn2puZj+iHcoxVOD/Q== dependencies: - "@typescript-eslint/types" "5.8.1" + "@typescript-eslint/types" "5.10.2" eslint-visitor-keys "^3.0.0" "@webassemblyjs/ast@1.11.1": @@ -1892,22 +1902,22 @@ "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.1.0.tgz#8342bef0badfb7dfd3b576f2574ab80c725be043" - integrity sha512-ttOkEkoalEHa7RaFYpM0ErK1xc4twg3Am9hfHhL7MVqlHebnkYd2wuI/ZqTDj0cVzZho6PdinY0phFZV3O0Mzg== +"@webpack-cli/configtest@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.1.1.tgz#9f53b1b7946a6efc2a749095a4f450e2932e8356" + integrity sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg== -"@webpack-cli/info@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.4.0.tgz#b9179c3227ab09cbbb149aa733475fcf99430223" - integrity sha512-F6b+Man0rwE4n0409FyAJHStYA5OIZERxmnUfLVwv0mc0V1wLad3V7jqRlMkgKBeAq07jUvglacNaa6g9lOpuw== +"@webpack-cli/info@^1.4.1": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.4.1.tgz#2360ea1710cbbb97ff156a3f0f24556e0fc1ebea" + integrity sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA== dependencies: envinfo "^7.7.3" -"@webpack-cli/serve@^1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.6.0.tgz#2c275aa05c895eccebbfc34cfb223c6e8bd591a2" - integrity sha512-ZkVeqEmRpBV2GHvjjUZqEai2PpUbuq8Bqd//vEYsp63J8WyexI8ppCqVS3Zs0QADf6aWuPdU+0XsPI647PVlQA== +"@webpack-cli/serve@^1.6.1": + version "1.6.1" + 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.0": version "0.8.0" @@ -1975,7 +1985,7 @@ acorn@^7.1.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.4.1, acorn@^8.6.0: +acorn@^8.2.4, acorn@^8.4.1, acorn@^8.7.0: version "8.7.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== @@ -1993,9 +2003,9 @@ agent-base@6, agent-base@^6.0.2: debug "4" agentkeepalive@^4.1.3: - version "4.1.4" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.1.4.tgz#d928028a4862cb11718e55227872e842a44c945b" - integrity sha512-+V/rGa3EuU74H6wR04plBb7Ks10FbtUQgRj/FQOG7uUIEuaINI+AiqJR1k6t3SVNs7o7ZjIdus6706qqzVq8jQ== + version "4.2.0" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.2.0.tgz#616ce94ccb41d1a39a45d203d8076fe98713062d" + integrity sha512-0PhAp58jZNw13UJv7NVdTGb0ZcghHUb3DrZ046JiiJY/BOaTTpbwdHq2VObPCBV8M2GPh7sgrJ3AQ8Ey468LJw== dependencies: debug "^4.1.0" depd "^1.1.2" @@ -2040,11 +2050,6 @@ all-contributors-cli@^6.20.0: pify "^5.0.0" yargs "^15.0.1" -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -2187,9 +2192,9 @@ assert-plus@1.0.0, assert-plus@^1.0.0: integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= async@^3.0.1: - version "3.2.2" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.2.tgz#2eb7671034bb2194d45d30e31e24ec7e7f9670cd" - integrity sha512-H0E+qZaDEfx/FY4t7iLRv1W2fFI6+pyCeTw1uN20AQPiwqwM6ojPxHxdLv4z8hi2DtnW9BOckSspLucW7pIE5g== + version "3.2.3" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9" + integrity sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g== asynckit@^0.4.0: version "0.4.0" @@ -2216,21 +2221,21 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -babel-jest@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.4.5.tgz#d38bd0be8ea71d8b97853a5fc9f76deeb095c709" - integrity sha512-3uuUTjXbgtODmSv/DXO9nZfD52IyC2OYTFaXGRzL0kpykzroaquCrD5+lZNafTvZlnNqZHt5pb0M08qVBZnsnA== +babel-jest@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.4.6.tgz#4d024e69e241cdf4f396e453a07100f44f7ce314" + integrity sha512-qZL0JT0HS1L+lOuH+xC2DVASR3nunZi/ozGhpgauJHgmI7f8rudxf6hUjEHympdQ/J64CdKmPkgfJ+A3U6QCrg== dependencies: - "@jest/transform" "^27.4.5" + "@jest/transform" "^27.4.6" "@jest/types" "^27.4.2" "@types/babel__core" "^7.1.14" - babel-plugin-istanbul "^6.0.0" + babel-plugin-istanbul "^6.1.1" babel-preset-jest "^27.4.0" chalk "^4.0.0" graceful-fs "^4.2.4" slash "^3.0.0" -babel-plugin-istanbul@^6.0.0: +babel-plugin-istanbul@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== @@ -2410,15 +2415,15 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -camelcase@^6.2.0, camelcase@^6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.1.tgz#250fd350cfd555d0d2160b1d51510eaf8326e86e" - integrity sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA== +camelcase@^6.2.0, camelcase@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001286: - version "1.0.30001294" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001294.tgz#4849f27b101fd59ddee3751598c663801032533d" - integrity sha512-LiMlrs1nSKZ8qkNhpUf5KD0Al1KCBE3zaT7OLOwEkagXMEDij98SiOovn9wxVGQpklk9vVC/pUSqgYmkmKOS8g== + version "1.0.30001305" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001305.tgz#02cd8031df07c4fcb117aa2ecc4899122681bd4c" + integrity sha512-p7d9YQMji8haf0f+5rbcv9WlQ+N5jMPfRAnUmZRlNxsNeBO3Yr7RYG6M2uTY1h9tCVdlkJg6YNNc4kiAiBLdWA== case@^1.6.3: version "1.6.3" @@ -2444,7 +2449,7 @@ chalk@^2.0.0, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: +chalk@^4, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -2597,11 +2602,6 @@ colorette@^2.0.14: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== -colors@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - columnify@^1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" @@ -2710,9 +2710,9 @@ conventional-changelog-conventionalcommits@4.6.1: q "^1.5.1" conventional-changelog-conventionalcommits@^4.5.0: - version "4.6.2" - resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.2.tgz#6debf07a894f7c7e22b950e2f872de334d5d49ed" - integrity sha512-fo+VhM0VtD3wdHZtrPhgvTFjAhAMUjYeQV6B5+DB/cupG1O554pJdTwrvBInq8JLHl+GucKQpZycMPye/OpgSw== + version "4.6.3" + resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.3.tgz#0765490f56424b46f6cb4db9135902d6e5a36dc2" + integrity sha512-LTTQV4fwOM4oLPad317V/QNQ1FY4Hju5qeBIM1uTHbrnCE+Eg4CdRZ3gO2pUeR+tzWdp80M2j3qFFEDWVqOV4g== dependencies: compare-func "^2.0.0" lodash "^4.17.15" @@ -2780,13 +2780,13 @@ conventional-changelog-preset-loader@^2.3.4: integrity sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g== conventional-changelog-writer@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-5.0.0.tgz#c4042f3f1542f2f41d7d2e0d6cad23aba8df8eec" - integrity sha512-HnDh9QHLNWfL6E1uHz6krZEQOgm8hN7z/m7tT16xwd802fwgMN0Wqd7AQYVkhpsjDUx/99oo+nGgvKF657XP5g== + version "5.0.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz#e0757072f045fe03d91da6343c843029e702f359" + integrity sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ== dependencies: conventional-commits-filter "^2.0.7" dateformat "^3.0.0" - handlebars "^4.7.6" + handlebars "^4.7.7" json-stringify-safe "^5.0.1" lodash "^4.17.15" meow "^8.0.0" @@ -2820,9 +2820,9 @@ conventional-commits-filter@^2.0.7: modify-values "^1.0.0" conventional-commits-parser@^3.2.0: - version "3.2.3" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.3.tgz#fc43704698239451e3ef35fd1d8ed644f46bd86e" - integrity sha512-YyRDR7On9H07ICFpRm/igcdjIqebXbvf4Cff+Pf0BrBys1i1EOzx9iFXNlAbdrLAR8jf7bkUYkDAr8pEy0q4Pw== + version "3.2.4" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz#a7d3b77758a202a9b2293d2112a8d8052c740972" + integrity sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q== dependencies: JSONStream "^1.0.4" is-text-path "^1.0.1" @@ -2925,22 +2925,17 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -date-format@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-2.1.0.tgz#31d5b5ea211cf5fd764cd38baf9d033df7e125cf" - integrity sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA== - -date-format@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-3.0.0.tgz#eb8780365c7d2b1511078fb491e6479780f3ad95" - integrity sha512-eyTcpKOcamdhWJXj56DpQMo1ylSQpcGtGKXcU0Tb97+K56/CF5amAqqqNj0+KvA0iw2ynxtHWFsPDSClCxe48w== +date-format@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.3.tgz#f63de5dc08dc02efd8ef32bf2a6918e486f35873" + integrity sha512-7P3FyqDcfeznLZp2b+OMitV9Sz2lUnsT87WaTat9nVwqsBkTzPG3lPLNwW3en6F4pHUiWzr6vb8CLhjdK9bcxQ== 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, 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== @@ -3155,9 +3150,9 @@ dot-prop@^6.0.1: is-obj "^2.0.0" dotenv@*: - version "10.0.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" - integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== + version "15.0.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-15.0.0.tgz#2a585639429bf2c2c62f387f0fffde9c75aafde0" + integrity sha512-/l1sXXm79ry34KwwS0y4oVZjB468iw/6u9g1W26dtexKcIJAnVL2pMF+hxQwzZ7LutxOwEgtym9eIxvX33CMKg== dotenv@^8.6.0: version "8.6.0" @@ -3186,9 +3181,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.4.17: - version "1.4.29" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.29.tgz#a9b85ab888d0122124c9647c04d8dd246fae94b6" - integrity sha512-N2Jbwxo5Rum8G2YXeUxycs1sv4Qme/ry71HG73bv8BvZl+I/4JtRgK/En+ST/Wh/yF1fqvVCY4jZBgMxnhjtBA== + version "1.4.61" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.61.tgz#97689f81b4ac5c996363d9ee7babd3406c44d6c3" + integrity sha512-kpzCOOFlx63C9qKRyIDEsKIUgzoe98ump7T4gU+/OLzj8gYkkWf2SIyBjhTSE0keAjMAp3i7C262YtkQOMYrGw== emittery@^0.8.1: version "0.8.1" @@ -3215,13 +3210,6 @@ enhanced-resolve@^5.8.3: graceful-fs "^4.2.4" tapable "^2.2.0" -enquirer@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - entities@~2.0: version "2.0.3" resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.3.tgz#5c487e5742ab93c15abb5da22759b8590ec03b7f" @@ -3359,33 +3347,32 @@ eslint-import-resolver-typescript@^2.5.0: resolve "^1.20.0" tsconfig-paths "^3.9.0" -eslint-module-utils@^2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz#b435001c9f8dd4ab7f6d0efcae4b9696d4c24b7c" - integrity sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ== +eslint-module-utils@^2.7.2: + 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== dependencies: debug "^3.2.7" find-up "^2.1.0" - pkg-dir "^2.0.0" -eslint-plugin-import@^2.25.3: - version "2.25.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz#a554b5f66e08fb4f6dc99221866e57cfff824766" - integrity sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg== +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== 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.1" + eslint-module-utils "^2.7.2" has "^1.0.3" is-core-module "^2.8.0" is-glob "^4.0.3" minimatch "^3.0.4" object.values "^1.1.5" resolve "^1.20.0" - tsconfig-paths "^3.11.0" + tsconfig-paths "^3.12.0" eslint-plugin-prettier@^4.0.0: version "4.0.0" @@ -3422,15 +3409,15 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" - integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1" + integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ== -eslint@^8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.5.0.tgz#ddd2c1afd8f412036f87ae2a063d2aa296d3175f" - integrity sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg== +eslint@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.8.0.tgz#9762b49abad0cb4952539ffdb0a046392e571a2d" + integrity sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ== dependencies: "@eslint/eslintrc" "^1.0.5" "@humanwhocodes/config-array" "^0.9.2" @@ -3439,12 +3426,11 @@ eslint@^8.5.0: cross-spawn "^7.0.2" debug "^4.3.2" doctrine "^3.0.0" - enquirer "^2.3.5" escape-string-regexp "^4.0.0" eslint-scope "^7.1.0" eslint-utils "^3.0.0" - eslint-visitor-keys "^3.1.0" - espree "^9.2.0" + eslint-visitor-keys "^3.2.0" + espree "^9.3.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -3452,7 +3438,7 @@ eslint@^8.5.0: functional-red-black-tree "^1.0.1" glob-parent "^6.0.1" globals "^13.6.0" - ignore "^4.0.6" + ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" @@ -3463,20 +3449,18 @@ eslint@^8.5.0: minimatch "^3.0.4" natural-compare "^1.4.0" optionator "^0.9.1" - progress "^2.0.0" regexpp "^3.2.0" - semver "^7.2.1" strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.2.0: - version "9.2.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.2.0.tgz#c50814e01611c2d0f8bd4daa83c369eabba80dbc" - integrity sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg== +espree@^9.2.0, espree@^9.3.0: + version "9.3.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.0.tgz#c1240d79183b72aaee6ccfa5a90bc9111df085a8" + integrity sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ== dependencies: - acorn "^8.6.0" + acorn "^8.7.0" acorn-jsx "^5.3.1" eslint-visitor-keys "^3.1.0" @@ -3544,17 +3528,15 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.4.2.tgz#4429b0f7e307771d176de9bdf23229b101db6ef6" - integrity sha512-BjAXIDC6ZOW+WBFNg96J22D27Nq5ohn+oGcuP2rtOtcjuxNoV9McpQ60PcQWhdFOSBIQdR72e+4HdnbZTFSTyg== +expect@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.4.6.tgz#f335e128b0335b6ceb4fcab67ece7cbd14c942e6" + integrity sha512-1M/0kAALIaj5LaG66sFJTbRsWTADnylly82cu4bspI0nl+pgP4E6Bh/aqdHlTUjul06K7xQnnrAoqfxVU0+/ag== dependencies: "@jest/types" "^27.4.2" - ansi-styles "^5.0.0" jest-get-type "^27.4.0" - jest-matcher-utils "^27.4.2" - jest-message-util "^27.4.2" - jest-regex-util "^27.4.0" + jest-matcher-utils "^27.4.6" + jest-message-util "^27.4.6" extend@~3.0.2: version "3.0.2" @@ -3590,7 +3572,7 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== -fast-glob@^3.1.1: +fast-glob@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== @@ -3601,6 +3583,17 @@ fast-glob@^3.1.1: merge2 "^1.3.0" micromatch "^4.0.4" +fast-glob@^3.2.9: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -3694,15 +3687,10 @@ flat-cache@^3.0.4: flatted "^3.1.0" rimraf "^3.0.2" -flatted@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" - integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== - -flatted@^3.1.0: - version "3.2.4" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" - integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== +flatted@^3.1.0, flatted@^3.2.4: + version "3.2.5" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" + integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== foreach@^2.0.5: version "2.0.5" @@ -3739,14 +3727,14 @@ fs-access@^1.0.1: dependencies: null-check "^1.0.0" -fs-extra@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== +fs-extra@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" + integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== dependencies: graceful-fs "^4.2.0" - jsonfile "^4.0.0" - universalify "^0.1.0" + jsonfile "^6.0.1" + universalify "^2.0.0" fs-extra@^9.1.0: version "9.1.0" @@ -3871,9 +3859,9 @@ getpass@^0.1.1: assert-plus "^1.0.0" git-raw-commits@^2.0.8: - version "2.0.10" - resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.10.tgz#e2255ed9563b1c9c3ea6bd05806410290297bbc1" - integrity sha512-sHhX5lsbG9SOO6yXdlwgEMQ/ljIn7qMpAbJZCGfXX2fq5T8M5SrDnpYk9/4HswTildcIqatsWa91vty6VhWSaQ== + version "2.0.11" + resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.11.tgz#bc3576638071d18655e1cc60d7f524920008d723" + integrity sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A== dependencies: dargs "^7.0.0" lodash "^4.17.15" @@ -3963,23 +3951,23 @@ globals@^13.6.0, globals@^13.9.0: type-fest "^0.20.2" globby@^11.0.2, globby@^11.0.4: - version "11.0.4" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" - integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" 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: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== +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== -handlebars@^4.7.6: +handlebars@^4.7.7: version "4.7.7" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== @@ -4054,9 +4042,9 @@ hosted-git-info@^2.1.4: integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== hosted-git-info@^4.0.0, hosted-git-info@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.0.2.tgz#5e425507eede4fea846b7262f0838456c4209961" - integrity sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg== + version "4.1.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" + integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== dependencies: lru-cache "^6.0.0" @@ -4122,7 +4110,7 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@^0.6.2: +iconv-lite@^0.6.2, iconv-lite@^0.6.3: version "0.6.3" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== @@ -4141,7 +4129,7 @@ ignore@^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.4, ignore@^5.1.8: +ignore@^5.1.8, ignore@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== @@ -4155,9 +4143,9 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: resolve-from "^4.0.0" import-local@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" - integrity sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA== + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" + integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== dependencies: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" @@ -4286,10 +4274,10 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" - integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== +is-core-module@^2.5.0, is-core-module@^2.8.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== dependencies: has "^1.0.3" @@ -4510,17 +4498,7 @@ istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== -istanbul-lib-instrument@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" - integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== - dependencies: - "@babel/core" "^7.7.5" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.0.0" - semver "^6.3.0" - -istanbul-lib-instrument@^5.0.4: +istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz#7b49198b657b27a730b8e9cb601f1e1bff24c59a" integrity sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q== @@ -4549,10 +4527,10 @@ istanbul-lib-source-maps@^4.0.0: istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" -istanbul-reports@^3.0.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.2.tgz#b80e13cbab0120e1c367ebaa099862361aed5ead" - integrity sha512-0gHxuT1NNC0aEIL1zbJ+MTgPbbHhU77eJPuU35WKA7TgXiSNlCAx4PENoMrH0Or6M2H80TaZcWKhM0IK6V8gRw== +istanbul-reports@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.3.tgz#4bcae3103b94518117930d51283690960b50d3c2" + integrity sha512-x9LtDVtfm/t1GFiLl3NffC7hz+I1ragvgX1P/Lg1NlIagifZDKUkuuaAxH/qpwj2IuEfD8G2Bs/UKp+sZ/pKkg== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -4566,86 +4544,86 @@ jest-changed-files@^27.4.2: execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.4.5.tgz#70bfb78e0200cab9b84747bf274debacaa538467" - integrity sha512-eTNWa9wsvBwPykhMMShheafbwyakcdHZaEYh5iRrQ0PFJxkDP/e3U/FvzGuKWu2WpwUA3C3hPlfpuzvOdTVqnw== +jest-circus@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.4.6.tgz#d3af34c0eb742a967b1919fbb351430727bcea6c" + integrity sha512-UA7AI5HZrW4wRM72Ro80uRR2Fg+7nR0GESbSI/2M+ambbzVuA63mn5T1p3Z/wlhntzGpIG1xx78GP2YIkf6PhQ== dependencies: - "@jest/environment" "^27.4.4" - "@jest/test-result" "^27.4.2" + "@jest/environment" "^27.4.6" + "@jest/test-result" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.4.2" + expect "^27.4.6" is-generator-fn "^2.0.0" - jest-each "^27.4.2" - jest-matcher-utils "^27.4.2" - jest-message-util "^27.4.2" - jest-runtime "^27.4.5" - jest-snapshot "^27.4.5" + jest-each "^27.4.6" + jest-matcher-utils "^27.4.6" + jest-message-util "^27.4.6" + jest-runtime "^27.4.6" + jest-snapshot "^27.4.6" jest-util "^27.4.2" - pretty-format "^27.4.2" + pretty-format "^27.4.6" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.5.tgz#8708f54c28d13681f3255ec9026a2b15b03d41e8" - integrity sha512-hrky3DSgE0u7sQxaCL7bdebEPHx5QzYmrGuUjaPLmPE8jx5adtvGuOlRspvMoVLTTDOHRnZDoRLYJuA+VCI7Hg== +jest-cli@^27.4.7: + version "27.4.7" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.7.tgz#d00e759e55d77b3bcfea0715f527c394ca314e5a" + integrity sha512-zREYhvjjqe1KsGV15mdnxjThKNDgza1fhDT+iUsXWLCq3sxe9w5xnvyctcYVT5PcdLSjv7Y5dCwTS3FCF1tiuw== dependencies: - "@jest/core" "^27.4.5" - "@jest/test-result" "^27.4.2" + "@jest/core" "^27.4.7" + "@jest/test-result" "^27.4.6" "@jest/types" "^27.4.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.4.5" + jest-config "^27.4.7" jest-util "^27.4.2" - jest-validate "^27.4.2" + jest-validate "^27.4.6" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.5.tgz#77ed7f2ba7bcfd7d740ade711d0d13512e08a59e" - integrity sha512-t+STVJtPt+fpqQ8GBw850NtSQbnDOw/UzdPfzDaHQ48/AylQlW7LHj3dH+ndxhC1UxJ0Q3qkq7IH+nM1skwTwA== +jest-config@^27.4.7: + version "27.4.7" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.7.tgz#4f084b2acbd172c8b43aa4cdffe75d89378d3972" + integrity sha512-xz/o/KJJEedHMrIY9v2ParIoYSrSVY6IVeE4z5Z3i101GoA5XgfbJz+1C8EYPsv7u7f39dS8F9v46BHDhn0vlw== dependencies: - "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.4.5" + "@babel/core" "^7.8.0" + "@jest/test-sequencer" "^27.4.6" "@jest/types" "^27.4.2" - babel-jest "^27.4.5" + babel-jest "^27.4.6" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - jest-circus "^27.4.5" - jest-environment-jsdom "^27.4.4" - jest-environment-node "^27.4.4" + jest-circus "^27.4.6" + jest-environment-jsdom "^27.4.6" + jest-environment-node "^27.4.6" jest-get-type "^27.4.0" - jest-jasmine2 "^27.4.5" + jest-jasmine2 "^27.4.6" jest-regex-util "^27.4.0" - jest-resolve "^27.4.5" - jest-runner "^27.4.5" + jest-resolve "^27.4.6" + jest-runner "^27.4.6" jest-util "^27.4.2" - jest-validate "^27.4.2" + jest-validate "^27.4.6" micromatch "^4.0.4" - pretty-format "^27.4.2" + pretty-format "^27.4.6" slash "^3.0.0" -jest-diff@^27.0.0, jest-diff@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.4.2.tgz#786b2a5211d854f848e2dcc1e324448e9481f36f" - integrity sha512-ujc9ToyUZDh9KcqvQDkk/gkbf6zSaeEg9AiBxtttXW59H/AcqEYp1ciXAtJp+jXWva5nAf/ePtSsgWwE5mqp4Q== +jest-diff@^27.0.0, jest-diff@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.4.6.tgz#93815774d2012a2cbb6cf23f84d48c7a2618f98d" + integrity sha512-zjaB0sh0Lb13VyPsd92V7HkqF6yKRH9vm33rwBt7rPYrpQvS1nCvlIy2pICbKta+ZjWngYLNn4cCK4nyZkjS/w== dependencies: chalk "^4.0.0" diff-sequences "^27.4.0" jest-get-type "^27.4.0" - pretty-format "^27.4.2" + pretty-format "^27.4.6" jest-docblock@^27.4.0: version "27.4.0" @@ -4654,40 +4632,40 @@ jest-docblock@^27.4.0: dependencies: detect-newline "^3.0.0" -jest-each@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.4.2.tgz#19364c82a692d0d26557642098d1f4619c9ee7d3" - integrity sha512-53V2MNyW28CTruB3lXaHNk6PkiIFuzdOC9gR3C6j8YE/ACfrPnz+slB0s17AgU1TtxNzLuHyvNlLJ+8QYw9nBg== +jest-each@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.4.6.tgz#e7e8561be61d8cc6dbf04296688747ab186c40ff" + integrity sha512-n6QDq8y2Hsmn22tRkgAk+z6MCX7MeVlAzxmZDshfS2jLcaBlyhpF3tZSJLR+kXmh23GEvS0ojMR8i6ZeRvpQcA== dependencies: "@jest/types" "^27.4.2" chalk "^4.0.0" jest-get-type "^27.4.0" jest-util "^27.4.2" - pretty-format "^27.4.2" + pretty-format "^27.4.6" -jest-environment-jsdom@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.4.4.tgz#94f738e99514d7a880e8ed8e03e3a321d43b49db" - integrity sha512-cYR3ndNfHBqQgFvS1RL7dNqSvD//K56j/q1s2ygNHcfTCAp12zfIromO1w3COmXrxS8hWAh7+CmZmGCIoqGcGA== +jest-environment-jsdom@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.4.6.tgz#c23a394eb445b33621dfae9c09e4c8021dea7b36" + integrity sha512-o3dx5p/kHPbUlRvSNjypEcEtgs6LmvESMzgRFQE6c+Prwl2JLA4RZ7qAnxc5VM8kutsGRTB15jXeeSbJsKN9iA== dependencies: - "@jest/environment" "^27.4.4" - "@jest/fake-timers" "^27.4.2" + "@jest/environment" "^27.4.6" + "@jest/fake-timers" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" - jest-mock "^27.4.2" + jest-mock "^27.4.6" jest-util "^27.4.2" jsdom "^16.6.0" -jest-environment-node@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.4.4.tgz#42fe5e3b224cb69b99811ebf6f5eaa5a59618514" - integrity sha512-D+v3lbJ2GjQTQR23TK0kY3vFVmSeea05giInI41HHOaJnAwOnmUHTZgUaZL+VxUB43pIzoa7PMwWtCVlIUoVoA== +jest-environment-node@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.4.6.tgz#ee8cd4ef458a0ef09d087c8cd52ca5856df90242" + integrity sha512-yfHlZ9m+kzTKZV0hVfhVu6GuDxKAYeFHrfulmy7Jxwsq4V7+ZK7f+c0XP/tbVDMQW7E4neG2u147hFkuVz0MlQ== dependencies: - "@jest/environment" "^27.4.4" - "@jest/fake-timers" "^27.4.2" + "@jest/environment" "^27.4.6" + "@jest/fake-timers" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" - jest-mock "^27.4.2" + jest-mock "^27.4.6" jest-util "^27.4.2" jest-expect-message@^1.0.2: @@ -4700,10 +4678,10 @@ jest-get-type@^27.4.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5" integrity sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ== -jest-haste-map@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.4.5.tgz#c2921224a59223f91e03ec15703905978ef0cc1a" - integrity sha512-oJm1b5qhhPs78K24EDGifWS0dELYxnoBiDhatT/FThgB9yxqUm5F6li3Pv+Q+apMBmmPNzOBnZ7ZxWMB1Leq1Q== +jest-haste-map@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.4.6.tgz#c60b5233a34ca0520f325b7e2cc0a0140ad0862a" + integrity sha512-0tNpgxg7BKurZeFkIOvGCkbmOHbLFf4LUQOxrQSMjvrQaQe3l6E8x6jYC1NuWkGo5WDdbr8FEzUxV2+LWNawKQ== dependencies: "@jest/types" "^27.4.2" "@types/graceful-fs" "^4.1.2" @@ -4714,58 +4692,57 @@ jest-haste-map@^27.4.5: jest-regex-util "^27.4.0" jest-serializer "^27.4.0" jest-util "^27.4.2" - jest-worker "^27.4.5" + jest-worker "^27.4.6" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.4.5.tgz#ff79d11561679ff6c89715b0cd6b1e8c0dfbc6dc" - integrity sha512-oUnvwhJDj2LhOiUB1kdnJjkx8C5PwgUZQb9urF77mELH9DGR4e2GqpWQKBOYXWs5+uTN9BGDqRz3Aeg5Wts7aw== +jest-jasmine2@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.4.6.tgz#109e8bc036cb455950ae28a018f983f2abe50127" + integrity sha512-uAGNXF644I/whzhsf7/qf74gqy9OuhvJ0XYp8SDecX2ooGeaPnmJMjXjKt0mqh1Rl5dtRGxJgNrHlBQIBfS5Nw== dependencies: - "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.4.4" + "@jest/environment" "^27.4.6" "@jest/source-map" "^27.4.0" - "@jest/test-result" "^27.4.2" + "@jest/test-result" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.4.2" + expect "^27.4.6" is-generator-fn "^2.0.0" - jest-each "^27.4.2" - jest-matcher-utils "^27.4.2" - jest-message-util "^27.4.2" - jest-runtime "^27.4.5" - jest-snapshot "^27.4.5" + jest-each "^27.4.6" + jest-matcher-utils "^27.4.6" + jest-message-util "^27.4.6" + jest-runtime "^27.4.6" + jest-snapshot "^27.4.6" jest-util "^27.4.2" - pretty-format "^27.4.2" + pretty-format "^27.4.6" throat "^6.0.1" -jest-leak-detector@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.4.2.tgz#7fc3120893a7a911c553f3f2bdff9faa4454abbb" - integrity sha512-ml0KvFYZllzPBJWDei3mDzUhyp/M4ubKebX++fPaudpe8OsxUE+m+P6ciVLboQsrzOCWDjE20/eXew9QMx/VGw== +jest-leak-detector@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.4.6.tgz#ed9bc3ce514b4c582637088d9faf58a33bd59bf4" + integrity sha512-kkaGixDf9R7CjHm2pOzfTxZTQQQ2gHTIWKY/JZSiYTc90bZp8kSZnUMS3uLAfwTZwc0tcMRoEX74e14LG1WapA== dependencies: jest-get-type "^27.4.0" - pretty-format "^27.4.2" + pretty-format "^27.4.6" -jest-matcher-utils@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.4.2.tgz#d17c5038607978a255e0a9a5c32c24e984b6c60b" - integrity sha512-jyP28er3RRtMv+fmYC/PKG8wvAmfGcSNproVTW2Y0P/OY7/hWUOmsPfxN1jOhM+0u2xU984u2yEagGivz9OBGQ== +jest-matcher-utils@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.4.6.tgz#53ca7f7b58170638590e946f5363b988775509b8" + integrity sha512-XD4PKT3Wn1LQnRAq7ZsTI0VRuEc9OrCPFiO1XL7bftTGmfNF0DcEwMHRgqiu7NGf8ZoZDREpGrCniDkjt79WbA== dependencies: chalk "^4.0.0" - jest-diff "^27.4.2" + jest-diff "^27.4.6" jest-get-type "^27.4.0" - pretty-format "^27.4.2" + pretty-format "^27.4.6" -jest-message-util@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.4.2.tgz#07f3f1bf207d69cf798ce830cc57f1a849f99388" - integrity sha512-OMRqRNd9E0DkBLZpFtZkAGYOXl6ZpoMtQJWTAREJKDOFa0M6ptB7L67tp+cszMBkvSgKOhNtQp2Vbcz3ZZKo/w== +jest-message-util@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.4.6.tgz#9fdde41a33820ded3127465e1a5896061524da31" + integrity sha512-0p5szriFU0U74czRSFjH6RyS7UYIAkn/ntwMuOwTGWrQIOh5NzXXrq72LOqIkJKKvFbPq+byZKuBz78fjBERBA== dependencies: "@babel/code-frame" "^7.12.13" "@jest/types" "^27.4.2" @@ -4773,14 +4750,14 @@ jest-message-util@^27.4.2: chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.4.2" + pretty-format "^27.4.6" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.4.2.tgz#184ff197a25491bfe4570c286daa5d62eb760b88" - integrity sha512-PDDPuyhoukk20JrQKeofK12hqtSka7mWH0QQuxSNgrdiPsrnYYLS6wbzu/HDlxZRzji5ylLRULeuI/vmZZDrYA== +jest-mock@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.4.6.tgz#77d1ba87fbd33ccb8ef1f061697e7341b7635195" + integrity sha512-kvojdYRkst8iVSZ1EJ+vc1RRD9llueBjKzXzeCytH3dMM7zvPV/ULcfI2nr0v0VUgm3Bjt3hBCQvOeaBz+ZTHw== dependencies: "@jest/types" "^27.4.2" "@types/node" "*" @@ -4795,40 +4772,40 @@ jest-regex-util@^27.4.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.4.0.tgz#e4c45b52653128843d07ad94aec34393ea14fbca" integrity sha512-WeCpMpNnqJYMQoOjm1nTtsgbR4XHAk1u00qDoNBQoykM280+/TmgA5Qh5giC1ecy6a5d4hbSsHzpBtu5yvlbEg== -jest-resolve-dependencies@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.5.tgz#9398af854bdb12d6a9e5a8a536ee401f889a3ecf" - integrity sha512-elEVvkvRK51y037NshtEkEnukMBWvlPzZHiL847OrIljJ8yIsujD2GXRPqDXC4rEVKbcdsy7W0FxoZb4WmEs7w== +jest-resolve-dependencies@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.6.tgz#fc50ee56a67d2c2183063f6a500cc4042b5e2327" + integrity sha512-W85uJZcFXEVZ7+MZqIPCscdjuctruNGXUZ3OHSXOfXR9ITgbUKeHj+uGcies+0SsvI5GtUfTw4dY7u9qjTvQOw== dependencies: "@jest/types" "^27.4.2" jest-regex-util "^27.4.0" - jest-snapshot "^27.4.5" + jest-snapshot "^27.4.6" -jest-resolve@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.5.tgz#8dc44f5065fb8d58944c20f932cb7b9fe9760cca" - integrity sha512-xU3z1BuOz/hUhVUL+918KqUgK+skqOuUsAi7A+iwoUldK6/+PW+utK8l8cxIWT9AW7IAhGNXjSAh1UYmjULZZw== +jest-resolve@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.6.tgz#2ec3110655e86d5bfcfa992e404e22f96b0b5977" + integrity sha512-SFfITVApqtirbITKFAO7jOVN45UgFzcRdQanOFzjnbd+CACDoyeX7206JyU92l4cRr73+Qy/TlW51+4vHGt+zw== dependencies: "@jest/types" "^27.4.2" chalk "^4.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.4.5" + jest-haste-map "^27.4.6" jest-pnp-resolver "^1.2.2" jest-util "^27.4.2" - jest-validate "^27.4.2" + jest-validate "^27.4.6" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.5.tgz#daba2ba71c8f34137dc7ac45616add35370a681e" - integrity sha512-/irauncTfmY1WkTaRQGRWcyQLzK1g98GYG/8QvIPviHgO1Fqz1JYeEIsSfF+9mc/UTA6S+IIHFgKyvUrtiBIZg== +jest-runner@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.6.tgz#1d390d276ec417e9b4d0d081783584cbc3e24773" + integrity sha512-IDeFt2SG4DzqalYBZRgbbPmpwV3X0DcntjezPBERvnhwKGWTW7C5pbbA5lVkmvgteeNfdd/23gwqv3aiilpYPg== dependencies: - "@jest/console" "^27.4.2" - "@jest/environment" "^27.4.4" - "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.5" + "@jest/console" "^27.4.6" + "@jest/environment" "^27.4.6" + "@jest/test-result" "^27.4.6" + "@jest/transform" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" @@ -4836,49 +4813,45 @@ jest-runner@^27.4.5: exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.4.0" - jest-environment-jsdom "^27.4.4" - jest-environment-node "^27.4.4" - jest-haste-map "^27.4.5" - jest-leak-detector "^27.4.2" - jest-message-util "^27.4.2" - jest-resolve "^27.4.5" - jest-runtime "^27.4.5" + jest-environment-jsdom "^27.4.6" + jest-environment-node "^27.4.6" + jest-haste-map "^27.4.6" + jest-leak-detector "^27.4.6" + jest-message-util "^27.4.6" + jest-resolve "^27.4.6" + jest-runtime "^27.4.6" jest-util "^27.4.2" - jest-worker "^27.4.5" + jest-worker "^27.4.6" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.4.5.tgz#97703ad2a1799d4f50ab59049bd21a9ceaed2813" - integrity sha512-CIYqwuJQXHQtPd/idgrx4zgJ6iCb6uBjQq1RSAGQrw2S8XifDmoM1Ot8NRd80ooAm+ZNdHVwsktIMGlA1F1FAQ== +jest-runtime@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.4.6.tgz#83ae923818e3ea04463b22f3597f017bb5a1cffa" + integrity sha512-eXYeoR/MbIpVDrjqy5d6cGCFOYBFFDeKaNWqTp0h6E74dK0zLHzASQXJpl5a2/40euBmKnprNLJ0Kh0LCndnWQ== dependencies: - "@jest/console" "^27.4.2" - "@jest/environment" "^27.4.4" - "@jest/globals" "^27.4.4" + "@jest/environment" "^27.4.6" + "@jest/fake-timers" "^27.4.6" + "@jest/globals" "^27.4.6" "@jest/source-map" "^27.4.0" - "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.5" + "@jest/test-result" "^27.4.6" + "@jest/transform" "^27.4.6" "@jest/types" "^27.4.2" - "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" execa "^5.0.0" - exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.4.5" - jest-message-util "^27.4.2" - jest-mock "^27.4.2" + jest-haste-map "^27.4.6" + jest-message-util "^27.4.6" + jest-mock "^27.4.6" jest-regex-util "^27.4.0" - jest-resolve "^27.4.5" - jest-snapshot "^27.4.5" + jest-resolve "^27.4.6" + jest-snapshot "^27.4.6" jest-util "^27.4.2" - jest-validate "^27.4.2" slash "^3.0.0" strip-bom "^4.0.0" - yargs "^16.2.0" jest-serializer@^27.4.0: version "27.4.0" @@ -4888,34 +4861,32 @@ jest-serializer@^27.4.0: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.4.5.tgz#2ea909b20aac0fe62504bc161331f730b8a7ecc7" - integrity sha512-eCi/iM1YJFrJWiT9de4+RpWWWBqsHiYxFG9V9o/n0WXs6GpW4lUt4FAHAgFPTLPqCUVzrMQmSmTZSgQzwqR7IQ== +jest-snapshot@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.4.6.tgz#e2a3b4fff8bdce3033f2373b2e525d8b6871f616" + integrity sha512-fafUCDLQfzuNP9IRcEqaFAMzEe7u5BF7mude51wyWv7VRex60WznZIC7DfKTgSIlJa8aFzYmXclmN328aqSDmQ== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" - "@babel/parser" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.4.5" + "@jest/transform" "^27.4.6" "@jest/types" "^27.4.2" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.4.2" + expect "^27.4.6" graceful-fs "^4.2.4" - jest-diff "^27.4.2" + jest-diff "^27.4.6" jest-get-type "^27.4.0" - jest-haste-map "^27.4.5" - jest-matcher-utils "^27.4.2" - jest-message-util "^27.4.2" - jest-resolve "^27.4.5" + jest-haste-map "^27.4.6" + jest-matcher-utils "^27.4.6" + jest-message-util "^27.4.6" jest-util "^27.4.2" natural-compare "^1.4.0" - pretty-format "^27.4.2" + pretty-format "^27.4.6" semver "^7.3.2" jest-util@^27.0.0, jest-util@^27.4.2: @@ -4930,24 +4901,24 @@ jest-util@^27.0.0, jest-util@^27.4.2: graceful-fs "^4.2.4" picomatch "^2.2.3" -jest-validate@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.4.2.tgz#eecfcc1b1c9429aa007da08a2bae4e32a81bbbc3" - integrity sha512-hWYsSUej+Fs8ZhOm5vhWzwSLmVaPAxRy+Mr+z5MzeaHm9AxUpXdoVMEW4R86y5gOobVfBsMFLk4Rb+QkiEpx1A== +jest-validate@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.4.6.tgz#efc000acc4697b6cf4fa68c7f3f324c92d0c4f1f" + integrity sha512-872mEmCPVlBqbA5dToC57vA3yJaMRfIdpCoD3cyHWJOMx+SJwLNw0I71EkWs41oza/Er9Zno9XuTkRYCPDUJXQ== dependencies: "@jest/types" "^27.4.2" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.4.0" leven "^3.1.0" - pretty-format "^27.4.2" + pretty-format "^27.4.6" -jest-watcher@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.4.2.tgz#c9037edfd80354c9fe90de4b6f8b6e2b8e736744" - integrity sha512-NJvMVyyBeXfDezhWzUOCOYZrUmkSCiatpjpm+nFUid74OZEHk6aMLrZAukIiFDwdbqp6mTM6Ui1w4oc+8EobQg== +jest-watcher@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.4.6.tgz#673679ebeffdd3f94338c24f399b85efc932272d" + integrity sha512-yKQ20OMBiCDigbD0quhQKLkBO+ObGN79MO4nT7YaCuQ5SM+dkBNWE8cZX0FjU6czwMvWw6StWbe+Wv4jJPJ+fw== dependencies: - "@jest/test-result" "^27.4.2" + "@jest/test-result" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" ansi-escapes "^4.2.1" @@ -4955,23 +4926,23 @@ jest-watcher@^27.4.2: jest-util "^27.4.2" string-length "^4.0.1" -jest-worker@^27.4.1, jest-worker@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.5.tgz#d696e3e46ae0f24cff3fa7195ffba22889262242" - integrity sha512-f2s8kEdy15cv9r7q4KkzGXvlY0JTcmCbMHZBfSQDwW77REr45IDWwd0lksDFeVHH2jJ5pqb90T77XscrjeGzzg== +jest-worker@^27.4.5, jest-worker@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.6.tgz#5d2d93db419566cb680752ca0792780e71b3273e" + integrity sha512-gHWJF/6Xi5CTG5QCvROr6GcmpIqNYpDJyc8A1h/DyXqH1tD6SnRCM0d3U5msV31D2LB/U+E0M+W4oyvKV44oNw== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.5.tgz#66e45acba44137fac26be9d3cc5bb031e136dc0f" - integrity sha512-uT5MiVN3Jppt314kidCk47MYIRilJjA/l2mxwiuzzxGUeJIvA8/pDaJOAX5KWvjAo7SCydcW0/4WEtgbLMiJkg== +jest@^27.4.7: + version "27.4.7" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.7.tgz#87f74b9026a1592f2da05b4d258e57505f28eca4" + integrity sha512-8heYvsx7nV/m8m24Vk26Y87g73Ba6ueUd0MWed/NXMhSZIm62U/llVbS0PJe1SHunbyXjJ/BqG1z9bFjGUIvTg== dependencies: - "@jest/core" "^27.4.5" + "@jest/core" "^27.4.7" import-local "^3.0.2" - jest-cli "^27.4.5" + jest-cli "^27.4.7" js-tokens@^4.0.0: version "4.0.0" @@ -5089,13 +5060,6 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= - optionalDependencies: - graceful-fs "^4.1.6" - jsonfile@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" @@ -5301,16 +5265,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.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.3.0.tgz#10dfafbb434351a3e30277a00b9879446f715bcb" - integrity sha512-Mc8jNuSFImQUIateBFwdOQcmC6Q5maU0VVvdC2R6XMb66/VnT+7WS4D/0EeNMZu1YODmJe5NIn2XftCzEocUgw== +log4js@^6.4.1: + version "6.4.1" + resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.4.1.tgz#9d3a8bf2c31c1e213fe3fc398a6053f7a2bc53e8" + integrity sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg== dependencies: - date-format "^3.0.0" - debug "^4.1.1" - flatted "^2.0.1" - rfdc "^1.1.4" - streamroller "^2.2.4" + date-format "^4.0.3" + debug "^4.3.3" + flatted "^3.2.4" + rfdc "^1.3.0" + streamroller "^3.0.2" lower-case@^1.1.1: version "1.1.4" @@ -5438,7 +5402,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.3.0: +merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== @@ -5639,9 +5603,9 @@ natural-compare@^1.4.0: integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= negotiator@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== neo-async@^2.6.0, neo-async@^2.6.2: version "2.6.2" @@ -5655,10 +5619,10 @@ no-case@^2.2.0: dependencies: lower-case "^1.1.1" -node-fetch@^2.6.0, node-fetch@^2.6.1: - version "2.6.6" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89" - integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA== +node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== dependencies: whatwg-url "^5.0.0" @@ -6185,7 +6149,7 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-parse@^1.0.6: +path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== @@ -6218,9 +6182,9 @@ picocolors@^1.0.0: integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== picomatch@^2.0.4, picomatch@^2.2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== pify@^2.3.0: version "2.3.0" @@ -6242,17 +6206,10 @@ pify@^5.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-5.0.0.tgz#1f5eca3f5e87ebec28cc6d54a0e4aaf00acc127f" integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== -pirates@^4.0.1: - version "4.0.4" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.4.tgz#07df81e61028e402735cdd49db701e4885b4e6e6" - integrity sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw== - -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= - dependencies: - find-up "^2.1.0" +pirates@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" + integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== pkg-dir@^4.2.0: version "4.2.0" @@ -6283,12 +6240,11 @@ prettier@^2.5.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== -pretty-format@^27.0.0, pretty-format@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.4.2.tgz#e4ce92ad66c3888423d332b40477c87d1dac1fb8" - integrity sha512-p0wNtJ9oLuvgOQDEIZ9zQjZffK7KtyR6Si0jnXULIDwrlNF8Cuir3AZP0hHv0jmKuNN/edOnbMjnzd4uTcmWiw== +pretty-format@^27.0.0, pretty-format@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.4.6.tgz#1b784d2f53c68db31797b2348fa39b49e31846b7" + integrity sha512-NblstegA1y/RJW2VyML+3LlpFjzx62cUrtBIKIWDXEDkjNeleA7Od7nrzcs/VLQvAeV4CgSYhrN39DRN88Qi/g== dependencies: - "@jest/types" "^27.4.2" ansi-regex "^5.0.1" ansi-styles "^5.0.0" react-is "^17.0.1" @@ -6298,11 +6254,6 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" @@ -6357,16 +6308,16 @@ q@^1.5.1: integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= qs@^6.9.4: - version "6.10.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.2.tgz#c1431bea37fc5b24c5bdbafa20f16bdf2a4b9ffe" - integrity sha512-mSIdjzqznWgfd4pMii7sHtaYF8rx8861hBO80SraY5GT0XQibWZWJSid0avzHGkDIZLImux2S5mXO0Hfct2QCw== + version "6.10.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" + integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== dependencies: side-channel "^1.0.4" qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== query-string@^6.13.8: version "6.14.1" @@ -6558,9 +6509,9 @@ regenerator-runtime@^0.13.4: integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== regexp.prototype.flags@^1.3.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26" - integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA== + version "1.4.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.1.tgz#b3f4c0059af9e47eca9f3f660e51d81307e72307" + integrity sha512-pMR7hBVUUGI7PMA37m2ofIdQCsomVnas+Jn5UPGAHQ+/LlwKm/aTLJHdasmHRzlfeZwHiAOaRSo2rbBDm3nNUQ== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" @@ -6629,12 +6580,13 @@ resolve.exports@^1.1.0: integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== resolve@^1.10.0, resolve@^1.20.0, resolve@^1.9.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + version "1.22.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" + integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" + is-core-module "^2.8.1" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" restore-cursor@^3.1.0: version "3.1.0" @@ -6654,7 +6606,7 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rfdc@^1.1.4: +rfdc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== @@ -6693,9 +6645,9 @@ rxjs@^6.6.0: tslib "^1.9.0" rxjs@^7.2.0: - version "7.5.1" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.1.tgz#af73df343cbcab37628197f43ea0c8256f54b157" - integrity sha512-KExVEeZWxMZnZhUZtsJcFwz8IvPvgu4G2Z2QyqjZQzUGr32KDYuSxrEYO4w3tFFNbfLozcrKUTvTPi+E9ywJkQ== + version "7.5.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.2.tgz#11e4a3a1dfad85dbf7fb6e33cbba17668497490b" + integrity sha512-PwDt186XaL3QN5qXj/H9DGyHhP3/RYYgZZwqBv9Tv8rsAaiwFH1IsJJlcgD37J7UW5a6O67qX0KWKS3/pu0m4w== dependencies: tslib "^2.1.0" @@ -6747,7 +6699,7 @@ semver-intersect@^1.4.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@7.x, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: +semver@7.x, semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -6881,19 +6833,19 @@ sort-keys@^4.0.0: dependencies: is-plain-obj "^2.0.0" -source-map-js@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e" - integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug== +source-map-js@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== -source-map-loader@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-3.0.0.tgz#f2a04ee2808ad01c774dea6b7d2639839f3b3049" - integrity sha512-GKGWqWvYr04M7tn8dryIWvb0s8YM41z82iQv01yBtIylgxax0CwvSy6gc2Y02iuXwEfGWRlMicH0nvms9UZphw== +source-map-loader@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-3.0.1.tgz#9ae5edc7c2d42570934be4c95d1ccc6352eba52d" + integrity sha512-Vp1UsfyPvgujKQzi4pyDiTOnE3E4H+yHvkVRN3c/9PJmQS4CQJExvcDvaX/D+RV+xQben9HJ56jMJS3CgUeWyA== dependencies: abab "^2.0.5" - iconv-lite "^0.6.2" - source-map-js "^0.6.2" + iconv-lite "^0.6.3" + source-map-js "^1.0.1" source-map-support@^0.5.6, source-map-support@~0.5.20: version "0.5.21" @@ -6982,9 +6934,9 @@ sprintf-js@~1.0.2: integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + version "1.17.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" + integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -7031,14 +6983,14 @@ standard-version@^9.3.2: stringify-package "^1.0.1" yargs "^16.0.0" -streamroller@^2.2.4: - version "2.2.4" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-2.2.4.tgz#c198ced42db94086a6193608187ce80a5f2b0e53" - integrity sha512-OG79qm3AujAM9ImoqgWEY1xG4HX+Lw+yY6qZj9R1K2mhF5bEmQ849wvrb+4vt4jLMLzwXttJlQbOdPOQVRv7DQ== +streamroller@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.0.2.tgz#30418d0eee3d6c93ec897f892ed098e3a81e68b7" + integrity sha512-ur6y5S5dopOaRXBuRIZ1u6GC5bcEXHRZKgfBjfCglMhmIf+roVCECjvkEYzNQOXIN2/JPnkMPW/8B3CZoKaEPA== dependencies: - date-format "^2.1.0" + date-format "^4.0.3" debug "^4.1.1" - fs-extra "^8.1.0" + fs-extra "^10.0.0" strict-uri-encode@^2.0.0: version "2.0.0" @@ -7195,6 +7147,11 @@ supports-hyperlinks@^2.0.0: has-flag "^4.0.0" supports-color "^7.0.0" +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -7263,11 +7220,11 @@ terminal-link@^2.0.0: supports-hyperlinks "^2.0.0" terser-webpack-plugin@^5.1.3: - version "5.3.0" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.0.tgz#21641326486ecf91d8054161c816e464435bae9f" - integrity sha512-LPIisi3Ol4chwAaPP8toUJ3L4qCM1G0wao7L3qNv57Drezxj6+VEyySpPw4B1HSO2Eg/hDY/MNF5XihCAoqnsQ== + version "5.3.1" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.1.tgz#0320dcc270ad5372c1e8993fabbd927929773e54" + integrity sha512-GvlZdT6wPQKbDNW/GDQzZFg/j4vKU96yl2q6mcUkzKOgW4gwf1Z8cZToUCrz31XHlPWH8MVb1r2tFtdDtTGJ7g== dependencies: - jest-worker "^27.4.1" + jest-worker "^27.4.5" schema-utils "^3.1.1" serialize-javascript "^6.0.0" source-map "^0.6.1" @@ -7384,10 +7341,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.2: - version "27.1.2" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.2.tgz#5991d6eb3fd8e1a8d4b8f6de3ec0a3cc567f3151" - integrity sha512-eSOiJOWq6Hhs6Khzk5wKC5sgWIXgXqOCiIl1+3lfnearu58Hj4QpE5tUhQcA3xtZrELbcvAGCsd6HB8OsaVaTA== +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== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" @@ -7416,7 +7373,7 @@ ts-node@^10.2.1, ts-node@^10.4.0: make-error "^1.1.1" yn "3.1.1" -tsconfig-paths@^3.11.0, tsconfig-paths@^3.9.0: +tsconfig-paths@^3.12.0, tsconfig-paths@^3.9.0: version "3.12.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" integrity sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg== @@ -7516,17 +7473,17 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript-json-schema@^0.52.0: - version "0.52.0" - resolved "https://registry.yarnpkg.com/typescript-json-schema/-/typescript-json-schema-0.52.0.tgz#954560ec90e5486e8f7a5b7706ec59286a708e29" - integrity sha512-3ZdHzx116gZ+D9LmMl5/+d1G3Rpt8baWngKzepYWHnXbAa8Winv64CmFRqLlMKneE1c40yugYDFcWdyX1FjGzQ== +typescript-json-schema@^0.53.0: + version "0.53.0" + resolved "https://registry.yarnpkg.com/typescript-json-schema/-/typescript-json-schema-0.53.0.tgz#ac5b89e4b0af55be422f475a041360e0556f88ea" + integrity sha512-BcFxC9nipQQOXxrBGI/jOWU31BwzVh6vqJR008G8VHKJtQ8YrZX6veriXfTK1l+L0/ff0yKl3mZigMLA6ZqkHg== dependencies: "@types/json-schema" "^7.0.9" "@types/node" "^16.9.2" glob "^7.1.7" safe-stable-stringify "^2.2.0" ts-node "^10.2.1" - typescript "~4.4.4" + typescript "~4.5.0" yargs "^17.1.1" typescript@~3.9.10: @@ -7534,15 +7491,15 @@ typescript@~3.9.10: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== -typescript@~4.4.4: - version "4.4.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" - integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== +typescript@~4.5.0: + version "4.5.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" + integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== uglify-js@^3.1.4: - version "3.14.5" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.5.tgz#cdabb7d4954231d80cb4a927654c4655e51f4859" - integrity sha512-qZukoSxOG0urUTvjc2ERMTcAy+BiFh3weWAkeurLwjrCba73poHmG3E36XEjd/JGukMzwTL7uCxZiAexj8ppvQ== + version "3.15.0" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.15.0.tgz#2d6a689d94783cab43975721977a13c2afec28f1" + integrity sha512-x+xdeDWq7FiORDvyIJ0q/waWd4PhjBNOm5dQUOq2AKC0IEjxOS66Ha9tctiVDGcRQuh69K7fgU5oRuTK4cysSg== uid-number@0.0.6: version "0.0.6" @@ -7583,7 +7540,7 @@ universal-user-agent@^6.0.0: resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== -universalify@^0.1.0, universalify@^0.1.2: +universalify@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== @@ -7640,9 +7597,9 @@ v8-compile-cache@^2.0.3: integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== v8-to-istanbul@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz#0aeb763894f1a0a1676adf8a8b7612a38902446c" - integrity sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA== + version "8.1.1" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" + integrity sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" @@ -7723,15 +7680,15 @@ webidl-conversions@^6.1.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== -webpack-cli@^4.9.1: - version "4.9.1" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.1.tgz#b64be825e2d1b130f285c314caa3b1ba9a4632b3" - integrity sha512-JYRFVuyFpzDxMDB+v/nanUdQYcZtqFPGzmlW4s+UkPMFhSpfRNmf1z4AwYcHJVdvEFAM7FFCQdNTpsBYhDLusQ== +webpack-cli@^4.9.2: + version "4.9.2" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.2.tgz#77c1adaea020c3f9e2db8aad8ea78d235c83659d" + integrity sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.1.0" - "@webpack-cli/info" "^1.4.0" - "@webpack-cli/serve" "^1.6.0" + "@webpack-cli/configtest" "^1.1.1" + "@webpack-cli/info" "^1.4.1" + "@webpack-cli/serve" "^1.6.1" colorette "^2.0.14" commander "^7.0.0" execa "^5.0.0" @@ -7749,15 +7706,15 @@ webpack-merge@^5.7.3: clone-deep "^4.0.1" wildcard "^2.0.0" -webpack-sources@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.2.tgz#d88e3741833efec57c4c789b6010db9977545260" - integrity sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw== +webpack-sources@^3.2.3: + version "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.65.0: - version "5.65.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.65.0.tgz#ed2891d9145ba1f0d318e4ea4f89c3fa18e6f9be" - integrity sha512-Q5or2o6EKs7+oKmJo7LaqZaMOlDWQse9Tm5l1WAfU/ujLGN5Pb0SqGeVkN/4bpPmEqEP5RnVhiqsOtWtUVwGRw== +webpack@^5.68.0: + version "5.68.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.68.0.tgz#a653a58ed44280062e47257f260117e4be90d560" + integrity sha512-zUcqaUO0772UuuW2bzaES2Zjlm/y3kRBQDVFVCge+s2Y8mwuUTdperGaAv65/NtRL/1zanpSJOq/MD8u61vo6g== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.50" @@ -7773,7 +7730,7 @@ webpack@^5.65.0: eslint-scope "5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" json-parse-better-errors "^1.0.2" loader-runner "^4.2.0" mime-types "^2.1.27" @@ -7782,7 +7739,7 @@ webpack@^5.65.0: tapable "^2.1.1" terser-webpack-plugin "^5.1.3" watchpack "^2.3.1" - webpack-sources "^3.2.2" + webpack-sources "^3.2.3" whatwg-encoding@^1.0.5: version "1.0.5" @@ -7887,10 +7844,10 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= -workerpool@^6.1.5: - version "6.1.5" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581" - integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== +workerpool@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" + integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== wrap-ansi@^6.2.0: version "6.2.0"