Skip to content

Commit

Permalink
fix(cdk init): fix 'lib' init template
Browse files Browse the repository at this point in the history
The init template used 'QueueArn' but that no long exists.

Add integ test.

Fixes #1214.
  • Loading branch information
rix0rrr committed Nov 20, 2018
1 parent 001e724 commit cab8258
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 42 deletions.
7 changes: 7 additions & 0 deletions packages/aws-cdk/integ-tests/test-init-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,12 @@ cdk init sample-app -l typescript
npm run build
cdk synth

rm -rf /tmp/cdk-integ-test
mkdir -p /tmp/cdk-integ-test
cd /tmp/cdk-integ-test

cdk init lib -l typescript
npm run build

echo "✅ success"

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface %name.PascalCased%Props {

export class %name.PascalCased% extends cdk.Construct {
/** @returns the ARN of the SQS queue */
public readonly queueArn: sqs.QueueArn;
public readonly queueArn: string;

constructor(parent: cdk.Construct, name: string, props: %name.PascalCased%Props = {}) {
super(parent, name);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"name": "%name%",
"version": "0.1.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"prepare": "tsc",
"watch": "tsc -w",
"test": "nodeunit test/test.*.js"
},
"devDependencies": {
"@types/nodeunit": "^0.0.30",
"nodeunit": "^0.11.2",
"typescript": "^3.1.2"
},
"peerDependencies": {
"@aws-cdk/cdk": "^%cdk-version%"
},
"dependencies": {
"@aws-cdk/aws-sns": "^%cdk-version%",
"@aws-cdk/aws-sqs": "^%cdk-version%",
"@aws-cdk/cdk": "^%cdk-version%"
}
"name": "%name%",
"version": "0.1.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"test": "nodeunit test/test.*.js"
},
"devDependencies": {
"@types/nodeunit": "^0.0.30",
"nodeunit": "^0.11.2",
"typescript": "^3.1.2"
},
"peerDependencies": {
"@aws-cdk/cdk": "^%cdk-version%"
},
"dependencies": {
"@aws-cdk/aws-sns": "^%cdk-version%",
"@aws-cdk/aws-sqs": "^%cdk-version%",
"@aws-cdk/cdk": "^%cdk-version%"
}
}
38 changes: 19 additions & 19 deletions packages/aws-cdk/lib/init-templates/lib/typescript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"compilerOptions": {
"target":"ES2018",
"module": "commonjs",
"lib": ["es2016", "es2017.object", "es2017.string"],
"declaration": true,
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": false,
"inlineSourceMap": true,
"inlineSources": true,
"experimentalDecorators": true,
"strictPropertyInitialization":false
}
"compilerOptions": {
"target":"ES2018",
"module": "commonjs",
"lib": ["es2016", "es2017.object", "es2017.string"],
"declaration": true,
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": false,
"inlineSourceMap": true,
"inlineSources": true,
"experimentalDecorators": true,
"strictPropertyInitialization":false
}
}

0 comments on commit cab8258

Please sign in to comment.