tnp-helpers 18.0.19 → 18.0.21

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 (532) hide show
  1. package/assets/shared/shared_folder_info.txt +1 -1
  2. package/browser/README.md +24 -24
  3. package/browser/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
  4. package/browser/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
  5. package/browser/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
  6. package/browser/esm2022/lib/base/classes/base-cli-worker.mjs +14 -4
  7. package/browser/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
  8. package/browser/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
  9. package/browser/esm2022/lib/base/classes/base-git.mjs +244 -4
  10. package/browser/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
  11. package/browser/esm2022/lib/base/classes/base-library-build.mjs +35 -10
  12. package/browser/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
  13. package/browser/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
  14. package/browser/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -430
  15. package/browser/esm2022/lib/base/classes/base-package-json.mjs +340 -0
  16. package/browser/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
  17. package/browser/esm2022/lib/base/classes/base-project-resolver.mjs +2 -11
  18. package/browser/esm2022/lib/base/classes/base-project.mjs +83 -87
  19. package/browser/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
  20. package/browser/esm2022/lib/base/classes/base-release-process.mjs +34 -36
  21. package/browser/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
  22. package/browser/esm2022/lib/base/classes/base-vscode.mjs +31 -1
  23. package/browser/esm2022/lib/base/classes/index.mjs +5 -1
  24. package/browser/esm2022/lib/base/commit-data.mjs +21 -4
  25. package/browser/esm2022/lib/base/core-project.mjs +3 -3
  26. package/browser/esm2022/lib/base/linked-project.mjs +4 -4
  27. package/browser/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
  28. package/browser/esm2022/lib/base/translate.mjs +566 -0
  29. package/browser/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
  30. package/browser/esm2022/lib/helpers/helpers.mjs +12 -6
  31. package/browser/esm2022/lib/index.mjs +2 -4
  32. package/browser/esm2022/lib/models.mjs +173 -3
  33. package/browser/esm2022/lib/utils.mjs +402 -41
  34. package/browser/fesm2022/tnp-helpers.mjs +4616 -2904
  35. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  36. package/browser/lib/base/classes/base-bower-json.d.ts +35 -0
  37. package/browser/lib/base/classes/base-cli-worker.d.ts +2 -2
  38. package/browser/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
  39. package/browser/lib/base/classes/base-feature-for-project.d.ts +2 -1
  40. package/browser/lib/base/classes/base-git.d.ts +42 -5
  41. package/browser/lib/base/classes/base-json-file-reader.d.ts +72 -0
  42. package/browser/lib/base/classes/base-library-build.d.ts +8 -11
  43. package/browser/lib/base/classes/base-linked-projects.d.ts +1 -2
  44. package/browser/lib/base/classes/base-node-modules.d.ts +56 -0
  45. package/browser/lib/base/classes/base-npm-helpers.d.ts +29 -108
  46. package/browser/lib/base/classes/base-package-json.d.ts +107 -0
  47. package/browser/lib/base/classes/base-process-manager.d.ts +31 -0
  48. package/browser/lib/base/classes/base-project-resolver.d.ts +2 -2
  49. package/browser/lib/base/classes/base-project.d.ts +17 -18
  50. package/browser/lib/base/classes/base-quick-fixes.d.ts +3 -1
  51. package/browser/lib/base/classes/base-release-process.d.ts +15 -13
  52. package/browser/lib/base/classes/{base-github-pages.d.ts → base-static-pages.d.ts} +3 -3
  53. package/browser/lib/base/classes/base-vscode.d.ts +4 -0
  54. package/browser/lib/base/classes/index.d.ts +5 -1
  55. package/browser/lib/base/commit-data.d.ts +14 -1
  56. package/browser/lib/base/core-project.d.ts +1 -1
  57. package/browser/lib/base/linked-project.d.ts +1 -1
  58. package/browser/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  59. package/browser/lib/base/translate.d.ts +228 -0
  60. package/browser/lib/helpers/helpers-array-obj.d.ts +3 -0
  61. package/browser/lib/helpers/helpers.d.ts +12 -8
  62. package/browser/lib/index.d.ts +1 -3
  63. package/browser/lib/models.d.ts +68 -8
  64. package/browser/lib/utils.d.ts +72 -13
  65. package/client/README.md +24 -24
  66. package/client/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
  67. package/client/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
  68. package/client/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
  69. package/client/esm2022/lib/base/classes/base-cli-worker.mjs +14 -4
  70. package/client/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
  71. package/client/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
  72. package/client/esm2022/lib/base/classes/base-git.mjs +244 -4
  73. package/client/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
  74. package/client/esm2022/lib/base/classes/base-library-build.mjs +35 -10
  75. package/client/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
  76. package/client/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
  77. package/client/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -430
  78. package/client/esm2022/lib/base/classes/base-package-json.mjs +340 -0
  79. package/client/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
  80. package/client/esm2022/lib/base/classes/base-project-resolver.mjs +2 -11
  81. package/client/esm2022/lib/base/classes/base-project.mjs +83 -87
  82. package/client/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
  83. package/client/esm2022/lib/base/classes/base-release-process.mjs +34 -36
  84. package/client/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
  85. package/client/esm2022/lib/base/classes/base-vscode.mjs +31 -1
  86. package/client/esm2022/lib/base/classes/index.mjs +5 -1
  87. package/client/esm2022/lib/base/commit-data.mjs +21 -4
  88. package/client/esm2022/lib/base/core-project.mjs +3 -3
  89. package/client/esm2022/lib/base/linked-project.mjs +4 -4
  90. package/client/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
  91. package/client/esm2022/lib/base/translate.mjs +566 -0
  92. package/client/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
  93. package/client/esm2022/lib/helpers/helpers.mjs +12 -6
  94. package/client/esm2022/lib/index.mjs +2 -4
  95. package/client/esm2022/lib/models.mjs +173 -3
  96. package/client/esm2022/lib/utils.mjs +402 -41
  97. package/client/fesm2022/tnp-helpers.mjs +4616 -2904
  98. package/client/fesm2022/tnp-helpers.mjs.map +1 -1
  99. package/client/lib/base/classes/base-bower-json.d.ts +35 -0
  100. package/client/lib/base/classes/base-cli-worker.d.ts +2 -2
  101. package/client/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
  102. package/client/lib/base/classes/base-feature-for-project.d.ts +2 -1
  103. package/client/lib/base/classes/base-git.d.ts +42 -5
  104. package/client/lib/base/classes/base-json-file-reader.d.ts +72 -0
  105. package/client/lib/base/classes/base-library-build.d.ts +8 -11
  106. package/client/lib/base/classes/base-linked-projects.d.ts +1 -2
  107. package/client/lib/base/classes/base-node-modules.d.ts +56 -0
  108. package/client/lib/base/classes/base-npm-helpers.d.ts +29 -108
  109. package/client/lib/base/classes/base-package-json.d.ts +107 -0
  110. package/client/lib/base/classes/base-process-manager.d.ts +31 -0
  111. package/client/lib/base/classes/base-project-resolver.d.ts +2 -2
  112. package/client/lib/base/classes/base-project.d.ts +17 -18
  113. package/client/lib/base/classes/base-quick-fixes.d.ts +3 -1
  114. package/client/lib/base/classes/base-release-process.d.ts +15 -13
  115. package/{websql/lib/base/classes/base-github-pages.d.ts → client/lib/base/classes/base-static-pages.d.ts} +3 -3
  116. package/client/lib/base/classes/base-vscode.d.ts +4 -0
  117. package/client/lib/base/classes/index.d.ts +5 -1
  118. package/client/lib/base/commit-data.d.ts +14 -1
  119. package/client/lib/base/core-project.d.ts +1 -1
  120. package/client/lib/base/linked-project.d.ts +1 -1
  121. package/client/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  122. package/client/lib/base/translate.d.ts +228 -0
  123. package/client/lib/helpers/helpers-array-obj.d.ts +3 -0
  124. package/client/lib/helpers/helpers.d.ts +12 -8
  125. package/client/lib/index.d.ts +1 -3
  126. package/client/lib/models.d.ts +68 -8
  127. package/client/lib/utils.d.ts +72 -13
  128. package/index.js +15 -2
  129. package/index.js.map +1 -1
  130. package/lib/base/base-cli-worker-config.d.ts +27 -0
  131. package/lib/base/base-cli-worker-config.js +53 -0
  132. package/lib/base/base-cli-worker-config.js.map +1 -0
  133. package/lib/base/base-cli-worker-controller.d.ts +15 -0
  134. package/lib/base/base-cli-worker-controller.js +154 -0
  135. package/lib/base/base-cli-worker-controller.js.map +1 -0
  136. package/lib/base/base-cli-worker.d.ts +82 -0
  137. package/lib/base/base-cli-worker.js +654 -0
  138. package/lib/base/base-cli-worker.js.map +1 -0
  139. package/lib/base/base-command-line.backend.d.ts +174 -0
  140. package/lib/base/base-command-line.backend.js +2221 -0
  141. package/lib/base/base-command-line.backend.js.map +1 -0
  142. package/lib/base/base-compiler-for-project.d.ts +7 -0
  143. package/lib/base/base-compiler-for-project.js +62 -0
  144. package/lib/base/base-compiler-for-project.js.map +1 -0
  145. package/lib/base/base-db.d.ts +12 -0
  146. package/lib/base/base-db.js +74 -0
  147. package/lib/base/base-db.js.map +1 -0
  148. package/lib/base/base-debounce-compiler-for-project.d.ts +28 -0
  149. package/lib/base/base-debounce-compiler-for-project.js +82 -0
  150. package/lib/base/base-debounce-compiler-for-project.js.map +1 -0
  151. package/lib/base/base-detached-service.d.ts +6 -0
  152. package/lib/base/base-detached-service.js +16 -0
  153. package/lib/base/base-detached-service.js.map +1 -0
  154. package/lib/base/base-feature-for-project.d.ts +5 -0
  155. package/lib/base/base-feature-for-project.js +11 -0
  156. package/lib/base/base-feature-for-project.js.map +1 -0
  157. package/lib/base/base-git.d.ts +148 -0
  158. package/lib/base/base-git.js +1202 -0
  159. package/lib/base/base-git.js.map +1 -0
  160. package/{client/lib/base/classes → lib/base}/base-github-pages.d.ts +4 -5
  161. package/lib/base/base-github-pages.js +173 -0
  162. package/lib/base/base-github-pages.js.map +1 -0
  163. package/lib/base/base-ignore-hide.d.ts +14 -0
  164. package/lib/base/base-ignore-hide.js +55 -0
  165. package/lib/base/base-ignore-hide.js.map +1 -0
  166. package/lib/base/base-library-build.d.ts +65 -0
  167. package/lib/base/base-library-build.js +717 -0
  168. package/lib/base/base-library-build.js.map +1 -0
  169. package/lib/base/base-linked-projects.d.ts +24 -0
  170. package/lib/base/base-linked-projects.js +408 -0
  171. package/lib/base/base-linked-projects.js.map +1 -0
  172. package/lib/base/base-npm-helpers.d.ts +128 -0
  173. package/lib/base/base-npm-helpers.js +774 -0
  174. package/lib/base/base-npm-helpers.js.map +1 -0
  175. package/lib/base/base-project-resolver.d.ts +41 -0
  176. package/lib/base/base-project-resolver.js +308 -0
  177. package/lib/base/base-project-resolver.js.map +1 -0
  178. package/lib/base/base-project.d.ts +244 -0
  179. package/lib/base/base-project.js +1223 -0
  180. package/lib/base/base-project.js.map +1 -0
  181. package/lib/base/base-quick-fixes.d.ts +6 -0
  182. package/lib/base/base-quick-fixes.js +31 -0
  183. package/lib/base/base-quick-fixes.js.map +1 -0
  184. package/lib/base/base-release-process.d.ts +69 -0
  185. package/lib/base/base-release-process.js +913 -0
  186. package/lib/base/base-release-process.js.map +1 -0
  187. package/lib/base/base-start-config.backend.d.ts +36 -0
  188. package/lib/base/base-start-config.backend.js +167 -0
  189. package/lib/base/base-start-config.backend.js.map +1 -0
  190. package/lib/base/base-vscode.d.ts +12 -0
  191. package/lib/base/base-vscode.js +139 -0
  192. package/lib/base/base-vscode.js.map +1 -0
  193. package/lib/base/classes/base-bower-json.d.ts +34 -0
  194. package/lib/base/classes/base-bower-json.js +19 -0
  195. package/lib/base/classes/base-bower-json.js.map +1 -0
  196. package/lib/base/classes/base-cli-worker-config.js +35 -24
  197. package/lib/base/classes/base-cli-worker-config.js.map +1 -1
  198. package/lib/base/classes/base-cli-worker-controller.js +98 -128
  199. package/lib/base/classes/base-cli-worker-controller.js.map +1 -1
  200. package/lib/base/classes/base-cli-worker.d.ts +2 -2
  201. package/lib/base/classes/base-cli-worker.js +402 -606
  202. package/lib/base/classes/base-cli-worker.js.map +1 -1
  203. package/lib/base/classes/base-command-line-feature.backend.d.ts +5 -9
  204. package/lib/base/classes/base-command-line-feature.backend.js +73 -132
  205. package/lib/base/classes/base-command-line-feature.backend.js.map +1 -1
  206. package/lib/base/classes/base-command-line.backend.d.ts +175 -0
  207. package/lib/base/classes/base-command-line.backend.js +2235 -0
  208. package/lib/base/classes/base-command-line.backend.js.map +1 -0
  209. package/lib/base/classes/base-compiler-for-project.js +27 -32
  210. package/lib/base/classes/base-compiler-for-project.js.map +1 -1
  211. package/lib/base/classes/base-db.js +43 -60
  212. package/lib/base/classes/base-db.js.map +1 -1
  213. package/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
  214. package/lib/base/classes/base-debounce-compiler-for-project.js +44 -70
  215. package/lib/base/classes/base-debounce-compiler-for-project.js.map +1 -1
  216. package/lib/base/classes/base-detached-service.js.map +1 -1
  217. package/lib/base/classes/base-feature-for-project.d.ts +2 -1
  218. package/lib/base/classes/base-feature-for-project.js +7 -4
  219. package/lib/base/classes/base-feature-for-project.js.map +1 -1
  220. package/lib/base/classes/base-git.d.ts +40 -3
  221. package/lib/base/classes/base-git.js +885 -943
  222. package/lib/base/classes/base-git.js.map +1 -1
  223. package/lib/base/classes/base-github-pages.js.map +1 -1
  224. package/lib/base/classes/base-global-command-line.backend.d.ts +10 -2
  225. package/lib/base/classes/base-global-command-line.backend.js +1058 -2011
  226. package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
  227. package/lib/base/classes/base-ignore-hide.d.ts +2 -2
  228. package/lib/base/classes/base-ignore-hide.js +24 -28
  229. package/lib/base/classes/base-ignore-hide.js.map +1 -1
  230. package/lib/base/classes/base-json-file-reader.d.ts +71 -0
  231. package/lib/base/classes/base-json-file-reader.js +141 -0
  232. package/lib/base/classes/base-json-file-reader.js.map +1 -0
  233. package/lib/base/classes/base-library-build.d.ts +8 -12
  234. package/lib/base/classes/base-library-build.js +433 -638
  235. package/lib/base/classes/base-library-build.js.map +1 -1
  236. package/lib/base/classes/base-linked-projects.d.ts +1 -3
  237. package/lib/base/classes/base-linked-projects.js +200 -314
  238. package/lib/base/classes/base-linked-projects.js.map +1 -1
  239. package/lib/base/classes/base-node-modules.d.ts +55 -0
  240. package/lib/base/classes/base-node-modules.js +415 -0
  241. package/lib/base/classes/base-node-modules.js.map +1 -0
  242. package/lib/base/classes/base-npm-helpers.d.ts +29 -97
  243. package/lib/base/classes/base-npm-helpers.js +178 -729
  244. package/lib/base/classes/base-npm-helpers.js.map +1 -1
  245. package/lib/base/classes/base-package-json.d.ts +106 -0
  246. package/lib/base/classes/base-package-json.js +381 -0
  247. package/lib/base/classes/base-package-json.js.map +1 -0
  248. package/lib/base/classes/base-process-manager.d.ts +30 -0
  249. package/lib/base/classes/base-process-manager.js +269 -0
  250. package/lib/base/classes/base-process-manager.js.map +1 -0
  251. package/lib/base/classes/base-project-resolver.d.ts +2 -3
  252. package/lib/base/classes/base-project-resolver.js +102 -119
  253. package/lib/base/classes/base-project-resolver.js.map +1 -1
  254. package/lib/base/classes/base-project.d.ts +20 -17
  255. package/lib/base/classes/base-project.js +553 -760
  256. package/lib/base/classes/base-project.js.map +1 -1
  257. package/lib/base/classes/base-quick-fixes.d.ts +3 -1
  258. package/lib/base/classes/base-quick-fixes.js +45 -17
  259. package/lib/base/classes/base-quick-fixes.js.map +1 -1
  260. package/lib/base/classes/base-release-process.d.ts +15 -13
  261. package/lib/base/classes/base-release-process.js +487 -835
  262. package/lib/base/classes/base-release-process.js.map +1 -1
  263. package/lib/base/classes/base-start-config.backend.js +116 -100
  264. package/lib/base/classes/base-start-config.backend.js.map +1 -1
  265. package/lib/base/classes/base-static-pages.d.ts +14 -0
  266. package/lib/base/classes/base-static-pages.js +105 -0
  267. package/lib/base/classes/base-static-pages.js.map +1 -0
  268. package/lib/base/classes/base-vscode.d.ts +4 -0
  269. package/lib/base/classes/base-vscode.js +446 -424
  270. package/lib/base/classes/base-vscode.js.map +1 -1
  271. package/lib/base/classes/index copy.d.ts +22 -0
  272. package/lib/base/classes/index copy.js +28 -0
  273. package/lib/base/classes/index copy.js.map +1 -0
  274. package/lib/base/classes/index.d.ts +4 -0
  275. package/lib/base/classes/index.js +36 -19
  276. package/lib/base/classes/index.js.map +1 -1
  277. package/lib/base/command-line-feature.backend.d.ts +51 -0
  278. package/lib/base/command-line-feature.backend.js +206 -0
  279. package/lib/base/command-line-feature.backend.js.map +1 -0
  280. package/lib/base/commit-data.d.ts +14 -1
  281. package/lib/base/commit-data.js +411 -464
  282. package/lib/base/commit-data.js.map +1 -1
  283. package/lib/base/config-database.js +33 -61
  284. package/lib/base/config-database.js.map +1 -1
  285. package/lib/base/core-project.d.ts +1 -1
  286. package/lib/base/core-project.js +110 -146
  287. package/lib/base/core-project.js.map +1 -1
  288. package/lib/base/gh-temp-code.d.ts +1 -0
  289. package/lib/base/gh-temp-code.js +62 -104
  290. package/lib/base/gh-temp-code.js.map +1 -1
  291. package/lib/base/index-rebuilder.backend.d.ts +1 -0
  292. package/lib/base/index-rebuilder.backend.js.map +1 -1
  293. package/lib/base/index.js +20 -7
  294. package/lib/base/index.js.map +1 -1
  295. package/lib/base/linked-project.d.ts +1 -1
  296. package/lib/base/linked-project.js +59 -38
  297. package/lib/base/linked-project.js.map +1 -1
  298. package/lib/base/ports-worker.d.ts +32 -0
  299. package/lib/base/ports-worker.js +244 -0
  300. package/lib/base/ports-worker.js.map +1 -0
  301. package/lib/base/project-database.js +12 -22
  302. package/lib/base/project-database.js.map +1 -1
  303. package/lib/base/tcp-udp-ports/index.js +17 -4
  304. package/lib/base/tcp-udp-ports/index.js.map +1 -1
  305. package/lib/base/tcp-udp-ports/not-assignable-port.entity.d.ts +1 -0
  306. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
  307. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js.map +1 -1
  308. package/lib/base/tcp-udp-ports/port.entity.d.ts +0 -0
  309. package/lib/base/tcp-udp-ports/port.entity.js +5 -0
  310. package/lib/base/tcp-udp-ports/port.entity.js.map +1 -0
  311. package/lib/base/tcp-udp-ports/ports.controller.js +195 -283
  312. package/lib/base/tcp-udp-ports/ports.controller.js.map +1 -1
  313. package/lib/base/tcp-udp-ports/ports.entity.d.ts +2 -2
  314. package/lib/base/tcp-udp-ports/ports.entity.js +74 -62
  315. package/lib/base/tcp-udp-ports/ports.entity.js.map +1 -1
  316. package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js +11 -14
  317. package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js.map +1 -1
  318. package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js +244 -427
  319. package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js.map +1 -1
  320. package/lib/base/tcp-upd-ports.worker.d.ts +13 -0
  321. package/lib/base/tcp-upd-ports.worker.js +99 -0
  322. package/lib/base/tcp-upd-ports.worker.js.map +1 -0
  323. package/lib/base/translate.d.ts +1 -1
  324. package/lib/base/translate.js +90 -119
  325. package/lib/base/translate.js.map +1 -1
  326. package/lib/build-info._auto-generated_.js.map +1 -1
  327. package/lib/helpers/for-backend/helpers-cli-tool.backend.js +109 -115
  328. package/lib/helpers/for-backend/helpers-cli-tool.backend.js.map +1 -1
  329. package/lib/helpers/for-backend/helpers-console-gui.js +55 -102
  330. package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
  331. package/lib/helpers/for-backend/helpers-dependencies.backend.js +28 -45
  332. package/lib/helpers/for-backend/helpers-dependencies.backend.js.map +1 -1
  333. package/lib/helpers/for-backend/helpers-file-folders.backend.d.ts +2 -2
  334. package/lib/helpers/for-backend/helpers-file-folders.backend.js +277 -266
  335. package/lib/helpers/for-backend/helpers-file-folders.backend.js.map +1 -1
  336. package/lib/helpers/for-backend/helpers-git.backend.d.ts +38 -3
  337. package/lib/helpers/for-backend/helpers-git.backend.js +806 -807
  338. package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
  339. package/lib/helpers/for-backend/helpers-network.backend.js +15 -18
  340. package/lib/helpers/for-backend/helpers-network.backend.js.map +1 -1
  341. package/lib/helpers/for-backend/helpers-npm.backend.js +5 -8
  342. package/lib/helpers/for-backend/helpers-npm.backend.js.map +1 -1
  343. package/lib/helpers/for-backend/helpers-path.backend.js +18 -26
  344. package/lib/helpers/for-backend/helpers-path.backend.js.map +1 -1
  345. package/lib/helpers/for-backend/helpers-process.backend.d.ts +2 -2
  346. package/lib/helpers/for-backend/helpers-process.backend.js +285 -363
  347. package/lib/helpers/for-backend/helpers-process.backend.js.map +1 -1
  348. package/lib/helpers/for-backend/helpers-system-terminal.backend.js +25 -42
  349. package/lib/helpers/for-backend/helpers-system-terminal.backend.js.map +1 -1
  350. package/lib/helpers/for-backend/helpers-vscode.backend.js +9 -12
  351. package/lib/helpers/for-backend/helpers-vscode.backend.js.map +1 -1
  352. package/lib/helpers/for-backend/ts-code/index.js +0 -2
  353. package/lib/helpers/for-backend/ts-code/index.js.map +1 -1
  354. package/lib/helpers/for-backend/ts-code/ts-code-extractor.d.ts +26 -0
  355. package/lib/helpers/for-backend/ts-code/ts-code-extractor.js +62 -0
  356. package/lib/helpers/for-backend/ts-code/ts-code-extractor.js.map +1 -0
  357. package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.d.ts +19 -0
  358. package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.js +81 -0
  359. package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.js.map +1 -0
  360. package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.js +2 -2
  361. package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.js.map +1 -1
  362. package/lib/helpers/for-browser/angular.helper.js +2 -2
  363. package/lib/helpers/for-browser/angular.helper.js.map +1 -1
  364. package/lib/helpers/for-browser/helpers-browser.js +27 -40
  365. package/lib/helpers/for-browser/helpers-browser.js.map +1 -1
  366. package/lib/helpers/helpers-array-obj.d.ts +3 -0
  367. package/lib/helpers/helpers-array-obj.js +49 -61
  368. package/lib/helpers/helpers-array-obj.js.map +1 -1
  369. package/lib/helpers/helpers-json5.backend.js +44 -55
  370. package/lib/helpers/helpers-json5.backend.js.map +1 -1
  371. package/lib/helpers/helpers-numbers.js +7 -10
  372. package/lib/helpers/helpers-numbers.js.map +1 -1
  373. package/lib/helpers/helpers-strings-regexes.js +40 -47
  374. package/lib/helpers/helpers-strings-regexes.js.map +1 -1
  375. package/lib/helpers/helpers-strings.js +38 -41
  376. package/lib/helpers/helpers-strings.js.map +1 -1
  377. package/lib/helpers/helpers.d.ts +12 -8
  378. package/lib/helpers/helpers.js +313 -393
  379. package/lib/helpers/helpers.js.map +1 -1
  380. package/lib/index._auto-generated_.d.ts +1 -0
  381. package/lib/index._auto-generated_.js.map +1 -1
  382. package/lib/index.d.ts +3 -4
  383. package/lib/index.js +21 -10
  384. package/lib/index.js.map +1 -1
  385. package/lib/lowdb/adapters/Memory.js +14 -20
  386. package/lib/lowdb/adapters/Memory.js.map +1 -1
  387. package/lib/lowdb/adapters/browser/LocalStorage.js +5 -8
  388. package/lib/lowdb/adapters/browser/LocalStorage.js.map +1 -1
  389. package/lib/lowdb/adapters/browser/SessionStorage.js +5 -8
  390. package/lib/lowdb/adapters/browser/SessionStorage.js.map +1 -1
  391. package/lib/lowdb/adapters/browser/WebStorage.js +10 -9
  392. package/lib/lowdb/adapters/browser/WebStorage.js.map +1 -1
  393. package/lib/lowdb/adapters/node/DataFile.js +29 -38
  394. package/lib/lowdb/adapters/node/DataFile.js.map +1 -1
  395. package/lib/lowdb/adapters/node/JSONFile.js +13 -18
  396. package/lib/lowdb/adapters/node/JSONFile.js.map +1 -1
  397. package/lib/lowdb/adapters/node/TextFile.js +36 -44
  398. package/lib/lowdb/adapters/node/TextFile.js.map +1 -1
  399. package/lib/lowdb/adapters/node/steno.js +72 -122
  400. package/lib/lowdb/adapters/node/steno.js.map +1 -1
  401. package/lib/lowdb/browser.js +17 -4
  402. package/lib/lowdb/browser.js.map +1 -1
  403. package/lib/lowdb/core/Low.js +30 -60
  404. package/lib/lowdb/core/Low.js.map +1 -1
  405. package/lib/lowdb/examples/browser.js.map +1 -1
  406. package/lib/lowdb/examples/cli.d.ts +1 -0
  407. package/lib/lowdb/examples/cli.js.map +1 -1
  408. package/lib/lowdb/examples/in-memory.d.ts +1 -0
  409. package/lib/lowdb/examples/in-memory.js.map +1 -1
  410. package/lib/lowdb/examples/server.d.ts +1 -0
  411. package/lib/lowdb/examples/server.js.map +1 -1
  412. package/lib/lowdb/index.js +16 -3
  413. package/lib/lowdb/index.js.map +1 -1
  414. package/lib/lowdb/node.js +18 -5
  415. package/lib/lowdb/node.js.map +1 -1
  416. package/lib/lowdb/presets/browser.js +7 -7
  417. package/lib/lowdb/presets/browser.js.map +1 -1
  418. package/lib/lowdb/presets/node.js +12 -23
  419. package/lib/lowdb/presets/node.js.map +1 -1
  420. package/lib/models.d.ts +68 -8
  421. package/lib/models.js +197 -3
  422. package/lib/models.js.map +1 -1
  423. package/lib/old/base-component.d.ts +1 -0
  424. package/lib/old/base-component.js +2 -2
  425. package/lib/old/base-component.js.map +1 -1
  426. package/lib/old/base-formly-component.d.ts +1 -0
  427. package/lib/old/base-formly-component.js +2 -2
  428. package/lib/old/base-formly-component.js.map +1 -1
  429. package/lib/old/condition-wait.d.ts +1 -0
  430. package/lib/old/condition-wait.js.map +1 -1
  431. package/lib/old/dual-component-ctrl.d.ts +1 -0
  432. package/lib/old/dual-component-ctrl.js +2 -2
  433. package/lib/old/dual-component-ctrl.js.map +1 -1
  434. package/lib/old/execute-command.d.ts +11 -0
  435. package/lib/old/execute-command.js +564 -0
  436. package/lib/old/execute-command.js.map +1 -0
  437. package/lib/old/helpers.d.ts +62 -0
  438. package/lib/old/helpers.js +279 -0
  439. package/lib/old/helpers.js.map +1 -0
  440. package/lib/old/models.d.ts +80 -0
  441. package/lib/old/models.js +57 -0
  442. package/lib/old/models.js.map +1 -0
  443. package/lib/utils.d.ts +72 -13
  444. package/lib/utils.js +502 -179
  445. package/lib/utils.js.map +1 -1
  446. package/lib/validators/validators-firedev.js +5 -5
  447. package/lib/validators/validators-firedev.js.map +1 -1
  448. package/lib/validators/validators-git.js +2 -2
  449. package/lib/validators/validators-git.js.map +1 -1
  450. package/lib/validators/validators-network.js +1 -1
  451. package/lib/validators/validators-network.js.map +1 -1
  452. package/lib/validators/validators.js +2 -2
  453. package/lib/validators/validators.js.map +1 -1
  454. package/migrations/1736198527297_init.js +39 -58
  455. package/migrations/1736198527297_init.js.map +1 -1
  456. package/migrations/1736199486472_addingNotAssignablePorts.js +42 -93
  457. package/migrations/1736199486472_addingNotAssignablePorts.js.map +1 -1
  458. package/migrations/1736454437350_addFreePorts.js +48 -100
  459. package/migrations/1736454437350_addFreePorts.js.map +1 -1
  460. package/migrations/index.js +15 -2
  461. package/migrations/index.js.map +1 -1
  462. package/migrations/migrations_index._auto-generated_.js +3 -3
  463. package/migrations/migrations_index._auto-generated_.js.map +1 -1
  464. package/package.json +14 -61
  465. package/src.d.ts +1 -1
  466. package/taon.jsonc +34 -49
  467. package/tmp-environment.json +8 -389
  468. package/websql/README.md +24 -24
  469. package/websql/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
  470. package/websql/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
  471. package/websql/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
  472. package/websql/esm2022/lib/base/classes/base-cli-worker.mjs +14 -4
  473. package/websql/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
  474. package/websql/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
  475. package/websql/esm2022/lib/base/classes/base-git.mjs +244 -4
  476. package/websql/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
  477. package/websql/esm2022/lib/base/classes/base-library-build.mjs +35 -10
  478. package/websql/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
  479. package/websql/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
  480. package/websql/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -430
  481. package/websql/esm2022/lib/base/classes/base-package-json.mjs +340 -0
  482. package/websql/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
  483. package/websql/esm2022/lib/base/classes/base-project-resolver.mjs +2 -10
  484. package/websql/esm2022/lib/base/classes/base-project.mjs +82 -87
  485. package/websql/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
  486. package/websql/esm2022/lib/base/classes/base-release-process.mjs +34 -36
  487. package/websql/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
  488. package/websql/esm2022/lib/base/classes/base-vscode.mjs +31 -1
  489. package/websql/esm2022/lib/base/classes/index.mjs +5 -1
  490. package/websql/esm2022/lib/base/commit-data.mjs +21 -4
  491. package/websql/esm2022/lib/base/core-project.mjs +3 -3
  492. package/websql/esm2022/lib/base/linked-project.mjs +4 -4
  493. package/websql/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
  494. package/websql/esm2022/lib/base/translate.mjs +566 -0
  495. package/websql/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
  496. package/websql/esm2022/lib/helpers/helpers.mjs +12 -6
  497. package/websql/esm2022/lib/index.mjs +2 -4
  498. package/websql/esm2022/lib/models.mjs +173 -3
  499. package/websql/esm2022/lib/utils.mjs +402 -41
  500. package/websql/fesm2022/tnp-helpers.mjs +4744 -3032
  501. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  502. package/websql/lib/base/classes/base-bower-json.d.ts +35 -0
  503. package/websql/lib/base/classes/base-cli-worker.d.ts +2 -2
  504. package/websql/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
  505. package/websql/lib/base/classes/base-feature-for-project.d.ts +2 -1
  506. package/websql/lib/base/classes/base-git.d.ts +42 -5
  507. package/websql/lib/base/classes/base-json-file-reader.d.ts +72 -0
  508. package/websql/lib/base/classes/base-library-build.d.ts +8 -11
  509. package/websql/lib/base/classes/base-linked-projects.d.ts +1 -2
  510. package/websql/lib/base/classes/base-node-modules.d.ts +56 -0
  511. package/websql/lib/base/classes/base-npm-helpers.d.ts +29 -108
  512. package/websql/lib/base/classes/base-package-json.d.ts +107 -0
  513. package/websql/lib/base/classes/base-process-manager.d.ts +31 -0
  514. package/websql/lib/base/classes/base-project-resolver.d.ts +2 -2
  515. package/websql/lib/base/classes/base-project.d.ts +17 -18
  516. package/websql/lib/base/classes/base-quick-fixes.d.ts +3 -1
  517. package/websql/lib/base/classes/base-release-process.d.ts +15 -13
  518. package/websql/lib/base/classes/base-static-pages.d.ts +15 -0
  519. package/websql/lib/base/classes/base-vscode.d.ts +4 -0
  520. package/websql/lib/base/classes/index.d.ts +5 -1
  521. package/websql/lib/base/commit-data.d.ts +14 -1
  522. package/websql/lib/base/core-project.d.ts +1 -1
  523. package/websql/lib/base/linked-project.d.ts +1 -1
  524. package/websql/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  525. package/websql/lib/base/translate.d.ts +228 -0
  526. package/websql/lib/helpers/helpers-array-obj.d.ts +3 -0
  527. package/websql/lib/helpers/helpers.d.ts +12 -8
  528. package/websql/lib/index.d.ts +1 -3
  529. package/websql/lib/models.d.ts +68 -8
  530. package/websql/lib/utils.d.ts +72 -13
  531. package/browser/package.json +0 -25
  532. package/websql/package.json +0 -25
