Skip to content

Commit

Permalink
chore(release): 1.65.0 (#3713)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Aug 18, 2022
2 parents 4c1eae8 + 8ca8191 commit 7a02b7f
Show file tree
Hide file tree
Showing 39 changed files with 6,588 additions and 910 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ jobs:
# We special-case typescript because it's not semantically versionned, and major.minor is the API contract
run: |-
# Upgrade devDependencies at repository root
ncu --upgrade --target=minor --filter=@types/node,@jest/types,jest-config,jest-circus
ncu --upgrade --target=minor --filter=@types/inquirer,@types/node,@jest/types,jest-config,jest-circus
ncu --upgrade --target=patch --filter=typescript
ncu --upgrade --target=latest --reject=@types/node,typescript,@jest/types,jest-config,jest-circus
ncu --upgrade --target=latest --reject=@types/inquirer,@types/node,typescript,@jest/types,jest-config,jest-circus
# Upgrade all production dependencies (and other always major-pinned dependencies)
lerna exec --parallel ncu -- --upgrade --target=minor \
Expand All @@ -85,7 +85,7 @@ jobs:
# Upgrade all other dependencies (devDependencies) to the latest
lerna exec --parallel ncu -- --upgrade --target=latest \
--reject='@types/node,typescript,${{ steps.production-dependencies.outputs.list }},${{ steps.monorepo-packages.outputs.list }}'
--reject='@types/inquirer,@types/node,typescript,${{ steps.production-dependencies.outputs.list }},${{ steps.monorepo-packages.outputs.list }}'
# This will ensure the current lockfile is up-to-date with the dependency specifications (necessary for "yarn update" to run)
- name: Run "yarn install"
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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.65.0](https://github.com/aws/jsii/compare/v1.64.0...v1.65.0) (2022-08-18)


### Features

* **pacmak:** allow opt-out of runtime type checking generation ([#3710](https://github.com/aws/jsii/issues/3710)) ([39923a5](https://github.com/aws/jsii/commit/39923a5885f33e99cc8c9181b8f36f20b6208551))


### Bug Fixes

* **dotnet:** AnonymousObject fails runtime type checks ([#3709](https://github.com/aws/jsii/issues/3709)) ([e7fadc0](https://github.com/aws/jsii/commit/e7fadc0866a9dbd1a0061ec184ae840b0f2f58a1))

## [1.64.0](https://github.com/aws/jsii/compare/v1.63.2...v1.64.0) (2022-08-11)


Expand Down
2 changes: 1 addition & 1 deletion gh-pages/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mkdocs~=1.3.1
mkdocs-awesome-pages-plugin~=2.8.0
mkdocs-material~=8.3.9
mkdocs-material~=8.4.0
mkdocs-git-revision-date-plugin~=0.3.2
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"rejectCycles": true
}
},
"version": "1.64.0"
"version": "1.65.0"
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"@jest/types": "^28.1.3",
"@types/jest": "^28.1.6",
"@types/node": "^14.18.23",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.32.0",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"all-contributors-cli": "^6.20.0",
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -31,7 +31,7 @@
"jest-circus": "^28.1.3",
"jest-config": "^28.1.3",
"jest-expect-message": "^1.0.2",
"lerna": "^5.3.0",
"lerna": "^5.4.0",
"prettier": "^2.7.1",
"standard-version": "^9.5.0",
"ts-node": "^10.9.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/@jsii/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
<PackageReference Update="Microsoft.CodeQuality.Analyzers" Version="3.3.2" />

<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Update="NSubstitute" Version="4.4.0" />
<PackageReference Update="xunit" Version="2.4.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.5" />
Expand Down
2 changes: 1 addition & 1 deletion packages/@jsii/benchmarks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"fs-extra": "^10.1.0",
"jsii": "^0.0.0",
"npm": "^8.15.1",
"npm": "^8.16.0",
"tar": "^6.1.11",
"typescript": "~3.9.10",
"yargs": "^16.2.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

using System;
using System.Collections.Generic;
using Amazon.JSII.Runtime.Deputy;
using Amazon.JSII.Tests.CalculatorNamespace;
using Amazon.JSII.Tests.CalculatorNamespace.Anonymous;
using Xunit;

#pragma warning disable CS0612
Expand All @@ -13,17 +15,17 @@ public sealed class TypeCheckingTests : IClassFixture<ServiceContainerFixture>,
const string Prefix = nameof(TypeCheckingTests) + ".";

private readonly IDisposable _serviceContainerFixture;

public TypeCheckingTests(ServiceContainerFixture serviceContainerFixture)
{
_serviceContainerFixture = serviceContainerFixture;
}

void IDisposable.Dispose()
{
_serviceContainerFixture.Dispose();
}

[Fact(DisplayName = Prefix + nameof(Constructor))]
public void Constructor()
{
Expand All @@ -39,7 +41,7 @@ public void Constructor()
);
Assert.Equal("Expected argument unionProperty[0][\"bad\"] to be one of: Amazon.JSII.Tests.CalculatorNamespace.IStructA, Amazon.JSII.Tests.CalculatorNamespace.IStructB; received System.String (Parameter 'unionProperty')", exception.Message);
}

[Fact(DisplayName = Prefix + nameof(Setter))]
public void Setter()
{
Expand All @@ -55,13 +57,21 @@ public void Setter()
});
Assert.Equal("Expected value[0][\"bad\"] to be one of: Amazon.JSII.Tests.CalculatorNamespace.IStructA, Amazon.JSII.Tests.CalculatorNamespace.IStructB; received System.String (Parameter 'value')", exception.Message);
}

