tnp-helpers 18.0.20 → 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 (521) hide show
  1. package/browser/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
  2. package/browser/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
  3. package/browser/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
  4. package/browser/esm2022/lib/base/classes/base-cli-worker.mjs +10 -2
  5. package/browser/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
  6. package/browser/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
  7. package/browser/esm2022/lib/base/classes/base-git.mjs +229 -4
  8. package/browser/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
  9. package/browser/esm2022/lib/base/classes/base-library-build.mjs +11 -7
  10. package/browser/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
  11. package/browser/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
  12. package/browser/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -429
  13. package/browser/esm2022/lib/base/classes/base-package-json.mjs +340 -0
  14. package/browser/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
  15. package/browser/esm2022/lib/base/classes/base-project-resolver.mjs +2 -11
  16. package/browser/esm2022/lib/base/classes/base-project.mjs +76 -61
  17. package/browser/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
  18. package/browser/esm2022/lib/base/classes/base-release-process.mjs +44 -11
  19. package/browser/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
  20. package/browser/esm2022/lib/base/classes/base-vscode.mjs +29 -1
  21. package/browser/esm2022/lib/base/classes/index.mjs +5 -1
  22. package/browser/esm2022/lib/base/commit-data.mjs +19 -1
  23. package/browser/esm2022/lib/base/core-project.mjs +3 -3
  24. package/browser/esm2022/lib/base/linked-project.mjs +4 -4
  25. package/browser/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
  26. package/browser/esm2022/lib/base/translate.mjs +566 -0
  27. package/browser/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
  28. package/browser/esm2022/lib/helpers/helpers.mjs +12 -6
  29. package/browser/esm2022/lib/index.mjs +2 -1
  30. package/browser/esm2022/lib/models.mjs +173 -3
  31. package/browser/esm2022/lib/utils.mjs +402 -41
  32. package/browser/fesm2022/tnp-helpers.mjs +4619 -2888
  33. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  34. package/browser/lib/base/classes/base-bower-json.d.ts +35 -0
  35. package/browser/lib/base/classes/base-cli-worker.d.ts +1 -1
  36. package/browser/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
  37. package/browser/lib/base/classes/base-feature-for-project.d.ts +2 -1
  38. package/browser/lib/base/classes/base-git.d.ts +34 -5
  39. package/browser/lib/base/classes/base-json-file-reader.d.ts +72 -0
  40. package/browser/lib/base/classes/base-library-build.d.ts +5 -5
  41. package/browser/lib/base/classes/base-linked-projects.d.ts +1 -2
  42. package/browser/lib/base/classes/base-node-modules.d.ts +56 -0
  43. package/browser/lib/base/classes/base-npm-helpers.d.ts +29 -112
  44. package/browser/lib/base/classes/base-package-json.d.ts +107 -0
  45. package/browser/lib/base/classes/base-process-manager.d.ts +31 -0
  46. package/browser/lib/base/classes/base-project-resolver.d.ts +2 -2
  47. package/browser/lib/base/classes/base-project.d.ts +14 -16
  48. package/browser/lib/base/classes/base-quick-fixes.d.ts +3 -1
  49. package/browser/lib/base/classes/base-release-process.d.ts +8 -9
  50. package/browser/lib/base/classes/{base-github-pages.d.ts → base-static-pages.d.ts} +3 -3
  51. package/browser/lib/base/classes/base-vscode.d.ts +4 -0
  52. package/browser/lib/base/classes/index.d.ts +5 -1
  53. package/browser/lib/base/commit-data.d.ts +14 -1
  54. package/browser/lib/base/linked-project.d.ts +1 -1
  55. package/browser/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  56. package/browser/lib/base/translate.d.ts +228 -0
  57. package/browser/lib/helpers/helpers-array-obj.d.ts +3 -0
  58. package/browser/lib/helpers/helpers.d.ts +12 -8
  59. package/browser/lib/models.d.ts +68 -2
  60. package/browser/lib/utils.d.ts +72 -13
  61. package/client/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
  62. package/client/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
  63. package/client/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
  64. package/client/esm2022/lib/base/classes/base-cli-worker.mjs +10 -2
  65. package/client/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
  66. package/client/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
  67. package/client/esm2022/lib/base/classes/base-git.mjs +229 -4
  68. package/client/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
  69. package/client/esm2022/lib/base/classes/base-library-build.mjs +11 -7
  70. package/client/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
  71. package/client/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
  72. package/client/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -429
  73. package/client/esm2022/lib/base/classes/base-package-json.mjs +340 -0
  74. package/client/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
  75. package/client/esm2022/lib/base/classes/base-project-resolver.mjs +2 -11
  76. package/client/esm2022/lib/base/classes/base-project.mjs +76 -61
  77. package/client/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
  78. package/client/esm2022/lib/base/classes/base-release-process.mjs +44 -11
  79. package/client/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
  80. package/client/esm2022/lib/base/classes/base-vscode.mjs +29 -1
  81. package/client/esm2022/lib/base/classes/index.mjs +5 -1
  82. package/client/esm2022/lib/base/commit-data.mjs +19 -1
  83. package/client/esm2022/lib/base/core-project.mjs +3 -3
  84. package/client/esm2022/lib/base/linked-project.mjs +4 -4
  85. package/client/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
  86. package/client/esm2022/lib/base/translate.mjs +566 -0
  87. package/client/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
  88. package/client/esm2022/lib/helpers/helpers.mjs +12 -6
  89. package/client/esm2022/lib/index.mjs +2 -1
  90. package/client/esm2022/lib/models.mjs +173 -3
  91. package/client/esm2022/lib/utils.mjs +402 -41
  92. package/client/fesm2022/tnp-helpers.mjs +4619 -2888
  93. package/client/fesm2022/tnp-helpers.mjs.map +1 -1
  94. package/client/lib/base/classes/base-bower-json.d.ts +35 -0
  95. package/client/lib/base/classes/base-cli-worker.d.ts +1 -1
  96. package/client/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
  97. package/client/lib/base/classes/base-feature-for-project.d.ts +2 -1
  98. package/client/lib/base/classes/base-git.d.ts +34 -5
  99. package/client/lib/base/classes/base-json-file-reader.d.ts +72 -0
  100. package/client/lib/base/classes/base-library-build.d.ts +5 -5
  101. package/client/lib/base/classes/base-linked-projects.d.ts +1 -2
  102. package/client/lib/base/classes/base-node-modules.d.ts +56 -0
  103. package/client/lib/base/classes/base-npm-helpers.d.ts +29 -112
  104. package/client/lib/base/classes/base-package-json.d.ts +107 -0
  105. package/client/lib/base/classes/base-process-manager.d.ts +31 -0
  106. package/client/lib/base/classes/base-project-resolver.d.ts +2 -2
  107. package/client/lib/base/classes/base-project.d.ts +14 -16
  108. package/client/lib/base/classes/base-quick-fixes.d.ts +3 -1
  109. package/client/lib/base/classes/base-release-process.d.ts +8 -9
  110. package/{websql/lib/base/classes/base-github-pages.d.ts → client/lib/base/classes/base-static-pages.d.ts} +3 -3
  111. package/client/lib/base/classes/base-vscode.d.ts +4 -0
  112. package/client/lib/base/classes/index.d.ts +5 -1
  113. package/client/lib/base/commit-data.d.ts +14 -1
  114. package/client/lib/base/linked-project.d.ts +1 -1
  115. package/client/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  116. package/client/lib/base/translate.d.ts +228 -0
  117. package/client/lib/helpers/helpers-array-obj.d.ts +3 -0
  118. package/client/lib/helpers/helpers.d.ts +12 -8
  119. package/client/lib/models.d.ts +68 -2
  120. package/client/lib/utils.d.ts +72 -13
  121. package/index.js +15 -2
  122. package/index.js.map +1 -1
  123. package/lib/base/base-cli-worker-config.d.ts +27 -0
  124. package/lib/base/base-cli-worker-config.js +53 -0
  125. package/lib/base/base-cli-worker-config.js.map +1 -0
  126. package/lib/base/base-cli-worker-controller.d.ts +15 -0
  127. package/lib/base/base-cli-worker-controller.js +154 -0
  128. package/lib/base/base-cli-worker-controller.js.map +1 -0
  129. package/lib/base/base-cli-worker.d.ts +82 -0
  130. package/lib/base/base-cli-worker.js +654 -0
  131. package/lib/base/base-cli-worker.js.map +1 -0
  132. package/lib/base/base-command-line.backend.d.ts +174 -0
  133. package/lib/base/base-command-line.backend.js +2221 -0
  134. package/lib/base/base-command-line.backend.js.map +1 -0
  135. package/lib/base/base-compiler-for-project.d.ts +7 -0
  136. package/lib/base/base-compiler-for-project.js +62 -0
  137. package/lib/base/base-compiler-for-project.js.map +1 -0
  138. package/lib/base/base-db.d.ts +12 -0
  139. package/lib/base/base-db.js +74 -0
  140. package/lib/base/base-db.js.map +1 -0
  141. package/lib/base/base-debounce-compiler-for-project.d.ts +28 -0
  142. package/lib/base/base-debounce-compiler-for-project.js +82 -0
  143. package/lib/base/base-debounce-compiler-for-project.js.map +1 -0
  144. package/lib/base/base-detached-service.d.ts +6 -0
  145. package/lib/base/base-detached-service.js +16 -0
  146. package/lib/base/base-detached-service.js.map +1 -0
  147. package/lib/base/base-feature-for-project.d.ts +5 -0
  148. package/lib/base/base-feature-for-project.js +11 -0
  149. package/lib/base/base-feature-for-project.js.map +1 -0
  150. package/lib/base/base-git.d.ts +148 -0
  151. package/lib/base/base-git.js +1202 -0
  152. package/lib/base/base-git.js.map +1 -0
  153. package/{client/lib/base/classes → lib/base}/base-github-pages.d.ts +4 -5
  154. package/lib/base/base-github-pages.js +173 -0
  155. package/lib/base/base-github-pages.js.map +1 -0
  156. package/lib/base/base-ignore-hide.d.ts +14 -0
  157. package/lib/base/base-ignore-hide.js +55 -0
  158. package/lib/base/base-ignore-hide.js.map +1 -0
  159. package/lib/base/base-library-build.d.ts +65 -0
  160. package/lib/base/base-library-build.js +717 -0
  161. package/lib/base/base-library-build.js.map +1 -0
  162. package/lib/base/base-linked-projects.d.ts +24 -0
  163. package/lib/base/base-linked-projects.js +408 -0
  164. package/lib/base/base-linked-projects.js.map +1 -0
  165. package/lib/base/base-npm-helpers.d.ts +128 -0
  166. package/lib/base/base-npm-helpers.js +774 -0
  167. package/lib/base/base-npm-helpers.js.map +1 -0
  168. package/lib/base/base-project-resolver.d.ts +41 -0
  169. package/lib/base/base-project-resolver.js +308 -0
  170. package/lib/base/base-project-resolver.js.map +1 -0
  171. package/lib/base/base-project.d.ts +244 -0
  172. package/lib/base/base-project.js +1223 -0
  173. package/lib/base/base-project.js.map +1 -0
  174. package/lib/base/base-quick-fixes.d.ts +6 -0
  175. package/lib/base/base-quick-fixes.js +31 -0
  176. package/lib/base/base-quick-fixes.js.map +1 -0
  177. package/lib/base/base-release-process.d.ts +69 -0
  178. package/lib/base/base-release-process.js +913 -0
  179. package/lib/base/base-release-process.js.map +1 -0
  180. package/lib/base/base-start-config.backend.d.ts +36 -0
  181. package/lib/base/base-start-config.backend.js +167 -0
  182. package/lib/base/base-start-config.backend.js.map +1 -0
  183. package/lib/base/base-vscode.d.ts +12 -0
  184. package/lib/base/base-vscode.js +139 -0
  185. package/lib/base/base-vscode.js.map +1 -0
  186. package/lib/base/classes/base-bower-json.d.ts +34 -0
  187. package/lib/base/classes/base-bower-json.js +19 -0
  188. package/lib/base/classes/base-bower-json.js.map +1 -0
  189. package/lib/base/classes/base-cli-worker-config.js +35 -24
  190. package/lib/base/classes/base-cli-worker-config.js.map +1 -1
  191. package/lib/base/classes/base-cli-worker-controller.js +98 -128
  192. package/lib/base/classes/base-cli-worker-controller.js.map +1 -1
  193. package/lib/base/classes/base-cli-worker.d.ts +1 -1
  194. package/lib/base/classes/base-cli-worker.js +402 -610
  195. package/lib/base/classes/base-cli-worker.js.map +1 -1
  196. package/lib/base/classes/base-command-line-feature.backend.d.ts +5 -9
  197. package/lib/base/classes/base-command-line-feature.backend.js +73 -132
  198. package/lib/base/classes/base-command-line-feature.backend.js.map +1 -1
  199. package/lib/base/classes/base-command-line.backend.d.ts +175 -0
  200. package/lib/base/classes/base-command-line.backend.js +2235 -0
  201. package/lib/base/classes/base-command-line.backend.js.map +1 -0
  202. package/lib/base/classes/base-compiler-for-project.js +27 -32
  203. package/lib/base/classes/base-compiler-for-project.js.map +1 -1
  204. package/lib/base/classes/base-db.js +43 -60
  205. package/lib/base/classes/base-db.js.map +1 -1
  206. package/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
  207. package/lib/base/classes/base-debounce-compiler-for-project.js +44 -70
  208. package/lib/base/classes/base-debounce-compiler-for-project.js.map +1 -1
  209. package/lib/base/classes/base-detached-service.js.map +1 -1
  210. package/lib/base/classes/base-feature-for-project.d.ts +2 -1
  211. package/lib/base/classes/base-feature-for-project.js +7 -4
  212. package/lib/base/classes/base-feature-for-project.js.map +1 -1
  213. package/lib/base/classes/base-git.d.ts +32 -3
  214. package/lib/base/classes/base-git.js +885 -975
  215. package/lib/base/classes/base-git.js.map +1 -1
  216. package/lib/base/classes/base-github-pages.js.map +1 -1
  217. package/lib/base/classes/base-global-command-line.backend.d.ts +7 -2
  218. package/lib/base/classes/base-global-command-line.backend.js +1055 -2021
  219. package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
  220. package/lib/base/classes/base-ignore-hide.d.ts +2 -2
  221. package/lib/base/classes/base-ignore-hide.js +24 -28
  222. package/lib/base/classes/base-ignore-hide.js.map +1 -1
  223. package/lib/base/classes/base-json-file-reader.d.ts +71 -0
  224. package/lib/base/classes/base-json-file-reader.js +141 -0
  225. package/lib/base/classes/base-json-file-reader.js.map +1 -0
  226. package/lib/base/classes/base-library-build.d.ts +5 -6
  227. package/lib/base/classes/base-library-build.js +431 -653
  228. package/lib/base/classes/base-library-build.js.map +1 -1
  229. package/lib/base/classes/base-linked-projects.d.ts +1 -3
  230. package/lib/base/classes/base-linked-projects.js +200 -314
  231. package/lib/base/classes/base-linked-projects.js.map +1 -1
  232. package/lib/base/classes/base-node-modules.d.ts +55 -0
  233. package/lib/base/classes/base-node-modules.js +415 -0
  234. package/lib/base/classes/base-node-modules.js.map +1 -0
  235. package/lib/base/classes/base-npm-helpers.d.ts +29 -99
  236. package/lib/base/classes/base-npm-helpers.js +178 -737
  237. package/lib/base/classes/base-npm-helpers.js.map +1 -1
  238. package/lib/base/classes/base-package-json.d.ts +106 -0
  239. package/lib/base/classes/base-package-json.js +381 -0
  240. package/lib/base/classes/base-package-json.js.map +1 -0
  241. package/lib/base/classes/base-process-manager.d.ts +30 -0
  242. package/lib/base/classes/base-process-manager.js +269 -0
  243. package/lib/base/classes/base-process-manager.js.map +1 -0
  244. package/lib/base/classes/base-project-resolver.d.ts +2 -3
  245. package/lib/base/classes/base-project-resolver.js +102 -119
  246. package/lib/base/classes/base-project-resolver.js.map +1 -1
  247. package/lib/base/classes/base-project.d.ts +17 -15
  248. package/lib/base/classes/base-project.js +551 -733
  249. package/lib/base/classes/base-project.js.map +1 -1
  250. package/lib/base/classes/base-quick-fixes.d.ts +3 -1
  251. package/lib/base/classes/base-quick-fixes.js +45 -17
  252. package/lib/base/classes/base-quick-fixes.js.map +1 -1
  253. package/lib/base/classes/base-release-process.d.ts +8 -9
  254. package/lib/base/classes/base-release-process.js +482 -757
  255. package/lib/base/classes/base-release-process.js.map +1 -1
  256. package/lib/base/classes/base-start-config.backend.js +115 -99
  257. package/lib/base/classes/base-start-config.backend.js.map +1 -1
  258. package/lib/base/classes/base-static-pages.d.ts +14 -0
  259. package/lib/base/classes/base-static-pages.js +105 -0
  260. package/lib/base/classes/base-static-pages.js.map +1 -0
  261. package/lib/base/classes/base-vscode.d.ts +4 -0
  262. package/lib/base/classes/base-vscode.js +446 -426
  263. package/lib/base/classes/base-vscode.js.map +1 -1
  264. package/lib/base/classes/index copy.d.ts +22 -0
  265. package/lib/base/classes/index copy.js +28 -0
  266. package/lib/base/classes/index copy.js.map +1 -0
  267. package/lib/base/classes/index.d.ts +4 -0
  268. package/lib/base/classes/index.js +36 -19
  269. package/lib/base/classes/index.js.map +1 -1
  270. package/lib/base/command-line-feature.backend.d.ts +51 -0
  271. package/lib/base/command-line-feature.backend.js +206 -0
  272. package/lib/base/command-line-feature.backend.js.map +1 -0
  273. package/lib/base/commit-data.d.ts +14 -1
  274. package/lib/base/commit-data.js +408 -460
  275. package/lib/base/commit-data.js.map +1 -1
  276. package/lib/base/config-database.js +33 -61
  277. package/lib/base/config-database.js.map +1 -1
  278. package/lib/base/core-project.js +110 -146
  279. package/lib/base/core-project.js.map +1 -1
  280. package/lib/base/gh-temp-code.d.ts +1 -0
  281. package/lib/base/gh-temp-code.js +62 -104
  282. package/lib/base/gh-temp-code.js.map +1 -1
  283. package/lib/base/index-rebuilder.backend.d.ts +1 -0
  284. package/lib/base/index-rebuilder.backend.js.map +1 -1
  285. package/lib/base/index.js +20 -7
  286. package/lib/base/index.js.map +1 -1
  287. package/lib/base/linked-project.d.ts +1 -1
  288. package/lib/base/linked-project.js +59 -38
  289. package/lib/base/linked-project.js.map +1 -1
  290. package/lib/base/ports-worker.d.ts +32 -0
  291. package/lib/base/ports-worker.js +244 -0
  292. package/lib/base/ports-worker.js.map +1 -0
  293. package/lib/base/project-database.js +12 -22
  294. package/lib/base/project-database.js.map +1 -1
  295. package/lib/base/tcp-udp-ports/index.js +17 -4
  296. package/lib/base/tcp-udp-ports/index.js.map +1 -1
  297. package/lib/base/tcp-udp-ports/not-assignable-port.entity.d.ts +1 -0
  298. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
  299. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js.map +1 -1
  300. package/lib/base/tcp-udp-ports/port.entity.d.ts +0 -0
  301. package/lib/base/tcp-udp-ports/port.entity.js +5 -0
  302. package/lib/base/tcp-udp-ports/port.entity.js.map +1 -0
  303. package/lib/base/tcp-udp-ports/ports.controller.js +195 -283
  304. package/lib/base/tcp-udp-ports/ports.controller.js.map +1 -1
  305. package/lib/base/tcp-udp-ports/ports.entity.d.ts +2 -2
  306. package/lib/base/tcp-udp-ports/ports.entity.js +74 -62
  307. package/lib/base/tcp-udp-ports/ports.entity.js.map +1 -1
  308. package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js +11 -14
  309. package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js.map +1 -1
  310. package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js +244 -427
  311. package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js.map +1 -1
  312. package/lib/base/tcp-upd-ports.worker.d.ts +13 -0
  313. package/lib/base/tcp-upd-ports.worker.js +99 -0
  314. package/lib/base/tcp-upd-ports.worker.js.map +1 -0
  315. package/lib/base/translate.d.ts +1 -1
  316. package/lib/base/translate.js +90 -119
  317. package/lib/base/translate.js.map +1 -1
  318. package/lib/build-info._auto-generated_.js.map +1 -1
  319. package/lib/helpers/for-backend/helpers-cli-tool.backend.js +109 -115
  320. package/lib/helpers/for-backend/helpers-cli-tool.backend.js.map +1 -1
  321. package/lib/helpers/for-backend/helpers-console-gui.js +55 -102
  322. package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
  323. package/lib/helpers/for-backend/helpers-dependencies.backend.js +28 -45
  324. package/lib/helpers/for-backend/helpers-dependencies.backend.js.map +1 -1
  325. package/lib/helpers/for-backend/helpers-file-folders.backend.d.ts +2 -2
  326. package/lib/helpers/for-backend/helpers-file-folders.backend.js +277 -266
  327. package/lib/helpers/for-backend/helpers-file-folders.backend.js.map +1 -1
  328. package/lib/helpers/for-backend/helpers-git.backend.d.ts +28 -3
  329. package/lib/helpers/for-backend/helpers-git.backend.js +804 -864
  330. package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
  331. package/lib/helpers/for-backend/helpers-network.backend.js +15 -18
  332. package/lib/helpers/for-backend/helpers-network.backend.js.map +1 -1
  333. package/lib/helpers/for-backend/helpers-npm.backend.js +5 -8
  334. package/lib/helpers/for-backend/helpers-npm.backend.js.map +1 -1
  335. package/lib/helpers/for-backend/helpers-path.backend.js +18 -26
  336. package/lib/helpers/for-backend/helpers-path.backend.js.map +1 -1
  337. package/lib/helpers/for-backend/helpers-process.backend.d.ts +2 -2
  338. package/lib/helpers/for-backend/helpers-process.backend.js +285 -363
  339. package/lib/helpers/for-backend/helpers-process.backend.js.map +1 -1
  340. package/lib/helpers/for-backend/helpers-system-terminal.backend.js +25 -42
  341. package/lib/helpers/for-backend/helpers-system-terminal.backend.js.map +1 -1
  342. package/lib/helpers/for-backend/helpers-vscode.backend.js +9 -12
  343. package/lib/helpers/for-backend/helpers-vscode.backend.js.map +1 -1
  344. package/lib/helpers/for-backend/ts-code/index.js +0 -2
  345. package/lib/helpers/for-backend/ts-code/index.js.map +1 -1
  346. package/lib/helpers/for-backend/ts-code/ts-code-extractor.d.ts +26 -0
  347. package/lib/helpers/for-backend/ts-code/ts-code-extractor.js +62 -0
  348. package/lib/helpers/for-backend/ts-code/ts-code-extractor.js.map +1 -0
  349. package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.d.ts +19 -0
  350. package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.js +81 -0
  351. package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.js.map +1 -0
  352. package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.js +2 -2
  353. package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.js.map +1 -1
  354. package/lib/helpers/for-browser/angular.helper.js +2 -2
  355. package/lib/helpers/for-browser/angular.helper.js.map +1 -1
  356. package/lib/helpers/for-browser/helpers-browser.js +27 -40
  357. package/lib/helpers/for-browser/helpers-browser.js.map +1 -1
  358. package/lib/helpers/helpers-array-obj.d.ts +3 -0
  359. package/lib/helpers/helpers-array-obj.js +49 -61
  360. package/lib/helpers/helpers-array-obj.js.map +1 -1
  361. package/lib/helpers/helpers-json5.backend.js +44 -55
  362. package/lib/helpers/helpers-json5.backend.js.map +1 -1
  363. package/lib/helpers/helpers-numbers.js +7 -10
  364. package/lib/helpers/helpers-numbers.js.map +1 -1
  365. package/lib/helpers/helpers-strings-regexes.js +40 -47
  366. package/lib/helpers/helpers-strings-regexes.js.map +1 -1
  367. package/lib/helpers/helpers-strings.js +38 -41
  368. package/lib/helpers/helpers-strings.js.map +1 -1
  369. package/lib/helpers/helpers.d.ts +12 -8
  370. package/lib/helpers/helpers.js +313 -393
  371. package/lib/helpers/helpers.js.map +1 -1
  372. package/lib/index._auto-generated_.d.ts +1 -0
  373. package/lib/index._auto-generated_.js.map +1 -1
  374. package/lib/index.d.ts +2 -1
  375. package/lib/index.js +21 -7
  376. package/lib/index.js.map +1 -1
  377. package/lib/lowdb/adapters/Memory.js +14 -20
  378. package/lib/lowdb/adapters/Memory.js.map +1 -1
  379. package/lib/lowdb/adapters/browser/LocalStorage.js +5 -8
  380. package/lib/lowdb/adapters/browser/LocalStorage.js.map +1 -1
  381. package/lib/lowdb/adapters/browser/SessionStorage.js +5 -8
  382. package/lib/lowdb/adapters/browser/SessionStorage.js.map +1 -1
  383. package/lib/lowdb/adapters/browser/WebStorage.js +10 -9
  384. package/lib/lowdb/adapters/browser/WebStorage.js.map +1 -1
  385. package/lib/lowdb/adapters/node/DataFile.js +29 -38
  386. package/lib/lowdb/adapters/node/DataFile.js.map +1 -1
  387. package/lib/lowdb/adapters/node/JSONFile.js +13 -18
  388. package/lib/lowdb/adapters/node/JSONFile.js.map +1 -1
  389. package/lib/lowdb/adapters/node/TextFile.js +36 -44
  390. package/lib/lowdb/adapters/node/TextFile.js.map +1 -1
  391. package/lib/lowdb/adapters/node/steno.js +72 -122
  392. package/lib/lowdb/adapters/node/steno.js.map +1 -1
  393. package/lib/lowdb/browser.js +17 -4
  394. package/lib/lowdb/browser.js.map +1 -1
  395. package/lib/lowdb/core/Low.js +30 -60
  396. package/lib/lowdb/core/Low.js.map +1 -1
  397. package/lib/lowdb/examples/browser.js.map +1 -1
  398. package/lib/lowdb/examples/cli.d.ts +1 -0
  399. package/lib/lowdb/examples/cli.js.map +1 -1
  400. package/lib/lowdb/examples/in-memory.d.ts +1 -0
  401. package/lib/lowdb/examples/in-memory.js.map +1 -1
  402. package/lib/lowdb/examples/server.d.ts +1 -0
  403. package/lib/lowdb/examples/server.js.map +1 -1
  404. package/lib/lowdb/index.js +16 -3
  405. package/lib/lowdb/index.js.map +1 -1
  406. package/lib/lowdb/node.js +18 -5
  407. package/lib/lowdb/node.js.map +1 -1
  408. package/lib/lowdb/presets/browser.js +7 -7
  409. package/lib/lowdb/presets/browser.js.map +1 -1
  410. package/lib/lowdb/presets/node.js +12 -23
  411. package/lib/lowdb/presets/node.js.map +1 -1
  412. package/lib/models.d.ts +68 -2
  413. package/lib/models.js +197 -3
  414. package/lib/models.js.map +1 -1
  415. package/lib/old/base-component.d.ts +1 -0
  416. package/lib/old/base-component.js +2 -2
  417. package/lib/old/base-component.js.map +1 -1
  418. package/lib/old/base-formly-component.d.ts +1 -0
  419. package/lib/old/base-formly-component.js +2 -2
  420. package/lib/old/base-formly-component.js.map +1 -1
  421. package/lib/old/condition-wait.d.ts +1 -0
  422. package/lib/old/condition-wait.js.map +1 -1
  423. package/lib/old/dual-component-ctrl.d.ts +1 -0
  424. package/lib/old/dual-component-ctrl.js +2 -2
  425. package/lib/old/dual-component-ctrl.js.map +1 -1
  426. package/lib/old/execute-command.d.ts +11 -0
  427. package/lib/old/execute-command.js +564 -0
  428. package/lib/old/execute-command.js.map +1 -0
  429. package/lib/old/helpers.d.ts +62 -0
  430. package/lib/old/helpers.js +279 -0
  431. package/lib/old/helpers.js.map +1 -0
  432. package/lib/old/models.d.ts +80 -0
  433. package/lib/old/models.js +57 -0
  434. package/lib/old/models.js.map +1 -0
  435. package/lib/utils.d.ts +72 -13
  436. package/lib/utils.js +502 -179
  437. package/lib/utils.js.map +1 -1
  438. package/lib/validators/validators-firedev.js +5 -5
  439. package/lib/validators/validators-firedev.js.map +1 -1
  440. package/lib/validators/validators-git.js +2 -2
  441. package/lib/validators/validators-git.js.map +1 -1
  442. package/lib/validators/validators-network.js +1 -1
  443. package/lib/validators/validators-network.js.map +1 -1
  444. package/lib/validators/validators.js +2 -2
  445. package/lib/validators/validators.js.map +1 -1
  446. package/migrations/1736198527297_init.js +39 -58
  447. package/migrations/1736198527297_init.js.map +1 -1
  448. package/migrations/1736199486472_addingNotAssignablePorts.js +42 -93
  449. package/migrations/1736199486472_addingNotAssignablePorts.js.map +1 -1
  450. package/migrations/1736454437350_addFreePorts.js +48 -100
  451. package/migrations/1736454437350_addFreePorts.js.map +1 -1
  452. package/migrations/index.js +15 -2
  453. package/migrations/index.js.map +1 -1
  454. package/migrations/migrations_index._auto-generated_.js +3 -3
  455. package/migrations/migrations_index._auto-generated_.js.map +1 -1
  456. package/package.json +14 -61
  457. package/src.d.ts +1 -1
  458. package/taon.jsonc +26 -41
  459. package/tmp-environment.json +8 -389
  460. package/websql/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
  461. package/websql/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
  462. package/websql/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
  463. package/websql/esm2022/lib/base/classes/base-cli-worker.mjs +10 -2
  464. package/websql/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
  465. package/websql/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
  466. package/websql/esm2022/lib/base/classes/base-git.mjs +229 -4
  467. package/websql/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
  468. package/websql/esm2022/lib/base/classes/base-library-build.mjs +11 -7
  469. package/websql/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
  470. package/websql/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
  471. package/websql/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -429
  472. package/websql/esm2022/lib/base/classes/base-package-json.mjs +340 -0
  473. package/websql/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
  474. package/websql/esm2022/lib/base/classes/base-project-resolver.mjs +2 -10
  475. package/websql/esm2022/lib/base/classes/base-project.mjs +75 -61
  476. package/websql/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
  477. package/websql/esm2022/lib/base/classes/base-release-process.mjs +44 -11
  478. package/websql/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
  479. package/websql/esm2022/lib/base/classes/base-vscode.mjs +29 -1
  480. package/websql/esm2022/lib/base/classes/index.mjs +5 -1
  481. package/websql/esm2022/lib/base/commit-data.mjs +19 -1
  482. package/websql/esm2022/lib/base/core-project.mjs +3 -3
  483. package/websql/esm2022/lib/base/linked-project.mjs +4 -4
  484. package/websql/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
  485. package/websql/esm2022/lib/base/translate.mjs +566 -0
  486. package/websql/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
  487. package/websql/esm2022/lib/helpers/helpers.mjs +12 -6
  488. package/websql/esm2022/lib/index.mjs +2 -1
  489. package/websql/esm2022/lib/models.mjs +173 -3
  490. package/websql/esm2022/lib/utils.mjs +402 -41
  491. package/websql/fesm2022/tnp-helpers.mjs +4738 -3007
  492. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  493. package/websql/lib/base/classes/base-bower-json.d.ts +35 -0
  494. package/websql/lib/base/classes/base-cli-worker.d.ts +1 -1
  495. package/websql/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
  496. package/websql/lib/base/classes/base-feature-for-project.d.ts +2 -1
  497. package/websql/lib/base/classes/base-git.d.ts +34 -5
  498. package/websql/lib/base/classes/base-json-file-reader.d.ts +72 -0
  499. package/websql/lib/base/classes/base-library-build.d.ts +5 -5
  500. package/websql/lib/base/classes/base-linked-projects.d.ts +1 -2
  501. package/websql/lib/base/classes/base-node-modules.d.ts +56 -0
  502. package/websql/lib/base/classes/base-npm-helpers.d.ts +29 -110
  503. package/websql/lib/base/classes/base-package-json.d.ts +107 -0
  504. package/websql/lib/base/classes/base-process-manager.d.ts +31 -0
  505. package/websql/lib/base/classes/base-project-resolver.d.ts +2 -2
  506. package/websql/lib/base/classes/base-project.d.ts +14 -16
  507. package/websql/lib/base/classes/base-quick-fixes.d.ts +3 -1
  508. package/websql/lib/base/classes/base-release-process.d.ts +8 -9
  509. package/websql/lib/base/classes/base-static-pages.d.ts +15 -0
  510. package/websql/lib/base/classes/base-vscode.d.ts +4 -0
  511. package/websql/lib/base/classes/index.d.ts +5 -1
  512. package/websql/lib/base/commit-data.d.ts +14 -1
  513. package/websql/lib/base/linked-project.d.ts +1 -1
  514. package/websql/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  515. package/websql/lib/base/translate.d.ts +228 -0
  516. package/websql/lib/helpers/helpers-array-obj.d.ts +3 -0
  517. package/websql/lib/helpers/helpers.d.ts +12 -8
  518. package/websql/lib/models.d.ts +68 -2
  519. package/websql/lib/utils.d.ts +72 -13
  520. package/browser/package.json +0 -25
  521. package/websql/package.json +0 -25
