gitnexus 1.6.13-rc.83 → 1.6.13-rc.84

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.13-rc.83",
3
+ "version": "1.6.13-rc.84",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
@@ -128,11 +128,11 @@
128
128
  "@types/express": "^5.0.6",
129
129
  "@types/node": "^26.0.0",
130
130
  "@types/proxy-addr": "^2.0.3",
131
- "@vitest/coverage-v8": "^4.0.18",
131
+ "@vitest/coverage-v8": "^5.0.0",
132
132
  "gitnexus-shared": "file:../gitnexus-shared",
133
133
  "tsx": "^4.0.0",
134
134
  "typescript": "^7.0.2",
135
- "vitest": "^4.0.18"
135
+ "vitest": "^5.0.0"
136
136
  },
137
137
  "overrides": {
138
138
  "adm-zip": ">=0.6.0",
@@ -1,10 +1,9 @@
1
+ import { readFile, writeFile } from 'node:fs/promises';
2
+ import { resolve } from 'node:path';
1
3
  import { JsonReporter, type TestRunEndReason } from 'vitest/node';
2
4
 
3
5
  /** Vitest's stock JSON omits unhandled errors, even when success is true. */
4
6
  export default class ExecutionReporter extends JsonReporter {
5
- private executionErrors = 0;
6
- private executionReason: TestRunEndReason = 'interrupted';
7
-
8
7
  constructor() {
9
8
  super({});
10
9
  }
@@ -14,20 +13,26 @@ export default class ExecutionReporter extends JsonReporter {
14
13
  errors: readonly unknown[] = [],
15
14
  reason: TestRunEndReason = 'interrupted',
16
15
  ): Promise<void> {
17
- this.executionErrors = errors.length;
18
- this.executionReason = reason;
16
+ const configuredOutput = this.ctx.config.outputFile;
17
+ const outputFile = resolve(
18
+ this.ctx.config.root,
19
+ (typeof configuredOutput === 'string' ? configuredOutput : configuredOutput?.json) ??
20
+ '.vitest/json/output.json',
21
+ );
22
+ // Vitest 5 writes JSON directly instead of calling writeReport. Use an
23
+ // explicit path so this reporter also works for the web suite on Vitest 4.
24
+ this.options.outputFile = outputFile;
19
25
  await super.onTestRunEnd(modules);
20
- }
21
-
22
- override async writeReport(json: string): Promise<void> {
23
- const report = JSON.parse(json);
24
- await super.writeReport(
26
+ const report = JSON.parse(await readFile(outputFile, 'utf8'));
27
+ await writeFile(
28
+ outputFile,
25
29
  JSON.stringify({
26
30
  ...report,
27
- success: report.success && this.executionErrors === 0 && this.executionReason === 'passed',
28
- executionErrors: this.executionErrors,
29
- executionReason: this.executionReason,
31
+ success: report.success && errors.length === 0 && reason === 'passed',
32
+ executionErrors: errors.length,
33
+ executionReason: reason,
30
34
  }),
35
+ 'utf8',
31
36
  );
32
37
  }
33
38
  }