Skip to content

Commit

Permalink
Stop bundling jsii packages - consume from npm instead (#521)
Browse files Browse the repository at this point in the history
Simply source `jsii` modules from `npm` as per normal...
  • Loading branch information
RomainMuller authored Aug 8, 2018
1 parent 61be5cb commit f553138
Show file tree
Hide file tree
Showing 163 changed files with 619 additions and 352 deletions.
4 changes: 1 addition & 3 deletions bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ root=$PWD
version="$(cat ${root}/lerna.json | grep version | cut -d '"' -f4)"

# Get commit from CodePipeline (or git, if we are in CodeBuild)
# If CODEBUILD_RESOLVED_SOURCE_VERSION is not defined (i.e. local
# If CODEBUILD_RESOLVED_SOURCE_VERSION is not defined (i.e. local
# build or CodePipeline build), use the HEAD commit hash).
commit="${CODEBUILD_RESOLVED_SOURCE_VERSION:-}"
if [ -z "${commit}" ]; then
Expand Down Expand Up @@ -49,8 +49,6 @@ echo "Staging: ${staging}"
# dist/ directories in the repo (this is what ./pack.sh is doing). This includes
# 'docs', 'npm', 'java' and 'dotnet' and any other jsii language artifacts.
rsync -av ${root}/pack/ .
# Also bundle the JSII java runtime in the Maven Repository
rsync -av ${root}/node_modules/jsii-java-runtime/maven-repo/ ./java/

# We are keeping y-npm support only for backwards compatibility reasons and until
# we publish y-npm itself and can devise instructions on how to use the self-contained .zip.
Expand Down
13 changes: 1 addition & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,16 @@
"ignore": true
},
"scripts": {
"preinstall": "rm -fr .local-npm && mkdir -p .local-npm && (cd .local-npm && unzip ../vendor/*.zip)",
"pkglint": "tools/pkglint/bin/pkglint -f ."
},
"devDependencies": {
"@types/node": "^8.9.4",
"@types/nodeunit": "^0.0.30",
"codemaker": "file:.local-npm/codemaker-0.5.0-beta.tgz",
"jsii": "file:.local-npm/jsii-0.5.0-beta.tgz",
"jsii-dotnet-generator": "file:.local-npm/jsii-dotnet-generator-0.5.0-beta.tgz",
"jsii-dotnet-jsonmodel": "file:.local-npm/jsii-dotnet-jsonmodel-0.5.0-beta.tgz",
"jsii-dotnet-runtime": "file:.local-npm/jsii-dotnet-runtime-0.5.0-beta.tgz",
"jsii-java-runtime": "file:.local-npm/jsii-java-runtime-0.5.0-beta.tgz",
"jsii-kernel": "file:.local-npm/jsii-kernel-0.5.0-beta.tgz",
"jsii-pacmak": "file:.local-npm/jsii-pacmak-0.5.0-beta.tgz",
"jsii-runtime": "file:.local-npm/jsii-runtime-0.5.0-beta.tgz",
"jsii-spec": "file:.local-npm/jsii-spec-0.5.0-beta.tgz",
"lerna": "^2.11.0",
"nodeunit": "^0.11.2",
"nyc": "^11.8.0",
"tslint": "^5.10.0",
"typescript": "^2.8.3"
"typescript": "^3.0.1"
},
"repository": {
"type": "git",
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/assets/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "cdk-assets"
}
},
"dotnet": {
"namespace": "Amazon.CDK.Assets"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-apigateway/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-apigateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "apigateway"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.APIGateway"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-applicationautoscaling/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-applicationautoscaling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "applicationautoscaling"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.ApplicationAutoScaling"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-appsync/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-appsync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "appsync"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.AppSync"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-athena/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-athena/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "athena"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.Athena"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-autoscaling/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-autoscaling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "autoscaling"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.AutoScaling"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-autoscalingplans/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-autoscalingplans/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "autoscalingplans"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.AutoScalingPlans"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-batch/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-batch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "batch"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.Batch"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-budgets/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-budgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "budgets"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.Budgets"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-certificatemanager/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-certificatemanager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "certificatemanager"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.CertificateManager"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-cloud9/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-cloud9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "cloud9"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.Cloud9"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-cloudformation/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-cloudformation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "cloudformation"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.CloudFormation"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-cloudfront/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ coverage

.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-cloudfront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "cloudfront"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.CloudFront"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-cloudtrail/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-cloudtrail/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "cloudtrail"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.CloudTrail"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-cloudwatch/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-cloudwatch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "cloudwatch"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.CloudWatch"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-codebuild-codepipeline/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ dist
!*.js
coverage
.nyc_output
*.tgz
*.tgz

# Include .jsii
!.jsii
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-codebuild-codepipeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"artifactId": "codebuild-codepipeline"
}
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.Codebuild.Codepipeline"
},
"sphinx": {}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-codebuild/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ coverage
dist
.LAST_PACKAGE
.LAST_BUILD
!*.js
!*.js

# Include .jsii
!.jsii
6 changes: 4 additions & 2 deletions packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ export class Project extends ProjectRef {
/**
* The IAM role for this project.
*/
public readonly role: iam.Role;
public readonly role?: iam.Role;

/**
* The ARN of the project.
Expand Down Expand Up @@ -450,7 +450,9 @@ export class Project extends ProjectRef {
* @param statement The permissions statement to add
*/
public addToRolePolicy(statement: cdk.PolicyStatement) {
return this.role.addToPolicy(statement);
if (this.role) {
this.role.addToPolicy(statement);
}
}

private createLoggingPermission() {
Expand Down
Loading

0 comments on commit f553138

Please sign in to comment.