@@ -1,2253 +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*/];
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;
890
569
  }
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*/];
946
- }
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
- };
1246
- //#endregion
1247
- //#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
- };
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
+ }
704
+ //#endregion
705
+ //#region commands / push style
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
- try {
1422
- this.project.git.fetch();
1423
- }
1424
- catch (error) { }
1425
- branchName = this.firstArg;
1426
- branches = this.__filterBranchesByPattern(branchName);
1427
- if (!(branches.length > 0)) return [3 /*break*/, 4];
1428
- return [4 /*yield*/, this.__selectBrach(branches, 'checkout')];
1429
- case 3:
1430
- branchName = _a.sent();
1431
- return [3 /*break*/, 5];
1432
- case 4:
1433
- index_1.Helpers.error("No branch found by name \"".concat(branchName, "\""), false, true);
1434
- _a.label = 5;
1435
- case 5:
1436
- try {
1437
- this.project.git.stageAllFiles();
1438
- this.project.git.stash();
1439
- }
1440
- catch (error) { }
1441
- this.project.git.checkout(branchName);
1442
- this._exit();
1443
- return [2 /*return*/];
1444
- }
1445
- });
1446
- });
1447
- };
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
+ }
1448
782
  //#endregion
1449
783
  //#region commands / push build
1450
- BaseGlobalCommandLine.prototype.pushBuild = function () {
1451
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1452
- return tslib_1.__generator(this, function (_a) {
1453
- switch (_a.label) {
1454
- case 0: return [4 /*yield*/, this.meltUpdateCommits()];
1455
- case 1:
1456
- _a.sent();
1457
- return [4 /*yield*/, this.push({ typeofCommit: 'build', commitMessageRequired: true })];
1458
- case 2:
1459
- _a.sent();
1460
- return [2 /*return*/];
1461
- }
1462
- });
1463
- });
1464
- };
784
+ async pushBuild() {
785
+ await this.meltUpdateCommits();
786
+ await this.push({ typeofCommit: 'build', commitMessageRequired: true });
787
+ }
1465
788
  //#endregion
