Skip to content

Commit 6391234

Browse files
fix: fix linting and formatting
1 parent 818bcf2 commit 6391234

File tree

133 files changed

+666
-708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+666
-708
lines changed

.vscode/launch.json

Lines changed: 15 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
1010
"args": ["../../src/lldebugger.ts", "-c environment=test"],
1111
"request": "launch",
12-
"skipFiles": [
13-
"<node_internals>/**"
14-
],
12+
"skipFiles": ["<node_internals>/**"],
1513
"console": "integratedTerminal",
1614
"type": "node",
1715
"cwd": "${workspaceRoot}/test/cdk-basic"
@@ -21,9 +19,7 @@
2119
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
2220
"args": ["../../src/lldebugger.ts", "-c environment=test", "-o"],
2321
"request": "launch",
24-
"skipFiles": [
25-
"<node_internals>/**"
26-
],
22+
"skipFiles": ["<node_internals>/**"],
2723
"console": "integratedTerminal",
2824
"type": "node",
2925
"cwd": "${workspaceRoot}/test/cdk-basic"
@@ -33,9 +29,7 @@
3329
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
3430
"args": ["../../src/lldebugger.ts", "--stage=test"],
3531
"request": "launch",
36-
"skipFiles": [
37-
"<node_internals>/**"
38-
],
32+
"skipFiles": ["<node_internals>/**"],
3933
"console": "integratedTerminal",
4034
"type": "node",
4135
"cwd": "${workspaceRoot}/test/sls-basic"
@@ -45,9 +39,7 @@
4539
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
4640
"args": ["../../src/lldebugger.ts", "--stage=test", "-o"],
4741
"request": "launch",
48-
"skipFiles": [
49-
"<node_internals>/**"
50-
],
42+
"skipFiles": ["<node_internals>/**"],
5143
"console": "integratedTerminal",
5244
"type": "node",
5345
"cwd": "${workspaceRoot}/test/sls-basic"
@@ -57,9 +49,7 @@
5749
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
5850
"args": ["../../src/lldebugger.ts"],
5951
"request": "launch",
60-
"skipFiles": [
61-
"<node_internals>/**"
62-
],
52+
"skipFiles": ["<node_internals>/**"],
6353
"console": "integratedTerminal",
6454
"type": "node",
6555
"cwd": "${workspaceRoot}/test/sls-esbuild-cjs"
@@ -69,9 +59,7 @@
6959
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
7060
"args": ["../../src/lldebugger.ts", "-o"],
7161
"request": "launch",
72-
"skipFiles": [
73-
"<node_internals>/**"
74-
],
62+
"skipFiles": ["<node_internals>/**"],
7563
"console": "integratedTerminal",
7664
"type": "node",
7765
"cwd": "${workspaceRoot}/test/sls-esbuild-cjs"
@@ -82,9 +70,7 @@
8270
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
8371
"args": ["../../src/lldebugger.ts"],
8472
"request": "launch",
85-
"skipFiles": [
86-
"<node_internals>/**"
87-
],
73+
"skipFiles": ["<node_internals>/**"],
8874
"console": "integratedTerminal",
8975
"type": "node",
9076
"cwd": "${workspaceRoot}/test/sls-esbuild-esm"
@@ -94,9 +80,7 @@
9480
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
9581
"args": ["../../src/lldebugger.ts", "-o"],
9682
"request": "launch",
97-
"skipFiles": [
98-
"<node_internals>/**"
99-
],
83+
"skipFiles": ["<node_internals>/**"],
10084
"console": "integratedTerminal",
10185
"type": "node",
10286
"cwd": "${workspaceRoot}/test/sls-esbuild-esm"
@@ -106,9 +90,7 @@
10690
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
10791
"args": ["../../src/lldebugger.ts", "--config-env=test"],
10892
"request": "launch",
109-
"skipFiles": [
110-
"<node_internals>/**"
111-
],
93+
"skipFiles": ["<node_internals>/**"],
11294
"console": "integratedTerminal",
11395
"type": "node",
11496
"cwd": "${workspaceRoot}/test/sam-basic"
@@ -118,9 +100,7 @@
118100
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
119101
"args": ["../../src/lldebugger.ts", "--config-env=test", "-o"],
120102
"request": "launch",
121-
"skipFiles": [
122-
"<node_internals>/**"
123-
],
103+
"skipFiles": ["<node_internals>/**"],
124104
"console": "integratedTerminal",
125105
"type": "node",
126106
"cwd": "${workspaceRoot}/test/sam-basic"
@@ -130,9 +110,7 @@
130110
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
131111
"args": ["../../src/lldebugger.ts", "--config-env=test"],
132112
"request": "launch",
133-
"skipFiles": [
134-
"<node_internals>/**"
135-
],
113+
"skipFiles": ["<node_internals>/**"],
136114
"console": "integratedTerminal",
137115
"type": "node",
138116
"cwd": "${workspaceRoot}/test/terraform-basic"
@@ -142,9 +120,7 @@
142120
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
143121
"args": ["../../src/lldebugger.ts", "--config-env=test", "-o"],
144122
"request": "launch",
145-
"skipFiles": [
146-
"<node_internals>/**"
147-
],
123+
"skipFiles": ["<node_internals>/**"],
148124
"console": "integratedTerminal",
149125
"type": "node",
150126
"cwd": "${workspaceRoot}/test/terraform-basic"
@@ -154,13 +130,10 @@
154130
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
155131
"args": ["../../src/lldebugger.ts", "-w"],
156132
"request": "launch",
157-
"skipFiles": [
158-
"<node_internals>/**"
159-
],
133+
"skipFiles": ["<node_internals>/**"],
160134
"console": "integratedTerminal",
161135
"type": "node",
162136
"cwd": "${workspaceRoot}/test/cdk-config"
163-
},
164-
137+
}
165138
]
166-
}
139+
}