@@ -1,2240 +1,1287 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseGlobalCommandLine = void 0;
4
- var tslib_1 = require("tslib");
5
- var index_1 = require("../../index");
6
- var base_command_line_feature_backend_1 = require("./base-command-line-feature.backend");
7
- var tnp_core_1 = require("tnp-core");
8
- var tnp_config_1 = require("tnp-config");
9
- var tnp_config_2 = require("tnp-config");
10
- var tnp_core_2 = require("tnp-core");
11
- var gh_temp_code_1 = require("../gh-temp-code");
12
- var BaseGlobalCommandLine = /** @class */ (function (_super) {
13
- tslib_1.__extends(BaseGlobalCommandLine, _super);
14
- function BaseGlobalCommandLine() {
15
- return _super !== null && _super.apply(this, arguments) || this;
16
- }
17
- BaseGlobalCommandLine.prototype._ = function () {
4
+ const tnp_config_1 = require("tnp-config");
5
+ const tnp_config_2 = require("tnp-config");
6
+ const tnp_core_1 = require("tnp-core");
7
+ const tnp_core_2 = require("tnp-core");
8
+ const tnp_core_3 = require("tnp-core");
9
+ const index_1 = require("../../index");
10
+ const gh_temp_code_1 = require("../gh-temp-code");
11
+ const base_command_line_feature_backend_1 = require("./base-command-line-feature.backend");
12
+ class BaseGlobalCommandLine extends base_command_line_feature_backend_1.BaseCommandLineFeature {
13
+ _() {
18
14
  index_1.Helpers.error('Please select git command');
19
- };
15
+ }
20
16
  //#region commands / prevent cwd is not project
21
17
  /**
22
18
  * TODO return argument not need for now
23
19
  */
24
- BaseGlobalCommandLine.prototype.cwdIsProject = function (options) {
25
- return tslib_1.__awaiter(this, void 0, void 0, function () {
26
- var requireProjectWithGitRoot, proj, useRoot;
27
- return tslib_1.__generator(this, function (_a) {
28
- switch (_a.label) {
29
- case 0:
30
- requireProjectWithGitRoot = (options || {}).requireProjectWithGitRoot;
31
- if (!!this.project && !requireProjectWithGitRoot) {
32
- return [2 /*return*/, true];
33
- }
34
- if (!(requireProjectWithGitRoot &&
35
- (!this.project || !this.project.git.isGitRoot))) return [3 /*break*/, 3];
36
- proj = this.ins.nearestTo(this.cwd, { findGitRoot: true });
37
- if (!proj) return [3 /*break*/, 2];
38
- index_1.Helpers.info("\n Current folder (".concat(this.cwd, ")\n is not a git root folder, but nearest project with\n git root has been found in: ").concat(tnp_core_1.chalk.bold(proj.genericName), "\n\n "));
39
- return [4 /*yield*/, index_1.Helpers.questionYesNo('Would you like to use this project ?')];
40
- case 1:
41
- useRoot = _a.sent();
42
- if (useRoot) {
43
- this.project = proj;
44
- this.cwd = proj.location;
45
- return [2 /*return*/, true];
46
- }
47
- else {
48
- index_1.Helpers.error("[".concat(tnp_config_2.config.frameworkName, "] This is not git root project folder"), true, true);
49
- }
50
- return [3 /*break*/, 3];
51
- case 2:
52
- index_1.Helpers.error("[".concat(tnp_config_2.config.frameworkName, "] This folder is not project folder"), false, true);
53
- _a.label = 3;
54
- case 3: return [2 /*return*/, true];
20
+ async cwdIsProject(options) {
21
+ const { requireProjectWithGitRoot } = options || {};
22
+ if (!!this.project && !requireProjectWithGitRoot) {
23
+ return true;
24
+ }
25
+ if (requireProjectWithGitRoot &&
26
+ (!this.project || !this.project.git.isGitRoot)) {
27
+ const proj = this.ins.nearestTo(this.cwd, { findGitRoot: true });
28
+ if (proj) {
29
+ index_1.Helpers.info(`
30
+ Current folder (${this.cwd})
31
+ is not a git root folder, but nearest project with
32
+ git root has been found in: ${tnp_core_1.chalk.bold(proj.genericName)}
33
+
34
+ `);
35
+ const useRoot = await index_1.Helpers.questionYesNo('Would you like to use this project ?');
36
+ if (useRoot) {
37
+ this.project = proj;
38
+ this.cwd = proj.location;
39
+ return true;
40
+ }
41
+ else {
42
+ index_1.Helpers.error(`[${tnp_config_2.config.frameworkName}] This is not git root project folder`, true, true);
55
43
  }
56
- });
57
- });
58
- };
44
+ }
45
+ else {
46
+ index_1.Helpers.error(`[${tnp_config_2.config.frameworkName}] This folder is not project folder`, false, true);
47
+ }
48
+ }
49
+ return true;
50
+ }
59
51
  //#endregion
60
52
  //#region commands / hosts
61
- BaseGlobalCommandLine.prototype.hosts = function () {
62
- index_1.Helpers.run("code ".concat((0, tnp_core_2.crossPlatformPath)(tnp_config_1.HOST_FILE_PATH))).sync();
53
+ hosts() {
54
+ index_1.Helpers.run(`code ${(0, tnp_core_2.crossPlatformPath)(tnp_config_1.HOST_FILE_PATH)}`).sync();
63
55
  process.exit(0);
64
- };
56
+ }
65
57
  //#endregion
66
58
  //#region commands / count commits
67
- BaseGlobalCommandLine.prototype.countCommits = function () {
59
+ countCommits() {
68
60
  console.log(index_1.Helpers.git.countCommits(this.cwd));
69
61
  this._exit();
70
- };
62
+ }
71
63
  //#endregion
72
64
  //#region commands / remove submodules
73
- BaseGlobalCommandLine.prototype.removeSubmodules = function () {
74
- var e_1, _a;
65
+ removeSubmodules() {
75
66
  index_1.Helpers.taskStarted('Removing submodules...');
76
- try {
77
- for (var _b = tslib_1.__values(index_1.Helpers.foldersFrom(this.cwd, {
78
- recursive: false,
79
- })), _c = _b.next(); !_c.done; _c = _b.next()) {
80
- var folderAbsPath = _c.value;
81
- if (index_1.Helpers.exists((0, tnp_core_2.crossPlatformPath)([folderAbsPath, '.git']))) {
82
- try {
83
- index_1.Helpers.run("git rm --cached ".concat(tnp_core_1.path.basename(folderAbsPath))).sync();
84
- }
85
- catch (error) { }
67
+ for (const folderAbsPath of index_1.Helpers.foldersFrom(this.cwd, {
68
+ recursive: false,
69
+ })) {
70
+ if (index_1.Helpers.exists((0, tnp_core_2.crossPlatformPath)([folderAbsPath, '.git']))) {
71
+ try {
72
+ index_1.Helpers.run(`git rm --cached ${tnp_core_1.path.basename(folderAbsPath)}`).sync();
86
73
  }
74
+ catch (error) { }
87
75
  }
88
76
  }
89
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
90
- finally {
91
- try {
92
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
93
- }
94
- finally { if (e_1) throw e_1.error; }
95
- }
96
77
  index_1.Helpers.taskDone('Done');
97
78
  this._exit();
98
- };
79
+ }
99
80
  //#endregion
100
81
  //#region commands / set editor
101
- BaseGlobalCommandLine.prototype.setEditor = function () {
102
- return tslib_1.__awaiter(this, void 0, void 0, function () {
103
- return tslib_1.__generator(this, function (_a) {
104
- switch (_a.label) {
105
- case 0: return [4 /*yield*/, this.ins.configDb.selectCodeEditor()];
106
- case 1:
107
- _a.sent();
108
- this._exit();
109
- return [2 /*return*/];
110
- }
111
- });
112
- });
113
- };
82
+ async setEditor() {
83
+ await this.ins.configDb.selectCodeEditor();
84
+ this._exit();
85
+ }
114
86
  //#endregion
115
87
  //#region commands / quick git update
116
88
  /**
117
89
  * quick git update push
118
90
  */
119
- BaseGlobalCommandLine.prototype.update = function () {
120
- return tslib_1.__awaiter(this, void 0, void 0, function () {
121
- return tslib_1.__generator(this, function (_a) {
122
- switch (_a.label) {
123
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
124
- case 1:
125
- if (!(_a.sent())) {
126
- return [2 /*return*/];
127
- }
128
- index_1.Helpers.info('Updating & push project...');
129
- try {
130
- this.project.git.addAndCommit("chore: ".concat(!!this.firstArg ? this.firstArg : 'update'));
131
- }
132
- catch (error) { }
133
- return [4 /*yield*/, this.project.git.pushCurrentBranch({
134
- askToRetry: true,
135
- forcePushNoQuestion: true,
136
- })];
137
- case 2:
138
- _a.sent();
139
- index_1.Helpers.info('Done');
140
- this._exit();
141
- return [2 /*return*/];
142
- }
143
- });
144
- });
145
- };
146
- BaseGlobalCommandLine.prototype.deepUp = function () {
147
- return tslib_1.__awaiter(this, arguments, void 0, function (noExit) {
148
- if (noExit === void 0) { noExit = false; }
149
- return tslib_1.__generator(this, function (_a) {
150
- switch (_a.label) {
151
- case 0: return [4 /*yield*/, this.deepUpdate(noExit)];
152
- case 1:
153
- _a.sent();
154
- return [2 /*return*/];
155
- }
156
- });
91
+ async update() {
92
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
93
+ return;
94
+ }
95
+ index_1.Helpers.info('Updating & push project...');
96
+ try {
97
+ this.project.git.addAndCommit(`chore: ${!!this.firstArg ? this.firstArg : 'update'}`);
98
+ }
99
+ catch (error) { }
100
+ await this.project.git.pushCurrentBranch({
101
+ askToRetry: true,
102
+ forcePushNoQuestion: true,
157
103
  });
158
- };
159
- BaseGlobalCommandLine.prototype.deepUpdate = function () {
160
- return tslib_1.__awaiter(this, arguments, void 0, function (noExit) {
161
- var updateProject;
162
- var _this = this;
163
- if (noExit === void 0) { noExit = false; }
164
- return tslib_1.__generator(this, function (_a) {
165
- switch (_a.label) {
166
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
167
- case 1:
168
- if (!(_a.sent())) {
169
- return [2 /*return*/];
170
- }
171
- index_1.Helpers.info('Deep updating & pushing project with children...');
172
- updateProject = function (project) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
173
- var error_1, _a, _b, child, e_2_1;
174
- var e_2, _c;
175
- return tslib_1.__generator(this, function (_d) {
176
- switch (_d.label) {
177
- case 0:
178
- _d.trys.push([0, 2, , 3]);
179
- return [4 /*yield*/, project.npmHelpers.bumpPatchVersion()];
180
- case 1:
181
- _d.sent();
182
- return [3 /*break*/, 3];
183
- case 2:
184
- error_1 = _d.sent();
185
- return [3 /*break*/, 3];
186
- case 3:
187
- try {
188
- project.git.addAndCommit("chore: ".concat(!!this.firstArg ? this.args.join(' ') : 'update'));
189
- }
190
- catch (error) { }
191
- return [4 /*yield*/, project.git.pushCurrentBranch({
192
- askToRetry: true,
193
- forcePushNoQuestion: true,
194
- })];
195
- case 4:
196
- _d.sent();
197
- if (!!project.isMonorepo) return [3 /*break*/, 12];
198
- _d.label = 5;
199
- case 5:
200
- _d.trys.push([5, 10, 11, 12]);
201
- _a = tslib_1.__values(project.children), _b = _a.next();
202
- _d.label = 6;
203
- case 6:
204
- if (!!_b.done) return [3 /*break*/, 9];
205
- child = _b.value;
206
- if (!child.git.isGitRoot) return [3 /*break*/, 8];
207
- return [4 /*yield*/, updateProject(child)];
208
- case 7:
209
- _d.sent();
210
- _d.label = 8;
211
- case 8:
212
- _b = _a.next();
213
- return [3 /*break*/, 6];
214
- case 9: return [3 /*break*/, 12];
215
- case 10:
216
- e_2_1 = _d.sent();
217
- e_2 = { error: e_2_1 };
218
- return [3 /*break*/, 12];
219
- case 11:
220
- try {
221
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
222
- }
223
- finally { if (e_2) throw e_2.error; }
224
- return [7 /*endfinally*/];
225
- case 12: return [2 /*return*/];
226
- }
227
- });
228
- }); };
229
- return [4 /*yield*/, updateProject(this.project)];
230
- case 2:
231
- _a.sent();
232
- index_1.Helpers.info('Done');
233
- this._exit();
234
- return [2 /*return*/];
104
+ index_1.Helpers.info('Done');
105
+ this._exit();
106
+ }
107
+ async deepUp(noExit = false) {
108
+ await this.deepUpdate(noExit);
109
+ }
110
+ async deepUpdate(noExit = false) {
111
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
112
+ return;
113
+ }
114
+ index_1.Helpers.info('Deep updating & pushing project with children...');
115
+ const updateProject = async (project) => {
116
+ try {
117
+ await project.packageJson.bumpPatchVersion();
118
+ }
119
+ catch (error) { }
120
+ try {
121
+ project.git.addAndCommit(`chore: ${!!this.firstArg ? this.args.join(' ') : 'update'}`);
122
+ }
123
+ catch (error) { }
124
+ await project.git.pushCurrentBranch({
125
+ askToRetry: true,
126
+ forcePushNoQuestion: true,
127
+ });
128
+ if (!project.isMonorepo) {
129
+ for (const child of project.children) {
130
+ if (child.git.isGitRoot) {
131
+ await updateProject(child);
132
+ }
235
133
  }
236
- });
237
- });
238
- };
134
+ }
135
+ };
136
+ await updateProject(this.project);
137
+ index_1.Helpers.info('Done');
138
+ this._exit();
139
+ }
239
140
  /**
240
141
  * Push update
241
142
  */
242
- BaseGlobalCommandLine.prototype.up = function () {
243
- return tslib_1.__awaiter(this, void 0, void 0, function () {
244
- return tslib_1.__generator(this, function (_a) {
245
- switch (_a.label) {
246
- case 0: return [4 /*yield*/, this.update()];
247
- case 1:
248
- _a.sent();
249
- return [2 /*return*/];
250
- }
251
- });
252
- });
253
- };
143
+ async up() {
144
+ await this.update();
145
+ }
254
146
  /**
255
147
  * Push update
256
148
  */
257
- BaseGlobalCommandLine.prototype.pu = function () {
258
- return tslib_1.__awaiter(this, void 0, void 0, function () {
259
- return tslib_1.__generator(this, function (_a) {
260
- switch (_a.label) {
261
- case 0: return [4 /*yield*/, this.update()];
262
- case 1:
263
- _a.sent();
264
- return [2 /*return*/];
265
- }
266
- });
267
- });
268
- };
149
+ async pu() {
150
+ await this.update();
151
+ }
269
152
  //#endregion
270
153
  //#region commands / develop
271
- BaseGlobalCommandLine.prototype.develop = function () {
272
- return tslib_1.__awaiter(this, void 0, void 0, function () {
273
- var founded, results, openInEditor, res;
274
- var _this = this;
275
- return tslib_1.__generator(this, function (_a) {
276
- switch (_a.label) {
277
- case 0:
278
- // Helpers.clearConsole();
279
- index_1.Helpers.taskStarted("getting all projects...");
280
- return [4 /*yield*/, this.ins.projectsDb.getAllProjectsFromDB()];
281
- case 1:
282
- founded = ((_a.sent()) || [])
283
- .filter(function (p) { return index_1.Helpers.exists(p.location); })
284
- .map(function (p) {
285
- var proj = _this.ins.From(p.location);
286
- // console.log(`Proj for ${p.location} `, !!proj)
287
- if (proj) {
288
- return proj;
289
- // return proj.embeddedProject ? proj.embeddedProject : proj;
290
- }
291
- // const nereset = this.ins.nearestTo(p.location);
292
- // if (nereset) {
293
- // const embeded = nereset.linkedProjects.find(l => crossPlatformPath([nereset.location, l.relativeClonePath]) === p.location);
294
- // if (embeded) {
295
- // return this.ins.From([nereset.location, embeded.relativeClonePath]);
296
- // }
297
- // }
298
- })
299
- .filter(function (p) { return !!p; });
300
- index_1.Helpers.taskDone("found ".concat(founded.length, " projects..."));
301
- index_1.Helpers.taskStarted("searching for project...");
302
- results = index_1.Helpers.uniqArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(index_1.Helpers.arrays.fuzzy(this.args.join(' '), founded, function (p) { return p.name; })
303
- .results), false), tslib_1.__read(index_1.Helpers.arrays.fuzzy(this.args.join(' '), founded, function (p) { return p.basename; })
304
- .results), false), tslib_1.__read(index_1.Helpers.arrays.fuzzy(this.args.join(' '), founded, function (p) { return p.location; })
305
- .results), false), 'location');
306
- index_1.Helpers.taskDone("found ".concat(results.length, " projects..."));
307
- openInEditor = function (proj) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
308
- var editor, embededProject, porjToOpen, locaitonFolderToOpen, error_2;
309
- return tslib_1.__generator(this, function (_a) {
310
- switch (_a.label) {
311
- case 0:
312
- index_1.Helpers.taskStarted("Getting code editor info...");
313
- return [4 /*yield*/, this.ins.configDb.getCodeEditor()];
314
- case 1:
315
- editor = _a.sent();
316
- index_1.Helpers.taskDone("Got code editor info...");
317
- embededProject = proj.linkedProjects.embeddedProject;
318
- porjToOpen = embededProject || proj;
319
- locaitonFolderToOpen = porjToOpen.location;
320
- index_1.Helpers.info('Initing and opening project...');
321
- _a.label = 2;
322
- case 2:
323
- _a.trys.push([2, 4, , 5]);
324
- return [4 /*yield*/, (porjToOpen === null || porjToOpen === void 0 ? void 0 : porjToOpen.struct())];
325
- case 3:
326
- _a.sent();
327
- return [3 /*break*/, 5];
328
- case 4:
329
- error_2 = _a.sent();
330
- return [3 /*break*/, 5];
331
- case 5:
332
- index_1.Helpers.run("".concat(editor, " ").concat(locaitonFolderToOpen)).sync();
333
- return [2 /*return*/];
334
- }
335
- });
336
- }); };
337
- if (!(results.length === 1)) return [3 /*break*/, 3];
338
- return [4 /*yield*/, openInEditor(tnp_core_1._.first(results))];
339
- case 2:
340
- _a.sent();
341
- return [3 /*break*/, 7];
342
- case 3:
343
- if (!(results.length === 0)) return [3 /*break*/, 4];
344
- index_1.Helpers.error("No project found by name: \"".concat(this.args.join(' '), "\""), false, true);
345
- return [3 /*break*/, 7];
346
- case 4:
347
- index_1.Helpers.info("Opening console gui to select project...");
348
- return [4 /*yield*/, index_1.Helpers.consoleGui.select('Select project to open', results.map(function (p) {
349
- return {
350
- name: p.genericName,
351
- value: p.location,
352
- };
353
- }), true)];
354
- case 5:
355
- res = _a.sent();
356
- return [4 /*yield*/, openInEditor(this.ins.From(res))];
357
- case 6:
358
- _a.sent();
359
- _a.label = 7;
360
- case 7:
361
- this._exit();
362
- return [2 /*return*/];
363
- }
364
- });
365
- });
366
- };
367
- BaseGlobalCommandLine.prototype.dev = function () {
368
- return tslib_1.__awaiter(this, void 0, void 0, function () {
369
- return tslib_1.__generator(this, function (_a) {
370
- switch (_a.label) {
371
- case 0: return [4 /*yield*/, this.develop()];
372
- case 1: return [2 /*return*/, _a.sent()];
373
- }
374
- });
375
- });
376
- };
154
+ async develop() {
155
+ // Helpers.clearConsole();
156
+ index_1.Helpers.taskStarted(`getting all projects...`);
157
+ const founded = ((await this.ins.projectsDb.getAllProjectsFromDB()) || [])
158
+ .filter(p => index_1.Helpers.exists(p.location))
159
+ .map(p => {
160
+ const proj = this.ins.From(p.location);
161
+ // console.log(`Proj for ${p.location} `, !!proj)
162
+ if (proj) {
163
+ return proj;
164
+ // return proj.embeddedProject ? proj.embeddedProject : proj;
165
+ }
166
+ // const nereset = this.ins.nearestTo(p.location);
167
+ // if (nereset) {
168
+ // const embeded = nereset.linkedProjects.find(l => crossPlatformPath([nereset.location, l.relativeClonePath]) === p.location);
169
+ // if (embeded) {
170
+ // return this.ins.From([nereset.location, embeded.relativeClonePath]);
171
+ // }
172
+ // }
173
+ })
174
+ .filter(p => !!p);
175
+ index_1.Helpers.taskDone(`found ${founded.length} projects...`);
176
+ index_1.Helpers.taskStarted(`searching for project...`);
177
+ // @ts-ignore
178
+ const results = index_1.Helpers.uniqArray([
179
+ ...index_1.Helpers.arrays.fuzzy(this.args.join(' '), founded, p => p.name)
180
+ .results,
181
+ ...index_1.Helpers.arrays.fuzzy(this.args.join(' '), founded, p => p.basename)
182
+ .results,
183
+ ...index_1.Helpers.arrays.fuzzy(this.args.join(' '), founded, p => p.location)
184
+ .results,
185
+ ], 'location');
186
+ index_1.Helpers.taskDone(`found ${results.length} projects...`);
187
+ const openInEditor = async (proj) => {
188
+ index_1.Helpers.taskStarted(`Getting code editor info...`);
189
+ const editor = await this.ins.configDb.getCodeEditor();
190
+ index_1.Helpers.taskDone(`Got code editor info...`);
191
+ const embededProject = proj.linkedProjects.embeddedProject;
192
+ const porjToOpen = embededProject || proj;
193
+ const locaitonFolderToOpen = porjToOpen.location;
194
+ index_1.Helpers.info('Initing and opening project...');
195
+ try {
196
+ await porjToOpen?.struct();
197
+ }
198
+ catch (error) { }
199
+ index_1.Helpers.run(`${editor} ${locaitonFolderToOpen}`).sync();
200
+ };
201
+ if (results.length === 1) {
202
+ await openInEditor(tnp_core_1._.first(results));
203
+ }
204
+ else if (results.length === 0) {
205
+ index_1.Helpers.error(`No project found by name: "${this.args.join(' ')}"`, false, true);
206
+ }
207
+ else {
208
+ index_1.Helpers.info(`Opening console gui to select project...`);
209
+ const res = await index_1.Helpers.consoleGui.select('Select project to open', results.map(p => {
210
+ return {
211
+ name: p.genericName,
212
+ value: p.location,
213
+ };
214
+ }), true);
215
+ await openInEditor(this.ins.From(res));
216
+ }
217
+ this._exit();
218
+ }
219
+ async dev() {
220
+ return await this.develop();
221
+ }
377
222
  //#endregion
