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
@@ -16,18 +16,9 @@ exports.default = (config, entryPoints) => {
16
16
  "process.env.FLUENTFFMPEG_COV": "0",
17
17
  }, absWorkingDir: process.cwd(), banner: {
18
18
  js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
19
- }, platform: "node", external: [
20
- // "testeranto.json",
21
- // "features.test.js",
22
- "react",
23
- // "events",
24
- // "ganache"
25
- ...config.externals,
26
- ], entryPoints: [...entryPoints], plugins: [
19
+ }, platform: "node", external: ["react", ...config.externals], entryPoints: [...entryPoints], plugins: [
27
20
  featuresPlugin_1.default,
28
- ...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
29
21
  inputFilesPluginFactory,
30
- // inputFilesPlugin("node", entryPoints),
31
22
  {
32
23
  name: "rebuild-notify",
33
24
  setup(build) {
@@ -41,5 +32,6 @@ exports.default = (config, entryPoints) => {
41
32
  });
42
33
  },
43
34
  },
35
+ ...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
44
36
  ] });
45
37
  };
@@ -9,19 +9,9 @@ const inputFilesPlugin_js_1 = __importDefault(require("./inputFilesPlugin.js"));
9
9
  const featuresPlugin_js_1 = __importDefault(require("./featuresPlugin.js"));
10
10
  exports.default = (config, entryPoints) => {
11
11
  const { inputFilesPluginFactory, register } = (0, inputFilesPlugin_js_1.default)("web", entryPoints);
12
- return Object.assign(Object.assign({}, (0, index_js_1.default)(config)), {
13
- // inject: ["./node_modules/testeranto/dist/cjs-shim.js"],
14
- // banner: {
15
- // js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
16
- // },
17
- // splitting: true,
18
- outdir: config.outdir + "/web", alias: {
12
+ return Object.assign(Object.assign({}, (0, index_js_1.default)(config)), { outdir: config.outdir + "/web", alias: {
19
13
  react: path_1.default.resolve("./node_modules/react"),
20
14
  }, metafile: true, external: [
21
- // "testeranto.json",
22
- // "features.test.ts",
23
- // "url",
24
- // "react",
25
15
  "path",
26
16
  "fs",
27
17
  "stream",
@@ -41,8 +31,6 @@ exports.default = (config, entryPoints) => {
41
31
  "dns",
42
32
  ], platform: "browser", entryPoints: [...entryPoints], plugins: [
43
33
  featuresPlugin_js_1.default,
44
- // markdownPlugin({}),
45
- ...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
46
34
  inputFilesPluginFactory,
47
35
  {
48
36
  name: "rebuild-notify",
@@ -57,5 +45,6 @@ exports.default = (config, entryPoints) => {
57
45
  });
58
46
  },
59
47
  },
48
+ ...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
60
49
  ] });
61
50
  };
@@ -15,29 +15,39 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
28
38
  Object.defineProperty(exports, "__esModule", { value: true });
29
39
  const fs_1 = __importDefault(require("fs"));
30
- const Init_1 = __importDefault(require("../dist/module/src/Init"));
40
+ const Init_1 = __importDefault(require("./Init"));
31
41
  console.log("Initializing a testeranto project");
32
42
  if (!process.argv[2]) {
33
43
  console.log("You didn't pass a config file, so I will create one for you.");
34
44
  fs_1.default.writeFileSync("testeranto.mts", fs_1.default.readFileSync("node_modules/testeranto/src/defaultConfig.ts"));
35
- Promise.resolve().then(() => __importStar(require(process.cwd() + "/" + "testeranto.mts"))).then((module) => {
45
+ Promise.resolve(`${process.cwd() + "/" + "testeranto.mts"}`).then(s => __importStar(require(s))).then((module) => {
36
46
  (0, Init_1.default)(module.default);
37
47
  });
38
48
  }
39
49
  else {
40
- Promise.resolve().then(() => __importStar(require(process.cwd() + "/" + process.argv[2]))).then((module) => {
50
+ Promise.resolve(`${process.cwd() + "/" + process.argv[2]}`).then(s => __importStar(require(s))).then((module) => {
41
51
  (0, Init_1.default)(module.default);
42
52
  });
43
53
  }
@@ -60,6 +60,7 @@ class BaseSuite {
60
60
  if (prop === "writeFileSync") {
61
61
  return (fp, contents) => target[prop](`suite-${sNdx}/beforeAll/${fp}`, contents);
62
62
  }
63
+ /* @ts-ignore:next-line */
63
64
  return Reflect.get(...arguments);
64
65
  },
65
66
  });
@@ -160,6 +161,7 @@ class BaseGiven {
160
161
  if (prop === "screencast") {
161
162
  return (opts, p) => target.screencast(Object.assign(Object.assign({}, opts), { path: `suite-${suiteNdx}/given-${key}/when/beforeEach/${opts.path}` }), p);
162
163
  }
164
+ /* @ts-ignore:next-line */
163
165
  return Reflect.get(...arguments);
164
166
  },
165
167
  });
@@ -194,6 +196,7 @@ class BaseGiven {
194
196
  if (prop === "writeFileSync") {
195
197
  return (fp, contents) => target[prop](`suite-${suiteNdx}/given-${key}/afterEach/${fp}`, contents);
196
198
  }
199
+ /* @ts-ignore:next-line */
197
200
  return Reflect.get(...arguments);
198
201
  },
199
202
  });