1466
789
  //#region commands / set origin
1467
- BaseGlobalCommandLine.prototype.SET_ORIGIN = function () {
1468
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1469
- var newOriginNameOrUrl, proj;
1470
- return tslib_1.__generator(this, function (_a) {
1471
- switch (_a.label) {
1472
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1473
- case 1:
1474
- if (!(_a.sent())) {
1475
- return [2 /*return*/];
1476
- }
1477
- newOriginNameOrUrl = this.firstArg;
1478
- proj = this.project;
1479
- if (proj && proj.git.isInsideGitRepo) {
1480
- proj.run("git remote rm origin").sync();
1481
- proj.run("git remote add origin ".concat(newOriginNameOrUrl, " ")).sync();
1482
- index_1.Helpers.info("Done");
1483
- }
1484
- else {
1485
- index_1.Helpers.error("This folder is not a git repo... ", false, true);
1486
- }
1487
- this._exit();
1488
- return [2 /*return*/];
1489
- }
1490
- });
1491
- });
1492
- };
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
+ }
1493
806
  //#endregion
1494
807
  //#region commands / rename origin
1495
- BaseGlobalCommandLine.prototype.RENAME_ORIGIN = function () {
1496
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1497
- var newOriginNameOrUrl, proj;
1498
- return tslib_1.__generator(this, function (_a) {
1499
- switch (_a.label) {
1500
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1501
- case 1:
1502
- if (!(_a.sent())) {
1503
- return [2 /*return*/];
1504
- }
1505
- newOriginNameOrUrl = this.firstArg;
1506
- proj = this.project;
1507
- if (proj && proj.git.isInsideGitRepo) {
1508
- proj.git.renameOrigin(newOriginNameOrUrl);
1509
- }
1510
- else {
1511
- index_1.Helpers.error("This folder is not a git repo... ", false, true);
1512
- }
1513
- this._exit();
1514
- return [2 /*return*/];
1515
- }
1516
- });
1517
- });
1518
- };
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
+ }
1519
822
  //#endregion
