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.
Files changed (176) hide show
  1. package/package.json +1 -1
  2. package/src/PM/main.ts +418 -92
  3. package/src/ReportClient.tsx +38 -30
  4. package/src/run.ts +4 -371
  5. package/tsc.log +8 -6
  6. package/dist/common/Init.js +0 -68
  7. package/dist/common/Node.js +0 -27
  8. package/dist/common/PM/index.js +0 -7
  9. package/dist/common/PM/main.js +0 -984
  10. package/dist/common/PM/node.js +0 -128
  11. package/dist/common/PM/web.js +0 -121
  12. package/dist/common/ReportServer.js +0 -22
  13. package/dist/common/SubPackages/react/component/node.js +0 -19
  14. package/dist/common/SubPackages/react/component/web.js +0 -19
  15. package/dist/common/SubPackages/react/jsx/index.js +0 -21
  16. package/dist/common/SubPackages/react/jsx/node.js +0 -10
  17. package/dist/common/SubPackages/react/jsx/web.js +0 -10
  18. package/dist/common/SubPackages/react-dom/component/node.js +0 -88
  19. package/dist/common/SubPackages/react-dom/component/web.js +0 -67
  20. package/dist/common/SubPackages/react-dom/jsx/index.js +0 -2
  21. package/dist/common/SubPackages/react-dom/jsx/node.js +0 -39
  22. package/dist/common/SubPackages/react-dom/jsx/web.js +0 -128
  23. package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -54
  24. package/dist/common/SubPackages/react-test-renderer/component/index.js +0 -2
  25. package/dist/common/SubPackages/react-test-renderer/component/interface.js +0 -70
  26. package/dist/common/SubPackages/react-test-renderer/component/node.js +0 -8
  27. package/dist/common/SubPackages/react-test-renderer/component/web.js +0 -8
  28. package/dist/common/SubPackages/react-test-renderer/fc/node.js +0 -60
  29. package/dist/common/SubPackages/react-test-renderer/fc/web.js +0 -60
  30. package/dist/common/SubPackages/react-test-renderer/jsx/index.js +0 -67
  31. package/dist/common/SubPackages/react-test-renderer/jsx/node.js +0 -10
  32. package/dist/common/SubPackages/react-test-renderer/jsx/web.js +0 -10
  33. package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +0 -52
  34. package/dist/common/SubPackages/react-test-renderer/jsx-promised/node.js +0 -10
  35. package/dist/common/SubPackages/react-test-renderer/jsx-promised/web.js +0 -10
  36. package/dist/common/Types.js +0 -2
  37. package/dist/common/Web.js +0 -49
  38. package/dist/common/build.js +0 -222
  39. package/dist/common/defaultConfig.js +0 -20
  40. package/dist/common/esbuildConfigs/eslint-formatter-testeranto.js +0 -6
  41. package/dist/common/esbuildConfigs/featuresPlugin.js +0 -39
  42. package/dist/common/esbuildConfigs/index.js +0 -21
  43. package/dist/common/esbuildConfigs/inputFilesPlugin.js +0 -27
  44. package/dist/common/esbuildConfigs/node.js +0 -37
  45. package/dist/common/esbuildConfigs/web.js +0 -50
  46. package/dist/common/init-docs.js +0 -53
  47. package/dist/common/lib/abstractBase.js +0 -329
  48. package/dist/common/lib/basebuilder.js +0 -98
  49. package/dist/common/lib/classBuilder.js +0 -40
  50. package/dist/common/lib/core.js +0 -117
  51. package/dist/common/lib/index.js +0 -21
  52. package/dist/common/lib/types.js +0 -2
  53. package/dist/common/package.json +0 -3
  54. package/dist/common/puppeteerConfiger.js +0 -24
  55. package/dist/common/run.js +0 -297
  56. package/dist/common/tsconfig.common.tsbuildinfo +0 -1
  57. package/dist/common/utils.js +0 -43
  58. package/dist/common/web.html.js +0 -22
  59. package/dist/module/Footer.js +0 -4
  60. package/dist/module/Init.js +0 -63
  61. package/dist/module/Node.js +0 -20
  62. package/dist/module/PM/index.js +0 -3
  63. package/dist/module/PM/main.js +0 -944
  64. package/dist/module/PM/node.js +0 -121
  65. package/dist/module/PM/web.js +0 -117
  66. package/dist/module/ReportClient.js +0 -97
  67. package/dist/module/ReportServer.js +0 -17
  68. package/dist/module/SubPackages/react/component/node.js +0 -14
  69. package/dist/module/SubPackages/react/component/web.js +0 -14
  70. package/dist/module/SubPackages/react/jsx/index.js +0 -15
  71. package/dist/module/SubPackages/react/jsx/node.js +0 -5
  72. package/dist/module/SubPackages/react/jsx/web.js +0 -5
  73. package/dist/module/SubPackages/react-dom/component/node.js +0 -80
  74. package/dist/module/SubPackages/react-dom/component/web.js +0 -62
  75. package/dist/module/SubPackages/react-dom/jsx/index.js +0 -1
  76. package/dist/module/SubPackages/react-dom/jsx/node.js +0 -31
  77. package/dist/module/SubPackages/react-dom/jsx/web.js +0 -90
  78. package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -16
  79. package/dist/module/SubPackages/react-test-renderer/component/index.js +0 -1
  80. package/dist/module/SubPackages/react-test-renderer/component/interface.js +0 -31
  81. package/dist/module/SubPackages/react-test-renderer/component/node.js +0 -3
  82. package/dist/module/SubPackages/react-test-renderer/component/web.js +0 -3
  83. package/dist/module/SubPackages/react-test-renderer/fc/node.js +0 -22
  84. package/dist/module/SubPackages/react-test-renderer/fc/web.js +0 -22
  85. package/dist/module/SubPackages/react-test-renderer/jsx/index.js +0 -28
  86. package/dist/module/SubPackages/react-test-renderer/jsx/node.js +0 -5
  87. package/dist/module/SubPackages/react-test-renderer/jsx/web.js +0 -5
  88. package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +0 -16
  89. package/dist/module/SubPackages/react-test-renderer/jsx-promised/node.js +0 -5
  90. package/dist/module/SubPackages/react-test-renderer/jsx-promised/web.js +0 -5
  91. package/dist/module/TestReport.js +0 -91
  92. package/dist/module/Types.js +0 -1
  93. package/dist/module/Web.js +0 -42
  94. package/dist/module/build.js +0 -184
  95. package/dist/module/defaultConfig.js +0 -18
  96. package/dist/module/esbuildConfigs/eslint-formatter-testeranto.js +0 -3
  97. package/dist/module/esbuildConfigs/featuresPlugin.js +0 -34
  98. package/dist/module/esbuildConfigs/index.js +0 -19
  99. package/dist/module/esbuildConfigs/inputFilesPlugin.js +0 -22
  100. package/dist/module/esbuildConfigs/node.js +0 -32
  101. package/dist/module/esbuildConfigs/web.js +0 -45
  102. package/dist/module/init-docs.js +0 -15
  103. package/dist/module/lib/abstractBase.js +0 -321
  104. package/dist/module/lib/basebuilder.js +0 -94
  105. package/dist/module/lib/classBuilder.js +0 -36
  106. package/dist/module/lib/core.js +0 -114
  107. package/dist/module/lib/index.js +0 -17
  108. package/dist/module/lib/types.js +0 -1
  109. package/dist/module/package.json +0 -3
  110. package/dist/module/puppeteerConfiger.js +0 -19
  111. package/dist/module/run.js +0 -259
  112. package/dist/module/tsconfig.module.tsbuildinfo +0 -1
  113. package/dist/module/utils.js +0 -29
  114. package/dist/module/web.html.js +0 -20
  115. package/dist/prebuild/ReportClient.css +0 -11367
  116. package/dist/prebuild/ReportClient.js +0 -23641
  117. package/dist/prebuild/ReportServer.mjs +0 -16
  118. package/dist/prebuild/TestReport.css +0 -11367
  119. package/dist/prebuild/TestReport.js +0 -27484
  120. package/dist/prebuild/build.mjs +0 -376
  121. package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +0 -9
  122. package/dist/prebuild/init-docs.mjs +0 -104
  123. package/dist/prebuild/run.mjs +0 -1190
  124. package/dist/tsconfig.tsbuildinfo +0 -1
  125. package/dist/types/Init.d.ts +0 -2
  126. package/dist/types/Node.d.ts +0 -12
  127. package/dist/types/PM/index.d.ts +0 -34
  128. package/dist/types/PM/main.d.ts +0 -59
  129. package/dist/types/PM/node.d.ts +0 -40
  130. package/dist/types/PM/web.d.ts +0 -38
  131. package/dist/types/ReportServer.d.ts +0 -1
  132. package/dist/types/SubPackages/react/component/node.d.ts +0 -7
  133. package/dist/types/SubPackages/react/component/web.d.ts +0 -7
  134. package/dist/types/SubPackages/react/jsx/index.d.ts +0 -12
  135. package/dist/types/SubPackages/react/jsx/node.d.ts +0 -4
  136. package/dist/types/SubPackages/react/jsx/web.d.ts +0 -4
  137. package/dist/types/SubPackages/react-dom/component/node.d.ts +0 -11
  138. package/dist/types/SubPackages/react-dom/component/web.d.ts +0 -20
  139. package/dist/types/SubPackages/react-dom/jsx/index.d.ts +0 -6
  140. package/dist/types/SubPackages/react-dom/jsx/node.d.ts +0 -7
  141. package/dist/types/SubPackages/react-dom/jsx/web.d.ts +0 -5
  142. package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -6
  143. package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +0 -13
  144. package/dist/types/SubPackages/react-test-renderer/component/interface.d.ts +0 -9
  145. package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +0 -4
  146. package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +0 -4
  147. package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +0 -8
  148. package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +0 -9
  149. package/dist/types/SubPackages/react-test-renderer/jsx/index.d.ts +0 -16
  150. package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +0 -9
  151. package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +0 -9
  152. package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -15
  153. package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -5
  154. package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -5
  155. package/dist/types/Types.d.ts +0 -61
  156. package/dist/types/Web.d.ts +0 -9
  157. package/dist/types/build.d.ts +0 -1
  158. package/dist/types/defaultConfig.d.ts +0 -3
  159. package/dist/types/esbuildConfigs/eslint-formatter-testeranto.d.ts +0 -2
  160. package/dist/types/esbuildConfigs/featuresPlugin.d.ts +0 -5
  161. package/dist/types/esbuildConfigs/index.d.ts +0 -4
  162. package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +0 -6
  163. package/dist/types/esbuildConfigs/node.d.ts +0 -4
  164. package/dist/types/esbuildConfigs/web.d.ts +0 -4
  165. package/dist/types/init-docs.d.ts +0 -1
  166. package/dist/types/lib/abstractBase.d.ts +0 -110
  167. package/dist/types/lib/basebuilder.d.ts +0 -27
  168. package/dist/types/lib/classBuilder.d.ts +0 -7
  169. package/dist/types/lib/core.d.ts +0 -7
  170. package/dist/types/lib/index.d.ts +0 -83
  171. package/dist/types/lib/types.d.ts +0 -14
  172. package/dist/types/puppeteerConfiger.d.ts +0 -4
  173. package/dist/types/run.d.ts +0 -1
  174. package/dist/types/tsconfig.types.tsbuildinfo +0 -1
  175. package/dist/types/utils.d.ts +0 -9
  176. package/dist/types/web.html.d.ts +0 -2