378
223
  //#region commands / repulll
379
- BaseGlobalCommandLine.prototype.repul = function () {
380
- return tslib_1.__awaiter(this, void 0, void 0, function () {
381
- return tslib_1.__generator(this, function (_a) {
382
- switch (_a.label) {
383
- case 0: return [4 /*yield*/, this.repull()];
384
- case 1:
385
- _a.sent();
386
- return [2 /*return*/];
387
- }
388
- });
389
- });
390
- };
391
- BaseGlobalCommandLine.prototype.repull = function () {
392
- return tslib_1.__awaiter(this, void 0, void 0, function () {
393
- return tslib_1.__generator(this, function (_a) {
394
- switch (_a.label) {
395
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
396
- case 1:
397
- if (!(_a.sent())) {
398
- return [2 /*return*/];
399
- }
400
- return [4 /*yield*/, this.project.git.resetHard({ HEAD: 10 })];
401
- case 2:
402
- _a.sent();
403
- return [4 /*yield*/, this.pull()];
404
- case 3:
405
- _a.sent();
406
- return [2 /*return*/];
407
- }
408
- });
409
- });
410
- };
224
+ async repul() {
225
+ await this.repull();
226
+ }
227
+ async repull() {
228
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
229
+ return;
230
+ }
231
+ await this.project.git.resetHard({ HEAD: 10 });
232
+ await this.pull();
233
+ }
411
234
  //#endregion
412
235
  //#region commands / pull
