lambda-live-debugger 1.2.1 → 1.2.2

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.
@@ -118,9 +118,11 @@ export class SamFramework {
118
118
  }
119
119
  if (!codePath) {
120
120
  const fileWithExtension = handlerParts[0];
121
+ const possibleCodePathsTs = `${fileWithExtension}.ts`;
122
+ const possibleCodePathsJs = `${fileWithExtension}.js`;
121
123
  const possibleCodePaths = [
122
- `${fileWithExtension}.ts`,
123
- `${fileWithExtension}.js`,
124
+ possibleCodePathsTs,
125
+ possibleCodePathsJs,
124
126
  `${fileWithExtension}.cjs`,
125
127
  `${fileWithExtension}.mjs`,
126
128
  ];
@@ -134,9 +136,10 @@ export class SamFramework {
134
136
  // ignore, file not found
135
137
  }
136
138
  }
137
- }
138
- if (!codePath) {
139
- throw new Error(`Code path not found for function: ${func.Name}`);
139
+ if (!codePath) {
140
+ codePath = possibleCodePathsJs;
141
+ Logger.warn(`[Function ${functionName}] Can not find code path for handler: ${handlerFull}. Using fallback: ${codePath}`);
142
+ }
140
143
  }
141
144
  const packageJsonPath = await findPackageJson(codePath);
142
145
  Logger.verbose(`[SAM] package.json path: ${packageJsonPath}`);
@@ -79,5 +79,6 @@ async function run() {
79
79
  FileWatcher.watchForFileChanges(rootFolderForWarchingChanges);
80
80
  await LambdaConnection.connect();
81
81
  Logger.log('Debugger started!');
82
+ Logger.info(`When you want to stop debugging and return to normal execution, type command 'lld -r' to remove LLD Layer from the functions.`);
82
83
  }
83
84
  run().catch(Logger.error);
package/dist/logger.d.ts CHANGED
@@ -18,6 +18,11 @@ declare function error(...args: any[]): void;
18
18
  * @param args The arguments to log
19
19
  */
20
20
  declare function warn(...args: any[]): void;
21
+ /**
22
+ * Log an info message in green
23
+ * @param args The arguments to log
24
+ */
25
+ declare function info(...args: any[]): void;
21
26
  /**
22
27
  * Log a verbose message if verbose is enabled. Log the message in grey.
23
28
  * @param args The arguments to log
@@ -38,6 +43,7 @@ export declare const Logger: {
38
43
  error: typeof error;
39
44
  warn: typeof warn;
40
45
  important: typeof important;
46
+ info: typeof info;
41
47
  verbose: typeof verbose;
42
48
  setVerbose: typeof setVerbose;
43
49
  isVerbose: typeof isVerbose;
package/dist/logger.mjs CHANGED
@@ -38,6 +38,14 @@ function warn(...args) {
38
38
  args = args.map((arg) => (typeof arg === 'string' ? chalk.yellow(arg) : arg));
39
39
  console.warn(...args);
40
40
  }
41
+ /**
42
+ * Log an info message in green
43
+ * @param args The arguments to log
44
+ */
45
+ function info(...args) {
46
+ args = args.map((arg) => typeof arg === 'string' ? chalk.greenBright(arg) : arg);
47
+ console.info(...args);
48
+ }
41
49
  /**
42
50
  * Log a verbose message if verbose is enabled. Log the message in grey.
43
51
  * @param args The arguments to log
@@ -67,6 +75,7 @@ export const Logger = {
67
75
  error,
68
76
  warn,
69
77
  important,
78
+ info,
70
79
  verbose,
71
80
  setVerbose,
72
81
  isVerbose,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambda-live-debugger",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "type": "module",
5
5
  "description": "Debug Lambda functions locally like it is running in the cloud",
6
6
  "repository": {