testeranto 0.94.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 (308) hide show
  1. package/README.md +1 -0
  2. package/bundle.js +80 -33
  3. package/dist/common/{src/Init.js → Init.js} +28 -0
  4. package/dist/common/{src/PM → PM}/main.js +272 -111
  5. package/dist/common/{src/PM → PM}/node.js +20 -5
  6. package/dist/common/{src/PM → PM}/web.js +19 -4
  7. package/dist/common/ReportServer.js +22 -0
  8. package/dist/common/{src/SubPackages → SubPackages}/react/jsx/index.js +0 -12
  9. package/dist/common/{src/SubPackages → SubPackages}/react/jsx/node.js +1 -6
  10. package/dist/common/{src/SubPackages → SubPackages}/react-dom/component/node.js +3 -16
  11. package/dist/common/{src/SubPackages → SubPackages}/react-dom/component/web.js +3 -3
  12. package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/node.js +1 -1
  13. package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/web.js +41 -30
  14. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +17 -7
  15. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.js +17 -7
  16. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/fc/node.js +17 -7
  17. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/fc/web.js +17 -7
  18. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/index.js +18 -14
  19. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +17 -7
  20. package/dist/common/build.js +222 -0
  21. package/dist/common/{src/defaultConfig.js → defaultConfig.js} +1 -0
  22. package/dist/common/esbuildConfigs/eslint-formatter-testeranto.js +6 -0
  23. package/dist/common/esbuildConfigs/inputFilesPlugin.js +27 -0
  24. package/dist/common/{src/esbuildConfigs → esbuildConfigs}/node.js +3 -14
  25. package/dist/common/{src/esbuildConfigs → esbuildConfigs}/web.js +3 -14
  26. package/dist/common/{src/init-docs.js → init-docs.js} +20 -10
  27. package/dist/common/{src/lib → lib}/abstractBase.js +20 -92
  28. package/dist/common/{src/lib → lib}/basebuilder.js +23 -10
  29. package/dist/common/{src/lib → lib}/classBuilder.js +1 -3
  30. package/dist/common/{src/lib → lib}/core.js +26 -10
  31. package/dist/common/{src/lib → lib}/index.js +0 -1
  32. package/dist/common/run.js +297 -0
  33. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  34. package/dist/common/utils.js +43 -0
  35. package/dist/module/Footer.js +4 -0
  36. package/dist/module/Init.js +63 -0
  37. package/dist/module/{src/PM → PM}/main.js +253 -102
  38. package/dist/module/{src/PM → PM}/node.js +20 -5
  39. package/dist/module/{src/PM → PM}/web.js +19 -4
  40. package/dist/module/ReportClient.js +97 -0
  41. package/dist/module/ReportServer.js +17 -0
  42. package/dist/module/SubPackages/react/jsx/index.js +15 -0
  43. package/dist/module/{src/SubPackages → SubPackages}/react/jsx/node.js +1 -6
  44. package/dist/module/{src/SubPackages → SubPackages}/react-dom/component/node.js +3 -16
  45. package/dist/module/{src/SubPackages → SubPackages}/react-dom/component/web.js +3 -3
  46. package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/node.js +3 -3
  47. package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/web.js +24 -23
  48. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/index.js +1 -7
  49. package/dist/module/TestReport.js +91 -0
  50. package/dist/module/build.js +184 -0
  51. package/dist/module/{src/defaultConfig.js → defaultConfig.js} +1 -0
  52. package/dist/module/esbuildConfigs/eslint-formatter-testeranto.js +3 -0
  53. package/dist/module/esbuildConfigs/inputFilesPlugin.js +22 -0
  54. package/dist/module/{src/esbuildConfigs → esbuildConfigs}/node.js +3 -14
  55. package/dist/module/{src/esbuildConfigs → esbuildConfigs}/web.js +3 -14
  56. package/dist/module/{src/init-docs.js → init-docs.js} +1 -1
  57. package/dist/module/{src/lib → lib}/abstractBase.js +20 -92
  58. package/dist/module/{src/lib → lib}/basebuilder.js +23 -10
  59. package/dist/module/{src/lib → lib}/classBuilder.js +1 -3
  60. package/dist/module/{src/lib → lib}/core.js +26 -10
  61. package/dist/module/{src/lib → lib}/index.js +0 -1
  62. package/dist/module/run.js +259 -0
  63. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  64. package/dist/module/utils.js +29 -0
  65. package/dist/prebuild/ReportClient.css +11367 -0
  66. package/dist/prebuild/ReportClient.js +23641 -0
  67. package/dist/prebuild/ReportServer.mjs +16 -0
  68. package/dist/prebuild/TestReport.css +11367 -0
  69. package/dist/prebuild/TestReport.js +27484 -0
  70. package/dist/prebuild/build.mjs +376 -0
  71. package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +9 -0
  72. package/dist/prebuild/init-docs.mjs +64 -8
  73. package/dist/prebuild/{run-tests.mjs → run.mjs} +501 -182
  74. package/dist/tsconfig.tsbuildinfo +1 -0
  75. package/dist/types/Node.d.ts +12 -0
  76. package/dist/types/{src/PM → PM}/index.d.ts +11 -3
  77. package/dist/types/{src/PM → PM}/main.d.ts +24 -15
  78. package/dist/types/{src/PM → PM}/node.d.ts +11 -6
  79. package/dist/types/{src/PM → PM}/web.d.ts +11 -7
  80. package/dist/types/SubPackages/react/component/node.d.ts +7 -0
  81. package/dist/types/SubPackages/react/component/web.d.ts +7 -0
  82. package/dist/types/SubPackages/react/jsx/index.d.ts +12 -0
  83. package/dist/types/SubPackages/react/jsx/node.d.ts +4 -0
  84. package/dist/types/SubPackages/react/jsx/web.d.ts +4 -0
  85. package/dist/types/SubPackages/react-dom/component/node.d.ts +11 -0
  86. package/dist/types/SubPackages/react-dom/component/web.d.ts +20 -0
  87. package/dist/types/SubPackages/react-dom/jsx/index.d.ts +6 -0
  88. package/dist/types/SubPackages/react-dom/jsx/node.d.ts +7 -0
  89. package/dist/types/SubPackages/react-dom/jsx/web.d.ts +5 -0
  90. package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +6 -0
  91. package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +13 -0
  92. package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +4 -0
  93. package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +4 -0
  94. package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +8 -0
  95. package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +9 -0
  96. package/dist/types/SubPackages/react-test-renderer/jsx/index.d.ts +16 -0
  97. package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +9 -0
  98. package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +9 -0
  99. package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +15 -0
  100. package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +5 -0
  101. package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +5 -0
  102. package/dist/types/Types.d.ts +61 -0
  103. package/dist/types/Web.d.ts +9 -0
  104. package/dist/types/defaultConfig.d.ts +3 -0
  105. package/dist/types/esbuildConfigs/eslint-formatter-testeranto.d.ts +2 -0
  106. package/dist/types/{src/esbuildConfigs → esbuildConfigs}/index.d.ts +1 -1
  107. package/dist/types/{src/esbuildConfigs → esbuildConfigs}/inputFilesPlugin.d.ts +0 -1
  108. package/dist/types/{src/esbuildConfigs → esbuildConfigs}/node.d.ts +1 -1
  109. package/dist/types/{src/esbuildConfigs → esbuildConfigs}/web.d.ts +1 -1
  110. package/dist/types/lib/abstractBase.d.ts +110 -0
  111. package/dist/types/lib/basebuilder.d.ts +27 -0
  112. package/dist/types/lib/classBuilder.d.ts +7 -0
  113. package/dist/types/lib/core.d.ts +7 -0
  114. package/dist/types/lib/index.d.ts +83 -0
  115. package/dist/types/lib/types.d.ts +14 -0
  116. package/dist/types/run.d.ts +1 -0
  117. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  118. package/dist/types/utils.d.ts +9 -0
  119. package/package.json +50 -39
  120. package/src/Footer.tsx +4 -0
  121. package/src/Init.ts +48 -0
  122. package/src/Node.ts +23 -17
  123. package/src/PM/index.ts +13 -9
  124. package/src/PM/main.ts +337 -139
  125. package/src/PM/node.ts +43 -8
  126. package/src/PM/web.ts +34 -6
  127. package/src/ReportClient.tsx +155 -0
  128. package/src/ReportServer.ts +21 -0
  129. package/src/SubPackages/react/component/node.ts +68 -24
  130. package/src/SubPackages/react/component/web.ts +68 -25
  131. package/src/SubPackages/react/jsx/index.ts +39 -18
  132. package/src/SubPackages/react/jsx/node.ts +23 -10
  133. package/src/SubPackages/react/jsx/web.ts +27 -14
  134. package/src/SubPackages/react-dom/component/node.ts +42 -50
  135. package/src/SubPackages/react-dom/component/web.ts +28 -10
  136. package/src/SubPackages/react-dom/jsx/node.ts +54 -56
  137. package/src/SubPackages/react-dom/jsx/web.ts +55 -42
  138. package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +23 -7
  139. package/src/SubPackages/react-test-renderer/component/index.ts +38 -5
  140. package/src/SubPackages/react-test-renderer/component/node.ts +24 -5
  141. package/src/SubPackages/react-test-renderer/component/web.ts +22 -5
  142. package/src/SubPackages/react-test-renderer/fc/node.ts +41 -7
  143. package/src/SubPackages/react-test-renderer/fc/web.ts +43 -11
  144. package/src/SubPackages/react-test-renderer/jsx/index.ts +39 -16
  145. package/src/SubPackages/react-test-renderer/jsx/node.ts +22 -5
  146. package/src/SubPackages/react-test-renderer/jsx/web.ts +22 -5
  147. package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +39 -6
  148. package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +27 -10
  149. package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +26 -12
  150. package/src/TestReport.tsx +176 -0
  151. package/src/Types.ts +131 -129
  152. package/src/Web.ts +24 -18
  153. package/src/build.ts +240 -0
  154. package/src/defaultConfig.ts +2 -1
  155. package/src/esbuildConfigs/eslint-formatter-testeranto.ts +5 -0
  156. package/src/esbuildConfigs/featuresPlugin.ts +0 -1
  157. package/src/esbuildConfigs/index.ts +1 -1
  158. package/src/esbuildConfigs/inputFilesPlugin.ts +2 -114
  159. package/src/esbuildConfigs/node.ts +7 -19
  160. package/src/esbuildConfigs/web.ts +6 -21
  161. package/src/init-docs.ts +2 -1
  162. package/src/lib/abstractBase.ts +140 -195
  163. package/src/lib/basebuilder.ts +57 -45
  164. package/src/lib/classBuilder.ts +15 -15
  165. package/src/lib/core.ts +44 -35
  166. package/src/lib/index.ts +47 -98
  167. package/src/lib/readme.md +12 -0
  168. package/src/lib/types.ts +40 -231
  169. package/src/run.ts +398 -0
  170. package/src/style.css +8 -0
  171. package/src/utils.ts +74 -2
  172. package/tsc.log +106 -0
  173. package/Bundle.Dockerfile +0 -52
  174. package/bin/init-docs.js +0 -24
  175. package/dist/common/dist/module/src/Init.js +0 -40
  176. package/dist/common/src/Aider.js +0 -143
  177. package/dist/common/src/Project.js +0 -227
  178. package/dist/common/src/Puppeteer.js +0 -111
  179. package/dist/common/src/SubPackages/puppeteer.js +0 -21
  180. package/dist/common/src/build-tests.js +0 -39
  181. package/dist/common/src/esbuildConfigs/features.js +0 -14
  182. package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +0 -87
  183. package/dist/common/src/esbuildConfigs/report.js +0 -14
  184. package/dist/common/src/esbuildConfigs/tests.js +0 -13
  185. package/dist/common/src/run-tests.js +0 -39
  186. package/dist/common/src/utils.js +0 -16
  187. package/dist/common/testeranto.js +0 -15
  188. package/dist/module/src/Aider.js +0 -136
  189. package/dist/module/src/Init.js +0 -35
  190. package/dist/module/src/Project.js +0 -220
  191. package/dist/module/src/Puppeteer.js +0 -106
  192. package/dist/module/src/SubPackages/puppeteer.js +0 -16
  193. package/dist/module/src/SubPackages/react/jsx/index.js +0 -27
  194. package/dist/module/src/build-tests.js +0 -11
  195. package/dist/module/src/esbuildConfigs/features.js +0 -12
  196. package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +0 -82
  197. package/dist/module/src/esbuildConfigs/report.js +0 -14
  198. package/dist/module/src/esbuildConfigs/tests.js +0 -11
  199. package/dist/module/src/run-tests.js +0 -11
  200. package/dist/module/src/utils.js +0 -9
  201. package/dist/module/testeranto.js +0 -13
  202. package/dist/prebuild/build-tests.mjs +0 -553
  203. package/dist/types/dist/module/src/Init.d.ts +0 -2
  204. package/dist/types/src/Aider.d.ts +0 -1
  205. package/dist/types/src/Node.d.ts +0 -13
  206. package/dist/types/src/Project.d.ts +0 -12
  207. package/dist/types/src/Puppeteer.d.ts +0 -2
  208. package/dist/types/src/SubPackages/puppeteer.d.ts +0 -6
  209. package/dist/types/src/SubPackages/react/component/node.d.ts +0 -7
  210. package/dist/types/src/SubPackages/react/component/web.d.ts +0 -7
  211. package/dist/types/src/SubPackages/react/jsx/index.d.ts +0 -12
  212. package/dist/types/src/SubPackages/react/jsx/node.d.ts +0 -4
  213. package/dist/types/src/SubPackages/react/jsx/web.d.ts +0 -4
  214. package/dist/types/src/SubPackages/react-dom/component/node.d.ts +0 -12
  215. package/dist/types/src/SubPackages/react-dom/component/web.d.ts +0 -11
  216. package/dist/types/src/SubPackages/react-dom/jsx/index.d.ts +0 -7
  217. package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +0 -6
  218. package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +0 -5
  219. package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -5
  220. package/dist/types/src/SubPackages/react-test-renderer/component/index.d.ts +0 -13
  221. package/dist/types/src/SubPackages/react-test-renderer/component/node.d.ts +0 -8
  222. package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +0 -3
  223. package/dist/types/src/SubPackages/react-test-renderer/fc/node.d.ts +0 -8
  224. package/dist/types/src/SubPackages/react-test-renderer/fc/web.d.ts +0 -8
  225. package/dist/types/src/SubPackages/react-test-renderer/jsx/index.d.ts +0 -17
  226. package/dist/types/src/SubPackages/react-test-renderer/jsx/node.d.ts +0 -8
  227. package/dist/types/src/SubPackages/react-test-renderer/jsx/web.d.ts +0 -8
  228. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -16
  229. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -4
  230. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -4
  231. package/dist/types/src/Types.d.ts +0 -51
  232. package/dist/types/src/Web.d.ts +0 -10
  233. package/dist/types/src/defaultConfig.d.ts +0 -3
  234. package/dist/types/src/esbuildConfigs/features.d.ts +0 -4
  235. package/dist/types/src/esbuildConfigs/report.d.ts +0 -0
  236. package/dist/types/src/esbuildConfigs/tests.d.ts +0 -4
  237. package/dist/types/src/lib/abstractBase.d.ts +0 -110
  238. package/dist/types/src/lib/basebuilder.d.ts +0 -27
  239. package/dist/types/src/lib/classBuilder.d.ts +0 -7
  240. package/dist/types/src/lib/core.d.ts +0 -8
  241. package/dist/types/src/lib/index.d.ts +0 -60
  242. package/dist/types/src/lib/types.d.ts +0 -68
  243. package/dist/types/src/utils.d.ts +0 -2
  244. package/dist/types/testeranto.d.ts +0 -16
  245. package/docker-compose.yml +0 -37
  246. package/src/Aider.ts +0 -168
  247. package/src/Project.ts +0 -292
  248. package/src/Puppeteer.ts +0 -143
  249. package/src/SubPackages/puppeteer.ts +0 -51
  250. package/src/build-tests.ts +0 -12
  251. package/src/esbuildConfigs/features.ts +0 -17
  252. package/src/esbuildConfigs/report.ts +0 -15
  253. package/src/esbuildConfigs/tests.ts +0 -14
  254. package/src/run-tests.ts +0 -12
  255. package/testeranto.ts +0 -13
  256. package/dist/common/{src/Node.js → Node.js} +0 -0
  257. package/dist/common/{src/PM → PM}/index.js +0 -0
  258. package/dist/common/{src/SubPackages → SubPackages}/react/component/node.js +0 -0
  259. package/dist/common/{src/SubPackages → SubPackages}/react/component/web.js +0 -0
  260. package/dist/common/{src/SubPackages → SubPackages}/react/jsx/web.js +0 -0
  261. package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/index.js +0 -0
  262. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/index.js +0 -0
  263. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/node.js +0 -0
  264. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/web.js +0 -0
  265. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/node.js +0 -0
  266. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/web.js +0 -0
  267. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/node.js +1 -1
  268. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  269. package/dist/common/{src/Types.js → Types.js} +0 -0
  270. package/dist/common/{src/Web.js → Web.js} +0 -0
  271. package/dist/common/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.js +0 -0
  272. package/dist/common/{src/esbuildConfigs → esbuildConfigs}/index.js +0 -0
  273. package/dist/common/{src/lib → lib}/types.js +0 -0
  274. package/dist/common/{src/puppeteerConfiger.js → puppeteerConfiger.js} +0 -0
  275. package/dist/common/{src/web.html.js → web.html.js} +0 -0
  276. package/dist/module/{src/Node.js → Node.js} +0 -0
  277. package/dist/module/{src/PM → PM}/index.js +0 -0
  278. package/dist/module/{src/SubPackages → SubPackages}/react/component/node.js +0 -0
  279. package/dist/module/{src/SubPackages → SubPackages}/react/component/web.js +0 -0
  280. package/dist/module/{src/SubPackages → SubPackages}/react/jsx/web.js +0 -0
  281. package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/index.js +0 -0
  282. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
  283. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/index.js +0 -0
  284. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.js +0 -0
  285. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/node.js +0 -0
  286. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/web.js +0 -0
  287. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/fc/node.js +0 -0
  288. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/fc/web.js +0 -0
  289. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/node.js +0 -0
  290. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/web.js +0 -0
  291. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
  292. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/node.js +1 -1
  293. /package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  294. /package/dist/module/{src/Types.js → Types.js} +0 -0
  295. /package/dist/module/{src/Web.js → Web.js} +0 -0
  296. /package/dist/module/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.js +0 -0
  297. /package/dist/module/{src/esbuildConfigs → esbuildConfigs}/index.js +0 -0
  298. /package/dist/module/{src/lib → lib}/types.js +0 -0
  299. /package/dist/module/{src/puppeteerConfiger.js → puppeteerConfiger.js} +0 -0
  300. /package/dist/module/{src/web.html.js → web.html.js} +0 -0
  301. /package/dist/types/{src/Init.d.ts → Init.d.ts} +0 -0
  302. /package/dist/types/{src/build-tests.d.ts → ReportServer.d.ts} +0 -0
  303. /package/dist/types/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.d.ts +0 -0
  304. /package/dist/types/{src/init-docs.d.ts → build.d.ts} +0 -0
  305. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.d.ts +0 -0
  306. /package/dist/types/{src/run-tests.d.ts → init-docs.d.ts} +0 -0
  307. /package/dist/types/{src/puppeteerConfiger.d.ts → puppeteerConfiger.d.ts} +0 -0
  308. /package/dist/types/{src/web.html.d.ts → web.html.d.ts} +0 -0
