From 4f7b48df861ca5638e2c73de0f88c05b2279fd37 Mon Sep 17 00:00:00 2001 From: Mitch Lloyd Date: Tue, 14 May 2019 00:26:32 -0700 Subject: [PATCH] feat(aws-cdk): use ts-node for TypeScript templates (#2527) Update sample-app with ts-node in a backwards compatible way (`npm run build` still compiles the code). Closes #1532 --- .../aws-cdk/lib/init-templates/app/typescript/cdk.template.json | 2 +- .../lib/init-templates/app/typescript/package.template.json | 1 + .../lib/init-templates/sample-app/typescript/cdk.template.json | 2 +- .../init-templates/sample-app/typescript/package.template.json | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk/lib/init-templates/app/typescript/cdk.template.json b/packages/aws-cdk/lib/init-templates/app/typescript/cdk.template.json index ca1d40ed37e2d..8c81ca271b7d6 100644 --- a/packages/aws-cdk/lib/init-templates/app/typescript/cdk.template.json +++ b/packages/aws-cdk/lib/init-templates/app/typescript/cdk.template.json @@ -1,3 +1,3 @@ { - "app": "node bin/%name%.js" + "app": "./node_modules/.bin/ts-node bin/%name%.ts" } diff --git a/packages/aws-cdk/lib/init-templates/app/typescript/package.template.json b/packages/aws-cdk/lib/init-templates/app/typescript/package.template.json index 14fe0f1362f82..5219b55bad307 100644 --- a/packages/aws-cdk/lib/init-templates/app/typescript/package.template.json +++ b/packages/aws-cdk/lib/init-templates/app/typescript/package.template.json @@ -12,6 +12,7 @@ "devDependencies": { "@types/node": "8.10.45", "typescript": "^3.3.3333", + "ts-node": "^8.1.0", "aws-cdk": "^%cdk-version%" }, "dependencies": { diff --git a/packages/aws-cdk/lib/init-templates/sample-app/typescript/cdk.template.json b/packages/aws-cdk/lib/init-templates/sample-app/typescript/cdk.template.json index ca1d40ed37e2d..8c81ca271b7d6 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/typescript/cdk.template.json +++ b/packages/aws-cdk/lib/init-templates/sample-app/typescript/cdk.template.json @@ -1,3 +1,3 @@ { - "app": "node bin/%name%.js" + "app": "./node_modules/.bin/ts-node bin/%name%.ts" } diff --git a/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.template.json b/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.template.json index c9a8e03200692..b2014a440b9f8 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.template.json +++ b/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.template.json @@ -12,6 +12,7 @@ "devDependencies": { "@types/node": "8.10.45", "typescript": "^3.3.3333", + "ts-node": "^8.1.0", "aws-cdk": "^%cdk-version%" }, "dependencies": {