1520
823
  //#region commands / last hash tag
1521
- BaseGlobalCommandLine.prototype.LAST_TAG_HASH = function () {
1522
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1523
- return tslib_1.__generator(this, function (_a) {
1524
- switch (_a.label) {
1525
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1526
- case 1:
1527
- if (!(_a.sent())) {
1528
- return [2 /*return*/];
1529
- }
1530
- index_1.Helpers.info(this.project.git.lastTagHash());
1531
- this._exit();
1532
- return [2 /*return*/];
1533
- }
1534
- });
1535
- });
1536
- };
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
+ }
1537
831
  //#endregion
1538
832
  //#region commands / last tag
1539
- BaseGlobalCommandLine.prototype.LAST_TAG = function () {
1540
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1541
- var proj;
1542
- return tslib_1.__generator(this, function (_a) {
1543
- switch (_a.label) {
1544
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1545
- case 1:
1546
- if (!(_a.sent())) {
1547
- return [2 /*return*/];
1548
- }
1549
- proj = this.project;
1550
- index_1.Helpers.info("\n\n last tag: ".concat(proj.git.lastTagVersionName, "\n last tag hash: ").concat(proj.git.lastTagHash(), "\n\n"));
1551
- this._exit();
1552
- return [2 /*return*/];
1553
- }
1554
- });
1555
- });
1556
- };
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
+ }
1557
846
  //#endregion
