From d7b0324e761d4501c8b89cfb57e30f4d4a340039 Mon Sep 17 00:00:00 2001 From: Romain Marcadier-Muller Date: Thu, 23 May 2019 08:56:42 +0200 Subject: [PATCH] chore(build): Enable incremental builds everywhere (#2603) Enables composite mode in all `tsconfig.json` files that are not generated by `jsii`, enabling incremental build support throughout the project surface. --- packages/cdk-dasm/package.json | 4 ++-- packages/cdk-dasm/tsconfig.json | 3 ++- packages/decdk/package.json | 6 +++--- packages/decdk/tsconfig.json | 7 ++++++- tools/awslint/package.json | 4 ++-- tools/awslint/tsconfig.json | 5 +++-- tools/cdk-build-tools/package.json | 4 ++-- tools/cdk-build-tools/tsconfig.json | 6 ++++-- tools/pkglint/package.json | 6 +++--- tools/pkglint/tsconfig.json | 6 ++++-- 10 files changed, 31 insertions(+), 20 deletions(-) diff --git a/packages/cdk-dasm/package.json b/packages/cdk-dasm/package.json index f0dde352fd99f..a1ce899ef0075 100644 --- a/packages/cdk-dasm/package.json +++ b/packages/cdk-dasm/package.json @@ -12,8 +12,8 @@ "cdk-dasm": "bin/cdk-dasm" }, "scripts": { - "build": "tsc && chmod +x bin/cdk-dasm", - "watch": "tsc -w", + "build": "tsc -b && chmod +x bin/cdk-dasm", + "watch": "tsc -b -w", "test": "jest", "package": "mkdir -p dist/js && cd dist/js && npm pack ../../", "build+test+package": "npm run build+test && npm run package", diff --git a/packages/cdk-dasm/tsconfig.json b/packages/cdk-dasm/tsconfig.json index 8319ad9617cd6..8575f3f69b66e 100644 --- a/packages/cdk-dasm/tsconfig.json +++ b/packages/cdk-dasm/tsconfig.json @@ -15,7 +15,8 @@ "noFallthroughCasesInSwitch": true, "inlineSourceMap": true, "inlineSources": true, - "noEmitOnError": false + "noEmitOnError": false, + "composite": true }, "exclude": [ "test/enrichments/**" diff --git a/packages/decdk/package.json b/packages/decdk/package.json index 4135acd58c202..5925efa2f032c 100644 --- a/packages/decdk/package.json +++ b/packages/decdk/package.json @@ -13,8 +13,8 @@ "decdk-schema": "bin/decdk-schema" }, "scripts": { - "build": "node ./deps.js && tsc && chmod +x bin/decdk && chmod +x bin/decdk-schema && bin/decdk-schema > cdk.schema.json", - "watch": "tsc -w", + "build": "node ./deps.js && tsc -b && chmod +x bin/decdk && chmod +x bin/decdk-schema && bin/decdk-schema > cdk.schema.json", + "watch": "tsc -b -w", "test": "jest", "package": "mkdir -p dist/js && cd dist/js && npm pack ../../", "build+test": "npm run build && npm test", @@ -151,4 +151,4 @@ "engines": { "node": ">= 8.10.0" } -} +} \ No newline at end of file diff --git a/packages/decdk/tsconfig.json b/packages/decdk/tsconfig.json index 8319ad9617cd6..74e957ca65061 100644 --- a/packages/decdk/tsconfig.json +++ b/packages/decdk/tsconfig.json @@ -15,9 +15,14 @@ "noFallthroughCasesInSwitch": true, "inlineSourceMap": true, "inlineSources": true, - "noEmitOnError": false + "noEmitOnError": false, + "composite": true }, "exclude": [ "test/enrichments/**" + ], + "references": [ + { "path": "../@aws-cdk/cdk" }, + { "path": "../@aws-cdk/cx-api" } ] } diff --git a/tools/awslint/package.json b/tools/awslint/package.json index 9ccd16f50a2d9..c727c94d33d72 100644 --- a/tools/awslint/package.json +++ b/tools/awslint/package.json @@ -5,10 +5,10 @@ "description": "Enforces the AWS Construct Library guidelines", "main": "index.js", "scripts": { - "build": "tsc && chmod +x bin/awslint", + "build": "tsc -b && chmod +x bin/awslint", "lint": "tslint && pkglint", "test": "echo ok", - "watch": "tsc -w", + "watch": "tsc -b -w", "build+test+package": "npm run build+test", "build+test": "npm run build && npm test" }, diff --git a/tools/awslint/tsconfig.json b/tools/awslint/tsconfig.json index 2455ee3509efe..b7272dae85951 100644 --- a/tools/awslint/tsconfig.json +++ b/tools/awslint/tsconfig.json @@ -22,7 +22,8 @@ "resolveJsonModule": true, "strict": true, "strictNullChecks": true, - "target": "ES2018" + "target": "ES2018", + "composite": true }, - "_generated_by_jsii_": "Generated by jsii - safe to delete, and ideally should be in .gitignore" + "include": ["**/*.ts"] } diff --git a/tools/cdk-build-tools/package.json b/tools/cdk-build-tools/package.json index 2efabe7af67e8..1961febbf4823 100644 --- a/tools/cdk-build-tools/package.json +++ b/tools/cdk-build-tools/package.json @@ -17,8 +17,8 @@ "cdk-awslint": "bin/cdk-awslint" }, "scripts": { - "build": "tsc && tslint -p . && chmod +x bin/cdk-build && chmod +x bin/cdk-test && chmod +x bin/cdk-watch && chmod +x bin/cdk-awslint && pkglint", - "watch": "tsc -w", + "build": "tsc -b && tslint -p . && chmod +x bin/cdk-build && chmod +x bin/cdk-test && chmod +x bin/cdk-watch && chmod +x bin/cdk-awslint && pkglint", + "watch": "tsc -b -w", "pkglint": "pkglint -f", "build+test+package": "npm run build+test", "build+test": "npm run build" diff --git a/tools/cdk-build-tools/tsconfig.json b/tools/cdk-build-tools/tsconfig.json index 033022226ac67..e4a4838f5d749 100644 --- a/tools/cdk-build-tools/tsconfig.json +++ b/tools/cdk-build-tools/tsconfig.json @@ -13,6 +13,8 @@ "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "inlineSourceMap": true, - "inlineSources": true - } + "inlineSources": true, + "composite": true + }, + "include": ["**/*.ts"] } diff --git a/tools/pkglint/package.json b/tools/pkglint/package.json index f5ad7aff2eb61..5f2b503dd3812 100644 --- a/tools/pkglint/package.json +++ b/tools/pkglint/package.json @@ -16,11 +16,11 @@ "pkglint": "bin/pkglint" }, "scripts": { - "build": "tsc && tslint -p . && chmod +x bin/pkglint", + "build": "tsc -b && tslint -p . && chmod +x bin/pkglint", "build+test": "npm run build", "build+test+package": "npm run build", - "watch": "tsc -w", - "lint": "tsc && tslint -p . --force" + "watch": "tsc -b -w", + "lint": "tsc -b && tslint -p . --force" }, "keywords": [ "aws", diff --git a/tools/pkglint/tsconfig.json b/tools/pkglint/tsconfig.json index 033022226ac67..e4a4838f5d749 100644 --- a/tools/pkglint/tsconfig.json +++ b/tools/pkglint/tsconfig.json @@ -13,6 +13,8 @@ "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "inlineSourceMap": true, - "inlineSources": true - } + "inlineSources": true, + "composite": true + }, + "include": ["**/*.ts"] }