lambda-live-debugger 0.0.109 → 0.0.111

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
@@ -224,6 +224,8 @@ export class CdkFramework {
224
224
  workerData: {
225
225
  verbose: Configuration.config.verbose,
226
226
  awsCdkLibPath,
227
+ projectDirname: getProjectDirname(),
228
+ moduleDirname: getModuleDirname(),
227
229
  },
228
230
  });
229
231
  worker.on("message", async (message) => {
@@ -1,10 +1,7 @@
1
+ // @ts-nocheck
1
2
  import { createRequire as topLevelCreateRequire } from "module";
2
3
  const require = topLevelCreateRequire(import.meta.url);
3
4
  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);
8
5
 
9
6
  import { workerData, parentPort } from "node:worker_threads";
10
7
  import fs from "fs/promises";
@@ -12,6 +9,9 @@ import fs from "fs/promises";
12
9
  import { Logger } from "../logger.mjs";
13
10
 
14
11
  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
+
15
15
  Logger.verbose(`[CDK] [Worker] Started`);
16
16
 
17
17
  parentPort.on("message", async (data) => {
@@ -21,7 +21,7 @@ import { LambdaConnection } from "./lambdaConnection.mjs";
21
21
  */
22
22
  async function run() {
23
23
  const version = await getVersion();
24
- Logger.log(`Welcome to Lambda Live Debugger version ${version}.`);
24
+ Logger.log(`Welcome to Lambda Live Debugger 🐞 version ${version}.`);
25
25
  Logger.log("To keep the project moving forward, please fill out the feedback form at https://forms.gle/v6ekZtuB45Rv3EyW9. Your input is greatly appreciated!");
26
26
  await Configuration.readConfig();
27
27
  Logger.setVerbose(Configuration.config.verbose === true);
@@ -39,8 +39,7 @@ async function run() {
39
39
  if (!Configuration.config.start && !Configuration.config.remove) {
40
40
  return;
41
41
  }
42
- Logger.log(`Starting the debugger
43
- ${Configuration.config.observable
42
+ Logger.log(`Starting the debugger ${Configuration.config.observable
44
43
  ? "in observable mode"
45
44
  : `(ID ${Configuration.config.debuggerId})`}
46
45
  ...`);
@@ -27,19 +27,12 @@ export async function findNpmPath(dir, moduleName) {
27
27
  * @returns
28
28
  */
29
29
  async function checkModuleInPackageJson(dir, moduleName) {
30
- const packageJsonPath = path.join(dir, "package.json");
31
- const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf8"));
32
- const dependencies = packageJson.dependencies || {};
33
- const devDependencies = packageJson.devDependencies || {};
34
- if (dependencies[moduleName] || devDependencies[moduleName]) {
35
- const modulePath = path.join(dir, "node_modules", moduleName);
36
- try {
37
- await fs.access(modulePath);
38
- }
39
- catch {
40
- return undefined;
41
- }
42
- return modulePath;
30
+ const modulePath = path.join(dir, "node_modules", moduleName);
31
+ try {
32
+ await fs.access(modulePath);
33
+ }
34
+ catch {
35
+ return undefined;
43
36
  }
44
- return undefined;
37
+ return modulePath;
45
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambda-live-debugger",
3
- "version": "0.0.109",
3
+ "version": "0.0.111",
4
4
  "type": "module",
5
5
  "description": "Debug Lambda functions locally like it is running in the cloud",
6
6
  "repository": {