testeranto 0.100.0 → 0.110.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 (285) hide show
  1. package/README.md +1 -0
  2. package/bundle.js +80 -30
  3. package/dist/common/{dist/module/src/Init.js → Init.js} +28 -0
  4. package/dist/common/{src/PM → PM}/main.js +138 -95
  5. package/dist/common/ReportServer.js +22 -0
  6. package/dist/common/{src/SubPackages → SubPackages}/react/jsx/index.js +0 -12
  7. package/dist/common/{src/SubPackages → SubPackages}/react-dom/component/node.js +3 -16
  8. package/dist/common/{src/SubPackages → SubPackages}/react-dom/component/web.js +3 -3
  9. package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/node.js +1 -1
  10. package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/web.js +41 -30
  11. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +17 -7
  12. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.js +17 -7
  13. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/fc/node.js +17 -7
  14. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/fc/web.js +17 -7
  15. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/index.js +18 -14
  16. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +17 -7
  17. package/dist/common/build.js +222 -0
  18. package/dist/common/{src/defaultConfig.js → defaultConfig.js} +1 -0
  19. package/dist/common/esbuildConfigs/eslint-formatter-testeranto.js +6 -0
  20. package/dist/common/esbuildConfigs/inputFilesPlugin.js +27 -0
  21. package/dist/common/{src/esbuildConfigs → esbuildConfigs}/node.js +2 -10
  22. package/dist/common/{src/esbuildConfigs → esbuildConfigs}/web.js +2 -13
  23. package/dist/common/{src/init-docs.js → init-docs.js} +20 -10
  24. package/dist/common/{src/lib → lib}/abstractBase.js +6 -1
  25. package/dist/common/{src/lib → lib}/basebuilder.js +23 -10
  26. package/dist/common/{src/lib → lib}/classBuilder.js +1 -3
  27. package/dist/common/{src/lib → lib}/core.js +26 -10
  28. package/dist/common/{src/lib → lib}/index.js +0 -1
  29. package/dist/common/{src/lib → lib}/types.js +0 -1
  30. package/dist/common/run.js +297 -0
  31. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  32. package/dist/common/utils.js +43 -0
  33. package/dist/module/Footer.js +4 -0
  34. package/dist/module/Init.js +63 -0
  35. package/dist/module/{src/PM → PM}/main.js +119 -86
  36. package/dist/module/ReportClient.js +97 -0
  37. package/dist/module/ReportServer.js +17 -0
  38. package/dist/module/SubPackages/react/jsx/index.js +15 -0
  39. package/dist/module/{src/SubPackages → SubPackages}/react-dom/component/node.js +3 -16
  40. package/dist/module/{src/SubPackages → SubPackages}/react-dom/component/web.js +3 -3
  41. package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/node.js +3 -3
  42. package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/web.js +24 -23
  43. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/index.js +1 -7
  44. package/dist/module/TestReport.js +91 -0
  45. package/dist/module/build.js +184 -0
  46. package/dist/module/{src/defaultConfig.js → defaultConfig.js} +1 -0
  47. package/dist/module/esbuildConfigs/eslint-formatter-testeranto.js +3 -0
  48. package/dist/module/esbuildConfigs/inputFilesPlugin.js +22 -0
  49. package/dist/module/{src/esbuildConfigs → esbuildConfigs}/node.js +2 -10
  50. package/dist/module/{src/esbuildConfigs → esbuildConfigs}/web.js +2 -13
  51. package/dist/module/{src/init-docs.js → init-docs.js} +1 -1
  52. package/dist/module/{src/lib → lib}/abstractBase.js +6 -1
  53. package/dist/module/{src/lib → lib}/basebuilder.js +23 -10
  54. package/dist/module/{src/lib → lib}/classBuilder.js +1 -3
  55. package/dist/module/{src/lib → lib}/core.js +26 -10
  56. package/dist/module/{src/lib → lib}/index.js +0 -1
  57. package/dist/module/run.js +259 -0
  58. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  59. package/dist/module/utils.js +29 -0
  60. package/dist/prebuild/ReportClient.css +11367 -0
  61. package/dist/prebuild/ReportClient.js +23641 -0
  62. package/dist/prebuild/ReportServer.mjs +16 -0
  63. package/dist/prebuild/TestReport.css +11367 -0
  64. package/dist/prebuild/TestReport.js +27484 -0
  65. package/dist/prebuild/build.mjs +376 -0
  66. package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +9 -0
  67. package/dist/prebuild/init-docs.mjs +64 -8
  68. package/dist/prebuild/{cli2.mjs → run.mjs} +353 -81
  69. package/dist/tsconfig.tsbuildinfo +1 -0
  70. package/dist/types/Node.d.ts +12 -0
  71. package/dist/types/{src/PM → PM}/index.d.ts +1 -1
  72. package/dist/types/{src/PM → PM}/main.d.ts +12 -9
  73. package/dist/types/{src/PM → PM}/node.d.ts +2 -4
  74. package/dist/types/{src/PM → PM}/web.d.ts +2 -4
  75. package/dist/types/SubPackages/react/component/node.d.ts +7 -0
  76. package/dist/types/SubPackages/react/component/web.d.ts +7 -0
  77. package/dist/types/SubPackages/react/jsx/index.d.ts +12 -0
  78. package/dist/types/SubPackages/react/jsx/node.d.ts +4 -0
  79. package/dist/types/SubPackages/react/jsx/web.d.ts +4 -0
  80. package/dist/types/SubPackages/react-dom/component/node.d.ts +11 -0
  81. package/dist/types/SubPackages/react-dom/component/web.d.ts +20 -0
  82. package/dist/types/SubPackages/react-dom/jsx/index.d.ts +6 -0
  83. package/dist/types/SubPackages/react-dom/jsx/node.d.ts +7 -0
  84. package/dist/types/SubPackages/react-dom/jsx/web.d.ts +5 -0
  85. package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +6 -0
  86. package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +13 -0
  87. package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +4 -0
  88. package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +4 -0
  89. package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +8 -0
  90. package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +9 -0
  91. package/dist/types/SubPackages/react-test-renderer/jsx/index.d.ts +16 -0
  92. package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +9 -0
  93. package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +9 -0
  94. package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +15 -0
  95. package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +5 -0
  96. package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +5 -0
  97. package/dist/types/Types.d.ts +61 -0
  98. package/dist/types/Web.d.ts +9 -0
  99. package/dist/types/defaultConfig.d.ts +3 -0
  100. package/dist/types/esbuildConfigs/eslint-formatter-testeranto.d.ts +2 -0
  101. package/dist/types/{src/esbuildConfigs → esbuildConfigs}/index.d.ts +1 -1
  102. package/dist/types/{src/esbuildConfigs → esbuildConfigs}/inputFilesPlugin.d.ts +0 -1
  103. package/dist/types/{src/esbuildConfigs → esbuildConfigs}/node.d.ts +1 -1
  104. package/dist/types/{src/esbuildConfigs → esbuildConfigs}/web.d.ts +1 -1
  105. package/dist/types/init-docs.d.ts +1 -0
  106. package/dist/types/lib/abstractBase.d.ts +110 -0
  107. package/dist/types/lib/basebuilder.d.ts +27 -0
  108. package/dist/types/lib/classBuilder.d.ts +7 -0
  109. package/dist/types/lib/core.d.ts +7 -0
  110. package/dist/types/lib/index.d.ts +83 -0
  111. package/dist/types/lib/types.d.ts +14 -0
  112. package/dist/types/run.d.ts +1 -0
  113. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  114. package/dist/types/utils.d.ts +9 -0
  115. package/package.json +40 -32
  116. package/src/Footer.tsx +4 -0
  117. package/src/Init.ts +48 -0
  118. package/src/Node.ts +23 -17
  119. package/src/PM/index.ts +1 -1
  120. package/src/PM/main.ts +143 -101
  121. package/src/PM/node.ts +2 -2
  122. package/src/PM/web.ts +1 -1
  123. package/src/ReportClient.tsx +155 -0
  124. package/src/ReportServer.ts +21 -0
  125. package/src/SubPackages/react/component/node.ts +68 -24
  126. package/src/SubPackages/react/component/web.ts +68 -25
  127. package/src/SubPackages/react/jsx/index.ts +39 -18
  128. package/src/SubPackages/react/jsx/node.ts +12 -10
  129. package/src/SubPackages/react/jsx/web.ts +27 -14
  130. package/src/SubPackages/react-dom/component/node.ts +42 -50
  131. package/src/SubPackages/react-dom/component/web.ts +28 -10
  132. package/src/SubPackages/react-dom/jsx/node.ts +54 -56
  133. package/src/SubPackages/react-dom/jsx/web.ts +55 -42
  134. package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +23 -7
  135. package/src/SubPackages/react-test-renderer/component/index.ts +38 -5
  136. package/src/SubPackages/react-test-renderer/component/node.ts +24 -5
  137. package/src/SubPackages/react-test-renderer/component/web.ts +22 -5
  138. package/src/SubPackages/react-test-renderer/fc/node.ts +41 -7
  139. package/src/SubPackages/react-test-renderer/fc/web.ts +43 -11
  140. package/src/SubPackages/react-test-renderer/jsx/index.ts +39 -16
  141. package/src/SubPackages/react-test-renderer/jsx/node.ts +8 -6
  142. package/src/SubPackages/react-test-renderer/jsx/web.ts +22 -5
  143. package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +39 -6
  144. package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +27 -10
  145. package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +26 -12
  146. package/src/TestReport.tsx +176 -0
  147. package/src/Types.ts +63 -309
  148. package/src/Web.ts +24 -18
  149. package/src/build.ts +240 -0
  150. package/src/defaultConfig.ts +2 -1
  151. package/src/esbuildConfigs/eslint-formatter-testeranto.ts +5 -0
  152. package/src/esbuildConfigs/featuresPlugin.ts +0 -1
  153. package/src/esbuildConfigs/index.ts +1 -1
  154. package/src/esbuildConfigs/inputFilesPlugin.ts +2 -135
  155. package/src/esbuildConfigs/node.ts +4 -13
  156. package/src/esbuildConfigs/web.ts +3 -19
  157. package/src/init-docs.ts +2 -1
  158. package/src/lib/abstractBase.ts +82 -80
  159. package/src/lib/basebuilder.ts +57 -45
  160. package/src/lib/classBuilder.ts +15 -15
  161. package/src/lib/core.ts +44 -35
  162. package/src/lib/index.ts +47 -98
  163. package/src/lib/readme.md +12 -0
  164. package/src/lib/types.ts +53 -70
  165. package/src/run.ts +398 -0
  166. package/src/style.css +8 -0
  167. package/src/utils.ts +74 -2
  168. package/tsc.log +106 -0
  169. package/Bundle.Dockerfile +0 -52
  170. package/bin/init-docs.js +0 -24
  171. package/dist/common/src/Init.js +0 -40
  172. package/dist/common/src/SubPackages/puppeteer.js +0 -21
  173. package/dist/common/src/cli.js +0 -439
  174. package/dist/common/src/cli2.js +0 -144
  175. package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +0 -99
  176. package/dist/common/src/utils.js +0 -16
  177. package/dist/common/testeranto.js +0 -15
  178. package/dist/module/src/Init.js +0 -35
  179. package/dist/module/src/SubPackages/puppeteer.js +0 -16
  180. package/dist/module/src/SubPackages/react/jsx/index.js +0 -27
  181. package/dist/module/src/cli.js +0 -411
  182. package/dist/module/src/cli2.js +0 -116
  183. package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +0 -94
  184. package/dist/module/src/lib/types.js +0 -2
  185. package/dist/module/src/utils.js +0 -9
  186. package/dist/module/testeranto.js +0 -13
  187. package/dist/prebuild/cli.mjs +0 -1491
  188. package/dist/types/dist/module/src/Init.d.ts +0 -2
  189. package/dist/types/src/Node.d.ts +0 -13
  190. package/dist/types/src/SubPackages/puppeteer.d.ts +0 -6
  191. package/dist/types/src/SubPackages/react/component/node.d.ts +0 -7
  192. package/dist/types/src/SubPackages/react/component/web.d.ts +0 -7
  193. package/dist/types/src/SubPackages/react/jsx/index.d.ts +0 -12
  194. package/dist/types/src/SubPackages/react/jsx/node.d.ts +0 -4
  195. package/dist/types/src/SubPackages/react/jsx/web.d.ts +0 -4
  196. package/dist/types/src/SubPackages/react-dom/component/node.d.ts +0 -12
  197. package/dist/types/src/SubPackages/react-dom/component/web.d.ts +0 -11
  198. package/dist/types/src/SubPackages/react-dom/jsx/index.d.ts +0 -7
  199. package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +0 -6
  200. package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +0 -5
  201. package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -5
  202. package/dist/types/src/SubPackages/react-test-renderer/component/index.d.ts +0 -13
  203. package/dist/types/src/SubPackages/react-test-renderer/component/node.d.ts +0 -8
  204. package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +0 -3
  205. package/dist/types/src/SubPackages/react-test-renderer/fc/node.d.ts +0 -8
  206. package/dist/types/src/SubPackages/react-test-renderer/fc/web.d.ts +0 -8
  207. package/dist/types/src/SubPackages/react-test-renderer/jsx/index.d.ts +0 -17
  208. package/dist/types/src/SubPackages/react-test-renderer/jsx/node.d.ts +0 -9
  209. package/dist/types/src/SubPackages/react-test-renderer/jsx/web.d.ts +0 -8
  210. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -16
  211. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -4
  212. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -4
  213. package/dist/types/src/Types.d.ts +0 -90
  214. package/dist/types/src/Web.d.ts +0 -10
  215. package/dist/types/src/defaultConfig.d.ts +0 -3
  216. package/dist/types/src/lib/abstractBase.d.ts +0 -110
  217. package/dist/types/src/lib/basebuilder.d.ts +0 -27
  218. package/dist/types/src/lib/classBuilder.d.ts +0 -7
  219. package/dist/types/src/lib/core.d.ts +0 -8
  220. package/dist/types/src/lib/index.d.ts +0 -60
  221. package/dist/types/src/lib/types.d.ts +0 -40
  222. package/dist/types/src/utils.d.ts +0 -2
  223. package/dist/types/testeranto.d.ts +0 -16
  224. package/docker-compose.yml +0 -37
  225. package/src/SubPackages/puppeteer.ts +0 -51
  226. package/src/cli.ts +0 -535
  227. package/src/cli2.ts +0 -157
  228. package/testeranto.ts +0 -13
  229. package/dist/common/{src/Node.js → Node.js} +0 -0
  230. package/dist/common/{src/PM → PM}/index.js +0 -0
  231. package/dist/common/{src/PM → PM}/node.js +0 -0
  232. package/dist/common/{src/PM → PM}/web.js +0 -0
  233. package/dist/common/{src/SubPackages → SubPackages}/react/component/node.js +0 -0
  234. package/dist/common/{src/SubPackages → SubPackages}/react/component/web.js +0 -0
  235. package/dist/common/{src/SubPackages → SubPackages}/react/jsx/node.js +0 -0
  236. package/dist/common/{src/SubPackages → SubPackages}/react/jsx/web.js +0 -0
  237. package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/index.js +0 -0
  238. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/index.js +0 -0
  239. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/node.js +0 -0
  240. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/web.js +0 -0
  241. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/node.js +0 -0
  242. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/web.js +0 -0
  243. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/node.js +1 -1
  244. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  245. package/dist/common/{src/Types.js → Types.js} +0 -0
  246. package/dist/common/{src/Web.js → Web.js} +0 -0
  247. package/dist/common/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.js +0 -0
  248. package/dist/common/{src/esbuildConfigs → esbuildConfigs}/index.js +0 -0
  249. package/dist/common/{src/puppeteerConfiger.js → puppeteerConfiger.js} +0 -0
  250. package/dist/common/{src/web.html.js → web.html.js} +0 -0
  251. package/dist/module/{src/Node.js → Node.js} +0 -0
  252. package/dist/module/{src/PM → PM}/index.js +0 -0
  253. package/dist/module/{src/PM → PM}/node.js +0 -0
  254. package/dist/module/{src/PM → PM}/web.js +0 -0
  255. package/dist/module/{src/SubPackages → SubPackages}/react/component/node.js +0 -0
  256. package/dist/module/{src/SubPackages → SubPackages}/react/component/web.js +0 -0
  257. package/dist/module/{src/SubPackages → SubPackages}/react/jsx/node.js +0 -0
  258. package/dist/module/{src/SubPackages → SubPackages}/react/jsx/web.js +0 -0
  259. package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/index.js +0 -0
  260. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
  261. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/index.js +0 -0
  262. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.js +0 -0
  263. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/node.js +0 -0
  264. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/web.js +0 -0
  265. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/fc/node.js +0 -0
  266. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/fc/web.js +0 -0
  267. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/node.js +0 -0
  268. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/web.js +0 -0
  269. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
  270. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/node.js +1 -1
  271. /package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  272. /package/dist/module/{src/Types.js → Types.js} +0 -0
  273. /package/dist/module/{src/Web.js → Web.js} +0 -0
  274. /package/dist/module/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.js +0 -0
  275. /package/dist/module/{src/esbuildConfigs → esbuildConfigs}/index.js +0 -0
  276. /package/dist/{types/src/cli.d.ts → module/lib/types.js} +0 -0
  277. /package/dist/module/{src/puppeteerConfiger.js → puppeteerConfiger.js} +0 -0
  278. /package/dist/module/{src/web.html.js → web.html.js} +0 -0
  279. /package/dist/types/{src/Init.d.ts → Init.d.ts} +0 -0
  280. /package/dist/types/{src/cli2.d.ts → ReportServer.d.ts} +0 -0
  281. /package/dist/types/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.d.ts +0 -0
  282. /package/dist/types/{src/init-docs.d.ts → build.d.ts} +0 -0
  283. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.d.ts +0 -0
  284. /package/dist/types/{src/puppeteerConfiger.d.ts → puppeteerConfiger.d.ts} +0 -0
  285. /package/dist/types/{src/web.html.d.ts → web.html.d.ts} +0 -0
