opencode-sonarqube 0.1.8 → 0.1.10

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 +18 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -16610,8 +16610,18 @@ async function deriveProjectKey(directory) {
16610
16610
  return packageJson.name;
16611
16611
  }
16612
16612
  } catch {}
16613
- const dirName = directory.split("/").pop() ?? "project";
16614
- return dirName;
16613
+ const dirName = directory.split("/").pop();
16614
+ if (dirName && dirName.length > 0) {
16615
+ return dirName;
16616
+ }
16617
+ const cwd = process.cwd();
16618
+ if (cwd && cwd !== "/") {
16619
+ const cwdName = cwd.split("/").pop();
16620
+ if (cwdName && cwdName.length > 0) {
16621
+ return cwdName;
16622
+ }
16623
+ }
16624
+ return `project-${Date.now()}`;
16615
16625
  }
16616
16626
  async function getProjectKey(config2, directory) {
16617
16627
  if (config2?.projectKey) {
@@ -19204,6 +19214,11 @@ function generateTokenName(projectKey) {
19204
19214
  }
19205
19215
  async function bootstrap(options) {
19206
19216
  const { config: config2, directory, force = false } = options;
19217
+ try {
19218
+ const { appendFileSync } = await import("node:fs");
19219
+ appendFileSync("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [BOOTSTRAP] Starting bootstrap directory=${directory} config.projectKey="${config2.projectKey || "(empty)"}"
19220
+ `);
19221
+ } catch {}
19207
19222
  logger5.info("Starting SonarQube bootstrap", { directory });
19208
19223
  if (!force) {
19209
19224
  const state2 = await loadProjectState(directory);
@@ -20092,7 +20107,7 @@ function getSeveritiesFromLevel(level) {
20092
20107
  init_types2();
20093
20108
  import { appendFileSync } from "node:fs";
20094
20109
  try {
20095
- appendFileSync("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [LOAD] Plugin module loaded!
20110
+ appendFileSync("/tmp/sonarqube-plugin-debug.log", `${new Date().toISOString()} [LOAD] Plugin module loaded! CWD=${process.cwd()}
20096
20111
  `);
20097
20112
  } catch {}
20098
20113
  var LOG_FILE = "/tmp/sonarqube-plugin-debug.log";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-sonarqube",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
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.7",
41
+ "opencode-sonarqube": "0.1.9",
42
42
  "zod": "^3.24.0"
43
43
  },
44
44
  "devDependencies": {