@@ -231,6 +234,7 @@ class BaseWhen {
231
234
  if (prop === "writeFileSync") {
232
235
  return (fp, contents) => target[prop](`${filepath}/andWhen/${fp}`, contents);
233
236
  }
237
+ /* @ts-ignore:next-line */
234
238
  return Reflect.get(...arguments);
235
239
  },
236
240
  });
@@ -275,6 +279,7 @@ class BaseThen {
275
279
  if (prop === "writeFileSync") {
276
280
  return (fp, contents) => target[prop](`${filepath}/${fp}`, contents);
277
281
  }
282
+ /* @ts-ignore:next-line */
278
283
  return Reflect.get(...arguments);
279
284
  },
280
285
  });
@@ -304,7 +309,7 @@ class BaseCheck {
304
309
  }
305
310
  async check(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm) {
306
311
  tLog(`\n Check: ${this.name}`);
307
- const store = await this.checkThat(subject, testResourceConfiguration, artifactory);
312
+ const store = await this.checkThat(subject, testResourceConfiguration, artifactory, pm);
308
313
  await this.checkCB(Object.entries(this.whens).reduce((a, [key, when]) => {
309
314
  a[key] = async (payload) => {
310
315
  return await when(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog, pm, "x");
@@ -42,17 +42,30 @@ class BaseBuilder {
42
42
  const numberOfFailures = Object.keys(suiteDone.givens).filter((k) => {
43
43
  return suiteDone.givens[k].error;
44
44
  }).length;
45
- puppetMaster.writeFileSync(`exitcode`, numberOfFailures.toString());
46
- // if (numberOfFailures > 0) {
47
- // puppetMaster.writeFileSync(
48
- // `prompt`,
49
- // `
50
- // aider --message "make a script that prints hello" hello.js
51
- // `
52
- // );
53
- // }
45
+ puppetMaster.writeFileSync(`bdd_errors.txt`, numberOfFailures.toString());
46
+ const o = this.toObj();
47
+ puppetMaster.writeFileSync(`littleBoard.html`, `
48
+ <!DOCTYPE html>
49
+ <html lang="en">
50
+
51
+ <head>
52
+ <meta name="description" content="Webpage description goes here" />
53
+ <meta charset="utf-8" />
54
+ <title>kokomoBay - testeranto</title>
55
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
56
+ <meta name="author" content="" />
57
+
58
+ <link rel="stylesheet" href="/kokomoBay/docs/TestReport.css" />
59
+ <script src="/kokomoBay/docs/TestReport.js"></script>
60
+
61
+ </head>
62
+
63
+ <body>
64
+ <h1>Test report</h1>
65
+ <div id="root"/>
66
+ </body>
67
+ `);
54
68
  puppetMaster.writeFileSync(`tests.json`, JSON.stringify(this.toObj(), null, 2));
55
- // console.log(`exiting gracefully with ${numberOfFailures} failures.`);
56
69
  return {
57
70
  failed: numberOfFailures,
58
71
  artifacts: this.artifacts || [],
@@ -34,9 +34,7 @@ class ClassBuilder extends basebuilder_js_1.BaseBuilder {
34
34
  };
35
35
  return a;
36
36
  }, {});
37
- super(input, classySuites, classyGivens, classyWhens, classyThens, classyChecks, testResourceRequirement, testSpecification
38
- // puppetMaster
39
- );
37
+ super(input, classySuites, classyGivens, classyWhens, classyThens, classyChecks, testResourceRequirement, testSpecification);
40
38
  }
41
39
  }
42
40
  exports.ClassBuilder = ClassBuilder;
@@ -8,16 +8,22 @@ class Testeranto extends classBuilder_js_1.ClassBuilder {
8
8
  const fullTestInterface = (0, index_js_1.DefaultTestInterface)(testInterface);
9
9
  super(testImplementation, testSpecification, input, class extends abstractBase_js_1.BaseSuite {
10
10
  afterAll(store, artifactory, pm) {
11
- return fullTestInterface.afterAll(store, (fPath, value) => {
12
- artifactory(`afterAll4-${this.name}/${fPath}`, value);
13
- }, pm);
11
+ return fullTestInterface.afterAll(store,
12
+ // (fPath: string, value: unknown) =>
13
+ // // TODO does not work?
14
+ // {
15
+ // artifactory(`afterAll4-${this.name}/${fPath}`, value);
16
+ // },
17
+ pm);
14
18
  }
15
19
  assertThat(t) {
16
20
  fullTestInterface.assertThis(t);
17
21
  }
18
22
  async setup(s, artifactory, tr, pm) {
19
23
  return (fullTestInterface.beforeAll ||
20
- (async (input, artifactory, tr, pm) => input))(s, this.testResourceConfiguration, artifactory, pm);
24
+ (async (input, artifactory, tr, pm) => input))(s, this.testResourceConfiguration,
25
+ // artifactory,
26
+ pm);
21
27
  }
22
28
  }, class Given extends abstractBase_js_1.BaseGiven {
23
29
  constructor() {
@@ -25,10 +31,15 @@ class Testeranto extends classBuilder_js_1.ClassBuilder {
25
31
  this.uberCatcher = uberCatcher;
26
32
  }
27
33
  async givenThat(subject, testResource, artifactory, initializer, initialValues, pm) {
28
- return fullTestInterface.beforeEach(subject, initializer, artifactory, testResource, initialValues, pm);
34
+ return fullTestInterface.beforeEach(subject, initializer,
35
+ // artifactory,
36
+ testResource, initialValues, pm);
29
37
  }
30
38
  afterEach(store, key, artifactory, pm) {
31
- return new Promise((res) => res(fullTestInterface.afterEach(store, key, (fPath, value) => artifactory(`after/${fPath}`, value), pm)));
39
+ return new Promise((res) => res(fullTestInterface.afterEach(store, key,
40
+ // (fPath: string, value: unknown) =>
41
+ // artifactory(`after/${fPath}`, value),
42
+ pm)));
32
43
  }
33
44
  }, class When extends abstractBase_js_1.BaseWhen {
34
45
  async andWhen(store, whenCB, testResource, pm) {
@@ -88,12 +99,17 @@ class Testeranto extends classBuilder_js_1.ClassBuilder {
88
99
  this.initialValues = initialValues;
89
100
  }
90
101
  async checkThat(subject, testResourceConfiguration, artifactory, pm) {
91
- return fullTestInterface.beforeEach(subject, this.initialValues, (fPath, value) => artifactory(`before/${fPath}`, value), testResourceConfiguration, this.initialValues, pm);
102
+ return fullTestInterface.beforeEach(subject, this.initialValues,
103
+ // (fPath: string, value: unknown) =>
104
+ // artifactory(`before/${fPath}`, value),
105
+ testResourceConfiguration, this.initialValues, pm);
92
106
  }
93
107
  afterEach(store, key, artifactory, pm) {
94
- return new Promise((res) => res(fullTestInterface.afterEach(store, key, (fPath, value) =>
95
- // TODO does not work?
96
- artifactory(`afterEach2-${this.name}/${fPath}`, value), pm)));
108
+ return new Promise((res) => res(fullTestInterface.afterEach(store, key,
109
+ // (fPath: string, value: unknown) =>
110
+ // // TODO does not work?
111
+ // artifactory(`afterEach2-${this.name}/${fPath}`, value),
112
+ pm)));
97
113
  }
98
114
  }, testResourceRequirement);
99
115
  }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultTestResourceRequirement = exports.DefaultTestInterface = exports.BaseTestInterface = void 0;
4
- // import { INodeUtils, ITestInterface, IUtils, IWebUtils } from "./types.js";
5
4
  exports.BaseTestInterface = {
6
5
  beforeAll: async (s) => s,
7
6
  beforeEach: async function (subject, initialValues, x, testResource, pm) {
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
- // import { IBaseTest } from "../Types";
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,297 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ const ansi_colors_1 = __importDefault(require("ansi-colors"));
40
+ const fs_1 = require("fs");
41
+ const path_1 = __importDefault(require("path"));
42
+ const node_crypto_1 = __importDefault(require("node:crypto"));
43
+ const fs_2 = __importDefault(require("fs"));
44
+ const tsc_prog_1 = __importDefault(require("tsc-prog"));
45
+ const eslint_1 = require("eslint");
46
+ const typescript_1 = __importDefault(require("typescript"));
47
+ const readline_1 = __importDefault(require("readline"));
48
+ const main_1 = require("./PM/main");
49
+ const utils_1 = require("./utils");
50
+ console.log(ansi_colors_1.default.inverse("Press 'x' to shutdown forcefully."));
51
+ readline_1.default.emitKeypressEvents(process.stdin);
52
+ if (process.stdin.isTTY)
53
+ process.stdin.setRawMode(true);
54
+ process.stdin.on("keypress", (str, key) => {
55
+ if (key.name === "x") {
56
+ console.log(ansi_colors_1.default.inverse("Shutting down forcefully..."));
57
+ process.exit(-1);
58
+ }
59
+ });
60
+ async function fileHash(filePath, algorithm = "md5") {
61
+ return new Promise((resolve, reject) => {
62
+ const hash = node_crypto_1.default.createHash(algorithm);
63
+ const fileStream = fs_2.default.createReadStream(filePath);
64
+ fileStream.on("data", (data) => {
65
+ hash.update(data);
66
+ });
67
+ fileStream.on("end", () => {
68
+ const fileHash = hash.digest("hex");
69
+ resolve(fileHash);
70
+ });
71
+ fileStream.on("error", (error) => {
72
+ reject(`Error reading file: ${error.message}`);
73
+ });
74
+ });
75
+ }
76
+ async function filesHash(files, algorithm = "md5") {
77
+ return new Promise((resolve, reject) => {
78
+ resolve(files.reduce(async (mm, f) => {
79
+ return (await mm) + (await fileHash(f));
80
+ }, Promise.resolve("")));
81
+ });
82
+ }
83
+ const getRunnables = (tests, payload = {
84
+ nodeEntryPoints: {},
85
+ webEntryPoints: {},
86
+ }) => {
87
+ return tests.reduce((pt, cv, cndx, cry) => {
88
+ if (cv[1] === "node") {
89
+ pt.nodeEntryPoints[cv[0]] = path_1.default.resolve(`./docs/node/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
90
+ }
91
+ else if (cv[1] === "web") {
92
+ pt.webEntryPoints[cv[0]] = path_1.default.resolve(`./docs/web/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
93
+ }
94
+ if (cv[3].length) {
95
+ getRunnables(cv[3], payload);
96
+ }
97
+ return pt;
98
+ }, payload);
99
+ };
100
+ const changes = {};
101
+ const tscCheck = async ({ entrypoint, addableFiles, platform, }) => {
102
+ console.log(ansi_colors_1.default.green(ansi_colors_1.default.inverse(`tsc < ${entrypoint}`)));
103
+ const program = tsc_prog_1.default.createProgramFromConfig({
104
+ basePath: process.cwd(), // always required, used for relative paths
105
+ configFilePath: "tsconfig.json", // config to inherit from (optional)
106
+ compilerOptions: {
107
+ rootDir: "src",
108
+ outDir: (0, utils_1.tscPather)(entrypoint, platform),
109
+ // declaration: true,
110
+ // skipLibCheck: true,
111
+ noEmit: true,
112
+ },
113
+ include: addableFiles, //["src/**/*"],
114
+ // exclude: ["**/*.test.ts", "**/*.spec.ts"],
115
+ });
116
+ const tscPath = (0, utils_1.tscPather)(entrypoint, platform);
117
+ let allDiagnostics = program.getSemanticDiagnostics();
118
+ const d = [];
119
+ allDiagnostics.forEach((diagnostic) => {
120
+ if (diagnostic.file) {
121
+ let { line, character } = typescript_1.default.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
122
+ let message = typescript_1.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
123
+ d.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
124
+ }
125
+ else {
126
+ d.push(typescript_1.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n"));
127
+ }
128
+ });
129
+ fs_2.default.writeFileSync(tscPath, d.join("\n"));
130
+ fs_2.default.writeFileSync((0, utils_1.tscExitCodePather)(entrypoint, platform), d.length.toString());
131
+ };
132
+ const eslint = new eslint_1.ESLint();
133
+ const formatter = await eslint.loadFormatter("./node_modules/testeranto/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs");
134
+ const eslintCheck = async (entrypoint, platform, addableFiles) => {
135
+ console.log(ansi_colors_1.default.green(ansi_colors_1.default.inverse(`eslint < ${entrypoint}`)));
136
+ const results = (await eslint.lintFiles(addableFiles))
137
+ .filter((r) => r.messages.length)
138
+ .filter((r) => {
139
+ return r.messages[0].ruleId !== null;
140
+ })
141
+ .map((r) => {
142
+ delete r.source;
143
+ return r;
144
+ });
145
+ fs_2.default.writeFileSync((0, utils_1.lintPather)(entrypoint, platform), await formatter.format(results));
146
+ fs_2.default.writeFileSync((0, utils_1.lintExitCodePather)(entrypoint, platform), results.length.toString());
147
+ };
148
+ const makePrompt = async (entryPoint, addableFiles, platform) => {
149
+ const promptPath = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `prompt.txt`);
150
+ const testPaths = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `tests.json`);
151
+ const featuresPath = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `featurePrompt.txt`);
152
+ fs_2.default.writeFileSync(promptPath, `
153
+ ${addableFiles
154
+ .map((x) => {
155
+ return `/add ${x}`;
156
+ })
157
+ .join("\n")}
158
+
159
+ /read ${(0, utils_1.lintPather)(entryPoint, platform)}
160
+ /read ${(0, utils_1.tscPather)(entryPoint, platform)}
161
+ /read ${testPaths}
162
+
163
+ /load ${featuresPath}
164
+
165
+ /code Fix the failing tests described in ${testPaths}. Correct any type signature errors described in the files ${(0, utils_1.tscPather)(entryPoint, platform)}. Implement any method which throws "Function not implemented. Resolve the lint errors described in ${(0, utils_1.lintPather)(entryPoint, platform)}"
166
+ `);
167
+ };
168
+ const metafileOutputs = async (platform) => {
169
+ const metafile = JSON.parse(fs_2.default.readFileSync(`docs/${platform}/metafile.json`).toString()).metafile;
170
+ if (!metafile)
171
+ return;
172
+ const outputs = metafile.outputs;
173
+ Object.keys(outputs).forEach(async (k) => {
174
+ const addableFiles = Object.keys(outputs[k].inputs).filter((i) => {
175
+ if (!fs_2.default.existsSync(i))
176
+ return false;
177
+ if (i.startsWith("node_modules"))
178
+ return false;
179
+ return true;
180
+ });
181
+ const f = `${k.split(".").slice(0, -1).join(".")}/`;
182
+ if (!fs_2.default.existsSync(f)) {
183
+ fs_2.default.mkdirSync(f);
184
+ }
185
+ const entrypoint = outputs[k].entryPoint;
186
+ if (entrypoint) {
187
+ const changeDigest = await filesHash(addableFiles);
188
+ if (changeDigest === changes[entrypoint]) {
189
+ // skip
190
+ }
191
+ else {
192
+ changes[entrypoint] = changeDigest;
193
+ tscCheck({ platform, addableFiles, entrypoint });
194
+ eslintCheck(entrypoint, platform, addableFiles);
195
+ makePrompt(entrypoint, addableFiles, platform);
196
+ }
197
+ }
198
+ });
199
+ };
200
+ Promise.resolve(`${process.cwd() + "/" + process.argv[2]}`).then(s => __importStar(require(s))).then(async (module) => {
201
+ const rawConfig = module.default;
202
+ const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/" + rawConfig.outdir });
203
+ let mode = config.devMode ? "DEV" : "PROD";
204
+ const fileHashes = {};
205
+ let pm = new main_1.PM_Main(config);
206
+ console.log(ansi_colors_1.default.inverse(`Press 'q' to shutdown gracefully`));
207
+ process.stdin.on("keypress", (str, key) => {
208
+ if (key.name === "q") {
209
+ console.log(ansi_colors_1.default.inverse("Testeranto-Run is shutting down gracefully..."));
210
+ mode = "PROD";
211
+ // onDone();
212
+ nodeMetafileWatcher.close();
213
+ webMetafileWatcher.close();
214
+ pm.shutDown();
215
+ }
216
+ });
217
+ metafileOutputs("node");
218
+ const nodeMetafileWatcher = (0, fs_1.watch)("docs/node/metafile.json", async (e, filename) => {
219
+ console.log(ansi_colors_1.default.green(ansi_colors_1.default.inverse(`< ${e} ${filename} (node)`)));
220
+ metafileOutputs("node");
221
+ });
222
+ metafileOutputs("web");
223
+ const webMetafileWatcher = (0, fs_1.watch)("docs/web/metafile.json", async (e, filename) => {
224
+ console.log(ansi_colors_1.default.green(ansi_colors_1.default.inverse(`< ${e} ${filename} (web)`)));
225
+ metafileOutputs("web");
226
+ });
227
+ await pm.startPuppeteer({
228
+ slowMo: 1,
229
+ // timeout: 1,
230
+ waitForInitialPage: false,
231
+ executablePath:
232
+ // process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
233
+ "/opt/homebrew/bin/chromium",
234
+ headless: true,
235
+ dumpio: true,
236
+ // timeout: 0,
237
+ devtools: true,
238
+ args: [
239
+ "--auto-open-devtools-for-tabs",
240
+ `--remote-debugging-port=3234`,
241
+ // "--disable-features=IsolateOrigins,site-per-process",
242
+ "--disable-site-isolation-trials",
243
+ "--allow-insecure-localhost",
244
+ "--allow-file-access-from-files",
245
+ "--allow-running-insecure-content",
246
+ "--disable-dev-shm-usage",
247
+ "--disable-extensions",
248
+ "--disable-gpu",
249
+ "--disable-setuid-sandbox",
250
+ "--disable-site-isolation-trials",
251
+ "--disable-web-security",
252
+ "--no-first-run",
253
+ "--no-sandbox",
254
+ "--no-startup-window",
255
+ // "--no-zygote",
256
+ "--reduce-security-for-testing",
257
+ "--remote-allow-origins=*",
258
+ "--unsafely-treat-insecure-origin-as-secure=*",
259
+ // "--disable-features=IsolateOrigins",
260
+ // "--remote-allow-origins=ws://localhost:3234",
261
+ // "--single-process",
262
+ // "--unsafely-treat-insecure-origin-as-secure",
263
+ // "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
264
+ // "--disk-cache-dir=/dev/null",
265
+ // "--disk-cache-size=1",
266
+ // "--start-maximized",
267
+ ],
268
+ }, ".");
269
+ const { nodeEntryPoints, webEntryPoints } = getRunnables(config.tests);
270
+ Object.entries(nodeEntryPoints).forEach(([k, outputFile]) => {
271
+ pm.launchNode(k, outputFile);
272
+ try {
273
+ (0, fs_1.watch)(outputFile, async (e, filename) => {
274
+ const hash = await fileHash(outputFile);
275
+ if (fileHashes[k] !== hash) {
276
+ fileHashes[k] = hash;
277
+ console.log(ansi_colors_1.default.green(ansi_colors_1.default.inverse(`< ${e} ${filename}`)));
278
+ pm.launchNode(k, outputFile);
279
+ }
280
+ });
281
+ }
282
+ catch (e) {
283
+ console.error(e);
284
+ }
285
+ });
286
+ Object.entries(webEntryPoints).forEach(([k, outputFile]) => {
287
+ pm.launchWeb(k, outputFile);
288
+ (0, fs_1.watch)(outputFile, async (e, filename) => {
289
+ const hash = await fileHash(outputFile);
290
+ if (fileHashes[k] !== hash) {
291
+ fileHashes[k] = hash;
292
+ console.log(ansi_colors_1.default.green(ansi_colors_1.default.inverse(`< ${e} ${filename}`)));
293
+ pm.launchWeb(k, outputFile);
294
+ }
295
+ });
296
+ });
297
+ });