From 80a10f052f12f261f12c11fb1080a7a05d64ec72 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Wed, 11 Dec 2024 15:49:34 +0100 Subject: [PATCH] chore: remove dependency on in-source compilation of `bin/` directory The `bin/cdk` binary relies on the fact that `bin/cdk.ts` undergoes an in-source compilation, producing `bin/cdk.js` which is then required. This fails in a different setup where we only compile the `lib/` directory and nothing else. So skip one level of indirection: just put the code that loads the actual CLI entry point directly in the bash wrapper. --- packages/aws-cdk/bin/cdk | 4 ++-- packages/aws-cdk/bin/cdk.ts | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 packages/aws-cdk/bin/cdk.ts diff --git a/packages/aws-cdk/bin/cdk b/packages/aws-cdk/bin/cdk index 067aa3422918e..7765cc578987a 100755 --- a/packages/aws-cdk/bin/cdk +++ b/packages/aws-cdk/bin/cdk @@ -1,6 +1,6 @@ #!/usr/bin/env node - // source maps must be enabled before importing files process.setSourceMapsEnabled(true); +const { cli } = require("../lib/cli"); -require('./cdk.js'); +cli(); diff --git a/packages/aws-cdk/bin/cdk.ts b/packages/aws-cdk/bin/cdk.ts deleted file mode 100644 index 4f2652b107236..0000000000000 --- a/packages/aws-cdk/bin/cdk.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { cli } from '../lib'; - -cli();