package/src/Aider.ts DELETED
@@ -1,168 +0,0 @@
1
- import fs from "fs";
2
- import { exec, spawn } from "child_process";
3
-
4
- export const execCommand = async (command) => {
5
- const ls = spawn(command.split(" ")[0], command.split(" ").slice(1, -1));
6
-
7
- process.stdin.pipe(ls.stdin);
8
- ls.stdout.pipe(process.stdout);
9
- ls.stderr.pipe(process.stdout);
10
- // ls.stdout.on("data", function (data) {
11
- // console.log("stdout: " + data.toString());
12
- // });
13
-
14
- // ls.stderr.on("data", function (data) {
15
- // console.log("stderr: " + data.toString());
16
- // });
17
-
18
- ls.on("exit", function (code) {
19
- console.log("child process exited with code " + code?.toString() || -1);
20
- });
21
-
22
- // return new Promise<void>((resolve, reject) => {
23
- // const [cmd, ...args] = command.split(" ");
24
- // const childProcess = spawn(cmd, args);
25
- // childProcess.stdout.on("data", (data) => {
26
- // process.stdout.write(data.toString());
27
- // });
28
- // childProcess.stderr.on("data", (data) => {
29
- // process.stderr.write(data.toString());
30
- // });
31
- // childProcess.on("error", (error) => {
32
- // reject(error);
33
- // });
34
- // childProcess.on("exit", (code) => {
35
- // if (code === 0) {
36
- // resolve();
37
- // } else {
38
- // reject(new Error(`Command exited with code ${code}.`));
39
- // }
40
- // });
41
- // });
42
- };
43
-
44
- const key = process.argv[2];
45
- console.log(key);
46
- const exitcode = fs.readFileSync(`${key}/exitcode`).toString();
47
-
48
- console.log("exitcode", exitcode);
49
-
50
- // if (exitcode != "0") {
51
- if (exitcode != "0") {
52
- const inputFiles = JSON.parse(
53
- fs.readFileSync(`${key}/inputFiles.json`).toString()
54
- );
55
-
56
- inputFiles.push(`${key}/tests.json`);
57
-
58
- // const features = await await Promise.all(
59
- // Array.from(
60
- // new Set(
61
- // JSON.parse(fs.readFileSync(`${key}/tests.json`).toString())
62
- // .givens.reduce((mm: any[], lm: { features: any[] }) => {
63
- // mm.push(
64
- // lm.features.reduce((mm2: any[], lm2: any) => {
65
- // mm2.push(lm2);
66
- // return mm2;
67
- // }, [])
68
- // );
69
- // return mm;
70
- // }, [])
71
- // .flat()
72
- // .flat()
73
- // )
74
- // ) as string[]
75
- // );
76
-
77
- // const final = features.reduce((mm, [k, v], ndx) => {
78
- // mm[k] = v;
79
- // return mm;
80
- // }, {});
81
-
82
- // const as = JSON.stringify(final);
83
-
84
- // const scriptCommand = `aider --model deepseek --api-key deepseek=${
85
- // process.env.DEEPSEEK_KEY
86
- // } --message "Fix the failing tests" --read ${key}/inputFiles.json ${inputFiles
87
- // .map((i) => `--file ${i}`)
88
- // .join(" ")}`;
89
-
90
- const scriptCommand = `aider --message "Fix the failing tests" --model deepseek --api-key deepseek=${
91
- process.env.DEEPSEEK_KEY
92
- } --file ./${inputFiles.join(" ./")}`;
93
-
94
- console.log("scriptCommand", scriptCommand);
95
-
96
- execCommand(scriptCommand);
97
-
98
- // fs.writeFile(`./${key}/features.json`, as, () => {
99
- // inputFiles.push(`./${key}/features.json`);
100
-
101
- // // itermTab(scriptCommand).then(() => console.log("yay"));
102
-
103
- // // const child = spawn("xterm -e", scriptCommand.split(" "), {
104
- // // detached: true,
105
- // // stdio: "ignore",
106
- // // });
107
- // // runCommandInITerm(scriptCommand);
108
- // });
109
-
110
- // .reduce(async (mm, feature) => {
111
- // const req = await octokit.request(
112
- // `GET /repos/adamwong246/kokomobay-taskman/contents/Task/${feature}.json`,
113
- // {
114
- // owner: "adamwong246",
115
- // repo: "kokomoBay-taskman",
116
- // path: `Task/${feature}.json`,
117
- // headers: {
118
- // "X-GitHub-Api-Version": "2022-11-28",
119
- // },
120
- // }
121
- // );
122
-
123
- // const j = JSON.parse(atob(req.data.content));
124
- // (await mm).push([
125
- // feature,
126
- // JSON.stringify({
127
- // name: j.name,
128
- // body: j.body,
129
- // }),
130
- // ]);
131
-
132
- // return mm;
133
- // }, Promise.resolve<[string, string][]>([]))
134
- // .then((z) => {
135
- // const final = z.reduce((mm, [k, v], ndx) => {
136
- // mm[k] = v;
137
- // return mm;
138
- // }, {});
139
-
140
- // const as = JSON.stringify(final);
141
-
142
- // fs.writeFile(`./${key}/features.json`, as, () => {
143
- // inputFiles.push(`./${key}/features.json`);
144
-
145
- // const scriptCommand = `aider --model deepseek --api-key deepseek=${
146
- // process.env.DEEPSEEK_KEY
147
- // } --message "Fix the failing tests" ${inputFiles.join(" ")}`;
148
-
149
- // console.log("scriptCommand", scriptCommand);
150
-
151
- // execCommand(scriptCommand);
152
- // // itermTab(scriptCommand).then(() => console.log("yay"));
153
-
154
- // // const child = spawn("xterm -e", scriptCommand.split(" "), {
155
- // // detached: true,
156
- // // stdio: "ignore",
157
- // // });
158
- // // runCommandInITerm(scriptCommand);
159
- // });
160
- // //
161
- // });
162
-
163
- // features.then((x) => {
164
- // console.log("done", x);
165
- // });
166
- } else {
167
- console.log("that test is not failing");
168
- }
package/src/Project.ts DELETED
@@ -1,292 +0,0 @@
1
- import { spawn } from "child_process";
2
-
3
- import esbuild from "esbuild";
4
- import fs from "fs";
5
- import path from "path";
6
- import readline from "readline";
7
- import { glob } from "glob";
8
-
9
- import esbuildNodeConfiger from "./esbuildConfigs/node.js";
10
- import esbuildWebConfiger from "./esbuildConfigs/web.js";
11
- import webHtmlFrame from "./web.html.js";
12
- import { ITestTypes, IBaseConfig, IRunTime } from "./lib/types.js";
13
-
14
- readline.emitKeypressEvents(process.stdin);
15
- if (process.stdin.isTTY) process.stdin.setRawMode(true);
16
-
17
- const logContent: string[] = [];
18
-
19
- function parseTsErrors(): void {
20
- try {
21
- // const logContent = fs.readFileSync(logPath, "utf-8").split("\n");
22
- const regex = /(^src(.*?))\(\d*,\d*\): error/gm;
23
- const brokenFilesToLines: Record<string, Set<number>> = {};
24
-
25
- for (let i = 0; i < logContent.length - 1; i++) {
26
- let m;
27
-
28
- while ((m = regex.exec(logContent[i])) !== null) {
29
- // This is necessary to avoid infinite loops with zero-width matches
30
- if (m.index === regex.lastIndex) {
31
- regex.lastIndex++;
32
- }
33
- if (!brokenFilesToLines[m[1]]) {
34
- brokenFilesToLines[m[1]] = new Set<number>();
35
- }
36
- brokenFilesToLines[m[1]].add(i);
37
- }
38
- }
39
-
40
- const final = Object.keys(brokenFilesToLines).reduce((mm, lm, ndx) => {
41
- mm[lm] = Array.from(brokenFilesToLines[lm]).map((l, ndx3) => {
42
- const a = Array.from(brokenFilesToLines[lm]);
43
-
44
- return Object.keys(a).reduce((mm2, lm2, ndx2) => {
45
- const acc: string[] = [];
46
-
47
- let j = a[lm2] + 1;
48
-
49
- let working = true;
50
- while (j < logContent.length - 1 && working) {
51
- if (
52
- !logContent[j].match(regex) &&
53
- working &&
54
- !logContent[j].match(/^..\/(.*?)\(\d*,\d*\)/)
55
- ) {
56
- acc.push(logContent[j]);
57
- } else {
58
- working = false;
59
- }
60
-
61
- j++;
62
- }
63
-
64
- mm2[lm] = [logContent[l], ...acc];
65
-
66
- return mm2;
67
- }, {} as any)[lm];
68
- });
69
- return mm;
70
- }, {});
71
-
72
- Object.keys(final).forEach((k) => {
73
- fs.mkdirSync(`./docs/types/${k.split("/").slice(0, -1).join("/")}`, {
74
- recursive: true,
75
- });
76
- fs.writeFileSync(
77
- `./docs/types/${k}.type_errors.txt`,
78
- final[k].flat().flat().join("\r\n")
79
- );
80
- });
81
- } catch (error) {
82
- console.error("Error reading or parsing the log file:", error);
83
- process.exit(1);
84
- }
85
- }
86
-
87
- const compile = () => {
88
- return new Promise((resolve, reject) => {
89
- const tsc = spawn("tsc", ["-noEmit"]);
90
-
91
- tsc.stdout.on("data", (data) => {
92
- // console.log(`tsc stdout: ${data}`);
93
- const lines = data.toString().split("\n");
94
- logContent.push(...lines);
95
- });
96
-
97
- tsc.stderr.on("data", (data) => {
98
- console.error(`stderr: ${data}`);
99
- process.exit(-1);
100
- });
101
-
102
- tsc.on("close", (code) => {
103
- parseTsErrors();
104
- console.log("tsc done");
105
- resolve(`tsc process exited with code ${code}`);
106
- // if (code !== 0) {
107
- // resolve(`tsc process exited with code ${code}`);
108
- // // reject(`tsc process exited with code ${code}`);
109
- // } else {
110
- // resolve({});
111
- // }
112
- });
113
- });
114
- };
115
-
116
- export class ITProject {
117
- config: IBaseConfig;
118
- mode: `DEV` | `PROD`;
119
- nodeDone: boolean = false;
120
- webDone: boolean = false;
121
-
122
- constructor(configs: IBaseConfig) {
123
- this.config = configs;
124
-
125
- this.mode = this.config.devMode ? "DEV" : "PROD";
126
-
127
- process.stdin.on("keypress", (str, key) => {
128
- if (key.name === "q") {
129
- console.log("Testeranto-EsBuild is shutting down...");
130
- this.mode = "PROD";
131
- this.onDone();
132
- }
133
- });
134
-
135
- fs.writeFileSync(
136
- `${this.config.outdir}/testeranto.json`,
137
- JSON.stringify(
138
- {
139
- ...this.config,
140
- buildDir: process.cwd() + "/" + this.config.outdir,
141
- },
142
- null,
143
- 2
144
- )
145
- );
146
-
147
- Promise.resolve(
148
- Promise.all(
149
- [...this.getSecondaryEndpointsPoints("web")].map(
150
- async (sourceFilePath) => {
151
- const sourceFileSplit = sourceFilePath.split("/");
152
- const sourceDir = sourceFileSplit.slice(0, -1);
153
- const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
154
- const sourceFileNameMinusJs = sourceFileName
155
- .split(".")
156
- .slice(0, -1)
157
- .join(".");
158
-
159
- const htmlFilePath = path.normalize(
160
- `${process.cwd()}/${this.config.outdir}/web/${sourceDir.join(
161
- "/"
162
- )}/${sourceFileNameMinusJs}.html`
163
- );
164
- const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
165
-
166
- return fs.promises
167
- .mkdir(path.dirname(htmlFilePath), { recursive: true })
168
- .then((x) =>
169
- fs.writeFileSync(
170
- htmlFilePath,
171
- webHtmlFrame(jsfilePath, htmlFilePath)
172
- )
173
- );
174
- }
175
- )
176
- )
177
- );
178
-
179
- const [nodeEntryPoints, webEntryPoints] = getRunnables(this.config.tests);
180
-
181
- glob(`./${this.config.outdir}/chunk-*.mjs`, {
182
- ignore: "node_modules/**",
183
- }).then((chunks) => {
184
- chunks.forEach((chunk) => {
185
- fs.unlinkSync(chunk);
186
- });
187
- });
188
-
189
- Promise.all([
190
- compile(),
191
-
192
- esbuild
193
- .context(esbuildNodeConfiger(this.config, nodeEntryPoints))
194
- .then(async (nodeContext) => {
195
- if (this.config.devMode) {
196
- await nodeContext.watch().then((v) => {
197
- this.onNodeDone();
198
- });
199
- } else {
200
- nodeContext.rebuild().then((v) => {
201
- this.onNodeDone();
202
- });
203
- }
204
-
205
- return nodeContext;
206
- }),
207
- esbuild
208
- .context(esbuildWebConfiger(this.config, webEntryPoints))
209
- .then(async (webContext) => {
210
- if (this.config.devMode) {
211
- await webContext.watch().then((v) => {
212
- this.onWebDone();
213
- });
214
- } else {
215
- webContext.rebuild().then((v) => {
216
- this.onWebDone();
217
- });
218
- }
219
- return webContext;
220
- }),
221
- ]);
222
- }
223
-
224
- onNodeDone = () => {
225
- this.nodeDone = true;
226
- this.onDone();
227
- };
228
- onWebDone = () => {
229
- this.webDone = true;
230
- this.onDone();
231
- };
232
-
233
- onDone = () => {
234
- // console.log(this.nodeDone && this.webDone && this.mode === "PROD");
235
- if (this.nodeDone && this.webDone && this.mode === "PROD") {
236
- console.log("Testeranto-EsBuild is all done. Goodbye!");
237
- process.exit();
238
- } else {
239
- if (this.mode === "PROD") {
240
- console.log("waiting for tests to finish");
241
- console.log(
242
- JSON.stringify(
243
- {
244
- nodeDone: this.nodeDone,
245
- webDone: this.webDone,
246
- mode: this.mode,
247
- },
248
- null,
249
- 2
250
- )
251
- );
252
- } else {
253
- console.log("waiting for tests to change");
254
- }
255
- console.log("press 'q' to quit");
256
- }
257
- };
258
-
259
- public getSecondaryEndpointsPoints(runtime?: IRunTime): string[] {
260
- const meta = (ts: ITestTypes[], st: Set<string>): Set<string> => {
261
- ts.forEach((t) => {
262
- if (t[1] === runtime) {
263
- st.add(t[0]);
264
- }
265
- if (Array.isArray(t[3])) {
266
- meta(t[3], st);
267
- }
268
- });
269
- return st;
270
- };
271
- return Array.from(meta(this.config.tests, new Set()));
272
- }
273
- }
274
-
275
- const getRunnables = (
276
- tests: ITestTypes[],
277
- payload = [new Set<string>(), new Set<string>()]
278
- ): [Set<string>, Set<string>] => {
279
- return tests.reduce((pt, cv, cndx, cry) => {
280
- if (cv[1] === "node") {
281
- pt[0].add(cv[0]);
282
- } else if (cv[1] === "web") {
283
- pt[1].add(cv[0]);
284
- }
285
-
286
- if (cv[3].length) {
287
- getRunnables(cv[3], payload);
288
- }
289
-
290
- return pt;
291
- }, payload as [Set<string>, Set<string>]);
292
- };
package/src/Puppeteer.ts DELETED
@@ -1,143 +0,0 @@
1
- import readline from "readline";
2
- import fs from "fs";
3
- import watch from "recursive-watch";
4
-
5
- import { PM_Main } from "./PM/main.js";
6
- import { destinationOfRuntime } from "./utils.js";
7
- import { IBaseConfig, IBuiltConfig } from "./lib/types.js";
8
-
9
- readline.emitKeypressEvents(process.stdin);
10
- if (process.stdin.isTTY) process.stdin.setRawMode(true);
11
-
12
- export default async (partialConfig) => {
13
- const config: IBuiltConfig = {
14
- ...partialConfig,
15
- buildDir: process.cwd() + "/" + partialConfig.outdir,
16
- };
17
-
18
- fs.writeFileSync(
19
- `${config.outdir}/testeranto.json`,
20
- JSON.stringify(
21
- {
22
- ...config,
23
- buildDir: process.cwd() + "/" + config.outdir,
24
- },
25
- null,
26
- 2
27
- )
28
- );
29
-
30
- const pm = new PM_Main(config);
31
-
32
- await pm.startPuppeteer(
33
- {
34
- // timeout: 1,
35
- waitForInitialPage: false,
36
- executablePath:
37
- // process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
38
- "/opt/homebrew/bin/chromium",
39
- headless: true,
40
- dumpio: true,
41
- // timeout: 0,
42
- devtools: true,
43
- args: [
44
- "--auto-open-devtools-for-tabs",
45
- `--remote-debugging-port=3234`,
46
-
47
- // "--disable-features=IsolateOrigins,site-per-process",
48
- "--disable-site-isolation-trials",
49
- "--allow-insecure-localhost",
50
- "--allow-file-access-from-files",
51
- "--allow-running-insecure-content",
52
-
53
- "--disable-dev-shm-usage",
54
- "--disable-extensions",
55
- "--disable-gpu",
56
- "--disable-setuid-sandbox",
57
- "--disable-site-isolation-trials",
58
- "--disable-web-security",
59
- "--no-first-run",
60
- "--no-sandbox",
61
- "--no-startup-window",
62
- // "--no-zygote",
63
- "--reduce-security-for-testing",
64
- "--remote-allow-origins=*",
65
- "--unsafely-treat-insecure-origin-as-secure=*",
66
- // "--disable-features=IsolateOrigins",
67
- // "--remote-allow-origins=ws://localhost:3234",
68
- // "--single-process",
69
- // "--unsafely-treat-insecure-origin-as-secure",
70
- // "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
71
-
72
- // "--disk-cache-dir=/dev/null",
73
- // "--disk-cache-size=1",
74
- // "--start-maximized",
75
- ],
76
- },
77
- "."
78
- );
79
-
80
- console.log(
81
- "\n Puppeteer is running. Press 'q' to shutdown softly. Press 'x' to shutdown forcefully.\n"
82
- );
83
- process.stdin.on("keypress", (str, key) => {
84
- if (key.name === "q") {
85
- pm.shutDown();
86
- }
87
- if (key.name === "x") {
88
- process.exit(-1);
89
- }
90
- });
91
-
92
- config.tests.forEach(([test, runtime, tr, sidecars]) => {
93
- if (runtime === "node") {
94
- pm.launchNode(test, destinationOfRuntime(test, "node", config));
95
- } else if (runtime === "web") {
96
- pm.launchWeb(test, destinationOfRuntime(test, "web", config), sidecars);
97
- } else {
98
- console.error("runtime makes no sense", runtime);
99
- }
100
- });
101
-
102
- if (config.devMode) {
103
- console.log("ready and watching for changes...", config.buildDir);
104
-
105
- watch(config.buildDir, (eventType, changedFile) => {
106
- if (changedFile) {
107
- config.tests.forEach(([test, runtime, tr, sidecars]) => {
108
- if (eventType === "change" || eventType === "rename") {
109
- if (
110
- changedFile ===
111
- test
112
- .replace("./", "node/")
113
- .split(".")
114
- .slice(0, -1)
115
- .concat("mjs")
116
- .join(".")
117
- ) {
118
- pm.launchNode(test, destinationOfRuntime(test, "node", config));
119
- }
120
-
121
- if (
122
- changedFile ===
123
- test
124
- .replace("./", "web/")
125
- .split(".")
126
- .slice(0, -1)
127
- .concat("mjs")
128
- .join(".")
129
- ) {
130
- pm.launchWeb(
131
- test,
132
- destinationOfRuntime(test, "web", config),
133
- sidecars
134
- );
135
- }
136
- }
137
- });
138
- }
139
- });
140
- } else {
141
- pm.shutDown();
142
- }
143
- };
@@ -1,51 +0,0 @@
1
- import React from "react";
2
-
3
- import Testeranto from "../Node.js";
4
-
5
- import {
6
- IBaseTest,
7
- IPartialNodeInterface,
8
- ITestImplementation,
9
- ITestSpecification,
10
- } from "../Types";
11
-
12
- type IInput = string;
13
- type ISelection = any;
14
- type IStore = any;
15
- type ISubject = any;
16
-
17
- export type IImpl<ISpec extends IBaseTest> = ITestImplementation<ISpec>;
18
-
19
- export type ISpec<T extends IBaseTest> = ITestSpecification<T>;
20
-
21
- export default <ITestShape extends IBaseTest>(
22
- testInput: IInput,
23
- testSpecifications: ISpec<ITestShape>,
24
- testImplementations: ITestImplementation<ITestShape>,
25
- testInterface?: IPartialNodeInterface<ITestShape>
26
- ) => {
27
- return Testeranto<ITestShape>(
28
- testInput,
29
- testSpecifications,
30
- testImplementations,
31
- {
32
- beforeAll: (x) => {
33
- // process.parentPort.postMessage(
34
- // `/docs/web/src/ClassicalComponent/test.html`
35
- // );
36
-
37
- return x;
38
- },
39
- beforeEach: async (): Promise<IStore> => {
40
- return new Promise((resolve, rej) => {
41
- resolve(React.createElement(testInput, {}, []));
42
- });
43
- },
44
- andWhen: function (s: IStore, whenCB): Promise<ISelection> {
45
- return whenCB()(s);
46
- },
47
-
48
- ...testInterface,
49
- }
50
- );
51
- };
@@ -1,12 +0,0 @@
1
- import process from "process";
2
-
3
- import { ITProject } from "./Project";
4
-
5
- if (!process.argv[2]) {
6
- console.log("You didn't pass a config file");
7
- process.exit(-1);
8
- } else {
9
- import(process.cwd() + "/" + process.argv[2]).then((module) => {
10
- new ITProject(module.default);
11
- });
12
- }
@@ -1,17 +0,0 @@
1
- import { BuildOptions } from "esbuild";
2
- import { IBaseConfig } from "../lib/types";
3
-
4
- export default (config: IBaseConfig): BuildOptions => {
5
- return {
6
- bundle: true,
7
- entryPoints: [config.features],
8
- minify: config.minify === true,
9
- outbase: config.outbase,
10
- write: true,
11
-
12
- outfile: `${config.outdir}/features.test.js`,
13
- // external: ["graphology"],
14
-
15
- format: "esm",
16
- };
17
- };
@@ -1,15 +0,0 @@
1
- // import { BuildOptions } from "esbuild";
2
-
3
- // import { IBaseConfig } from "../lib/types";
4
-
5
- // export default (config: IBaseConfig): BuildOptions => {
6
- // return {
7
- // bundle: true,
8
- // entryPoints: ["./node_modules/testeranto/dist/module/report.js"],
9
- // minify: config.minify === true,
10
- // outbase: config.outbase,
11
- // write: true,
12
- // outfile: `${config.outdir}/report.js`,
13
- // external: ["tests.json", "features.test.js"],
14
- // };
15
- // };