413
- BaseGlobalCommandLine.prototype.pull = function () {
414
- return tslib_1.__awaiter(this, void 0, void 0, function () {
415
- return tslib_1.__generator(this, function (_a) {
416
- switch (_a.label) {
417
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
418
- case 1:
419
- if (!(_a.sent())) {
420
- return [2 /*return*/];
421
- }
422
- return [4 /*yield*/, this.project.git.pullProcess({
423
- setOrigin: this.params['setOrigin'],
424
- })];
425
- case 2:
426
- _a.sent();
427
- this._exit();
428
- return [2 /*return*/];
429
- }
430
- });
236
+ async pull() {
237
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
238
+ return;
239
+ }
240
+ await this.project.git.pullProcess({
241
+ setOrigin: this.params['setOrigin'],
431
242
  });
432
- };
243
+ this._exit();
244
+ }
433
245
  //#endregion
434
246
  //#region commands / pull all
435
- BaseGlobalCommandLine.prototype.pullAll = function () {
436
- return tslib_1.__awaiter(this, void 0, void 0, function () {
437
- return tslib_1.__generator(this, function (_a) {
438
- switch (_a.label) {
439
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
440
- case 1:
441
- if (!(_a.sent())) {
442
- return [2 /*return*/];
443
- }
444
- return [4 /*yield*/, this.project.git.pullProcess({
445
- cloneChildren: true,
446
- setOrigin: this.params['setOrigin'],
447
- })];
448
- case 2:
449
- _a.sent();
450
- this._exit();
451
- return [2 /*return*/];
452
- }
453
- });
247
+ async pullAll() {
248
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
249
+ return;
250
+ }
251
+ await this.project.git.pullProcess({
252
+ cloneChildren: true,
253
+ setOrigin: this.params['setOrigin'],
454
254
  });
455
- };
255
+ this._exit();
256
+ }
456
257
  //#endregion
457
258
  //#region commands / push and pull
458
- BaseGlobalCommandLine.prototype.pp = function () {
459
- return tslib_1.__awaiter(this, void 0, void 0, function () {
460
- var currentBranch;
461
- return tslib_1.__generator(this, function (_a) {
462
- currentBranch = this.project.git.currentBranchName;
463
- this.project
464
- .run("git push origin ".concat(currentBranch, " && git pull origin ").concat(currentBranch))
465
- .sync();
466
- console.log('Done push and pull');
467
- this._exit();
468
- return [2 /*return*/];
469
- });
470
- });
471
- };
259
+ async pp() {
260
+ const currentBranch = this.project.git.currentBranchName;
261
+ this.project
262
+ .run(`git push origin ${currentBranch} && git pull origin ${currentBranch}`)
263
+ .sync();
264
+ console.log('Done push and pull');
265
+ this._exit();
266
+ }
472
267
  //#endregion
473
268
  //#region commands / reset
474
- BaseGlobalCommandLine.prototype.__resetInfo = function (branchToReset) {
475
- index_1.Helpers.info("\n\n YOU ARE RESETING EVERYTHING TO BRANCH: ".concat(tnp_core_1.chalk.bold(branchToReset), "\n\n- curret project (").concat(this.project.name, ")\n").concat(tnp_core_1._.isArray(this.project.children) && this.project.children.length > 0
476
- ? "- modules:\n".concat(this.project.children
477
- .map(function (c) { return "\t".concat(c.basename, " (").concat(tnp_core_1.chalk.yellow(c.name), ")"); })
478
- .join('\n'))
479
- : '', "\n "));
480
- };
481
- BaseGlobalCommandLine.prototype.fetch = function () {
482
- return tslib_1.__awaiter(this, void 0, void 0, function () {
483
- var _a, _b;
484
- return tslib_1.__generator(this, function (_c) {
485
- try {
486
- (_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.git) === null || _b === void 0 ? void 0 : _b.fetch();
487
- }
488
- catch (error) { }
489
- this._exit();
490
- return [2 /*return*/];
491
- });
492
- });
493
- };
494
- BaseGlobalCommandLine.prototype.reset = function () {
495
- return tslib_1.__awaiter(this, void 0, void 0, function () {
496
- var parent, branchFromLinkedProjectConfig, overrideBranchToReset, resetOnlyChildren, branches, resetProject, res;
497
- var _this = this;
498
- var _a, _b, _c, _d, _e;
499
- return tslib_1.__generator(this, function (_f) {
500
- switch (_f.label) {
501
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
502
- case 1:
503
- // Helpers.clearConsole();
504
- if (!(_f.sent())) {
505
- return [2 /*return*/];
506
- }
507
- parent = this.project.parent;
508
- branchFromLinkedProjectConfig = (_b = (_a = parent === null || parent === void 0 ? void 0 : parent.linkedProjects) === null || _a === void 0 ? void 0 : _a.linkedProjects.find(function (l) {
509
- return ((0, tnp_core_2.crossPlatformPath)([parent.location, l.relativeClonePath]) ===
510
- _this.project.location);
511
- })) === null || _b === void 0 ? void 0 : _b.deafultBranch;
512
- overrideBranchToReset = this.firstArg ||
513
- branchFromLinkedProjectConfig ||
514
- ((_c = this.project.core) === null || _c === void 0 ? void 0 : _c.branch) ||
515
- this.project.getDefaultDevelopmentBranch() ||
516
- this.project.git.currentBranchName;
517
- if ((_d = this.project.core) === null || _d === void 0 ? void 0 : _d.branch) {
518
- index_1.Helpers.info("\n\n Core branch for project: ".concat((_e = this.project.core) === null || _e === void 0 ? void 0 : _e.branch, "\n\n "));
519
- }
520
- resetOnlyChildren = !!this.project.linkedProjects.getLinkedProjectsConfig().resetOnlyChildren;
521
- branches = index_1.Helpers.uniqArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(this.__filterBranchesByPattern(overrideBranchToReset)), false), tslib_1.__read(this.__filterBranchesByPattern('')), false));
522
- if (!resetOnlyChildren) return [3 /*break*/, 2];
523
- index_1.Helpers.info("Reseting only children...for defualt branches.");
524
- return [3 /*break*/, 5];
525
- case 2:
526
- if (!(branches.length > 0)) return [3 /*break*/, 4];
527
- return [4 /*yield*/, this.__selectBrach(branches, 'reset')];
528
- case 3:
529
- overrideBranchToReset = _f.sent();
530
- return [3 /*break*/, 5];
531
- case 4:
532
- index_1.Helpers.error("No branch found by name \"".concat(overrideBranchToReset || this.firstArg, "\""), false, true);
533
- _f.label = 5;
534
- case 5:
535
- overrideBranchToReset = overrideBranchToReset || '';
536
- this.__resetInfo(overrideBranchToReset
537
- ? overrideBranchToReset
538
- : this.project.getDefaultDevelopmentBranch());
539
- resetProject = this.project;
540
- if (!(this.project.git.isInsideGitRepo && !this.project.git.isGitRoot)) return [3 /*break*/, 7];
541
- index_1.Helpers.warn("You are not in root of git repo...", false);
542
- resetProject = this.ins.nearestTo((0, tnp_core_2.crossPlatformPath)([this.project.location, '..']), {
543
- findGitRoot: true,
544
- });
545
- return [4 /*yield*/, index_1.Helpers.questionYesNo("Would you like to reset root repo instead (project=".concat(tnp_core_1.chalk.bold.red(resetProject.genericName), ") ?"))];
546
- case 6:
547
- if (!(_f.sent())) {
548
- index_1.Helpers.error("Aborted", false, true);
549
- }
550
- _f.label = 7;
551
- case 7: return [4 /*yield*/, index_1.Helpers.questionYesNo("Reset hard and pull current project " +
552
- "".concat(resetProject.linkedProjects.linkedProjects.length > 0 ? '(and children)' : '', " ?"))];
553
- case 8:
554
- res = _f.sent();
555
- if (!res) return [3 /*break*/, 10];
556
- return [4 /*yield*/, resetProject.resetProcess(overrideBranchToReset)];
557
- case 9:
558
- _f.sent();
559
- _f.label = 10;
560
- case 10:
561
- this._exit();
562
- return [2 /*return*/];
563
- }
564
- });
565
- });
566
- };
269
+ __resetInfo(branchToReset, withChildren) {
270
+ index_1.Helpers.info(`
271
+
272
+ YOU ARE RESETING ${withChildren ? 'EVERYTHING' : 'PROJECT'} ` +
273
+ `TO BRANCH: ${tnp_core_1.chalk.bold(branchToReset)}
274
+
275
+ - curret project (${this.project.name})
276
+ ${withChildren &&
277
+ tnp_core_1._.isArray(this.project.children) &&
278
+ this.project.children.length > 0
279
+ ? `- modules:\n${this.project.children
280
+ .map(c => `\t${c.basename} (${tnp_core_1.chalk.yellow(c.name)})`)
281
+ .join('\n')}`
282
+ : ''}
283
+ `);
284
+ }
285
+ async fetch() {
286
+ try {
287
+ this.project?.git?.fetch();
288
+ }
289
+ catch (error) { }
290
+ this._exit();
291
+ }
292
+ async reset() {
293
+ // Helpers.clearConsole();
294
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
295
+ return;
296
+ }
297
+ const parent = this.project.parent;
298
+ const branchFromLinkedProjectConfig = parent?.linkedProjects?.linkedProjects.find(l => {
299
+ return ((0, tnp_core_2.crossPlatformPath)([parent.location, l.relativeClonePath]) ===
300
+ this.project.location);
301
+ })?.defaultBranch;
302
+ let overrideBranchToReset = this.firstArg ||
303
+ branchFromLinkedProjectConfig ||
304
+ this.project.core?.branch ||
305
+ this.project.git.getDefaultDevelopmentBranch() ||
306
+ this.project.git.currentBranchName;
307
+ if (this.project.core?.branch) {
308
+ index_1.Helpers.info(`
309
+
310
+ Core branch for project: ${this.project.core?.branch}
311
+
312
+ `);
313
+ }
314
+ const resetOnlyChildren = !!this.project.linkedProjects.getLinkedProjectsConfig().resetOnlyChildren;
315
+ const branches = index_1.Helpers.uniqArray([
316
+ ...this.__filterBranchesByPattern(overrideBranchToReset),
317
+ ...this.__filterBranchesByPattern(''),
318
+ ]);
319
+ const resetChildren = this.project.git.resetIsRestingAlsoChildren();
320
+ if (resetChildren && resetOnlyChildren) {
321
+ index_1.Helpers.info(`Reseting only children...for defualt branches.`);
322
+ }
323
+ else {
324
+ if (branches.length > 0) {
325
+ overrideBranchToReset = await this.__selectBrach(branches, 'reset');
326
+ }
327
+ else {
328
+ index_1.Helpers.error(`No branch found by name "${overrideBranchToReset || this.firstArg}"`, false, true);
329
+ }
330
+ }
331
+ overrideBranchToReset = overrideBranchToReset || '';
332
+ this.__resetInfo(overrideBranchToReset
333
+ ? overrideBranchToReset
334
+ : this.project.git.getDefaultDevelopmentBranch(), resetChildren);
335
+ let resetProject = this.project;
336
+ if (this.project.git.isInsideGitRepo && !this.project.git.isGitRoot) {
337
+ index_1.Helpers.warn(`You are not in root of git repo...`, false);
338
+ resetProject = this.ins.nearestTo((0, tnp_core_2.crossPlatformPath)([this.project.location, '..']), {
339
+ findGitRoot: true,
340
+ });
341
+ if (!(await index_1.Helpers.questionYesNo(`Would you like to reset root repo instead (project=${tnp_core_1.chalk.bold.red(resetProject.genericName)}) ?`))) {
342
+ index_1.Helpers.error(`Aborted`, false, true);
343
+ }
344
+ }
345
+ const res = await index_1.Helpers.questionYesNo(`Reset hard and pull current project ` +
346
+ `${resetChildren && resetProject.linkedProjects.linkedProjects.length > 0 ? '(and children)' : ''} ?`);
347
+ if (res) {
348
+ await resetProject.resetProcess(overrideBranchToReset);
349
+ }
350
+ this._exit();
351
+ }
567
352
  //#endregion
568
353
  //#region commands / soft
569
- BaseGlobalCommandLine.prototype.soft = function () {
570
- return tslib_1.__awaiter(this, void 0, void 0, function () {
571
- return tslib_1.__generator(this, function (_a) {
572
- switch (_a.label) {
573
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
574
- case 1:
575
- // TODO when aciton commit
576
- if (!(_a.sent())) {
577
- return [2 /*return*/];
578
- }
579
- this.project.git.resetSoftHEAD(1);
580
- this._exit();
581
- return [2 /*return*/];
582
- }
583
- });
354
+ async soft() {
355
+ // TODO when aciton commit
356
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
357
+ return;
358
+ }
359
+ const howManyCommits = Number(this.firstArg) || 1;
360
+ tnp_core_1._.times(howManyCommits, n => {
361
+ console.log(`Resetting soft ${n + 1} commit "${this.project.git.lastCommitMessage()}"`);
362
+ this.project.git.resetSoftHEAD(1);
584
363
  });
585
- };
364
+ this._exit();
365
+ }
586
366
  //#endregion
587
367
  //#region commands / rebase
588
- BaseGlobalCommandLine.prototype.rebase = function () {
589
- return tslib_1.__awaiter(this, void 0, void 0, function () {
590
- var currentBranch, safeReset, rebaseBranch, branches, error_3;
591
- return tslib_1.__generator(this, function (_a) {
592
- switch (_a.label) {
593
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
594
- case 1:
595
- if (!(_a.sent())) {
596
- return [2 /*return*/];
597
- }
598
- currentBranch = this.project.git.currentBranchName;
599
- safeReset = 10;
600
- rebaseBranch = this.firstArg || this.project.getDefaultDevelopmentBranch();
601
- branches = this.__filterBranchesByPattern(rebaseBranch);
602
- if (!(branches.length > 0)) return [3 /*break*/, 3];
603
- return [4 /*yield*/, this.__selectBrach(branches, 'reset')];
604
- case 2:
605
- rebaseBranch = _a.sent();
606
- return [3 /*break*/, 4];
607
- case 3:
608
- index_1.Helpers.error("No branch found by name \"".concat(rebaseBranch, "\""), false, true);
609
- _a.label = 4;
610
- case 4:
611
- _a.trys.push([4, 6, , 8]);
612
- this.project
613
- .run("git reset--hard && git checkout ".concat(rebaseBranch, " && git reset--hard HEAD~").concat(safeReset, " && git pull origin ").concat(rebaseBranch, " ") +
614
- "&& git checkout ".concat(currentBranch, " && git reset--soft HEAD~1 && git stash && git reset--hard HEAD~").concat(safeReset, " && git rebase ").concat(rebaseBranch, " && git stash apply"), { output: false, silence: true })
615
- .sync();
616
- return [4 /*yield*/, this.project.init()];
617
- case 5:
618
- _a.sent();
619
- index_1.Helpers.info('REBASE DONE');
620
- return [3 /*break*/, 8];
621
- case 6:
622
- error_3 = _a.sent();
623
- return [4 /*yield*/, this.project.init()];
624
- case 7:
625
- _a.sent();
626
- index_1.Helpers.warn('PLEASE MERGE YOUR CHANGES');
627
- return [3 /*break*/, 8];
628
- case 8:
629
- this._exit();
630
- return [2 /*return*/];
631
- }
632
- });
633
- });
634
- };
368
+ async rebase() {
369
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
370
+ return;
371
+ }
372
+ const currentBranch = this.project.git.currentBranchName;
373
+ let safeReset = 10;
374
+ let rebaseBranch = this.firstArg || this.project.git.getDefaultDevelopmentBranch();
375
+ const branches = this.__filterBranchesByPattern(rebaseBranch);
376
+ if (branches.length > 1) {
377
+ rebaseBranch = await this.__selectBrach(branches, 'rebase');
378
+ }
379
+ else if (branches.length === 1) {
380
+ rebaseBranch = tnp_core_1._.first(branches);
381
+ }
382
+ else {
383
+ index_1.Helpers.error(`No rebase branch found by name "${rebaseBranch}"`, false, true);
384
+ }
385
+ index_1.Helpers.info(`
386
+ You are rebasing current branch (${currentBranch}) to ${rebaseBranch}
387
+
388
+ Files from last commit:
389
+
390
+ "${tnp_core_1.chalk.gray(await this.project.git.getCommitMessageByHash(this.project.git.lastCommitHash()))}"
391
+ (hash: ${tnp_core_1.chalk.gray(this.project.git.lastCommitHash())})
392
+
393
+ are going to be applied after rebase.
394
+
395
+
396
+ `);
397
+ if (!(await tnp_core_3.UtilsTerminal.confirm({
398
+ message: `Do you want to continue ?`,
399
+ defaultValue: true,
400
+ }))) {
401
+ this._exit();
402
+ }
403
+ try {
404
+ this.project.git.resetHard();
405
+ this.project.git.checkout(rebaseBranch);
406
+ this.project.git.resetHard({ HEAD: safeReset });
407
+ await this.project.git.pullCurrentBranch();
408
+ this.project.git.checkout(currentBranch);
409
+ this.project.git.resetSoftHEAD(1);
410
+ this.project.git.stageAllFiles();
411
+ this.project.git.stash();
412
+ this.project.git.resetHard({ HEAD: safeReset });
413
+ this.project.git.rebase(rebaseBranch);
414
+ this.project.git.stashApply();
415
+ await this.project.init();
416
+ index_1.Helpers.info('REBASE DONE');
417
+ }
418
+ catch (error) {
419
+ index_1.Helpers.renderError(error);
420
+ try {
421
+ // dummy init to get back to previous vscode settings
422
+ await this.project.init();
423
+ }
424
+ catch (error) { }
425
+ index_1.Helpers.error('Not able to rebase', true, true);
426
+ }
427
+ this._exit();
428
+ }
635
429
  //#endregion
636
430
  //#region commands / stash
637
431
  /**
638
432
  * stash only staged files
639
433
  */
640
- BaseGlobalCommandLine.prototype.stash = function () {
641
- return tslib_1.__awaiter(this, void 0, void 0, function () {
642
- return tslib_1.__generator(this, function (_a) {
643
- switch (_a.label) {
644
- case 0:
645
- index_1.Helpers.info("Stashing only staged files...");
646
- return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
647
- case 1:
648
- if (!(_a.sent())) {
649
- return [2 /*return*/];
650
- }
651
- this.project.git.stash({ onlyStaged: true });
652
- this._exit();
653
- return [2 /*return*/];
654
- }
655
- });
656
- });
657
- };
434
+ async stash() {
435
+ index_1.Helpers.info(`Stashing only staged files...`);
436
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
437
+ return;
438
+ }
439
+ this.project.git.stash({ onlyStaged: true });
440
+ this._exit();
441
+ }
658
442
  //#endregion
659
443
  //#region commands / stash all
660
444
  /**
661
445
  * stash all files
662
446
  */
663
- BaseGlobalCommandLine.prototype.stashAll = function () {
664
- return tslib_1.__awaiter(this, void 0, void 0, function () {
665
- return tslib_1.__generator(this, function (_a) {
666
- switch (_a.label) {
667
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
668
- case 1:
669
- if (!(_a.sent())) {
670
- return [2 /*return*/];
671
- }
672
- this.project.git.stageAllFiles();
673
- this.project.git.stash({ onlyStaged: false });
674
- this._exit();
675
- return [2 /*return*/];
676
- }
677
- });
678
- });
679
- };
447
+ async stashAll() {
448
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
449
+ return;
450
+ }
451
+ this.project.git.stageAllFiles();
452
+ this.project.git.stash();
453
+ this._exit();
454
+ }
680
455
  //#endregion
681
456
  //#region commands / push all origins
682
457
  /**
683
458
  * push force to all orgins
684
459
  */
685
- BaseGlobalCommandLine.prototype.pushAllForce = function () {
686
- return tslib_1.__awaiter(this, void 0, void 0, function () {
687
- return tslib_1.__generator(this, function (_a) {
688
- switch (_a.label) {
689
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
690
- case 1:
691
- if (!(_a.sent())) {
692
- return [2 /*return*/];
693
- }
694
- return [4 /*yield*/, this.pushAll(true)];
695
- case 2:
696
- _a.sent();
697
- return [2 /*return*/];
698
- }
699
- });
700
- });
701
- };
702
- BaseGlobalCommandLine.prototype.pAllForce = function () {
703
- return tslib_1.__awaiter(this, void 0, void 0, function () {
704
- return tslib_1.__generator(this, function (_a) {
705
- switch (_a.label) {
706
- case 0: return [4 /*yield*/, this.pushAllForce()];
707
- case 1:
708
- _a.sent();
709
- return [2 /*return*/];
710
- }
711
- });
712
- });
713
- };
714
- BaseGlobalCommandLine.prototype.pAllf = function () {
715
- return tslib_1.__awaiter(this, void 0, void 0, function () {
716
- return tslib_1.__generator(this, function (_a) {
717
- switch (_a.label) {
718
- case 0: return [4 /*yield*/, this.pushAllForce()];
719
- case 1:
720
- _a.sent();
721
- return [2 /*return*/];
722
- }
723
- });
724
- });
725
- };
726
- BaseGlobalCommandLine.prototype.pAll = function () {
727
- return tslib_1.__awaiter(this, void 0, void 0, function () {
728
- return tslib_1.__generator(this, function (_a) {
729
- switch (_a.label) {
730
- case 0: return [4 /*yield*/, this.pushAll()];
731
- case 1:
732
- _a.sent();
733
- return [2 /*return*/];
734
- }
735
- });
736
- });
737
- };
460
+ async pushAllForce() {
461
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
462
+ return;
463
+ }
464
+ await this.pushAll(true);
465
+ }
466
+ async pAllForce() {
467
+ await this.pushAllForce();
468
+ }
469
+ async pAllf() {
470
+ await this.pushAllForce();
471
+ }
472
+ async pAll() {
473
+ await this.pushAll();
474
+ }
738
475
  /**
739
476
  * push to all origins
740
477
  */
