From c2f301c3aa9d5a278864d2e494245513c7020b9e Mon Sep 17 00:00:00 2001 From: Mitch Lloyd Date: Sat, 11 May 2019 14:45:45 -0700 Subject: [PATCH 1/2] Use ts-node for TypeScript template Closes #1532 --- .../aws-cdk/lib/init-templates/app/typescript/cdk.template.json | 2 +- .../lib/init-templates/app/typescript/package.template.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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": { From 7c2adb989d421eee9a23049f2d18cd3c072e10f5 Mon Sep 17 00:00:00 2001 From: Mitch Lloyd Date: Mon, 13 May 2019 20:00:03 -0700 Subject: [PATCH 2/2] Update sample-app with ts-node --- .../lib/init-templates/sample-app/typescript/cdk.template.json | 2 +- .../init-templates/sample-app/typescript/package.template.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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": {