diff --git a/.gitignore b/.gitignore index a0aca6a8a4e08..c7edf94689791 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ lerna-debug.log dist pack .BUILD_COMPLETED +.local-npm \ No newline at end of file diff --git a/README.md b/README.md index b66c54f7fdd4c..e0e274034bd7f 100644 --- a/README.md +++ b/README.md @@ -159,8 +159,8 @@ npm run pkglint ### Updating jsii -Run `./pack.sh` in the jsii repository and copy the tarballs to `./local-npm`. -Make sure all tarballs are defined in the root `package.json`. +Download an official jsii zip bundle and replace the file under `./vendor`. +Any added dependencies, they will need to be added to the root `package.json`. # Language Support diff --git a/build.sh b/build.sh index 61296b08d3783..b99aa20457085 100755 --- a/build.sh +++ b/build.sh @@ -12,7 +12,7 @@ export PATH=node_modules/.bin:$PATH echo "=============================================================================================" echo "boostrapping..." -lerna bootstrap --reject-cycles --loglevel=debug +lerna bootstrap --reject-cycles echo "=============================================================================================" echo "testing..." diff --git a/bundle-beta.sh b/bundle-beta.sh index c84cd6c1439d6..1f5c8b8c42c42 100755 --- a/bundle-beta.sh +++ b/bundle-beta.sh @@ -24,7 +24,7 @@ echo "Staging: ${staging}" # Create a local npm repository mkdir -p repo/npm rsync -aL ${root}/pack/*.tgz repo/npm # cdk modules -rsync -aL ${root}/local-npm/*.tgz repo/npm # jsii modules +rsync -aL ${root}/.local-npm/*.tgz repo/npm # jsii modules # Create a local maven repository mkdir -p repo/maven diff --git a/install.sh b/install.sh index f71160b09bce4..6f3ef6a9804f3 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,9 @@ #!/bin/bash set -euo pipefail +mkdir -p .local-npm +(cd .local-npm && unzip ../vendor/*.zip) + echo "=============================================================================================" echo "installing repo-global dependencies..." npm i --no-package-lock --global-style diff --git a/local-npm/.gitignore b/local-npm/.gitignore deleted file mode 100644 index 27b93e1e63535..0000000000000 --- a/local-npm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!*.tgz diff --git a/local-npm/codemaker-0.4.0-pre.tgz b/local-npm/codemaker-0.4.0-pre.tgz deleted file mode 100644 index 2263fc78f142a..0000000000000 Binary files a/local-npm/codemaker-0.4.0-pre.tgz and /dev/null differ diff --git a/local-npm/jsii-0.4.0-pre.tgz b/local-npm/jsii-0.4.0-pre.tgz deleted file mode 100644 index 1f3884c6c3165..0000000000000 Binary files a/local-npm/jsii-0.4.0-pre.tgz and /dev/null differ diff --git a/local-npm/jsii-java-runtime-0.4.0-pre.tgz b/local-npm/jsii-java-runtime-0.4.0-pre.tgz deleted file mode 100644 index edd5e6f229b6f..0000000000000 Binary files a/local-npm/jsii-java-runtime-0.4.0-pre.tgz and /dev/null differ diff --git a/local-npm/jsii-kernel-0.4.0-pre.tgz b/local-npm/jsii-kernel-0.4.0-pre.tgz deleted file mode 100644 index e70d4d0a2d73f..0000000000000 Binary files a/local-npm/jsii-kernel-0.4.0-pre.tgz and /dev/null differ diff --git a/local-npm/jsii-pacmak-0.4.0-pre.tgz b/local-npm/jsii-pacmak-0.4.0-pre.tgz deleted file mode 100644 index 59a22eebca614..0000000000000 Binary files a/local-npm/jsii-pacmak-0.4.0-pre.tgz and /dev/null differ diff --git a/local-npm/jsii-runtime-0.4.0-pre.tgz b/local-npm/jsii-runtime-0.4.0-pre.tgz deleted file mode 100644 index 83873fdd28cfc..0000000000000 Binary files a/local-npm/jsii-runtime-0.4.0-pre.tgz and /dev/null differ diff --git a/local-npm/jsii-spec-0.4.0-pre.tgz b/local-npm/jsii-spec-0.4.0-pre.tgz deleted file mode 100644 index 529bb2ff08eb8..0000000000000 Binary files a/local-npm/jsii-spec-0.4.0-pre.tgz and /dev/null differ diff --git a/package.json b/package.json index 2fd671e22ea3a..d30e20ecf740f 100644 --- a/package.json +++ b/package.json @@ -14,13 +14,13 @@ "typescript": "^2.8.3", "tslint": "^5.10.0", "nyc": "^11.8.0", - "jsii": "file:local-npm/jsii-0.4.0-pre.tgz", - "jsii-java-runtime": "file:local-npm/jsii-java-runtime-0.4.0-pre.tgz", - "jsii-pacmak": "file:local-npm/jsii-pacmak-0.4.0-pre.tgz", - "jsii-runtime": "file:local-npm/jsii-runtime-0.4.0-pre.tgz", - "jsii-spec": "file:local-npm/jsii-spec-0.4.0-pre.tgz", - "jsii-kernel": "file:local-npm/jsii-kernel-0.4.0-pre.tgz", - "codemaker": "file:local-npm/codemaker-0.4.0-pre.tgz" + "jsii": "file:.local-npm/jsii-0.4.0-pre.tgz", + "jsii-java-runtime": "file:.local-npm/jsii-java-runtime-0.4.0-pre.tgz", + "jsii-pacmak": "file:.local-npm/jsii-pacmak-0.4.0-pre.tgz", + "jsii-runtime": "file:.local-npm/jsii-runtime-0.4.0-pre.tgz", + "jsii-spec": "file:.local-npm/jsii-spec-0.4.0-pre.tgz", + "jsii-kernel": "file:.local-npm/jsii-kernel-0.4.0-pre.tgz", + "codemaker": "file:.local-npm/codemaker-0.4.0-pre.tgz" }, "repository": { "type": "git", diff --git a/packages/@aws-cdk/acm/.gitignore b/packages/@aws-cdk/acm/.gitignore index 0706fc7fce4d3..4e5b425f7cc3f 100644 --- a/packages/@aws-cdk/acm/.gitignore +++ b/packages/@aws-cdk/acm/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/cloudformation-diff/lib/diff/index.ts b/packages/@aws-cdk/cloudformation-diff/lib/diff/index.ts index de10db6067c46..632f9567498b9 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/diff/index.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/diff/index.ts @@ -51,7 +51,7 @@ export function diffResource(oldValue: types.Resource, newValue: types.Resource) function _diffProperty(oldV: any, newV: any, key: string, resourceClass?: ResourceClass) { let changeImpact: types.ResourceImpact | undefined; - const spec = resourceClass && resourceClass.RESOURCE_PROPERTIES[key]; + const spec = resourceClass && resourceClass.resourceProperties[key]; if (spec) { switch (spec.updateType) { case 'Immutable': diff --git a/packages/@aws-cdk/cloudfront/.gitignore b/packages/@aws-cdk/cloudfront/.gitignore index c5808ff37102b..44e182f4814d1 100644 --- a/packages/@aws-cdk/cloudfront/.gitignore +++ b/packages/@aws-cdk/cloudfront/.gitignore @@ -1,6 +1,7 @@ *.js *.d.ts tsconfig.json +tslint.json *.js.map dist coverage diff --git a/packages/@aws-cdk/cloudtrail/.gitignore b/packages/@aws-cdk/cloudtrail/.gitignore index 0706fc7fce4d3..4e5b425f7cc3f 100644 --- a/packages/@aws-cdk/cloudtrail/.gitignore +++ b/packages/@aws-cdk/cloudtrail/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/codebuild/.gitignore b/packages/@aws-cdk/codebuild/.gitignore index 0946edfabe9fa..541a7635fd070 100644 --- a/packages/@aws-cdk/codebuild/.gitignore +++ b/packages/@aws-cdk/codebuild/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/codecommit/.gitignore b/packages/@aws-cdk/codecommit/.gitignore index 4a14c934cd873..026a6f10e3d47 100644 --- a/packages/@aws-cdk/codecommit/.gitignore +++ b/packages/@aws-cdk/codecommit/.gitignore @@ -4,3 +4,4 @@ node_modules dist tsconfig.json +tslint.json diff --git a/packages/@aws-cdk/codepipeline/.gitignore b/packages/@aws-cdk/codepipeline/.gitignore index 0946edfabe9fa..541a7635fd070 100644 --- a/packages/@aws-cdk/codepipeline/.gitignore +++ b/packages/@aws-cdk/codepipeline/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/core/.gitignore b/packages/@aws-cdk/core/.gitignore index c5808ff37102b..44e182f4814d1 100644 --- a/packages/@aws-cdk/core/.gitignore +++ b/packages/@aws-cdk/core/.gitignore @@ -1,6 +1,7 @@ *.js *.d.ts tsconfig.json +tslint.json *.js.map dist coverage diff --git a/packages/@aws-cdk/core/lib/cloudformation/resource.ts b/packages/@aws-cdk/core/lib/cloudformation/resource.ts index b6700572b7e7c..ae19bc1090e7d 100644 --- a/packages/@aws-cdk/core/lib/cloudformation/resource.ts +++ b/packages/@aws-cdk/core/lib/cloudformation/resource.ts @@ -24,8 +24,9 @@ export class Resource extends Referenceable { /** * A decoration used to create a CloudFormation attribute property. * @param customName Custom name for the attribute (default is the name of the property) + * NOTE: we return "any" here to satistfy jsii, which doesn't support lambdas. */ - public static attribute(customName?: string) { + public static attribute(customName?: string): any { return (prototype: any, key: string) => { const name = customName || key; Object.defineProperty(prototype, key, { diff --git a/packages/@aws-cdk/custom-resources/.gitignore b/packages/@aws-cdk/custom-resources/.gitignore index 0706fc7fce4d3..4e5b425f7cc3f 100644 --- a/packages/@aws-cdk/custom-resources/.gitignore +++ b/packages/@aws-cdk/custom-resources/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/cx-api/.gitignore b/packages/@aws-cdk/cx-api/.gitignore index 4a14c934cd873..026a6f10e3d47 100644 --- a/packages/@aws-cdk/cx-api/.gitignore +++ b/packages/@aws-cdk/cx-api/.gitignore @@ -4,3 +4,4 @@ node_modules dist tsconfig.json +tslint.json diff --git a/packages/@aws-cdk/dynamodb/.gitignore b/packages/@aws-cdk/dynamodb/.gitignore index 4a14c934cd873..8ad82bc245b78 100644 --- a/packages/@aws-cdk/dynamodb/.gitignore +++ b/packages/@aws-cdk/dynamodb/.gitignore @@ -4,3 +4,5 @@ node_modules dist tsconfig.json +tslint.json + diff --git a/packages/@aws-cdk/ec2/.gitignore b/packages/@aws-cdk/ec2/.gitignore index 26bed542eb091..00eafcfae55bb 100644 --- a/packages/@aws-cdk/ec2/.gitignore +++ b/packages/@aws-cdk/ec2/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/events/.gitignore b/packages/@aws-cdk/events/.gitignore index 0946edfabe9fa..541a7635fd070 100644 --- a/packages/@aws-cdk/events/.gitignore +++ b/packages/@aws-cdk/events/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/iam/.gitignore b/packages/@aws-cdk/iam/.gitignore index 0706fc7fce4d3..4e5b425f7cc3f 100644 --- a/packages/@aws-cdk/iam/.gitignore +++ b/packages/@aws-cdk/iam/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/kms/.gitignore b/packages/@aws-cdk/kms/.gitignore index 4a14c934cd873..026a6f10e3d47 100644 --- a/packages/@aws-cdk/kms/.gitignore +++ b/packages/@aws-cdk/kms/.gitignore @@ -4,3 +4,4 @@ node_modules dist tsconfig.json +tslint.json diff --git a/packages/@aws-cdk/lambda/.gitignore b/packages/@aws-cdk/lambda/.gitignore index 4a14c934cd873..8ad82bc245b78 100644 --- a/packages/@aws-cdk/lambda/.gitignore +++ b/packages/@aws-cdk/lambda/.gitignore @@ -4,3 +4,5 @@ node_modules dist tsconfig.json +tslint.json + diff --git a/packages/@aws-cdk/neptune/.gitignore b/packages/@aws-cdk/neptune/.gitignore index 0946edfabe9fa..541a7635fd070 100644 --- a/packages/@aws-cdk/neptune/.gitignore +++ b/packages/@aws-cdk/neptune/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/quickstarts/.gitignore b/packages/@aws-cdk/quickstarts/.gitignore index 0706fc7fce4d3..4e5b425f7cc3f 100644 --- a/packages/@aws-cdk/quickstarts/.gitignore +++ b/packages/@aws-cdk/quickstarts/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/rds/.gitignore b/packages/@aws-cdk/rds/.gitignore index 0946edfabe9fa..541a7635fd070 100644 --- a/packages/@aws-cdk/rds/.gitignore +++ b/packages/@aws-cdk/rds/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/route53/.gitignore b/packages/@aws-cdk/route53/.gitignore index 4a14c934cd873..026a6f10e3d47 100644 --- a/packages/@aws-cdk/route53/.gitignore +++ b/packages/@aws-cdk/route53/.gitignore @@ -4,3 +4,4 @@ node_modules dist tsconfig.json +tslint.json diff --git a/packages/@aws-cdk/rtv/.gitignore b/packages/@aws-cdk/rtv/.gitignore index fdb40c4293695..864e4e5e8fe02 100644 --- a/packages/@aws-cdk/rtv/.gitignore +++ b/packages/@aws-cdk/rtv/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/s3/.gitignore b/packages/@aws-cdk/s3/.gitignore index 0946edfabe9fa..541a7635fd070 100644 --- a/packages/@aws-cdk/s3/.gitignore +++ b/packages/@aws-cdk/s3/.gitignore @@ -1,5 +1,6 @@ *.js tsconfig.json +tslint.json *.js.map *.d.ts dist diff --git a/packages/@aws-cdk/sns/.gitignore b/packages/@aws-cdk/sns/.gitignore index 4a14c934cd873..026a6f10e3d47 100644 --- a/packages/@aws-cdk/sns/.gitignore +++ b/packages/@aws-cdk/sns/.gitignore @@ -4,3 +4,4 @@ node_modules dist tsconfig.json +tslint.json diff --git a/packages/@aws-cdk/sqs/.gitignore b/packages/@aws-cdk/sqs/.gitignore index 4a14c934cd873..8ad82bc245b78 100644 --- a/packages/@aws-cdk/sqs/.gitignore +++ b/packages/@aws-cdk/sqs/.gitignore @@ -4,3 +4,5 @@ node_modules dist tsconfig.json +tslint.json + diff --git a/tools/cfn2ts/lib/codegen.ts b/tools/cfn2ts/lib/codegen.ts index 55bc4c7237a38..961d3b1f88a07 100644 --- a/tools/cfn2ts/lib/codegen.ts +++ b/tools/cfn2ts/lib/codegen.ts @@ -206,12 +206,12 @@ export default class CodeGenerator { this.code.line('/**'); this.code.line(` * The CloudFormation resource type name for this resource class.`); this.code.line(' */'); - this.code.line(`public static readonly RESOURCE_TYPE_NAME = ${JSON.stringify(resourceName.specName!.fqn)};`); + this.code.line(`public static readonly resourceTypeName = ${JSON.stringify(resourceName.specName!.fqn)};`); this.code.line(); this.code.line('/**'); this.code.line(' * The list of properties on the CloudFormation model for this resource, with their attache metadata.'); this.code.line(' */'); - this.code.open(`public static readonly RESOURCE_PROPERTIES: { [name: string]: ${REGISTRY}.PropertySpecification } = {`); + this.code.open(`public static readonly resourceProperties: { [name: string]: ${REGISTRY}.PropertySpecification } = {`); for (const pname of Object.keys(spec.Properties).sort()) { const prop = spec.Properties[pname]; this.code.line(`${pname}: { isRequired: ${JSON.stringify(prop.Required)}, updateType: ${JSON.stringify(prop.UpdateType)} },`); diff --git a/tools/cfn2ts/lib/index.ts b/tools/cfn2ts/lib/index.ts index b5b8fa65b7591..aa27c1549254d 100644 --- a/tools/cfn2ts/lib/index.ts +++ b/tools/cfn2ts/lib/index.ts @@ -22,7 +22,7 @@ export default async function(specFiles: string[], enrichmentsDir?: string) { await fs.mkdirp(jsonPath); await fs.copy(templateDir, outPath, { recursive: true }); const indexFile = fs.createWriteStream(indexPath); - indexFile.write('export { PropertySpecification, ResourceClass, resourceImplementationFor } from \'./registry\';\n\n'); + indexFile.write('export * from \'./registry\';\n\n'); for (const mod of Object.keys(specByModule).sort()) { const spec = specByModule[mod]; diff --git a/tools/cfn2ts/module-template/lib/registry.ts b/tools/cfn2ts/module-template/lib/registry.ts index 18cb16689ad09..f9f28a40c6df2 100644 --- a/tools/cfn2ts/module-template/lib/registry.ts +++ b/tools/cfn2ts/module-template/lib/registry.ts @@ -4,8 +4,8 @@ export interface PropertySpecification { } export interface ResourceClass { - readonly RESOURCE_PROPERTIES: { [name: string]: PropertySpecification | undefined }; - readonly RESOURCE_TYPE_NAME: string; + readonly resourceProperties: { [name: string]: PropertySpecification | undefined }; + readonly resourceTypeName: string; } const catalog: { [resourceType: string]: ResourceClass } = {}; @@ -17,7 +17,7 @@ const catalog: { [resourceType: string]: ResourceClass } = {}; * @param resourceClass the corresponding Resource implementation. */ export function registerResourceType(resourceClass: ResourceClass) { - const typeName = resourceClass.RESOURCE_TYPE_NAME; + const typeName = resourceClass.resourceTypeName; if (catalog.hasOwnProperty(typeName)) { throw new Error(`Attempted to re-define CloudFormation resource ${typeName}`); } diff --git a/vendor/jsii-0.4.0-pre+6248947.zip b/vendor/jsii-0.4.0-pre+6248947.zip new file mode 100644 index 0000000000000..923fb07f4db5f Binary files /dev/null and b/vendor/jsii-0.4.0-pre+6248947.zip differ