LICENSE.md

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
thereof.
2525

2626
1.5. “Incompatible With Secondary Licenses”
27-
means
27+
means
2828

2929
a. that the initial Contributor has attached the notice described in
3030
Exhibit B to the Covered Software; or
@@ -89,7 +89,6 @@
8989
otherwise, or (b) ownership of more than fifty percent (50%) of the
9090
outstanding shares or beneficial ownership of such entity.
9191

92-
9392
2. License Grants and Conditions
9493

9594
2.1. Grants
@@ -157,7 +156,6 @@
157156
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
158157
Section 2.1.
159158

160-
161159
3. Responsibilities
162160

163161
3.1. Distribution of Source Form
@@ -232,29 +230,29 @@
232230
5. Termination
233231

234232
5.1. The rights granted under this License will terminate automatically if You
235-
fail to comply with any of its terms. However, if You become compliant,
236-
then the rights granted under this License from a particular Contributor
237-
are reinstated (a) provisionally, unless and until such Contributor
238-
explicitly and finally terminates Your grants, and (b) on an ongoing basis,
239-
if such Contributor fails to notify You of the non-compliance by some
240-
reasonable means prior to 60 days after You have come back into compliance.
241-
Moreover, Your grants from a particular Contributor are reinstated on an
242-
ongoing basis if such Contributor notifies You of the non-compliance by
243-
some reasonable means, this is the first time You have received notice of
244-
non-compliance with this License from such Contributor, and You become
245-
compliant prior to 30 days after Your receipt of the notice.
233+
fail to comply with any of its terms. However, if You become compliant,
234+
then the rights granted under this License from a particular Contributor
235+
are reinstated (a) provisionally, unless and until such Contributor
236+
explicitly and finally terminates Your grants, and (b) on an ongoing basis,
237+
if such Contributor fails to notify You of the non-compliance by some
238+
reasonable means prior to 60 days after You have come back into compliance.
239+
Moreover, Your grants from a particular Contributor are reinstated on an
240+
ongoing basis if such Contributor notifies You of the non-compliance by
241+
some reasonable means, this is the first time You have received notice of
242+
non-compliance with this License from such Contributor, and You become
243+
compliant prior to 30 days after Your receipt of the notice.
246244