741
- BaseGlobalCommandLine.prototype.pushAll = function () {
742
- return tslib_1.__awaiter(this, arguments, void 0, function (force) {
743
- var remotes, index, _a, origin_1, url;
744
- if (force === void 0) { force = false; }
745
- return tslib_1.__generator(this, function (_b) {
746
- switch (_b.label) {
747
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
748
- case 1:
749
- if (!(_b.sent())) {
750
- return [2 /*return*/];
751
- }
752
- remotes = this.project.git.allOrigins;
753
- index_1.Helpers.info("\n\n Remotes for repo:\n\n".concat(remotes.map(function (r, i) { return "".concat(i + 1, ". ").concat(r.origin, " ").concat(r.url); }).join('\n'), "\n\n"));
754
- index = 0;
755
- _b.label = 2;
756
- case 2:
757
- if (!(index < remotes.length)) return [3 /*break*/, 5];
758
- _a = remotes[index], origin_1 = _a.origin, url = _a.url;
759
- index_1.Helpers.taskStarted("Pushing to ".concat(tnp_core_1.chalk.bold(origin_1), " (").concat(url, ")..."));
760
- return [4 /*yield*/, this.push({ force: force, origin: origin_1, noExit: true })];
761
- case 3:
762
- _b.sent();
763
- index_1.Helpers.taskDone("Pushed to ".concat(origin_1));
764
- _b.label = 4;
765
- case 4:
766
- index++;
767
- return [3 /*break*/, 2];
768
- case 5:
769
- this._exit();
770
- return [2 /*return*/];
771
- }
772
- });
773
- });
774
- };
478
+ async pushAll(force = false) {
479
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
480
+ return;
481
+ }
482
+ const remotes = this.project.git.allOrigins;
483
+ index_1.Helpers.info(`
484
+
485
+ Remotes for repo:
486
+
487
+ ${remotes.map((r, i) => `${i + 1}. ${r.origin} ${r.url}`).join('\n')}
488
+
489
+ `);
490
+ for (let index = 0; index < remotes.length; index++) {
491
+ const { origin, url } = remotes[index];
492
+ index_1.Helpers.taskStarted(`Pushing to ${tnp_core_1.chalk.bold(origin)} (${url})...`);
493
+ await this.push({ force, origin, noExit: true });
494
+ index_1.Helpers.taskDone(`Pushed to ${origin}`);
495
+ }
496
+ this._exit();
497
+ }
775
498
  //#endregion
776
499
  //#region commands / push force
777
- BaseGlobalCommandLine.prototype.forcePush = function () {
778
- return tslib_1.__awaiter(this, void 0, void 0, function () {
779
- return tslib_1.__generator(this, function (_a) {
780
- switch (_a.label) {
781
- case 0: return [4 /*yield*/, this.push({ force: true, typeofCommit: 'feature' })];
782
- case 1:
783
- _a.sent();
784
- return [2 /*return*/];
785
- }
786
- });
787
- });
788
- };
789
- BaseGlobalCommandLine.prototype.pushForce = function () {
790
- return tslib_1.__awaiter(this, void 0, void 0, function () {
791
- return tslib_1.__generator(this, function (_a) {
792
- switch (_a.label) {
793
- case 0: return [4 /*yield*/, this.push({ force: true, typeofCommit: 'feature' })];
794
- case 1:
795
- _a.sent();
796
- return [2 /*return*/];
797
- }
798
- });
799
- });
800
- };
500
+ async forcePush() {
501
+ await this.push({ force: true, typeofCommit: 'feature' });
502
+ }
503
+ async pushForce() {
504
+ await this.push({ force: true, typeofCommit: 'feature' });
505
+ }
801
506
  //#endregion
802
507
  //#region commands / commit
803
508
  /**
804
509
  * Commit and push this for single repo
805
510
  */
806
- BaseGlobalCommandLine.prototype.commit = function () {
807
- return tslib_1.__awaiter(this, arguments, void 0, function (options) {
808
- var _this = this;
809
- if (options === void 0) { options = {}; }
810
- return tslib_1.__generator(this, function (_a) {
811
- switch (_a.label) {
812
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
813
- case 1:
814
- if (!(_a.sent())) {
815
- return [2 /*return*/];
816
- }
817
- return [4 /*yield*/, this.project.git.meltActionCommits()];
818
- case 2:
819
- _a.sent();
820
- return [4 /*yield*/, this.project.git.pushProcess(tslib_1.__assign(tslib_1.__assign({}, options), { forcePushNoQuestion: options.force, args: this.args, exitCallBack: function () {
821
- _this._exit();
822
- }, skipChildren: true, overrideCommitMessage: this.args.join(' '), setOrigin: this.params['setOrigin'], currentOrigin: this.project.git.originURL }))];
823
- case 3:
824
- _a.sent();
825
- if (options.noExit) {
826
- return [2 /*return*/];
827
- }
828
- this._exit();
829
- return [2 /*return*/];
830
- }
831
- });
832
- });
833
- };
511
+ async commit(options = {}) {
512
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
513
+ return;
514
+ }
515
+ await this.project.git.meltActionCommits();
516
+ await this.project.git.pushProcess({
517
+ ...options,
518
+ forcePushNoQuestion: options.force,
519
+ args: this.args,
520
+ exitCallBack: () => {
521
+ this._exit();
522
+ },
523
+ skipChildren: true,
524
+ overrideCommitMessage: this.args.join(' '),
525
+ setOrigin: this.params['setOrigin'],
526
+ currentOrigin: this.project.git.originURL,
527
+ });
528
+ if (options.noExit) {
529
+ return;
530
+ }
531
+ this._exit();
532
+ }
834
533
  //#endregion
835
534
  //#region commands / push
836
- BaseGlobalCommandLine.prototype._preventPushPullFromNotCorrectBranch = function () {
837
- return tslib_1.__awaiter(this, void 0, void 0, function () {
838
- var _loop_1, this_1, state_1;
839
- return tslib_1.__generator(this, function (_a) {
840
- switch (_a.label) {
841
- case 0:
842
- _loop_1 = function () {
843
- var devBranch, options_1, res;
844
- return tslib_1.__generator(this, function (_b) {
845
- switch (_b.label) {
846
- case 0:
847
- devBranch = this_1.project.git.duringPushWarnIfProjectNotOnSpecyficDevBranch();
848
- if (!(!!devBranch && devBranch !== this_1.project.git.currentBranchName)) return [3 /*break*/, 2];
849
- index_1.Helpers.warn("\n\n ".concat(this_1.project.genericName, "\n\n You are not on ").concat(devBranch, " branch. Please switch to this branch and try again\n\n\n\n "), false);
850
- options_1 = {
851
- open: { name: 'Open in vscode' },
852
- continue: { name: 'Continue (check again)' },
853
- continueForce: { name: 'Continue (without checking)' },
854
- exit: { name: 'Exit process' },
855
- };
856
- return [4 /*yield*/, index_1.Helpers.selectChoicesAsk('What you want to do ?', Object.keys(options_1).map(function (k) {
857
- return { name: options_1[k].name, value: k };
858
- }))];
859
- case 1:
860
- res = _b.sent();
861
- if (res === 'continue') {
862
- return [2 /*return*/, "continue"];
863
- }
864
- if (res === 'exit') {
865
- this_1._exit();
866
- }
867
- if (res === 'open') {
868
- this_1.project.run('code . ').sync();
869
- return [2 /*return*/, "continue"];
870
- }
871
- if (res === 'continueForce') {
872
- return [2 /*return*/, { value: void 0 }];
873
- }
874
- _b.label = 2;
875
- case 2: return [2 /*return*/, { value: void 0 }];
876
- }
877
- });
878
- };
879
- this_1 = this;
880
- _a.label = 1;
881
- case 1:
882
- if (!true) return [3 /*break*/, 3];
883
- return [5 /*yield**/, _loop_1()];
884
- case 2:
885
- state_1 = _a.sent();
886
- if (typeof state_1 === "object")
887
- return [2 /*return*/, state_1.value];
888
- return [3 /*break*/, 1];
889
- case 3: return [2 /*return*/];
890
- }
891
- });
892
- });
893
- };
894
- BaseGlobalCommandLine.prototype.qPush = function () {
895
- return tslib_1.__awaiter(this, void 0, void 0, function () {
896
- return tslib_1.__generator(this, function (_a) {
897
- switch (_a.label) {
898
- case 0: return [4 /*yield*/, this.quickPush()];
899
- case 1:
900
- _a.sent();
901
- return [2 /*return*/];
902
- }
903
- });
904
- });
905
- };
906
- BaseGlobalCommandLine.prototype.quickPush = function () {
907
- return tslib_1.__awaiter(this, void 0, void 0, function () {
908
- return tslib_1.__generator(this, function (_a) {
909
- switch (_a.label) {
910
- case 0: return [4 /*yield*/, this.push({ skipLint: true })];
911
- case 1:
912
- _a.sent();
913
- return [2 /*return*/];
914
- }
915
- });
916
- });
917
- };
918
- BaseGlobalCommandLine.prototype.push = function () {
919
- return tslib_1.__awaiter(this, arguments, void 0, function (options) {
920
- var _this = this;
921
- if (options === void 0) { options = {}; }
922
- return tslib_1.__generator(this, function (_a) {
923
- switch (_a.label) {
924
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
925
- case 1:
926
- // console.log('args', this.args);
927
- // console.log(`argsWithParams "${this.argsWithParams}"` );
928
- if (!(_a.sent())) {
929
- return [2 /*return*/];
930
- }
931
- return [4 /*yield*/, this._preventPushPullFromNotCorrectBranch()];
932
- case 2:
933
- _a.sent();
934
- return [4 /*yield*/, this.project.git.pushProcess(tslib_1.__assign(tslib_1.__assign({}, options), { forcePushNoQuestion: options.force, args: (options === null || options === void 0 ? void 0 : options.overrideCommitMessage)
935
- ? ((options === null || options === void 0 ? void 0 : options.overrideCommitMessage) || '').split(' ')
936
- : this.args, exitCallBack: function () {
937
- _this._exit();
938
- }, setOrigin: this.params['setOrigin'], currentOrigin: this.project.git.originURL }))];
939
- case 3:
940
- _a.sent();
941
- if (options.noExit) {
942
- return [2 /*return*/];
943
- }
944
- this._exit();
945
- return [2 /*return*/];
535
+ async _preventPushPullFromNotCorrectBranch() {
536
+ while (true) {
537
+ const devBranch = this.project.git.duringPushWarnIfProjectNotOnSpecyficDevBranch();
538
+ if (!!devBranch && devBranch !== this.project.git.currentBranchName) {
539
+ index_1.Helpers.warn(`
540
+
541
+ ${this.project.genericName}
542
+
543
+ You are not on ${devBranch} branch. Please switch to this branch and try again
544
+
545
+
546
+
547
+ `, false);
548
+ const options = {
549
+ open: { name: 'Open in vscode' },
550
+ continue: { name: 'Continue (check again)' },
551
+ continueForce: { name: 'Continue (without checking)' },
552
+ exit: { name: 'Exit process' },
553
+ };
554
+ const res = await index_1.Helpers.selectChoicesAsk('What you want to do ?', Object.keys(options).map(k => {
555
+ return { name: options[k].name, value: k };
556
+ }));
557
+ if (res === 'continue') {
558
+ continue;
559
+ }
560
+ if (res === 'exit') {
561
+ this._exit();
562
+ }
563
+ if (res === 'open') {
564
+ this.project.run('code . ').sync();
565
+ continue;
566
+ }
567
+ if (res === 'continueForce') {
568
+ return;
946
569
  }
947
- });
570
+ }
571
+ return;
572
+ }
573
+ }
574
+ async qPush() {
575
+ await this.quickPush();
576
+ }
577
+ async quickPush() {
578
+ await this.push({ skipLint: true });
579
+ }
580
+ async push(options = {}) {
581
+ // console.log('args', this.args);
582
+ // console.log(`argsWithParams "${this.argsWithParams}"` );
583
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
584
+ return;
585
+ }
586
+ await this._preventPushPullFromNotCorrectBranch();
587
+ await this.project.git.pushProcess({
588
+ ...options,
589
+ forcePushNoQuestion: options.force,
590
+ args: options?.overrideCommitMessage
591
+ ? (options?.overrideCommitMessage || '').split(' ')
592
+ : this.args,
593
+ exitCallBack: () => {
594
+ this._exit();
595
+ },
596
+ setOrigin: this.params['setOrigin'],
597
+ currentOrigin: this.project.git.originURL,
948
598
  });
949
- };
599
+ if (options.noExit) {
600
+ return;
601
+ }
602
+ this._exit();
603
+ }
950
604
  //#endregion
951
605
  //#region commands / melt
952
- BaseGlobalCommandLine.prototype.melt = function () {
953
- return tslib_1.__awaiter(this, void 0, void 0, function () {
954
- return tslib_1.__generator(this, function (_a) {
955
- switch (_a.label) {
956
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
957
- case 1:
958
- if (!(_a.sent())) {
959
- return [2 /*return*/];
960
- }
961
- return [4 /*yield*/, this.meltUpdateCommits(true)];
962
- case 2:
963
- _a.sent();
964
- this._exit();
965
- return [2 /*return*/];
966
- }
967
- });
968
- });
969
- };
606
+ async melt() {
607
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
608
+ return;
609
+ }
610
+ await this.meltUpdateCommits(true);
611
+ this._exit();
612
+ }
970
613
  //#endregion
971
614
  //#region commands / melt updat ecommits
972
- BaseGlobalCommandLine.prototype.meltUpdateCommits = function () {
973
- return tslib_1.__awaiter(this, arguments, void 0, function (hideInfo) {
974
- if (hideInfo === void 0) { hideInfo = false; }
975
- return tslib_1.__generator(this, function (_a) {
976
- switch (_a.label) {
977
- case 0:
978
- if (!(this.project.git.meltActionCommits() > 0)) return [3 /*break*/, 2];
979
- if (!!hideInfo) return [3 /*break*/, 2];
980
- this.project.git.stageAllFiles();
981
- return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo('Update commits has been reset. Continue with changes ?')];
982
- case 1:
983
- if (!(_a.sent())) {
984
- this._exit();
985
- }
986
- _a.label = 2;
987
- case 2: return [2 /*return*/];
615
+ async meltUpdateCommits(hideInfo = false) {
616
+ if (this.project.git.meltActionCommits() > 0) {
617
+ if (!hideInfo) {
618
+ this.project.git.stageAllFiles();
619
+ if (!(await index_1.Helpers.consoleGui.question.yesNo('Update commits has been reset. Continue with changes ?'))) {
620
+ this._exit();
988
621
  }
989
- });
990
- });
991
- };
622
+ }
623
+ }
624
+ }
992
625
  //#endregion
993
626
  //#region commands / push feature
994
- BaseGlobalCommandLine.prototype.pf = function () {
995
- return tslib_1.__awaiter(this, void 0, void 0, function () {
996
- return tslib_1.__generator(this, function (_a) {
997
- switch (_a.label) {
998
- case 0: return [4 /*yield*/, this.pushFeature()];
999
- case 1:
1000
- _a.sent();
1001
- return [2 /*return*/];
1002
- }
1003
- });
1004
- });
1005
- };
1006
- BaseGlobalCommandLine.prototype.pRel = function () {
1007
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1008
- return tslib_1.__generator(this, function (_a) {
1009
- switch (_a.label) {
1010
- case 0: return [4 /*yield*/, this.pushRelease()];
1011
- case 1:
1012
- _a.sent();
1013
- return [2 /*return*/];
1014
- }
1015
- });
1016
- });
1017
- };
1018
- BaseGlobalCommandLine.prototype.pRelease = function () {
1019
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1020
- return tslib_1.__generator(this, function (_a) {
1021
- switch (_a.label) {
1022
- case 0: return [4 /*yield*/, this.pushRelease()];
1023
- case 1:
1024
- _a.sent();
1025
- return [2 /*return*/];
1026
- }
1027
- });
1028
- });
1029
- };
1030
- BaseGlobalCommandLine.prototype.pushRelease = function () {
1031
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1032
- return tslib_1.__generator(this, function (_a) {
1033
- switch (_a.label) {
1034
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1035
- case 1:
1036
- _a.sent();
1037
- return [4 /*yield*/, this.push({
1038
- typeofCommit: 'release',
1039
- commitMessageRequired: true,
1040
- overrideCommitMessage: "".concat(tnp_core_1._.first(this.project.releaseProcess.getReleaseWords()), " ") +
1041
- "version ".concat(this.project.npmHelpers.version),
1042
- })];
1043
- case 2:
1044
- _a.sent();
1045
- return [2 /*return*/];
1046
- }
1047
- });
1048
- });
1049
- };
1050
- BaseGlobalCommandLine.prototype.mPush = function () {
1051
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1052
- return tslib_1.__generator(this, function (_a) {
1053
- switch (_a.label) {
1054
- case 0: return [4 /*yield*/, this.meltPush()];
1055
- case 1:
1056
- _a.sent();
1057
- return [2 /*return*/];
1058
- }
1059
- });
1060
- });
1061
- };
1062
- BaseGlobalCommandLine.prototype.fmPush = function () {
1063
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1064
- return tslib_1.__generator(this, function (_a) {
1065
- switch (_a.label) {
1066
- case 0: return [4 /*yield*/, this.forceMeltPush()];
1067
- case 1:
1068
- _a.sent();
1069
- return [2 /*return*/];
1070
- }
1071
- });
1072
- });
1073
- };
1074
- BaseGlobalCommandLine.prototype.mfPush = function () {
1075
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1076
- return tslib_1.__generator(this, function (_a) {
1077
- switch (_a.label) {
1078
- case 0: return [4 /*yield*/, this.forceMeltPush()];
1079
- case 1:
1080
- _a.sent();
1081
- return [2 /*return*/];
1082
- }
1083
- });
1084
- });
1085
- };
1086
- BaseGlobalCommandLine.prototype.mforcePush = function () {
1087
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1088
- return tslib_1.__generator(this, function (_a) {
1089
- switch (_a.label) {
1090
- case 0: return [4 /*yield*/, this.forceMeltPush()];
1091
- case 1:
1092
- _a.sent();
1093
- return [2 /*return*/];
1094
- }
1095
- });
1096
- });
1097
- };
1098
- BaseGlobalCommandLine.prototype.meltforcePush = function () {
1099
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1100
- return tslib_1.__generator(this, function (_a) {
1101
- switch (_a.label) {
1102
- case 0: return [4 /*yield*/, this.forceMeltPush()];
1103
- case 1:
1104
- _a.sent();
1105
- return [2 /*return*/];
1106
- }
1107
- });
1108
- });
1109
- };
1110
- BaseGlobalCommandLine.prototype.forceMeltPush = function () {
1111
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1112
- return tslib_1.__generator(this, function (_a) {
1113
- switch (_a.label) {
1114
- case 0: return [4 /*yield*/, this.meltPush(true)];
1115
- case 1:
1116
- _a.sent();
1117
- return [2 /*return*/];
1118
- }
1119
- });
1120
- });
1121
- };
1122
- BaseGlobalCommandLine.prototype.meltPush = function () {
1123
- return tslib_1.__awaiter(this, arguments, void 0, function (force) {
1124
- if (force === void 0) { force = false; }
1125
- return tslib_1.__generator(this, function (_a) {
1126
- switch (_a.label) {
1127
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1128
- case 1:
1129
- _a.sent();
1130
- return [4 /*yield*/, this.push({
1131
- mergeUpdateCommits: true,
1132
- force: force,
1133
- })];
1134
- case 2:
1135
- _a.sent();
1136
- return [2 /*return*/];
1137
- }
1138
- });
627
+ async pf() {
628
+ await this.pushFeature();
629
+ }
630
+ async pRel() {
631
+ await this.pushRelease();
632
+ }
633
+ async pRelease() {
634
+ await this.pushRelease();
635
+ }
636
+ async pushRelease() {
637
+ await this.meltUpdateCommits();
638
+ await this.push({
639
+ typeofCommit: 'release',
640
+ commitMessageRequired: true,
641
+ overrideCommitMessage: `${tnp_core_1._.first(this.project.releaseProcess.getReleaseWords())} ` +
642
+ `version ${this.project.packageJson.version}`,
1139
643
  });
1140
- };
1141
- BaseGlobalCommandLine.prototype.pushFeature = function () {
1142
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1143
- return tslib_1.__generator(this, function (_a) {
1144
- switch (_a.label) {
1145
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1146
- case 1:
1147
- _a.sent();
1148
- return [4 /*yield*/, this.push({ typeofCommit: 'feature', commitMessageRequired: true })];
1149
- case 2:
1150
- _a.sent();
1151
- return [2 /*return*/];
1152
- }
1153
- });
644
+ }
645
+ async mPush() {
646
+ await this.meltPush();
647
+ }
648
+ async fmPush() {
649
+ await this.forceMeltPush();
650
+ }
651
+ async mfPush() {
652
+ await this.forceMeltPush();
653
+ }
654
+ async mforcePush() {
655
+ await this.forceMeltPush();
656
+ }
657
+ async meltforcePush() {
658
+ await this.forceMeltPush();
659
+ }
660
+ async forceMeltPush() {
661
+ await this.meltPush(true);
662
+ }
663
+ async meltPush(force = false) {
664
+ await this.meltUpdateCommits();
665
+ await this.push({
666
+ mergeUpdateCommits: true,
667
+ force,
1154
668
  });
1155
- };
669
+ }
670
+ async pushFeature() {
671
+ await this.meltUpdateCommits();
672
+ await this.push({ typeofCommit: 'feature', commitMessageRequired: true });
673
+ }
1156
674
  //#endregion
1157
675
  //#region commands / push fix
1158
- BaseGlobalCommandLine.prototype.pushFix = function () {
1159
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1160
- return tslib_1.__generator(this, function (_a) {
1161
- switch (_a.label) {
1162
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1163
- case 1:
1164
- _a.sent();
1165
- return [4 /*yield*/, this.push({ typeofCommit: 'bugfix', commitMessageRequired: true })];
1166
- case 2:
1167
- _a.sent();
1168
- return [2 /*return*/];
1169
- }
1170
- });
1171
- });
1172
- };
1173
- BaseGlobalCommandLine.prototype.pfix = function () {
676
+ async pushFix() {
677
+ await this.meltUpdateCommits();
678
+ await this.push({ typeofCommit: 'bugfix', commitMessageRequired: true });
679
+ }
680
+ pfix() {
1174
681
  this.pushFix();
1175
- };
682
+ }
1176
683
  //#endregion
