opencode-sonarqube 0.1.14 → 0.1.16
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/index.js +25 -10
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -19432,6 +19432,12 @@ function formatActionPrompt(result, config2) {
|
|
|
19432
19432
|
}
|
|
19433
19433
|
function createIdleHook(getConfig, getDirectory) {
|
|
19434
19434
|
return async function handleSessionIdle() {
|
|
19435
|
+
try {
|
|
19436
|
+
const { appendFileSync } = await import("node:fs");
|
|
19437
|
+
const dir = getDirectory();
|
|
19438
|
+
appendFileSync("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [IDLE-HOOK] getDirectory()=${dir}
|
|
19439
|
+
`);
|
|
19440
|
+
} catch {}
|
|
19435
19441
|
const rawConfig = getConfig()?.["sonarqube"];
|
|
19436
19442
|
const config2 = loadConfig(rawConfig);
|
|
19437
19443
|
if (!isAnalysisEnabled(config2)) {
|
|
@@ -20161,43 +20167,52 @@ function shouldIgnoreFile2(filePath) {
|
|
|
20161
20167
|
var SonarQubePlugin = async ({ client, directory, worktree }) => {
|
|
20162
20168
|
debugLog.info("=== PLUGIN START ===", { directory, worktree, cwd: process.cwd() });
|
|
20163
20169
|
const resolveValidDirectory = () => {
|
|
20164
|
-
|
|
20170
|
+
const log = (msg) => {
|
|
20171
|
+
try {
|
|
20172
|
+
appendFileSync("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [RESOLVE] ${msg}
|
|
20173
|
+
`);
|
|
20174
|
+
} catch {}
|
|
20175
|
+
};
|
|
20176
|
+
log(`START worktree=${worktree} directory=${directory} cwd=${process.cwd()}`);
|
|
20165
20177
|
if (worktree && worktree !== "/" && worktree.length > 1) {
|
|
20166
|
-
|
|
20178
|
+
log(`USING worktree=${worktree}`);
|
|
20167
20179
|
return worktree;
|
|
20168
20180
|
}
|
|
20169
20181
|
if (directory && directory !== "/" && directory.length > 1) {
|
|
20170
|
-
|
|
20182
|
+
log(`USING directory=${directory}`);
|
|
20171
20183
|
return directory;
|
|
20172
20184
|
}
|
|
20173
20185
|
const cwd = process.cwd();
|
|
20174
20186
|
if (cwd && cwd !== "/" && cwd.length > 1) {
|
|
20175
|
-
|
|
20187
|
+
log(`USING cwd=${cwd}`);
|
|
20176
20188
|
return cwd;
|
|
20177
20189
|
}
|
|
20178
20190
|
try {
|
|
20179
20191
|
const pluginUrl = import.meta.url;
|
|
20180
|
-
|
|
20192
|
+
log(`import.meta.url=${pluginUrl}`);
|
|
20181
20193
|
const pluginPath = pluginUrl.replace("file://", "");
|
|
20182
20194
|
const pathParts = pluginPath.split("/");
|
|
20183
20195
|
const nodeModulesIndex = pathParts.findIndex((p) => p === "node_modules");
|
|
20184
|
-
|
|
20196
|
+
log(`pathParts nodeModulesIndex=${nodeModulesIndex}`);
|
|
20185
20197
|
if (nodeModulesIndex > 0) {
|
|
20186
20198
|
const projectPath = pathParts.slice(0, nodeModulesIndex).join("/");
|
|
20187
|
-
|
|
20199
|
+
log(`extracted projectPath=${projectPath}`);
|
|
20188
20200
|
if (projectPath && projectPath !== "/" && projectPath.length > 1) {
|
|
20189
20201
|
return projectPath;
|
|
20190
20202
|
}
|
|
20191
20203
|
}
|
|
20192
20204
|
} catch (e) {
|
|
20193
|
-
|
|
20205
|
+
log(`import.meta.url FAILED: ${e}`);
|
|
20194
20206
|
}
|
|
20195
20207
|
const homeDir = process.env["HOME"] || "/Users";
|
|
20196
|
-
|
|
20208
|
+
log(`FALLBACK home=${homeDir}`);
|
|
20197
20209
|
return homeDir;
|
|
20198
20210
|
};
|
|
20199
20211
|
const effectiveDirectory = resolveValidDirectory();
|
|
20200
|
-
|
|
20212
|
+
try {
|
|
20213
|
+
appendFileSync("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [RESOLVE] FINAL effective=${effectiveDirectory}
|
|
20214
|
+
`);
|
|
20215
|
+
} catch {}
|
|
20201
20216
|
await client.app.log({
|
|
20202
20217
|
body: {
|
|
20203
20218
|
service: "opencode-sonarqube",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-sonarqube",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
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.
|
|
41
|
+
"opencode-sonarqube": "0.1.15",
|
|
42
42
|
"zod": "^3.24.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|