@t0.labs/daxta 0.3.6 → 0.4.0
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/README.md +80 -16
- package/assets/readme/demo.html +1896 -0
- package/assets/readme/docs-fields.png +0 -0
- package/assets/readme/docs-overview.png +0 -0
- package/assets/readme/docs-scenarios.png +0 -0
- package/assets/readme/terminal-docs-ready.png +0 -0
- package/dist/jest/reporter.d.ts +2 -5
- package/dist/jest/reporter.js +12 -27
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/jest/reporter.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Jest reporter
|
|
3
|
-
*
|
|
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;
|
package/dist/jest/reporter.js
CHANGED
|
@@ -28,43 +28,28 @@ function printDocsReady(hits, operations) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* Jest reporter
|
|
32
|
-
*
|
|
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
|
-
|
|
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
|
-
|
|
52
|
+
// never fail the test run
|
|
68
53
|
}
|
|
69
54
|
}
|
|
70
55
|
}
|