@@ -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
- <table>
115
- <tr>
116
- <td>name</td>
117
- <td>run time</td>
118
- <td>BDD errors</td>
119
- <td>Lint errors</td>
120
- <td>Type errors</td>
121
- <td>prompt</td>
122
- </tr>
123
- {
124
- ...collated.map((c) => {
125
- return <tr>
126
- <td>{c.name}</td>
127
- <td>{c.runTime}</td>
128
- <td><a href={`${c.runTime}/${c.name.split(".").slice(0, -1).join(".")}/littleBoard.html`}>{c.bddErrors}</a></td>
129
- <td><a href={`${c.runTime}/${c.name.split(".").slice(0, -1).join(".")}/lint_errors.json`}>{c.staticAnalysis}</a></td>
130
- <td><a href={`${c.runTime}/${c.name.split(".").slice(0, -1).join(".")}/type_errors.txt`}>{c.typeErrors}</a></td>
131
-
132
-
133
- <td>
134
- <pre>
135
- aider --model deepseek/deepseek-chat --load {`docs/${c.runTime}/${c.name.split(".").slice(0, -1).join(".")}/prompt.txt`}
136
- </pre>
137
- </td>
138
-
139
-
140
- </tr>
141
- })
142
- }
143
- </table>
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(227,24): error TS18048: 'page' is possibly 'undefined'.
18
- src/PM/main.ts(258,9): error TS2322: Type 'string' is not assignable to type '`${string}.webm`'.
19
- src/PM/main.ts(261,17): error TS2538: Type 'undefined' cannot be used as an index type.
20
- src/PM/main.ts(300,3): error TS2416: Property 'customScreenShot' in type 'PM_Main' is not assignable to the same property in base type 'PM'.
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(735,15): error TS2345: Argument of type 'Page' is not assignable to parameter of type 'Page | PromiseLike<Page>'.
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(151,38): error TS2345: Argument of type 'FunctionComponentElement<{}>' is not assignable to parameter of type 'ReactNode'.
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'.
@@ -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
- };
@@ -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
- };
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PM = void 0;
4
- const fPaths = [];
5
- class PM {
6
- }
7
- exports.PM = PM;