1177
684
  //#region commands / push chore
1178
- BaseGlobalCommandLine.prototype.pushChore = function () {
1179
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1180
- return tslib_1.__generator(this, function (_a) {
1181
- switch (_a.label) {
1182
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1183
- case 1:
1184
- _a.sent();
1185
- return [4 /*yield*/, this.push({ typeofCommit: 'chore', commitMessageRequired: true })];
1186
- case 2:
1187
- _a.sent();
1188
- return [2 /*return*/];
1189
- }
1190
- });
1191
- });
1192
- };
1193
- BaseGlobalCommandLine.prototype.pc = function () {
1194
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1195
- return tslib_1.__generator(this, function (_a) {
1196
- switch (_a.label) {
1197
- case 0: return [4 /*yield*/, this.pushChore()];
1198
- case 1:
1199
- _a.sent();
1200
- return [2 /*return*/];
1201
- }
1202
- });
1203
- });
1204
- };
685
+ async pushChore() {
686
+ await this.meltUpdateCommits();
687
+ await this.push({ typeofCommit: 'chore', commitMessageRequired: true });
688
+ }
689
+ async pc() {
690
+ await this.pushChore();
691
+ }
1205
692
  //#endregion
1206
693
  //#region commands / push refactor
1207
- BaseGlobalCommandLine.prototype.pushRefactor = function () {
1208
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1209
- return tslib_1.__generator(this, function (_a) {
1210
- switch (_a.label) {
1211
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1212
- case 1:
1213
- _a.sent();
1214
- return [4 /*yield*/, this.push({ typeofCommit: 'refactor', commitMessageRequired: true })];
1215
- case 2:
1216
- _a.sent();
1217
- return [2 /*return*/];
1218
- }
1219
- });
1220
- });
1221
- };
1222
- BaseGlobalCommandLine.prototype.pushref = function () {
1223
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1224
- return tslib_1.__generator(this, function (_a) {
1225
- switch (_a.label) {
1226
- case 0: return [4 /*yield*/, this.pushRefactor()];
1227
- case 1:
1228
- _a.sent();
1229
- return [2 /*return*/];
1230
- }
1231
- });
1232
- });
1233
- };
1234
- BaseGlobalCommandLine.prototype.pref = function () {
1235
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1236
- return tslib_1.__generator(this, function (_a) {
1237
- switch (_a.label) {
1238
- case 0: return [4 /*yield*/, this.pushRefactor()];
1239
- case 1:
1240
- _a.sent();
1241
- return [2 /*return*/];
1242
- }
1243
- });
1244
- });
1245
- };
694
+ async pushRefactor() {
695
+ await this.meltUpdateCommits();
696
+ await this.push({ typeofCommit: 'refactor', commitMessageRequired: true });
697
+ }
698
+ async pushref() {
699
+ await this.pushRefactor();
700
+ }
701
+ async pref() {
702
+ await this.pushRefactor();
703
+ }
1246
704
  //#endregion
1247
705
  //#region commands / push style
1248
- BaseGlobalCommandLine.prototype.pushStyle = function () {
1249
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1250
- return tslib_1.__generator(this, function (_a) {
1251
- switch (_a.label) {
1252
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1253
- case 1:
1254
- _a.sent();
1255
- return [4 /*yield*/, this.push({ typeofCommit: 'style', commitMessageRequired: true })];
1256
- case 2:
1257
- _a.sent();
1258
- return [2 /*return*/];
1259
- }
1260
- });
1261
- });
1262
- };
1263
- BaseGlobalCommandLine.prototype.pstyl = function () {
1264
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1265
- return tslib_1.__generator(this, function (_a) {
1266
- switch (_a.label) {
1267
- case 0: return [4 /*yield*/, this.pushStyle()];
1268
- case 1:
1269
- _a.sent();
1270
- return [2 /*return*/];
1271
- }
1272
- });
1273
- });
1274
- };
1275
- BaseGlobalCommandLine.prototype.pstyle = function () {
1276
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1277
- return tslib_1.__generator(this, function (_a) {
1278
- switch (_a.label) {
1279
- case 0: return [4 /*yield*/, this.pushStyle()];
1280
- case 1:
1281
- _a.sent();
1282
- return [2 /*return*/];
1283
- }
1284
- });
1285
- });
1286
- };
706
+ async pushStyle() {
707
+ await this.meltUpdateCommits();
708
+ await this.push({ typeofCommit: 'style', commitMessageRequired: true });
709
+ }
710
+ async pstyl() {
711
+ await this.pushStyle();
712
+ }
713
+ async pstyle() {
714
+ await this.pushStyle();
715
+ }
1287
716
  //#endregion
1288
717
  //#region commands / push docs
1289
- BaseGlobalCommandLine.prototype.pushDocs = function () {
1290
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1291
- return tslib_1.__generator(this, function (_a) {
1292
- switch (_a.label) {
1293
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1294
- case 1:
1295
- _a.sent();
1296
- return [4 /*yield*/, this.push({ typeofCommit: 'docs', commitMessageRequired: true })];
1297
- case 2:
1298
- _a.sent();
1299
- return [2 /*return*/];
1300
- }
1301
- });
1302
- });
1303
- };
1304
- BaseGlobalCommandLine.prototype.pd = function () {
1305
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1306
- return tslib_1.__generator(this, function (_a) {
1307
- switch (_a.label) {
1308
- case 0: return [4 /*yield*/, this.pushDocs()];
1309
- case 1:
1310
- _a.sent();
1311
- return [2 /*return*/];
1312
- }
1313
- });
1314
- });
1315
- };
1316
- BaseGlobalCommandLine.prototype.pdocs = function () {
1317
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1318
- return tslib_1.__generator(this, function (_a) {
1319
- switch (_a.label) {
1320
- case 0: return [4 /*yield*/, this.pushDocs()];
1321
- case 1:
1322
- _a.sent();
1323
- return [2 /*return*/];
1324
- }
1325
- });
1326
- });
1327
- };
718
+ async pushDocs() {
719
+ await this.meltUpdateCommits();
720
+ await this.push({ typeofCommit: 'docs', commitMessageRequired: true });
721
+ }
722
+ async pd() {
723
+ await this.pushDocs();
724
+ }
725
+ async pdocs() {
726
+ await this.pushDocs();
727
+ }
1328
728
  //#endregion
1329
729
  //#region commands / push test
1330
- BaseGlobalCommandLine.prototype.pushTest = function () {
1331
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1332
- return tslib_1.__generator(this, function (_a) {
1333
- switch (_a.label) {
1334
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1335
- case 1:
1336
- _a.sent();
1337
- return [4 /*yield*/, this.push({ typeofCommit: 'test', commitMessageRequired: true })];
1338
- case 2:
1339
- _a.sent();
1340
- return [2 /*return*/];
1341
- }
1342
- });
1343
- });
1344
- };
1345
- BaseGlobalCommandLine.prototype.pTest = function () {
1346
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1347
- return tslib_1.__generator(this, function (_a) {
1348
- switch (_a.label) {
1349
- case 0: return [4 /*yield*/, this.pushTest()];
1350
- case 1:
1351
- _a.sent();
1352
- return [2 /*return*/];
1353
- }
1354
- });
1355
- });
1356
- };
1357
- BaseGlobalCommandLine.prototype.pTests = function () {
1358
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1359
- return tslib_1.__generator(this, function (_a) {
1360
- switch (_a.label) {
1361
- case 0: return [4 /*yield*/, this.pushTest()];
1362
- case 1:
1363
- _a.sent();
1364
- return [2 /*return*/];
1365
- }
1366
- });
1367
- });
1368
- };
730
+ async pushTest() {
731
+ await this.meltUpdateCommits();
732
+ await this.push({ typeofCommit: 'test', commitMessageRequired: true });
733
+ }
734
+ async pTest() {
735
+ await this.pushTest();
736
+ }
737
+ async pTests() {
738
+ await this.pushTest();
739
+ }
1369
740
  //#endregion
1370
741
  //#region commands / push perf
1371
- BaseGlobalCommandLine.prototype.pushPerf = function () {
1372
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1373
- return tslib_1.__generator(this, function (_a) {
1374
- switch (_a.label) {
1375
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1376
- case 1:
1377
- _a.sent();
1378
- return [4 /*yield*/, this.push({
1379
- typeofCommit: 'performance',
1380
- commitMessageRequired: true,
1381
- })];
1382
- case 2:
1383
- _a.sent();
1384
- return [2 /*return*/];
1385
- }
1386
- });
742
+ async pushPerf() {
743
+ await this.meltUpdateCommits();
744
+ await this.push({
745
+ typeofCommit: 'performance',
746
+ commitMessageRequired: true,
1387
747
  });
1388
- };
748
+ }
1389
749
  //#endregion
1390
750
  //#region commands / push ci
1391
- BaseGlobalCommandLine.prototype.pushCi = function () {
1392
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1393
- return tslib_1.__generator(this, function (_a) {
1394
- switch (_a.label) {
1395
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1396
- case 1:
1397
- _a.sent();
1398
- return [4 /*yield*/, this.push({ typeofCommit: 'ci', commitMessageRequired: true })];
1399
- case 2:
1400
- _a.sent();
1401
- return [2 /*return*/];
1402
- }
1403
- });
1404
- });
1405
- };
751
+ async pushCi() {
752
+ await this.meltUpdateCommits();
753
+ await this.push({ typeofCommit: 'ci', commitMessageRequired: true });
754
+ }
1406
755
  //#endregion
1407
756
  //#region commands / select branch
1408
- BaseGlobalCommandLine.prototype.branch = function () {
1409
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1410
- var branchName, branches;
1411
- return tslib_1.__generator(this, function (_a) {
1412
- switch (_a.label) {
1413
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1414
- case 1:
1415
- if (!(_a.sent())) {
1416
- return [2 /*return*/];
1417
- }
1418
- return [4 /*yield*/, this.project.struct()];
1419
- case 2:
1420
- _a.sent();
1421
- branchName = this.firstArg;
1422
- branches = this.__filterBranchesByPattern(branchName);
1423
- if (!(branches.length > 0)) return [3 /*break*/, 4];
1424
- return [4 /*yield*/, this.__selectBrach(branches, 'checkout')];
1425
- case 3:
1426
- branchName = _a.sent();
1427
- return [3 /*break*/, 5];
1428
- case 4:
1429
- index_1.Helpers.error("No branch found by name \"".concat(branchName, "\""), false, true);
1430
- _a.label = 5;
1431
- case 5:
1432
- this.project.git.checkout(branchName);
1433
- this._exit();
1434
- return [2 /*return*/];
1435
- }
1436
- });
1437
- });
1438
- };
757
+ async branch() {
758
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
759
+ return;
760
+ }
761
+ await this.project.struct();
762
+ try {
763
+ this.project.git.fetch();
764
+ }
765
+ catch (error) { }
766
+ let branchName = this.firstArg;
767
+ const branches = this.__filterBranchesByPattern(branchName);
768
+ if (branches.length > 0) {
769
+ branchName = await this.__selectBrach(branches, 'checkout');
770
+ }
771
+ else {
772
+ index_1.Helpers.error(`No branch found by name "${branchName}"`, false, true);
773
+ }
774
+ try {
775
+ this.project.git.stageAllFiles();
776
+ this.project.git.stash();
777
+ }
778
+ catch (error) { }
779
+ this.project.git.checkout(branchName);
780
+ this._exit();
781
+ }
1439
782
  //#endregion
1440
783
  //#region commands / push build
1441
- BaseGlobalCommandLine.prototype.pushBuild = function () {
1442
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1443
- return tslib_1.__generator(this, function (_a) {
1444
- switch (_a.label) {
1445
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1446
- case 1:
1447
- _a.sent();
1448
- return [4 /*yield*/, this.push({ typeofCommit: 'build', commitMessageRequired: true })];
1449
- case 2:
1450
- _a.sent();
1451
- return [2 /*return*/];
1452
- }
1453
- });
1454
- });
1455
- };
784
+ async pushBuild() {
785
+ await this.meltUpdateCommits();
786
+ await this.push({ typeofCommit: 'build', commitMessageRequired: true });
787
+ }
1456
788
  //#endregion
1457
789
  //#region commands / set origin
1458
- BaseGlobalCommandLine.prototype.SET_ORIGIN = function () {
1459
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1460
- var newOriginNameOrUrl, proj;
1461
- return tslib_1.__generator(this, function (_a) {
1462
- switch (_a.label) {
1463
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1464
- case 1:
1465
- if (!(_a.sent())) {
1466
- return [2 /*return*/];
1467
- }
1468
- newOriginNameOrUrl = this.firstArg;
1469
- proj = this.project;
1470
- if (proj && proj.git.isInsideGitRepo) {
1471
- proj.run("git remote rm origin").sync();
1472
- proj.run("git remote add origin ".concat(newOriginNameOrUrl, " ")).sync();
1473
- index_1.Helpers.info("Done");
1474
- }
1475
- else {
1476
- index_1.Helpers.error("This folder is not a git repo... ", false, true);
1477
- }
1478
- this._exit();
1479
- return [2 /*return*/];
1480
- }
1481
- });
1482
- });
1483
- };
790
+ async SET_ORIGIN() {
791
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
792
+ return;
793
+ }
794
+ const newOriginNameOrUrl = this.firstArg;
795
+ const proj = this.project;
796
+ if (proj && proj.git.isInsideGitRepo) {
797
+ proj.run(`git remote rm origin`).sync();
798
+ proj.run(`git remote add origin ${newOriginNameOrUrl} `).sync();
799
+ index_1.Helpers.info(`Done`);
800
+ }
801
+ else {
802
+ index_1.Helpers.error(`This folder is not a git repo... `, false, true);
803
+ }
804
+ this._exit();
805
+ }
1484
806
  //#endregion
1485
807
  //#region commands / rename origin
1486
- BaseGlobalCommandLine.prototype.RENAME_ORIGIN = function () {
1487
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1488
- var newOriginNameOrUrl, proj;
1489
- return tslib_1.__generator(this, function (_a) {
1490
- switch (_a.label) {
1491
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1492
- case 1:
1493
- if (!(_a.sent())) {
1494
- return [2 /*return*/];
1495
- }
1496
- newOriginNameOrUrl = this.firstArg;
1497
- proj = this.project;
1498
- if (proj && proj.git.isInsideGitRepo) {
1499
- proj.git.renameOrigin(newOriginNameOrUrl);
1500
- }
1501
- else {
1502
- index_1.Helpers.error("This folder is not a git repo... ", false, true);
1503
- }
1504
- this._exit();
1505
- return [2 /*return*/];
1506
- }
1507
- });
1508
- });
1509
- };
808
+ async RENAME_ORIGIN() {
809
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
810
+ return;
811
+ }
812
+ const newOriginNameOrUrl = this.firstArg;
813
+ const proj = this.project;
814
+ if (proj && proj.git.isInsideGitRepo) {
815
+ proj.git.renameOrigin(newOriginNameOrUrl);
816
+ }
817
+ else {
818
+ index_1.Helpers.error(`This folder is not a git repo... `, false, true);
819
+ }
820
+ this._exit();
821
+ }
1510
822
  //#endregion
1511
823
  //#region commands / last hash tag
1512
- BaseGlobalCommandLine.prototype.LAST_TAG_HASH = function () {
1513
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1514
- return tslib_1.__generator(this, function (_a) {
1515
- switch (_a.label) {
1516
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1517
- case 1:
1518
- if (!(_a.sent())) {
1519
- return [2 /*return*/];
1520
- }
1521
- index_1.Helpers.info(this.project.git.lastTagHash());
1522
- this._exit();
1523
- return [2 /*return*/];
1524
- }
1525
- });
1526
- });
1527
- };
824
+ async LAST_TAG_HASH() {
825
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
826
+ return;
827
+ }
828
+ index_1.Helpers.info(this.project.git.lastTagHash());
829
+ this._exit();
830
+ }
1528
831
  //#endregion
1529
832
  //#region commands / last tag
1530
- BaseGlobalCommandLine.prototype.LAST_TAG = function () {
1531
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1532
- var proj;
1533
- return tslib_1.__generator(this, function (_a) {
1534
- switch (_a.label) {
1535
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1536
- case 1:
1537
- if (!(_a.sent())) {
1538
- return [2 /*return*/];
1539
- }
1540
- proj = this.project;
1541
- index_1.Helpers.info("\n\n last tag: ".concat(proj.git.lastTagVersionName, "\n last tag hash: ").concat(proj.git.lastTagHash(), "\n\n"));
1542
- this._exit();
1543
- return [2 /*return*/];
1544
- }
1545
- });
1546
- });
1547
- };
833
+ async LAST_TAG() {
834
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
835
+ return;
836
+ }
837
+ const proj = this.project;
838
+ index_1.Helpers.info(`
839
+
840
+ last tag: ${proj.git.lastTagVersionName}
841
+ last tag hash: ${proj.git.lastTagHash()}
842
+
843
+ `);
844
+ this._exit();
845
+ }
1548
846
  //#endregion
1549
847
  //#region commands / check tag exists
1550
- BaseGlobalCommandLine.prototype.CHECK_TAG_EXISTS = function () {
1551
- index_1.Helpers.info("tag \"".concat(this.firstArg, "\" exits = ").concat(index_1.Helpers.git.checkTagExists(this.firstArg), " "));
848
+ CHECK_TAG_EXISTS() {
849
+ index_1.Helpers.info(`tag "${this.firstArg}" exits = ${index_1.Helpers.git.checkTagExists(this.firstArg)} `);
1552
850
  this._exit();
1553
- };
851
+ }
1554
852
  //#endregion
1555
853
  //#region commands / lint
1556
854
  /**
1557
855
  * TODO move somewhere
1558
856
  */