[Fact(DisplayName = Prefix + nameof(StaticMethod))]
public void StaticMethod()
{
var exception = Assert.Throws<System.ArgumentException>(() =>
StructUnionConsumer.IsStructA("Not a StructA"));
Assert.Equal("Expected argument struct to be one of: Amazon.JSII.Tests.CalculatorNamespace.IStructA, Amazon.JSII.Tests.CalculatorNamespace.IStructB; received System.String (Parameter 'struct')", exception.Message);
}

[Fact(DisplayName = Prefix + nameof(AnonymousObjectIsValid))]
public void AnonymousObjectIsValid()
{
var anonymousObject = UseOptions.Provide("A");
Assert.IsType<AnonymousObject>(anonymousObject);
Assert.Equal("A", UseOptions.Consume(anonymousObject));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Amazon.JSII.Runtime.Deputy
{
internal sealed class AnonymousObject : DeputyBase
public sealed class AnonymousObject : DeputyBase
{
internal AnonymousObject(ByRefValue byRefValue) : base(byRefValue)
{
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,10 @@ def test_setter_to_union(self):
def test_nested_struct(self):
# None of these should throw...
NestingClass.NestedStruct(name="Queen B")

def test_anonymous_object(self):
struct = jsii_calc.StructUnionConsumer.provide_struct("A")
assert jsii_calc.StructUnionConsumer.is_struct_a(struct)

iface = jsii_calc.anonymous.UseOptions.provide("A")
assert jsii_calc.anonymous.UseOptions.consume(iface) == "A"
47 changes: 47 additions & 0 deletions packages/jsii-calc/lib/anonymous/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
export interface IOptionA {
doSomething(): string;
}

export interface IOptionB {
doSomethingElse(): string;
}

export class UseOptions {
public static provide(which: 'A' | 'B'): IOptionA | IOptionB {
switch (which) {
case 'A':
return new OptionA();
case 'B':
return new OptionB();
default:
throw new Error(`Unexpected option: ${which as any}`);
}
}

public static privideAsAny(which: 'A' | 'B'): any {
return this.provide(which);
}

public static consume(option: IOptionA | IOptionB): string {
if (option instanceof OptionA) {
return option.doSomething();
} else if (option instanceof OptionB) {
return option.doSomethingElse();
}
throw new Error(`Unexpected option: ${option as any}`);
}

private constructor() {}
}

class OptionA implements IOptionA {
public doSomething(): string {
return 'A';
}
}

class OptionB implements IOptionB {
public doSomethingElse(): string {
return 'B';
}
}
14 changes: 14 additions & 0 deletions packages/jsii-calc/lib/compliance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2358,6 +2358,20 @@ export class StructUnionConsumer {
}
}

public static provideStruct(which: 'A' | 'B'): StructA | StructB {
switch (which) {
case 'A':
return { requiredString: 'required', optionalNumber: 1337 };
case 'B':
return {
requiredString: 'required',
optionalStructA: this.provideStruct('A'),
};
default:
throw new Error(`Illegal value for which: ${which as any}`);
}
}

private constructor() {}
}

Expand Down
2 changes: 2 additions & 0 deletions packages/jsii-calc/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ export * as module2700 from './module2700';

export * as cdk16625 from './cdk16625';
export * as jsii3656 from './jsii3656';

export * as anonymous from './anonymous';
Loading

0 comments on commit 7a02b7f

Please sign in to comment.