tnp-helpers 18.0.19 → 18.0.21

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