testeranto 0.200.0 → 0.202.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 (376) hide show
  1. package/README.md +26 -1
  2. package/bundle.js +3 -2
  3. package/design-editor/DesignEditor.tsx +40 -241
  4. package/dist/common/design-editor/DesignEditor.js +33 -198
  5. package/dist/common/src/App.js +158 -16
  6. package/dist/common/src/PM/PM_WithBuild.js +135 -0
  7. package/dist/common/src/PM/PM_WithEslintAndTsc.js +79 -67
  8. package/dist/common/src/PM/PM_WithGit.js +517 -0
  9. package/dist/common/src/PM/PM_WithProcesses.js +519 -0
  10. package/dist/common/src/PM/PM_WithWebSocket.js +535 -0
  11. package/dist/common/src/PM/base.js +62 -0
  12. package/dist/common/src/PM/main.js +533 -1676
  13. package/dist/common/src/PM/metafileOutputs.js +78 -0
  14. package/dist/common/src/PM/node.js +0 -6
  15. package/dist/common/src/PM/pure.js +0 -8
  16. package/dist/common/src/PM/types.js +1 -0
  17. package/dist/common/src/PM/utils.js +210 -0
  18. package/dist/common/src/PM/web.js +0 -6
  19. package/dist/common/src/ReportServer.js +0 -10
  20. package/dist/common/src/ReportServerLib.js +0 -140
  21. package/dist/common/src/components/pure/AppFrame.js +68 -56
  22. package/dist/common/src/components/pure/ArtifactTree.js +80 -0
  23. package/dist/common/src/components/pure/BuildLogViewer.js +106 -0
  24. package/dist/common/src/components/pure/DebugEnv.js +30 -0
  25. package/dist/common/src/components/pure/FileTree.js +34 -0
  26. package/dist/common/src/components/pure/FileTreeItem.js +29 -0
  27. package/dist/common/src/components/pure/GitHubLoginButton.js +18 -0
  28. package/dist/common/src/components/pure/GitIntegrationView.js +342 -0
  29. package/dist/common/src/components/pure/ProcessManager.js +1 -0
  30. package/dist/common/src/components/pure/ProcessManagerView.js +73 -74
  31. package/dist/common/src/components/pure/ProjectPageView.js +4 -117
  32. package/dist/common/src/components/pure/Settings.js +121 -0
  33. package/dist/common/src/components/pure/Settings.test.js +34 -0
  34. package/dist/common/src/components/pure/SignIn.js +22 -0
  35. package/dist/common/src/components/pure/SingleProcessView.js +166 -213
  36. package/dist/common/src/components/pure/TestPageView.js +113 -368
  37. package/dist/common/src/components/pure/TestPageView_utils.js +117 -0
  38. package/dist/common/src/components/pure/TestTable.js +33 -0
  39. package/dist/common/src/components/pure/ToastNotification.js +14 -0
  40. package/dist/common/src/components/pure/UserProfile.js +27 -0
  41. package/dist/common/src/components/stateful/AuthCallbackPage.js +51 -0
  42. package/dist/common/src/components/stateful/FeaturesReporter.js +2 -1
  43. package/dist/common/src/components/stateful/FileTree.js +58 -39
  44. package/dist/common/src/components/stateful/GitIntegrationPage.js +12 -0
  45. package/dist/common/src/components/stateful/ProcessManagerPage.js +13 -15
  46. package/dist/common/src/components/stateful/ProjectPage.js +6 -5
  47. package/dist/common/src/components/stateful/ProjectsPage.js +17 -19
  48. package/dist/common/src/components/stateful/SingleProcessPage.js +16 -26
  49. package/dist/common/src/components/stateful/TestPage.js +7 -5
  50. package/dist/common/src/hooks/useGitMode.js +21 -0
  51. package/dist/common/src/lib/BaseSuite.test/mock.js +15 -8
  52. package/dist/common/src/lib/BaseSuite.test/test.js +56 -80
  53. package/dist/common/src/lib/Tiposkripto.js +24 -0
  54. package/dist/common/src/lib/Tiposkripto.test/MockTiposkripto.js +154 -10
  55. package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.adapter.js +6 -12
  56. package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.implementation.js +63 -23
  57. package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.specification.js +14 -6
  58. package/dist/common/src/lib/pmProxy.test/specification.js +167 -52
  59. package/dist/common/src/services/FileService.js +505 -0
  60. package/dist/common/src/services/GitHubAuthService.js +184 -0
  61. package/dist/common/src/testeranto.js +38 -97
  62. package/dist/common/src/utils/api.js +12 -8
  63. package/dist/common/src/utils/gitTest.js +27 -0
  64. package/dist/common/src/utils.js +23 -13
  65. package/dist/common/testeranto.config.js +21 -17
  66. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  67. package/dist/module/design-editor/DesignEditor.js +33 -199
  68. package/dist/module/src/App.js +121 -15
  69. package/dist/module/src/PM/PM_WithBuild.js +128 -0
  70. package/dist/module/src/PM/PM_WithEslintAndTsc.js +79 -67
  71. package/dist/module/src/PM/PM_WithGit.js +477 -0
  72. package/dist/module/src/PM/PM_WithProcesses.js +479 -0
  73. package/dist/module/src/PM/PM_WithWebSocket.js +528 -0
  74. package/dist/module/src/PM/base.js +62 -0
  75. package/dist/module/src/PM/main.js +533 -1676
  76. package/dist/module/src/PM/metafileOutputs.js +78 -0
  77. package/dist/module/src/PM/node.js +0 -6
  78. package/dist/module/src/PM/pure.js +0 -8
  79. package/dist/module/src/PM/types.js +1 -1
  80. package/dist/module/src/PM/utils.js +196 -0
  81. package/dist/module/src/PM/web.js +0 -6
  82. package/dist/module/src/ReportServer.js +1 -9
  83. package/dist/module/src/ReportServerLib.js +1 -134
  84. package/dist/module/src/components/pure/AppFrame.js +66 -24
  85. package/dist/module/src/components/pure/ArtifactTree.js +80 -0
  86. package/dist/module/src/components/pure/BuildLogViewer.js +99 -0
  87. package/dist/module/src/components/pure/DebugEnv.js +23 -0
  88. package/dist/module/src/components/pure/FileTree.js +27 -0
  89. package/dist/module/src/components/pure/FileTreeItem.js +22 -0
  90. package/dist/module/src/components/pure/GitHubLoginButton.js +11 -0
  91. package/dist/module/src/components/pure/GitIntegrationView.js +305 -0
  92. package/dist/module/src/components/pure/ProcessManager.js +1 -0
  93. package/dist/module/src/components/pure/ProcessManagerView.js +74 -75
  94. package/dist/module/src/components/pure/ProjectPageView.js +5 -118
  95. package/dist/module/src/components/pure/Settings.js +84 -0
  96. package/dist/module/src/components/pure/Settings.test.js +29 -0
  97. package/dist/module/src/components/pure/SignIn.js +15 -0
  98. package/dist/module/src/components/pure/SingleProcessView.js +130 -214
  99. package/dist/module/src/components/pure/TestPageView.js +97 -352
  100. package/dist/module/src/components/pure/TestPageView_utils.js +109 -0
  101. package/dist/module/src/components/pure/TestTable.js +26 -0
  102. package/dist/module/src/components/pure/ToastNotification.js +7 -0
  103. package/dist/module/src/components/pure/UserProfile.js +20 -0
  104. package/dist/module/src/components/stateful/AuthCallbackPage.js +14 -0
  105. package/dist/module/src/components/stateful/FeaturesReporter.js +2 -1
  106. package/dist/module/src/components/stateful/FileTree.js +59 -33
  107. package/dist/module/src/components/stateful/GitIntegrationPage.js +5 -0
  108. package/dist/module/src/components/stateful/ProcessManagerPage.js +13 -15
  109. package/dist/module/src/components/stateful/ProjectPage.js +6 -5
  110. package/dist/module/src/components/stateful/ProjectsPage.js +16 -18
  111. package/dist/module/src/components/stateful/SingleProcessPage.js +16 -26
  112. package/dist/module/src/components/stateful/TestPage.js +8 -6
  113. package/dist/module/src/hooks/useGitMode.js +17 -0
  114. package/dist/module/src/lib/BaseSuite.test/mock.js +15 -8
  115. package/dist/module/src/lib/BaseSuite.test/test.js +56 -80
  116. package/dist/module/src/lib/Tiposkripto.js +24 -0
  117. package/dist/module/src/lib/Tiposkripto.test/MockTiposkripto.js +154 -10
  118. package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.adapter.js +6 -12
  119. package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.implementation.js +63 -23
  120. package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.specification.js +14 -6
  121. package/dist/module/src/lib/pmProxy.test/specification.js +167 -52
  122. package/dist/module/src/services/FileService.js +468 -0
  123. package/dist/module/src/services/GitHubAuthService.js +180 -0
  124. package/dist/module/src/testeranto.js +38 -97
  125. package/dist/module/src/utils/api.js +10 -7
  126. package/dist/module/src/utils/gitTest.js +23 -0
  127. package/dist/module/src/utils.js +21 -12
  128. package/dist/module/testeranto.config.js +21 -17
  129. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  130. package/dist/prebuild/App.css +94 -121
  131. package/dist/prebuild/App.js +44601 -11225
  132. package/dist/prebuild/testeranto.mjs +4106 -0
  133. package/dist/types/design-editor/DesignEditor.d.ts +1 -18
  134. package/dist/types/src/App.d.ts +18 -0
  135. package/dist/types/src/PM/PM_WithBuild.d.ts +13 -0
  136. package/dist/types/src/PM/PM_WithEslintAndTsc.d.ts +2 -4
  137. package/dist/types/src/PM/PM_WithGit.d.ts +27 -0
  138. package/dist/types/src/PM/PM_WithProcesses.d.ts +29 -0
  139. package/dist/types/src/PM/PM_WithWebSocket.d.ts +108 -0
  140. package/dist/types/src/PM/base.d.ts +1 -1
  141. package/dist/types/src/PM/index.d.ts +0 -2
  142. package/dist/types/src/PM/main.d.ts +6 -77
  143. package/dist/types/src/PM/metafileOutputs.d.ts +0 -0
  144. package/dist/types/src/PM/node.d.ts +0 -2
  145. package/dist/types/src/PM/pure.d.ts +0 -2
  146. package/dist/types/src/PM/types.d.ts +118 -0
  147. package/dist/types/src/PM/utils.d.ts +35 -0
  148. package/dist/types/src/PM/web.d.ts +0 -2
  149. package/dist/types/src/Pure.d.ts +6 -1
  150. package/dist/types/src/ReportServer.d.ts +0 -1
  151. package/dist/types/src/ReportServerLib.d.ts +0 -1
  152. package/dist/types/src/Types.d.ts +1 -0
  153. package/dist/types/src/components/pure/ArtifactTree.d.ts +0 -0
  154. package/dist/types/src/components/pure/BuildLogViewer.d.ts +7 -0
  155. package/dist/types/src/components/pure/DebugEnv.d.ts +2 -0
  156. package/dist/types/src/components/pure/FileTree.d.ts +6 -0
  157. package/dist/types/src/components/pure/FileTreeItem.d.ts +8 -0
  158. package/dist/types/src/components/pure/GitHubLoginButton.d.ts +8 -0
  159. package/dist/types/src/components/pure/GitIntegrationView.d.ts +1 -0
  160. package/dist/types/src/components/pure/Settings.d.ts +1 -0
  161. package/dist/types/src/components/pure/Settings.test.d.ts +1 -0
  162. package/dist/types/src/components/pure/SignIn.d.ts +1 -0
  163. package/dist/types/src/components/pure/SingleProcessView.d.ts +10 -0
  164. package/dist/types/src/components/pure/TestPageView.d.ts +2 -1
  165. package/dist/types/src/components/pure/TestPageView_utils.d.ts +23 -0
  166. package/dist/types/src/components/pure/TestTable.d.ts +16 -0
  167. package/dist/types/src/components/pure/ToastNotification.d.ts +6 -0
  168. package/dist/types/src/components/pure/UserProfile.d.ts +2 -0
  169. package/dist/types/src/components/stateful/AuthCallbackPage.d.ts +2 -0
  170. package/dist/types/src/components/stateful/FileTree.d.ts +0 -8
  171. package/dist/types/src/components/stateful/GitIntegrationPage.d.ts +1 -0
  172. package/dist/types/src/hooks/useGitMode.d.ts +7 -0
  173. package/dist/types/src/lib/BaseSuite.test/mock.d.ts +2 -2
  174. package/dist/types/src/lib/BaseSuite.test/test.d.ts +4 -3
  175. package/dist/types/src/lib/Tiposkripto.d.ts +2 -0
  176. package/dist/types/src/lib/Tiposkripto.test/MockTiposkripto.d.ts +3 -0
  177. package/dist/types/src/lib/Tiposkripto.test/Tiposkripto.types.d.ts +5 -0
  178. package/dist/types/src/lib/index.d.ts +6 -0
  179. package/dist/types/src/services/FileService.d.ts +34 -0
  180. package/dist/types/src/services/GitHubAuthService.d.ts +32 -0
  181. package/dist/types/src/utils/api.d.ts +1 -0
  182. package/dist/types/src/utils/gitTest.d.ts +11 -0
  183. package/dist/types/src/utils.d.ts +3 -3
  184. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  185. package/example/__pycache__/Calculator.cpython-313.pyc +0 -0
  186. package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/README.md +187 -0
  187. package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/base_given.go +163 -0
  188. package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/base_suite.go +85 -0
  189. package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/base_then.go +21 -0
  190. package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/base_when.go +21 -0
  191. package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/golingvu.go +554 -0
  192. package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/test_adapter.go +33 -0
  193. package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/types.go +72 -0
  194. package/example/vendor/modules.txt +5 -0
  195. package/git-integration-plan.md +395 -0
  196. package/package.json +26 -14
  197. package/src/App.tsx +169 -18
  198. package/src/PM/PM_WithBuild.ts +171 -0
  199. package/src/PM/PM_WithEslintAndTsc.ts +109 -86
  200. package/src/PM/PM_WithGit.ts +585 -0
  201. package/src/PM/PM_WithProcesses.ts +639 -0
  202. package/src/PM/PM_WithWebSocket.ts +631 -0
  203. package/src/PM/base.ts +63 -1
  204. package/src/PM/index.ts +8 -5
  205. package/src/PM/main.ts +672 -2050
  206. package/src/PM/metafileOutputs.ts +90 -0
  207. package/src/PM/node.ts +18 -18
  208. package/src/PM/pure.ts +5 -13
  209. package/src/PM/types.ts +145 -0
  210. package/src/PM/utils.ts +256 -0
  211. package/src/PM/web.ts +8 -8
  212. package/src/README.md +122 -0
  213. package/src/ReportServer.ts +0 -12
  214. package/src/ReportServerLib.ts +0 -147
  215. package/src/Types.ts +1 -0
  216. package/src/app.scss +14 -164
  217. package/src/components/pure/AppFrame.tsx +237 -71
  218. package/src/components/pure/ArtifactTree.tsx +82 -0
  219. package/src/components/pure/BuildLogViewer.tsx +168 -0
  220. package/src/components/pure/DebugEnv.tsx +30 -0
  221. package/src/components/pure/FileTree.tsx +58 -0
  222. package/src/components/pure/FileTreeItem.tsx +49 -0
  223. package/src/components/pure/GitHubLoginButton.tsx +31 -0
  224. package/src/components/pure/GitIntegrationView.tsx +443 -0
  225. package/src/components/pure/ProcessManager.tsx +6 -5
  226. package/src/components/pure/ProcessManagerView.tsx +162 -166
  227. package/src/components/pure/ProjectPageView.tsx +6 -224
  228. package/src/components/pure/Settings.test.tsx +34 -0
  229. package/src/components/pure/Settings.tsx +163 -0
  230. package/src/components/pure/SignIn.tsx +33 -0
  231. package/src/components/pure/SingleProcessView.tsx +231 -235
  232. package/src/components/pure/TestPageView.test/specification.ts +1 -0
  233. package/src/components/pure/TestPageView.tsx +317 -826
  234. package/src/components/pure/TestPageView_utils.tsx +285 -0
  235. package/src/components/pure/TestTable.tsx +88 -0
  236. package/src/components/pure/ToastNotification.tsx +19 -0
  237. package/src/components/pure/UserProfile.tsx +44 -0
  238. package/src/components/stateful/AuthCallbackPage.tsx +21 -0
  239. package/src/components/stateful/FeaturesReporter.tsx +3 -1
  240. package/src/components/stateful/FileTree.tsx +58 -58
  241. package/src/components/stateful/GitIntegrationPage.tsx +8 -0
  242. package/src/components/stateful/ProcessManagerPage.tsx +13 -17
  243. package/src/components/stateful/ProjectPage.tsx +6 -5
  244. package/src/components/stateful/ProjectsPage.tsx +17 -19
  245. package/src/components/stateful/SVGEditor/CircleForm.tsx +68 -0
  246. package/src/components/stateful/SVGEditor/GroupForm.tsx +56 -0
  247. package/src/components/stateful/SVGEditor/RectForm.tsx +74 -0
  248. package/src/components/stateful/SVGEditor/SVGAttributeField.tsx +29 -0
  249. package/src/components/stateful/SVGEditor/SVGAttributesEditor.tsx +73 -0
  250. package/src/components/stateful/SVGEditor/SVGEditorControls.tsx +45 -0
  251. package/src/components/stateful/SVGEditor/SVGElementForm.tsx +45 -0
  252. package/src/components/stateful/SVGEditor/SVGPreview.tsx +225 -0
  253. package/src/components/stateful/SVGEditor/SVGTextEditor.tsx +166 -0
  254. package/src/components/stateful/SVGEditor/SVGTree.tsx +159 -0
  255. package/src/components/stateful/SVGEditor/SVGTypes.ts +36 -0
  256. package/src/components/stateful/SVGEditor/svg.xsd.xml +3038 -0
  257. package/src/components/stateful/SVGEditorPage.tsx +503 -0
  258. package/src/components/stateful/SingleProcessPage.tsx +18 -31
  259. package/src/components/stateful/TestPage.tsx +25 -22
  260. package/src/golingvu/golingvu.go +38 -2
  261. package/src/hooks/useGitMode.ts +20 -0
  262. package/src/lib/BaseSuite.test/mock.ts +16 -10
  263. package/src/lib/BaseSuite.test/test.ts +144 -103
  264. package/src/lib/Tiposkripto.test/MockTiposkripto.ts +178 -14
  265. package/src/lib/Tiposkripto.test/Tiposkripto.adapter.ts +9 -14
  266. package/src/lib/Tiposkripto.test/Tiposkripto.implementation.ts +78 -38
  267. package/src/lib/Tiposkripto.test/Tiposkripto.specification.ts +51 -9
  268. package/src/lib/Tiposkripto.test/Tiposkripto.types.ts +5 -0
  269. package/src/lib/Tiposkripto.ts +27 -0
  270. package/src/lib/index.ts +7 -0
  271. package/src/lib/pmProxy.test/specification.ts +168 -166
  272. package/src/pitono/PM/__pycache__/python.cpython-313.pyc +0 -0
  273. package/src/pitono/__pycache__/Pitono.cpython-313.pyc +0 -0
  274. package/src/pitono/__pycache__/__init__.cpython-313.pyc +0 -0
  275. package/src/pitono/__pycache__/base_given.cpython-313.pyc +0 -0
  276. package/src/pitono/__pycache__/base_suite.cpython-313.pyc +0 -0
  277. package/src/pitono/__pycache__/base_then.cpython-313.pyc +0 -0
  278. package/src/pitono/__pycache__/base_when.cpython-313.pyc +0 -0
  279. package/src/pitono/__pycache__/core_generator.cpython-313.pyc +0 -0
  280. package/src/pitono/__pycache__/simple_adapter.cpython-313.pyc +0 -0
  281. package/src/pitono/__pycache__/types.cpython-313.pyc +0 -0
  282. package/src/services/FileService.ts +542 -0
  283. package/src/services/GitHubAuthService.ts +240 -0
  284. package/src/testeranto.ts +62 -140
  285. package/src/utils/api.ts +15 -13
  286. package/src/utils/gitTest.ts +29 -0
  287. package/src/utils.ts +21 -12
  288. package/testeranto/App.css +94 -121
  289. package/testeranto/App.js +44601 -11225
  290. package/testeranto/bundles/golang/core/Calculator.golingvu.go +53 -0
  291. package/testeranto/bundles/golang/core/Calculator.golingvu.golingvu.go +53 -0
  292. package/testeranto/bundles/node/core/chunk-RIM6RECA.mjs +1170 -0
  293. package/testeranto/bundles/node/core/chunk-VXVF7WFO.mjs +4321 -0
  294. package/testeranto/bundles/node/core/example/Calculator.test.mjs +503 -0
  295. package/testeranto/bundles/node/core/src/lib/BaseSuite.test/node.test.mjs +94 -1231
  296. package/testeranto/bundles/node/core/src/lib/TipoSkripto.test/TipoSkripto.mjs +574 -0
  297. package/testeranto/bundles/node/core/src/lib/pmProxy.test/index.mjs +482 -0
  298. package/testeranto/bundles/pure/core/chunk-XYOCRDEQ.mjs +1080 -0
  299. package/testeranto/bundles/pure/core/src/Pure.test.mjs +410 -0
  300. package/testeranto/bundles/pure/core/src/lib/BaseSuite.test/pure.test.mjs +93 -1146
  301. package/testeranto/bundles/python/core/Calculator.pitono.test.py +24 -0
  302. package/testeranto/bundles/python/core/test_example.py +24 -0
  303. package/testeranto/bundles/web/core/MPLUSRounded1c-Black-O75GP5JI.ttf +0 -0
  304. package/testeranto/bundles/web/core/MPLUSRounded1c-Bold-R524Q5BH.ttf +0 -0
  305. package/testeranto/bundles/web/core/MPLUSRounded1c-ExtraBold-C6GRMYVT.ttf +0 -0
  306. package/testeranto/bundles/web/core/MPLUSRounded1c-Light-WKN65Y2C.ttf +0 -0
  307. package/testeranto/bundles/web/core/MPLUSRounded1c-Medium-ZC4DWL7C.ttf +0 -0
  308. package/testeranto/bundles/web/core/MPLUSRounded1c-Regular-DT6EKZ3S.ttf +0 -0
  309. package/testeranto/bundles/web/core/MPLUSRounded1c-Thin-YWDNVG6M.ttf +0 -0
  310. package/testeranto/bundles/web/core/chunk-DFRN4SYZ.mjs +2297 -0
  311. package/testeranto/bundles/web/core/chunk-JMDLMADH.mjs +27996 -0
  312. package/testeranto/bundles/web/core/chunk-LQMU5NCG.mjs +3082 -0
  313. package/testeranto/bundles/web/core/chunk-Q5TONB2Z.mjs +6874 -0
  314. package/testeranto/bundles/web/core/src/components/pure/FeaturesReporterView.test/index.mjs +164 -0
  315. package/testeranto/bundles/web/core/src/components/pure/ModalContent.test/index.css +11697 -0
  316. package/testeranto/bundles/web/core/src/components/pure/ModalContent.test/index.mjs +336 -0
  317. package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.css +11697 -0
  318. package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.mjs +517 -0
  319. package/testeranto/bundles/web/core/src/lib/BaseSuite.test/web.test.mjs +107 -1134
  320. package/testeranto/metafiles/golang/core.json +3 -3
  321. package/testeranto/metafiles/node/core.json +474 -31
  322. package/testeranto/metafiles/pure/core.json +144 -28
  323. package/testeranto/metafiles/python/core.json +11 -0
  324. package/testeranto/metafiles/web/core.json +15829 -45
  325. package/testeranto/reports/core/config.json +40 -0
  326. package/testeranto/reports/core/src/Pure.test/pure/exit.log +0 -0
  327. package/testeranto/reports/core/src/Pure.test/pure/lint_errors.txt +0 -0
  328. package/testeranto/reports/core/src/Pure.test/pure/prompt.txt +14 -0
  329. package/testeranto/reports/core/src/Pure.test/pure/type_errors.txt +73 -0
  330. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/debug.log +0 -0
  331. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/error.log +91 -0
  332. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/exit.log +1 -0
  333. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/info.log +2 -0
  334. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/tests.json +68 -0
  335. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/warn.log +0 -0
  336. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/debug.log +0 -0
  337. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/error.log +30 -0
  338. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/exit.log +1 -0
  339. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/info.log +2 -0
  340. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/tests.json +88 -0
  341. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/warn.log +0 -0
  342. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +0 -6
  343. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/prompt.txt +0 -11
  344. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/stdout.log +1 -0
  345. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/tests.json +1 -1
  346. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/type_errors.txt +35 -38
  347. package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +0 -2
  348. package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +0 -10
  349. package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +40 -38
  350. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/tests.json +1 -1
  351. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/exit.log +1 -0
  352. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/lint_errors.txt +0 -0
  353. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/message.txt +17 -0
  354. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/prompt.txt +17 -0
  355. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stderr.log +55 -0
  356. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stdout.log +191 -0
  357. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/type_errors.txt +71 -0
  358. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/exit.log +1 -0
  359. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/lint_errors.txt +15 -0
  360. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/message.txt +17 -0
  361. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/prompt.txt +17 -0
  362. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stderr.log +20 -0
  363. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stdout.log +4 -0
  364. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/type_errors.txt +49 -0
  365. package/testeranto/reports/core/summary.json +34 -6
  366. package/testeranto.config.ts +26 -20
  367. package/tsc.log +141 -91
  368. package/tsconfig.json +6 -2
  369. package/dist/prebuild/ReportServer.mjs +0 -227
  370. package/dist/prebuild/mothership/index.mjs +0 -22
  371. package/dist/types/design-editor/server.d.ts +0 -1
  372. package/testeranto/bundles/web/core/src/lib/BaseSuite.test/web.test.html +0 -15
  373. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/lint_errors.txt +0 -2
  374. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/prompt.txt +0 -25
  375. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/type_errors.txt +0 -56
  376. /package/testeranto/reports/core/src/{lib/BaseSuite.test/web.test/web → Pure.test/pure}/message.txt +0 -0
