opencode-sonarqube 0.1.4 → 0.1.5

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 +35 -3
  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 = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-sonarqube",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
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.4",
41
42
  "zod": "^3.24.0"
42
43
  },
43
44
  "devDependencies": {