testeranto 0.110.0 → 0.111.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/package.json +1 -1
- package/src/PM/main.ts +418 -92
- package/src/ReportClient.tsx +38 -30
- package/src/run.ts +4 -371
- package/tsc.log +8 -6
- package/dist/common/Init.js +0 -68
- package/dist/common/Node.js +0 -27
- package/dist/common/PM/index.js +0 -7
- package/dist/common/PM/main.js +0 -984
- package/dist/common/PM/node.js +0 -128
- package/dist/common/PM/web.js +0 -121
- package/dist/common/ReportServer.js +0 -22
- package/dist/common/SubPackages/react/component/node.js +0 -19
- package/dist/common/SubPackages/react/component/web.js +0 -19
- package/dist/common/SubPackages/react/jsx/index.js +0 -21
- package/dist/common/SubPackages/react/jsx/node.js +0 -10
- package/dist/common/SubPackages/react/jsx/web.js +0 -10
- package/dist/common/SubPackages/react-dom/component/node.js +0 -88
- package/dist/common/SubPackages/react-dom/component/web.js +0 -67
- package/dist/common/SubPackages/react-dom/jsx/index.js +0 -2
- package/dist/common/SubPackages/react-dom/jsx/node.js +0 -39
- package/dist/common/SubPackages/react-dom/jsx/web.js +0 -128
- package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -54
- package/dist/common/SubPackages/react-test-renderer/component/index.js +0 -2
- package/dist/common/SubPackages/react-test-renderer/component/interface.js +0 -70
- package/dist/common/SubPackages/react-test-renderer/component/node.js +0 -8
- package/dist/common/SubPackages/react-test-renderer/component/web.js +0 -8
- package/dist/common/SubPackages/react-test-renderer/fc/node.js +0 -60
- package/dist/common/SubPackages/react-test-renderer/fc/web.js +0 -60
- package/dist/common/SubPackages/react-test-renderer/jsx/index.js +0 -67
- package/dist/common/SubPackages/react-test-renderer/jsx/node.js +0 -10
- package/dist/common/SubPackages/react-test-renderer/jsx/web.js +0 -10
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +0 -52
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/node.js +0 -10
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/web.js +0 -10
- package/dist/common/Types.js +0 -2
- package/dist/common/Web.js +0 -49
- package/dist/common/build.js +0 -222
- package/dist/common/defaultConfig.js +0 -20
- package/dist/common/esbuildConfigs/eslint-formatter-testeranto.js +0 -6
- package/dist/common/esbuildConfigs/featuresPlugin.js +0 -39
- package/dist/common/esbuildConfigs/index.js +0 -21
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +0 -27
- package/dist/common/esbuildConfigs/node.js +0 -37
- package/dist/common/esbuildConfigs/web.js +0 -50
- package/dist/common/init-docs.js +0 -53
- package/dist/common/lib/abstractBase.js +0 -329
- package/dist/common/lib/basebuilder.js +0 -98
- package/dist/common/lib/classBuilder.js +0 -40
- package/dist/common/lib/core.js +0 -117
- package/dist/common/lib/index.js +0 -21
- package/dist/common/lib/types.js +0 -2
- package/dist/common/package.json +0 -3
- package/dist/common/puppeteerConfiger.js +0 -24
- package/dist/common/run.js +0 -297
- package/dist/common/tsconfig.common.tsbuildinfo +0 -1
- package/dist/common/utils.js +0 -43
- package/dist/common/web.html.js +0 -22
- package/dist/module/Footer.js +0 -4
- package/dist/module/Init.js +0 -63
- package/dist/module/Node.js +0 -20
- package/dist/module/PM/index.js +0 -3
- package/dist/module/PM/main.js +0 -944
- package/dist/module/PM/node.js +0 -121
- package/dist/module/PM/web.js +0 -117
- package/dist/module/ReportClient.js +0 -97
- package/dist/module/ReportServer.js +0 -17
- package/dist/module/SubPackages/react/component/node.js +0 -14
- package/dist/module/SubPackages/react/component/web.js +0 -14
- package/dist/module/SubPackages/react/jsx/index.js +0 -15
- package/dist/module/SubPackages/react/jsx/node.js +0 -5
- package/dist/module/SubPackages/react/jsx/web.js +0 -5
- package/dist/module/SubPackages/react-dom/component/node.js +0 -80
- package/dist/module/SubPackages/react-dom/component/web.js +0 -62
- package/dist/module/SubPackages/react-dom/jsx/index.js +0 -1
- package/dist/module/SubPackages/react-dom/jsx/node.js +0 -31
- package/dist/module/SubPackages/react-dom/jsx/web.js +0 -90
- package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -16
- package/dist/module/SubPackages/react-test-renderer/component/index.js +0 -1
- package/dist/module/SubPackages/react-test-renderer/component/interface.js +0 -31
- package/dist/module/SubPackages/react-test-renderer/component/node.js +0 -3
- package/dist/module/SubPackages/react-test-renderer/component/web.js +0 -3
- package/dist/module/SubPackages/react-test-renderer/fc/node.js +0 -22
- package/dist/module/SubPackages/react-test-renderer/fc/web.js +0 -22
- package/dist/module/SubPackages/react-test-renderer/jsx/index.js +0 -28
- package/dist/module/SubPackages/react-test-renderer/jsx/node.js +0 -5
- package/dist/module/SubPackages/react-test-renderer/jsx/web.js +0 -5
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +0 -16
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/node.js +0 -5
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/web.js +0 -5
- package/dist/module/TestReport.js +0 -91
- package/dist/module/Types.js +0 -1
- package/dist/module/Web.js +0 -42
- package/dist/module/build.js +0 -184
- package/dist/module/defaultConfig.js +0 -18
- package/dist/module/esbuildConfigs/eslint-formatter-testeranto.js +0 -3
- package/dist/module/esbuildConfigs/featuresPlugin.js +0 -34
- package/dist/module/esbuildConfigs/index.js +0 -19
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +0 -22
- package/dist/module/esbuildConfigs/node.js +0 -32
- package/dist/module/esbuildConfigs/web.js +0 -45
- package/dist/module/init-docs.js +0 -15
- package/dist/module/lib/abstractBase.js +0 -321
- package/dist/module/lib/basebuilder.js +0 -94
- package/dist/module/lib/classBuilder.js +0 -36
- package/dist/module/lib/core.js +0 -114
- package/dist/module/lib/index.js +0 -17
- package/dist/module/lib/types.js +0 -1
- package/dist/module/package.json +0 -3
- package/dist/module/puppeteerConfiger.js +0 -19
- package/dist/module/run.js +0 -259
- package/dist/module/tsconfig.module.tsbuildinfo +0 -1
- package/dist/module/utils.js +0 -29
- package/dist/module/web.html.js +0 -20
- package/dist/prebuild/ReportClient.css +0 -11367
- package/dist/prebuild/ReportClient.js +0 -23641
- package/dist/prebuild/ReportServer.mjs +0 -16
- package/dist/prebuild/TestReport.css +0 -11367
- package/dist/prebuild/TestReport.js +0 -27484
- package/dist/prebuild/build.mjs +0 -376
- package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +0 -9
- package/dist/prebuild/init-docs.mjs +0 -104
- package/dist/prebuild/run.mjs +0 -1190
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types/Init.d.ts +0 -2
- package/dist/types/Node.d.ts +0 -12
- package/dist/types/PM/index.d.ts +0 -34
- package/dist/types/PM/main.d.ts +0 -59
- package/dist/types/PM/node.d.ts +0 -40
- package/dist/types/PM/web.d.ts +0 -38
- package/dist/types/ReportServer.d.ts +0 -1
- package/dist/types/SubPackages/react/component/node.d.ts +0 -7
- package/dist/types/SubPackages/react/component/web.d.ts +0 -7
- package/dist/types/SubPackages/react/jsx/index.d.ts +0 -12
- package/dist/types/SubPackages/react/jsx/node.d.ts +0 -4
- package/dist/types/SubPackages/react/jsx/web.d.ts +0 -4
- package/dist/types/SubPackages/react-dom/component/node.d.ts +0 -11
- package/dist/types/SubPackages/react-dom/component/web.d.ts +0 -20
- package/dist/types/SubPackages/react-dom/jsx/index.d.ts +0 -6
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +0 -7
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -6
- package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +0 -13
- package/dist/types/SubPackages/react-test-renderer/component/interface.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +0 -4
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +0 -4
- package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +0 -8
- package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/jsx/index.d.ts +0 -16
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -15
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -5
- package/dist/types/Types.d.ts +0 -61
- package/dist/types/Web.d.ts +0 -9
- package/dist/types/build.d.ts +0 -1
- package/dist/types/defaultConfig.d.ts +0 -3
- package/dist/types/esbuildConfigs/eslint-formatter-testeranto.d.ts +0 -2
- package/dist/types/esbuildConfigs/featuresPlugin.d.ts +0 -5
- package/dist/types/esbuildConfigs/index.d.ts +0 -4
- package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +0 -6
- package/dist/types/esbuildConfigs/node.d.ts +0 -4
- package/dist/types/esbuildConfigs/web.d.ts +0 -4
- package/dist/types/init-docs.d.ts +0 -1
- package/dist/types/lib/abstractBase.d.ts +0 -110
- package/dist/types/lib/basebuilder.d.ts +0 -27
- package/dist/types/lib/classBuilder.d.ts +0 -7
- package/dist/types/lib/core.d.ts +0 -7
- package/dist/types/lib/index.d.ts +0 -83
- package/dist/types/lib/types.d.ts +0 -14
- package/dist/types/puppeteerConfiger.d.ts +0 -4
- package/dist/types/run.d.ts +0 -1
- package/dist/types/tsconfig.types.tsbuildinfo +0 -1
- package/dist/types/utils.d.ts +0 -9
- package/dist/types/web.html.d.ts +0 -2
package/src/ReportClient.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import "./style.css"
|
|
|
6
6
|
|
|
7
7
|
import { IRunTime, ITestTypes, IBuiltConfig } from "./lib";
|
|
8
8
|
import { Footer } from "./Footer";
|
|
9
|
+
import { Table } from "react-bootstrap";
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
type ICollation = {
|
|
@@ -111,36 +112,43 @@ const BigBoard = () => {
|
|
|
111
112
|
});
|
|
112
113
|
|
|
113
114
|
return <div >
|
|
114
|
-
<
|
|
115
|
-
<
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
115
|
+
<Table striped bordered hover>
|
|
116
|
+
<thead>
|
|
117
|
+
<tr>
|
|
118
|
+
<th></th>
|
|
119
|
+
<th>platform</th>
|
|
120
|
+
<th>BDD errors</th>
|
|
121
|
+
<th>Lint errors</th>
|
|
122
|
+
<th>Type errors</th>
|
|
123
|
+
<th>prompt</th>
|
|
124
|
+
</tr>
|
|
125
|
+
|
|
126
|
+
</thead>
|
|
127
|
+
|
|
128
|
+
<tbody>
|
|
129
|
+
{
|
|
130
|
+
...collated.map((c) => {
|
|
131
|
+
return <tr>
|
|
132
|
+
<td>{c.name}</td>
|
|
133
|
+
<td>{c.runTime}</td>
|
|
134
|
+
<td><a href={`${c.runTime}/${c.name.split(".").slice(0, -1).join(".")}/littleBoard.html`}>{c.bddErrors}</a></td>
|
|
135
|
+
<td><a href={`${c.runTime}/${c.name.split(".").slice(0, -1).join(".")}/lint_errors.json`}>{c.staticAnalysis}</a></td>
|
|
136
|
+
<td><a href={`${c.runTime}/${c.name.split(".").slice(0, -1).join(".")}/type_errors.txt`}>{c.typeErrors}</a></td>
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
<td>
|
|
140
|
+
<pre>
|
|
141
|
+
aider --model deepseek/deepseek-chat --load {`docs/${c.runTime}/${c.name.split(".").slice(0, -1).join(".")}/prompt.txt`}
|
|
142
|
+
</pre>
|
|
143
|
+
</td>
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
</tr>
|
|
147
|
+
})
|
|
148
|
+
}
|
|
149
|
+
</tbody>
|
|
150
|
+
|
|
151
|
+
</Table>
|
|
144
152
|
<Footer />
|
|
145
153
|
</div>
|
|
146
154
|
}
|
package/src/run.ts
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import ansiC from "ansi-colors";
|
|
2
|
-
import { watch } from "fs";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import crypto from "node:crypto";
|
|
5
|
-
import fs from "fs";
|
|
6
|
-
import tsc from "tsc-prog";
|
|
7
|
-
import { ESLint } from "eslint";
|
|
8
|
-
import ts from "typescript";
|
|
9
2
|
import readline from "readline";
|
|
10
3
|
|
|
11
4
|
import { PM_Main } from "./PM/main";
|
|
12
|
-
import {
|
|
13
|
-
lintExitCodePather,
|
|
14
|
-
lintPather,
|
|
15
|
-
tscExitCodePather,
|
|
16
|
-
tscPather,
|
|
17
|
-
} from "./utils";
|
|
18
|
-
import { IBaseConfig, IBuiltConfig, IRunnables, ITestTypes } from "./lib";
|
|
5
|
+
import { IBaseConfig, IBuiltConfig } from "./lib";
|
|
19
6
|
|
|
20
7
|
console.log(ansiC.inverse("Press 'x' to shutdown forcefully."));
|
|
21
8
|
|
|
@@ -29,245 +16,6 @@ process.stdin.on("keypress", (str, key) => {
|
|
|
29
16
|
}
|
|
30
17
|
});
|
|
31
18
|
|
|
32
|
-
async function fileHash(filePath, algorithm = "md5") {
|
|
33
|
-
return new Promise<string>((resolve, reject) => {
|
|
34
|
-
const hash = crypto.createHash(algorithm);
|
|
35
|
-
const fileStream = fs.createReadStream(filePath);
|
|
36
|
-
|
|
37
|
-
fileStream.on("data", (data) => {
|
|
38
|
-
hash.update(data);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
fileStream.on("end", () => {
|
|
42
|
-
const fileHash = hash.digest("hex");
|
|
43
|
-
resolve(fileHash);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
fileStream.on("error", (error) => {
|
|
47
|
-
reject(`Error reading file: ${error.message}`);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async function filesHash(files: string[], algorithm = "md5") {
|
|
53
|
-
return new Promise<string>((resolve, reject) => {
|
|
54
|
-
resolve(
|
|
55
|
-
files.reduce(async (mm: Promise<string>, f) => {
|
|
56
|
-
return (await mm) + (await fileHash(f));
|
|
57
|
-
}, Promise.resolve(""))
|
|
58
|
-
);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
const getRunnables = (
|
|
62
|
-
tests: ITestTypes[],
|
|
63
|
-
payload = {
|
|
64
|
-
nodeEntryPoints: {},
|
|
65
|
-
webEntryPoints: {},
|
|
66
|
-
}
|
|
67
|
-
): IRunnables => {
|
|
68
|
-
return tests.reduce((pt, cv, cndx, cry) => {
|
|
69
|
-
if (cv[1] === "node") {
|
|
70
|
-
pt.nodeEntryPoints[cv[0]] = path.resolve(
|
|
71
|
-
`./docs/node/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
|
|
72
|
-
);
|
|
73
|
-
} else if (cv[1] === "web") {
|
|
74
|
-
pt.webEntryPoints[cv[0]] = path.resolve(
|
|
75
|
-
`./docs/web/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (cv[3].length) {
|
|
80
|
-
getRunnables(cv[3], payload);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return pt;
|
|
84
|
-
}, payload as IRunnables);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const changes: Record<string, string> = {};
|
|
88
|
-
|
|
89
|
-
const tscCheck = async ({
|
|
90
|
-
entrypoint,
|
|
91
|
-
addableFiles,
|
|
92
|
-
platform,
|
|
93
|
-
}: {
|
|
94
|
-
platform: "web" | "node";
|
|
95
|
-
entrypoint: string;
|
|
96
|
-
addableFiles: string[];
|
|
97
|
-
}) => {
|
|
98
|
-
console.log(ansiC.green(ansiC.inverse(`tsc < ${entrypoint}`)));
|
|
99
|
-
const program = tsc.createProgramFromConfig({
|
|
100
|
-
basePath: process.cwd(), // always required, used for relative paths
|
|
101
|
-
configFilePath: "tsconfig.json", // config to inherit from (optional)
|
|
102
|
-
compilerOptions: {
|
|
103
|
-
rootDir: "src",
|
|
104
|
-
outDir: tscPather(entrypoint, platform),
|
|
105
|
-
// declaration: true,
|
|
106
|
-
// skipLibCheck: true,
|
|
107
|
-
noEmit: true,
|
|
108
|
-
},
|
|
109
|
-
include: addableFiles, //["src/**/*"],
|
|
110
|
-
// exclude: ["**/*.test.ts", "**/*.spec.ts"],
|
|
111
|
-
});
|
|
112
|
-
const tscPath = tscPather(entrypoint, platform);
|
|
113
|
-
|
|
114
|
-
let allDiagnostics = program.getSemanticDiagnostics();
|
|
115
|
-
|
|
116
|
-
const d: string[] = [];
|
|
117
|
-
allDiagnostics.forEach((diagnostic) => {
|
|
118
|
-
if (diagnostic.file) {
|
|
119
|
-
let { line, character } = ts.getLineAndCharacterOfPosition(
|
|
120
|
-
diagnostic.file,
|
|
121
|
-
diagnostic.start!
|
|
122
|
-
);
|
|
123
|
-
let message = ts.flattenDiagnosticMessageText(
|
|
124
|
-
diagnostic.messageText,
|
|
125
|
-
"\n"
|
|
126
|
-
);
|
|
127
|
-
d.push(
|
|
128
|
-
`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`
|
|
129
|
-
);
|
|
130
|
-
} else {
|
|
131
|
-
d.push(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"));
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
fs.writeFileSync(tscPath, d.join("\n"));
|
|
136
|
-
fs.writeFileSync(
|
|
137
|
-
tscExitCodePather(entrypoint, platform),
|
|
138
|
-
d.length.toString()
|
|
139
|
-
);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
const eslint = new ESLint();
|
|
143
|
-
const formatter = await eslint.loadFormatter(
|
|
144
|
-
"./node_modules/testeranto/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs"
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
const eslintCheck = async (
|
|
148
|
-
entrypoint: string,
|
|
149
|
-
platform: "web" | "node",
|
|
150
|
-
addableFiles: string[]
|
|
151
|
-
) => {
|
|
152
|
-
console.log(ansiC.green(ansiC.inverse(`eslint < ${entrypoint}`)));
|
|
153
|
-
const results = (await eslint.lintFiles(addableFiles))
|
|
154
|
-
.filter((r) => r.messages.length)
|
|
155
|
-
.filter((r) => {
|
|
156
|
-
return r.messages[0].ruleId !== null;
|
|
157
|
-
})
|
|
158
|
-
.map((r) => {
|
|
159
|
-
delete r.source;
|
|
160
|
-
return r;
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
fs.writeFileSync(
|
|
164
|
-
lintPather(entrypoint, platform),
|
|
165
|
-
await formatter.format(results)
|
|
166
|
-
);
|
|
167
|
-
fs.writeFileSync(
|
|
168
|
-
lintExitCodePather(entrypoint, platform),
|
|
169
|
-
results.length.toString()
|
|
170
|
-
);
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
const makePrompt = async (
|
|
174
|
-
entryPoint: string,
|
|
175
|
-
addableFiles: string[],
|
|
176
|
-
platform: "web" | "node"
|
|
177
|
-
) => {
|
|
178
|
-
const promptPath = path.join(
|
|
179
|
-
"./docs/",
|
|
180
|
-
platform,
|
|
181
|
-
entryPoint.split(".").slice(0, -1).join("."),
|
|
182
|
-
`prompt.txt`
|
|
183
|
-
);
|
|
184
|
-
|
|
185
|
-
const testPaths = path.join(
|
|
186
|
-
"./docs/",
|
|
187
|
-
platform,
|
|
188
|
-
entryPoint.split(".").slice(0, -1).join("."),
|
|
189
|
-
`tests.json`
|
|
190
|
-
);
|
|
191
|
-
|
|
192
|
-
const featuresPath = path.join(
|
|
193
|
-
"./docs/",
|
|
194
|
-
platform,
|
|
195
|
-
entryPoint.split(".").slice(0, -1).join("."),
|
|
196
|
-
`featurePrompt.txt`
|
|
197
|
-
);
|
|
198
|
-
|
|
199
|
-
fs.writeFileSync(
|
|
200
|
-
promptPath,
|
|
201
|
-
`
|
|
202
|
-
${addableFiles
|
|
203
|
-
.map((x) => {
|
|
204
|
-
return `/add ${x}`;
|
|
205
|
-
})
|
|
206
|
-
.join("\n")}
|
|
207
|
-
|
|
208
|
-
/read ${lintPather(entryPoint, platform)}
|
|
209
|
-
/read ${tscPather(entryPoint, platform)}
|
|
210
|
-
/read ${testPaths}
|
|
211
|
-
|
|
212
|
-
/load ${featuresPath}
|
|
213
|
-
|
|
214
|
-
/code Fix the failing tests described in ${testPaths}. Correct any type signature errors described in the files ${tscPather(
|
|
215
|
-
entryPoint,
|
|
216
|
-
platform
|
|
217
|
-
)}. Implement any method which throws "Function not implemented. Resolve the lint errors described in ${lintPather(
|
|
218
|
-
entryPoint,
|
|
219
|
-
platform
|
|
220
|
-
)}"
|
|
221
|
-
`
|
|
222
|
-
);
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
type IOutputs = Record<
|
|
226
|
-
string,
|
|
227
|
-
{
|
|
228
|
-
entryPoint: string;
|
|
229
|
-
inputs: Record<string, string>;
|
|
230
|
-
}
|
|
231
|
-
>;
|
|
232
|
-
|
|
233
|
-
const metafileOutputs = async (platform: "web" | "node") => {
|
|
234
|
-
const metafile = JSON.parse(
|
|
235
|
-
fs.readFileSync(`docs/${platform}/metafile.json`).toString()
|
|
236
|
-
).metafile;
|
|
237
|
-
|
|
238
|
-
if (!metafile) return;
|
|
239
|
-
|
|
240
|
-
const outputs: IOutputs = metafile.outputs;
|
|
241
|
-
|
|
242
|
-
Object.keys(outputs).forEach(async (k) => {
|
|
243
|
-
const addableFiles = Object.keys(outputs[k].inputs).filter((i) => {
|
|
244
|
-
if (!fs.existsSync(i)) return false;
|
|
245
|
-
if (i.startsWith("node_modules")) return false;
|
|
246
|
-
return true;
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
const f = `${k.split(".").slice(0, -1).join(".")}/`;
|
|
250
|
-
if (!fs.existsSync(f)) {
|
|
251
|
-
fs.mkdirSync(f);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
const entrypoint = outputs[k].entryPoint;
|
|
255
|
-
|
|
256
|
-
if (entrypoint) {
|
|
257
|
-
const changeDigest = await filesHash(addableFiles);
|
|
258
|
-
|
|
259
|
-
if (changeDigest === changes[entrypoint]) {
|
|
260
|
-
// skip
|
|
261
|
-
} else {
|
|
262
|
-
changes[entrypoint] = changeDigest;
|
|
263
|
-
tscCheck({ platform, addableFiles, entrypoint });
|
|
264
|
-
eslintCheck(entrypoint, platform, addableFiles);
|
|
265
|
-
makePrompt(entrypoint, addableFiles, platform);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
};
|
|
270
|
-
|
|
271
19
|
import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
272
20
|
const rawConfig: IBaseConfig = module.default;
|
|
273
21
|
|
|
@@ -276,123 +24,8 @@ import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
|
276
24
|
buildDir: process.cwd() + "/" + rawConfig.outdir,
|
|
277
25
|
};
|
|
278
26
|
|
|
279
|
-
let mode = config.devMode ? "DEV" : "PROD";
|
|
280
|
-
const fileHashes = {};
|
|
27
|
+
// let mode = config.devMode ? "DEV" : "PROD";
|
|
28
|
+
// const fileHashes = {};
|
|
281
29
|
let pm: PM_Main | undefined = new PM_Main(config);
|
|
282
|
-
|
|
283
|
-
console.log(ansiC.inverse(`Press 'q' to shutdown gracefully`));
|
|
284
|
-
process.stdin.on("keypress", (str, key) => {
|
|
285
|
-
if (key.name === "q") {
|
|
286
|
-
console.log(
|
|
287
|
-
ansiC.inverse("Testeranto-Run is shutting down gracefully...")
|
|
288
|
-
);
|
|
289
|
-
mode = "PROD";
|
|
290
|
-
// onDone();
|
|
291
|
-
nodeMetafileWatcher.close();
|
|
292
|
-
webMetafileWatcher.close();
|
|
293
|
-
pm.shutDown();
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
metafileOutputs("node");
|
|
298
|
-
const nodeMetafileWatcher = watch(
|
|
299
|
-
"docs/node/metafile.json",
|
|
300
|
-
async (e, filename) => {
|
|
301
|
-
console.log(ansiC.green(ansiC.inverse(`< ${e} ${filename} (node)`)));
|
|
302
|
-
metafileOutputs("node");
|
|
303
|
-
}
|
|
304
|
-
);
|
|
305
|
-
|
|
306
|
-
metafileOutputs("web");
|
|
307
|
-
const webMetafileWatcher = watch(
|
|
308
|
-
"docs/web/metafile.json",
|
|
309
|
-
async (e, filename) => {
|
|
310
|
-
console.log(ansiC.green(ansiC.inverse(`< ${e} ${filename} (web)`)));
|
|
311
|
-
metafileOutputs("web");
|
|
312
|
-
}
|
|
313
|
-
);
|
|
314
|
-
|
|
315
|
-
await pm.startPuppeteer(
|
|
316
|
-
{
|
|
317
|
-
slowMo: 1,
|
|
318
|
-
// timeout: 1,
|
|
319
|
-
waitForInitialPage: false,
|
|
320
|
-
executablePath:
|
|
321
|
-
// process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
|
|
322
|
-
"/opt/homebrew/bin/chromium",
|
|
323
|
-
headless: true,
|
|
324
|
-
dumpio: true,
|
|
325
|
-
// timeout: 0,
|
|
326
|
-
devtools: true,
|
|
327
|
-
|
|
328
|
-
args: [
|
|
329
|
-
"--auto-open-devtools-for-tabs",
|
|
330
|
-
`--remote-debugging-port=3234`,
|
|
331
|
-
|
|
332
|
-
// "--disable-features=IsolateOrigins,site-per-process",
|
|
333
|
-
"--disable-site-isolation-trials",
|
|
334
|
-
"--allow-insecure-localhost",
|
|
335
|
-
"--allow-file-access-from-files",
|
|
336
|
-
"--allow-running-insecure-content",
|
|
337
|
-
|
|
338
|
-
"--disable-dev-shm-usage",
|
|
339
|
-
"--disable-extensions",
|
|
340
|
-
"--disable-gpu",
|
|
341
|
-
"--disable-setuid-sandbox",
|
|
342
|
-
"--disable-site-isolation-trials",
|
|
343
|
-
"--disable-web-security",
|
|
344
|
-
"--no-first-run",
|
|
345
|
-
"--no-sandbox",
|
|
346
|
-
"--no-startup-window",
|
|
347
|
-
// "--no-zygote",
|
|
348
|
-
"--reduce-security-for-testing",
|
|
349
|
-
"--remote-allow-origins=*",
|
|
350
|
-
"--unsafely-treat-insecure-origin-as-secure=*",
|
|
351
|
-
// "--disable-features=IsolateOrigins",
|
|
352
|
-
// "--remote-allow-origins=ws://localhost:3234",
|
|
353
|
-
// "--single-process",
|
|
354
|
-
// "--unsafely-treat-insecure-origin-as-secure",
|
|
355
|
-
// "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
|
|
356
|
-
|
|
357
|
-
// "--disk-cache-dir=/dev/null",
|
|
358
|
-
// "--disk-cache-size=1",
|
|
359
|
-
// "--start-maximized",
|
|
360
|
-
],
|
|
361
|
-
},
|
|
362
|
-
"."
|
|
363
|
-
);
|
|
364
|
-
|
|
365
|
-
const { nodeEntryPoints, webEntryPoints } = getRunnables(config.tests);
|
|
366
|
-
|
|
367
|
-
Object.entries(nodeEntryPoints).forEach(
|
|
368
|
-
([k, outputFile]: [string, string]) => {
|
|
369
|
-
pm.launchNode(k, outputFile);
|
|
370
|
-
try {
|
|
371
|
-
watch(outputFile, async (e, filename) => {
|
|
372
|
-
const hash = await fileHash(outputFile);
|
|
373
|
-
if (fileHashes[k] !== hash) {
|
|
374
|
-
fileHashes[k] = hash;
|
|
375
|
-
console.log(ansiC.green(ansiC.inverse(`< ${e} ${filename}`)));
|
|
376
|
-
pm.launchNode(k, outputFile);
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
} catch (e) {
|
|
380
|
-
console.error(e);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
);
|
|
384
|
-
|
|
385
|
-
Object.entries(webEntryPoints).forEach(
|
|
386
|
-
([k, outputFile]: [string, string]) => {
|
|
387
|
-
pm.launchWeb(k, outputFile);
|
|
388
|
-
watch(outputFile, async (e, filename) => {
|
|
389
|
-
const hash = await fileHash(outputFile);
|
|
390
|
-
if (fileHashes[k] !== hash) {
|
|
391
|
-
fileHashes[k] = hash;
|
|
392
|
-
console.log(ansiC.green(ansiC.inverse(`< ${e} ${filename}`)));
|
|
393
|
-
pm.launchWeb(k, outputFile);
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
);
|
|
30
|
+
pm.start();
|
|
398
31
|
});
|
package/tsc.log
CHANGED
|
@@ -14,15 +14,17 @@ src/Node.ts(58,56): error TS2345: Argument of type 'PM_Node' is not assignable t
|
|
|
14
14
|
Types of parameters 'cdpPage' and 'page' are incompatible.
|
|
15
15
|
Type 'string | undefined' is not assignable to type 'CdpPage'.
|
|
16
16
|
Type 'undefined' is not assignable to type 'CdpPage'.
|
|
17
|
-
src/PM/main.ts(
|
|
18
|
-
src/PM/main.ts(
|
|
19
|
-
src/PM/main.ts(
|
|
20
|
-
src/PM/main.ts(
|
|
17
|
+
src/PM/main.ts(292,24): error TS18048: 'page' is possibly 'undefined'.
|
|
18
|
+
src/PM/main.ts(323,9): error TS2322: Type 'string' is not assignable to type '`${string}.webm`'.
|
|
19
|
+
src/PM/main.ts(326,17): error TS2538: Type 'undefined' cannot be used as an index type.
|
|
20
|
+
src/PM/main.ts(363,3): error TS2416: Property 'customScreenShot' in type 'PM_Main' is not assignable to the same property in base type 'PM'.
|
|
21
21
|
Type '(opts: object, cdpPage?: CdpPage | undefined) => void' is not assignable to type '(opts: object, page?: string | undefined) => any'.
|
|
22
22
|
Types of parameters 'cdpPage' and 'page' are incompatible.
|
|
23
23
|
Type 'string | undefined' is not assignable to type 'CdpPage | undefined'.
|
|
24
24
|
Type 'string' is not assignable to type 'CdpPage'.
|
|
25
|
-
src/PM/main.ts(
|
|
25
|
+
src/PM/main.ts(800,24): error TS2339: Property 'status' does not exist on type '{ runTimeError?: number | "?" | undefined; typeErrors?: number | "?" | undefined; staticErrors?: number | "?" | undefined; prompt?: string | undefined; }'.
|
|
26
|
+
src/PM/main.ts(804,24): error TS2339: Property 'status' does not exist on type '{ runTimeError?: number | "?" | undefined; typeErrors?: number | "?" | undefined; staticErrors?: number | "?" | undefined; prompt?: string | undefined; }'.
|
|
27
|
+
src/PM/main.ts(1063,15): error TS2345: Argument of type 'Page' is not assignable to parameter of type 'Page | PromiseLike<Page>'.
|
|
26
28
|
Type 'import("/Users/adam/Code/testeranto/node_modules/puppeteer-core/lib/types").Page' is not assignable to type 'import("/Users/adam/Code/testeranto/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page").Page'.
|
|
27
29
|
Property '#private' in type 'Page' refers to a different member that cannot be accessed from within type 'Page'.
|
|
28
30
|
src/PM/node.ts(88,3): error TS2416: Property 'customScreenShot' in type 'PM_Node' is not assignable to the same property in base type 'PM'.
|
|
@@ -30,7 +32,7 @@ src/PM/node.ts(88,3): error TS2416: Property 'customScreenShot' in type 'PM_Node
|
|
|
30
32
|
Types of parameters 'cdpPage' and 'page' are incompatible.
|
|
31
33
|
Type 'string | undefined' is not assignable to type 'CdpPage'.
|
|
32
34
|
Type 'undefined' is not assignable to type 'CdpPage'.
|
|
33
|
-
src/ReportClient.tsx(
|
|
35
|
+
src/ReportClient.tsx(159,38): error TS2345: Argument of type 'FunctionComponentElement<{}>' is not assignable to parameter of type 'ReactNode'.
|
|
34
36
|
Property 'children' is missing in type 'FunctionComponentElement<{}>' but required in type 'ReactPortal'.
|
|
35
37
|
src/SubPackages/react-dom/component/web.ts(90,13): error TS2345: Argument of type 'CElement<any, TesterantoComponent>' is not assignable to parameter of type 'ReactNode'.
|
|
36
38
|
Property 'children' is missing in type 'ComponentElement<any, TesterantoComponent>' but required in type 'ReactPortal'.
|
package/dist/common/Init.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_1 = __importDefault(require("fs"));
|
|
7
|
-
exports.default = async (partialConfig) => {
|
|
8
|
-
const config = Object.assign(Object.assign({}, partialConfig), { buildDir: process.cwd() + "/" + partialConfig.outdir });
|
|
9
|
-
try {
|
|
10
|
-
fs_1.default.mkdirSync(`${process.cwd()}/${config.outdir}`);
|
|
11
|
-
}
|
|
12
|
-
catch (_a) {
|
|
13
|
-
// console.log()
|
|
14
|
-
}
|
|
15
|
-
fs_1.default.writeFileSync(`${config.outdir}/index.html`, `
|
|
16
|
-
<!DOCTYPE html>
|
|
17
|
-
<html lang="en">
|
|
18
|
-
|
|
19
|
-
<head>
|
|
20
|
-
<meta name="description" content="Webpage description goes here" />
|
|
21
|
-
<meta charset="utf-8" />
|
|
22
|
-
<title>kokomoBay - testeranto</title>
|
|
23
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
24
|
-
<meta name="author" content="" />
|
|
25
|
-
|
|
26
|
-
<link rel="stylesheet" href="/kokomoBay/docs/ReportClient.css" />
|
|
27
|
-
<script type="module" src="/kokomoBay/docs/ReportClient.js"></script>
|
|
28
|
-
|
|
29
|
-
</head>
|
|
30
|
-
|
|
31
|
-
<body>
|
|
32
|
-
<div id="root">
|
|
33
|
-
react is loading
|
|
34
|
-
</div>
|
|
35
|
-
</body>
|
|
36
|
-
|
|
37
|
-
</html>
|
|
38
|
-
`);
|
|
39
|
-
fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/ReportClient.js`, `${config.outdir}/ReportClient.js`);
|
|
40
|
-
fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/ReportClient.css`, `${config.outdir}/ReportClient.css`);
|
|
41
|
-
fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/TestReport.js`, `${config.outdir}/TestReport.js`);
|
|
42
|
-
fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/TestReport.css`, `${config.outdir}/TestReport.css`);
|
|
43
|
-
fs_1.default.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
|
|
44
|
-
try {
|
|
45
|
-
fs_1.default.mkdirSync(`${process.cwd()}/${config.outdir}/node`);
|
|
46
|
-
}
|
|
47
|
-
catch (_b) {
|
|
48
|
-
// console.log()
|
|
49
|
-
}
|
|
50
|
-
try {
|
|
51
|
-
fs_1.default.mkdirSync(`${process.cwd()}/${config.outdir}/web`);
|
|
52
|
-
}
|
|
53
|
-
catch (_c) {
|
|
54
|
-
// console.log()
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
fs_1.default.mkdirSync(`${process.cwd()}/${config.outdir}/features`);
|
|
58
|
-
}
|
|
59
|
-
catch (_d) {
|
|
60
|
-
// console.log()
|
|
61
|
-
}
|
|
62
|
-
try {
|
|
63
|
-
fs_1.default.mkdirSync(`${process.cwd()}/${config.outdir}/ts`);
|
|
64
|
-
}
|
|
65
|
-
catch (_e) {
|
|
66
|
-
// console.log()
|
|
67
|
-
}
|
|
68
|
-
};
|
package/dist/common/Node.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.NodeTesteranto = void 0;
|
|
7
|
-
const core_js_1 = __importDefault(require("./lib/core.js"));
|
|
8
|
-
const index_js_1 = require("./lib/index.js");
|
|
9
|
-
const node_js_1 = require("./PM/node.js");
|
|
10
|
-
class NodeTesteranto extends core_js_1.default {
|
|
11
|
-
constructor(input, testSpecification, testImplementation, testResourceRequirement, testInterface) {
|
|
12
|
-
super(input, testSpecification, testImplementation, testResourceRequirement, testInterface, () => {
|
|
13
|
-
// no-op
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
async receiveTestResourceConfig(partialTestResource) {
|
|
17
|
-
const t = JSON.parse(partialTestResource);
|
|
18
|
-
const pm = new node_js_1.PM_Node(t);
|
|
19
|
-
const { failed, artifacts, logPromise, features } = await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
20
|
-
// pm.customclose();
|
|
21
|
-
return { features, failed };
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.NodeTesteranto = NodeTesteranto;
|
|
25
|
-
exports.default = async (input, testSpecification, testImplementation, testInterface, testResourceRequirement = index_js_1.defaultTestResourceRequirement) => {
|
|
26
|
-
return new NodeTesteranto(input, testSpecification, testImplementation, testResourceRequirement, testInterface);
|
|
27
|
-
};
|