1559
- BaseGlobalCommandLine.prototype.lint = function () {
1560
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1561
- return tslib_1.__generator(this, function (_a) {
1562
- switch (_a.label) {
1563
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1564
- case 1:
1565
- if (!(_a.sent())) {
1566
- return [2 /*return*/];
1567
- }
1568
- return [4 /*yield*/, this.project.lint()];
1569
- case 2:
1570
- _a.sent();
1571
- return [2 /*return*/];
1572
- }
1573
- });
1574
- });
1575
- };
857
+ async lint() {
858
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
859
+ return;
860
+ }
861
+ await this.project.lint();
862
+ }
1576
863
  //#endregion
1577
864
  //#region commands / version
1578
865
  /**
1579
866
  * TODO move somewhere
1580
867
  */
1581
- BaseGlobalCommandLine.prototype.version = function () {
1582
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1583
- return tslib_1.__generator(this, function (_a) {
1584
- switch (_a.label) {
1585
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1586
- case 1:
1587
- if (!(_a.sent())) {
1588
- return [2 /*return*/];
1589
- }
1590
- console.log('Current project verison: ' + this.project.npmHelpers.version);
1591
- this._exit();
1592
- return [2 /*return*/];
1593
- }
1594
- });
1595
- });
1596
- };
868
+ async version() {
869
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
870
+ return;
871
+ }
872
+ console.log('Current project verison: ' + this.project.packageJson.version);
873
+ this._exit();
874
+ }
1597
875
  //#endregion
1598
876
  //#region commands / init
1599
877
  /**
1600
878
  * TODO move somewhere
1601
879
  */
1602
- BaseGlobalCommandLine.prototype.init = function () {
1603
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1604
- return tslib_1.__generator(this, function (_a) {
1605
- switch (_a.label) {
1606
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1607
- case 1:
1608
- if (!(_a.sent())) {
1609
- return [2 /*return*/];
1610
- }
1611
- return [4 /*yield*/, this.project.init()];
1612
- case 2:
1613
- _a.sent();
1614
- this._exit();
1615
- return [2 /*return*/];
1616
- }
1617
- });
1618
- });
1619
- };
880
+ async init() {
881
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
882
+ return;
883
+ }
884
+ await this.project.init();
885
+ this._exit();
886
+ }
1620
887
  /**
1621
888
  * init parent and first level children
1622
889
  */
1623
- BaseGlobalCommandLine.prototype.initAll = function () {
1624
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1625
- var _a, _b, child, e_3_1;
1626
- var e_3, _c;
1627
- return tslib_1.__generator(this, function (_d) {
1628
- switch (_d.label) {
1629
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1630
- case 1:
1631
- if (!(_d.sent())) {
1632
- return [2 /*return*/];
1633
- }
1634
- return [4 /*yield*/, this.project.init()];
1635
- case 2:
1636
- _d.sent();
1637
- _d.label = 3;
1638
- case 3:
1639
- _d.trys.push([3, 8, 9, 10]);
1640
- _a = tslib_1.__values(this.project.children), _b = _a.next();
1641
- _d.label = 4;
1642
- case 4:
1643
- if (!!_b.done) return [3 /*break*/, 7];
1644
- child = _b.value;
1645
- return [4 /*yield*/, child.init()];
1646
- case 5:
1647
- _d.sent();
1648
- _d.label = 6;
1649
- case 6:
1650
- _b = _a.next();
1651
- return [3 /*break*/, 4];
1652
- case 7: return [3 /*break*/, 10];
1653
- case 8:
1654
- e_3_1 = _d.sent();
1655
- e_3 = { error: e_3_1 };
1656
- return [3 /*break*/, 10];
1657
- case 9:
1658
- try {
1659
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
1660
- }
1661
- finally { if (e_3) throw e_3.error; }
1662
- return [7 /*endfinally*/];
1663
- case 10:
1664
- this._exit();
1665
- return [2 /*return*/];
1666
- }
1667
- });
1668
- });
1669
- };
890
+ async initAll() {
891
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
892
+ return;
893
+ }
894
+ await this.project.init();
895
+ for (const child of this.project.children) {
896
+ await child.init();
897
+ }
898
+ this._exit();
899
+ }
1670
900
  //#endregion
1671
901
  //#region commands / struct
1672
902
  /**
1673
903
  * TODO move somewhere
1674
904
  */
1675
- BaseGlobalCommandLine.prototype.struct = function () {
1676
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1677
- return tslib_1.__generator(this, function (_a) {
1678
- switch (_a.label) {
1679
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1680
- case 1:
1681
- if (!(_a.sent())) {
1682
- return [2 /*return*/];
1683
- }
1684
- return [4 /*yield*/, this.project.struct()];
1685
- case 2:
1686
- _a.sent();
1687
- this._exit();
1688
- return [2 /*return*/];
1689
- }
1690
- });
1691
- });
1692
- };
905
+ async struct() {
906
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
907
+ return;
908
+ }
909
+ await this.project.struct();
910
+ this._exit();
911
+ }
1693
912
  //#endregion
1694
913
  //#region commands / info
1695
914
  /**
1696
915
  * TODO move somewhere
1697
916
  */
1698
- BaseGlobalCommandLine.prototype.info = function () {
1699
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1700
- return tslib_1.__generator(this, function (_a) {
1701
- switch (_a.label) {
1702
- case 0: return [4 /*yield*/, this.cwdIsProject({
1703
- requireProjectWithGitRoot: false,
1704
- })];
1705
- case 1:
1706
- if (!(_a.sent())) {
1707
- return [2 /*return*/];
1708
- }
1709
- index_1.Helpers.clearConsole();
1710
- return [4 /*yield*/, this.project.info()];
1711
- case 2:
1712
- _a.sent();
1713
- return [4 /*yield*/, this.project.linkedProjects.saveAllLinkedProjectsToDB()];
1714
- case 3:
1715
- _a.sent();
1716
- this._exit();
1717
- return [2 /*return*/];
1718
- }
1719
- });
1720
- });
1721
- };
917
+ async info() {
918
+ if (!(await this.cwdIsProject({
919
+ requireProjectWithGitRoot: false,
920
+ }))) {
921
+ return;
922
+ }
923
+ index_1.Helpers.clearConsole();
924
+ await this.project.info();
925
+ await this.project.linkedProjects.saveAllLinkedProjectsToDB();
926
+ this._exit();
927
+ }
1722
928
  //#endregion
1723
929
  //#region commands / info
1724
- BaseGlobalCommandLine.prototype.modified = function () {
1725
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1726
- var proj, libs;
1727
- return tslib_1.__generator(this, function (_a) {
1728
- switch (_a.label) {
1729
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1730
- case 1:
1731
- if (!(_a.sent())) {
1732
- return [2 /*return*/];
1733
- }
1734
- proj = this.project;
1735
- libs = proj.children.filter(function (child) {
1736
- process.stdout.write('.');
1737
- return child.git.thereAreSomeUncommitedChangeExcept([
1738
- tnp_config_2.config.file.package_json,
1739
- ]);
1740
- });
1741
- console.log('\n' + index_1.Helpers.terminalLine());
1742
- index_1.Helpers.info(libs.length
1743
- ? libs
1744
- .map(function (c) {
1745
- return "".concat(tnp_core_1.chalk.bold(c.name), " (").concat(c.git.uncommitedFiles.map(function (p) { return tnp_core_1.chalk.black(tnp_core_1.path.basename(p)); }).join(', '), ")");
1746
- })
1747
- .join('\n')
1748
- : 'Nothing modifed');
1749
- this._exit();
1750
- return [2 /*return*/];
1751
- }
1752
- });
1753
- });
1754
- };
930
+ async modified() {
931
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
932
+ return;
933
+ }
934
+ const proj = this.project;
935
+ const libs = proj.children.filter(child => {
936
+ process.stdout.write('.');
937
+ return child.git.thereAreSomeUncommitedChangeExcept([
938
+ tnp_config_2.config.file.package_json,
939
+ ]);
940
+ });
941
+ console.log('\n' + index_1.Helpers.terminalLine());
942
+ index_1.Helpers.info(libs.length
943
+ ? libs
944
+ .map(c => `${tnp_core_1.chalk.bold(c.name)} (${c.git.uncommitedFiles.map(p => tnp_core_1.chalk.black(tnp_core_1.path.basename(p))).join(', ')})`)
945
+ .join('\n')
946
+ : 'Nothing modifed');
947
+ this._exit();
948
+ }
1755
949
  //#endregion
1756
950
  //#region commands / update
1757
- BaseGlobalCommandLine.prototype.UPDATE = function () {
1758
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1759
- var linkedProjects;
1760
- var _this = this;
1761
- return tslib_1.__generator(this, function (_a) {
1762
- switch (_a.label) {
1763
- case 0:
1764
- linkedProjects = index_1.LinkedProject.detect(this.project.location).filter(function (linkedProj) {
1765
- return _this.project.ins.From([
1766
- _this.project.location,
1767
- linkedProj.relativeClonePath,
1768
- ]);
1769
- });
1770
- return [4 /*yield*/, index_1.Helpers.questionYesNo("\n\n Deteced project:\n".concat(linkedProjects.map(function (l) { return "- ".concat(l.relativeClonePath); }).join('\n'), "\n\n\nWould you like to update current project configuration?"))];
1771
- case 1:
1772
- if (_a.sent()) {
1773
- this.project.linkedProjects.addLinkedProjects(linkedProjects);
1774
- }
1775
- return [4 /*yield*/, this.project.init()];
1776
- case 2:
1777
- _a.sent();
1778
- index_1.Helpers.info("Linked projects updated");
1779
- this._exit(0);
1780
- return [2 /*return*/];
1781
- }
1782
- });
1783
- });
1784
- };
951
+ async UPDATE() {
952
+ const linkedProjects = index_1.LinkedProject.detect(this.project.location).filter(linkedProj => this.project.ins.From([
953
+ this.project.location,
954
+ linkedProj.relativeClonePath,
955
+ ]));
956
+ if (await index_1.Helpers.questionYesNo(`
957
+
958
+ Deteced project:
959
+ ${linkedProjects.map(l => `- ${l.relativeClonePath}`).join('\n')}
960
+
961
+
962
+ Would you like to update current project configuration?`)) {
963
+ this.project.linkedProjects.addLinkedProjects(linkedProjects);
964
+ }
965
+ await this.project.init();
966
+ index_1.Helpers.info(`Linked projects updated`);
967
+ this._exit(0);
968
+ }
1785
969
  //#endregion
1786
970
  //#region commands / changes
1787
- BaseGlobalCommandLine.prototype.changes = function () {
1788
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1789
- var _a, _b, _c, _d, chil, _e, _f, e_4_1;
1790
- var e_4, _g;
1791
- return tslib_1.__generator(this, function (_h) {
1792
- switch (_h.label) {
1793
- case 0:
1794
- _b = (_a = index_1.Helpers).info;
1795
- return [4 /*yield*/, this.project.git.changesSummary()];
1796
- case 1:
1797
- _b.apply(_a, [_h.sent()]);
1798
- index_1.Helpers.terminalLine();
1799
- _h.label = 2;
1800
- case 2:
1801
- _h.trys.push([2, 7, 8, 9]);
1802
- _c = tslib_1.__values(this.project.children), _d = _c.next();
1803
- _h.label = 3;
1804
- case 3:
1805
- if (!!_d.done) return [3 /*break*/, 6];
1806
- chil = _d.value;
1807
- _f = (_e = index_1.Helpers).info;
1808
- return [4 /*yield*/, chil.git.changesSummary()];
1809
- case 4:
1810
- _f.apply(_e, [_h.sent()]);
1811
- _h.label = 5;
1812
- case 5:
1813
- _d = _c.next();
1814
- return [3 /*break*/, 3];
1815
- case 6: return [3 /*break*/, 9];
1816
- case 7:
1817
- e_4_1 = _h.sent();
1818
- e_4 = { error: e_4_1 };
1819
- return [3 /*break*/, 9];
1820
- case 8:
1821
- try {
1822
- if (_d && !_d.done && (_g = _c.return)) _g.call(_c);
1823
- }
1824
- finally { if (e_4) throw e_4.error; }
1825
- return [7 /*endfinally*/];
1826
- case 9:
1827
- this._exit();
1828
- return [2 /*return*/];
1829
- }
1830
- });
1831
- });
1832
- };
971
+ async changes() {
972
+ index_1.Helpers.info(await this.project.git.changesSummary());
973
+ index_1.Helpers.terminalLine();
974
+ for (const chil of this.project.children) {
975
+ index_1.Helpers.info(await chil.git.changesSummary());
976
+ }
977
+ this._exit();
978
+ }
1833
979
  //#endregion
1834
980
  //#region commands / branch name
1835
- BaseGlobalCommandLine.prototype.BRANCH_NAME = function () {
1836
- console.log("current branch name: \"".concat(index_1.Helpers.git.currentBranchName(process.cwd()), "\""));
981
+ BRANCH_NAME() {
982
+ console.log(`current branch name: "${index_1.Helpers.git.currentBranchName(process.cwd())}"`);
1837
983
  this._exit();
1838
- };
984
+ }
1839
985
  //#endregion
1840
986
  //#region commands / remotes
1841
- BaseGlobalCommandLine.prototype.REMOTES = function () {
987
+ REMOTES() {
1842
988
  console.log(index_1.Helpers.git.allOrigins(this.cwd));
1843
989
  this._exit();
1844
- };
1845
- BaseGlobalCommandLine.prototype.SET_REMOTE_SSH = function () {
1846
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1847
- return tslib_1.__generator(this, function (_a) {
1848
- switch (_a.label) {
1849
- case 0: return [4 /*yield*/, index_1.Helpers.git.changeRemoteFromHttpsToSSh(this.cwd)];
1850
- case 1:
1851
- _a.sent();
1852
- this._exit();
1853
- return [2 /*return*/];
1854
- }
1855
- });
1856
- });
1857
- };
1858
- BaseGlobalCommandLine.prototype.SET_REMOTE_http = function () {
1859
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1860
- return tslib_1.__generator(this, function (_a) {
1861
- switch (_a.label) {
1862
- case 0: return [4 /*yield*/, index_1.Helpers.git.changeRemoveFromSshToHttps(this.cwd)];
1863
- case 1:
1864
- _a.sent();
1865
- this._exit();
1866
- return [2 /*return*/];
1867
- }
1868
- });
1869
- });
1870
- };
1871
- BaseGlobalCommandLine.prototype.SET_REMOTE_https = function () {
1872
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1873
- return tslib_1.__generator(this, function (_a) {
1874
- switch (_a.label) {
1875
- case 0: return [4 /*yield*/, this.SET_REMOTE_http()];
1876
- case 1:
1877
- _a.sent();
1878
- return [2 /*return*/];
1879
- }
1880
- });
1881
- });
1882
- };
1883
- BaseGlobalCommandLine.prototype._resolveChildFromArg = function () {
1884
- var _this = this;
1885
- var _a = index_1.Helpers.cliTool.resolveItemFromArgsBegin(this.args, function (arg) {
1886
- return _this.ins.From([_this.cwd, arg]);
1887
- }), projFromArg = _a.resolved, clearedCommand = _a.clearedCommand;
990
+ }
991
+ async SET_REMOTE_SSH() {
992
+ await index_1.Helpers.git.changeRemoteFromHttpsToSSh(this.cwd);
993
+ this._exit();
994
+ }
995
+ async SET_REMOTE_http() {
996
+ await index_1.Helpers.git.changeRemoveFromSshToHttps(this.cwd);
997
+ this._exit();
998
+ }
999
+ async SET_REMOTE_https() {
1000
+ await this.SET_REMOTE_http();
1001
+ }
1002
+ _resolveChildFromArg() {
1003
+ const { resolved: projFromArg, clearedCommand } = index_1.Helpers.cliTool.resolveItemFromArgsBegin(this.args, arg => this.ins.From([this.cwd, arg]));
1888
1004
  if (!!projFromArg) {
1889
1005
  this.args = clearedCommand.split(' ');
1890
1006
  this.cwd = projFromArg.location;
1891
1007
  this.project = projFromArg;
1892
1008
  }
1893
- };
1894
- BaseGlobalCommandLine.prototype.origin = function () {
1009
+ }
1010
+ origin() {
1895
1011
  this._resolveChildFromArg();
1896
1012
  console.log(index_1.Helpers.git.getOriginURL(this.cwd));
1897
1013
  this._exit();
1898
- };
1899
- BaseGlobalCommandLine.prototype.remote = function () {
1014
+ }
1015
+ remote() {
1900
1016
  console.log(index_1.Helpers.git.getOriginURL(this.cwd));
1901
1017
  this._exit();
1902
- };
1903
- BaseGlobalCommandLine.prototype.originHttp = function () {
1018
+ }
1019
+ originHttp() {
1904
1020
  console.log(index_1.Helpers.git.originSshToHttp(index_1.Helpers.git.getOriginURL(this.cwd)));
1905
1021
  this._exit();
1906
- };
1907
- BaseGlobalCommandLine.prototype.originHttps = function () {
1022
+ }
1023
+ originHttps() {
1908
1024
  console.log(index_1.Helpers.git.originSshToHttp(index_1.Helpers.git.getOriginURL(this.cwd)));
1909
1025
  this._exit();
1910
- };
1911
- BaseGlobalCommandLine.prototype.originssh = function () {
1026
+ }
1027
+ originssh() {
1912
1028
  console.log(index_1.Helpers.git.originHttpToSsh(index_1.Helpers.git.getOriginURL(this.cwd)));
1913
1029
  this._exit();
1914
- };
1915
- BaseGlobalCommandLine.prototype.origins = function () {
1030
+ }
1031
+ origins() {
1916
1032
  this.REMOTES();
1917
- };
1033
+ }
1918
1034
  //#endregion
1919
1035
  //#region commands / git config
1920
- BaseGlobalCommandLine.prototype.gitConfig = function () {
1921
- var root = index_1.Helpers.git.findGitRoot(this.cwd);
1922
- index_1.Helpers.run("code ".concat((0, tnp_core_2.crossPlatformPath)([root, '.git', 'config']))).sync();
1036
+ gitConfig() {
1037
+ const root = index_1.Helpers.git.findGitRoot(this.cwd);
1038
+ index_1.Helpers.run(`code ${(0, tnp_core_2.crossPlatformPath)([root, '.git', 'config'])}`).sync();
1923
1039
  this._exit();
1924
- };
1040
+ }
1925
1041
  //#endregion
1926
1042
  //#region commands / lastCommitHash
1927
- BaseGlobalCommandLine.prototype.LAST_COMMIT_HASH = function () {
1043
+ LAST_COMMIT_HASH() {
1928
1044
  console.log(index_1.Helpers.git.lastCommitHash(this.cwd));
1929
1045
  this._exit();
1930
- };
1046
+ }
1931
1047
  //#endregion
1932
1048
  //#region commands / commit message by hash
1933
- BaseGlobalCommandLine.prototype.COMMIT_MESSAGE_BY_HASH = function () {
1934
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1935
- var hash, _a, _b;
1936
- return tslib_1.__generator(this, function (_c) {
1937
- switch (_c.label) {
1938
- case 0:
1939
- hash = this.firstArg;
1940
- _b = (_a = console).log;
1941
- return [4 /*yield*/, this.project.git.getCommitMessageByHash(hash)];
1942
- case 1:
1943
- _b.apply(_a, [_c.sent()]);
1944
- this._exit();
1945
- return [2 /*return*/];
1946
- }
1947
- });
1948
- });
1949
- };
1049
+ async COMMIT_MESSAGE_BY_HASH() {
1050
+ const hash = this.firstArg;
1051
+ console.log(await this.project.git.getCommitMessageByHash(hash));
1052
+ this._exit();
1053
+ }
1950
1054
  //#endregion
1951
1055
  //#region commands / last 5 commit hashes
