opencode-sonarqube 0.1.14 → 0.1.15

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 +19 -10
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -20161,43 +20161,52 @@ function shouldIgnoreFile2(filePath) {
20161
20161
  var SonarQubePlugin = async ({ client, directory, worktree }) => {
20162
20162
  debugLog.info("=== PLUGIN START ===", { directory, worktree, cwd: process.cwd() });
20163
20163
  const resolveValidDirectory = () => {
20164
- debugLog.info("resolveValidDirectory: starting", { worktree, directory, cwd: process.cwd() });
20164
+ const log = (msg) => {
20165
+ try {
20166
+ appendFileSync("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [RESOLVE] ${msg}
20167
+ `);
20168
+ } catch {}
20169
+ };
20170
+ log(`START worktree=${worktree} directory=${directory} cwd=${process.cwd()}`);
20165
20171
  if (worktree && worktree !== "/" && worktree.length > 1) {
20166
- debugLog.info("resolveValidDirectory: using worktree", { worktree });
20172
+ log(`USING worktree=${worktree}`);
20167
20173
  return worktree;
20168
20174
  }
20169
20175
  if (directory && directory !== "/" && directory.length > 1) {
20170
- debugLog.info("resolveValidDirectory: using directory", { directory });
20176
+ log(`USING directory=${directory}`);
20171
20177
  return directory;
20172
20178
  }
20173
20179
  const cwd = process.cwd();
20174
20180
  if (cwd && cwd !== "/" && cwd.length > 1) {
20175
- debugLog.info("resolveValidDirectory: using cwd", { cwd });
20181
+ log(`USING cwd=${cwd}`);
20176
20182
  return cwd;
20177
20183
  }
20178
20184
  try {
20179
20185
  const pluginUrl = import.meta.url;
20180
- debugLog.info("resolveValidDirectory: import.meta.url", { pluginUrl });
20186
+ log(`import.meta.url=${pluginUrl}`);
20181
20187
  const pluginPath = pluginUrl.replace("file://", "");
20182
20188
  const pathParts = pluginPath.split("/");
20183
20189
  const nodeModulesIndex = pathParts.findIndex((p) => p === "node_modules");
20184
- debugLog.info("resolveValidDirectory: pathParts", { pathParts: pathParts.join(","), nodeModulesIndex });
20190
+ log(`pathParts nodeModulesIndex=${nodeModulesIndex}`);
20185
20191
  if (nodeModulesIndex > 0) {
20186
20192
  const projectPath = pathParts.slice(0, nodeModulesIndex).join("/");
20187
- debugLog.info("resolveValidDirectory: extracted projectPath", { projectPath });
20193
+ log(`extracted projectPath=${projectPath}`);
20188
20194
  if (projectPath && projectPath !== "/" && projectPath.length > 1) {
20189
20195
  return projectPath;
20190
20196
  }
20191
20197
  }
20192
20198
  } catch (e) {
20193
- debugLog.error("resolveValidDirectory: import.meta.url failed", { error: String(e) });
20199
+ log(`import.meta.url FAILED: ${e}`);
20194
20200
  }
20195
20201
  const homeDir = process.env["HOME"] || "/Users";
20196
- debugLog.info("resolveValidDirectory: using fallback home", { homeDir });
20202
+ log(`FALLBACK home=${homeDir}`);
20197
20203
  return homeDir;
20198
20204
  };
20199
20205
  const effectiveDirectory = resolveValidDirectory();
20200
- debugLog.info("Resolved directory FINAL", { original: directory, effective: effectiveDirectory });
20206
+ try {
20207
+ appendFileSync("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [RESOLVE] FINAL effective=${effectiveDirectory}
20208
+ `);
20209
+ } catch {}
20201
20210
  await client.app.log({
20202
20211
  body: {
20203
20212
  service: "opencode-sonarqube",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-sonarqube",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
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,7 +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.13",
41
+ "opencode-sonarqube": "0.1.14",
42
42
  "zod": "^3.24.0"
43
43
  },
44
44
  "devDependencies": {