1558
847
  //#region commands / check tag exists
1559
- BaseGlobalCommandLine.prototype.CHECK_TAG_EXISTS = function () {
1560
- 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)} `);
1561
850
  this._exit();
1562
- };
851
+ }
1563
852
  //#endregion
1564
853
  //#region commands / lint
1565
854
  /**
1566
855
  * TODO move somewhere
1567
856
  */
1568
- BaseGlobalCommandLine.prototype.lint = function () {
1569
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1570
- return tslib_1.__generator(this, function (_a) {
1571
- switch (_a.label) {
1572
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1573
- case 1:
1574
- if (!(_a.sent())) {
1575
- return [2 /*return*/];
1576
- }
1577
- return [4 /*yield*/, this.project.lint()];
1578
- case 2:
1579
- _a.sent();
1580
- return [2 /*return*/];
1581
- }
1582
- });
1583
- });
1584
- };
857
+ async lint() {
858
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
859
+ return;
860
+ }
861
+ await this.project.lint();
862
+ }
1585
863
  //#endregion
1586
864
  //#region commands / version
1587
865
  /**
1588
866
  * TODO move somewhere
1589
867
  */
1590
- BaseGlobalCommandLine.prototype.version = function () {
1591
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1592
- return tslib_1.__generator(this, function (_a) {
1593
- switch (_a.label) {
1594
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1595
- case 1:
1596
- if (!(_a.sent())) {
1597
- return [2 /*return*/];
1598
- }
1599
- console.log('Current project verison: ' + this.project.npmHelpers.version);
1600
- this._exit();
1601
- return [2 /*return*/];
1602
- }
1603
- });
1604
- });
1605
- };
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
+ }
1606
875
  //#endregion
1607
876
  //#region commands / init
1608
877
  /**
1609
878
  * TODO move somewhere
1610
879
  */
1611
- BaseGlobalCommandLine.prototype.init = function () {
1612
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1613
- return tslib_1.__generator(this, function (_a) {
1614
- switch (_a.label) {
1615
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1616
- case 1:
1617
- if (!(_a.sent())) {
1618
- return [2 /*return*/];
1619
- }
1620
- return [4 /*yield*/, this.project.init()];
1621
- case 2:
1622
- _a.sent();
1623
- this._exit();
1624
- return [2 /*return*/];
1625
- }
1626
- });
1627
- });
1628
- };
880
+ async init() {
881
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
882
+ return;
883
+ }
884
+ await this.project.init();
885
+ this._exit();
886
+ }
1629
887
  /**
1630
888
  * init parent and first level children
1631
889
  */
1632
- BaseGlobalCommandLine.prototype.initAll = function () {
1633
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1634
- var _a, _b, child, e_3_1;
1635
- var e_3, _c;
1636
- return tslib_1.__generator(this, function (_d) {
1637
- switch (_d.label) {
1638
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1639
- case 1:
1640
- if (!(_d.sent())) {
1641
- return [2 /*return*/];
1642
- }
1643
- return [4 /*yield*/, this.project.init()];
1644
- case 2:
1645
- _d.sent();
1646
- _d.label = 3;
1647
- case 3:
1648
- _d.trys.push([3, 8, 9, 10]);
1649
- _a = tslib_1.__values(this.project.children), _b = _a.next();
1650
- _d.label = 4;
1651
- case 4:
1652
- if (!!_b.done) return [3 /*break*/, 7];
1653
- child = _b.value;
1654
- return [4 /*yield*/, child.init()];
1655
- case 5:
1656
- _d.sent();
1657
- _d.label = 6;
1658
- case 6:
1659
- _b = _a.next();
1660
- return [3 /*break*/, 4];
1661
- case 7: return [3 /*break*/, 10];
1662
- case 8:
1663
- e_3_1 = _d.sent();
1664
- e_3 = { error: e_3_1 };
1665
- return [3 /*break*/, 10];
1666
- case 9:
1667
- try {
1668
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
1669
- }
1670
- finally { if (e_3) throw e_3.error; }
1671
- return [7 /*endfinally*/];
1672
- case 10:
1673
- this._exit();
1674
- return [2 /*return*/];
1675
- }
1676
- });
1677
- });
1678
- };
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
+ }
1679
900
  //#endregion
1680
901
  //#region commands / struct
1681
902
  /**
1682
903
  * TODO move somewhere
1683
904
  */
1684
- BaseGlobalCommandLine.prototype.struct = function () {
1685
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1686
- return tslib_1.__generator(this, function (_a) {
1687
- switch (_a.label) {
1688
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1689
- case 1:
1690
- if (!(_a.sent())) {
1691
- return [2 /*return*/];
1692
- }
1693
- return [4 /*yield*/, this.project.struct()];
1694
- case 2:
1695
- _a.sent();
1696
- this._exit();
1697
- return [2 /*return*/];
1698
- }
1699
- });
1700
- });
1701
- };
905
+ async struct() {
906
+ if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
907
+ return;
908
+ }
909
+ await this.project.struct();
910
+ this._exit();
911
+ }
1702
912
  //#endregion
1703
913
  //#region commands / info
1704
914
  /**
1705
915
  * TODO move somewhere
1706
916
  */
1707
- BaseGlobalCommandLine.prototype.info = function () {
1708
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1709
- return tslib_1.__generator(this, function (_a) {
1710
- switch (_a.label) {
1711
- case 0: return [4 /*yield*/, this.cwdIsProject({
1712
- requireProjectWithGitRoot: false,
1713
- })];
1714
- case 1:
1715
- if (!(_a.sent())) {
1716
- return [2 /*return*/];
1717
- }
1718
- index_1.Helpers.clearConsole();
1719
- return [4 /*yield*/, this.project.info()];
1720
- case 2:
1721
- _a.sent();
1722
- return [4 /*yield*/, this.project.linkedProjects.saveAllLinkedProjectsToDB()];
1723
- case 3:
1724
- _a.sent();
1725
- this._exit();
1726
- return [2 /*return*/];
1727
- }
1728
- });
1729
- });
1730
- };
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
+ }
1731
928
  //#endregion
1732
929
  //#region commands / info
1733
- BaseGlobalCommandLine.prototype.modified = function () {
1734
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1735
- var proj, libs;
1736
- return tslib_1.__generator(this, function (_a) {
1737
- switch (_a.label) {
1738
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1739
- case 1:
1740
- if (!(_a.sent())) {
1741
- return [2 /*return*/];
1742
- }
1743
- proj = this.project;
1744
- libs = proj.children.filter(function (child) {
1745
- process.stdout.write('.');
1746
- return child.git.thereAreSomeUncommitedChangeExcept([
1747
- tnp_config_2.config.file.package_json,
1748
- ]);
1749
- });
1750
- console.log('\n' + index_1.Helpers.terminalLine());
1751
- index_1.Helpers.info(libs.length
1752
- ? libs
1753
- .map(function (c) {
1754
- 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(', '), ")");
1755
- })
1756
- .join('\n')
1757
- : 'Nothing modifed');
1758
- this._exit();
1759
- return [2 /*return*/];
1760
- }
1761
- });
1762
- });
1763
- };
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
+ }
1764
949
  //#endregion
1765
950
  //#region commands / update
1766
- BaseGlobalCommandLine.prototype.UPDATE = function () {
1767
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1768
- var linkedProjects;
1769
- var _this = this;
1770
- return tslib_1.__generator(this, function (_a) {
1771
- switch (_a.label) {
1772
- case 0:
1773
- linkedProjects = index_1.LinkedProject.detect(this.project.location).filter(function (linkedProj) {
1774
- return _this.project.ins.From([
1775
- _this.project.location,
1776
- linkedProj.relativeClonePath,
1777
- ]);
1778
- });
1779
- 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?"))];
1780
- case 1:
1781
- if (_a.sent()) {
1782
- this.project.linkedProjects.addLinkedProjects(linkedProjects);
1783
- }
1784
- return [4 /*yield*/, this.project.init()];
1785
- case 2:
1786
- _a.sent();
1787
- index_1.Helpers.info("Linked projects updated");
1788
- this._exit(0);
1789
- return [2 /*return*/];
1790
- }
1791
- });
1792
- });
1793
- };
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
+ }
1794
969
  //#endregion
1795
970
  //#region commands / changes
1796
- BaseGlobalCommandLine.prototype.changes = function () {
1797
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1798
- var _a, _b, _c, _d, chil, _e, _f, e_4_1;
1799
- var e_4, _g;
1800
- return tslib_1.__generator(this, function (_h) {
1801
- switch (_h.label) {
1802
- case 0:
1803
- _b = (_a = index_1.Helpers).info;
1804
- return [4 /*yield*/, this.project.git.changesSummary()];
1805
- case 1:
1806
- _b.apply(_a, [_h.sent()]);
1807
- index_1.Helpers.terminalLine();
1808
- _h.label = 2;
1809
- case 2:
1810
- _h.trys.push([2, 7, 8, 9]);
1811
- _c = tslib_1.__values(this.project.children), _d = _c.next();
1812
- _h.label = 3;
1813
- case 3:
1814
- if (!!_d.done) return [3 /*break*/, 6];
1815
- chil = _d.value;
1816
- _f = (_e = index_1.Helpers).info;
1817
- return [4 /*yield*/, chil.git.changesSummary()];
1818
- case 4:
1819
- _f.apply(_e, [_h.sent()]);
1820
- _h.label = 5;
1821
- case 5:
1822
- _d = _c.next();
1823
- return [3 /*break*/, 3];
1824
- case 6: return [3 /*break*/, 9];
1825
- case 7:
1826
- e_4_1 = _h.sent();
1827
- e_4 = { error: e_4_1 };
1828
- return [3 /*break*/, 9];
1829
- case 8:
1830
- try {
1831
- if (_d && !_d.done && (_g = _c.return)) _g.call(_c);
1832
- }
1833
- finally { if (e_4) throw e_4.error; }
1834
- return [7 /*endfinally*/];
1835
- case 9:
1836
- this._exit();
1837
- return [2 /*return*/];
1838
- }
1839
- });
1840
- });
1841
- };
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
+ }
1842
979
  //#endregion
1843
980
  //#region commands / branch name
1844
- BaseGlobalCommandLine.prototype.BRANCH_NAME = function () {
1845
- 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())}"`);
1846
983
  this._exit();
