@t0.labs/daxta 0.3.6 → 0.3.7

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.
@@ -1,11 +1,8 @@
1
1
  /**
2
- * Jest reporter plugin — records/rebuilds during the run, prints Docs ready at the end.
3
- * Jest stays the process parent; DAxTA is only a plugin.
2
+ * Jest reporter — only builds OpenAPI/HTML when the full run completes.
3
+ * During the run we only record hits (superagent hook + flush); no mid-run rebuilds.
4
4
  */
5
5
  declare class DaxtaJestReporter {
6
- private suitesDone;
7
- onTestResult(): void;
8
6
  onRunComplete(): void;
9
- private rebuild;
10
7
  }
11
8
  export = DaxtaJestReporter;
@@ -28,43 +28,28 @@ function printDocsReady(hits, operations) {
28
28
  }
29
29
  }
30
30
  /**
31
- * Jest reporter plugin — records/rebuilds during the run, prints Docs ready at the end.
32
- * Jest stays the process parent; DAxTA is only a plugin.
31
+ * Jest reporter — only builds OpenAPI/HTML when the full run completes.
32
+ * During the run we only record hits (superagent hook + flush); no mid-run rebuilds.
33
33
  */
34
34
  class DaxtaJestReporter {
35
- constructor() {
36
- this.suitesDone = 0;
37
- }
38
- onTestResult() {
39
- this.suitesDone += 1;
40
- this.rebuild({ html: this.suitesDone % 5 === 0 });
41
- }
42
35
  onRunComplete() {
43
- const result = this.rebuild({ html: true });
44
- if (!result || result.skipped) {
45
- try {
46
- const build = (0, build_spec_1.buildDaxtaSpec)({ silent: true, html: true });
47
- (0, incremental_1.clearPartialMarker)();
48
- if (!build.skipped)
49
- printDocsReady(build.hits, build.operations);
50
- }
51
- catch {
52
- // ignore
53
- }
54
- return;
55
- }
56
- printDocsReady(result.hits ?? 0, result.operations ?? 0);
57
- }
58
- rebuild(options) {
59
36
  try {
60
37
  // eslint-disable-next-line @typescript-eslint/no-var-requires
61
38
  require('reflect-metadata');
62
39
  // eslint-disable-next-line @typescript-eslint/no-var-requires
63
40
  const { rebuildFromDisk } = require('../build/incremental');
64
- return rebuildFromDisk({ silent: true, force: true, html: options.html });
41
+ const result = rebuildFromDisk({ silent: true, force: true, html: true });
42
+ if (result && !result.skipped) {
43
+ printDocsReady(result.hits ?? 0, result.operations ?? 0);
44
+ return;
45
+ }
46
+ const build = (0, build_spec_1.buildDaxtaSpec)({ silent: true, html: true });
47
+ (0, incremental_1.clearPartialMarker)();
48
+ if (!build.skipped)
49
+ printDocsReady(build.hits, build.operations);
65
50
  }
66
51
  catch {
67
- return null;
52
+ // never fail the test run
68
53
  }
69
54
  }
70
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t0.labs/daxta",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "DAxTA \u2014 docs from Nest integration traffic + DTO field CLI / Try-it",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",