codesentry 0.1.6 → 0.1.8

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -1
  2. package/package.json +4 -3
package/dist/index.js CHANGED
@@ -142,6 +142,25 @@ import { join as join2 } from "path";
142
142
  import chalk2 from "chalk";
143
143
  import { Listr } from "listr2";
144
144
 
145
+ // src/errors.ts
146
+ var errorDetail = (error) => {
147
+ const stderr = error.stderr;
148
+ const stderrText = typeof stderr === "string" && stderr.trim().length > 0 ? ` (stderr: ${stderr.trim()})` : "";
149
+ return `${error.message}${stderrText}`;
150
+ };
151
+ var formatErrorChain = (error) => {
152
+ if (!(error instanceof Error)) {
153
+ return "erro desconhecido";
154
+ }
155
+ const parts = [errorDetail(error)];
156
+ let current = error.cause;
157
+ while (current instanceof Error) {
158
+ parts.push(errorDetail(current));
159
+ current = current.cause;
160
+ }
161
+ return parts.join(" | Causa: ");
162
+ };
163
+
145
164
  // src/reporters/console.reporter.ts
146
165
  import chalk from "chalk";
147
166
  import Table from "cli-table3";
@@ -498,7 +517,7 @@ var generateMarkdownReportFilename = (date = /* @__PURE__ */ new Date()) => {
498
517
  var errorMessage2 = (error) => error instanceof Error ? error.message : "erro desconhecido";
499
518
  var reportScanFailure = (error) => {
500
519
  process.exitCode = 1;
501
- console.error(`Falha ao executar o scan: ${errorMessage2(error)}`);
520
+ console.error(`Falha ao executar o scan: ${formatErrorChain(error)}`);
502
521
  };
503
522
  var printResult = (result, options) => {
504
523
  if (options.json) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codesentry",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "workspaces": [
5
5
  "packages/semgrep-rules"
6
6
  ],
@@ -48,6 +48,7 @@
48
48
  "@clack/prompts": "^1.7.0",
49
49
  "chalk": "^6.0.0",
50
50
  "cli-table3": "^0.6.5",
51
+ "codesentry-semgrep-rules": "0.1.8",
51
52
  "commander": "^15.0.0",
52
53
  "eslint": "^10.10.0",
53
54
  "eslint-plugin-no-unsanitized": "^4.1.5",
@@ -58,8 +59,8 @@
58
59
  "p-limit": "^7.3.2"
59
60
  },
60
61
  "optionalDependencies": {
61
- "codesentry-semgrep-linux-x64": "0.1.6",
62
- "codesentry-semgrep-win32-x64": "0.1.6"
62
+ "codesentry-semgrep-linux-x64": "0.1.8",
63
+ "codesentry-semgrep-win32-x64": "0.1.8"
63
64
  },
64
65
  "devDependencies": {
65
66
  "@types/node": "^26.4.1",