Skip to content

Commit

Permalink
release: v0.20.4 (#974)
Browse files Browse the repository at this point in the history
Added code to up-cast from `dict` to the relevant struct type in the generated
python code whenever the value type is some unambiguous struct. Whenever
a UNION of types is involved, the user must construct the struct type themselves,
as the runtime would then have no way to choose which type should be used on
it's own without additional information.
  • Loading branch information
RomainMuller authored Nov 12, 2019
1 parent 26aa77c commit 96d89e1
Show file tree
Hide file tree
Showing 113 changed files with 1,360 additions and 207 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.20.4](https://github.com/aws/jsii/compare/v0.20.3...v0.20.4) (2019-11-12)


### Bug Fixes

* **python:** correctly handle nested structs-as-dict ([#973](https://github.com/aws/jsii/issues/973)) ([9fd2499](https://github.com/aws/jsii/commit/9fd2499388745cf63d194a47bf247e5e24f4a7db))





## [0.20.3](https://github.com/aws/jsii/compare/v0.20.2...v0.20.3) (2019-11-11)


Expand Down
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": "0.20.3"
"version": "0.20.4"
}
8 changes: 8 additions & 0 deletions packages/codemaker/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.20.4](https://github.com/aws/jsii/compare/v0.20.3...v0.20.4) (2019-11-12)

**Note:** Version bump only for package codemaker





## [0.20.3](https://github.com/aws/jsii/compare/v0.20.2...v0.20.3) (2019-11-11)

**Note:** Version bump only for package codemaker
Expand Down
2 changes: 1 addition & 1 deletion packages/codemaker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codemaker",
"version": "0.20.3",
"version": "0.20.4",
"description": "A tiny utility for generating source code",
"license": "Apache-2.0",
"author": {
Expand Down
8 changes: 8 additions & 0 deletions packages/jsii-build-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.20.4](https://github.com/aws/jsii/compare/v0.20.3...v0.20.4) (2019-11-12)

**Note:** Version bump only for package jsii-build-tools





## [0.20.3](https://github.com/aws/jsii/compare/v0.20.2...v0.20.3) (2019-11-11)

**Note:** Version bump only for package jsii-build-tools
Expand Down
2 changes: 1 addition & 1 deletion packages/jsii-build-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsii-build-tools",
"version": "0.20.3",
"version": "0.20.4",
"private": true,
"description": "Internal repository-level tools",
"license": "Apache-2.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/jsii-calc-base-of-base/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.20.4](https://github.com/aws/jsii/compare/v0.20.3...v0.20.4) (2019-11-12)

**Note:** Version bump only for package @scope/jsii-calc-base-of-base





## [0.20.3](https://github.com/aws/jsii/compare/v0.20.2...v0.20.3) (2019-11-11)

**Note:** Version bump only for package @scope/jsii-calc-base-of-base
Expand Down
6 changes: 3 additions & 3 deletions packages/jsii-calc-base-of-base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scope/jsii-calc-base-of-base",
"version": "0.20.3",
"version": "0.20.4",
"private": true,
"description": "An example transitive dependency for jsii-calc.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -29,8 +29,8 @@
"test:update": "npm run build && UPDATE_DIFF=1 npm run test"
},
"devDependencies": {
"jsii": "^0.20.3",
"jsii-build-tools": "^0.20.3"
"jsii": "^0.20.4",
"jsii-build-tools": "^0.20.4"
},
"jsii": {
"outdir": "dist",
Expand Down
6 changes: 3 additions & 3 deletions packages/jsii-calc-base-of-base/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"description": "An example transitive dependency for jsii-calc.",
"homepage": "https://github.com/aws/jsii",
"jsiiVersion": "0.20.3",
"jsiiVersion": "0.20.4",
"license": "Apache-2.0",
"name": "@scope/jsii-calc-base-of-base",
"repository": {
Expand Down Expand Up @@ -110,6 +110,6 @@
]
}
},
"version": "0.20.3",
"fingerprint": "bEQA39uj2RUus5ZFJHS6u+4dObsdCz+6nz1OCgC8gEA="
"version": "0.20.4",
"fingerprint": "CTFOBPl1h1P7OanPGuUCZj/kGnWefYnRI7+Kks7Oux8="
}
8 changes: 8 additions & 0 deletions packages/jsii-calc-base/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.20.4](https://github.com/aws/jsii/compare/v0.20.3...v0.20.4) (2019-11-12)

**Note:** Version bump only for package @scope/jsii-calc-base





## [0.20.3](https://github.com/aws/jsii/compare/v0.20.2...v0.20.3) (2019-11-11)

**Note:** Version bump only for package @scope/jsii-calc-base
Expand Down
10 changes: 5 additions & 5 deletions packages/jsii-calc-base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scope/jsii-calc-base",
"version": "0.20.3",
"version": "0.20.4",
"private": true,
"description": "An example direct dependency for jsii-calc.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -29,14 +29,14 @@
"test:update": "npm run build && UPDATE_DIFF=1 npm run test"
},
"dependencies": {
"@scope/jsii-calc-base-of-base": "^0.20.3"
"@scope/jsii-calc-base-of-base": "^0.20.4"
},
"peerDependencies": {
"@scope/jsii-calc-base-of-base": "^0.20.3"
"@scope/jsii-calc-base-of-base": "^0.20.4"
},
"devDependencies": {
"jsii": "^0.20.3",
"jsii-build-tools": "^0.20.3"
"jsii": "^0.20.4",
"jsii-build-tools": "^0.20.4"
},
"jsii": {
"outdir": "dist",
Expand Down
10 changes: 5 additions & 5 deletions packages/jsii-calc-base/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"module": "scope.jsii_calc_base_of_base"
}
},
"version": "0.20.3"
"version": "0.20.4"
}
},
"dependencyClosure": {
Expand All @@ -54,12 +54,12 @@
"module": "scope.jsii_calc_base_of_base"
}
},
"version": "0.20.3"
"version": "0.20.4"
}
},
"description": "An example direct dependency for jsii-calc.",
"homepage": "https://github.com/aws/jsii",
"jsiiVersion": "0.20.3",
"jsiiVersion": "0.20.4",
"license": "Apache-2.0",
"name": "@scope/jsii-calc-base",
"repository": {
Expand Down Expand Up @@ -173,6 +173,6 @@
"name": "IBaseInterface"
}
},
"version": "0.20.3",
"fingerprint": "0IR7KelwYefWdNKrUGCmpipMIXqmySYWQo3Ie0GLs0E="
"version": "0.20.4",
"fingerprint": "QA/Uez7P6b9LKt4LeSdtpljkoj/RINtXWde4MjtExkk="
}
8 changes: 8 additions & 0 deletions packages/jsii-calc-lib/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.20.4](https://github.com/aws/jsii/compare/v0.20.3...v0.20.4) (2019-11-12)

**Note:** Version bump only for package @scope/jsii-calc-lib





## [0.20.3](https://github.com/aws/jsii/compare/v0.20.2...v0.20.3) (2019-11-11)

**Note:** Version bump only for package @scope/jsii-calc-lib
Expand Down
10 changes: 5 additions & 5 deletions packages/jsii-calc-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scope/jsii-calc-lib",
"version": "0.20.3",
"version": "0.20.4",
"private": true,
"description": "A simple calcuator library built on JSII.",
"deprecated": "Really just deprecated for shows...",
Expand Down Expand Up @@ -31,14 +31,14 @@
"test:update": "npm run build && UPDATE_DIFF=1 npm run test"
},
"dependencies": {
"@scope/jsii-calc-base": "^0.20.3"
"@scope/jsii-calc-base": "^0.20.4"
},
"peerDependencies": {
"@scope/jsii-calc-base": "^0.20.3"
"@scope/jsii-calc-base": "^0.20.4"
},
"devDependencies": {
"jsii": "^0.20.3",
"jsii-build-tools": "^0.20.3"
"jsii": "^0.20.4",
"jsii-build-tools": "^0.20.4"
},
"jsii": {
"outdir": "dist",
Expand Down
12 changes: 6 additions & 6 deletions packages/jsii-calc-lib/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"module": "scope.jsii_calc_base"
}
},
"version": "0.20.3"
"version": "0.20.4"
}
},
"dependencyClosure": {
Expand All @@ -54,7 +54,7 @@
"module": "scope.jsii_calc_base"
}
},
"version": "0.20.3"
"version": "0.20.4"
},
"@scope/jsii-calc-base-of-base": {
"targets": {
Expand All @@ -77,7 +77,7 @@
"module": "scope.jsii_calc_base_of_base"
}
},
"version": "0.20.3"
"version": "0.20.4"
}
},
"description": "A simple calcuator library built on JSII.",
Expand All @@ -86,7 +86,7 @@
"stability": "deprecated"
},
"homepage": "https://github.com/aws/jsii",
"jsiiVersion": "0.20.3",
"jsiiVersion": "0.20.4",
"license": "Apache-2.0",
"name": "@scope/jsii-calc-lib",
"repository": {
Expand Down Expand Up @@ -538,6 +538,6 @@
]
}
},
"version": "0.20.3",
"fingerprint": "ui/3zA+Ppo35hXyXMm3f+YynqNBsOq2i44VaPZh0/hY="
"version": "0.20.4",
"fingerprint": "cgTc9JCOUBd+KkYayX1pTHgJDYQiMTSS/tdj48cUUn0="
}
11 changes: 11 additions & 0 deletions packages/jsii-calc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.20.4](https://github.com/aws/jsii/compare/v0.20.3...v0.20.4) (2019-11-12)


### Bug Fixes

* **python:** correctly handle nested structs-as-dict ([#973](https://github.com/aws/jsii/issues/973)) ([9fd2499](https://github.com/aws/jsii/commit/9fd2499388745cf63d194a47bf247e5e24f4a7db))





## [0.20.3](https://github.com/aws/jsii/compare/v0.20.2...v0.20.3) (2019-11-11)

**Note:** Version bump only for package jsii-calc
Expand Down
33 changes: 33 additions & 0 deletions packages/jsii-calc/lib/compliance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2175,3 +2175,36 @@ class PrivateBell implements IBell {
this.rung = true;
}
}

/**
* This is here to check that we can pass a nested struct into a kwargs by specifying it as an
* in-line dictionary. This is cheating with the declared types, but Python people don't play by
* the rules much apparently.
*/
export interface RootStruct {
/**
* May not be empty.
*/
readonly stringProp: string;
readonly nestedStruct?: NestedStruct;
}
export interface NestedStruct {
/**
* When provided, must be > 0.
*/
readonly numberProp: number;
}
export class RootStructValidator {
public static validate(struct: RootStruct): void {
if (!struct.stringProp) {
throw new Error('Missing required field: stringProp');
}
if (struct.nestedStruct) {
if (struct.nestedStruct.numberProp <= 0) {
throw new Error('numberProp must be > 0');
}
}
}

private constructor() { }
}
18 changes: 9 additions & 9 deletions packages/jsii-calc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsii-calc",
"version": "0.20.3",
"version": "0.20.4",
"private": true,
"description": "A simple calcuator built on JSII.",
"stability": "experimental",
Expand Down Expand Up @@ -31,19 +31,19 @@
"test:update": "npm run build && UPDATE_DIFF=1 npm run test"
},
"dependencies": {
"@scope/jsii-calc-base": "^0.20.3",
"@scope/jsii-calc-base-of-base": "^0.20.3",
"@scope/jsii-calc-lib": "^0.20.3",
"@scope/jsii-calc-base": "^0.20.4",
"@scope/jsii-calc-base-of-base": "^0.20.4",
"@scope/jsii-calc-lib": "^0.20.4",
"jsii-calc-bundled": "file:../@fixtures/jsii-calc-bundled"
},
"peerDependencies": {
"@scope/jsii-calc-base": "^0.20.3",
"@scope/jsii-calc-base-of-base": "^0.20.3",
"@scope/jsii-calc-lib": "^0.20.3"
"@scope/jsii-calc-base": "^0.20.4",
"@scope/jsii-calc-base-of-base": "^0.20.4",
"@scope/jsii-calc-lib": "^0.20.4"
},
"devDependencies": {
"jsii": "^0.20.3",
"jsii-build-tools": "^0.20.3"
"jsii": "^0.20.4",
"jsii-build-tools": "^0.20.4"
},
"jsii": {
"outdir": "dist",
Expand Down
Loading

0 comments on commit 96d89e1

Please sign in to comment.