1952
- BaseGlobalCommandLine.prototype.LAST_5_COMMITS = function () {
1953
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1954
- var index, hash;
1955
- return tslib_1.__generator(this, function (_a) {
1956
- switch (_a.label) {
1957
- case 0:
1958
- index = 0;
1959
- _a.label = 1;
1960
- case 1:
1961
- if (!(index < 5)) return [3 /*break*/, 4];
1962
- return [4 /*yield*/, this.project.git.getCommitHashByIndex(index)];
1963
- case 2:
1964
- hash = _a.sent();
1965
- console.log(hash);
1966
- _a.label = 3;
1967
- case 3:
1968
- index++;
1969
- return [3 /*break*/, 1];
1970
- case 4:
1971
- this._exit();
1972
- return [2 /*return*/];
1973
- }
1974
- });
1975
- });
1976
- };
1056
+ async LAST_5_COMMITS() {
1057
+ for (let index = 0; index < 5; index++) {
1058
+ const hash = await this.project.git.getCommitHashByIndex(index);
1059
+ console.log(hash);
1060
+ }
1061
+ this._exit();
1062
+ }
1977
1063
  //#endregion
1978
1064
  //#region commands / update deps from
1979
- BaseGlobalCommandLine.prototype.updateDepsFrom = function () {
1980
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1981
- var locations;
1982
- var _this = this;
1983
- return tslib_1.__generator(this, function (_a) {
1984
- locations = this.args.join(' ').trim() === '' ? [] : this.args;
1985
- if (tnp_core_1._.isArray(locations)) {
1986
- locations = locations.map(function (l) {
1987
- if (tnp_core_1.path.isAbsolute(l)) {
1988
- return tnp_core_1.path.resolve(l);
1989
- }
1990
- return tnp_core_1.path.resolve(tnp_core_1.path.join(_this.cwd, l));
1991
- });
1065
+ async updateDepsFrom() {
1066
+ let locations = this.args.join(' ').trim() === '' ? [] : this.args;
1067
+ if (tnp_core_1._.isArray(locations)) {
1068
+ locations = locations.map(l => {
1069
+ if (tnp_core_1.path.isAbsolute(l)) {
1070
+ return tnp_core_1.path.resolve(l);
1992
1071
  }
1993
- this.project.npmHelpers.updateDepsFrom(locations);
1994
- this._exit();
1995
- return [2 /*return*/];
1072
+ return tnp_core_1.path.resolve(tnp_core_1.path.join(this.cwd, l));
1996
1073
  });
1997
- });
1998
- };
1074
+ }
1075
+ this.project.packageJson.updateDepsFrom(locations);
1076
+ this._exit();
1077
+ }
1999
1078
  //#endregion
2000
1079
  //#region is terminal supported
2001
- BaseGlobalCommandLine.prototype.isTerminalSupported = function () {
2002
- console.log("Terminal is supported: ".concat(index_1.Helpers.isSupportedTaonTerminal));
1080
+ isTerminalSupported() {
1081
+ console.log(`Terminal is supported: ${index_1.Helpers.isSupportedTaonTerminal}`);
2003
1082
  this._exit();
2004
- };
1083
+ }
2005
1084
  //#endregion
2006
1085
  //#region prox ext
2007
- BaseGlobalCommandLine.prototype.INSTALL_PROJECT_EXTENSIONS = function () {
2008
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2009
- return tslib_1.__generator(this, function (_a) {
2010
- switch (_a.label) {
2011
- case 0: return [4 /*yield*/, this.INSTALL_PROJ_EXT()];
2012
- case 1:
2013
- _a.sent();
2014
- return [2 /*return*/];
2015
- }
2016
- });
2017
- });
2018
- };
2019
- BaseGlobalCommandLine.prototype.INSTALL_PROJECT_EXT = function () {
2020
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2021
- return tslib_1.__generator(this, function (_a) {
2022
- switch (_a.label) {
2023
- case 0: return [4 /*yield*/, this.INSTALL_PROJ_EXT()];
2024
- case 1:
2025
- _a.sent();
2026
- return [2 /*return*/];
2027
- }
2028
- });
2029
- });
2030
- };
2031
- BaseGlobalCommandLine.prototype.INS_PROJ_EXT = function () {
2032
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2033
- return tslib_1.__generator(this, function (_a) {
2034
- switch (_a.label) {
2035
- case 0: return [4 /*yield*/, this.INSTALL_PROJ_EXT()];
2036
- case 1:
2037
- _a.sent();
2038
- return [2 /*return*/];
2039
- }
2040
- });
2041
- });
2042
- };
2043
- BaseGlobalCommandLine.prototype.INSTALL_PROJ_EXT = function () {
2044
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2045
- var p, extensions;
2046
- return tslib_1.__generator(this, function (_a) {
2047
- switch (_a.label) {
2048
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
2049
- case 1:
2050
- if (!(_a.sent())) {
2051
- return [2 /*return*/];
2052
- }
2053
- this.project.vsCodeHelpers.recreateExtensions();
2054
- p = this.project.pathFor('.vscode/extensions.json');
2055
- extensions = index_1.Helpers.readJson(p, { recommendations: [] }, true);
2056
- index_1.Helpers.clearConsole();
2057
- return [4 /*yield*/, this.project.vsCodeHelpers.installExtensions(extensions.recommendations, true)];
2058
- case 2:
2059
- _a.sent();
2060
- this._exit();
2061
- return [2 /*return*/];
2062
- }
2063
- });
2064
- });
2065
- };
1086
+ async INSTALL_PROJECT_EXTENSIONS() {
1087
+ await this.INSTALL_PROJ_EXT();
1088
+ }
1089
+ async INSTALL_PROJECT_EXT() {
1090
+ await this.INSTALL_PROJ_EXT();
1091
+ }
1092
+ async INS_PROJ_EXT() {
1093
+ await this.INSTALL_PROJ_EXT();
1094
+ }
1095
+ async INSTALL_PROJ_EXT() {
1096
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
1097
+ return;
1098
+ }
1099
+ this.project.vsCodeHelpers.recreateExtensions();
1100
+ const p = this.project.pathFor('.vscode/extensions.json');
1101
+ const extensions = index_1.Helpers.readJson(p, { recommendations: [] }, true);
1102
+ index_1.Helpers.clearConsole();
1103
+ await this.project.vsCodeHelpers.installExtensions(extensions.recommendations, true);
1104
+ this._exit();
1105
+ }
2066
1106
  //#endregion
2067
1107
  //#region proj db
2068
- BaseGlobalCommandLine.prototype.projdb = function () {
2069
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2070
- return tslib_1.__generator(this, function (_a) {
2071
- switch (_a.label) {
2072
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
2073
- case 1:
2074
- if (!(_a.sent())) {
2075
- return [2 /*return*/];
2076
- }
2077
- index_1.Helpers.info("Projects db location:\n ".concat(this.project.linkedProjects.projectsDbLocation, "\n\n opening in vscode...\n\n "));
2078
- index_1.Helpers.run("code ".concat(this.project.linkedProjects.projectsDbLocation)).sync();
2079
- this._exit();
2080
- return [2 /*return*/];
2081
- }
2082
- });
2083
- });
2084
- };
1108
+ async projdb() {
1109
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
1110
+ return;
1111
+ }
1112
+ index_1.Helpers.info(`Projects db location:
1113
+ ${this.project.linkedProjects.projectsDbLocation}
1114
+
1115
+ opening in vscode...
1116
+
1117
+ `);
1118
+ index_1.Helpers.run(`code ${this.project.linkedProjects.projectsDbLocation}`).sync();
1119
+ this._exit();
1120
+ }
2085
1121
  //#endregion
2086
1122
  //#region filter all project branches by pattern
2087
- BaseGlobalCommandLine.prototype.__filterBranchesByPattern = function (branchPatternOrBranchName) {
2088
- var branches = index_1.Helpers.arrays.uniqArray(this.project.git.getBranchesNamesBy(branchPatternOrBranchName) ||
1123
+ __filterBranchesByPattern(branchPatternOrBranchName) {
1124
+ const branches = index_1.Helpers.arrays.uniqArray(this.project.git.getBranchesNamesBy(branchPatternOrBranchName) ||
2089
1125
  this.project.getMainBranches());
2090
1126
  // console.log('branches', branches);
2091
1127
  return branches;
2092
- };
1128
+ }
2093
1129
  //#endregion
2094
1130
  //#region select branch from list of branches
2095
- BaseGlobalCommandLine.prototype.__selectBrach = function (branches, task) {
2096
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2097
- var childrenMsg;
2098
- return tslib_1.__generator(this, function (_a) {
2099
- switch (_a.label) {
2100
- case 0:
2101
- childrenMsg = this.project.children.length == 0
2102
- ? '(no children in project)'
2103
- : '(with children)';
2104
- return [4 /*yield*/, index_1.Helpers.autocompleteAsk("Choose branch to ".concat(task, " in this project ").concat(childrenMsg, ": "), branches.map(function (b) {
2105
- return { name: b, value: b };
2106
- }))];
2107
- case 1: return [2 /*return*/, _a.sent()];
2108
- }
2109
- });
2110
- });
2111
- };
1131
+ async __selectBrach(branches, task) {
1132
+ const actionWithoutChildren = task === 'reset' && !this.project.git.resetIsRestingAlsoChildren();
1133
+ const childrenMsg = actionWithoutChildren
1134
+ ? '(without children)'
1135
+ : this.project.children.length == 0
1136
+ ? '(no children in project)'
1137
+ : '(with children)';
1138
+ return await index_1.Helpers.autocompleteAsk(`Choose branch to ${task} in this project ${childrenMsg}: `, branches.map(b => {
1139
+ return { name: b, value: b };
1140
+ }));
1141
+ }
2112
1142
  //#endregion
2113
1143
  //#region commands / clone
2114
- BaseGlobalCommandLine.prototype.clone = function () {
2115
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2116
- var url, originType;
2117
- return tslib_1.__generator(this, function (_a) {
2118
- url = this.firstArg;
2119
- originType = this.params['setOrigin'];
2120
- if (originType) {
2121
- if (originType === 'ssh') {
2122
- url = index_1.Helpers.git.originHttpToSsh(url);
2123
- }
2124
- if (originType === 'http') {
2125
- url = index_1.Helpers.git.originSshToHttp(url);
2126
- }
2127
- }
2128
- index_1.Helpers.git.clone({
2129
- url: url,
2130
- cwd: this.cwd,
2131
- });
2132
- this._exit();
2133
- return [2 /*return*/];
2134
- });
2135
- });
2136
- };
2137
- //#endregion
2138
- //#region commands / ghtemp
2139
- BaseGlobalCommandLine.prototype.ghSave = function () {
2140
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2141
- return tslib_1.__generator(this, function (_a) {
2142
- switch (_a.label) {
2143
- case 0: return [4 /*yield*/, new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().save()];
2144
- case 1:
2145
- _a.sent();
2146
- this._exit();
2147
- return [2 /*return*/];
2148
- }
2149
- });
2150
- });
2151
- };
2152
- BaseGlobalCommandLine.prototype.ghRestore = function () {
2153
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2154
- return tslib_1.__generator(this, function (_a) {
2155
- switch (_a.label) {
2156
- case 0: return [4 /*yield*/, new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().restore()];
2157
- case 1:
2158
- _a.sent();
2159
- this._exit();
2160
- return [2 /*return*/];
2161
- }
2162
- });
1144
+ async clone() {
1145
+ let url = this.firstArg;
1146
+ const originType = this.params['setOrigin'];
1147
+ if (originType) {
1148
+ if (originType === 'ssh') {
1149
+ url = index_1.Helpers.git.originHttpToSsh(url);
1150
+ }
1151
+ if (originType === 'http') {
1152
+ url = index_1.Helpers.git.originSshToHttp(url);
1153
+ }
1154
+ }
1155
+ index_1.Helpers.git.clone({
1156
+ url,
1157
+ cwd: this.cwd,
2163
1158
  });
2164
- };
1159
+ this._exit();
1160
+ }
1161
+ //#endregion
1162
+ //#region commands / gh temp
1163
+ async ghSave() {
1164
+ await new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().save();
1165
+ this._exit();
1166
+ }
1167
+ async ghRestore() {
1168
+ await new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().restore();
1169
+ this._exit();
1170
+ }
2165
1171
  //#endregion
2166
1172
  //#region commands / start cli service ports worker
2167
- BaseGlobalCommandLine.prototype.ports = function () {
2168
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2169
- return tslib_1.__generator(this, function (_a) {
2170
- switch (_a.label) {
2171
- case 0: return [4 /*yield*/, this.ins.portsWorker.infoScreen()];
2172
- case 1:
2173
- _a.sent();
2174
- return [2 /*return*/];
2175
- }
2176
- });
2177
- });
2178
- };
2179
- BaseGlobalCommandLine.prototype.startCliServicePortsWorker = function () {
2180
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2181
- return tslib_1.__generator(this, function (_a) {
2182
- switch (_a.label) {
2183
- case 0: return [4 /*yield*/, this.ins.portsWorker.cliStartProcedure(this.params)];
2184
- case 1:
2185
- _a.sent();
2186
- return [2 /*return*/];
2187
- }
2188
- });
2189
- });
2190
- };
1173
+ async ports() {
1174
+ await this.ins.portsWorker.infoScreen();
1175
+ }
1176
+ /**
1177
+ * tnp startCliServicePortsWorker --restart
1178
+ */
1179
+ async startCliServicePortsWorker() {
1180
+ await this.ins.portsWorker.cliStartProcedure(this.params);
1181
+ }
2191
1182
  //#endregion
2192
1183
  //#region commands / pause terminal
2193
- BaseGlobalCommandLine.prototype.pauseTerminal = function () {
1184
+ pauseTerminal() {
2194
1185
  index_1.Helpers.pressKeyAndContinue();
2195
1186
  this._exit();
2196
- };
1187
+ }
2197
1188
  //#endregion
2198
1189
  //#region commands / gh pages init
2199
- BaseGlobalCommandLine.prototype.ghPagesInit = function () {
2200
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2201
- return tslib_1.__generator(this, function (_a) {
2202
- switch (_a.label) {
2203
- case 0: return [4 /*yield*/, this.project.init()];
2204
- case 1:
2205
- _a.sent();
2206
- return [4 /*yield*/, this.project.githubPages.init(this.params['provider'] || 'github', !!this.params['full'])];
2207
- case 2:
2208
- _a.sent();
2209
- index_1.Helpers.run('code .', {
2210
- cwd: this.project.githubPages.mainFolderAbsPath,
2211
- }).sync();
2212
- this._exit();
2213
- return [2 /*return*/];
2214
- }
2215
- });
2216
- });
2217
- };
2218
- //#endregion
2219
- BaseGlobalCommandLine.prototype.isPortInUse = function () {
2220
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2221
- var port, _a, _b, _c, _d;
2222
- return tslib_1.__generator(this, function (_e) {
2223
- switch (_e.label) {
2224
- case 0:
2225
- port = parseInt(this.firstArg);
2226
- _b = (_a = console).log;
2227
- _d = (_c = "Port ".concat(port, " is in use: ")).concat;
2228
- return [4 /*yield*/, tnp_core_1.UtilsOs.isPortInUse(port)];
2229
- case 1:
2230
- _b.apply(_a, [_d.apply(_c, [_e.sent()])]);
2231
- this._exit();
2232
- return [2 /*return*/];
2233
- }
2234
- });
2235
- });
2236
- };
2237
- return BaseGlobalCommandLine;
2238
- }(base_command_line_feature_backend_1.BaseCommandLineFeature));
1190
+ async ghPagesInit() {
1191
+ await this.project.init();
1192
+ await this.project.staticPages.init(this.params['provider'] || 'github', !!this.params['full']);
1193
+ index_1.Helpers.run('code .', {
1194
+ cwd: this.project.staticPages.mainFolderAbsPath,
1195
+ }).sync();
1196
+ this._exit();
1197
+ }
1198
+ //#endregion
1199
+ //#region commands / is port in use
1200
+ async isPortInUse() {
1201
+ const port = parseInt(this.firstArg);
1202
+ console.log(`Port ${port} is in use: ${await tnp_core_1.UtilsOs.isPortInUse(port)}`);
1203
+ this._exit();
1204
+ }
1205
+ //#endregion
1206
+ //#region commands / proc menu
1207
+ //#region @notForNpm
1208
+ async procMenu() {
1209
+ //#region @backendFunc
1210
+ const { BaseProcessManger, CommandConfig } = await Promise.resolve().then(() => require('./base-process-manager'));
1211
+ const ngBuildLibCommand = CommandConfig.from({
1212
+ name: 'TSC',
1213
+ cmd: 'node -e "let i = 0; setInterval(() => console.log(\'TSC lib Compiled success \' + (++i)), 1000)"',
1214
+ goToNextCommandWhenOutput: {
1215
+ stdoutContains: 'TSC lib Compiled success 5',
1216
+ },
1217
+ });
1218
+ const angularNormalNgServe = CommandConfig.from({
1219
+ shouldBeActiveOrAlreadyBuild: [ngBuildLibCommand],
1220
+ name: 'NG Normal',
1221
+ cmd: 'node -e "let i = 0; setInterval(() => console.log(\'NG NORMAL: Hello from ng --watch \' + (++i)), 1200)"',
1222
+ goToNextCommandWhenOutput: {
1223
+ stdoutContains: 'NG NORMAL: Hello from ng --watch 5',
1224
+ },
1225
+ });
1226
+ const angularWebsqlNgServe = CommandConfig.from({
1227
+ shouldBeActiveOrAlreadyBuild: [ngBuildLibCommand],
1228
+ name: 'NG websql',
1229
+ cmd: 'node -e "let i = 0; setInterval(() => console.log(\'NG WEBSQL: Hello from ng --watch \' + (++i)), 1200)"',
1230
+ goToNextCommandWhenOutput: {
1231
+ stdoutContains: 'NG WEBSQL: Hello from ng --watch 5',
1232
+ },
1233
+ });
1234
+ const electronNormalNgServe = CommandConfig.from({
1235
+ shouldBeActiveOrAlreadyBuild: [angularNormalNgServe],
1236
+ name: 'ELECTRON Normal',
1237
+ cmd: 'node -e "let i = 0; setInterval(() => console.log(\'ELECTRON Normal: Hello from electron \' + (++i)), 1500)"',
1238
+ });
1239
+ const updateAssets = CommandConfig.from({
1240
+ name: 'Update assets',
1241
+ cmd: 'node -e "let i = 0; setInterval(() => console.log(\'Updated assets \' + (++i)), 1000)"',
1242
+ });
1243
+ await new BaseProcessManger(this.project).init({
1244
+ title: 'What do you want to build?',
1245
+ header: 'Starting process selection...',
1246
+ watch: true,
1247
+ commands: [
1248
+ ngBuildLibCommand,
1249
+ angularNormalNgServe,
1250
+ angularWebsqlNgServe,
1251
+ electronNormalNgServe,
1252
+ updateAssets,
1253
+ ],
1254
+ });
1255
+ //#endregion
1256
+ }
1257
+ //#endregion
1258
+ //#endregion
1259
+ //#region commands / proc info
1260
+ procInfo() {
1261
+ this.processInfo();
1262
+ }
1263
+ processInfo() {
1264
+ index_1.Helpers.info(`
1265
+
1266
+ Is running in CLI mode: ${tnp_core_1.UtilsOs.isRunningInCliMode()}
1267
+ Is running in Mocha test: ${tnp_core_1.UtilsOs.isRunningInMochaTest()}
1268
+ Is running in VSCode extension: ${tnp_core_1.UtilsOs.isRunningInVscodeExtension()}
1269
+ Is running in Electron: ${tnp_core_1.UtilsOs.isRunningInElectron()}
1270
+ Is running in Docker: ${tnp_core_1.UtilsOs.isRunningInDocker()}
1271
+ Is running in WebSQL: ${tnp_core_1.UtilsOs.isRunningInWebSQL()}
1272
+ Is running in WSL: ${tnp_core_1.UtilsOs.isRunningInWsl()}
1273
+ Is running in Linux graphics capable environment: ${tnp_core_1.UtilsOs.isRunningInLinuxGraphicsCapableEnvironment()}
1274
+ Is running in Node: ${tnp_core_1.UtilsOs.isRunningInNode()}
1275
+ Is running in Browser: ${tnp_core_1.UtilsOs.isRunningInBrowser()}
1276
+
1277
+ `);
1278
+ this._exit();
1279
+ }
1280
+ //#endregion
1281
+ lastGitTag() {
1282
+ console.log(this.project?.git.lastTagVersionName);
1283
+ this._exit();
1284
+ }
1285
+ }
2239
1286
  exports.BaseGlobalCommandLine = BaseGlobalCommandLine;
2240
1287
  //# sourceMappingURL=base-global-command-line.backend.js.map