lambda-live-debugger 1.0.6 → 1.1.0

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.
@@ -107,6 +107,11 @@ export class CdkFramework {
107
107
  define: lambdaInCdk.bundling?.define,
108
108
  external: external.length > 0 ? external : undefined,
109
109
  },
110
+ metadata: {
111
+ framework: 'cdk',
112
+ stackName: lambdaInCdk.stackName,
113
+ cdkPath: lambdaInCdk.cdkPath,
114
+ },
110
115
  });
111
116
  }
112
117
  }
@@ -390,7 +395,7 @@ export class CdkFramework {
390
395
  const contextFromLldConfig = config.context?.reduce((acc, arg) => {
391
396
  const [key, value] = arg.split('=');
392
397
  if (key && value) {
393
- acc[key] = value;
398
+ acc[key.trim()] = value.trim();
394
399
  }
395
400
  return acc;
396
401
  }, {});
@@ -11,7 +11,7 @@ parentPort.on('message', async (data) => {
11
11
  // this is global variable to store the data from the CDK code once it is executed
12
12
  global.lambdas = [];
13
13
 
14
- Logger.verbose(`[Worker ${workerData.workerId}] Received message`, data);
14
+ Logger.verbose(`[Worker] Received message`, data);
15
15
 
16
16
  // execute code to get the data into global.lambdas
17
17
  await import(data.compileOutput);
@@ -146,6 +146,10 @@ export class SamFramework {
146
146
  handler,
147
147
  packageJsonPath,
148
148
  esBuildOptions,
149
+ metadata: {
150
+ framework: 'sam',
151
+ stackName,
152
+ },
149
153
  };
150
154
  lambdasDiscovered.push(lambdaResource);
151
155
  }
@@ -157,6 +157,9 @@ export class SlsFramework {
157
157
  handler,
158
158
  packageJsonPath,
159
159
  esBuildOptions,
160
+ metadata: {
161
+ framework: 'sls',
162
+ },
160
163
  };
161
164
  lambdasDiscovered.push(lambdaResource);
162
165
  }
@@ -99,6 +99,9 @@ export class TerraformFramework {
99
99
  handler,
100
100
  packageJsonPath,
101
101
  esBuildOptions: undefined,
102
+ metadata: {
103
+ framework: 'terraform',
104
+ },
102
105
  };
103
106
  lambdasDiscovered.push(lambdaResource);
104
107
  }
@@ -112,7 +112,7 @@ async function onMessageFromLambda(message) {
112
112
  await ioTServiceConnection.publish(payload, `${topic}/${message.data.workerId}`);
113
113
  }
114
114
  else {
115
- // if we are in observable mode, mark the worker as processed
115
+ // if we are in Observability mode, mark the worker as processed
116
116
  lambdasProcessingObservableMode.delete(message.data.functionId);
117
117
  }
118
118
  }
@@ -22,7 +22,6 @@ import { LambdaConnection } from './lambdaConnection.mjs';
22
22
  async function run() {
23
23
  const version = await getVersion();
24
24
  Logger.log(`Welcome to Lambda Live Debugger 🐞 version ${version}.`);
25
- Logger.important('To keep the project moving forward, please fill out the feedback form at https://forms.gle/v6ekZtuB45Rv3EyW9. Your input is greatly appreciated!');
26
25
  await Configuration.readConfig();
27
26
  Logger.setVerbose(Configuration.config.verbose === true);
28
27
  Logger.verbose(`Parameters: \n${Object.entries(Configuration.config)
@@ -40,7 +39,7 @@ async function run() {
40
39
  return;
41
40
  }
42
41
  let message = `Starting the debugger ${Configuration.config.observable
43
- ? 'in observable mode'
42
+ ? 'in Observability mode'
44
43
  : `(ID ${Configuration.config.debuggerId})`}...`;
45
44
  if (Configuration.config.remove) {
46
45
  message = `Removing Lambda Live Debugger${Configuration.config.remove === 'all' ? ' including layer' : ''}...`;
package/dist/logger.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  import chalk from 'chalk';
2
- const orange = '#D24E01';
3
2
  let verboseEnabled = false;
4
3
  /**
5
4
  * Log a message
@@ -20,7 +19,7 @@ function log(...args) {
20
19
  * @param args The arguments to log
21
20
  */
22
21
  function important(...args) {
23
- args = args.map((arg) => typeof arg === 'string' ? chalk.hex(orange)(arg) : arg);
22
+ args = args.map((arg) => (typeof arg === 'string' ? chalk.yellow(arg) : arg));
24
23
  console.log(...args);
25
24
  }
26
25
  /**
@@ -36,7 +35,7 @@ function error(...args) {
36
35
  * @param args The arguments to log
37
36
  */
38
37
  function warn(...args) {
39
- args = args.map((arg) => typeof arg === 'string' ? chalk.hex(orange)(arg) : arg);
38
+ args = args.map((arg) => (typeof arg === 'string' ? chalk.yellow(arg) : arg));
40
39
  console.warn(...args);
41
40
  }
42
41
  /**
@@ -15,6 +15,11 @@ declare function getLambdas(config: LldConfig): Promise<{
15
15
  forceBundle?: boolean | undefined;
16
16
  bundlingType?: import("./types/resourcesDiscovery.js").BundlingType | undefined;
17
17
  esBuildOptions?: import("./types/resourcesDiscovery.js").EsBuildOptions | undefined;
18
+ metadata: {
19
+ framework: string;
20
+ stackName?: string | undefined;
21
+ cdkPath?: string | undefined;
22
+ };
18
23
  }[] | undefined>;
19
24
  export declare const ResourceDiscovery: {
20
25
  getSupportedFrameworksNames: typeof getSupportedFrameworksNames;
@@ -10,6 +10,20 @@ export type LambdaResource = {
10
10
  forceBundle?: boolean;
11
11
  bundlingType?: BundlingType;
12
12
  esBuildOptions?: EsBuildOptions;
13
+ metadata: {
14
+ /**
15
+ * Framework name
16
+ */
17
+ framework: string;
18
+ /**
19
+ * If framework is CDK or SAM, this is the stack name
20
+ */
21
+ stackName?: string;
22
+ /**
23
+ * If framework is CDK, this is the construct path
24
+ */
25
+ cdkPath?: string;
26
+ };
13
27
  };
14
28
  export declare enum BundlingType {
15
29
  ESBUILD = "ESBUILD",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambda-live-debugger",
3
- "version": "1.0.6",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "description": "Debug Lambda functions locally like it is running in the cloud",
6
6
  "repository": {