opencode-sonarqube 0.1.15 → 0.1.17
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 +26 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -19213,12 +19213,31 @@ function generateTokenName(projectKey) {
|
|
|
19213
19213
|
return `opencode-${projectKey}-${timestamp}-${uuid3}`;
|
|
19214
19214
|
}
|
|
19215
19215
|
async function bootstrap(options) {
|
|
19216
|
-
|
|
19216
|
+
let { config: config2, directory, force = false } = options;
|
|
19217
19217
|
try {
|
|
19218
19218
|
const { appendFileSync } = await import("node:fs");
|
|
19219
19219
|
appendFileSync("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [BOOTSTRAP] Starting bootstrap directory=${directory} config.projectKey="${config2.projectKey || "(empty)"}"
|
|
19220
19220
|
`);
|
|
19221
19221
|
} catch {}
|
|
19222
|
+
if (!directory || directory === "/" || directory === "." || directory.length < 2) {
|
|
19223
|
+
try {
|
|
19224
|
+
const pluginUrl = import.meta.url;
|
|
19225
|
+
const pluginPath = pluginUrl.replace("file://", "");
|
|
19226
|
+
const pathParts = pluginPath.split("/");
|
|
19227
|
+
const nodeModulesIndex = pathParts.findIndex((p) => p === "node_modules");
|
|
19228
|
+
if (nodeModulesIndex > 0) {
|
|
19229
|
+
const projectPath = pathParts.slice(0, nodeModulesIndex).join("/");
|
|
19230
|
+
if (projectPath && projectPath !== "/" && projectPath.length > 1) {
|
|
19231
|
+
directory = projectPath;
|
|
19232
|
+
try {
|
|
19233
|
+
const { appendFileSync } = await import("node:fs");
|
|
19234
|
+
appendFileSync("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [BOOTSTRAP] Fixed directory from import.meta.url: ${directory}
|
|
19235
|
+
`);
|
|
19236
|
+
} catch {}
|
|
19237
|
+
}
|
|
19238
|
+
}
|
|
19239
|
+
} catch {}
|
|
19240
|
+
}
|
|
19222
19241
|
if (!directory || directory === "/" || directory === "." || directory.length < 2) {
|
|
19223
19242
|
logger5.error("Invalid directory for bootstrap", { directory });
|
|
19224
19243
|
return {
|
|
@@ -19432,6 +19451,12 @@ function formatActionPrompt(result, config2) {
|
|
|
19432
19451
|
}
|
|
19433
19452
|
function createIdleHook(getConfig, getDirectory) {
|
|
19434
19453
|
return async function handleSessionIdle() {
|
|
19454
|
+
try {
|
|
19455
|
+
const { appendFileSync } = await import("node:fs");
|
|
19456
|
+
const dir = getDirectory();
|
|
19457
|
+
appendFileSync("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [IDLE-HOOK] getDirectory()=${dir}
|
|
19458
|
+
`);
|
|
19459
|
+
} catch {}
|
|
19435
19460
|
const rawConfig = getConfig()?.["sonarqube"];
|
|
19436
19461
|
const config2 = loadConfig(rawConfig);
|
|
19437
19462
|
if (!isAnalysisEnabled(config2)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-sonarqube",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
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.16",
|
|
42
42
|
"zod": "^3.24.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|