247245
5.2. If You initiate litigation against any entity by asserting a patent
248-
infringement claim (excluding declaratory judgment actions, counter-claims,
249-
and cross-claims) alleging that a Contributor Version directly or
250-
indirectly infringes any patent, then the rights granted to You by any and
251-
all Contributors for the Covered Software under Section 2.1 of this License
252-
shall terminate.
246+
infringement claim (excluding declaratory judgment actions, counter-claims,
247+
and cross-claims) alleging that a Contributor Version directly or
248+
indirectly infringes any patent, then the rights granted to You by any and
249+
all Contributors for the Covered Software under Section 2.1 of this License
250+
shall terminate.
253251

254252
5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
255-
license agreements (excluding distributors and resellers) which have been
256-
validly granted by You or Your distributors under this License prior to
257-
termination shall survive termination.
253+
license agreements (excluding distributors and resellers) which have been
254+
validly granted by You or Your distributors under this License prior to
255+
termination shall survive termination.
258256

259257
6. Disclaimer of Warranty
260258

@@ -266,7 +264,7 @@
266264
Should any Covered Software prove defective in any respect, You (not any
267265
Contributor) assume the cost of any necessary servicing, repair, or
268266
correction. This disclaimer of warranty constitutes an essential part of this
269-
License. No use of any Covered Software is authorized under this License
267+
License. No use of any Covered Software is authorized under this License
270268
except under this disclaimer.
271269

272270
7. Limitation of Liability
@@ -301,7 +299,6 @@
301299
contract shall be construed against the drafter shall not be used to construe
302300
this License against a Contributor.
303301

304-
305302
10. Versions of the License
306303

307304
10.1. New Versions
@@ -327,9 +324,9 @@
327324
modified license differs from this License).
328325

329326
10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
330-
If You choose to distribute Source Code Form that is Incompatible With
331-
Secondary Licenses under the terms of this version of the License, the
332-
notice described in Exhibit B of this License must be attached.
327+
If You choose to distribute Source Code Form that is Incompatible With
328+
Secondary Licenses under the terms of this version of the License, the
329+
notice described in Exhibit B of this License must be attached.
333330

334331
Exhibit A - Source Code Form License Notice
335332

fix-imports.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { readdir, readFile, writeFile, rename, stat } from "fs/promises";
1+
import { readdir, readFile, writeFile, rename } from "fs/promises";
22
import { join, dirname, parse } from "path";
33
import { fileURLToPath } from "url";
44

@@ -39,6 +39,8 @@ const directoryPath = join(__dirname, "dist");
3939

4040
processFiles(directoryPath)
4141
.then(() =>
42-
console.log("JS files have been converted to MJS and import paths updated.")
42+
console.log(
43+
"JS files have been converted to MJS and import paths updated.",
44+
),
4345
)
4446
.catch((err) => console.error("Error processing files:", err));

