lambda-live-debugger 0.0.103 → 0.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -22,7 +22,7 @@ parentPort.on("message", async (data) => {
|
|
|
22
22
|
// execute code to get the data into global.lambdas
|
|
23
23
|
const codeFile = await fs.readFile(data.compileOutput, "utf8");
|
|
24
24
|
|
|
25
|
-
fixCdkPaths();
|
|
25
|
+
await fixCdkPaths(workerData.awsCdkLibPath);
|
|
26
26
|
|
|
27
27
|
eval(codeFile);
|
|
28
28
|
|
|
@@ -54,12 +54,11 @@ parentPort.on("message", async (data) => {
|
|
|
54
54
|
/**
|
|
55
55
|
* Some paths are not resolved correctly in the CDK code, so we need to fix them
|
|
56
56
|
*/
|
|
57
|
-
function fixCdkPaths() {
|
|
58
|
-
//
|
|
57
|
+
async function fixCdkPaths(awsCdkLibPath) {
|
|
58
|
+
// leave this lines for manual debugging
|
|
59
|
+
//const awsCdkLibPath = path.resolve("node_modules/aws-cdk-lib");
|
|
60
|
+
//const path = require("path");
|
|
59
61
|
|
|
60
|
-
// Get the path to the aws-cdk-lib module
|
|
61
|
-
let awsCdkLibPath = require.resolve("aws-cdk-lib");
|
|
62
|
-
awsCdkLibPath = awsCdkLibPath.replace("/index.js", "");
|
|
63
62
|
Logger.verbose(`[CDK] [Worker] aws-cdk-lib PATH ${awsCdkLibPath}`);
|
|
64
63
|
|
|
65
64
|
const pathsFix = {
|
|
@@ -33,6 +33,12 @@ async function checkModuleInPackageJson(dir, moduleName) {
|
|
|
33
33
|
const devDependencies = packageJson.devDependencies || {};
|
|
34
34
|
if (dependencies[moduleName] || devDependencies[moduleName]) {
|
|
35
35
|
const modulePath = path.join(dir, "node_modules", moduleName);
|
|
36
|
+
try {
|
|
37
|
+
await fs.access(modulePath);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
36
42
|
return modulePath;
|
|
37
43
|
}
|
|
38
44
|
return undefined;
|