1847
- };
984
+ }
1848
985
  //#endregion
1849
986
  //#region commands / remotes
1850
- BaseGlobalCommandLine.prototype.REMOTES = function () {
987
+ REMOTES() {
1851
988
  console.log(index_1.Helpers.git.allOrigins(this.cwd));
1852
989
  this._exit();
1853
- };
1854
- BaseGlobalCommandLine.prototype.SET_REMOTE_SSH = function () {
1855
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1856
- return tslib_1.__generator(this, function (_a) {
1857
- switch (_a.label) {
1858
- case 0: return [4 /*yield*/, index_1.Helpers.git.changeRemoteFromHttpsToSSh(this.cwd)];
1859
- case 1:
1860
- _a.sent();
1861
- this._exit();
1862
- return [2 /*return*/];
1863
- }
1864
- });
1865
- });
1866
- };
1867
- BaseGlobalCommandLine.prototype.SET_REMOTE_http = function () {
1868
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1869
- return tslib_1.__generator(this, function (_a) {
1870
- switch (_a.label) {
1871
- case 0: return [4 /*yield*/, index_1.Helpers.git.changeRemoveFromSshToHttps(this.cwd)];
1872
- case 1:
1873
- _a.sent();
1874
- this._exit();
1875
- return [2 /*return*/];
1876
- }
1877
- });
1878
- });
1879
- };
1880
- BaseGlobalCommandLine.prototype.SET_REMOTE_https = function () {
1881
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1882
- return tslib_1.__generator(this, function (_a) {
1883
- switch (_a.label) {
1884
- case 0: return [4 /*yield*/, this.SET_REMOTE_http()];
1885
- case 1:
1886
- _a.sent();
1887
- return [2 /*return*/];
1888
- }
1889
- });
1890
- });
1891
- };
1892
- BaseGlobalCommandLine.prototype._resolveChildFromArg = function () {
1893
- var _this = this;
1894
- var _a = index_1.Helpers.cliTool.resolveItemFromArgsBegin(this.args, function (arg) {
1895
- return _this.ins.From([_this.cwd, arg]);
1896
- }), 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]));
1897
1004
  if (!!projFromArg) {
1898
1005
  this.args = clearedCommand.split(' ');
1899
1006
  this.cwd = projFromArg.location;
1900
1007
  this.project = projFromArg;
1901
1008
  }
