Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): fix some return types #3192

Merged
merged 5 commits into from
Jul 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
change-return-type:@aws-cdk/aws-codebuild.PipelineProject.addSecondaryArtifact
change-return-type:@aws-cdk/aws-codebuild.Project.addSecondaryArtifact
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ export class Project extends ProjectBase {
* @param secondaryArtifact the artifact to add as a secondary artifact
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-multi-in-out.html
*/
public addSecondaryArtifact(secondaryArtifact: IArtifacts): any {
public addSecondaryArtifact(secondaryArtifact: IArtifacts): void {
if (!secondaryArtifact.identifier) {
throw new Error("The identifier attribute is mandatory for secondary artifacts");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
removed:@aws-cdk/aws-ec2.Port.toRuleJSON
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-ec2/lib/port.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export class Port {
/**
* Produce the ingress/egress rule JSON for the given connection
*/
public toRuleJSON(): any {
public toRuleJson(): any {
return {
ipProtocol: this.props.protocol,
fromPort: this.props.fromPort,
Expand All @@ -198,4 +198,4 @@ export class Port {

function renderPort(port: number) {
return Token.isUnresolved(port) ? `{IndirectPort}` : port.toString();
}
}
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-ec2/lib/security-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ abstract class SecurityGroupBase extends Resource implements ISecurityGroup {
new CfnSecurityGroupIngress(scope, id, {
groupId: this.securityGroupId,
...peer.toIngressRuleConfig(),
...connection.toRuleJSON(),
...connection.toRuleJson(),
description
});
}
Expand All @@ -94,7 +94,7 @@ abstract class SecurityGroupBase extends Resource implements ISecurityGroup {
new CfnSecurityGroupEgress(scope, id, {
groupId: this.securityGroupId,
...peer.toEgressRuleConfig(),
...connection.toRuleJSON(),
...connection.toRuleJson(),
description
});
}
Expand Down Expand Up @@ -298,7 +298,7 @@ export class SecurityGroup extends SecurityGroupBase {

this.addDirectIngressRule({
...peer.toIngressRuleConfig(),
...connection.toRuleJSON(),
...connection.toRuleJson(),
description
});
}
Expand Down Expand Up @@ -327,7 +327,7 @@ export class SecurityGroup extends SecurityGroupBase {

const rule = {
...peer.toEgressRuleConfig(),
...connection.toRuleJSON(),
...connection.toRuleJson(),
description
};

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/core/lib/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export class Stack extends Construct implements ITaggable {
* reports them as missing, and let the CLI resolve them by calling EC2
* `DescribeAvailabilityZones` on the target environment.
*/
public get availabilityZones() {
public get availabilityZones(): string[] {
// if account/region are tokens, we can't obtain AZs through the context
// provider, so we fallback to use Fn::GetAZs. the current lowest common
// denominator is 2 AZs across all AWS regions.
Expand Down
1 change: 1 addition & 0 deletions scripts/check-api-compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ for i in ${!package_dirs[*]}; do
if [[ ! -d $tmpdir/node_modules/${package_names[$i]} ]]; then continue; fi
echo -n "${package_names[$i]}... "
if npx jsii-diff \
--keys \
--ignore-file ${package_dirs[$i]}/allowed-breaking-changes-${current_version}.txt \
$tmpdir/node_modules/${package_names[$i]} \
${package_dirs[$i]} \
Expand Down