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,43 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseLibraryBuild = exports.ChildProcess = void 0;
4
- var tslib_1 = require("tslib");
3
+ exports.BaseLibraryBuild = void 0;
5
4
  //#region import
6
- //#region @backend
7
- var tnp_core_1 = require("tnp-core");
8
- var child_process_1 = require("child_process");
9
- Object.defineProperty(exports, "ChildProcess", { enumerable: true, get: function () { return child_process_1.ChildProcess; } });
10
- var tnp_core_2 = require("tnp-core");
11
- var tnp_config_1 = require("tnp-config");
12
- var tnp_core_3 = require("tnp-core");
13
- var base_feature_for_project_1 = require("./base-feature-for-project");
14
- var index_1 = require("../../index");
5
+ const tnp_config_1 = 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 base_feature_for_project_1 = require("./base-feature-for-project");
15
11
  //#endregion
16
12
  /**
17
13
  * Base library build for standard angular/typescript projects
18
14
  */
19
- var BaseLibraryBuild = /** @class */ (function (_super) {
20
- tslib_1.__extends(BaseLibraryBuild, _super);
21
- function BaseLibraryBuild() {
22
- var _this = _super.apply(this, tslib_1.__spreadArray([], tslib_1.__read(arguments), false)) || this;
23
- _this.cache = {};
24
- _this.tempOrgTsConfigFile = "tmp-original-".concat(tnp_config_1.config.file.tsconfig_json);
25
- return _this;
26
- //#endregion
27
- }
15
+ class BaseLibraryBuild extends base_feature_for_project_1.BaseFeatureForProject {
16
+ cache = {};
17
+ tempOrgTsConfigFile = `tmp-original-${tnp_config_1.config.file.tsconfig_json}`;
28
18
  //#region getters & methods / sort by deps
29
- BaseLibraryBuild.prototype.sortByDeps = function (libraries) {
19
+ sortByDeps(libraries) {
30
20
  //#region @backendFunc
31
- var libs = libraries;
32
- var sorted = this.project.ins.sortGroupOfProject(libs, function (proj) {
21
+ const libs = libraries;
22
+ const sorted = this.project.ins.sortGroupOfProject(libs, proj => {
33
23
  // resolve dependencies names
34
24
  if (!tnp_core_3._.isUndefined(proj.cache['deps'])) {
35
25
  return proj.cache['deps'];
36
26
  }
37
- var allLibs = Object.keys(proj.npmHelpers.allDependencies);
38
- proj.cache['deps'] = allLibs.filter(function (f) { return !tnp_core_3._.isUndefined(libs.find(function (c) { return c.name === f; })); });
27
+ const allLibs = Object.keys(proj.packageJson.allDependencies);
28
+ proj.cache['deps'] = allLibs.filter(f => !tnp_core_3._.isUndefined(libs.find(c => c.name === f)));
39
29
  return proj.cache['deps'];
40
- }, function (proj) {
30
+ }, proj => {
41
31
  // resolve name to compare
42
32
  if (!tnp_core_3._.isUndefined(proj.cache['nameToCompare'])) {
43
33
  return proj.cache['nameToCompare'];
@@ -47,7 +37,7 @@ var BaseLibraryBuild = /** @class */ (function (_super) {
47
37
  });
48
38
  return sorted;
49
39
  //#endregion
50
- };
40
+ }
51
41
  //#endregion
52
42
  //#region getters & methods / get sorted libraries by deps for build\
53
43
  /**
@@ -61,674 +51,462 @@ var BaseLibraryBuild = /** @class */ (function (_super) {
61
51
  * 5. build selected libraries in watch mode
62
52
  * (skip normal build for not selected libraries)
63
53
  */
64
- BaseLibraryBuild.prototype.selectAndSaveLibraries = function (_a) {
65
- return tslib_1.__awaiter(this, arguments, void 0, function (
66
- // this: {},
67
- _b) {
68
- var buildAll, skipRebuildingAllForWatch, lastSelected, selected, _c, _d, defaultSelected, pickedLibs, selected;
69
- var _e;
70
- var selectedLibs = _b.selectedLibs, watch = _b.watch, watchBuildSupported = _b.watchBuildSupported, skipAllLibsQuestion = _b.skipAllLibsQuestion, useLastUserConfiguration = _b.useLastUserConfiguration;
71
- return tslib_1.__generator(this, function (_f) {
72
- switch (_f.label) {
73
- case 0:
74
- buildAll = false;
75
- skipRebuildingAllForWatch = false;
76
- if (selectedLibs.length <= 1) {
77
- return [2 /*return*/, { selectedLibs: selectedLibs, skipRebuildingAllForWatch: skipRebuildingAllForWatch }];
78
- }
79
- if (tnp_core_3._.isUndefined(watchBuildSupported)) {
80
- watchBuildSupported = true;
81
- }
82
- lastSelected = ((_e = index_1.Helpers.readJson(this.project.pathFor(tnp_config_1.FilesNames.tmpLastSelectedJsonFile))) === null || _e === void 0 ? void 0 : _e.lastSelected) || [];
83
- if (!(tnp_core_3._.isArray(lastSelected) && lastSelected.length > 0)) return [3 /*break*/, 8];
84
- selected = lastSelected
85
- .map(function (c) { return selectedLibs.find(function (l) { return l.name == c; }); })
86
- .filter(function (c) { return !!c; });
87
- index_1.Helpers.info("\nLast selected libs\n\n".concat(selected.map(function (c, i) { return "".concat(i + 1, ". ").concat(c.basename, " ").concat(tnp_core_1.chalk.bold(c.name)); }).join('\n'), "\n\n "));
88
- if (!useLastUserConfiguration) return [3 /*break*/, 1];
89
- _c = true;
90
- return [3 /*break*/, 3];
91
- case 1: return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo("Continue ".concat(watch ? 'watch' : '', " build with last selected ?"))];
92
- case 2:
93
- _c = _f.sent();
94
- _f.label = 3;
95
- case 3:
96
- if (!_c) return [3 /*break*/, 8];
97
- selectedLibs = selected;
98
- if (!((watchBuildSupported && watch) || useLastUserConfiguration)) return [3 /*break*/, 7];
99
- if (!this.project.hasFolder(tnp_config_1.config.folder.dist)) return [3 /*break*/, 6];
100
- _d = useLastUserConfiguration;
101
- if (_d) return [3 /*break*/, 5];
102
- return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo("Skip rebuilding all libraries for watch mode ?")];
103
- case 4:
104
- _d = (_f.sent());
105
- _f.label = 5;
106
- case 5:
107
- skipRebuildingAllForWatch = _d;
108
- return [3 /*break*/, 7];
109
- case 6:
54
+ async selectAndSaveLibraries(
55
+ // this: {},
56
+ { selectedLibs, watch, watchBuildSupported, skipAllLibsQuestion, useLastUserConfiguration, }) {
57
+ //#region @backendFunc
58
+ let buildAll = false;
59
+ let skipRebuildingAllForWatch = false;
60
+ if (selectedLibs.length <= 1) {
61
+ return { selectedLibs, skipRebuildingAllForWatch };
62
+ }
63
+ if (tnp_core_3._.isUndefined(watchBuildSupported)) {
64
+ watchBuildSupported = true;
65
+ }
66
+ const lastSelected = index_1.Helpers.readJson(this.project.pathFor(tnp_config_1.FilesNames.tmpLastSelectedJsonFile))
67
+ ?.lastSelected || [];
68
+ if (tnp_core_3._.isArray(lastSelected) && lastSelected.length > 0) {
69
+ const selected = lastSelected
70
+ .map(c => selectedLibs.find(l => l.name == c))
71
+ .filter(c => !!c);
72
+ index_1.Helpers.info(`
73
+ Last selected libs
74
+
75
+ ${selected.map((c, i) => `${i + 1}. ${c.basename} ${tnp_core_1.chalk.bold(c.name)}`).join('\n')}
76
+
77
+ `);
78
+ if (useLastUserConfiguration
79
+ ? true
80
+ : await index_1.Helpers.consoleGui.question.yesNo(`Continue${watch ? ' watch ' : ' '}build with last selected ?`)) {
81
+ selectedLibs = selected;
82
+ // TODO maybe safe about skip
83
+ if ((watchBuildSupported && watch) || useLastUserConfiguration) {
84
+ // if(this.project)
85
+ if (this.project.hasFolder(tnp_config_1.config.folder.dist)) {
86
+ skipRebuildingAllForWatch =
87
+ useLastUserConfiguration ||
88
+ (await index_1.Helpers.consoleGui.question.yesNo(`Skip rebuilding all libraries for watch mode ?`));
89
+ }
90
+ else {
110
91
  // no dist -> rebuild all
111
92
  skipRebuildingAllForWatch = false;
112
- _f.label = 7;
113
- case 7: return [2 /*return*/, { selectedLibs: selectedLibs, skipRebuildingAllForWatch: skipRebuildingAllForWatch }];
114
- case 8:
115
- if (!(!watch || (watch && selectedLibs.length < 6))) return [3 /*break*/, 10];
116
- if (!!skipAllLibsQuestion) return [3 /*break*/, 10];
117
- return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo("Should all libraries be included in".concat(watch ? ' watch' : ' ', "build ?"))];
118
- case 9:
119
- buildAll = _f.sent();
120
- _f.label = 10;
121
- case 10:
122
- if (buildAll) {
123
- return [2 /*return*/, { selectedLibs: selectedLibs, skipRebuildingAllForWatch: skipRebuildingAllForWatch }];
124
- }
125
- _f.label = 11;
126
- case 11:
127
- if (!true) return [3 /*break*/, 14];
128
- defaultSelected = lastSelected
129
- .map(function (c) { return selectedLibs.find(function (l) { return l.name == c; }); })
130
- .filter(function (c) { return !!c; })
131
- .map(function (c) { return c.name; });
132
- return [4 /*yield*/, tnp_core_3.UtilsTerminal.multiselect({
133
- question: "Select libraries to ".concat(watch ? 'watch' : '', " build "),
134
- choices: selectedLibs.map(function (c) {
135
- return { name: c.name, value: c.name, selected: true };
136
- }),
137
- defaultSelected: defaultSelected,
138
- })];
139
- case 12:
140
- pickedLibs = (_f.sent()).map(function (c) { return selectedLibs.find(function (l) { return l.name == c; }); });
141
- selected = pickedLibs.filter(function (c) {
142
- // if (!!c) { // TODO QUICK_FIX
143
- // this.project.removeFile(lastSelectedJsonFile);
144
- // Helpers.warn(`Please restart this command`);
145
- // process.exit(0);
146
- // }
147
- return !!c;
148
- });
149
- index_1.Helpers.info("\n\n".concat(selected.map(function (c, i) { return "".concat(i + 1, ". ").concat(c.basename, " ").concat(tnp_core_1.chalk.bold(c.name)); }).join('\n'), "\n\n "));
150
- return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo("Continue build with ".concat(selected.length, " selected ?"))];
151
- case 13:
152
- if (_f.sent()) {
153
- selectedLibs = selected;
154
- return [3 /*break*/, 14];
155
- }
156
- return [3 /*break*/, 11];
157
- case 14:
158
- index_1.Helpers.writeJson(this.project.pathFor(tnp_config_1.FilesNames.tmpLastSelectedJsonFile), {
159
- lastSelected: selectedLibs.map(function (c) { return c.name; }),
160
- });
161
- return [2 /*return*/, { selectedLibs: selectedLibs, skipRebuildingAllForWatch: skipRebuildingAllForWatch }];
93
+ }
162
94
  }
95
+ return { selectedLibs, skipRebuildingAllForWatch };
96
+ }
97
+ }
98
+ // more than 6 libs can be hard to manage in watch mode
99
+ if (!watch || (watch && selectedLibs.length < 6)) {
100
+ if (!skipAllLibsQuestion) {
101
+ buildAll = await index_1.Helpers.consoleGui.question.yesNo(`Should all libraries be included in${watch ? ' watch' : ' '}build ?`);
102
+ }
103
+ }
104
+ if (buildAll) {
105
+ return { selectedLibs, skipRebuildingAllForWatch };
106
+ }
107
+ while (true) {
108
+ const defaultSelected = lastSelected
109
+ .map(c => selectedLibs.find(l => l.name == c))
110
+ .filter(c => !!c)
111
+ .map(c => c.name);
112
+ const pickedLibs = (await tnp_core_3.UtilsTerminal.multiselect({
113
+ question: `Select libraries to ${watch ? 'watch' : ''} build `,
114
+ choices: selectedLibs.map(c => {
115
+ return { name: c.name, value: c.name, selected: true };
116
+ }),
117
+ defaultSelected,
118
+ })).map(c => selectedLibs.find(l => l.name == c));
119
+ // console.log({ pickedLibs });
120
+ const selected = pickedLibs.filter(c => {
121
+ // if (!!c) { // TODO QUICK_FIX
122
+ // this.project.removeFile(lastSelectedJsonFile);
123
+ // Helpers.warn(`Please restart this command`);
124
+ // process.exit(0);
125
+ // }
126
+ return !!c;
163
127
  });
128
+ index_1.Helpers.info(`
129
+
130
+ ${selected.map((c, i) => `${i + 1}. ${c.basename} ${tnp_core_1.chalk.bold(c.name)}`).join('\n')}
131
+
132
+ `);
133
+ if (await index_1.Helpers.consoleGui.question.yesNo(`Continue build with ${selected.length} selected ?`)) {
134
+ selectedLibs = selected;
135
+ break;
136
+ }
137
+ }
138
+ index_1.Helpers.writeJson(this.project.pathFor(tnp_config_1.FilesNames.tmpLastSelectedJsonFile), {
139
+ lastSelected: selectedLibs.map(c => c.name),
164
140
  });
165
- };
166
- Object.defineProperty(BaseLibraryBuild.prototype, "libraries", {
141
+ return { selectedLibs, skipRebuildingAllForWatch };
167
142
  //#endregion
168
- //#region getters & methods / angular libraries
169
- /**
170
- * angular libraries from angular.json
171
- */
172
- get: function () {
173
- //#region @backendFunc
174
- if (!tnp_core_3._.isUndefined(this.cache['libraries'])) {
175
- return this.cache['libraries'];
176
- }
177
- var libraries = this.getLibraries();
178
- this.cache['libraries'] = libraries;
179
- return libraries;
180
- //#endregion
181
- },
182
- enumerable: false,
183
- configurable: true
184
- });
185
- BaseLibraryBuild.prototype.getLibraries = function () {
186
- var _this = this;
187
- var _a;
143
+ }
144
+ //#endregion
145
+ //#region getters & methods / angular libraries
146
+ /**
147
+ * angular libraries from angular.json
148
+ */
149
+ get libraries() {
188
150
  //#region @backendFunc
189
- var projects = Object.values(((_a = index_1.Helpers.readJson(this.project.pathFor(tnp_config_1.config.file.angular_json))) === null || _a === void 0 ? void 0 : _a.projects) || {}).filter(function (f) { return f.projectType === 'library'; });
190
- var libraries = projects.map(function (c) {
191
- return _this.project.ins.From(tnp_core_2.path.join(_this.project.location, c.root));
192
- });
151
+ if (!tnp_core_3._.isUndefined(this.cache['libraries'])) {
152
+ return this.cache['libraries'];
153
+ }
154
+ const libraries = this.getLibraries();
155
+ this.cache['libraries'] = libraries;
156
+ return libraries;
157
+ //#endregion
158
+ }
159
+ getLibraries() {
160
+ //#region @backendFunc
161
+ const projects = Object.values(index_1.Helpers.readJson(this.project.pathFor(tnp_config_1.config.file.angular_json))
162
+ ?.projects || {}).filter(f => f.projectType === 'library');
163
+ let libraries = projects.map(c => this.project.ins.From(tnp_core_2.path.join(this.project.location, c.root)));
193
164
  libraries = this.sortByDeps(libraries);
194
165
  return libraries;
195
166
  //#endregion
196
- };
167
+ }
197
168
  //#endregion
198
169
  //#region getters & methods / build libraries
199
170
  /**
200
171
  * Angular library build
201
172
  */
202
- BaseLibraryBuild.prototype.buildLibraries = function () {
203
- return tslib_1.__awaiter(this, arguments, void 0, function (
204
- // this:{},
205
- _a) {
206
- var useExternalProvidedLibs, allLibs, locationsForNodeModules, _b, selectedLibs, skipRebuildingAllForWatch, allParenProjsForExtenalLibsBuild, allParenProjsForExtenalLibsBuild_1, allParenProjsForExtenalLibsBuild_1_1, libProj, _c, _d, _e, index, lib, e_1_1, e_2_1, _f, _g, _h, index, lib, e_3_1;
207
- var e_2, _j, e_1, _k, e_3, _l;
208
- var
209
- // this:{},
210
- _m = _a === void 0 ? {} : _a, _o = _m.watch, watch = _o === void 0 ? false : _o, strategy = _m.strategy, _p = _m.releaseBuild, releaseBuild = _p === void 0 ? false : _p, copylink_to_node_modules = _m.copylink_to_node_modules, outputLineReplace = _m.outputLineReplace, libraries = _m.libraries, useLastUserConfiguration = _m.useLastUserConfiguration;
211
- return tslib_1.__generator(this, function (_q) {
212
- switch (_q.label) {
213
- case 0:
214
- //#region @backend
215
- return [4 /*yield*/, this.project.linkedProjects.saveAllLinkedProjectsToDB()];
216
- case 1:
217
- //#region @backend
218
- _q.sent();
219
- return [4 /*yield*/, this.changeTsConfigForLibrariesTypes()];
220
- case 2:
221
- _q.sent();
222
- //#region prepare parameters
223
- if (!Array.isArray(copylink_to_node_modules)) {
224
- copylink_to_node_modules = [];
225
- }
226
- if (!strategy) {
227
- strategy = 'link';
228
- }
229
- useExternalProvidedLibs = !tnp_core_3._.isNil(libraries);
230
- allLibs = useExternalProvidedLibs ? libraries : this.libraries;
231
- locationsForNodeModules = releaseBuild
232
- ? []
233
- : tslib_1.__spreadArray(tslib_1.__spreadArray([
234
- this.project.pathFor(tnp_config_1.config.folder.node_modules)
235
- ], tslib_1.__read(copylink_to_node_modules), false), tslib_1.__read((!useExternalProvidedLibs
236
- ? []
237
- : index_1.Helpers.uniqArray(libraries.map(function (c) {
238
- return c.parent.pathFor(tnp_config_1.config.folder.node_modules);
239
- })))), false);
240
- return [4 /*yield*/, this.selectAndSaveLibraries({
241
- selectedLibs: libraries ? libraries : allLibs,
242
- watch: watch,
243
- skipAllLibsQuestion: useExternalProvidedLibs,
244
- useLastUserConfiguration: useLastUserConfiguration,
245
- })];
246
- case 3:
247
- _b = _q.sent(), selectedLibs = _b.selectedLibs, skipRebuildingAllForWatch = _b.skipRebuildingAllForWatch;
248
- allParenProjsForExtenalLibsBuild = useExternalProvidedLibs
249
- ? index_1.Helpers.uniqArray(libraries.map(function (c) { return c.parent; }), 'location')
250
- : [this.project];
251
- _q.label = 4;
252
- case 4:
253
- _q.trys.push([4, 16, 17, 18]);
254
- allParenProjsForExtenalLibsBuild_1 = tslib_1.__values(allParenProjsForExtenalLibsBuild), allParenProjsForExtenalLibsBuild_1_1 = allParenProjsForExtenalLibsBuild_1.next();
255
- _q.label = 5;
256
- case 5:
257
- if (!!allParenProjsForExtenalLibsBuild_1_1.done) return [3 /*break*/, 15];
258
- libProj = allParenProjsForExtenalLibsBuild_1_1.value;
259
- return [4 /*yield*/, libProj.init()];
260
- case 6:
261
- _q.sent();
262
- _q.label = 7;
263
- case 7:
264
- _q.trys.push([7, 12, 13, 14]);
265
- _c = (e_1 = void 0, tslib_1.__values(libProj.libraryBuild.libraries.entries())), _d = _c.next();
266
- _q.label = 8;
267
- case 8:
268
- if (!!_d.done) return [3 /*break*/, 11];
269
- _e = tslib_1.__read(_d.value, 2), index = _e[0], lib = _e[1];
270
- if (watch && skipRebuildingAllForWatch) {
271
- index_1.Helpers.info("Skipping build for watch mode (".concat(index + 1, "/").concat(allLibs.length, ")") +
272
- " ".concat(lib.basename, " (").concat(tnp_core_1.chalk.bold(lib.name), ")"));
273
- return [3 /*break*/, 10];
274
- }
275
- index_1.Helpers.info("Building (".concat(index + 1, "/").concat(allLibs.length, ") ").concat(lib.basename) +
276
- " (".concat(tnp_core_1.chalk.bold(lib.name), ")"));
277
- return [4 /*yield*/, libProj.libraryBuild.libNormalBuildProcess({
278
- lib: lib,
279
- locationsForNodeModules: useExternalProvidedLibs
280
- ? [
281
- this.project.pathFor(tnp_config_1.config.folder.node_modules),
282
- libProj.pathFor(tnp_config_1.config.folder.node_modules),
283
- ]
284
- : locationsForNodeModules,
285
- strategy: strategy,
286
- outputLineReplace: outputLineReplace &&
287
- outputLineReplace(lib, useExternalProvidedLibs),
288
- })];
289
- case 9:
290
- _q.sent();
291
- _q.label = 10;
292
- case 10:
293
- _d = _c.next();
294
- return [3 /*break*/, 8];
295
- case 11: return [3 /*break*/, 14];
296
- case 12:
297
- e_1_1 = _q.sent();
298
- e_1 = { error: e_1_1 };
299
- return [3 /*break*/, 14];
300
- case 13:
301
- try {
302
- if (_d && !_d.done && (_k = _c.return)) _k.call(_c);
303
- }
304
- finally { if (e_1) throw e_1.error; }
305
- return [7 /*endfinally*/];
306
- case 14:
307
- allParenProjsForExtenalLibsBuild_1_1 = allParenProjsForExtenalLibsBuild_1.next();
308
- return [3 /*break*/, 5];
309
- case 15: return [3 /*break*/, 18];
310
- case 16:
311
- e_2_1 = _q.sent();
312
- e_2 = { error: e_2_1 };
313
- return [3 /*break*/, 18];
314
- case 17:
315
- try {
316
- if (allParenProjsForExtenalLibsBuild_1_1 && !allParenProjsForExtenalLibsBuild_1_1.done && (_j = allParenProjsForExtenalLibsBuild_1.return)) _j.call(allParenProjsForExtenalLibsBuild_1);
317
- }
318
- finally { if (e_2) throw e_2.error; }
319
- return [7 /*endfinally*/];
320
- case 18:
321
- _q.trys.push([18, 23, 24, 25]);
322
- _f = tslib_1.__values(selectedLibs.entries()), _g = _f.next();
323
- _q.label = 19;
324
- case 19:
325
- if (!!_g.done) return [3 /*break*/, 22];
326
- _h = tslib_1.__read(_g.value, 2), index = _h[0], lib = _h[1];
327
- index_1.Helpers.info("Building for watch (".concat(index + 1, "/").concat(selectedLibs.length, ") ") +
328
- "".concat(lib.basename, " (").concat(tnp_core_1.chalk.bold(lib.name), ")"));
329
- return [4 /*yield*/, this.libWatchBuildProcess({
330
- lib: lib,
331
- locationsForNodeModules: locationsForNodeModules,
332
- strategy: strategy,
333
- outputLineReplace: outputLineReplace && outputLineReplace(lib, useExternalProvidedLibs),
334
- })];
335
- case 20:
336
- _q.sent();
337
- _q.label = 21;
338
- case 21:
339
- _g = _f.next();
340
- return [3 /*break*/, 19];
341
- case 22: return [3 /*break*/, 25];
342
- case 23:
343
- e_3_1 = _q.sent();
344
- e_3 = { error: e_3_1 };
345
- return [3 /*break*/, 25];
346
- case 24:
347
- try {
348
- if (_g && !_g.done && (_l = _f.return)) _l.call(_f);
349
- }
350
- finally { if (e_3) throw e_3.error; }
351
- return [7 /*endfinally*/];
352
- case 25:
353
- //#endregion
354
- //#region success message
355
- if (watch) {
356
- index_1.Helpers.success('BUILD DONE.. watching..');
357
- }
358
- else {
359
- // await this.__indexRebuilder.start({ taskName: 'index rebuild watch' });
360
- index_1.Helpers.success('BUILD DONE');
361
- }
362
- return [2 /*return*/];
363
- }
364
- });
173
+ async buildLibraries(
174
+ // this:{},
175
+ { watch = false, strategy, releaseBuild = false, copylink_to_node_modules, outputLineReplace, libraries, useLastUserConfiguration, } = {}) {
176
+ //#region @backend
177
+ await this.project.linkedProjects.saveAllLinkedProjectsToDB();
178
+ await this.changeTsConfigForLibrariesTypes();
179
+ //#region prepare parameters
180
+ if (!Array.isArray(copylink_to_node_modules)) {
181
+ copylink_to_node_modules = [];
182
+ }
183
+ if (!strategy) {
184
+ strategy = 'link';
185
+ }
186
+ //#endregion
187
+ //#region select target node_modules
188
+ const useExternalProvidedLibs = !tnp_core_3._.isNil(libraries);
189
+ const allLibs = useExternalProvidedLibs ? libraries : this.libraries;
190
+ const locationsForNodeModules = releaseBuild
191
+ ? []
192
+ : [
193
+ this.project.pathFor(tnp_config_1.config.folder.node_modules),
194
+ ...copylink_to_node_modules,
195
+ ...(!useExternalProvidedLibs
196
+ ? []
197
+ : index_1.Helpers.uniqArray(libraries.map(c => c.parent.pathFor(tnp_config_1.config.folder.node_modules)))),
198
+ ];
199
+ //#endregion
200
+ //#region select libs to build
201
+ let { selectedLibs, skipRebuildingAllForWatch } = await this.selectAndSaveLibraries({
202
+ selectedLibs: libraries ? libraries : allLibs,
203
+ watch,
204
+ skipAllLibsQuestion: useExternalProvidedLibs,
205
+ useLastUserConfiguration,
365
206
  });
366
- };
207
+ //#endregion
208
+ //#region normal build
209
+ const allParenProjsForExtenalLibsBuild = useExternalProvidedLibs
210
+ ? index_1.Helpers.uniqArray(libraries.map(c => c.parent), 'location')
211
+ : [this.project];
212
+ // console.log(
213
+ // 'SORTED PROJECTS',
214
+ // additionalLibsProjs.map(c => c.name),
215
+ // );
216
+ selectedLibs = this.sortByDeps(selectedLibs);
217
+ // TODO sort additionalLibsProjs thing before ric
218
+ for (const libProj of allParenProjsForExtenalLibsBuild) {
219
+ await libProj.init();
220
+ for (const [index, lib] of libProj.libraryBuild.libraries.entries()) {
221
+ if (watch && skipRebuildingAllForWatch) {
222
+ const selectedNames = selectedLibs.map(c => c.name);
223
+ if (!selectedNames.includes(lib.name)) {
224
+ index_1.Helpers.info(`Skipping build for watch mode (${index + 1}/${allLibs.length})` +
225
+ ` ${lib.basename} (${tnp_core_1.chalk.bold(lib.name)})`);
226
+ }
227
+ continue;
228
+ }
229
+ index_1.Helpers.info(`Building (${index + 1}/${allLibs.length}) ${lib.basename}` +
230
+ ` (${tnp_core_1.chalk.bold(lib.name)})`);
231
+ await libProj.libraryBuild.libNormalBuildProcess({
232
+ lib,
233
+ locationsForNodeModules: useExternalProvidedLibs
234
+ ? [
235
+ this.project.pathFor(tnp_config_1.config.folder.node_modules),
236
+ libProj.pathFor(tnp_config_1.config.folder.node_modules),
237
+ ]
238
+ : locationsForNodeModules,
239
+ strategy,
240
+ outputLineReplace: outputLineReplace &&
241
+ outputLineReplace(lib, useExternalProvidedLibs),
242
+ });
243
+ }
244
+ }
245
+ //#endregion
246
+ //#region watch build
247
+ if (watch) {
248
+ for (const [index, lib] of selectedLibs.entries()) {
249
+ index_1.Helpers.info(`Building for watch (${index + 1}/${selectedLibs.length}) ` +
250
+ `${lib.basename} (${tnp_core_1.chalk.bold(lib.name)})`);
251
+ await this.libWatchBuildProcess({
252
+ lib,
253
+ locationsForNodeModules,
254
+ strategy,
255
+ outputLineReplace: outputLineReplace &&
256
+ outputLineReplace(lib, useExternalProvidedLibs),
257
+ });
258
+ }
259
+ }
260
+ //#endregion
261
+ //#region success message
262
+ if (watch) {
263
+ index_1.Helpers.success('BUILD DONE.. watching..');
264
+ }
265
+ else {
266
+ // await this.__indexRebuilder.start({ taskName: 'index rebuild watch' });
267
+ index_1.Helpers.success('BUILD DONE');
268
+ }
269
+ //#endregion
270
+ //#endregion
271
+ }
367
272
  //#endregion
368
273
  //#region getters & methods / lib watch build process
369
- BaseLibraryBuild.prototype.libWatchBuildProcess = function (_a) {
370
- return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
371
- var debouncedBuild;
372
- var lib = _b.lib, locationsForNodeModules = _b.locationsForNodeModules, strategy = _b.strategy, outputLineReplace = _b.outputLineReplace;
373
- return tslib_1.__generator(this, function (_c) {
374
- switch (_c.label) {
375
- case 0:
376
- debouncedBuild = tnp_core_3._.debounce(function () {
377
- var e_4, _a;
378
- var sourceDist = lib.nearestParent.pathFor([
379
- tnp_config_1.config.folder.dist,
380
- lib.basename,
381
- ]);
382
- try {
383
- for (var locationsForNodeModules_1 = tslib_1.__values(locationsForNodeModules), locationsForNodeModules_1_1 = locationsForNodeModules_1.next(); !locationsForNodeModules_1_1.done; locationsForNodeModules_1_1 = locationsForNodeModules_1.next()) {
384
- var node_modules = locationsForNodeModules_1_1.value;
385
- var dest = (0, tnp_core_2.crossPlatformPath)([node_modules, lib.name]);
386
- if (index_1.Helpers.isSymlinkFileExitedOrUnexisted(dest)) {
387
- index_1.Helpers.remove(dest);
388
- }
389
- index_1.Helpers.copy(sourceDist, dest, {
390
- recursive: true,
391
- overwrite: true,
392
- });
393
- console.log("Sync (watch|copy) done for ".concat(lib.basename, " to ").concat(lib.name, " (").concat((0, tnp_core_2.crossPlatformPath)([
394
- tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules)),
395
- tnp_config_1.config.folder.node_modules,
396
- ]), ")"));
397
- }
398
- }
399
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
400
- finally {
401
- try {
402
- if (locationsForNodeModules_1_1 && !locationsForNodeModules_1_1.done && (_a = locationsForNodeModules_1.return)) _a.call(locationsForNodeModules_1);
403
- }
404
- finally { if (e_4) throw e_4.error; }
405
- }
406
- }, 500);
407
- //#endregion
408
- //#region watch build process
409
- return [4 /*yield*/, lib.nearestParent.execute(lib.libraryBuild.getLibraryBuildComamnd({
410
- watch: true,
411
- }), {
412
- outputLineReplace: outputLineReplace,
413
- resolvePromiseMsg: {
414
- stdout: lib.libraryBuild.getLibraryBuildSuccessComamnds,
415
- },
416
- resolvePromiseMsgCallback: {
417
- stdout: function () {
418
- if (strategy === 'copy') {
419
- debouncedBuild();
420
- }
421
- },
422
- },
423
- })];
424
- case 1:
425
- //#endregion
426
- //#region watch build process
427
- _c.sent();
428
- return [2 /*return*/];
274
+ async libWatchBuildProcess({ lib, locationsForNodeModules, strategy, outputLineReplace, }) {
275
+ //#region @backendFunc
276
+ //#region debouce copy/link
277
+ const debouncedBuild = tnp_core_3._.debounce(() => {
278
+ const sourceDist = lib.nearestParent.pathFor([
279
+ tnp_config_1.config.folder.dist,
280
+ lib.basename,
281
+ ]);
282
+ for (const node_modules of locationsForNodeModules) {
283
+ const dest = (0, tnp_core_2.crossPlatformPath)([node_modules, lib.name]);
284
+ if (index_1.Helpers.isSymlinkFileExitedOrUnexisted(dest)) {
285
+ index_1.Helpers.remove(dest);
429
286
  }
430
- });
287
+ index_1.Helpers.copy(sourceDist, dest, {
288
+ recursive: true,
289
+ overwrite: true,
290
+ });
291
+ console.log(`Sync (watch|copy) done for ${lib.basename} to ${lib.name} (${(0, tnp_core_2.crossPlatformPath)([
292
+ tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules)),
293
+ tnp_config_1.config.folder.node_modules,
294
+ ])})`);
295
+ }
296
+ }, 500);
297
+ //#endregion
298
+ //#region watch build process
299
+ await lib.nearestParent.execute(lib.libraryBuild.getLibraryBuildCommand({
300
+ watch: true,
301
+ }), {
302
+ outputLineReplace,
303
+ resolvePromiseMsg: {
304
+ stdout: lib.libraryBuild.getLibraryBuildSuccessComamnds,
305
+ },
306
+ resolvePromiseMsgCallback: {
307
+ stdout: () => {
308
+ if (strategy === 'copy') {
309
+ debouncedBuild();
310
+ }
311
+ },
312
+ },
431
313
  });
432
- };
314
+ //#endregion
315
+ //#endregion
316
+ }
433
317
  //#endregion
434
318
  //#region getters & methods / lib normal build process
435
- BaseLibraryBuild.prototype.libNormalBuildProcess = function (_a) {
436
- return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
437
- var libCompiledInDist, compileProcess, locationsForNodeModules_2, locationsForNodeModules_2_1, node_modules_abs_path, libInsideNodeModules, locationsForNodeModules_3, locationsForNodeModules_3_1, node_modules_abs_path, libInsideNodeModules;
438
- var e_5, _c, e_6, _d;
439
- var _this = this;
440
- var lib = _b.lib, locationsForNodeModules = _b.locationsForNodeModules, strategy = _b.strategy, outputLineReplace = _b.outputLineReplace;
441
- return tslib_1.__generator(this, function (_e) {
442
- switch (_e.label) {
443
- case 0:
444
- libCompiledInDist = lib.nearestParent.pathFor([
445
- tnp_config_1.config.folder.dist,
446
- lib.basename,
447
- ]);
448
- compileProcess = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
449
- return tslib_1.__generator(this, function (_a) {
450
- switch (_a.label) {
451
- case 0:
452
- if (!!index_1.Helpers.exists(libCompiledInDist)) return [3 /*break*/, 2];
453
- index_1.Helpers.info("Compiling ".concat(lib.name, " ..."));
454
- return [4 /*yield*/, lib.nearestParent.execute(lib.libraryBuild.getLibraryBuildComamnd({
455
- watch: false,
456
- }), {
457
- resolvePromiseMsg: {
458
- stdout: lib.libraryBuild.getLibraryBuildSuccessComamnds,
459
- },
460
- outputLineReplace: outputLineReplace,
461
- })];
462
- case 1:
463
- _a.sent();
464
- _a.label = 2;
465
- case 2: return [2 /*return*/];
466
- }
467
- });
468
- }); };
469
- if (!(strategy === 'link')) return [3 /*break*/, 2];
470
- try {
471
- //#region link dist to node_modules
472
- for (locationsForNodeModules_2 = tslib_1.__values(locationsForNodeModules), locationsForNodeModules_2_1 = locationsForNodeModules_2.next(); !locationsForNodeModules_2_1.done; locationsForNodeModules_2_1 = locationsForNodeModules_2.next()) {
473
- node_modules_abs_path = locationsForNodeModules_2_1.value;
474
- libInsideNodeModules = (0, tnp_core_2.crossPlatformPath)([
475
- node_modules_abs_path,
476
- lib.name,
477
- ]);
478
- if (!index_1.Helpers.isSymlinkFileExitedOrUnexisted(libInsideNodeModules)) {
479
- index_1.Helpers.remove(libInsideNodeModules);
480
- }
481
- // console.log('linking from ', sourceDist);
482
- // console.log('linking to ', dest);
483
- // Helpers.remove(dest);
484
- index_1.Helpers.createSymLink(libCompiledInDist, libInsideNodeModules, {
485
- continueWhenExistedFolderDoesntExists: true,
486
- });
487
- if (lib.isAngularLib) {
488
- // recreate index d.ts
489
- }
490
- else {
491
- // create index.ts from index.d.ts
492
- // QUICK_FIX for typescript
493
- if (lib.hasFile('src/index.d.ts') && !lib.hasFile('src/index.ts')) {
494
- index_1.Helpers.createSymLink(lib.pathFor('src/index.d.ts'),
495
- // crossPlatformPath([libCompiledInDist, 'index.d.ts']),
496
- lib.pathFor('src/index.ts'), {
497
- continueWhenExistedFolderDoesntExists: true,
498
- });
499
- try {
500
- lib.removeFile('src/index.d.ts');
501
- }
502
- catch (error) { }
503
- }
504
- }
505
- console.log("Sync (link) done for ".concat(lib.basename, " to ").concat(lib.name, " (").concat((0, tnp_core_2.crossPlatformPath)([
506
- tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules_abs_path)),
507
- tnp_config_1.config.folder.node_modules,
508
- ]), ")"));
509
- }
510
- }
511
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
512
- finally {
513
- try {
514
- if (locationsForNodeModules_2_1 && !locationsForNodeModules_2_1.done && (_c = locationsForNodeModules_2.return)) _c.call(locationsForNodeModules_2);
515
- }
516
- finally { if (e_5) throw e_5.error; }
517
- }
518
- return [4 /*yield*/, compileProcess()];
519
- case 1:
520
- _e.sent();
521
- return [3 /*break*/, 4];
522
- case 2:
523
- if (!(strategy === 'copy')) return [3 /*break*/, 4];
524
- //#region copy dist to node_modules
525
- return [4 /*yield*/, compileProcess()];
526
- case 3:
527
- //#region copy dist to node_modules
528
- _e.sent();
319
+ async libNormalBuildProcess({ lib, locationsForNodeModules, strategy, outputLineReplace, }) {
320
+ //#region @backendFunc
321
+ const libCompiledInDist = lib.nearestParent.pathFor([
322
+ tnp_config_1.config.folder.dist,
323
+ lib.basename,
324
+ ]);
325
+ //#region compile process
326
+ const compileProcess = async () => {
327
+ index_1.Helpers.info(`Compiling ${lib.name} ...`);
328
+ await lib.nearestParent.execute(lib.libraryBuild.getLibraryBuildCommand({
329
+ watch: false,
330
+ }), {
331
+ resolvePromiseMsg: {
332
+ stdout: lib.libraryBuild.getLibraryBuildSuccessComamnds,
333
+ },
334
+ outputLineReplace,
335
+ });
336
+ };
337
+ //#endregion
338
+ if (strategy === 'link') {
339
+ //#region link dist to node_modules
340
+ for (const node_modules_abs_path of locationsForNodeModules) {
341
+ const libInsideNodeModules = (0, tnp_core_2.crossPlatformPath)([
342
+ node_modules_abs_path,
343
+ lib.name,
344
+ ]);
345
+ if (!index_1.Helpers.isSymlinkFileExitedOrUnexisted(libInsideNodeModules)) {
346
+ index_1.Helpers.remove(libInsideNodeModules);
347
+ }
348
+ // console.log('linking from ', sourceDist);
349
+ // console.log('linking to ', dest);
350
+ // Helpers.remove(dest);
351
+ index_1.Helpers.createSymLink(libCompiledInDist, libInsideNodeModules, {
352
+ continueWhenExistedFolderDoesntExists: true,
353
+ });
354
+ if (lib.isAngularLib) {
355
+ // recreate index d.ts
356
+ }
357
+ else {
358
+ // create index.ts from index.d.ts
359
+ // QUICK_FIX for typescript
360
+ if (lib.hasFile('src/index.d.ts') && !lib.hasFile('src/index.ts')) {
361
+ index_1.Helpers.createSymLink(lib.pathFor('src/index.d.ts'),
362
+ // crossPlatformPath([libCompiledInDist, 'index.d.ts']),
363
+ lib.pathFor('src/index.ts'), {
364
+ continueWhenExistedFolderDoesntExists: true,
365
+ });
529
366
  try {
530
- for (locationsForNodeModules_3 = tslib_1.__values(locationsForNodeModules), locationsForNodeModules_3_1 = locationsForNodeModules_3.next(); !locationsForNodeModules_3_1.done; locationsForNodeModules_3_1 = locationsForNodeModules_3.next()) {
531
- node_modules_abs_path = locationsForNodeModules_3_1.value;
532
- libInsideNodeModules = (0, tnp_core_2.crossPlatformPath)([
533
- node_modules_abs_path,
534
- lib.name,
535
- ]);
536
- if (index_1.Helpers.isSymlinkFileExitedOrUnexisted(libInsideNodeModules)) {
537
- index_1.Helpers.remove(libInsideNodeModules);
538
- }
539
- index_1.Helpers.copy(libCompiledInDist, libInsideNodeModules, {
540
- recursive: true,
541
- overwrite: true,
542
- });
543
- console.log("Sync copy done for ".concat(lib.basename, " to ").concat(lib.name, " (").concat((0, tnp_core_2.crossPlatformPath)([
544
- tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules_abs_path)),
545
- tnp_config_1.config.folder.node_modules,
546
- ]), ")"));
547
- }
367
+ lib.removeFile('src/index.d.ts');
548
368
  }
549
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
550
- finally {
551
- try {
552
- if (locationsForNodeModules_3_1 && !locationsForNodeModules_3_1.done && (_d = locationsForNodeModules_3.return)) _d.call(locationsForNodeModules_3);
553
- }
554
- finally { if (e_6) throw e_6.error; }
555
- }
556
- _e.label = 4;
557
- case 4: return [2 /*return*/];
369
+ catch (error) { }
370
+ }
558
371
  }
559
- });
560
- });
561
- };
372
+ console.log(`Sync (link) done for ${lib.basename} to ${lib.name} (${(0, tnp_core_2.crossPlatformPath)([
373
+ tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules_abs_path)),
374
+ tnp_config_1.config.folder.node_modules,
375
+ ])})`);
376
+ }
377
+ await compileProcess();
378
+ //#endregion
379
+ }
380
+ else if (strategy === 'copy') {
381
+ //#region copy dist to node_modules
382
+ await compileProcess();
383
+ for (const node_modules_abs_path of locationsForNodeModules) {
384
+ const libInsideNodeModules = (0, tnp_core_2.crossPlatformPath)([
385
+ node_modules_abs_path,
386
+ lib.name,
387
+ ]);
388
+ if (index_1.Helpers.isSymlinkFileExitedOrUnexisted(libInsideNodeModules)) {
389
+ index_1.Helpers.remove(libInsideNodeModules);
390
+ }
391
+ index_1.Helpers.copy(libCompiledInDist, libInsideNodeModules, {
392
+ recursive: true,
393
+ overwrite: true,
394
+ });
395
+ console.log(`Sync copy done for ${lib.basename} to ${lib.name} (${(0, tnp_core_2.crossPlatformPath)([
396
+ tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules_abs_path)),
397
+ tnp_config_1.config.folder.node_modules,
398
+ ])})`);
399
+ }
400
+ //#endregion
401
+ }
402
+ //#endregion
403
+ }
562
404
  //#endregion
563
405
  //#region getters & methods / get library build success command
564
- BaseLibraryBuild.prototype.getLibraryBuildComamnd = function (options) {
406
+ getLibraryBuildCommand(options) {
565
407
  //#region @backendFunc
566
- var watch = options.watch;
408
+ const { watch } = options;
567
409
  if (this.project.isAngularLib) {
568
- return "npm-run ng build ".concat(this.project.basename, " ").concat(watch ? '--watch' : '');
410
+ return `npm-run ng build ${this.project.basename} ${watch ? '--watch' : ''}`;
569
411
  }
570
412
  else {
571
- return ("npm-run tsc -p libraries/".concat(this.project.basename, "/tsconfig.lib.json ") +
572
- " ".concat(watch ? '--watch' : '', " --preserveWatchOutput"));
413
+ return (`npm-run tsc -p libraries/${this.project.basename}/tsconfig.lib.json ` +
414
+ ` ${watch ? '--watch' : ''} --preserveWatchOutput`);
573
415
  }
574
416
  //#endregion
575
- };
576
- Object.defineProperty(BaseLibraryBuild.prototype, "getLibraryBuildSuccessComamnds", {
417
+ }
418
+ //#endregion
419
+ //#region getters & methods / get library build success command
420
+ get getLibraryBuildSuccessComamnds() {
421
+ //#region @backendFunc
422
+ const isAngularLib = this.project.isAngularLib;
423
+ if (isAngularLib) {
424
+ return [`Trace: Build complete`, 'Compilation complete'];
425
+ }
426
+ else {
427
+ return [
428
+ `Found 0 errors. Watching for file change`,
429
+ 'Compilation complete',
430
+ ];
431
+ }
577
432
  //#endregion
578
- //#region getters & methods / get library build success command
579
- get: function () {
580
- //#region @backendFunc
581
- var isAngularLib = index_1.Helpers.exists(this.project.pathFor('ng-package.json'));
582
- if (isAngularLib) {
583
- return ["Trace: Build complete", 'Compilation complete'];
584
- }
585
- else {
586
- return [
587
- "Found 0 errors. Watching for file change",
588
- 'Compilation complete',
589
- ];
590
- }
591
- //#endregion
592
- },
593
- enumerable: false,
594
- configurable: true
595
- });
433
+ }
596
434
  //#endregion
597
435
  //#region getters & methods / select copy to projects
598
- BaseLibraryBuild.prototype.selectCopytoProjects = function () {
599
- return tslib_1.__awaiter(this, void 0, void 0, function () {
600
- var projects, locations;
601
- var _this = this;
602
- return tslib_1.__generator(this, function (_a) {
603
- switch (_a.label) {
604
- case 0:
605
- projects = this.project.ins.allProjectsFromFolder(tnp_core_2.path.dirname(this.project.location))
606
- .filter(function (c) { return c.location !== _this.project.location; })
607
- .map(function (p) {
608
- var _a;
609
- return ((_a = p.linkedProjects) === null || _a === void 0 ? void 0 : _a.embeddedProject)
610
- ? p.linkedProjects.embeddedProject
611
- : p;
612
- });
613
- return [4 /*yield*/, index_1.Helpers.consoleGui.multiselect('Copy compiled version to projects', projects.map(function (c) {
614
- return {
615
- name: c.genericName,
616
- value: c.pathFor(tnp_config_1.config.folder.node_modules),
617
- };
618
- }), true)];
619
- case 1:
620
- locations = _a.sent();
621
- return [2 /*return*/, locations];
622
- }
623
- });
624
- });
625
- };
436
+ async selectCopytoProjects() {
437
+ //#region @backendFunc
438
+ const projects = this.project.ins.allProjectsFromFolder(tnp_core_2.path.dirname(this.project.location))
439
+ .filter(c => c.location !== this.project.location)
440
+ .map(p => p.linkedProjects?.embeddedProject
441
+ ? p.linkedProjects.embeddedProject
442
+ : p);
443
+ const locations = await index_1.Helpers.consoleGui.multiselect('Copy compiled version to projects', projects.map(c => {
444
+ return {
445
+ name: c.genericName,
446
+ value: c.pathFor(tnp_config_1.config.folder.node_modules),
447
+ };
448
+ }), true);
449
+ return locations;
450
+ //#endregion
451
+ }
626
452
  //#endregion
627
453
  //#region private methods / change tsconfig for libraries typescript proper local types
628
- BaseLibraryBuild.prototype.changeTsConfigForLibrariesTypes = function () {
629
- return tslib_1.__awaiter(this, void 0, void 0, function () {
630
- var _a, _b, libChild, howMuchBack;
631
- var e_7, _c;
632
- return tslib_1.__generator(this, function (_d) {
633
- switch (_d.label) {
634
- case 0:
635
- //#region @backendFunc
636
- return [4 /*yield*/, this.restoreOriginalTsConfig()];
637
- case 1:
638
- //#region @backendFunc
639
- _d.sent();
640
- return [4 /*yield*/, this.replaceTsConfigsPathes()];
641
- case 2:
642
- _d.sent();
643
- try {
644
- for (_a = tslib_1.__values(this.project.libraryBuild.libraries), _b = _a.next(); !_b.done; _b = _a.next()) {
645
- libChild = _b.value;
646
- howMuchBack = this.project
647
- .relative(libChild.location)
648
- .split('/').length;
649
- libChild.setValueToJSONC('tsconfig.lib.json', 'extends', "".concat(tnp_core_3._.times(howMuchBack, function () { return "../"; }).join('')).concat(this.tempOrgTsConfigFile));
650
- }
651
- }
652
- catch (e_7_1) { e_7 = { error: e_7_1 }; }
653
- finally {
654
- try {
655
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
656
- }
657
- finally { if (e_7) throw e_7.error; }
658
- }
659
- return [2 /*return*/];
660
- }
661
- });
662
- });
663
- };
454
+ async changeTsConfigForLibrariesTypes() {
455
+ //#region @backendFunc
456
+ await this.restoreOriginalTsConfig();
457
+ await this.replaceTsConfigsPathes();
458
+ for (const libChild of this.project.libraryBuild.libraries) {
459
+ const howMuchBack = this.project
460
+ .relative(libChild.location)
461
+ .split('/').length;
462
+ libChild.setValueToJSONC('tsconfig.lib.json', 'extends', `${tnp_core_3._.times(howMuchBack, () => `../`).join('')}${this.tempOrgTsConfigFile}`);
463
+ }
464
+ //#endregion
465
+ }
664
466
  //#endregion
665
467
  //#region private methods / replace tsconfig pathes
666
- BaseLibraryBuild.prototype.replaceTsConfigsPathes = function () {
667
- return tslib_1.__awaiter(this, void 0, void 0, function () {
668
- var paths;
669
- var _this = this;
670
- return tslib_1.__generator(this, function (_a) {
671
- //#region @backendFunc
672
- if (!this.project.hasFile(this.tempOrgTsConfigFile)) {
673
- index_1.Helpers.copyFile(this.project.pathFor(tnp_config_1.config.file.tsconfig_json), this.project.pathFor(this.tempOrgTsConfigFile));
674
- }
675
- paths = this.project.libraryBuild.libraries.reduce(function (a, b) {
676
- var _a;
677
- return tnp_core_3._.merge(a, (_a = {},
678
- _a[b.name] = [
679
- (0, tnp_core_2.crossPlatformPath)([_this.project.relative(b.location), 'src', 'lib']),
680
- ],
681
- _a["".concat(b.name, "/*")] = [
682
- "".concat((0, tnp_core_2.crossPlatformPath)([_this.project.relative(b.location), 'src', 'lib']), "/*"),
683
- ],
684
- _a));
685
- }, {});
686
- // console.log('paths', paths);
687
- this.project.setValueToJSONC(tnp_config_1.config.file.tsconfig_json, 'compilerOptions.paths', paths);
688
- return [2 /*return*/];
468
+ async replaceTsConfigsPathes() {
469
+ //#region @backendFunc
470
+ if (!this.project.hasFile(this.tempOrgTsConfigFile)) {
471
+ index_1.Helpers.copyFile(this.project.pathFor(tnp_config_1.config.file.tsconfig_json), this.project.pathFor(this.tempOrgTsConfigFile));
472
+ }
473
+ const paths = this.project.libraryBuild.libraries.reduce((a, b) => {
474
+ return tnp_core_3._.merge(a, {
475
+ [b.name]: [
476
+ (0, tnp_core_2.crossPlatformPath)([this.project.relative(b.location), 'src', 'lib']),
477
+ ],
478
+ [`${b.name}/*`]: [
479
+ `${(0, tnp_core_2.crossPlatformPath)([this.project.relative(b.location), 'src', 'lib'])}/*`,
480
+ ],
689
481
  });
690
- });
691
- };
482
+ }, {});
483
+ // console.log('paths', paths);
484
+ this.project.setValueToJSONC(tnp_config_1.config.file.tsconfig_json, 'compilerOptions.paths', paths);
485
+ //#endregion
486
+ }
692
487
  //#endregion
693
488
  //#region private methods / restore original tsconfig
694
- BaseLibraryBuild.prototype.restoreOriginalTsConfig = function () {
695
- return tslib_1.__awaiter(this, void 0, void 0, function () {
696
- var commands, commands_1, commands_1_1, command;
697
- var e_8, _a;
698
- var _this = this;
699
- return tslib_1.__generator(this, function (_b) {
700
- //#region @backendFunc
701
- index_1.Helpers.taskStarted(' original tsconfig files');
702
- commands = tslib_1.__spreadArray([
703
- "git checkout ".concat(this.tempOrgTsConfigFile),
704
- "git checkout ".concat(tnp_config_1.config.file.tsconfig_json)
705
- ], tslib_1.__read(this.project.libraryBuild.libraries.map(function (lib) {
706
- return "git checkout ".concat(_this.project.relative(lib.location), "/").concat(tnp_config_1.config.file.tsconfig_lib_json);
707
- })), false);
708
- try {
709
- for (commands_1 = tslib_1.__values(commands), commands_1_1 = commands_1.next(); !commands_1_1.done; commands_1_1 = commands_1.next()) {
710
- command = commands_1_1.value;
711
- try {
712
- this.project
713
- .run(command, { output: false, biggerBuffer: false, silence: true })
714
- .sync();
715
- }
716
- catch (err) { }
717
- }
718
- }
719
- catch (e_8_1) { e_8 = { error: e_8_1 }; }
720
- finally {
721
- try {
722
- if (commands_1_1 && !commands_1_1.done && (_a = commands_1.return)) _a.call(commands_1);
723
- }
724
- finally { if (e_8) throw e_8.error; }
725
- }
726
- index_1.Helpers.taskDone('Restore original tsconfig files');
727
- return [2 /*return*/];
728
- });
729
- });
730
- };
731
- return BaseLibraryBuild;
732
- }(base_feature_for_project_1.BaseFeatureForProject));
489
+ async restoreOriginalTsConfig() {
490
+ //#region @backendFunc
491
+ index_1.Helpers.taskStarted(' original tsconfig files');
492
+ const commands = [
493
+ `git checkout ${this.tempOrgTsConfigFile}`,
494
+ `git checkout ${tnp_config_1.config.file.tsconfig_json}`,
495
+ ...this.project.libraryBuild.libraries.map(lib => {
496
+ return `git checkout ${this.project.relative(lib.location)}/${tnp_config_1.config.file.tsconfig_lib_json}`;
497
+ }),
498
+ ];
499
+ for (const command of commands) {
500
+ try {
501
+ this.project
502
+ .run(command, { output: false, biggerBuffer: false, silence: true })
503
+ .sync();
504
+ }
505
+ catch (err) { }
506
+ }
507
+ index_1.Helpers.taskDone('Restore original tsconfig files');
508
+ //#endregion
509
+ }
510
+ }
733
511
  exports.BaseLibraryBuild = BaseLibraryBuild;
734
512
  //# sourceMappingURL=base-library-build.js.map