1902
- };
1903
- BaseGlobalCommandLine.prototype.origin = function () {
1009
+ }
1010
+ origin() {
1904
1011
  this._resolveChildFromArg();
1905
1012
  console.log(index_1.Helpers.git.getOriginURL(this.cwd));
1906
1013
  this._exit();
1907
- };
1908
- BaseGlobalCommandLine.prototype.remote = function () {
1014
+ }
1015
+ remote() {
1909
1016
  console.log(index_1.Helpers.git.getOriginURL(this.cwd));
1910
1017
  this._exit();
1911
- };
1912
- BaseGlobalCommandLine.prototype.originHttp = function () {
1018
+ }
1019
+ originHttp() {
1913
1020
  console.log(index_1.Helpers.git.originSshToHttp(index_1.Helpers.git.getOriginURL(this.cwd)));
1914
1021
  this._exit();
1915
- };
1916
- BaseGlobalCommandLine.prototype.originHttps = function () {
1022
+ }
1023
+ originHttps() {
1917
1024
  console.log(index_1.Helpers.git.originSshToHttp(index_1.Helpers.git.getOriginURL(this.cwd)));
1918
1025
  this._exit();
1919
- };
1920
- BaseGlobalCommandLine.prototype.originssh = function () {
1026
+ }
1027
+ originssh() {
1921
1028
  console.log(index_1.Helpers.git.originHttpToSsh(index_1.Helpers.git.getOriginURL(this.cwd)));
1922
1029
  this._exit();
1923
- };
1924
- BaseGlobalCommandLine.prototype.origins = function () {
1030
+ }
1031
+ origins() {
1925
1032
  this.REMOTES();
1926
- };
1033
+ }
1927
1034
  //#endregion
1928
1035
  //#region commands / git config
1929
- BaseGlobalCommandLine.prototype.gitConfig = function () {
1930
- var root = index_1.Helpers.git.findGitRoot(this.cwd);
1931
- 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();
1932
1039
  this._exit();
1933
- };
1040
+ }
1934
1041
  //#endregion
1935
1042
  //#region commands / lastCommitHash
1936
- BaseGlobalCommandLine.prototype.LAST_COMMIT_HASH = function () {
1043
+ LAST_COMMIT_HASH() {
1937
1044
  console.log(index_1.Helpers.git.lastCommitHash(this.cwd));
1938
1045
  this._exit();
1939
- };
1046
+ }
1940
1047
  //#endregion
1941
1048
  //#region commands / commit message by hash
1942
- BaseGlobalCommandLine.prototype.COMMIT_MESSAGE_BY_HASH = function () {
1943
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1944
- var hash, _a, _b;
1945
- return tslib_1.__generator(this, function (_c) {
1946
- switch (_c.label) {
1947
- case 0:
1948
- hash = this.firstArg;
1949
- _b = (_a = console).log;
1950
- return [4 /*yield*/, this.project.git.getCommitMessageByHash(hash)];
1951
- case 1:
1952
- _b.apply(_a, [_c.sent()]);
1953
- this._exit();
1954
- return [2 /*return*/];
1955
- }
1956
- });
1957
- });
1958
- };
1049
+ async COMMIT_MESSAGE_BY_HASH() {
1050
+ const hash = this.firstArg;
1051
+ console.log(await this.project.git.getCommitMessageByHash(hash));
1052
+ this._exit();
1053
+ }
1959
1054
  //#endregion
1960
1055
  //#region commands / last 5 commit hashes
1961
- BaseGlobalCommandLine.prototype.LAST_5_COMMITS = function () {
1962
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1963
- var index, hash;
1964
- return tslib_1.__generator(this, function (_a) {
1965
- switch (_a.label) {
1966
- case 0:
1967
- index = 0;
1968
- _a.label = 1;
1969
- case 1:
1970
- if (!(index < 5)) return [3 /*break*/, 4];
1971
- return [4 /*yield*/, this.project.git.getCommitHashByIndex(index)];
1972
- case 2:
1973
- hash = _a.sent();
1974
- console.log(hash);
1975
- _a.label = 3;
1976
- case 3:
1977
- index++;
1978
- return [3 /*break*/, 1];
1979
- case 4:
1980
- this._exit();
1981
- return [2 /*return*/];
1982
- }
1983
- });
1984
- });
1985
- };
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
+ }
1986
1063
  //#endregion
1987
1064
  //#region commands / update deps from
1988
- BaseGlobalCommandLine.prototype.updateDepsFrom = function () {
1989
- return tslib_1.__awaiter(this, void 0, void 0, function () {
1990
- var locations;
1991
- var _this = this;
1992
- return tslib_1.__generator(this, function (_a) {
1993
- locations = this.args.join(' ').trim() === '' ? [] : this.args;
1994
- if (tnp_core_1._.isArray(locations)) {
1995
- locations = locations.map(function (l) {
1996
- if (tnp_core_1.path.isAbsolute(l)) {
1997
- return tnp_core_1.path.resolve(l);
1998
- }
1999
- return tnp_core_1.path.resolve(tnp_core_1.path.join(_this.cwd, l));
2000
- });
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);
2001
1071
  }
2002
- this.project.npmHelpers.updateDepsFrom(locations);
2003
- this._exit();
2004
- return [2 /*return*/];
1072
+ return tnp_core_1.path.resolve(tnp_core_1.path.join(this.cwd, l));
2005
1073
  });
2006
- });
2007
- };
1074
+ }
1075
+ this.project.packageJson.updateDepsFrom(locations);
1076
+ this._exit();
1077
+ }
2008
1078
  //#endregion
2009
1079
  //#region is terminal supported
2010
- BaseGlobalCommandLine.prototype.isTerminalSupported = function () {
2011
- console.log("Terminal is supported: ".concat(index_1.Helpers.isSupportedTaonTerminal));
1080
+ isTerminalSupported() {
1081
+ console.log(`Terminal is supported: ${index_1.Helpers.isSupportedTaonTerminal}`);
2012
1082
  this._exit();
2013
- };
1083
+ }
2014
1084
  //#endregion
2015
1085
  //#region prox ext
2016
- BaseGlobalCommandLine.prototype.INSTALL_PROJECT_EXTENSIONS = function () {
2017
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2018
- return tslib_1.__generator(this, function (_a) {
2019
- switch (_a.label) {
2020
- case 0: return [4 /*yield*/, this.INSTALL_PROJ_EXT()];
2021
- case 1:
2022
- _a.sent();
2023
- return [2 /*return*/];
2024
- }
2025
- });
2026
- });
2027
- };
2028
- BaseGlobalCommandLine.prototype.INSTALL_PROJECT_EXT = function () {
2029
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2030
- return tslib_1.__generator(this, function (_a) {
2031
- switch (_a.label) {
2032
- case 0: return [4 /*yield*/, this.INSTALL_PROJ_EXT()];
2033
- case 1:
2034
- _a.sent();
2035
- return [2 /*return*/];
2036
- }
2037
- });
2038
- });
2039
- };
2040
- BaseGlobalCommandLine.prototype.INS_PROJ_EXT = function () {
2041
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2042
- return tslib_1.__generator(this, function (_a) {
2043
- switch (_a.label) {
2044
- case 0: return [4 /*yield*/, this.INSTALL_PROJ_EXT()];
2045
- case 1:
2046
- _a.sent();
2047
- return [2 /*return*/];
2048
- }
2049
- });
2050
- });
2051
- };
2052
- BaseGlobalCommandLine.prototype.INSTALL_PROJ_EXT = function () {
2053
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2054
- var p, extensions;
2055
- return tslib_1.__generator(this, function (_a) {
2056
- switch (_a.label) {
2057
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
2058
- case 1:
2059
- if (!(_a.sent())) {
2060
- return [2 /*return*/];
2061
- }
2062
- this.project.vsCodeHelpers.recreateExtensions();
2063
- p = this.project.pathFor('.vscode/extensions.json');
2064
- extensions = index_1.Helpers.readJson(p, { recommendations: [] }, true);
2065
- index_1.Helpers.clearConsole();
2066
- return [4 /*yield*/, this.project.vsCodeHelpers.installExtensions(extensions.recommendations, true)];
2067
- case 2:
2068
- _a.sent();
2069
- this._exit();
2070
- return [2 /*return*/];
2071
- }
2072
- });
2073
- });
2074
- };
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
+ }
2075
1106
  //#endregion