@@ -1,99 +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
- const path_1 = __importDefault(require("path"));
8
- const child_process_1 = require("child_process");
9
- const otherInputs = {};
10
- const register = (entrypoint, sources) => {
11
- if (!otherInputs[entrypoint]) {
12
- otherInputs[entrypoint] = new Set();
13
- }
14
- sources.forEach((s) => otherInputs[entrypoint].add(s));
15
- };
16
- function tree(meta, key) {
17
- const outputKey = Object.keys(meta.outputs).find((k) => {
18
- return meta.outputs[k].entryPoint === key;
19
- });
20
- if (!outputKey) {
21
- console.error("No outputkey found");
22
- process.exit(-1);
23
- }
24
- return Object.keys(meta.outputs[outputKey].inputs).filter((k) => k.startsWith("src"));
25
- }
26
- exports.default = (platform, entryPoints) => {
27
- return {
28
- register,
29
- inputFilesPluginFactory: {
30
- name: "metafileWriter",
31
- setup(build) {
32
- build.onEnd((result) => {
33
- fs_1.default.writeFileSync(`docs/${platform}/metafile.json`, JSON.stringify(result, null, 2));
34
- if (result.errors.length === 0) {
35
- entryPoints.forEach((entryPoint) => {
36
- const filePath = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `inputFiles.json`);
37
- const dirName = path_1.default.dirname(filePath);
38
- if (!fs_1.default.existsSync(dirName)) {
39
- fs_1.default.mkdirSync(dirName, { recursive: true });
40
- }
41
- const promptPath = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `prompt.txt`);
42
- const testPaths = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `tests.json`);
43
- const featuresPath = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `featurePrompt.txt`);
44
- const stderrPath = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `stderr.log`);
45
- const stdoutPath = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `stdout.log`);
46
- if (result.metafile) {
47
- const addableFiles = tree(result.metafile, entryPoint.split("/").slice(1).join("/"))
48
- .map((y) => {
49
- if (otherInputs[y]) {
50
- return Array.from(otherInputs[y]);
51
- }
52
- return y;
53
- })
54
- .flat();
55
- const typeErrorFiles = addableFiles.map((t) => `docs/types/${t}.type_errors.txt`);
56
- const lintPath = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `lint_errors.txt`);
57
- fs_1.default.writeFileSync(promptPath, `
58
- ${addableFiles
59
- .map((x) => {
60
- return `/add ${x}`;
61
- })
62
- .join("\n")}
63
-
64
- ${typeErrorFiles
65
- .map((x) => {
66
- return `/read ${x}`;
67
- })
68
- .join("\n")}
69
-
70
- /read ${lintPath}
71
- /read ${testPaths}
72
- /read ${stdoutPath}
73
- /read ${stderrPath}
74
-
75
- /load ${featuresPath}
76
-
77
- /code Fix the failing tests described in ${testPaths}. Correct any type signature errors described in the files [${typeErrorFiles.join(", ")}]. Implement any method which throws "Function not implemented. Resolve the lint errors described in ${lintPath}"
78
- `);
79
- const logContent = [];
80
- const tsc = (0, child_process_1.spawn)("eslint", addableFiles);
81
- tsc.stdout.on("data", (data) => {
82
- const lines = data.toString().split("\n");
83
- logContent.push(...lines);
84
- });
85
- tsc.stderr.on("data", (data) => {
86
- console.error(`stderr: ${data}`);
87
- process.exit(-1);
88
- });
89
- tsc.on("close", (code) => {
90
- fs_1.default.writeFileSync(lintPath, logContent.join("\n"));
91
- });
92
- }
93
- });
94
- }
95
- });
96
- },
97
- },
98
- };
99
- };
@@ -1,16 +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.destinationOfRuntime = void 0;
7
- // import { configs } from "eslint-plugin-react";
8
- const path_1 = __importDefault(require("path"));
9
- const destinationOfRuntime = (f, r, configs) => {
10
- return path_1.default
11
- .normalize(`${configs.buildDir}/${r}/${f}`)
12
- .split(".")
13
- .slice(0, -1)
14
- .join(".");
15
- };
16
- exports.destinationOfRuntime = destinationOfRuntime;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- botEmail: "adamwong246@gmail.com",
5
- taskman: "adamwong246/kokomobay-taskman",
6
- outdir: "docs",
7
- tests: [["./src/LoginButton.test.tsx", "web", { ports: 0 }, []]],
8
- debugger: true,
9
- clearScreen: false,
10
- devMode: true,
11
- minify: false,
12
- outbase: ".",
13
- ports: [],
14
- externals: [],
15
- };
@@ -1,35 +0,0 @@
1
- import fs from "fs";
2
- export default async (partialConfig) => {
3
- const config = Object.assign(Object.assign({}, partialConfig), { buildDir: process.cwd() + "/" + partialConfig.outdir });
4
- try {
5
- fs.mkdirSync(`${process.cwd()}/${config.outdir}`);
6
- }
7
- catch (_a) {
8
- // console.log()
9
- }
10
- fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
11
- try {
12
- fs.mkdirSync(`${process.cwd()}/${config.outdir}/node`);
13
- }
14
- catch (_b) {
15
- // console.log()
16
- }
17
- try {
18
- fs.mkdirSync(`${process.cwd()}/${config.outdir}/web`);
19
- }
20
- catch (_c) {
21
- // console.log()
22
- }
23
- try {
24
- fs.mkdirSync(`${process.cwd()}/${config.outdir}/features`);
25
- }
26
- catch (_d) {
27
- // console.log()
28
- }
29
- try {
30
- fs.mkdirSync(`${process.cwd()}/${config.outdir}/ts`);
31
- }
32
- catch (_e) {
33
- // console.log()
34
- }
35
- };
@@ -1,16 +0,0 @@
1
- import React from "react";
2
- import Testeranto from "../Node.js";
3
- export default (testInput, testSpecifications, testImplementations, testInterface) => {
4
- return Testeranto(testInput, testSpecifications, testImplementations, Object.assign({ beforeAll: (x) => {
5
- // process.parentPort.postMessage(
6
- // `/docs/web/src/ClassicalComponent/test.html`
7
- // );
8
- return x;
9
- }, beforeEach: async () => {
10
- return new Promise((resolve, rej) => {
11
- resolve(React.createElement(testInput, {}, []));
12
- });
13
- }, andWhen: function (s, whenCB) {
14
- return whenCB()(s);
15
- } }, testInterface));
16
- };
@@ -1,27 +0,0 @@
1
- import React from "react";
2
- export const testInterface = {
3
- // beforeAll: async (proto, testResource, artificer, pm): Promise<IStore> => {
4
- // return React.createElement(proto);
5
- // // return new Promise((resolve, rej) => {
6
- // // resolve(x());
7
- // // });
8
- // },
9
- // beforeEach: async (subject, initializer, artificer): Promise<IStore> => {
10
- // return new Promise((resolve, rej) => {
11
- // resolve(React.createElement(subject));
12
- // });
13
- // },
14
- andWhen: async (s, whenCB) => {
15
- await whenCB(s());
16
- return new Promise((resolve, rej) => {
17
- resolve(React.createElement(s));
18
- });
19
- // return whenCB(s);
20
- },
21
- butThen: async (subject, thenCB) => {
22
- await thenCB(subject());
23
- return new Promise((resolve, rej) => {
24
- resolve(React.createElement(subject));
25
- });
26
- },
27
- };
@@ -1,411 +0,0 @@
1
- import { spawn } from "child_process";
2
- import fs from "fs";
3
- import path from "path";
4
- import readline from "readline";
5
- import { glob } from "glob";
6
- import { debounceWatch } from "@bscotch/debounce-watch";
7
- import esbuild from "esbuild";
8
- import esbuildNodeConfiger from "./esbuildConfigs/node.js";
9
- import esbuildWebConfiger from "./esbuildConfigs/web.js";
10
- import webHtmlFrame from "./web.html.js";
11
- import { PM_Main } from "./PM/main.js";
12
- readline.emitKeypressEvents(process.stdin);
13
- if (process.stdin.isTTY)
14
- process.stdin.setRawMode(true);
15
- function parseTsErrors(logContent) {
16
- fs.writeFileSync("docs/types/log.txt", logContent.join("\n"));
17
- try {
18
- const regex = /(^src(.*?))\(\d*,\d*\): error/gm;
19
- const brokenFilesToLines = {};
20
- for (let i = 0; i < logContent.length - 1; i++) {
21
- let m;
22
- while ((m = regex.exec(logContent[i])) !== null) {
23
- // This is necessary to avoid infinite loops with zero-width matches
24
- if (m.index === regex.lastIndex) {
25
- regex.lastIndex++;
26
- }
27
- if (!brokenFilesToLines[m[1]]) {
28
- brokenFilesToLines[m[1]] = new Set();
29
- }
30
- brokenFilesToLines[m[1]].add(i);
31
- }
32
- }
33
- const final = Object.keys(brokenFilesToLines).reduce((mm, lm, ndx) => {
34
- mm[lm] = Array.from(brokenFilesToLines[lm]).map((l, ndx3) => {
35
- const a = Array.from(brokenFilesToLines[lm]);
36
- return Object.keys(a).reduce((mm2, lm2, ndx2) => {
37
- const acc = [];
38
- let j = a[lm2] + 1;
39
- let working = true;
40
- while (j < logContent.length - 1 && working) {
41
- if (!logContent[j].match(regex) &&
42
- working &&
43
- !logContent[j].match(/^..\/(.*?)\(\d*,\d*\)/)) {
44
- acc.push(logContent[j]);
45
- }
46
- else {
47
- working = false;
48
- }
49
- j++;
50
- }
51
- mm2[lm] = [logContent[l], ...acc];
52
- return mm2;
53
- }, {})[lm];
54
- });
55
- return mm;
56
- }, {});
57
- Object.keys(final).forEach((k) => {
58
- fs.mkdirSync(`./docs/types/${k.split("/").slice(0, -1).join("/")}`, {
59
- recursive: true,
60
- });
61
- fs.writeFileSync(`./docs/types/${k}.type_errors.txt`, final[k].flat().flat().join("\r\n"));
62
- });
63
- }
64
- catch (error) {
65
- console.error("Error reading or parsing the log file:", error);
66
- process.exit(1);
67
- }
68
- }
69
- function parseLintErrors(logContent) {
70
- fs.writeFileSync("docs/eslint/log.txt", logContent.join("\n"));
71
- try {
72
- const regex = new RegExp(`^${process.cwd()}/(.*?)`, "gm");
73
- const brokenFilesToLines = {};
74
- for (let i = 0; i < logContent.length - 1; i++) {
75
- let m;
76
- while ((m = regex.exec(logContent[i])) !== null) {
77
- // This is necessary to avoid infinite loops with zero-width matches
78
- if (m.index === regex.lastIndex) {
79
- regex.lastIndex++;
80
- }
81
- if (!brokenFilesToLines[m[1]]) {
82
- brokenFilesToLines[m[1]] = new Set();
83
- }
84
- brokenFilesToLines[m[1]].add(i);
85
- }
86
- }
87
- const final = Object.keys(brokenFilesToLines).reduce((mm, lm, ndx) => {
88
- mm[lm] = Array.from(brokenFilesToLines[lm]).map((l, ndx3) => {
89
- const a = Array.from(brokenFilesToLines[lm]);
90
- return Object.keys(a).reduce((mm2, lm2, ndx2) => {
91
- const acc = [];
92
- let j = a[lm2] + 1;
93
- let working = true;
94
- while (j < logContent.length - 1 && working) {
95
- if (!logContent[j].match(regex) &&
96
- working
97
- // &&
98
- // !logContent[j].match(/^..\/(.*?)\(\d*,\d*\)/)
99
- ) {
100
- acc.push(logContent[j]);
101
- }
102
- else {
103
- working = false;
104
- }
105
- j++;
106
- }
107
- mm2[lm] = [logContent[l], ...acc];
108
- return mm2;
109
- }, {})[lm];
110
- });
111
- return mm;
112
- }, {});
113
- Object.keys(final).forEach((k) => {
114
- fs.mkdirSync(`./docs/eslint/${k.split("/").slice(0, -1).join("/")}`, {
115
- recursive: true,
116
- });
117
- fs.writeFileSync(`./docs/eslint/${k}.lint_errors.txt`, final[k].flat().flat().join("\r\n"));
118
- });
119
- }
120
- catch (error) {
121
- console.error("Error reading or parsing the log file:", error);
122
- process.exit(1);
123
- }
124
- }
125
- const typecheck = () => {
126
- const logContent = [];
127
- fs.rmSync("docs/types", { force: true, recursive: true });
128
- fs.mkdirSync("docs/types");
129
- const tsc = spawn("tsc", ["-noEmit"]);
130
- tsc.stdout.on("data", (data) => {
131
- const lines = data.toString().split("\n");
132
- logContent.push(...lines);
133
- });
134
- tsc.stderr.on("data", (data) => {
135
- console.error(`stderr: ${data}`);
136
- process.exit(-1);
137
- });
138
- tsc.on("close", (code) => {
139
- parseTsErrors(logContent);
140
- });
141
- };
142
- const eslint = () => {
143
- const logContent = [];
144
- fs.rmSync("docs/eslint", { force: true, recursive: true });
145
- fs.mkdirSync("docs/eslint");
146
- const tsc = spawn("eslint", ["./src"]);
147
- tsc.stdout.on("data", (data) => {
148
- const lines = data.toString().split("\n");
149
- logContent.push(...lines);
150
- });
151
- tsc.stderr.on("data", (data) => {
152
- console.error(`stderr: ${data}`);
153
- process.exit(-1);
154
- });
155
- tsc.on("close", (code) => {
156
- parseLintErrors(logContent);
157
- });
158
- };
159
- const getRunnables = (tests, payload = {
160
- nodeEntryPoints: {},
161
- webEntryPoints: {},
162
- }) => {
163
- return tests.reduce((pt, cv, cndx, cry) => {
164
- if (cv[1] === "node") {
165
- pt.nodeEntryPoints[cv[0]] = path.resolve(`./docs/node/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
166
- }
167
- else if (cv[1] === "web") {
168
- pt.webEntryPoints[cv[0]] = path.resolve(`./docs/web/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
169
- }
170
- if (cv[3].length) {
171
- getRunnables(cv[3], payload);
172
- }
173
- return pt;
174
- }, payload);
175
- };
176
- import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
177
- const rawConfig = module.default;
178
- const getSecondaryEndpointsPoints = (runtime) => {
179
- const meta = (ts, st) => {
180
- ts.forEach((t) => {
181
- if (t[1] === runtime) {
182
- st.add(t[0]);
183
- }
184
- if (Array.isArray(t[3])) {
185
- meta(t[3], st);
186
- }
187
- });
188
- return st;
189
- };
190
- return Array.from(meta(config.tests, new Set()));
191
- };
192
- const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/" + rawConfig.outdir });
193
- let nodeDone = false;
194
- let webDone = false;
195
- let mode = config.devMode ? "DEV" : "PROD";
196
- let status = "build";
197
- let pm = new PM_Main(config);
198
- const fileHashes = {};
199
- const { nodeEntryPoints, webEntryPoints } = getRunnables(config.tests);
200
- const onNodeDone = () => {
201
- nodeDone = true;
202
- onDone();
203
- };
204
- const onWebDone = () => {
205
- webDone = true;
206
- onDone();
207
- };
208
- // async function fileHash(filePath, algorithm = "md5") {
209
- // return new Promise((resolve, reject) => {
210
- // const hash = crypto.createHash(algorithm);
211
- // const fileStream = fs.createReadStream(filePath);
212
- // fileStream.on("data", (data) => {
213
- // hash.update(data);
214
- // });
215
- // fileStream.on("end", () => {
216
- // const fileHash = hash.digest("hex");
217
- // resolve(fileHash);
218
- // });
219
- // fileStream.on("error", (error) => {
220
- // reject(`Error reading file: ${error.message}`);
221
- // });
222
- // });
223
- // }
224
- const onDone = async () => {
225
- if (nodeDone && webDone) {
226
- status = "built";
227
- }
228
- if (nodeDone && webDone && status === "built") {
229
- // Object.entries(nodeEntryPoints).forEach(([k, outputFile]) => {
230
- // console.log("watching", outputFile);
231
- // try {
232
- // watch(outputFile, async (filename) => {
233
- // const hash = await fileHash(outputFile);
234
- // if (fileHashes[k] !== hash) {
235
- // fileHashes[k] = hash;
236
- // console.log(`< ${filename} `);
237
- // pm.launchNode(k, outputFile);
238
- // }
239
- // });
240
- // } catch (e) {
241
- // console.error(e);
242
- // }
243
- // });
244
- // Object.entries(webEntryPoints).forEach(([k, outputFile]) => {
245
- // console.log("watching", outputFile);
246
- // watch(outputFile, async (filename) => {
247
- // const hash = await fileHash(outputFile);
248
- // console.log(`< ${filename} ${hash}`);
249
- // if (fileHashes[k] !== hash) {
250
- // fileHashes[k] = hash;
251
- // pm.launchWeb(k, outputFile);
252
- // }
253
- // });
254
- // });
255
- }
256
- if (nodeDone && webDone && mode === "PROD") {
257
- console.log("Testeranto-EsBuild is all done. Goodbye!");
258
- process.exit();
259
- }
260
- else {
261
- if (mode === "PROD") {
262
- console.log("waiting for tests to finish");
263
- console.log(JSON.stringify({
264
- nodeDone: nodeDone,
265
- webDone: webDone,
266
- mode: mode,
267
- }, null, 2));
268
- }
269
- else {
270
- console.log("waiting for tests to change");
271
- }
272
- console.log("press 'q' to quit");
273
- if (config.devMode) {
274
- console.log("ready and watching for changes...");
275
- }
276
- else {
277
- pm.shutDown();
278
- }
279
- ////////////////////////////////////////////////////////////////////////////////
280
- }
281
- };
282
- console.log(`Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`);
283
- process.stdin.on("keypress", (str, key) => {
284
- if (key.name === "q") {
285
- console.log("Testeranto-EsBuild is shutting down...");
286
- mode = "PROD";
287
- onDone();
288
- }
289
- });
290
- // const eslint = new ESLint();
291
- // const configEslint = await eslint.calculateConfigForFile(
292
- // "./src/eslint.config.mjs"
293
- // );
294
- // // console.log(`configEslint`, configEslint);
295
- // fs.watch("src", { recursive: true }, async (eventType, filename) => {
296
- // if (eventType === "change") {
297
- // console.log(`File ${filename} has been modified.`);
298
- // const x = await eslint.lintFiles([`./src/${filename}`]);
299
- // console.log(x[0].messages);
300
- // } else if (eventType === "rename") {
301
- // console.log(`File ${filename} has been created or deleted.`);
302
- // }
303
- // });
304
- fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(config, null, 2));
305
- Promise.resolve(Promise.all([...getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
306
- const sourceFileSplit = sourceFilePath.split("/");
307
- const sourceDir = sourceFileSplit.slice(0, -1);
308
- const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
309
- const sourceFileNameMinusJs = sourceFileName
310
- .split(".")
311
- .slice(0, -1)
312
- .join(".");
313
- const htmlFilePath = path.normalize(`${process.cwd()}/${config.outdir}/web/${sourceDir.join("/")}/${sourceFileNameMinusJs}.html`);
314
- const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
315
- return fs.promises
316
- .mkdir(path.dirname(htmlFilePath), { recursive: true })
317
- .then((x) => fs.writeFileSync(htmlFilePath, webHtmlFrame(jsfilePath, htmlFilePath)));
318
- })));
319
- glob(`./${config.outdir}/chunk-*.mjs`, {
320
- ignore: "node_modules/**",
321
- }).then((chunks) => {
322
- chunks.forEach((chunk) => {
323
- fs.unlinkSync(chunk);
324
- });
325
- });
326
- // const processDebouncedEvents: DebouncedEventsProcessor = (events) => {
327
- // typecheck();
328
- // };
329
- debounceWatch((events) => {
330
- typecheck();
331
- eslint();
332
- }, "./src", {
333
- onlyFileExtensions: ["ts", "tsx", "mts"],
334
- debounceWaitSeconds: 0.2,
335
- allowOverlappingRuns: false,
336
- });
337
- await pm.startPuppeteer({
338
- slowMo: 1,
339
- // timeout: 1,
340
- waitForInitialPage: false,
341
- executablePath:
342
- // process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
343
- "/opt/homebrew/bin/chromium",
344
- headless: true,
345
- dumpio: true,
346
- // timeout: 0,
347
- devtools: true,
348
- args: [
349
- "--auto-open-devtools-for-tabs",
350
- `--remote-debugging-port=3234`,
351
- // "--disable-features=IsolateOrigins,site-per-process",
352
- "--disable-site-isolation-trials",
353
- "--allow-insecure-localhost",
354
- "--allow-file-access-from-files",
355
- "--allow-running-insecure-content",
356
- "--disable-dev-shm-usage",
357
- "--disable-extensions",
358
- "--disable-gpu",
359
- "--disable-setuid-sandbox",
360
- "--disable-site-isolation-trials",
361
- "--disable-web-security",
362
- "--no-first-run",
363
- "--no-sandbox",
364
- "--no-startup-window",
365
- // "--no-zygote",
366
- "--reduce-security-for-testing",
367
- "--remote-allow-origins=*",
368
- "--unsafely-treat-insecure-origin-as-secure=*",
369
- // "--disable-features=IsolateOrigins",
370
- // "--remote-allow-origins=ws://localhost:3234",
371
- // "--single-process",
372
- // "--unsafely-treat-insecure-origin-as-secure",
373
- // "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
374
- // "--disk-cache-dir=/dev/null",
375
- // "--disk-cache-size=1",
376
- // "--start-maximized",
377
- ],
378
- }, ".");
379
- await Promise.all([
380
- esbuild
381
- .context(esbuildNodeConfiger(config, Object.keys(nodeEntryPoints)))
382
- .then(async (nodeContext) => {
383
- if (config.devMode) {
384
- await nodeContext.watch().then((v) => {
385
- onNodeDone();
386
- });
387
- }
388
- else {
389
- nodeContext.rebuild().then((v) => {
390
- onNodeDone();
391
- });
392
- }
393
- return nodeContext;
394
- }),
395
- esbuild
396
- .context(esbuildWebConfiger(config, Object.keys(webEntryPoints)))
397
- .then(async (webContext) => {
398
- if (config.devMode) {
399
- await webContext.watch().then((v) => {
400
- onWebDone();
401
- });
402
- }
403
- else {
404
- webContext.rebuild().then((v) => {
405
- onWebDone();
406
- });
407
- }
408
- return webContext;
409
- }),
410
- ]);
411
- });