From cb3d1559507cc454b2d9c270d0bb0d670ce57ba5 Mon Sep 17 00:00:00 2001 From: Ansgar Mertens Date: Wed, 3 Aug 2022 21:25:42 +0200 Subject: [PATCH 1/2] fix(cli): fix version detection for Java being a bit too optimistic about the package name Resolves #1994 --- packages/cdktf-cli/lib/debug.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/cdktf-cli/lib/debug.ts b/packages/cdktf-cli/lib/debug.ts index 71af8b1ad3..49da755c37 100644 --- a/packages/cdktf-cli/lib/debug.ts +++ b/packages/cdktf-cli/lib/debug.ts @@ -253,9 +253,12 @@ async function getJavaPackageVersion(packageName: string) { return undefined; } + // We need to search for the package name AND a colon to not match a line like + // [INFO] com.hashicorp:cdktf-provider-aws:jar:9.0.9:compile + // when looking for the cdktf package (see Github issue #1994) const versionLine = resolutionPart .split(/\r\n|\r|\n/) - .find((line) => line.includes(javaPackageName)); + .find((line) => line.includes(`${javaPackageName}:`)); if (!versionLine) { logger.debug( From 2213ca207d66519de5851ff306df7a6f32961235 Mon Sep 17 00:00:00 2001 From: Ansgar Mertens Date: Thu, 4 Aug 2022 12:51:41 +0200 Subject: [PATCH 2/2] fix(cli): Don't validate types within node_modules Related to https://github.com/yargs/yargs-parser/issues/452 which caused synth to fail. After this change TypeScript will only check types that are actually used in user code but not whether all types in dependencies are correct. We opted for this instead of pinning a version of yargs-parser without this bug because disabling this kind of checking will also help with future bugs that might occur and won't require an update of the TypeScript template. Thus this change also helps with #1991 --- packages/cdktf-cli/templates/typescript/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cdktf-cli/templates/typescript/tsconfig.json b/packages/cdktf-cli/templates/typescript/tsconfig.json index 785e09884b..3e53f1dbf7 100644 --- a/packages/cdktf-cli/templates/typescript/tsconfig.json +++ b/packages/cdktf-cli/templates/typescript/tsconfig.json @@ -23,7 +23,8 @@ "strictPropertyInitialization": true, "stripInternal": true, "target": "ES2018", - "incremental": true + "incremental": true, + "skipLibCheck": true }, "include": [ "**/*.ts"