2076
1107
  //#region proj db
2077
- BaseGlobalCommandLine.prototype.projdb = function () {
2078
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2079
- return tslib_1.__generator(this, function (_a) {
2080
- switch (_a.label) {
2081
- case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
2082
- case 1:
2083
- if (!(_a.sent())) {
2084
- return [2 /*return*/];
2085
- }
2086
- index_1.Helpers.info("Projects db location:\n ".concat(this.project.linkedProjects.projectsDbLocation, "\n\n opening in vscode...\n\n "));
2087
- index_1.Helpers.run("code ".concat(this.project.linkedProjects.projectsDbLocation)).sync();
2088
- this._exit();
2089
- return [2 /*return*/];
2090
- }
2091
- });
2092
- });
2093
- };
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
+ }
2094
1121
  //#endregion
2095
1122
  //#region filter all project branches by pattern
2096
- BaseGlobalCommandLine.prototype.__filterBranchesByPattern = function (branchPatternOrBranchName) {
2097
- 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) ||
2098
1125
  this.project.getMainBranches());
2099
1126
  // console.log('branches', branches);
2100
1127
  return branches;
2101
- };
1128
+ }
2102
1129
  //#endregion
2103
1130
  //#region select branch from list of branches
2104
- BaseGlobalCommandLine.prototype.__selectBrach = function (branches, task) {
2105
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2106
- var childrenMsg;
2107
- return tslib_1.__generator(this, function (_a) {
2108
- switch (_a.label) {
2109
- case 0:
2110
- childrenMsg = this.project.children.length == 0
2111
- ? '(no children in project)'
2112
- : '(with children)';
2113
- return [4 /*yield*/, index_1.Helpers.autocompleteAsk("Choose branch to ".concat(task, " in this project ").concat(childrenMsg, ": "), branches.map(function (b) {
2114
- return { name: b, value: b };
2115
- }))];
2116
- case 1: return [2 /*return*/, _a.sent()];
2117
- }
2118
- });
2119
- });
2120
- };
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
+ }
2121
1142
  //#endregion
2122
1143
  //#region commands / clone
2123
- BaseGlobalCommandLine.prototype.clone = function () {
2124
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2125
- var url, originType;
2126
- return tslib_1.__generator(this, function (_a) {
2127
- url = this.firstArg;
2128
- originType = this.params['setOrigin'];
2129
- if (originType) {
2130
- if (originType === 'ssh') {
2131
- url = index_1.Helpers.git.originHttpToSsh(url);
2132
- }
2133
- if (originType === 'http') {
2134
- url = index_1.Helpers.git.originSshToHttp(url);
2135
- }
2136
- }
2137
- index_1.Helpers.git.clone({
2138
- url: url,
2139
- cwd: this.cwd,
2140
- });
2141
- this._exit();
2142
- return [2 /*return*/];
2143
- });
2144
- });
2145
- };
2146
- //#endregion
2147
- //#region commands / ghtemp
2148
- BaseGlobalCommandLine.prototype.ghSave = function () {
2149
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2150
- return tslib_1.__generator(this, function (_a) {
2151
- switch (_a.label) {
2152
- case 0: return [4 /*yield*/, new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().save()];
2153
- case 1:
2154
- _a.sent();
2155
- this._exit();
2156
- return [2 /*return*/];
2157
- }
2158
- });
2159
- });
2160
- };
2161
- BaseGlobalCommandLine.prototype.ghRestore = function () {
2162
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2163
- return tslib_1.__generator(this, function (_a) {
2164
- switch (_a.label) {
2165
- case 0: return [4 /*yield*/, new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().restore()];
2166
- case 1:
2167
- _a.sent();
2168
- this._exit();
2169
- return [2 /*return*/];
2170
- }
2171
- });
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,
2172
1158
  });
2173
- };
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
+ }
2174
1171
  //#endregion
2175
1172
  //#region commands / start cli service ports worker
2176
- BaseGlobalCommandLine.prototype.ports = function () {
2177
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2178
- return tslib_1.__generator(this, function (_a) {
2179
- switch (_a.label) {
2180
- case 0: return [4 /*yield*/, this.ins.portsWorker.infoScreen()];
2181
- case 1:
2182
- _a.sent();
2183
- return [2 /*return*/];
2184
- }
2185
- });
2186
- });
2187
- };
1173
+ async ports() {
1174
+ await this.ins.portsWorker.infoScreen();
1175
+ }
2188
1176
  /**
2189
1177
  * tnp startCliServicePortsWorker --restart
2190
1178
  */
2191
- BaseGlobalCommandLine.prototype.startCliServicePortsWorker = function () {
2192
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2193
- return tslib_1.__generator(this, function (_a) {
2194
- switch (_a.label) {
2195
- case 0: return [4 /*yield*/, this.ins.portsWorker.cliStartProcedure(this.params)];
2196
- case 1:
2197
- _a.sent();
2198
- return [2 /*return*/];
2199
- }
2200
- });
2201
- });
2202
- };
1179
+ async startCliServicePortsWorker() {
1180
+ await this.ins.portsWorker.cliStartProcedure(this.params);
1181
+ }
2203
1182
  //#endregion
2204
1183
  //#region commands / pause terminal
2205
- BaseGlobalCommandLine.prototype.pauseTerminal = function () {
1184
+ pauseTerminal() {
2206
1185
  index_1.Helpers.pressKeyAndContinue();
2207
1186
  this._exit();
2208
- };
1187
+ }
2209
1188
  //#endregion
2210
1189
  //#region commands / gh pages init
2211
- BaseGlobalCommandLine.prototype.ghPagesInit = function () {
2212
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2213
- return tslib_1.__generator(this, function (_a) {
2214
- switch (_a.label) {
2215
- case 0: return [4 /*yield*/, this.project.init()];
2216
- case 1:
2217
- _a.sent();
2218
- return [4 /*yield*/, this.project.githubPages.init(this.params['provider'] || 'github', !!this.params['full'])];
2219
- case 2:
2220
- _a.sent();
2221
- index_1.Helpers.run('code .', {
2222
- cwd: this.project.githubPages.mainFolderAbsPath,
2223
- }).sync();
2224
- this._exit();
2225
- return [2 /*return*/];
2226
- }
2227
- });
2228
- });
2229
- };
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
+ }
2230
1198
  //#endregion
2231
1199
  //#region commands / is port in use
2232
- BaseGlobalCommandLine.prototype.isPortInUse = function () {
2233
- return tslib_1.__awaiter(this, void 0, void 0, function () {
2234
- var port, _a, _b, _c, _d;
2235
- return tslib_1.__generator(this, function (_e) {
2236
- switch (_e.label) {
2237
- case 0:
2238
- port = parseInt(this.firstArg);
2239
- _b = (_a = console).log;
2240
- _d = (_c = "Port ".concat(port, " is in use: ")).concat;
2241
- return [4 /*yield*/, tnp_core_1.UtilsOs.isPortInUse(port)];
2242
- case 1:
2243
- _b.apply(_a, [_d.apply(_c, [_e.sent()])]);
2244
- this._exit();
2245
- return [2 /*return*/];
2246
- }
2247
- });
2248
- });
2249
- };
2250
- return BaseGlobalCommandLine;
2251
- }(base_command_line_feature_backend_1.BaseCommandLineFeature));
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
+ }
2252
1286
  exports.BaseGlobalCommandLine = BaseGlobalCommandLine;
2253
1287
  //# sourceMappingURL=base-global-command-line.backend.js.map