@@ -8,81 +8,94 @@ import ansiC from "ansi-colors";
8
8
  import { ESLint } from "eslint";
9
9
  import tsc from "tsc-prog";
10
10
  import { lintPather, tscPather } from "../utils";
11
- import { PM_Base } from "./base.js";
11
+ import { PM_WithBuild } from "./PM_WithBuild.js";
12
12
  import { makePromptInternal } from "../utils/makePrompt";
13
13
  const eslint = new ESLint();
14
14
  const formatter = await eslint.loadFormatter("./node_modules/testeranto/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs");
15
- export class PM_WithEslintAndTsc extends PM_Base {
15
+ export class PM_WithEslintAndTsc extends PM_WithBuild {
16
16
  constructor(configs, name, mode) {
17
- super(configs);
17
+ super(configs, name, mode);
18
18
  this.summary = {};
19
19
  this.tscCheck = async ({ entrypoint, addableFiles, platform, }) => {
20
- console.log(ansiC.green(ansiC.inverse(`tsc < ${entrypoint}`)));
21
- try {
22
- this.typeCheckIsRunning(entrypoint);
23
- }
24
- catch (e) {
25
- console.error("error in tscCheck");
26
- console.error(e);
27
- console.error(entrypoint);
28
- console.error(JSON.stringify(this.summary, null, 2));
29
- process.exit(-1);
30
- }
31
- const program = tsc.createProgramFromConfig({
32
- basePath: process.cwd(), // always required, used for relative paths
33
- configFilePath: "tsconfig.json", // config to inherit from (optional)
34
- compilerOptions: {
35
- outDir: tscPather(entrypoint, platform, this.name),
36
- // declaration: true,
37
- // skipLibCheck: true,
38
- noEmit: true,
39
- },
40
- include: addableFiles, //["src/**/*"],
41
- // exclude: ["node_modules", "../testeranto"],
42
- // exclude: ["**/*.test.ts", "**/*.spec.ts"],
43
- });
44
- const tscPath = tscPather(entrypoint, platform, this.name);
45
- const allDiagnostics = program.getSemanticDiagnostics();
46
- const results = [];
47
- allDiagnostics.forEach((diagnostic) => {
48
- if (diagnostic.file) {
49
- const { line, character } = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
50
- const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
51
- results.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
20
+ const processId = `tsc-${entrypoint}-${Date.now()}`;
21
+ const command = `tsc check for ${entrypoint}`;
22
+ const tscPromise = (async () => {
23
+ try {
24
+ this.typeCheckIsRunning(entrypoint);
52
25
  }
53
- else {
54
- results.push(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"));
26
+ catch (e) {
27
+ // Log error through process manager
28
+ throw new Error(`Error in tscCheck: ${e.message}`);
55
29
  }
56
- });
57
- fs.writeFileSync(tscPath, results.join("\n"));
58
- this.typeCheckIsNowDone(entrypoint, results.length);
30
+ const program = tsc.createProgramFromConfig({
31
+ basePath: process.cwd(),
32
+ configFilePath: "tsconfig.json",
33
+ compilerOptions: {
34
+ outDir: tscPather(entrypoint, platform, this.name),
35
+ noEmit: true,
36
+ },
37
+ include: addableFiles,
38
+ });
39
+ const tscPath = tscPather(entrypoint, platform, this.name);
40
+ const allDiagnostics = program.getSemanticDiagnostics();
41
+ const results = [];
42
+ allDiagnostics.forEach((diagnostic) => {
43
+ if (diagnostic.file) {
44
+ const { line, character } = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
45
+ const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
46
+ results.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
47
+ }
48
+ else {
49
+ results.push(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"));
50
+ }
51
+ });
52
+ fs.writeFileSync(tscPath, results.join("\n"));
53
+ this.typeCheckIsNowDone(entrypoint, results.length);
54
+ return results.length;
55
+ })();
56
+ // Add to process manager if available
57
+ if (this.addPromiseProcess) {
58
+ this.addPromiseProcess(processId, tscPromise, command, "build-time", entrypoint);
59
+ }
60
+ else {
61
+ // Fallback to just running the promise
62
+ await tscPromise;
63
+ }
59
64
  };
60
65
  this.eslintCheck = async (entrypoint, platform, addableFiles) => {
61
- console.log(ansiC.green(ansiC.inverse(`eslint < ${entrypoint}`)));
62
- try {
63
- this.lintIsRunning(entrypoint);
66
+ const processId = `eslint-${entrypoint}-${Date.now()}`;
67
+ const command = `eslint check for ${entrypoint}`;
68
+ const eslintPromise = (async () => {
69
+ try {
70
+ this.lintIsRunning(entrypoint);
71
+ }
72
+ catch (e) {
73
+ throw new Error(`Error in eslintCheck: ${e.message}`);
74
+ }
75
+ const filepath = lintPather(entrypoint, platform, this.name);
76
+ if (fs.existsSync(filepath))
77
+ fs.rmSync(filepath);
78
+ const results = (await eslint.lintFiles(addableFiles))
79
+ .filter((r) => r.messages.length)
80
+ .filter((r) => {
81
+ return r.messages[0].ruleId !== null;
82
+ })
83
+ .map((r) => {
84
+ delete r.source;
85
+ return r;
86
+ });
87
+ fs.writeFileSync(filepath, await formatter.format(results));
88
+ this.lintIsNowDone(entrypoint, results.length);
89
+ return results.length;
90
+ })();
91
+ // Add to process manager if available
92
+ if (this.addPromiseProcess) {
93
+ this.addPromiseProcess(processId, eslintPromise, command, "build-time", entrypoint);
64
94
  }
65
- catch (e) {
66
- console.error("error in eslintCheck");
67
- console.error(e);
68
- console.error(entrypoint);
69
- console.error(JSON.stringify(this.summary, null, 2));
70
- process.exit(-1);
95
+ else {
96
+ // Fallback to just running the promise
97
+ await eslintPromise;
71
98
  }
72
- const filepath = lintPather(entrypoint, platform, this.name);
73
- if (fs.existsSync(filepath))
74
- fs.rmSync(filepath);
75
- const results = (await eslint.lintFiles(addableFiles))
76
- .filter((r) => r.messages.length)
77
- .filter((r) => {
78
- return r.messages[0].ruleId !== null;
79
- })
80
- .map((r) => {
81
- delete r.source;
82
- return r;
83
- });
84
- fs.writeFileSync(filepath, await formatter.format(results));
85
- this.lintIsNowDone(entrypoint, results.length);
86
99
  };
87
100
  this.makePrompt = async (entryPoint, addableFiles, platform) => {
88
101
  await makePromptInternal(this.summary, this.name, entryPoint, addableFiles, platform);
@@ -145,17 +158,16 @@ export class PM_WithEslintAndTsc extends PM_Base {
145
158
  this.checkForShutdown();
146
159
  };
147
160
  this.writeBigBoard = () => {
161
+ // note: this path is different from the one used by front end
148
162
  const summaryPath = `./testeranto/reports/${this.name}/summary.json`;
149
163
  const summaryData = JSON.stringify(this.summary, null, 2);
150
164
  fs.writeFileSync(summaryPath, summaryData);
151
165
  // Broadcast the update
152
166
  this.broadcast({
153
- type: 'summaryUpdate',
154
- data: this.summary
167
+ type: "summaryUpdate",
168
+ data: this.summary,
155
169
  });
156
170
  };
157
- this.name = name;
158
- this.mode = mode;
159
171
  this.summary = {};
160
172
  // Initialize all test entries first
161
173
  this.configs.tests.forEach(([t, rt, tr, sidecars]) => {
@@ -0,0 +1,477 @@
1
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
2
+ /* eslint-disable no-async-promise-executor */
3
+ /* eslint-disable @typescript-eslint/no-explicit-any */
4
+ /* eslint-disable @typescript-eslint/no-unused-vars */
5
+ import url from "url";
6
+ import { PM_WithEslintAndTsc } from "./PM_WithEslintAndTsc.js";
7
+ export class PM_WithGit extends PM_WithEslintAndTsc {
8
+ constructor(configs, name, mode) {
9
+ super(configs, name, mode);
10
+ this.gitWatchTimeout = null;
11
+ this.gitWatcher = null;
12
+ }
13
+ // Override requestHandler to add Git-specific endpoints
14
+ requestHandler(req, res) {
15
+ const parsedUrl = url.parse(req.url || "/");
16
+ const pathname = parsedUrl.pathname || "/";
17
+ // Handle Git API endpoints
18
+ if (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith("/api/git/")) {
19
+ this.handleGitApi(req, res);
20
+ return;
21
+ }
22
+ if (pathname === "/api/auth/github/token" && req.method === "POST") {
23
+ this.handleGitHubTokenExchange(req, res);
24
+ return;
25
+ }
26
+ // Handle GitHub OAuth callback
27
+ if (pathname === "/auth/github/callback") {
28
+ // Serve the callback HTML page
29
+ const callbackHtml = `
30
+ <!DOCTYPE html>
31
+ <html>
32
+ <head>
33
+ <title>GitHub Authentication - Testeranto</title>
34
+ <script>
35
+ // Extract the code from the URL and send it to the parent window
36
+ const urlParams = new URLSearchParams(window.location.search);
37
+ const code = urlParams.get('code');
38
+ const error = urlParams.get('error');
39
+
40
+ if (code) {
41
+ window.opener.postMessage({ type: 'github-auth-callback', code }, '*');
42
+ } else if (error) {
43
+ window.opener.postMessage({ type: 'github-auth-error', error }, '*');
44
+ }
45
+ window.close();
46
+ </script>
47
+ </head>
48
+ <body>
49
+ <p>Completing authentication...</p>
50
+ </body>
51
+ </html>`;
52
+ res.writeHead(200, { "Content-Type": "text/html" });
53
+ res.end(callbackHtml);
54
+ return;
55
+ }
56
+ // Call the parent class's requestHandler for all other requests
57
+ super.requestHandler(req, res);
58
+ }
59
+ // this method is also horrible
60
+ handleGitApi(req, res) {
61
+ const parsedUrl = url.parse(req.url || "/");
62
+ const pathname = parsedUrl.pathname || "/";
63
+ // Set CORS headers
64
+ res.setHeader("Access-Control-Allow-Origin", "*");
65
+ res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
66
+ res.setHeader("Access-Control-Allow-Headers", "Content-Type");
67
+ if (req.method === "OPTIONS") {
68
+ res.writeHead(200);
69
+ res.end();
70
+ return;
71
+ }
72
+ try {
73
+ if (pathname === "/api/git/changes" && req.method === "GET") {
74
+ this.handleGitChanges(req, res);
75
+ }
76
+ else if (pathname === "/api/git/status" && req.method === "GET") {
77
+ this.handleGitFileStatus(req, res);
78
+ }
79
+ else if (pathname === "/api/git/commit" && req.method === "POST") {
80
+ this.handleGitCommit(req, res);
81
+ }
82
+ else if (pathname === "/api/git/push" && req.method === "POST") {
83
+ this.handleGitPush(req, res);
84
+ }
85
+ else if (pathname === "/api/git/pull" && req.method === "POST") {
86
+ this.handleGitPull(req, res);
87
+ }
88
+ else if (pathname === "/api/git/branch" && req.method === "GET") {
89
+ this.handleGitBranch(req, res);
90
+ }
91
+ else if (pathname === "/api/git/remote-status" &&
92
+ req.method === "GET") {
93
+ this.handleGitRemoteStatus(req, res);
94
+ }
95
+ else {
96
+ res.writeHead(404, { "Content-Type": "application/json" });
97
+ res.end(JSON.stringify({ error: "Not found" }));
98
+ }
99
+ }
100
+ catch (error) {
101
+ res.writeHead(500, { "Content-Type": "application/json" });
102
+ res.end(JSON.stringify({ error: "Internal server error" }));
103
+ }
104
+ }
105
+ async handleGitChanges(req, res) {
106
+ try {
107
+ const changes = await this.getGitChanges();
108
+ res.writeHead(200, { "Content-Type": "application/json" });
109
+ res.end(JSON.stringify(changes));
110
+ }
111
+ catch (error) {
112
+ res.writeHead(500, { "Content-Type": "application/json" });
113
+ res.end(JSON.stringify({ error: "Failed to get changes" }));
114
+ }
115
+ }
116
+ async handleGitFileStatus(req, res) {
117
+ const parsedUrl = url.parse(req.url || "/");
118
+ const query = parsedUrl.query || "";
119
+ const params = new URLSearchParams(query);
120
+ const path = params.get("path");
121
+ if (!path) {
122
+ res.writeHead(400, { "Content-Type": "application/json" });
123
+ res.end(JSON.stringify({ error: "Path parameter required" }));
124
+ return;
125
+ }
126
+ try {
127
+ const status = await this.getGitFileStatus(path);
128
+ res.writeHead(200, { "Content-Type": "application/json" });
129
+ res.end(JSON.stringify(status));
130
+ }
131
+ catch (error) {
132
+ res.writeHead(500, { "Content-Type": "application/json" });
133
+ res.end(JSON.stringify({ error: "Failed to get file status" }));
134
+ }
135
+ }
136
+ async handleGitCommit(req, res) {
137
+ let body = "";
138
+ req.on("data", (chunk) => {
139
+ body += chunk.toString();
140
+ });
141
+ req.on("end", async () => {
142
+ try {
143
+ const { message, description } = JSON.parse(body);
144
+ await this.executeGitCommit(message, description);
145
+ res.writeHead(200, { "Content-Type": "application/json" });
146
+ res.end(JSON.stringify({ success: true }));
147
+ }
148
+ catch (error) {
149
+ res.writeHead(500, { "Content-Type": "application/json" });
150
+ res.end(JSON.stringify({ error: "Failed to commit" }));
151
+ }
152
+ });
153
+ }
154
+ async handleGitPush(req, res) {
155
+ try {
156
+ await this.executeGitPush();
157
+ res.writeHead(200, { "Content-Type": "application/json" });
158
+ res.end(JSON.stringify({ success: true }));
159
+ }
160
+ catch (error) {
161
+ res.writeHead(500, { "Content-Type": "application/json" });
162
+ res.end(JSON.stringify({ error: "Failed to push" }));
163
+ }
164
+ }
165
+ async handleGitPull(req, res) {
166
+ try {
167
+ await this.executeGitPull();
168
+ res.writeHead(200, { "Content-Type": "application/json" });
169
+ res.end(JSON.stringify({ success: true }));
170
+ }
171
+ catch (error) {
172
+ res.writeHead(500, { "Content-Type": "application/json" });
173
+ res.end(JSON.stringify({ error: "Failed to pull" }));
174
+ }
175
+ }
176
+ async handleGitBranch(req, res) {
177
+ try {
178
+ const branch = await this.getCurrentGitBranch();
179
+ res.writeHead(200, { "Content-Type": "text/plain" });
180
+ res.end(branch);
181
+ }
182
+ catch (error) {
183
+ res.writeHead(500, { "Content-Type": "application/json" });
184
+ res.end(JSON.stringify({ error: "Failed to get branch" }));
185
+ }
186
+ }
187
+ async handleGitHubTokenExchange(req, res) {
188
+ let body = "";
189
+ req.on("data", (chunk) => {
190
+ body += chunk.toString();
191
+ });
192
+ req.on("end", async () => {
193
+ try {
194
+ const { code } = JSON.parse(body);
195
+ // Exchange code for access token
196
+ const tokenResponse = await fetch("https://github.com/login/oauth/access_token", {
197
+ method: "POST",
198
+ headers: {
199
+ Accept: "application/json",
200
+ "Content-Type": "application/json",
201
+ },
202
+ body: JSON.stringify({
203
+ client_id: process.env.GITHUB_CLIENT_ID,
204
+ client_secret: process.env.GITHUB_CLIENT_SECRET,
205
+ code,
206
+ }),
207
+ });
208
+ const tokenData = await tokenResponse.json();
209
+ if (tokenData.error) {
210
+ res.writeHead(400, { "Content-Type": "application/json" });
211
+ res.end(JSON.stringify({ error: tokenData.error_description }));
212
+ return;
213
+ }
214
+ res.writeHead(200, { "Content-Type": "application/json" });
215
+ res.end(JSON.stringify({ access_token: tokenData.access_token }));
216
+ }
217
+ catch (error) {
218
+ res.writeHead(500, { "Content-Type": "application/json" });
219
+ res.end(JSON.stringify({ error: "Failed to exchange token" }));
220
+ }
221
+ });
222
+ }
223
+ async handleGitRemoteStatus(req, res) {
224
+ try {
225
+ const status = await this.getGitRemoteStatus();
226
+ res.writeHead(200, { "Content-Type": "application/json" });
227
+ res.end(JSON.stringify(status));
228
+ }
229
+ catch (error) {
230
+ res.writeHead(500, { "Content-Type": "application/json" });
231
+ res.end(JSON.stringify({ error: "Failed to get remote status" }));
232
+ }
233
+ }
234
+ async getGitFileStatus(path) {
235
+ try {
236
+ const changes = await this.getGitChanges();
237
+ const fileChange = changes.find((change) => change.path === path);
238
+ if (fileChange) {
239
+ return { status: fileChange.status };
240
+ }
241
+ return { status: "unchanged" };
242
+ }
243
+ catch (error) {
244
+ console.error("Failed to get file status:", error);
245
+ return { status: "unchanged" };
246
+ }
247
+ }
248
+ async executeGitCommit(message, description) {
249
+ try {
250
+ const { exec } = await import("child_process");
251
+ const fullMessage = description
252
+ ? `${message}\n\n${description}`
253
+ : message;
254
+ return new Promise((resolve, reject) => {
255
+ // Stage all changes first
256
+ exec("git add -A", { cwd: process.cwd() }, (error) => {
257
+ if (error) {
258
+ reject(new Error(`Failed to stage changes: ${error.message}`));
259
+ return;
260
+ }
261
+ // Commit with message
262
+ const commitCommand = `git commit -m "${fullMessage.replace(/"/g, '\\"')}"`;
263
+ exec(commitCommand, { cwd: process.cwd() }, (commitError) => {
264
+ if (commitError) {
265
+ reject(new Error(`Failed to commit: ${commitError.message}`));
266
+ return;
267
+ }
268
+ resolve();
269
+ });
270
+ });
271
+ });
272
+ }
273
+ catch (error) {
274
+ throw new Error(`Failed to execute commit: ${error instanceof Error ? error.message : "Unknown error"}`);
275
+ }
276
+ }
277
+ async executeGitPush() {
278
+ try {
279
+ const { exec } = await import("child_process");
280
+ return new Promise((resolve, reject) => {
281
+ exec("git push", { cwd: process.cwd() }, (error) => {
282
+ if (error) {
283
+ reject(new Error(`Failed to push: ${error.message}`));
284
+ return;
285
+ }
286
+ resolve();
287
+ });
288
+ });
289
+ }
290
+ catch (error) {
291
+ throw new Error(`Failed to execute push: ${error instanceof Error ? error.message : "Unknown error"}`);
292
+ }
293
+ }
294
+ async executeGitPull() {
295
+ try {
296
+ const { exec } = await import("child_process");
297
+ return new Promise((resolve, reject) => {
298
+ exec("git pull", { cwd: process.cwd() }, (error) => {
299
+ if (error) {
300
+ reject(new Error(`Failed to pull: ${error.message}`));
301
+ return;
302
+ }
303
+ resolve();
304
+ });
305
+ });
306
+ }
307
+ catch (error) {
308
+ throw new Error(`Failed to execute pull: ${error instanceof Error ? error.message : "Unknown error"}`);
309
+ }
310
+ }
311
+ // private async sendInitialState(ws: WebSocket) {
312
+ // try {
313
+ // const changes = await this.getGitChanges();
314
+ // const status = await this.getGitRemoteStatus();
315
+ // const branch = await this.getCurrentGitBranch();
316
+ // ws.send(JSON.stringify({ type: "changes", changes }));
317
+ // ws.send(JSON.stringify({ type: "status", status }));
318
+ // ws.send(JSON.stringify({ type: "branch", branch }));
319
+ // } catch (error) {
320
+ // console.error("Error sending initial state:", error);
321
+ // ws.send(
322
+ // JSON.stringify({
323
+ // type: "error",
324
+ // message: "Failed to get Git status",
325
+ // })
326
+ // );
327
+ // }
328
+ // }
329
+ // private async refreshGitStatus() {
330
+ // try {
331
+ // const changes = await this.getGitChanges();
332
+ // const status = await this.getGitRemoteStatus();
333
+ // const branch = await this.getCurrentGitBranch();
334
+ // this.broadcast({ type: "changes", changes });
335
+ // this.broadcast({ type: "status", status });
336
+ // this.broadcast({ type: "branch", branch });
337
+ // } catch (error) {
338
+ // console.error("Error refreshing Git status:", error);
339
+ // }
340
+ // }
341
+ onBuildDone() {
342
+ console.log("Build processes completed");
343
+ // The builds are done, which means the files are ready to be watched
344
+ // This matches the original behavior where builds completed before PM_Main started
345
+ // Start Git watcher for development mode
346
+ this.startGitWatcher();
347
+ }
348
+ async startGitWatcher() {
349
+ console.log("Starting Git watcher for real-time updates");
350
+ // Watch for file system changes in the current directory
351
+ const watcher = (await import("fs")).watch(process.cwd(), { recursive: true }, async (eventType, filename) => {
352
+ if (filename && !filename.includes(".git")) {
353
+ try {
354
+ // Debounce the Git status check
355
+ clearTimeout(this.gitWatchTimeout);
356
+ this.gitWatchTimeout = setTimeout(async () => {
357
+ const changes = await this.getGitChanges();
358
+ const status = await this.getGitRemoteStatus();
359
+ const branch = await this.getCurrentGitBranch();
360
+ this.broadcast({ type: "changes", changes });
361
+ this.broadcast({ type: "status", status });
362
+ this.broadcast({ type: "branch", branch });
363
+ }, 500); // Wait 500ms after last change
364
+ }
365
+ catch (error) {
366
+ console.error("Error checking Git status:", error);
367
+ }
368
+ }
369
+ });
370
+ // Also set up a periodic check in case file watching misses something
371
+ setInterval(async () => {
372
+ try {
373
+ const changes = await this.getGitChanges();
374
+ const status = await this.getGitRemoteStatus();
375
+ const branch = await this.getCurrentGitBranch();
376
+ this.broadcast({ type: "changes", changes });
377
+ this.broadcast({ type: "status", status });
378
+ this.broadcast({ type: "branch", branch });
379
+ }
380
+ catch (error) {
381
+ console.error("Error checking Git status:", error);
382
+ }
383
+ }, 10000); // Check every 10 seconds as a fallback
384
+ this.gitWatcher = watcher;
385
+ }
386
+ async getGitChanges() {
387
+ try {
388
+ // Use git status --porcelain to get machine-readable output
389
+ const { exec } = await import("child_process");
390
+ return new Promise((resolve, reject) => {
391
+ exec("git status --porcelain", { cwd: process.cwd() }, (error, stdout, stderr) => {
392
+ if (error) {
393
+ console.error("Error getting git changes:", error);
394
+ resolve([]);
395
+ return;
396
+ }
397
+ const changes = [];
398
+ const lines = stdout.trim().split("\n");
399
+ for (const line of lines) {
400
+ if (!line.trim())
401
+ continue;
402
+ // Parse git status output (XY PATH)
403
+ const status = line.substring(0, 2).trim();
404
+ const path = line.substring(3).trim();
405
+ let fileStatus = "unchanged";
406
+ if (status.startsWith("M")) {
407
+ fileStatus = "modified";
408
+ }
409
+ else if (status.startsWith("A")) {
410
+ fileStatus = "added";
411
+ }
412
+ else if (status.startsWith("D")) {
413
+ fileStatus = "deleted";
414
+ }
415
+ else if (status.startsWith("U") || status.includes("U")) {
416
+ fileStatus = "conflicted";
417
+ }
418
+ else if (status.startsWith("??")) {
419
+ fileStatus = "added";
420
+ }
421
+ if (fileStatus !== "unchanged") {
422
+ changes.push({
423
+ path,
424
+ status: fileStatus,
425
+ });
426
+ }
427
+ }
428
+ resolve(changes);
429
+ });
430
+ });
431
+ }
432
+ catch (error) {
433
+ console.error("Failed to get git changes:", error);
434
+ return [];
435
+ }
436
+ }
437
+ async getGitRemoteStatus() {
438
+ try {
439
+ const { exec } = await import("child_process");
440
+ return new Promise((resolve) => {
441
+ // Get ahead/behind status for current branch
442
+ exec("git rev-list --left-right --count HEAD...@{u}", { cwd: process.cwd() }, (error, stdout, stderr) => {
443
+ if (error) {
444
+ // If there's no upstream branch, return 0 for both
445
+ resolve({ ahead: 0, behind: 0 });
446
+ return;
447
+ }
448
+ const [behind, ahead] = stdout.trim().split("\t").map(Number);
449
+ resolve({ ahead, behind });
450
+ });
451
+ });
452
+ }
453
+ catch (error) {
454
+ console.error("Failed to get remote status:", error);
455
+ return { ahead: 0, behind: 0 };
456
+ }
457
+ }
458
+ async getCurrentGitBranch() {
459
+ try {
460
+ const { exec } = await import("child_process");
461
+ return new Promise((resolve) => {
462
+ exec("git branch --show-current", { cwd: process.cwd() }, (error, stdout, stderr) => {
463
+ if (error) {
464
+ console.error("Error getting current branch:", error);
465
+ resolve("main");
466
+ return;
467
+ }
468
+ resolve(stdout.trim() || "main");
469
+ });
470
+ });
471
+ }
472
+ catch (error) {
473
+ console.error("Failed to get current branch:", error);
474
+ return "main";
475
+ }
476
+ }
477
+ }