lambda-live-debugger 0.0.104 → 0.0.106
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.
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ You probably need to tweak some settings. You can do it via CLI parameters or, b
|
|
|
90
90
|
lld -w
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
The configuration is saved to `lldebugger.config.ts
|
|
93
|
+
The configuration is saved to `lldebugger.config.ts`.
|
|
94
94
|
|
|
95
95
|
### CLI Parameters
|
|
96
96
|
|
|
@@ -114,6 +114,35 @@ The configuration is saved to `lldebugger.config.ts`
|
|
|
114
114
|
-h, --help display help for command
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
+
## Configuration file lldebugger.config.ts
|
|
118
|
+
|
|
119
|
+
Example lldebugger.config.ts:
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
import { type LldConfigTs } from "lambda-live-debugger";
|
|
123
|
+
|
|
124
|
+
export default {
|
|
125
|
+
framework: "cdk",
|
|
126
|
+
context: ["environment=development"],
|
|
127
|
+
region: "eu-central-1",
|
|
128
|
+
observable: false,
|
|
129
|
+
verbose: false,
|
|
130
|
+
//getLambdas: async (foundLambdas) => {
|
|
131
|
+
// you can customize the list of lambdas here or create your own
|
|
132
|
+
// return foundLambdas;
|
|
133
|
+
//},
|
|
134
|
+
} satisfies LldConfigTs;
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The setting are the same as for CLI parameters.
|
|
138
|
+
|
|
139
|
+
### Custom framework implementation and adjustment
|
|
140
|
+
|
|
141
|
+
getLambdas: async (foundLambdas) => {
|
|
142
|
+
//you can customize the list of lambdas here or create your own
|
|
143
|
+
//return foundLambdas;
|
|
144
|
+
},
|
|
145
|
+
|
|
117
146
|
### Debugging
|
|
118
147
|
|
|
119
148
|
You might want to configure your development tool for debugging. The wizard automatically configures for VsCode in `.vscode/launch.json`. Here is an example:
|
|
@@ -142,13 +171,6 @@ For other tools, please send documentation to include here. WebStorm instruction
|
|
|
142
171
|
|
|
143
172
|
Set the `subfolder` parameter if your framework is in a subfolder.
|
|
144
173
|
|
|
145
|
-
## Custom Configuration
|
|
146
|
-
|
|
147
|
-
getLambdas: async (foundLambdas) => {
|
|
148
|
-
//you can customize the list of lambdas here or create your own
|
|
149
|
-
//return foundLambdas;
|
|
150
|
-
},
|
|
151
|
-
|
|
152
174
|
## Removing
|
|
153
175
|
|
|
154
176
|
To remove Lambda Live Debugger from your AWS account
|
|
Binary file
|
|
@@ -10,8 +10,8 @@ import { Logger } from "../logger.mjs";
|
|
|
10
10
|
* Support for AWS SAM framework
|
|
11
11
|
*/
|
|
12
12
|
export class SamFramework {
|
|
13
|
-
samConfigFile =
|
|
14
|
-
samTemplateFile =
|
|
13
|
+
samConfigFile = "samconfig.toml";
|
|
14
|
+
samTemplateFile = "template.yaml";
|
|
15
15
|
/**
|
|
16
16
|
* Framework name
|
|
17
17
|
*/
|
|
@@ -24,17 +24,17 @@ export class SamFramework {
|
|
|
24
24
|
*/
|
|
25
25
|
async canHandle() {
|
|
26
26
|
try {
|
|
27
|
-
await fs.access(this.samConfigFile, constants.F_OK);
|
|
27
|
+
await fs.access(path.resolve(this.samConfigFile), constants.F_OK);
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
30
|
-
Logger.verbose(`[SAM] This is not a SAM framework project. ${this.samConfigFile} not found.`);
|
|
30
|
+
Logger.verbose(`[SAM] This is not a SAM framework project. ${path.resolve(this.samConfigFile)} not found.`);
|
|
31
31
|
return false;
|
|
32
32
|
}
|
|
33
33
|
try {
|
|
34
|
-
await fs.access(this.samTemplateFile, constants.F_OK);
|
|
34
|
+
await fs.access(path.resolve(this.samTemplateFile), constants.F_OK);
|
|
35
35
|
}
|
|
36
36
|
catch (error) {
|
|
37
|
-
Logger.verbose(`[SAM] This is not a SAM framework project. ${this.samTemplateFile} not found.`);
|
|
37
|
+
Logger.verbose(`[SAM] This is not a SAM framework project. ${path.resolve(this.samTemplateFile)} not found.`);
|
|
38
38
|
return false;
|
|
39
39
|
}
|
|
40
40
|
return true;
|
|
@@ -51,13 +51,13 @@ export class SamFramework {
|
|
|
51
51
|
role: config.role,
|
|
52
52
|
};
|
|
53
53
|
const environment = config.configEnv ?? "default";
|
|
54
|
-
const samConfigContent = await fs.readFile(this.samConfigFile, "utf-8");
|
|
54
|
+
const samConfigContent = await fs.readFile(path.resolve(this.samConfigFile), "utf-8");
|
|
55
55
|
const samConfig = toml.parse(samConfigContent);
|
|
56
56
|
const stackName = samConfig[environment]?.global?.parameters?.stack_name;
|
|
57
57
|
if (!stackName) {
|
|
58
|
-
throw new Error(`Stack name not found in ${this.samConfigFile}`);
|
|
58
|
+
throw new Error(`Stack name not found in ${path.resolve(this.samConfigFile)}`);
|
|
59
59
|
}
|
|
60
|
-
const samTemplateContent = await fs.readFile(this.samTemplateFile, "utf-8");
|
|
60
|
+
const samTemplateContent = await fs.readFile(path.resolve(this.samTemplateFile), "utf-8");
|
|
61
61
|
const template = yaml.parse(samTemplateContent);
|
|
62
62
|
const lambdas = [];
|
|
63
63
|
// get all resources of type AWS::Serverless::Function
|
|
@@ -24,7 +24,11 @@ export class TerraformFramework {
|
|
|
24
24
|
async canHandle() {
|
|
25
25
|
// is there any filey with *.tf extension
|
|
26
26
|
const files = await fs.readdir(process.cwd());
|
|
27
|
-
|
|
27
|
+
const r = files.some((f) => f.endsWith(".tf"));
|
|
28
|
+
if (!r) {
|
|
29
|
+
Logger.verbose(`[Terraform] This is not a Terraform project. There are no *.tf files in ${path.resolve(".")} folder.`);
|
|
30
|
+
}
|
|
31
|
+
return r;
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* Get Lambda functions
|