Skip to content

Commit

Permalink
chore(release): 1.28.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Elad Ben-Israel authored Apr 13, 2021
2 parents 796e286 + 2d83da9 commit 1801f4f
Show file tree
Hide file tree
Showing 32 changed files with 456 additions and 211 deletions.
19 changes: 19 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,25 @@
"contributions": [
"bug"
]
},
{
"login": "yglcode",
"name": "Yigong Liu",
"avatar_url": "https://avatars.githubusercontent.com/u/11893614?v=4",
"profile": "https://github.com/yglcode",
"contributions": [
"bug",
"ideas"
]
},
{
"login": "Cristim",
"name": "Cristian Măgherușan-Stanciu",
"avatar_url": "https://avatars.githubusercontent.com/u/95209?v=4",
"profile": "http://mcristi.wordpress.com",
"contributions": [
"bug"
]
}
],
"repoType": "github",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: |-
echo "::set-output name=pip-cache::$(python3 -m pip cache dir)"
- name: Cache
uses: actions/cache@v2.1.4
uses: actions/cache@v2.1.5
with:
path: ${{ steps.cache-locations.outputs.pip-cache }}
key: ${{ runner.os }}-${{ hashFiles('**/requirements-dev.txt') }}
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ jobs:
with:
go-version: '1.16'
- name: Set up Java 8
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'
- name: Set up Node 12
uses: actions/setup-node@v2.1.5
with:
Expand All @@ -57,7 +58,7 @@ jobs:
echo "::set-output name=pip-cache::$(python3 -m pip cache dir)"
echo "::set-output name=yarn-cache::$(yarn cache dir)"
- name: Cache
uses: actions/cache@v2.1.4
uses: actions/cache@v2.1.5
with:
path: |-
${{ steps.cache-locations.outputs.pip-cache }}
Expand Down Expand Up @@ -122,9 +123,10 @@ jobs:
with:
go-version: '1.16'
- name: Set up Java 8
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'
- name: Set up Node 12
uses: actions/setup-node@v2.1.5
with:
Expand All @@ -148,7 +150,7 @@ jobs:
echo "::set-output name=pip-cache::$(python3 -m pip cache dir)"
echo "::set-output name=yarn-cache::$(yarn cache dir)"
- name: Cache
uses: actions/cache@v2.1.4
uses: actions/cache@v2.1.5
with:
path: |-
${{ steps.cache-locations.outputs.pip-cache }}
Expand Down Expand Up @@ -273,9 +275,10 @@ jobs:
with:
go-version: ${{ matrix.go }}
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
- name: Set up Node ${{ matrix.node }}
uses: actions/setup-node@v2.1.5
with:
Expand Down Expand Up @@ -309,7 +312,7 @@ jobs:
echo "::set-output name=pip-cache::$(python3 -m pip cache dir)"
echo "::set-output name=yarn-cache::$(yarn cache dir)"
- name: Cache
uses: actions/cache@v2.1.4
uses: actions/cache@v2.1.5
with:
path: |-
${{ steps.cache-locations.outputs.pip-cache }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Restore Yarn cache
uses: actions/cache@v2.1.4
uses: actions/cache@v2.1.5
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

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.28.0](https://github.com/aws/jsii/compare/v1.27.1...v1.28.0) (2021-04-13)


### Features

* **jsii-go:** use reflect to resolve overriden methods ([#2780](https://github.com/aws/jsii/issues/2780)) ([295d189](https://github.com/aws/jsii/commit/295d189610938d5e644243af8c4d1f17f1c2a8a0)), closes [#2768](https://github.com/aws/jsii/issues/2768)


### Bug Fixes

* **dotnet:** unable to pass 2d-array of interfaces ([#2763](https://github.com/aws/jsii/issues/2763)) ([347cf69](https://github.com/aws/jsii/commit/347cf69305a82733da2dc10517cb0b911decbce1)), closes [aws/aws-cdk#12587](https://github.com/aws/aws-cdk/issues/12587)
* deprecated symbol stripping does not strip out heritage clause with imported type ([#2783](https://github.com/aws/jsii/issues/2783)) ([e87d879](https://github.com/aws/jsii/commit/e87d879f9b637a769b6b62af5fe7711ca0b8a3c5))

## [1.27.1](https://github.com/aws/jsii/compare/v1.27.0...v1.27.1) (2021-04-12)

### Bug Fixes
Expand Down
28 changes: 15 additions & 13 deletions README.md

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions gh-pages/content/user-guides/lib-user/language-specific/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,8 @@ following convention: `New<ClassName>_Override`, and receives the *overriding*
struct instance as the first parameter.

The **go** `struct` that *extends* the base *jsii class* must anonymously embed
the *jsii class*' **go** interface, while specifying the `overrides:"..."` field
tag. The value of the tag is a comma-separated list of **go** methods that are
locally overridden (note: in the case of *property accessors*, the *getter* name
is to be used, even if only the *setter* is overridden).
the *jsii class*' **go** interface. All overridden method *must* be defined
using a pointer receiver.

Assuming the following abstract base class:

Expand Down Expand Up @@ -165,8 +163,8 @@ import (
)

type childClass struct {
// We implement AbstractMethod, AbstractReadonlyProperty, and override the setter for ConcreteProperty
jsiimodule.AbstractBaseClass `overrides:"AbstractMethod,AbstractReadonlyProperty,ConcreteProperty"`
// Anonymous embed of the "base class".
jsiimodule.AbstractBaseClass

// Our own storage
stringValue string
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.1.2
mkdocs-awesome-pages-plugin~=2.5.0
mkdocs-material~=7.0.7
mkdocs-material~=7.1.1
mkdocs-git-revision-date-plugin~=0.3.1
5 changes: 5 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Config } from '@jest/types';
import { defaults } from 'jest-config';
import { cpus } from 'os';
import { env } from 'process';

/**
Expand Down Expand Up @@ -28,6 +29,10 @@ const config: Config.InitialOptions = {
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|test).ts'],
testRunner: 'jest-circus/runner',
// Adjust maximum concurrency to specifically disallow running unbounded. Allow a minimum of 2 concurrent
// tests, and a maximum of 4 (which is the libuv thread pool size - more will likely cause wait times to
// quickly run out of control, and make everything very, very slow.)
maxConcurrency: Math.max(Math.min(cpus().length - 1, 4), 2),
// When in Continuous Integration, allow double the default test timeout (assuming "frugal" runner type)
testTimeout: env.CI === 'true' ? 10_000 : undefined,
transform: {
Expand Down
6 changes: 4 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"lerna": "3.13.1",
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"],
"packages": [
"packages/*"
],
"command": {
"bootstrap": {
"rejectCycles": true
}
},
"version": "1.27.1"
"version": "1.28.0"
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"devDependencies": {
"@jest/types": "^26.6.2",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/parser": "^4.21.0",
"all-contributors-cli": "^6.20.0",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
Expand All @@ -30,7 +30,7 @@
"jest-expect-message": "^1.0.2",
"lerna": "^4.0.0",
"prettier": "^2.2.1",
"standard-version": "^9.1.1",
"standard-version": "^9.2.0",
"ts-jest": "^26.5.4",
"ts-node": "^9.1.1",
"typescript": "~3.9.9"
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.2" />
<PackageReference Update="Microsoft.CodeQuality.Analyzers" Version="3.3.2" />

<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.9.1" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Update="NSubstitute" Version="4.2.2" />
<PackageReference Update="xunit" Version="2.4.1" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1512,5 +1512,18 @@ public override String Repeat(String word)
return word;
}
}

[Fact(DisplayName = Prefix + nameof(ArrayOfInterfaces))]
public void ArrayOfInterfaces()
{
var bells = new IBell[1][];
bells[0] = new IBell[1];
bells[0][0] = new Bell();

var allTypes = new AllTypes();
allTypes.AnyProperty = bells;

Assert.Equal(bells, allTypes.AnyProperty);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
Expand Down Expand Up @@ -348,6 +348,12 @@ TypeReference InferType(IReferenceMap referenceMap, Type type)
return new TypeReference(enumAttribute.FullyQualifiedName);
}

var interfaceAttribute = type.GetCustomAttribute<JsiiInterfaceAttribute>();
if (interfaceAttribute != null)
{
return new TypeReference(interfaceAttribute.FullyQualifiedName);
}

var structAttribute = type.GetCustomAttribute<JsiiByValueAttribute>();
if (structAttribute != null)
{
Expand Down
31 changes: 15 additions & 16 deletions packages/@jsii/go-runtime-test/project/compliance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func (suite *ComplianceSuite) TestEqualsIsResistantToPropertyShadowingResultVari
}

type overridableProtectedMemberDerived struct {
calc.OverridableProtectedMember `overrides:"OverrideReadOnly,OverrideReadWrite"`
calc.OverridableProtectedMember
}

func newOverridableProtectedMemberDerived() *overridableProtectedMemberDerived {
Expand Down Expand Up @@ -381,7 +381,7 @@ func newImplementsAdditionalInterface(s calc.StructB) *implementsAdditionalInter
return &n
}

func (x implementsAdditionalInterface) ReturnStruct() *calc.StructB {
func (x *implementsAdditionalInterface) ReturnStruct() *calc.StructB {
return &x._struct
}

Expand Down Expand Up @@ -500,7 +500,7 @@ func (suite *ComplianceSuite) TestCallbacksCorrectlyDeserializeArguments() {
}

type testCallbacksCorrectlyDeserializeArgumentsDataRenderer struct {
calc.DataRenderer `overrides:"RenderMap"`
calc.DataRenderer
}

func NewTestCallbacksCorrectlyDeserializeArgumentsDataRenderer() *testCallbacksCorrectlyDeserializeArgumentsDataRenderer {
Expand Down Expand Up @@ -610,7 +610,7 @@ func (suite *ComplianceSuite) TestNullShouldBeTreatedAsUndefined() {
}

type myOverridableProtectedMember struct {
calc.OverridableProtectedMember `overrides:"OverrideMe"`
calc.OverridableProtectedMember
}

func newMyOverridableProtectedMember() *myOverridableProtectedMember {
Expand All @@ -619,7 +619,7 @@ func newMyOverridableProtectedMember() *myOverridableProtectedMember {
return &m
}

func (x myOverridableProtectedMember) OverrideMe() *string {
func (x *myOverridableProtectedMember) OverrideMe() *string {
return jsii.String("Cthulhu Fhtagn!")
}

Expand Down Expand Up @@ -685,7 +685,7 @@ func (suite *ComplianceSuite) TestMapReturnedByMethodCanBeRead() {
}

type myAbstractSuite struct {
calc.AbstractSuite `overrides:"SomeMethod,Property"`
calc.AbstractSuite

_property *string
}
Expand Down Expand Up @@ -724,10 +724,10 @@ func (suite *ComplianceSuite) TestCanOverrideProtectedSetter() {
}

type TestCanOverrideProtectedSetterOverridableProtectedMember struct {
calc.OverridableProtectedMember `overrides:"OverrideReadWrite"`
calc.OverridableProtectedMember
}

func (x TestCanOverrideProtectedSetterOverridableProtectedMember) SetOverrideReadWrite(val *string) {
func (x *TestCanOverrideProtectedSetterOverridableProtectedMember) SetOverrideReadWrite(val *string) {
x.OverridableProtectedMember.SetOverrideReadWrite(jsii.String(fmt.Sprintf("zzzzzzzzz%s", *val)))
}

Expand All @@ -737,7 +737,6 @@ func newTestCanOverrideProtectedSetterOverridableProtectedMember() *TestCanOverr
return &m
}


func (suite *ComplianceSuite) TestObjRefsAreLabelledUsingWithTheMostCorrectType() {
require := suite.Require()

Expand Down Expand Up @@ -952,7 +951,7 @@ func (suite *ComplianceSuite) TestPropertyOverrides_Get_Calls_Super() {
}

type testPropertyOverridesGetCallsSuper struct {
calc.SyncVirtualMethods `overrides:"TheProperty"`
calc.SyncVirtualMethods
}

func (t *testPropertyOverridesGetCallsSuper) TheProperty() *string {
Expand Down Expand Up @@ -1063,7 +1062,7 @@ func (suite *ComplianceSuite) TestPropertyOverrides_Get_Throws() {
}

type testPropertyOverridesGetThrows struct {
calc.SyncVirtualMethods `overrides:"TheProperty"`
calc.SyncVirtualMethods
}

func (t *testPropertyOverridesGetThrows) TheProperty() *string {
Expand Down Expand Up @@ -1143,7 +1142,7 @@ func (suite *ComplianceSuite) TestPropertyOverrides_Set_Calls_Super() {
}

type testPropertyOverridesSetCallsSuper struct {
calc.SyncVirtualMethods `overrides:"TheProperty"`
calc.SyncVirtualMethods
}

func (t *testPropertyOverridesSetCallsSuper) SetTheProperty(value *string) {
Expand Down Expand Up @@ -1327,8 +1326,8 @@ func (suite *ComplianceSuite) TestObjectIdDoesNotGetReallocatedWhenTheConstructo
}

type partiallyInitializedThisConsumerImpl struct {
calc.PartiallyInitializedThisConsumer `overrides:"ConsumePartiallyInitializedThis"`
require *require.Assertions
calc.PartiallyInitializedThisConsumer
require *require.Assertions
}

func NewPartiallyInitializedThisConsumerImpl(assert *require.Assertions) *partiallyInitializedThisConsumerImpl {
Expand Down Expand Up @@ -1478,7 +1477,7 @@ func (suite *ComplianceSuite) TestPropertyOverrides_Set_Throws() {
}

type testPropertyOverrides_Set_ThrowsSyncVirtualMethods struct {
calc.SyncVirtualMethods `overrides:"TheProperty"`
calc.SyncVirtualMethods
}

func NewTestPropertyOverrides_Set_ThrowsSyncVirtualMethods() *testPropertyOverrides_Set_ThrowsSyncVirtualMethods {
Expand Down Expand Up @@ -1582,7 +1581,7 @@ func (suite *ComplianceSuite) TestAsyncOverrides_OverrideCallsSuper() {
}

type OverrideCallsSuper struct {
calc.AsyncVirtualMethods `overrides:"OverrideMe"`
calc.AsyncVirtualMethods
}

func (o *OverrideCallsSuper) OverrideMe(mult *float64) *float64 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

type OverrideAsyncMethods struct {
jsiicalc.AsyncVirtualMethods `overrides:"OverrideMe"`
jsiicalc.AsyncVirtualMethods
}

func New() *OverrideAsyncMethods {
Expand Down
Loading

0 comments on commit 1801f4f

Please sign in to comment.