testeranto 0.110.0 → 0.112.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/dist/common/PM/main.js +279 -87
- package/dist/common/run.js +4 -239
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/PM/main.js +280 -88
- package/dist/module/ReportClient.js +46 -46
- package/dist/module/run.js +4 -239
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/ReportClient.js +1060 -60
- package/dist/prebuild/run.mjs +297 -334
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/PM/main.d.ts +16 -9
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/utils.d.ts +6 -0
- package/package.json +1 -1
- package/src/PM/main.ts +406 -112
- package/src/ReportClient.tsx +80 -70
- package/src/run.ts +5 -369
- package/src/utils.ts +10 -0
- package/tsc.log +8 -6
package/dist/module/PM/main.js
CHANGED
|
@@ -1,14 +1,55 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import fs, { watch } from "fs";
|
|
2
3
|
import path from "path";
|
|
3
4
|
import puppeteer from "puppeteer-core";
|
|
4
5
|
import ansiC from "ansi-colors";
|
|
5
|
-
import
|
|
6
|
+
import crypto from "node:crypto";
|
|
7
|
+
import { ESLint } from "eslint";
|
|
8
|
+
import tsc from "tsc-prog";
|
|
9
|
+
import { lintPather, tscPather } from "../utils";
|
|
6
10
|
import { PM } from "./index.js";
|
|
11
|
+
const eslint = new ESLint();
|
|
12
|
+
const formatter = await eslint.loadFormatter("./node_modules/testeranto/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs");
|
|
13
|
+
const changes = {};
|
|
14
|
+
const fileHashes = {};
|
|
7
15
|
const fileStreams3 = [];
|
|
8
16
|
const fPaths = [];
|
|
9
17
|
const files = {};
|
|
10
18
|
const recorders = {};
|
|
11
19
|
const screenshots = {};
|
|
20
|
+
async function fileHash(filePath, algorithm = "md5") {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
const hash = crypto.createHash(algorithm);
|
|
23
|
+
const fileStream = fs.createReadStream(filePath);
|
|
24
|
+
fileStream.on("data", (data) => {
|
|
25
|
+
hash.update(data);
|
|
26
|
+
});
|
|
27
|
+
fileStream.on("end", () => {
|
|
28
|
+
const fileHash = hash.digest("hex");
|
|
29
|
+
resolve(fileHash);
|
|
30
|
+
});
|
|
31
|
+
fileStream.on("error", (error) => {
|
|
32
|
+
reject(`Error reading file: ${error.message}`);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const getRunnables = (tests, payload = {
|
|
37
|
+
nodeEntryPoints: {},
|
|
38
|
+
webEntryPoints: {},
|
|
39
|
+
}) => {
|
|
40
|
+
return tests.reduce((pt, cv, cndx, cry) => {
|
|
41
|
+
if (cv[1] === "node") {
|
|
42
|
+
pt.nodeEntryPoints[cv[0]] = path.resolve(`./docs/node/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
|
|
43
|
+
}
|
|
44
|
+
else if (cv[1] === "web") {
|
|
45
|
+
pt.webEntryPoints[cv[0]] = path.resolve(`./docs/web/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
|
|
46
|
+
}
|
|
47
|
+
if (cv[3].length) {
|
|
48
|
+
getRunnables(cv[3], payload);
|
|
49
|
+
}
|
|
50
|
+
return pt;
|
|
51
|
+
}, payload);
|
|
52
|
+
};
|
|
12
53
|
const statusMessagePretty = (failures, test) => {
|
|
13
54
|
if (failures === 0) {
|
|
14
55
|
console.log(ansiC.green(ansiC.inverse(`> ${test} completed successfully`)));
|
|
@@ -27,6 +68,13 @@ async function writeFileAndCreateDir(filePath, data) {
|
|
|
27
68
|
console.error(`Error writing file: ${error}`);
|
|
28
69
|
}
|
|
29
70
|
}
|
|
71
|
+
const filesHash = async (files, algorithm = "md5") => {
|
|
72
|
+
return new Promise((resolve, reject) => {
|
|
73
|
+
resolve(files.reduce(async (mm, f) => {
|
|
74
|
+
return (await mm) + (await fileHash(f));
|
|
75
|
+
}, Promise.resolve("")));
|
|
76
|
+
});
|
|
77
|
+
};
|
|
30
78
|
function isValidUrl(string) {
|
|
31
79
|
try {
|
|
32
80
|
new URL(string);
|
|
@@ -41,35 +89,117 @@ export class PM_Main extends PM {
|
|
|
41
89
|
super();
|
|
42
90
|
this.shutdownMode = false;
|
|
43
91
|
this.bigBoard = {};
|
|
92
|
+
this.stop = () => {
|
|
93
|
+
console.log(ansiC.inverse("Testeranto-Run is shutting down gracefully..."));
|
|
94
|
+
this.mode = "PROD";
|
|
95
|
+
this.nodeMetafileWatcher.close();
|
|
96
|
+
this.webMetafileWatcher.close();
|
|
97
|
+
this.checkForShutdown();
|
|
98
|
+
};
|
|
99
|
+
this.tscCheck = async ({ entrypoint, addableFiles, platform, }) => {
|
|
100
|
+
console.log(ansiC.green(ansiC.inverse(`tsc < ${entrypoint}`)));
|
|
101
|
+
this.bigBoard[entrypoint].typeErrors = "?";
|
|
102
|
+
const program = tsc.createProgramFromConfig({
|
|
103
|
+
basePath: process.cwd(), // always required, used for relative paths
|
|
104
|
+
configFilePath: "tsconfig.json", // config to inherit from (optional)
|
|
105
|
+
compilerOptions: {
|
|
106
|
+
rootDir: "src",
|
|
107
|
+
outDir: tscPather(entrypoint, platform),
|
|
108
|
+
// declaration: true,
|
|
109
|
+
// skipLibCheck: true,
|
|
110
|
+
noEmit: true,
|
|
111
|
+
},
|
|
112
|
+
include: addableFiles, //["src/**/*"],
|
|
113
|
+
// exclude: ["**/*.test.ts", "**/*.spec.ts"],
|
|
114
|
+
});
|
|
115
|
+
const tscPath = tscPather(entrypoint, platform);
|
|
116
|
+
let allDiagnostics = program.getSemanticDiagnostics();
|
|
117
|
+
const d = [];
|
|
118
|
+
allDiagnostics.forEach((diagnostic) => {
|
|
119
|
+
if (diagnostic.file) {
|
|
120
|
+
let { line, character } = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
|
|
121
|
+
let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
122
|
+
d.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
d.push(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"));
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
fs.writeFileSync(tscPath, d.join("\n"));
|
|
129
|
+
this.bigBoard[entrypoint].typeErrors = d.length;
|
|
130
|
+
if (this.shutdownMode) {
|
|
131
|
+
this.checkForShutdown();
|
|
132
|
+
}
|
|
133
|
+
// fs.writeFileSync(
|
|
134
|
+
// tscExitCodePather(entrypoint, platform),
|
|
135
|
+
// d.length.toString()
|
|
136
|
+
// );
|
|
137
|
+
};
|
|
138
|
+
this.eslintCheck = async (entrypoint, platform, addableFiles) => {
|
|
139
|
+
this.bigBoard[entrypoint].staticErrors = "?";
|
|
140
|
+
console.log(ansiC.green(ansiC.inverse(`eslint < ${entrypoint}`)));
|
|
141
|
+
const results = (await eslint.lintFiles(addableFiles))
|
|
142
|
+
.filter((r) => r.messages.length)
|
|
143
|
+
.filter((r) => {
|
|
144
|
+
return r.messages[0].ruleId !== null;
|
|
145
|
+
})
|
|
146
|
+
.map((r) => {
|
|
147
|
+
delete r.source;
|
|
148
|
+
return r;
|
|
149
|
+
});
|
|
150
|
+
fs.writeFileSync(lintPather(entrypoint, platform), await formatter.format(results));
|
|
151
|
+
this.bigBoard[entrypoint].staticErrors = results.length;
|
|
152
|
+
if (this.shutdownMode) {
|
|
153
|
+
this.checkForShutdown();
|
|
154
|
+
}
|
|
155
|
+
// fs.writeFileSync(
|
|
156
|
+
// lintExitCodePather(entrypoint, platform),
|
|
157
|
+
// results.length.toString()
|
|
158
|
+
// );
|
|
159
|
+
};
|
|
160
|
+
this.makePrompt = async (entryPoint, addableFiles, platform) => {
|
|
161
|
+
this.bigBoard[entryPoint].prompt = "?";
|
|
162
|
+
const promptPath = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `prompt.txt`);
|
|
163
|
+
const testPaths = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `tests.json`);
|
|
164
|
+
const featuresPath = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `featurePrompt.txt`);
|
|
165
|
+
fs.writeFileSync(promptPath, `
|
|
166
|
+
${addableFiles
|
|
167
|
+
.map((x) => {
|
|
168
|
+
return `/add ${x}`;
|
|
169
|
+
})
|
|
170
|
+
.join("\n")}
|
|
171
|
+
|
|
172
|
+
/read ${lintPather(entryPoint, platform)}
|
|
173
|
+
/read ${tscPather(entryPoint, platform)}
|
|
174
|
+
/read ${testPaths}
|
|
175
|
+
|
|
176
|
+
/load ${featuresPath}
|
|
177
|
+
|
|
178
|
+
/code Fix the failing tests described in ${testPaths}. Correct any type signature errors described in the files ${tscPather(entryPoint, platform)}. Implement any method which throws "Function not implemented. Resolve the lint errors described in ${lintPather(entryPoint, platform)}"
|
|
179
|
+
`);
|
|
180
|
+
this.bigBoard[entryPoint].prompt = `aider --model deepseek/deepseek-chat --load docs/${platform}/${entryPoint
|
|
181
|
+
.split(".")
|
|
182
|
+
.slice(0, -1)
|
|
183
|
+
.join(".")}/prompt.txt`;
|
|
184
|
+
if (this.shutdownMode) {
|
|
185
|
+
this.checkForShutdown();
|
|
186
|
+
}
|
|
187
|
+
};
|
|
44
188
|
this.checkForShutdown = () => {
|
|
45
|
-
const anyRunning = Object.values(this.bigBoard).filter((x) => x.
|
|
46
|
-
.
|
|
189
|
+
const anyRunning = Object.values(this.bigBoard).filter((x) => x.prompt === "?").length +
|
|
190
|
+
Object.values(this.bigBoard).filter((x) => x.runTimeError === "?")
|
|
191
|
+
.length +
|
|
192
|
+
Object.values(this.bigBoard).filter((x) => x.staticErrors === "?")
|
|
193
|
+
.length +
|
|
194
|
+
Object.values(this.bigBoard).filter((x) => x.typeErrors === "?")
|
|
195
|
+
.length >
|
|
196
|
+
0;
|
|
47
197
|
if (anyRunning) {
|
|
198
|
+
console.log(ansiC.inverse("Shutting down. Please wait"));
|
|
48
199
|
}
|
|
49
200
|
else {
|
|
50
201
|
this.browser.disconnect().then(() => {
|
|
51
|
-
|
|
52
|
-
timestamp: Date.now(),
|
|
53
|
-
tests: this.configs.tests.reduce((mm, t) => {
|
|
54
|
-
const bddErrors = fs
|
|
55
|
-
.readFileSync(bddExitCodePather(t[0], t[1]))
|
|
56
|
-
.toString();
|
|
57
|
-
const lintErrors = fs
|
|
58
|
-
.readFileSync(lintExitCodePather(t[0], t[1]))
|
|
59
|
-
.toString();
|
|
60
|
-
const typeErrors = fs
|
|
61
|
-
.readFileSync(tscExitCodePather(t[0], t[1]))
|
|
62
|
-
.toString();
|
|
63
|
-
mm[t[0]] = {
|
|
64
|
-
bddErrors,
|
|
65
|
-
lintErrors,
|
|
66
|
-
typeErrors,
|
|
67
|
-
};
|
|
68
|
-
return mm;
|
|
69
|
-
}, {}),
|
|
70
|
-
};
|
|
71
|
-
const s = JSON.stringify(final, null, 2);
|
|
72
|
-
fs.writeFileSync("docs/summary.json", s);
|
|
202
|
+
fs.writeFileSync("docs/summary.json", JSON.stringify(this.bigBoard, null, 2));
|
|
73
203
|
console.log(ansiC.inverse("Goodbye"));
|
|
74
204
|
process.exit();
|
|
75
205
|
});
|
|
@@ -184,15 +314,7 @@ export class PM_Main extends PM {
|
|
|
184
314
|
};
|
|
185
315
|
this.launchWebSideCar = async (src, dest, testConfig) => {
|
|
186
316
|
const d = dest + ".mjs";
|
|
187
|
-
// console.log(green, "launchWebSideCar", src, dest, d);
|
|
188
317
|
console.log(ansiC.green(ansiC.inverse(`launchWebSideCar ${src}`)));
|
|
189
|
-
const destFolder = dest.replace(".mjs", "");
|
|
190
|
-
// const webArgz = JSON.stringify({
|
|
191
|
-
// name: dest,
|
|
192
|
-
// ports: [].toString(),
|
|
193
|
-
// fs: destFolder,
|
|
194
|
-
// browserWSEndpoint: this.browser.wsEndpoint(),
|
|
195
|
-
// });
|
|
196
318
|
const fileStreams2 = [];
|
|
197
319
|
const doneFileStream2 = [];
|
|
198
320
|
return new Promise((res, rej) => {
|
|
@@ -292,7 +414,6 @@ export class PM_Main extends PM {
|
|
|
292
414
|
};
|
|
293
415
|
this.launchNodeSideCar = async (src, dest, testConfig) => {
|
|
294
416
|
const d = dest + ".mjs";
|
|
295
|
-
// console.log(green, "launchNodeSideCar", src, dest, d);
|
|
296
417
|
console.log(ansiC.green(ansiC.inverse(`launchNodeSideCar ${src}`)));
|
|
297
418
|
const destFolder = dest.replace(".mjs", "");
|
|
298
419
|
let argz = "";
|
|
@@ -334,10 +455,6 @@ export class PM_Main extends PM {
|
|
|
334
455
|
process.exit(-1);
|
|
335
456
|
}
|
|
336
457
|
const builtfile = dest + ".mjs";
|
|
337
|
-
// console.log(
|
|
338
|
-
// "node builtfile",
|
|
339
|
-
// (await import(`${builtfile}?cacheBust=${Date.now()}`)).default
|
|
340
|
-
// );
|
|
341
458
|
this.server[builtfile] = await import(`${builtfile}?cacheBust=${Date.now()}`).then((module) => {
|
|
342
459
|
return module.default.then((defaultModule) => {
|
|
343
460
|
// console.log("defaultModule", defaultModule);
|
|
@@ -355,7 +472,6 @@ export class PM_Main extends PM {
|
|
|
355
472
|
// });
|
|
356
473
|
});
|
|
357
474
|
});
|
|
358
|
-
// console.log("portsToUse", portsToUse);
|
|
359
475
|
for (let i = 0; i <= portsToUse.length; i++) {
|
|
360
476
|
if (portsToUse[i]) {
|
|
361
477
|
this.ports[portsToUse[i]] = "true"; //port is open again
|
|
@@ -667,21 +783,25 @@ export class PM_Main extends PM {
|
|
|
667
783
|
})
|
|
668
784
|
.join("\n"));
|
|
669
785
|
});
|
|
670
|
-
this.writeBigBoard();
|
|
786
|
+
// this.writeBigBoard();
|
|
671
787
|
};
|
|
672
788
|
this.receiveExitCode = (srcTest, failures) => {
|
|
673
789
|
this.bigBoard[srcTest].runTimeError = failures;
|
|
674
790
|
this.writeBigBoard();
|
|
675
791
|
};
|
|
676
792
|
this.writeBigBoard = () => {
|
|
677
|
-
fs.writeFileSync("./docs/
|
|
793
|
+
fs.writeFileSync("./docs/summary.json", JSON.stringify(this.bigBoard, null, 2));
|
|
678
794
|
};
|
|
795
|
+
this.mode = configs.devMode ? "DEV" : "PROD";
|
|
679
796
|
this.server = {};
|
|
680
797
|
this.configs = configs;
|
|
681
798
|
this.ports = {};
|
|
682
799
|
this.configs.tests.forEach(([t]) => {
|
|
683
800
|
this.bigBoard[t] = {
|
|
684
|
-
|
|
801
|
+
runTimeError: "?",
|
|
802
|
+
typeErrors: "?",
|
|
803
|
+
staticErrors: "?",
|
|
804
|
+
prompt: "?",
|
|
685
805
|
};
|
|
686
806
|
});
|
|
687
807
|
this.configs.ports.forEach((element) => {
|
|
@@ -750,29 +870,6 @@ export class PM_Main extends PM {
|
|
|
750
870
|
globalThis["end"] = (uid) => {
|
|
751
871
|
fileStreams3[uid].end();
|
|
752
872
|
};
|
|
753
|
-
// async (ssOpts: ScreenshotOptions, testName: string) => {
|
|
754
|
-
// const p = ssOpts.path as string;
|
|
755
|
-
// const dir = path.dirname(p);
|
|
756
|
-
// fs.mkdirSync(dir, {
|
|
757
|
-
// recursive: true,
|
|
758
|
-
// });
|
|
759
|
-
// if (!files[testName]) {
|
|
760
|
-
// files[testName] = new Set();
|
|
761
|
-
// }
|
|
762
|
-
// files[testName].add(ssOpts.path as string);
|
|
763
|
-
// const sPromise = page.screenshot({
|
|
764
|
-
// ...ssOpts,
|
|
765
|
-
// path: p,
|
|
766
|
-
// });
|
|
767
|
-
// if (!screenshots[testName]) {
|
|
768
|
-
// screenshots[testName] = [];
|
|
769
|
-
// }
|
|
770
|
-
// screenshots[testName].push(sPromise);
|
|
771
|
-
// // sPromise.then(())
|
|
772
|
-
// await sPromise;
|
|
773
|
-
// return sPromise;
|
|
774
|
-
// // page.evaluate(`window["screenshot done"]`);
|
|
775
|
-
// };
|
|
776
873
|
globalThis["customScreenShot"] = async (opts, pageKey, testName) => {
|
|
777
874
|
const page = (await this.browser.pages()).find(
|
|
778
875
|
/* @ts-ignore:next-line */
|
|
@@ -807,16 +904,6 @@ export class PM_Main extends PM {
|
|
|
807
904
|
recorders[opts.path] = recorder;
|
|
808
905
|
return opts.path;
|
|
809
906
|
};
|
|
810
|
-
// globalThis["customclose"] = (p: string, testName: string) => {
|
|
811
|
-
// if (!files[testName]) {
|
|
812
|
-
// files[testName] = new Set();
|
|
813
|
-
// }
|
|
814
|
-
// fs.writeFileSync(
|
|
815
|
-
// p + "/manifest.json",
|
|
816
|
-
// JSON.stringify(Array.from(files[testName]))
|
|
817
|
-
// );
|
|
818
|
-
// delete files[testName];
|
|
819
|
-
// };
|
|
820
907
|
}
|
|
821
908
|
customclose() {
|
|
822
909
|
throw new Error("Method not implemented.");
|
|
@@ -928,17 +1015,122 @@ export class PM_Main extends PM {
|
|
|
928
1015
|
throw new Error("Method not implemented.");
|
|
929
1016
|
}
|
|
930
1017
|
////////////////////////////////////////////////////////////////////////////////
|
|
931
|
-
async
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
1018
|
+
async metafileOutputs(platform) {
|
|
1019
|
+
const metafile = JSON.parse(fs.readFileSync(`docs/${platform}/metafile.json`).toString()).metafile;
|
|
1020
|
+
if (!metafile)
|
|
1021
|
+
return;
|
|
1022
|
+
const outputs = metafile.outputs;
|
|
1023
|
+
Object.keys(outputs).forEach(async (k) => {
|
|
1024
|
+
const addableFiles = Object.keys(outputs[k].inputs).filter((i) => {
|
|
1025
|
+
if (!fs.existsSync(i))
|
|
1026
|
+
return false;
|
|
1027
|
+
if (i.startsWith("node_modules"))
|
|
1028
|
+
return false;
|
|
1029
|
+
return true;
|
|
1030
|
+
});
|
|
1031
|
+
const f = `${k.split(".").slice(0, -1).join(".")}/`;
|
|
1032
|
+
if (!fs.existsSync(f)) {
|
|
1033
|
+
fs.mkdirSync(f);
|
|
1034
|
+
}
|
|
1035
|
+
const entrypoint = outputs[k].entryPoint;
|
|
1036
|
+
if (entrypoint) {
|
|
1037
|
+
const changeDigest = await filesHash(addableFiles);
|
|
1038
|
+
if (changeDigest === changes[entrypoint]) {
|
|
1039
|
+
// skip
|
|
1040
|
+
}
|
|
1041
|
+
else {
|
|
1042
|
+
changes[entrypoint] = changeDigest;
|
|
1043
|
+
this.tscCheck({
|
|
1044
|
+
platform,
|
|
1045
|
+
addableFiles,
|
|
1046
|
+
entrypoint: "./" + entrypoint,
|
|
1047
|
+
});
|
|
1048
|
+
this.eslintCheck("./" + entrypoint, platform, addableFiles);
|
|
1049
|
+
this.makePrompt("./" + entrypoint, addableFiles, platform);
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
async start() {
|
|
1055
|
+
this.browser = (await puppeteer.launch({
|
|
1056
|
+
slowMo: 1,
|
|
1057
|
+
// timeout: 1,
|
|
1058
|
+
waitForInitialPage: false,
|
|
1059
|
+
executablePath:
|
|
1060
|
+
// process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
|
|
1061
|
+
"/opt/homebrew/bin/chromium",
|
|
1062
|
+
headless: true,
|
|
1063
|
+
dumpio: true,
|
|
1064
|
+
// timeout: 0,
|
|
1065
|
+
devtools: true,
|
|
1066
|
+
args: [
|
|
1067
|
+
"--auto-open-devtools-for-tabs",
|
|
1068
|
+
`--remote-debugging-port=3234`,
|
|
1069
|
+
// "--disable-features=IsolateOrigins,site-per-process",
|
|
1070
|
+
"--disable-site-isolation-trials",
|
|
1071
|
+
"--allow-insecure-localhost",
|
|
1072
|
+
"--allow-file-access-from-files",
|
|
1073
|
+
"--allow-running-insecure-content",
|
|
1074
|
+
"--disable-dev-shm-usage",
|
|
1075
|
+
"--disable-extensions",
|
|
1076
|
+
"--disable-gpu",
|
|
1077
|
+
"--disable-setuid-sandbox",
|
|
1078
|
+
"--disable-site-isolation-trials",
|
|
1079
|
+
"--disable-web-security",
|
|
1080
|
+
"--no-first-run",
|
|
1081
|
+
"--no-sandbox",
|
|
1082
|
+
"--no-startup-window",
|
|
1083
|
+
// "--no-zygote",
|
|
1084
|
+
"--reduce-security-for-testing",
|
|
1085
|
+
"--remote-allow-origins=*",
|
|
1086
|
+
"--unsafely-treat-insecure-origin-as-secure=*",
|
|
1087
|
+
// "--disable-features=IsolateOrigins",
|
|
1088
|
+
// "--remote-allow-origins=ws://localhost:3234",
|
|
1089
|
+
// "--single-process",
|
|
1090
|
+
// "--unsafely-treat-insecure-origin-as-secure",
|
|
1091
|
+
// "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
|
|
1092
|
+
// "--disk-cache-dir=/dev/null",
|
|
1093
|
+
// "--disk-cache-size=1",
|
|
1094
|
+
// "--start-maximized",
|
|
1095
|
+
],
|
|
1096
|
+
}));
|
|
1097
|
+
const { nodeEntryPoints, webEntryPoints } = getRunnables(this.configs.tests);
|
|
1098
|
+
Object.entries(nodeEntryPoints).forEach(([k, outputFile]) => {
|
|
1099
|
+
this.launchNode(k, outputFile);
|
|
1100
|
+
try {
|
|
1101
|
+
watch(outputFile, async (e, filename) => {
|
|
1102
|
+
const hash = await fileHash(outputFile);
|
|
1103
|
+
if (fileHashes[k] !== hash) {
|
|
1104
|
+
fileHashes[k] = hash;
|
|
1105
|
+
console.log(ansiC.green(ansiC.inverse(`< ${e} ${filename}`)));
|
|
1106
|
+
this.launchNode(k, outputFile);
|
|
1107
|
+
}
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
catch (e) {
|
|
1111
|
+
console.error(e);
|
|
1112
|
+
}
|
|
1113
|
+
});
|
|
1114
|
+
Object.entries(webEntryPoints).forEach(([k, outputFile]) => {
|
|
1115
|
+
this.launchWeb(k, outputFile);
|
|
1116
|
+
watch(outputFile, async (e, filename) => {
|
|
1117
|
+
const hash = await fileHash(outputFile);
|
|
1118
|
+
if (fileHashes[k] !== hash) {
|
|
1119
|
+
fileHashes[k] = hash;
|
|
1120
|
+
console.log(ansiC.green(ansiC.inverse(`< ${e} ${filename}`)));
|
|
1121
|
+
this.launchWeb(k, outputFile);
|
|
1122
|
+
}
|
|
1123
|
+
});
|
|
1124
|
+
});
|
|
1125
|
+
this.metafileOutputs("node");
|
|
1126
|
+
this.nodeMetafileWatcher = watch("docs/node/metafile.json", async (e, filename) => {
|
|
1127
|
+
console.log(ansiC.green(ansiC.inverse(`< ${e} ${filename} (node)`)));
|
|
1128
|
+
this.metafileOutputs("node");
|
|
1129
|
+
});
|
|
1130
|
+
this.metafileOutputs("web");
|
|
1131
|
+
this.webMetafileWatcher = watch("docs/web/metafile.json", async (e, filename) => {
|
|
1132
|
+
console.log(ansiC.green(ansiC.inverse(`< ${e} ${filename} (web)`)));
|
|
1133
|
+
this.metafileOutputs("web");
|
|
1134
|
+
});
|
|
943
1135
|
}
|
|
944
1136
|
}
|
|
@@ -3,6 +3,7 @@ import React, { useEffect, useState } from "react";
|
|
|
3
3
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
4
4
|
import "./style.css";
|
|
5
5
|
import { Footer } from "./Footer";
|
|
6
|
+
import { Table } from "react-bootstrap";
|
|
6
7
|
const BigBoard = () => {
|
|
7
8
|
const [configs, setConfigs] = useState();
|
|
8
9
|
useEffect(() => {
|
|
@@ -18,7 +19,7 @@ const BigBoard = () => {
|
|
|
18
19
|
const [bigBoard, setBigBoard] = useState({});
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
(async () => {
|
|
21
|
-
fetch('/kokomoBay/docs/
|
|
22
|
+
fetch('/kokomoBay/docs/summary.json')
|
|
22
23
|
.then(response => response.json())
|
|
23
24
|
.then(json => {
|
|
24
25
|
setBigBoard(json);
|
|
@@ -26,52 +27,53 @@ const BigBoard = () => {
|
|
|
26
27
|
.catch(error => console.error(error));
|
|
27
28
|
})();
|
|
28
29
|
}, []);
|
|
29
|
-
const [staticAnalysis, setStaticAnalysis] = useState({});
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}, [configs, bigBoard]);
|
|
39
|
-
const [typeErrors, setTypeErrors] = useState({});
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [configs, bigBoard]);
|
|
49
|
-
const [bddErrors, setBddErrors] = useState({});
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, [configs, bigBoard]);
|
|
59
|
-
if (!configs
|
|
30
|
+
// const [staticAnalysis, setStaticAnalysis] = useState<Record<string, string>>({});
|
|
31
|
+
// useEffect(() => {
|
|
32
|
+
// (async () => {
|
|
33
|
+
// let accumulator = {};
|
|
34
|
+
// for (const t of (configs || { tests: [] as ITestTypes[] }).tests) {
|
|
35
|
+
// accumulator[t[0]] = await (await fetch(`/kokomoBay/docs/${t[1]}/${t[0].split(".").slice(0, -1).join(".")}/lint_errors.txt`)).text()
|
|
36
|
+
// }
|
|
37
|
+
// setStaticAnalysis(accumulator);
|
|
38
|
+
// })();
|
|
39
|
+
// }, [configs, bigBoard]);
|
|
40
|
+
// const [typeErrors, setTypeErrors] = useState<Record<string, string>>({});
|
|
41
|
+
// useEffect(() => {
|
|
42
|
+
// (async () => {
|
|
43
|
+
// let accumulator = {};
|
|
44
|
+
// for (const t of (configs || { tests: [] as ITestTypes[] }).tests) {
|
|
45
|
+
// accumulator[t[0]] = await (await fetch(`/kokomoBay/docs/${t[1]}/${t[0].split(".").slice(0, -1).join(".")}/type_errors.txt`)).text()
|
|
46
|
+
// }
|
|
47
|
+
// setTypeErrors(accumulator);
|
|
48
|
+
// })();
|
|
49
|
+
// }, [configs, bigBoard]);
|
|
50
|
+
// const [bddErrors, setBddErrors] = useState<Record<string, string>>({});
|
|
51
|
+
// useEffect(() => {
|
|
52
|
+
// (async () => {
|
|
53
|
+
// let accumulator = {};
|
|
54
|
+
// for (const t of (configs || { tests: [] as ITestTypes[] }).tests) {
|
|
55
|
+
// accumulator[t[0]] = await (await fetch(`/kokomoBay/docs/${t[1]}/${t[0].split(".").slice(0, -1).join(".")}/bdd_errors.txt`)).text()
|
|
56
|
+
// }
|
|
57
|
+
// setBddErrors(accumulator);
|
|
58
|
+
// })();
|
|
59
|
+
// }, [configs, bigBoard]);
|
|
60
|
+
if (!configs) {
|
|
60
61
|
return React.createElement("div", null, "loading...");
|
|
61
62
|
}
|
|
62
63
|
const collated = configs.tests.map((c) => {
|
|
63
|
-
return Object.assign(Object.assign({}, bigBoard[c[0]]), { name: c[0], runTime: c[1], tr: c[2], sidecars: c[3], staticAnalysis:
|
|
64
|
+
return Object.assign(Object.assign({}, bigBoard[c[0]]), { name: c[0], runTime: c[1], tr: c[2], sidecars: c[3], staticAnalysis: bigBoard[c[0]].staticErrors, typeErrors: bigBoard[c[0]].typeErrors, bddErrors: bigBoard[c[0]].runTimeError, prompt: bigBoard[c[0]].prompt });
|
|
64
65
|
});
|
|
65
66
|
return React.createElement("div", null,
|
|
66
|
-
React.createElement(
|
|
67
|
-
React.createElement("
|
|
68
|
-
React.createElement("
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
React.createElement(Table, { striped: true, bordered: true, hover: true },
|
|
68
|
+
React.createElement("thead", null,
|
|
69
|
+
React.createElement("tr", null,
|
|
70
|
+
React.createElement("th", null),
|
|
71
|
+
React.createElement("th", null, "platform"),
|
|
72
|
+
React.createElement("th", null, "BDD errors"),
|
|
73
|
+
React.createElement("th", null, "Lint errors"),
|
|
74
|
+
React.createElement("th", null, "Type errors"),
|
|
75
|
+
React.createElement("th", null, "prompt"))),
|
|
76
|
+
React.createElement("tbody", null, ...collated.map((c) => {
|
|
75
77
|
return React.createElement("tr", null,
|
|
76
78
|
React.createElement("td", null, c.name),
|
|
77
79
|
React.createElement("td", null, c.runTime),
|
|
@@ -82,10 +84,8 @@ const BigBoard = () => {
|
|
|
82
84
|
React.createElement("td", null,
|
|
83
85
|
React.createElement("a", { href: `${c.runTime}/${c.name.split(".").slice(0, -1).join(".")}/type_errors.txt` }, c.typeErrors)),
|
|
84
86
|
React.createElement("td", null,
|
|
85
|
-
React.createElement("pre", null,
|
|
86
|
-
|
|
87
|
-
`docs/${c.runTime}/${c.name.split(".").slice(0, -1).join(".")}/prompt.txt`)));
|
|
88
|
-
})),
|
|
87
|
+
React.createElement("pre", null, c.prompt)));
|
|
88
|
+
}))),
|
|
89
89
|
React.createElement(Footer, null));
|
|
90
90
|
};
|
|
91
91
|
document.addEventListener("DOMContentLoaded", function () {
|