opencode-sonarqube 0.1.4 → 0.1.6

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 +54 -5
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -1,5 +1,20 @@
1
1
  import { createRequire } from "node:module";
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
2
4
  var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __toESM = (mod, isNodeMode, target) => {
8
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
9
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
+ for (let key of __getOwnPropNames(mod))
11
+ if (!__hasOwnProp.call(to, key))
12
+ __defProp(to, key, {
13
+ get: () => mod[key],
14
+ enumerable: true
15
+ });
16
+ return to;
17
+ };
3
18
  var __export = (target, all) => {
4
19
  for (var name in all)
5
20
  __defProp(target, name, {
@@ -17091,6 +17106,12 @@ class SonarQubeClient {
17091
17106
  if (requestBody) {
17092
17107
  headers["Content-Type"] = "application/x-www-form-urlencoded";
17093
17108
  }
17109
+ const logLine = `${new Date().toISOString()} [API] >>> ${method} ${endpoint} ${JSON.stringify({ url: url2, params, hasBody: !!body, bodyKeys: body ? Object.keys(body) : [] })}
17110
+ `;
17111
+ try {
17112
+ const { appendFileSync } = await import("node:fs");
17113
+ appendFileSync("/tmp/sonarqube-plugin-debug.log", logLine);
17114
+ } catch {}
17094
17115
  console.log(`[SONARQUBE-API] >>> ${method} ${endpoint}`, JSON.stringify({
17095
17116
  url: url2,
17096
17117
  params,
@@ -20069,15 +20090,26 @@ function getSeveritiesFromLevel(level) {
20069
20090
 
20070
20091
  // src/index.ts
20071
20092
  init_types2();
20093
+ import { appendFileSync } from "node:fs";
20094
+ var LOG_FILE = "/tmp/sonarqube-plugin-debug.log";
20072
20095
  var debugLog = {
20073
- info: (msg, extra) => {
20096
+ _write: (level, msg, extra) => {
20097
+ const timestamp = new Date().toISOString();
20098
+ const logLine = `${timestamp} [${level}] ${msg} ${extra ? JSON.stringify(extra) : ""}
20099
+ `;
20100
+ try {
20101
+ appendFileSync(LOG_FILE, logLine);
20102
+ } catch {}
20074
20103
  console.log(`[SONARQUBE-DEBUG] ${msg}`, extra ? JSON.stringify(extra) : "");
20075
20104
  },
20105
+ info: (msg, extra) => {
20106
+ debugLog._write("INFO", msg, extra);
20107
+ },
20076
20108
  warn: (msg, extra) => {
20077
- console.warn(`[SONARQUBE-DEBUG] ${msg}`, extra ? JSON.stringify(extra) : "");
20109
+ debugLog._write("WARN", msg, extra);
20078
20110
  },
20079
20111
  error: (msg, extra) => {
20080
- console.error(`[SONARQUBE-DEBUG] ${msg}`, extra ? JSON.stringify(extra) : "");
20112
+ debugLog._write("ERROR", msg, extra);
20081
20113
  }
20082
20114
  };
20083
20115
  var IGNORED_FILE_PATTERNS2 = [
@@ -20196,7 +20228,13 @@ Use \`sonarqube({ action: "issues" })\` to see details or \`sonarqube({ action:
20196
20228
  });
20197
20229
  await showToast(qgFailed ? "SonarQube: Quality Gate Failed" : "SonarQube: Issues Found", qgFailed ? "error" : "info");
20198
20230
  }
20199
- } catch {}
20231
+ } catch (error45) {
20232
+ try {
20233
+ const { appendFileSync: appendFileSync2 } = await import("node:fs");
20234
+ appendFileSync2("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [ERROR] performInitialQualityCheck FAILED: ${error45}
20235
+ `);
20236
+ } catch {}
20237
+ }
20200
20238
  };
20201
20239
  const showToast = async (message, variant = "info") => {
20202
20240
  try {
@@ -20506,6 +20544,11 @@ Git operation completed with changes. Consider running:
20506
20544
  }
20507
20545
  },
20508
20546
  "experimental.chat.system.transform": async (_input, output) => {
20547
+ try {
20548
+ const { appendFileSync: appendFileSync2 } = await import("node:fs");
20549
+ appendFileSync2("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [HOOK] experimental.chat.system.transform ENTERED
20550
+ `);
20551
+ } catch {}
20509
20552
  debugLog.info("=== experimental.chat.system.transform START ===");
20510
20553
  await loadPluginConfig();
20511
20554
  const sonarConfig = pluginConfig?.["sonarqube"];
@@ -20567,7 +20610,13 @@ ${config2.level === "enterprise" ? `This project follows enterprise-level qualit
20567
20610
  - \`sonarqube({ action: "worstfiles" })\` - Find files needing most attention
20568
20611
  - \`sonarqube({ action: "issues" })\` - See all issues`;
20569
20612
  output.system.push(systemContext);
20570
- } catch {}
20613
+ } catch (error45) {
20614
+ try {
20615
+ const { appendFileSync: appendFileSync2 } = await import("node:fs");
20616
+ appendFileSync2("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [ERROR] experimental.chat.system.transform FAILED: ${error45}
20617
+ `);
20618
+ } catch {}
20619
+ }
20571
20620
  },
20572
20621
  tool: {
20573
20622
  sonarqube: tool({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-sonarqube",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "OpenCode Plugin for SonarQube integration - Enterprise-level code quality from the start",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -38,6 +38,7 @@
38
38
  "homepage": "https://github.com/mguttmann/opencode-sonarqube#readme",
39
39
  "dependencies": {
40
40
  "@opencode-ai/plugin": "^1.1.34",
41
+ "opencode-sonarqube": "0.1.5",
41
42
  "zod": "^3.24.0"
42
43
  },
43
44
  "devDependencies": {