src/awsCredentials.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { AwsConfiguration } from "./types/awsConfiguration.js";
88
* @returns
99
*/
1010
function getCredentialsProvider(
11-
awsConfiguration: AwsConfiguration
11+
awsConfiguration: AwsConfiguration,
1212
): AwsCredentialIdentityProvider {
1313
return fromNodeProviderChain({
1414
clientConfig: { region: awsConfiguration.region },

src/cloudFormation.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let cloudFormationClient: CloudFormationClient;
1212
*/
1313
async function getCloudFormationStackTemplate(
1414
stackName: string,
15-
awsConfiguration: AwsConfiguration
15+
awsConfiguration: AwsConfiguration,
1616
) {
1717
const { GetTemplateCommand } = await import("@aws-sdk/client-cloudformation");
1818
const command = new GetTemplateCommand({ StackName: stackName });
@@ -31,7 +31,7 @@ async function getCloudFormationStackTemplate(
3131
if (error.name === "ValidationError") {
3232
throw new Error(
3333
`Stack ${stackName} not found. Try specifying a region. Error: ${error.message}`,
34-
{ cause: error }
34+
{ cause: error },
3535
);
3636
} else {
3737
throw error;
@@ -65,7 +65,7 @@ async function getCloudFormationClient(awsConfiguration: AwsConfiguration) {
6565
*/
6666
async function getCloudFormationResources(
6767
stackName: string,
68-
awsConfiguration: AwsConfiguration
68+
awsConfiguration: AwsConfiguration,
6969
) {
7070
const { ListStackResourcesCommand } = await import(
7171
"@aws-sdk/client-cloudformation"
@@ -83,7 +83,7 @@ async function getCloudFormationResources(
8383
if (error.name === "ValidationError") {
8484
throw new Error(
8585
`Stack ${stackName} not found. Try specifying a region. Error: ${error.message}`,
86-
{ cause: error }
86+
{ cause: error },
8787
);
8888
} else {
8989
throw error;
@@ -99,7 +99,7 @@ async function getCloudFormationResources(
9999
*/
100100
async function getLambdasInStack(
101101
stackName: string,
102-
awsConfiguration: AwsConfiguration
102+
awsConfiguration: AwsConfiguration,
103103
): Promise<
104104
Array<{
105105
lambdaName: string;
@@ -108,18 +108,20 @@ async function getLambdasInStack(
108108
> {
109109
const response = await getCloudFormationResources(
110110
stackName,
111-
awsConfiguration
111+
awsConfiguration,
112112
);
113113
const lambdaResources = response.StackResourceSummaries?.filter(
114-
(resource) => resource.ResourceType === "AWS::Lambda::Function"
114+
(resource) => resource.ResourceType === "AWS::Lambda::Function",
115115
);
116116

117-
return lambdaResources?.map((resource) => {
118-
return {
119-
lambdaName: resource.PhysicalResourceId!,
120-
logicalId: resource.LogicalResourceId!,
121-
};
122-
})!;
117+
return (
118+
lambdaResources?.map((resource) => {
119+
return {
120+
lambdaName: resource.PhysicalResourceId!,
121+
logicalId: resource.LogicalResourceId!,
122+
};
123+
}) ?? []
124+
);
123125
}
124126

125127
export const CloudFormation = {

src/configuration.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ async function discoverLambdas() {
141141
if (!lambdasListNew) {
142142
if (noFramework) {
143143
throw new Error(
144-
`No framework was found, or Lambdas provided via ${configFileDefaultName} config file. If you are using monorepo, you should configure a subfolder via config/cli parameter or run the Lambda Live Debugger from a subfolder that contains the framework project.`
144+
`No framework was found, or Lambdas provided via ${configFileDefaultName} config file. If you are using monorepo, you should configure a subfolder via config/cli parameter or run the Lambda Live Debugger from a subfolder that contains the framework project.`,
145145
);
146146
} else {
147147
throw new Error(
148-
`No Lambdas were provided via ${configFileDefaultName} config file, but some were found via the framework. Check the settings 'getLambdas' or remove it.`
148+
`No Lambdas were provided via ${configFileDefaultName} config file, but some were found via the framework. Check the settings 'getLambdas' or remove it.`,
149149
);
150150
}
151151
}
@@ -173,7 +173,7 @@ function saveDiscoveredLambdas(lambdasListNew: LambdaResource[]) {
173173
Logger.log(
174174
` - ${getLambdas()
175175
.map((f) => `${f.functionName} code: ${f.codePath}`)
176-
.join("\n - ")}`
176+
.join("\n - ")}`,
177177
);
178178
}
179179
}

0 commit comments

Comments
 (0)