Skip to content

Commit 41287f6

Browse files
fix: cdk paths when using __dirname
1 parent e1d78af commit 41287f6

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

src/frameworks/cdkFramework.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ export class CdkFramework implements IFramework {
324324
workerData: {
325325
verbose: Configuration.config.verbose,
326326
awsCdkLibPath,
327+
projectDirname: getProjectDirname(),
328+
moduleDirname: getModuleDirname(),
327329
},
328330
},
329331
);

src/frameworks/cdkFrameworkWorker.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1+
// @ts-nocheck
12
import { createRequire as topLevelCreateRequire } from "module";
23
const require = topLevelCreateRequire(import.meta.url);
34
import path from "path";
4-
import { fileURLToPath } from "node:url";
5-
const __filename = fileURLToPath(import.meta.url);
6-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7-
const __dirname = path.dirname(__filename);
85

96
import { workerData, parentPort } from "node:worker_threads";
107
import fs from "fs/promises";
118

129
import { Logger } from "../logger.mjs";
1310

1411
Logger.setVerbose(workerData.verbose);
12+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
13+
const __dirname = path.resolve(path.join(workerData.projectDirname, "/x/x"));
14+
1515
Logger.verbose(`[CDK] [Worker] Started`);
1616

1717
parentPort.on("message", async (data) => {

src/lldebugger.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { LambdaConnection } from "./lambdaConnection.js";
2323
async function run() {
2424
const version = await getVersion();
2525

26-
Logger.log(`Welcome to Lambda Live Debugger version ${version}.`);
26+
Logger.log(`Welcome to Lambda Live Debugger 🐞 version ${version}.`);
2727
Logger.log(
2828
"To keep the project moving forward, please fill out the feedback form at https://forms.gle/v6ekZtuB45Rv3EyW9. Your input is greatly appreciated!",
2929
);
@@ -53,12 +53,11 @@ async function run() {
5353
}
5454

5555
Logger.log(
56-
`Starting the debugger
57-
${
58-
Configuration.config.observable
59-
? "in observable mode"
60-
: `(ID ${Configuration.config.debuggerId})`
61-
}
56+
`Starting the debugger ${
57+
Configuration.config.observable
58+
? "in observable mode"
59+
: `(ID ${Configuration.config.debuggerId})`
60+
}
6261
...`,
6362
);
6463

test/sam-basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
"dependencies": {
1616
"@aws-sdk/client-sts": "^3.577.0"
1717
}
18-
}
18+
}

0 commit comments

Comments
 (0)