lambda-live-debugger 0.0.106 → 0.0.108

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/dist/vsCode.mjs CHANGED
@@ -3,7 +3,7 @@ import path from "path";
3
3
  import { parse, printParseErrorCode, applyEdits, modify, } from "jsonc-parser";
4
4
  import { getModuleDirname, getProjectDirname } from "./getDirname.mjs";
5
5
  import { Logger } from "./logger.mjs";
6
- async function getVsCodeLaunchConfig(lldConfig) {
6
+ async function getVsCodeLaunchConfig() {
7
7
  const localRuntimeExecutable = "${workspaceFolder}/node_modules/.bin/lld";
8
8
  const config = {
9
9
  version: "0.2.0",
@@ -37,7 +37,7 @@ async function getVsCodeLaunchConfig(lldConfig) {
37
37
  runtimeExecutableSet = true;
38
38
  //Logger.log("Found local folder", localFolder);
39
39
  }
40
- catch (err) {
40
+ catch {
41
41
  //Logger.log("Not found", localFolder);
42
42
  }
43
43
  }
@@ -68,7 +68,7 @@ async function getVsCodeLaunchConfig(lldConfig) {
68
68
  Logger.verbose(`Found folder with lld executable: ${folder}`);
69
69
  break;
70
70
  }
71
- catch (err) {
71
+ catch {
72
72
  // Not found
73
73
  }
74
74
  }
@@ -127,7 +127,7 @@ async function getCurrentState() {
127
127
  try {
128
128
  await fs.access(filePath, fs.constants.F_OK);
129
129
  }
130
- catch (err) {
130
+ catch {
131
131
  createNewFile = true;
132
132
  }
133
133
  if (!createNewFile) {
@@ -169,10 +169,10 @@ async function isConfigured() {
169
169
  }
170
170
  return false;
171
171
  }
172
- async function addConfiguration(lldConfig) {
172
+ async function addConfiguration() {
173
173
  Logger.log("Adding configuration to .vscode/launch.json");
174
174
  const state = await getCurrentState();
175
- const config = await getVsCodeLaunchConfig(lldConfig);
175
+ const config = await getVsCodeLaunchConfig();
176
176
  if (state.state === "FILE_EXISTS_CONFIGURATION_DOES_NOT_EXIST") {
177
177
  const { jsonString, filePath, configurationsLength } = state;
178
178
  await writeConfiguration(filePath, jsonString, config.configurations[0], configurationsLength);
@@ -0,0 +1,43 @@
1
+ import globals from "globals";
2
+ import pluginJs from "@eslint/js";
3
+ import tseslint from "typescript-eslint";
4
+ import pluginPrettier from "eslint-plugin-prettier";
5
+ import prettierConfig from "eslint-config-prettier";
6
+
7
+ export default [
8
+ { files: ["**/*.{js,mjs,cjs,ts}"] },
9
+ {
10
+ ignores: [
11
+ "**/dist/**",
12
+ "**/cdk.out/**",
13
+ "**/.lldebugger/**",
14
+ "**/.serverless/**",
15
+ "**/.aws-sam/**",
16
+ "src/extension/aws/*.js",
17
+ ],
18
+ },
19
+ {
20
+ languageOptions: {
21
+ globals: globals.node,
22
+ parser: "@typescript-eslint/parser",
23
+ parserOptions: {
24
+ project: "./tsconfig.json",
25
+ },
26
+ },
27
+ },
28
+ pluginJs.configs.recommended,
29
+ ...tseslint.configs.recommended,
30
+ {
31
+ plugins: {
32
+ prettier: pluginPrettier,
33
+ },
34
+ rules: {
35
+ ...pluginPrettier.configs.recommended.rules,
36
+ "@typescript-eslint/no-floating-promises": "error",
37
+ "@typescript-eslint/no-explicit-any": "off",
38
+ "@typescript-eslint/no-require-imports": "off",
39
+ "@typescript-eslint/ban-ts-comment": "off",
40
+ },
41
+ },
42
+ prettierConfig,
43
+ ];
package/fix-imports.js CHANGED
@@ -1,4 +1,4 @@
1
- import { readdir, readFile, writeFile, rename, stat } from "fs/promises";
1
+ import { readdir, readFile, writeFile, rename } from "fs/promises";
2
2
  import { join, dirname, parse } from "path";
3
3
  import { fileURLToPath } from "url";
4
4
 
@@ -39,6 +39,8 @@ const directoryPath = join(__dirname, "dist");
39
39
 
40
40
  processFiles(directoryPath)
41
41
  .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
+ ),
43
45
  )
44
46
  .catch((err) => console.error("Error processing files:", err));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambda-live-debugger",
3
- "version": "0.0.106",
3
+ "version": "0.0.108",
4
4
  "type": "module",
5
5
  "description": "Debug Lambda functions locally like it is running in the cloud",
6
6
  "repository": {
@@ -38,6 +38,9 @@
38
38
  "typings": "dist/index.d.ts",
39
39
  "scripts": {
40
40
  "typecheck": "tsc --noEmit -p tsconfig.typecheck.json && npx tsc --noEmit -p src/extension/tsconfig.json",
41
+ "lint": "eslint . --fix",
42
+ "prettier": "prettier . --write",
43
+ "prepare": "husky",
41
44
  "add-bang": "sed -i '1s|^|#!/usr/bin/env node\\n|' ./dist/lldebugger.mjs",
42
45
  "build": "tsc -p tsconfig.build.json && cp src/nodeWorkerRunner.mjs dist && cp src/frameworks/cdkFrameworkWorker.mjs dist/frameworks && node fix-imports.js && npm run add-bang && npm run bundle-extension",
43
46
  "bundle-extension": "cd src/extension && npm run build && cd ../../",
@@ -58,6 +61,7 @@
58
61
  "test-terraform-basic-observable": "npm run build && RUN_TEST_FROM_CLI=true OBSERVABLE_MODE=true vitest run test/terraform-basic.test.ts"
59
62
  },
60
63
  "devDependencies": {
64
+ "@eslint/js": "^9.8.0",
61
65
  "@tsconfig/node20": "^20.1.4",
62
66
  "@types/aws-iot-device-sdk": "^2.2.8",
63
67
  "@types/inquirer": "^9.0.7",
@@ -66,10 +70,17 @@
66
70
  "aws-cdk": "2.135.0",
67
71
  "aws-cdk-lib": "2.135.0",
68
72
  "constructs": "^10.0.0",
73
+ "eslint": "^9.8.0",
74
+ "eslint-config-prettier": "^9.1.0",
75
+ "eslint-plugin-prettier": "^5.2.1",
76
+ "globals": "^15.9.0",
77
+ "husky": "^9.1.4",
78
+ "prettier": "^3.3.3",
69
79
  "semantic-release": "^23.0.8",
70
80
  "serverless": "^3.38.0",
71
81
  "serverless-esbuild": "^1.52.1",
72
- "tsx": "^4.7.1"
82
+ "tsx": "^4.7.1",
83
+ "typescript-eslint": "^8.0.0"
73
84
  },
74
85
  "dependencies": {
75
86
  "@aws-sdk/client-cloudformation": "^3.577.0",
@@ -3,7 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "outDir": "./dist",
5
5
  "rootDir": "./src",
6
- "declaration": true,
6
+ "declaration": true
7
7
  },
8
8
  "include": ["src/**/*"],
9
9
  "exclude": ["node_modules", "dist", "src/extension"]