tnp-helpers 18.0.25 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) 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-cli-worker/base-cli-worker-config.mjs +37 -0
  4. package/browser/esm2022/lib/base/classes/base-cli-worker/base-cli-worker-controller.mjs +125 -0
  5. package/browser/esm2022/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.mjs +133 -0
  6. package/browser/esm2022/lib/base/classes/base-cli-worker/base-cli-worker.mjs +404 -0
  7. package/browser/esm2022/lib/base/classes/base-cli-worker/index.mjs +7 -0
  8. package/browser/esm2022/lib/base/classes/base-vscode.mjs +1 -4
  9. package/browser/esm2022/lib/base/classes/index.mjs +1 -3
  10. package/browser/esm2022/lib/base/tcp-udp-ports/ports.controller.mjs +2 -2
  11. package/browser/esm2022/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.mjs +261 -0
  12. package/browser/esm2022/lib/base/tcp-udp-ports/tcp-upd-ports.worker.mjs +8 -261
  13. package/browser/esm2022/lib/models.mjs +1 -1
  14. package/browser/fesm2022/tnp-helpers.mjs +460 -443
  15. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  16. package/{client/lib/base/classes → browser/lib/base/classes/base-cli-worker}/base-cli-worker-config.d.ts +2 -2
  17. package/browser/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.d.ts +40 -0
  18. package/browser/lib/base/classes/{base-cli-worker.d.ts → base-cli-worker/base-cli-worker.d.ts} +11 -43
  19. package/browser/lib/base/classes/base-cli-worker/index.d.ts +5 -0
  20. package/browser/lib/base/classes/index.d.ts +0 -2
  21. package/browser/lib/base/tcp-udp-ports/ports.controller.d.ts +2 -2
  22. package/browser/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.d.ts +20 -0
  23. package/browser/lib/base/tcp-udp-ports/tcp-upd-ports.worker.d.ts +5 -17
  24. package/browser/lib/models.d.ts +3 -1
  25. package/client/README.md +24 -24
  26. package/client/esm2022/lib/base/classes/base-cli-worker/base-cli-worker-config.mjs +37 -0
  27. package/client/esm2022/lib/base/classes/base-cli-worker/base-cli-worker-controller.mjs +125 -0
  28. package/client/esm2022/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.mjs +133 -0
  29. package/client/esm2022/lib/base/classes/base-cli-worker/base-cli-worker.mjs +404 -0
  30. package/client/esm2022/lib/base/classes/base-cli-worker/index.mjs +7 -0
  31. package/client/esm2022/lib/base/classes/base-vscode.mjs +1 -4
  32. package/client/esm2022/lib/base/classes/index.mjs +1 -3
  33. package/client/esm2022/lib/base/tcp-udp-ports/ports.controller.mjs +2 -2
  34. package/client/esm2022/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.mjs +261 -0
  35. package/client/esm2022/lib/base/tcp-udp-ports/tcp-upd-ports.worker.mjs +8 -261
  36. package/client/esm2022/lib/models.mjs +1 -1
  37. package/client/fesm2022/tnp-helpers.mjs +460 -443
  38. package/client/fesm2022/tnp-helpers.mjs.map +1 -1
  39. package/{websql/lib/base/classes → client/lib/base/classes/base-cli-worker}/base-cli-worker-config.d.ts +2 -2
  40. package/client/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.d.ts +40 -0
  41. package/client/lib/base/classes/{base-cli-worker.d.ts → base-cli-worker/base-cli-worker.d.ts} +11 -43
  42. package/client/lib/base/classes/base-cli-worker/index.d.ts +5 -0
  43. package/client/lib/base/classes/index.d.ts +0 -2
  44. package/client/lib/base/tcp-udp-ports/ports.controller.d.ts +2 -2
  45. package/client/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.d.ts +20 -0
  46. package/client/lib/base/tcp-udp-ports/tcp-upd-ports.worker.d.ts +5 -17
  47. package/client/lib/models.d.ts +3 -1
  48. package/index.js.map +1 -1
  49. package/lib/base/classes/base-bower-json.js.map +1 -1
  50. package/lib/base/classes/{base-cli-worker-config.d.ts → base-cli-worker/base-cli-worker-config.d.ts} +1 -1
  51. package/lib/base/classes/base-cli-worker/base-cli-worker-config.js.map +1 -0
  52. package/lib/base/classes/base-cli-worker/base-cli-worker-controller.js.map +1 -0
  53. package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.d.ts +39 -0
  54. package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.js +148 -0
  55. package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.js.map +1 -0
  56. package/lib/base/classes/{base-cli-worker.d.ts → base-cli-worker/base-cli-worker.d.ts} +9 -41
  57. package/lib/base/classes/{base-cli-worker.js → base-cli-worker/base-cli-worker.js} +43 -176
  58. package/lib/base/classes/base-cli-worker/base-cli-worker.js.map +1 -0
  59. package/lib/base/classes/base-cli-worker/index.d.ts +4 -0
  60. package/lib/base/classes/base-cli-worker/index.js +21 -0
  61. package/lib/base/classes/base-cli-worker/index.js.map +1 -0
  62. package/lib/base/classes/base-command-line-feature.backend.js.map +1 -1
  63. package/lib/base/classes/base-compiler-for-project.js.map +1 -1
  64. package/lib/base/classes/base-db.js.map +1 -1
  65. package/lib/base/classes/base-debounce-compiler-for-project.js.map +1 -1
  66. package/lib/base/classes/base-feature-for-project.js.map +1 -1
  67. package/lib/base/classes/base-git.js.map +1 -1
  68. package/lib/base/classes/base-global-command-line.backend.js +1 -1
  69. package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
  70. package/lib/base/classes/base-ignore-hide.js.map +1 -1
  71. package/lib/base/classes/base-json-file-reader.js.map +1 -1
  72. package/lib/base/classes/base-library-build.js.map +1 -1
  73. package/lib/base/classes/base-linked-projects.js.map +1 -1
  74. package/lib/base/classes/base-node-modules.js.map +1 -1
  75. package/lib/base/classes/base-npm-helpers.js.map +1 -1
  76. package/lib/base/classes/base-package-json.js.map +1 -1
  77. package/lib/base/classes/base-powershell.js.map +1 -1
  78. package/lib/base/classes/base-process-manager.js.map +1 -1
  79. package/lib/base/classes/base-project-resolver.js.map +1 -1
  80. package/lib/base/classes/base-project.js.map +1 -1
  81. package/lib/base/classes/base-quick-fixes.js.map +1 -1
  82. package/lib/base/classes/base-release-process.js.map +1 -1
  83. package/lib/base/classes/base-start-config.backend.js.map +1 -1
  84. package/lib/base/classes/base-static-pages.js.map +1 -1
  85. package/lib/base/classes/base-vscode.js +8 -12
  86. package/lib/base/classes/base-vscode.js.map +1 -1
  87. package/lib/base/classes/index.d.ts +0 -2
  88. package/lib/base/classes/index.js +0 -2
  89. package/lib/base/classes/index.js.map +1 -1
  90. package/lib/base/commit-data.js.map +1 -1
  91. package/lib/base/config-database.js.map +1 -1
  92. package/lib/base/core-project.js.map +1 -1
  93. package/lib/base/gh-temp-code.js.map +1 -1
  94. package/lib/base/index-rebuilder.backend.js.map +1 -1
  95. package/lib/base/index.js.map +1 -1
  96. package/lib/base/linked-project.js.map +1 -1
  97. package/lib/base/project-database.js.map +1 -1
  98. package/lib/base/tcp-udp-ports/index.js.map +1 -1
  99. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
  100. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js.map +1 -1
  101. package/lib/base/tcp-udp-ports/ports.controller.d.ts +2 -2
  102. package/lib/base/tcp-udp-ports/ports.controller.js +2 -2
  103. package/lib/base/tcp-udp-ports/ports.controller.js.map +1 -1
  104. package/lib/base/tcp-udp-ports/ports.entity.js.map +1 -1
  105. package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js.map +1 -1
  106. package/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.d.ts +32 -0
  107. package/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.js +256 -0
  108. package/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.js.map +1 -0
  109. package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.d.ts +4 -29
  110. package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js +7 -257
  111. package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js.map +1 -1
  112. package/lib/base/translate.js.map +1 -1
  113. package/lib/build-info._auto-generated_.js.map +1 -1
  114. package/lib/helpers/for-backend/helpers-cli-tool.backend.js.map +1 -1
  115. package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
  116. package/lib/helpers/for-backend/helpers-dependencies.backend.js.map +1 -1
  117. package/lib/helpers/for-backend/helpers-file-folders.js.map +1 -1
  118. package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
  119. package/lib/helpers/for-backend/helpers-network.backend.js.map +1 -1
  120. package/lib/helpers/for-backend/helpers-npm.backend.js.map +1 -1
  121. package/lib/helpers/for-backend/helpers-path.backend.js.map +1 -1
  122. package/lib/helpers/for-backend/helpers-process.js.map +1 -1
  123. package/lib/helpers/for-backend/helpers-system-terminal.backend.js.map +1 -1
  124. package/lib/helpers/for-backend/helpers-vscode.backend.js.map +1 -1
  125. package/lib/helpers/for-browser/angular.helper.js +2 -2
  126. package/lib/helpers/for-browser/angular.helper.js.map +1 -1
  127. package/lib/helpers/for-browser/helpers-browser.js.map +1 -1
  128. package/lib/helpers/helpers-array-obj.js.map +1 -1
  129. package/lib/helpers/helpers-json5.backend.js.map +1 -1
  130. package/lib/helpers/helpers-numbers.js.map +1 -1
  131. package/lib/helpers/helpers-strings-regexes.js.map +1 -1
  132. package/lib/helpers/helpers-strings.js.map +1 -1
  133. package/lib/helpers/helpers.js.map +1 -1
  134. package/lib/index._auto-generated_.js.map +1 -1
  135. package/lib/index.js.map +1 -1
  136. package/lib/lowdb/adapters/Memory.js.map +1 -1
  137. package/lib/lowdb/adapters/browser/LocalStorage.js.map +1 -1
  138. package/lib/lowdb/adapters/browser/SessionStorage.js.map +1 -1
  139. package/lib/lowdb/adapters/browser/WebStorage.js.map +1 -1
  140. package/lib/lowdb/adapters/node/DataFile.js.map +1 -1
  141. package/lib/lowdb/adapters/node/JSONFile.js.map +1 -1
  142. package/lib/lowdb/adapters/node/TextFile.js.map +1 -1
  143. package/lib/lowdb/adapters/node/steno.js.map +1 -1
  144. package/lib/lowdb/browser.js.map +1 -1
  145. package/lib/lowdb/core/Low.js.map +1 -1
  146. package/lib/lowdb/examples/browser.js.map +1 -1
  147. package/lib/lowdb/examples/cli.js.map +1 -1
  148. package/lib/lowdb/examples/in-memory.js.map +1 -1
  149. package/lib/lowdb/examples/server.js.map +1 -1
  150. package/lib/lowdb/index.js.map +1 -1
  151. package/lib/lowdb/node.js.map +1 -1
  152. package/lib/lowdb/presets/browser.js.map +1 -1
  153. package/lib/lowdb/presets/node.js.map +1 -1
  154. package/lib/models.d.ts +2 -0
  155. package/lib/models.js.map +1 -1
  156. package/lib/old/base-component.js +2 -2
  157. package/lib/old/base-component.js.map +1 -1
  158. package/lib/old/base-formly-component.js +2 -2
  159. package/lib/old/base-formly-component.js.map +1 -1
  160. package/lib/old/condition-wait.js.map +1 -1
  161. package/lib/old/dual-component-ctrl.js +2 -2
  162. package/lib/old/dual-component-ctrl.js.map +1 -1
  163. package/lib/old/execute-command.js.map +1 -1
  164. package/lib/old/helpers.js.map +1 -1
  165. package/lib/old/models.js.map +1 -1
  166. package/lib/utils.js.map +1 -1
  167. package/lib/validators/validators-firedev.js.map +1 -1
  168. package/lib/validators/validators-git.js.map +1 -1
  169. package/lib/validators/validators-network.js.map +1 -1
  170. package/lib/validators/validators.js.map +1 -1
  171. package/migrations/1736198527297_init.js.map +1 -1
  172. package/migrations/1736199486472_addingNotAssignablePorts.js.map +1 -1
  173. package/migrations/1736454437350_addFreePorts.js.map +1 -1
  174. package/migrations/index.js.map +1 -1
  175. package/migrations/migrations_index._auto-generated_.js.map +1 -1
  176. package/package.json +2 -2
  177. package/tmp-environment.json +3 -3
  178. package/websql/README.md +24 -24
  179. package/websql/esm2022/lib/base/classes/base-cli-worker/base-cli-worker-config.mjs +37 -0
  180. package/websql/esm2022/lib/base/classes/base-cli-worker/base-cli-worker-controller.mjs +125 -0
  181. package/websql/esm2022/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.mjs +133 -0
  182. package/websql/esm2022/lib/base/classes/base-cli-worker/base-cli-worker.mjs +404 -0
  183. package/websql/esm2022/lib/base/classes/base-cli-worker/index.mjs +7 -0
  184. package/websql/esm2022/lib/base/classes/base-vscode.mjs +1 -4
  185. package/websql/esm2022/lib/base/classes/index.mjs +1 -3
  186. package/websql/esm2022/lib/base/tcp-udp-ports/ports.controller.mjs +2 -2
  187. package/websql/esm2022/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.mjs +261 -0
  188. package/websql/esm2022/lib/base/tcp-udp-ports/tcp-upd-ports.worker.mjs +8 -261
  189. package/websql/esm2022/lib/models.mjs +1 -1
  190. package/websql/fesm2022/tnp-helpers.mjs +460 -443
  191. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  192. package/{browser/lib/base/classes → websql/lib/base/classes/base-cli-worker}/base-cli-worker-config.d.ts +2 -2
  193. package/websql/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.d.ts +40 -0
  194. package/websql/lib/base/classes/{base-cli-worker.d.ts → base-cli-worker/base-cli-worker.d.ts} +11 -43
  195. package/websql/lib/base/classes/base-cli-worker/index.d.ts +5 -0
  196. package/websql/lib/base/classes/index.d.ts +0 -2
  197. package/websql/lib/base/tcp-udp-ports/ports.controller.d.ts +2 -2
  198. package/websql/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.d.ts +20 -0
  199. package/websql/lib/base/tcp-udp-ports/tcp-upd-ports.worker.d.ts +5 -17
  200. package/websql/lib/models.d.ts +3 -1
  201. package/browser/esm2022/lib/base/classes/base-cli-worker-config.mjs +0 -37
  202. package/browser/esm2022/lib/base/classes/base-cli-worker-controller.mjs +0 -125
  203. package/browser/esm2022/lib/base/classes/base-cli-worker.mjs +0 -523
  204. package/cli.d.ts +0 -6
  205. package/client/esm2022/lib/base/classes/base-cli-worker-config.mjs +0 -37
  206. package/client/esm2022/lib/base/classes/base-cli-worker-controller.mjs +0 -125
  207. package/client/esm2022/lib/base/classes/base-cli-worker.mjs +0 -523
  208. package/env.d.ts +0 -3
  209. package/environments/angular-node-app/env.angular-node-app.__.d.ts +0 -3
  210. package/environments/angular-node-app/env.angular-node-app.prod.d.ts +0 -3
  211. package/environments/docs-webapp/env.docs-webapp.__.d.ts +0 -3
  212. package/environments/electron-app/env.electron-app.__.d.ts +0 -3
  213. package/environments/electron-app/env.electron-app.prod.d.ts +0 -3
  214. package/environments/mobile-app/env.mobile-app.__.d.ts +0 -3
  215. package/environments/mobile-app/env.mobile-app.prod.d.ts +0 -3
  216. package/environments/npm-lib-and-cli-tool/env.npm-lib-and-cli-tool.__.d.ts +0 -3
  217. package/environments/npm-lib-and-cli-tool/env.npm-lib-and-cli-tool.prod.d.ts +0 -3
  218. package/environments/vscode-plugin/env.vscode-plugin.__.d.ts +0 -6
  219. package/environments/vscode-plugin/env.vscode-plugin.prod.d.ts +0 -4
  220. package/global-typings.d.ts +0 -41
  221. package/lib/base/classes/base-cli-worker-config.js.map +0 -1
  222. package/lib/base/classes/base-cli-worker-controller.js.map +0 -1
  223. package/lib/base/classes/base-cli-worker.js.map +0 -1
  224. package/lib/base/classes/base-detached-service.d.ts +0 -5
  225. package/lib/base/classes/base-detached-service.js +0 -12
  226. package/lib/base/classes/base-detached-service.js.map +0 -1
  227. package/lib/base/classes/base-github-pages.d.ts +0 -14
  228. package/lib/constants.d.ts +0 -77
  229. package/lib/helpers/for-backend/helpers-file-folders.backend.d.ts +0 -104
  230. package/lib/helpers/for-backend/helpers-file-folders.backend.js +0 -956
  231. package/lib/helpers/for-backend/helpers-file-folders.backend.js.map +0 -1
  232. package/lib/helpers/for-backend/helpers-process.backend.d.ts +0 -87
  233. package/lib/helpers/for-backend/helpers-process.backend.js +0 -496
  234. package/lib/helpers/for-backend/helpers-process.backend.js.map +0 -1
  235. package/lib/helpers/for-backend/ts-code/index.d.ts +0 -1
  236. package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.d.ts +0 -29
  237. package/lib/helpers.d.ts +0 -0
  238. package/lib/options.d.ts +0 -252
  239. package/lib/project/abstract/artifacts/__helpers__/artifacts-helpers.d.ts +0 -28
  240. package/lib/project/abstract/artifacts/__helpers__/branding.d.ts +0 -13
  241. package/lib/project/abstract/artifacts/__helpers__/environment-config/environment-config.d.ts +0 -26
  242. package/lib/project/abstract/artifacts/angular-node-app/artifact-angular-node-app.d.ts +0 -53
  243. package/lib/project/abstract/artifacts/angular-node-app/index.d.ts +0 -1
  244. package/lib/project/abstract/artifacts/angular-node-app/tools/assets-list-file-generator.d.ts +0 -19
  245. package/lib/project/abstract/artifacts/angular-node-app/tools/assets-manager.d.ts +0 -5
  246. package/lib/project/abstract/artifacts/angular-node-app/tools/basename-manager.d.ts +0 -17
  247. package/lib/project/abstract/artifacts/angular-node-app/tools/docs-app-build-config.d.ts +0 -21
  248. package/lib/project/abstract/artifacts/angular-node-app/tools/inside-struct-angular13-app.d.ts +0 -6
  249. package/lib/project/abstract/artifacts/angular-node-app/tools/migrations-helper.d.ts +0 -18
  250. package/lib/project/abstract/artifacts/artifacts-manager.d.ts +0 -39
  251. package/lib/project/abstract/artifacts/base-artifact.d.ts +0 -52
  252. package/lib/project/abstract/artifacts/docs-webapp/artifact-docs-webapp.d.ts +0 -27
  253. package/lib/project/abstract/artifacts/docs-webapp/docs.d.ts +0 -55
  254. package/lib/project/abstract/artifacts/docs-webapp/index.d.ts +0 -1
  255. package/lib/project/abstract/artifacts/electron-app/artifact-electron-app.d.ts +0 -22
  256. package/lib/project/abstract/artifacts/electron-app/index.d.ts +0 -1
  257. package/lib/project/abstract/artifacts/mobile-app/artifact-mobile-app.d.ts +0 -16
  258. package/lib/project/abstract/artifacts/mobile-app/index.d.ts +0 -1
  259. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/artifact-npm-lib-and-cli-tool.d.ts +0 -82
  260. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/index.d.ts +0 -1
  261. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/browser-code-cut.d.ts +0 -102
  262. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-cut.d.ts +0 -41
  263. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.d.ts +0 -44
  264. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/cut-fn.d.ts +0 -1
  265. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/file-split-process.d.ts +0 -14
  266. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/compilations/compilation-backend.d.ts +0 -60
  267. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/compilations/compilation-browser.d.ts +0 -41
  268. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/compilations/incremental-build-process.d.ts +0 -23
  269. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/base-copy-manager.d.ts +0 -85
  270. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/copy-manager-helpers.d.ts +0 -12
  271. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/copy-manager-organization.d.ts +0 -0
  272. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/copy-manager-standalone.d.ts +0 -77
  273. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/copy-manager.d.ts +0 -7
  274. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/mjs-fesm-module-spliter.d.ts +0 -46
  275. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/source-maping-url.d.ts +0 -11
  276. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/typescript-dts-fixer.d.ts +0 -25
  277. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/files-recreation/files-recreator.d.ts +0 -133
  278. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/files-recreation/files-templates.d.ts +0 -8
  279. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/files-recreation/index.d.ts +0 -2
  280. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/index-autogen-provider.d.ts +0 -15
  281. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-struct-angular13-lib.d.ts +0 -6
  282. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/inside-struct.d.ts +0 -44
  283. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/inside-structures.d.ts +0 -17
  284. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/structs/base-inside-struct.d.ts +0 -12
  285. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/structs/inside-struct-constants.d.ts +0 -2
  286. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/structs/inside-struct-helpers.d.ts +0 -12
  287. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/structs/loaders/image-loader.d.ts +0 -1
  288. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/structs/loaders/loader-ids-default.d.ts +0 -1
  289. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/structs/loaders/loader-ids-ellipsis.d.ts +0 -1
  290. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/structs/loaders/loader-ids-facebook.d.ts +0 -1
  291. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/structs/loaders/loader-ids-grid.d.ts +0 -1
  292. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/structs/loaders/loader-ids-heart.d.ts +0 -1
  293. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/structs/loaders/loader-ids-ripple.d.ts +0 -1
  294. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/inside-structures/structs/loaders/loaders.d.ts +0 -2
  295. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/lib-project/lib-project-base.d.ts +0 -9
  296. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/lib-project/lib-project-standalone.d.ts +0 -9
  297. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/singular-build.d.ts +0 -0
  298. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/test-runner/cypress-test-runner.d.ts +0 -7
  299. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/test-runner/index.d.ts +0 -3
  300. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/test-runner/jest-test-runner.d.ts +0 -8
  301. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/test-runner/mocha-test-runner.d.ts +0 -7
  302. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/webpack-backend-compilation.d.ts +0 -0
  303. package/lib/project/abstract/artifacts/vscode-plugin/artifact-vscode-plugin.d.ts +0 -33
  304. package/lib/project/abstract/artifacts/vscode-plugin/index.d.ts +0 -1
  305. package/lib/project/abstract/framework.d.ts +0 -61
  306. package/lib/project/abstract/git.d.ts +0 -26
  307. package/lib/project/abstract/library-build.d.ts +0 -9
  308. package/lib/project/abstract/linked-projects.d.ts +0 -4
  309. package/lib/project/abstract/linter.d.ts +0 -9
  310. package/lib/project/abstract/node-modules.d.ts +0 -35
  311. package/lib/project/abstract/npm-helpers.d.ts +0 -22
  312. package/lib/project/abstract/package-json.d.ts +0 -14
  313. package/lib/project/abstract/packages-recognition.d.ts +0 -16
  314. package/lib/project/abstract/project-resolve.d.ts +0 -37
  315. package/lib/project/abstract/project.d.ts +0 -63
  316. package/lib/project/abstract/quick-fixes.d.ts +0 -18
  317. package/lib/project/abstract/release-process/index.d.ts +0 -1
  318. package/lib/project/abstract/release-process/release-config.d.ts +0 -0
  319. package/lib/project/abstract/release-process/release-process.d.ts +0 -26
  320. package/lib/project/abstract/taon-worker/taon-build.controller.d.ts +0 -5
  321. package/lib/project/abstract/taon-worker/taon-build.entity.d.ts +0 -8
  322. package/lib/project/abstract/taon-worker/taon-env.entity.d.ts +0 -10
  323. package/lib/project/abstract/taon-worker/taon-project.entity.d.ts +0 -8
  324. package/lib/project/abstract/taon-worker/taon.context.d.ts +0 -56
  325. package/lib/project/abstract/taon-worker/taon.controller.d.ts +0 -7
  326. package/lib/project/abstract/taon-worker/taon.worker.d.ts +0 -40
  327. package/lib/project/abstract/taonJson.d.ts +0 -49
  328. package/lib/project/abstract/vscode.d.ts +0 -80
  329. package/lib/project/cli/base-cli.d.ts +0 -8
  330. package/lib/project/cli/cli-BRANDING.d.ts +0 -23
  331. package/lib/project/cli/cli-BUILD.d.ts +0 -4
  332. package/lib/project/cli/cli-DOCS.d.ts +0 -4
  333. package/lib/project/cli/cli-INIT.d.ts +0 -13
  334. package/lib/project/cli/cli-LINK.d.ts +0 -23
  335. package/lib/project/cli/cli-MIGRATION.d.ts +0 -4
  336. package/lib/project/cli/cli-NEW.d.ts +0 -15
  337. package/lib/project/cli/cli-OPEN.d.ts +0 -15
  338. package/lib/project/cli/cli-RELEASE.d.ts +0 -4
  339. package/lib/project/cli/cli-TEST.d.ts +0 -23
  340. package/lib/project/cli/cli-VERSION.d.ts +0 -16
  341. package/lib/project/cli/cli-VSCODE.d.ts +0 -17
  342. package/lib/project/cli/cli-_GLOBAL_.d.ts +0 -85
  343. package/lib/project/cli/index.d.ts +0 -29
  344. package/lib/project/index.d.ts +0 -0
  345. package/lib/templates.d.ts +0 -1
  346. package/migrations/1737301724542_addingSampleData.d.ts +0 -14
  347. package/start.backend.d.ts +0 -2
  348. package/taon.jsonc +0 -34
  349. package/websql/esm2022/lib/base/classes/base-cli-worker-config.mjs +0 -37
  350. package/websql/esm2022/lib/base/classes/base-cli-worker-controller.mjs +0 -125
  351. package/websql/esm2022/lib/base/classes/base-cli-worker.mjs +0 -523
  352. /package/browser/lib/base/classes/{base-cli-worker-controller.d.ts → base-cli-worker/base-cli-worker-controller.d.ts} +0 -0
  353. /package/client/lib/base/classes/{base-cli-worker-controller.d.ts → base-cli-worker/base-cli-worker-controller.d.ts} +0 -0
  354. /package/lib/base/classes/{base-cli-worker-config.js → base-cli-worker/base-cli-worker-config.js} +0 -0
  355. /package/lib/base/classes/{base-cli-worker-controller.d.ts → base-cli-worker/base-cli-worker-controller.d.ts} +0 -0
  356. /package/lib/base/classes/{base-cli-worker-controller.js → base-cli-worker/base-cli-worker-controller.js} +0 -0
  357. /package/websql/lib/base/classes/{base-cli-worker-controller.d.ts → base-cli-worker/base-cli-worker-controller.d.ts} +0 -0
@@ -1,956 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HelpersFileFolders = void 0;
4
- const crypto = require("crypto");
5
- const glob = require("glob");
6
- const tnp_config_1 = require("tnp-config");
7
- const tnp_core_1 = require("tnp-core");
8
- const underscore = require("underscore");
9
- const index_1 = require("../../index");
10
- class HelpersFileFolders {
11
- /**
12
- * Calculate file or string checksum
13
- */
14
- checksum(absolutePathToFileOrContent, algorithm) {
15
- //#region @backendFunc
16
- const fileContent = tnp_core_1.path.isAbsolute(absolutePathToFileOrContent)
17
- ? index_1.Helpers.readFile(absolutePathToFileOrContent)
18
- : absolutePathToFileOrContent;
19
- return crypto
20
- .createHash(algorithm || 'md5')
21
- .update(fileContent, 'utf8')
22
- .digest('hex');
23
- //#endregion
24
- }
25
- getValueFromJSON(filepath, lodashGetPath, defaultValue = void 0) {
26
- //#region @backendFunc
27
- if (!tnp_core_1.fse.existsSync(filepath)) {
28
- return defaultValue;
29
- }
30
- const json = index_1.Helpers.readJson(filepath);
31
- return tnp_core_1._.get(json, lodashGetPath, defaultValue);
32
- //#endregion
33
- }
34
- getValueFromJSONC(filepath, lodashGetPath, defaultValue = void 0) {
35
- //#region @backendFunc
36
- if (!tnp_core_1.fse.existsSync(filepath)) {
37
- return defaultValue;
38
- }
39
- const json = index_1.Helpers.readJson5(filepath);
40
- return tnp_core_1._.get(json, lodashGetPath, defaultValue);
41
- //#endregion
42
- }
43
- readValueFromJson(filepath, lodashGetPath, defaultValue = void 0) {
44
- //#region @backendFunc
45
- return index_1.Helpers.getValueFromJSON(filepath, lodashGetPath, defaultValue);
46
- //#endregion
47
- }
48
- readValueFromJsonC(filepath, lodashGetPath, defaultValue = void 0) {
49
- //#region @backendFunc
50
- return index_1.Helpers.getValueFromJSONC(filepath, lodashGetPath, defaultValue);
51
- //#endregion
52
- }
53
- setValueToJSON(filepath, lodashGetPath, value) {
54
- //#region @backendFunc
55
- if (!tnp_core_1.fse.existsSync(filepath)) {
56
- index_1.Helpers.warn(`Recreating unexised json file: ${filepath}`);
57
- index_1.Helpers.writeFile(filepath, '{}');
58
- }
59
- const json = index_1.Helpers.readJson(filepath);
60
- tnp_core_1._.set(json, lodashGetPath, value);
61
- index_1.Helpers.writeJson(filepath, json);
62
- //#endregion
63
- }
64
- setValueToJSONC(filepath, lodashGetPath, value) {
65
- //#region @backendFunc
66
- if (!tnp_core_1.fse.existsSync(filepath)) {
67
- index_1.Helpers.warn(`Recreating unexised json file: ${filepath}`);
68
- index_1.Helpers.writeFile(filepath, '{}');
69
- }
70
- const json = index_1.Helpers.readJsonC(filepath);
71
- tnp_core_1._.set(json, lodashGetPath, value);
72
- index_1.Helpers.writeJsonC(filepath, json);
73
- //#endregion
74
- }
75
- /**
76
- * file size in bytes
77
- */
78
- size(filePath) {
79
- //#region @backendFunc
80
- if (!index_1.Helpers.exists(filePath) || index_1.Helpers.isFolder(filePath)) {
81
- return null;
82
- }
83
- return tnp_core_1.fse.lstatSync(filePath).size;
84
- //#endregion
85
- }
86
- pathFromLink(filePath) {
87
- //#region @backendFunc
88
- return tnp_core_1.fse.readlinkSync(filePath);
89
- //#endregion
90
- }
91
- // renameFolder(from: string, to: string, cwd?: string) {
92
- // // const command = `mv ${from} ${to}`;
93
- // const command = `renamer --find ${from} --replace ${to} *`;
94
- // Helpers.run(command, { cwd }).sync()
95
- // }
96
- /**
97
- * @deprecated
98
- */
99
- renameFolder(from, to, cwd) {
100
- //#region @backendFunc
101
- index_1.Helpers.renameFiles(from, to, cwd);
102
- //#endregion
103
- }
104
- /**
105
- * @deprecated
106
- */
107
- renameFiles(from, to, cwd) {
108
- //#region @backendFunc
109
- try {
110
- const directoryPath = cwd || '.';
111
- // Read all files in the directory
112
- const files = tnp_core_1.fse.readdirSync(directoryPath);
113
- files.forEach(file => {
114
- // Check if the file name includes the 'from' pattern
115
- if (file.includes(from)) {
116
- const newFileName = file.replace(from, to);
117
- const currentPath = tnp_core_1.path.join(directoryPath, file);
118
- const newPath = tnp_core_1.path.join(directoryPath, newFileName);
119
- // Rename the file
120
- tnp_core_1.fse.renameSync(currentPath, newPath);
121
- console.log(`Renamed file from ${currentPath} to ${newPath}`);
122
- }
123
- });
124
- }
125
- catch (error) {
126
- console.error(`Error renaming files from ${from} to ${to}:`, error);
127
- }
128
- //#endregion
129
- }
130
- getTempFolder() {
131
- //#region @backendFunc
132
- let tmp = '/tmp';
133
- if (process.platform === 'darwin') {
134
- tmp = '/private/tmp';
135
- }
136
- if (process.platform === 'win32') {
137
- tmp = (0, tnp_core_1.crossPlatformPath)(tnp_core_1.path.join((0, tnp_core_1.crossPlatformPath)(tnp_core_1.os.homedir()), '/AppData/Local/Temp'));
138
- }
139
- if (!index_1.Helpers.exists(tmp)) {
140
- index_1.Helpers.mkdirp(tmp);
141
- }
142
- return tmp;
143
- //#endregion
144
- }
145
- // createMultiplatformLink(target: string, link: string) {
146
- // if (this.isPlainFileOrFolder(link)) {
147
- // link = path.join(process.cwd(), link);
148
- // }
149
- // let command: string;
150
- // if (os.platform() === 'win32') {
151
- // if (target.startsWith('./')) {
152
- // target = path.win32.normalize(path.join(process.cwd(), path.basename(target)))
153
- // } else {
154
- // if (target === '.' || target === './') {
155
- // target = path.win32.normalize(path.join(process.cwd(), path.basename(link)))
156
- // } else {
157
- // target = path.win32.normalize(path.join(target, path.basename(link)))
158
- // }
159
- // }
160
- // if (fse.existsSync(target)) {
161
- // fse.unlinkSync(target);
162
- // }
163
- // target = path.win32.normalize(target)
164
- // if (link === '.' || link === './') {
165
- // link = process.cwd()
166
- // }
167
- // link = path.win32.normalize(link);
168
- // // if (path.resolve(target) === path.resolve(link)) { // TODO
169
- // // Helpers.warn(`[createMultiplatformLink][win32] Trying to link same location`);
170
- // // return;
171
- // // }
172
- // command = "mklink \/D "
173
- // + target
174
- // + " "
175
- // + link
176
- // + " >nul 2>&1 "
177
- // } else {
178
- // if (target.startsWith('./')) {
179
- // target = target.replace(/^\.\//g, '');
180
- // }
181
- // if (link === '.' || link === './') {
182
- // link = process.cwd()
183
- // }
184
- // if (path.resolve(target) === path.resolve(link)) {
185
- // Helpers.warn(`[createMultiplatformLink] Trying to link same location`);
186
- // return;
187
- // }
188
- // command = `ln -sf "${link}" "${target}"`;
189
- // }
190
- // child_process.execSync(command);
191
- // }
192
- isPlainFileOrFolder(filePath) {
193
- //#region @backendFunc
194
- return /^([a-zA-Z]|\-|\_|\@|\#|\$|\!|\^|\&|\*|\(|\))+$/.test(filePath);
195
- //#endregion
196
- }
197
- /**
198
- * @deprecated
199
- * use import (or modules only on backend)
200
- */
201
- requireUncached(module) {
202
- //#region @backendFunc
203
- delete require.cache[require.resolve(module)];
204
- return require(module);
205
- //#endregion
206
- }
207
- /**
208
- * @deprecated
209
- * use import (or modules only on backend)
210
- *
211
- * get default export object from js file
212
- * @param jsFilePath
213
- */
214
- require(jsFilePath) {
215
- //#region @backendFunc
216
- const orgPath = jsFilePath;
217
- if (!tnp_core_1.fse.existsSync(jsFilePath)) {
218
- jsFilePath = `${jsFilePath}.js`;
219
- }
220
- if (!tnp_core_1.fse.existsSync(jsFilePath)) {
221
- index_1.Helpers.error(`Not able to find path: ${orgPath}`);
222
- }
223
- let fileContent = tnp_core_1.fse.readFileSync(jsFilePath).toLocaleString();
224
- (() => {
225
- const stringForRegex = `require\\(("|')\\.\\/([a-zA-Z0-9]|\\/|\\-|\\_|\\+|\\.)*("|')\\)`;
226
- index_1.Helpers.log(`[taon-helpre][require][${jsFilePath}] stringForRegex: ${stringForRegex}`, 1);
227
- fileContent = fileContent
228
- .split('\n')
229
- .map(line => {
230
- const matches = line.match(new RegExp(stringForRegex));
231
- if (matches !== null) {
232
- // console.log('matched', matches)
233
- const rep = tnp_core_1._.first(matches);
234
- if (rep) {
235
- const newFilename = (0, tnp_core_1.crossPlatformPath)([
236
- tnp_core_1.path.dirname(jsFilePath),
237
- rep.split('(')[1].replace(/("|'|\))/g, ''),
238
- ]);
239
- line = line.replace(rep, `require('${newFilename}')`);
240
- }
241
- // console.log(line)
242
- }
243
- // console.log('matched', matches)
244
- return line;
245
- })
246
- .join('\n');
247
- })();
248
- (() => {
249
- const stringForRegex = `require\\(("|')([a-zA-Z0-9]|\\/|\\-|\\_|\\+|\\.)*("|')\\)`;
250
- index_1.Helpers.log(`[taon-helpre][require][${jsFilePath}] stringForRegex: ${stringForRegex}`, 1);
251
- fileContent = fileContent
252
- .split('\n')
253
- .map(line => {
254
- // console.log(`LINE: "${line}"`)
255
- const matches = line.match(new RegExp(stringForRegex));
256
- if (matches !== null) {
257
- // console.log('matched', matches)
258
- const rep = tnp_core_1._.first(matches);
259
- if (rep) {
260
- const relativePart = rep.split('(')[1].replace(/("|'|\))/g, '');
261
- // console.log(`RELATIVE PART: "${relativePart}"`)
262
- if (relativePart.search('/') !== -1 &&
263
- !relativePart.startsWith('/')) {
264
- const newFilename = (0, tnp_core_1.crossPlatformPath)([
265
- tnp_core_1.path.dirname(jsFilePath),
266
- 'node_modules',
267
- relativePart,
268
- ]);
269
- line = line.replace(rep, `require('${newFilename}')`);
270
- }
271
- }
272
- // console.log(line)
273
- }
274
- // console.log('matched', matches)
275
- return line;
276
- })
277
- .join('\n');
278
- })();
279
- return eval(fileContent);
280
- //#endregion
281
- }
282
- tryRecreateDir(dirpath) {
283
- //#region @backendFunc
284
- try {
285
- index_1.Helpers.mkdirp(dirpath);
286
- }
287
- catch (error) {
288
- index_1.Helpers.log(`Trying to recreate directory: ${dirpath}`);
289
- index_1.Helpers.sleep(1);
290
- index_1.Helpers.mkdirp(dirpath);
291
- }
292
- //#endregion
293
- }
294
- /**
295
- * @deprecated
296
- */
297
- tryCopyFrom(source, destination, options = {}) {
298
- //#region @backendFunc
299
- index_1.Helpers.log(`Trying to copy from: ${source} to ${destination}`);
300
- destination = (0, tnp_core_1.crossPlatformPath)(destination);
301
- source = (0, tnp_core_1.crossPlatformPath)(source);
302
- if (source === destination) {
303
- index_1.Helpers.warn('[taon-helpers] Probably error... trying to copy the same folder...');
304
- return;
305
- }
306
- if (tnp_core_1.fse.existsSync(source) && !tnp_core_1.fse.lstatSync(source).isDirectory()) {
307
- // Helpers.warn(`[tryCopyFrom] This source is not directory: ${source} to ${destination}`);
308
- index_1.Helpers.copyFile(source, destination);
309
- return;
310
- }
311
- if (tnp_core_1.fse.existsSync(destination.replace(/\/$/, ''))) {
312
- const destMaybe = destination.replace(/\/$/, '');
313
- const stats = tnp_core_1.fse.lstatSync(destMaybe);
314
- const isNotDirectory = !stats.isDirectory();
315
- const isSymbolicLink = stats.isSymbolicLink();
316
- if (isNotDirectory || isSymbolicLink) {
317
- tnp_core_1.rimraf.sync(destMaybe);
318
- }
319
- }
320
- options = tnp_core_1._.merge({
321
- overwrite: true,
322
- recursive: true,
323
- }, options);
324
- if (process.platform === 'win32') {
325
- // TODO QUICK_FIX
326
- options['dereference'] = true;
327
- }
328
- try {
329
- tnp_core_1.fse.copySync(source, destination, options);
330
- }
331
- catch (error) {
332
- tnp_core_1.rimraf.sync(destination);
333
- tnp_core_1.fse.copySync(source, destination, options);
334
- }
335
- //#endregion
336
- }
337
- // private deleteFolderRecursive = (pathToFolder) => {
338
- // if (fs.existsSync(pathToFolder)) {
339
- // fs.readdirSync(pathToFolder).forEach((file, index) => {
340
- // const curPath = path.join(pathToFolder, file);
341
- // if (fs.lstatSync(curPath).isDirectory()) { // recurse
342
- // this.deleteFolderRecursive(curPath);
343
- // } else { // delete file
344
- // fs.unlinkSync(curPath);
345
- // }
346
- // });
347
- // fs.rmdirSync(pathToFolder);
348
- // }
349
- // };
350
- move(from, to) {
351
- //#region @backendFunc
352
- if (!tnp_core_1.fse.existsSync(from)) {
353
- index_1.Helpers.warn(`[move] File or folder doesnt not exists: ${from}`);
354
- return;
355
- }
356
- if (!tnp_core_1.path.isAbsolute(from)) {
357
- index_1.Helpers.warn(`[move] Source path is not absolute: ${from}`);
358
- return;
359
- }
360
- if (!tnp_core_1.path.isAbsolute(to)) {
361
- index_1.Helpers.warn(`[move] Destination path is not absolute: ${to}`);
362
- return;
363
- }
364
- if (index_1.Helpers.isUnexistedLink(to)) {
365
- index_1.Helpers.remove(to);
366
- }
367
- if (index_1.Helpers.isUnexistedLink(tnp_core_1.path.dirname(to))) {
368
- index_1.Helpers.remove(tnp_core_1.path.dirname(to));
369
- }
370
- // if (!Helpers.exists(path.dirname(to))) {
371
- // if (Helpers.isUnexistedLink(path.dirname(to))) {
372
- // Helpers.remove(path.dirname(to));
373
- // } else {
374
- // Helpers.remove(path.dirname(to));
375
- // Helpers.mkdirp(path.dirname(to));
376
- // }
377
- // }
378
- // if(Helpers.isSymlinkFileExitedOrUnexisted(to)) {
379
- // Helpers.error(`You are trying to move into symlink location:
380
- // from: ${from}
381
- // to: ${to}
382
- // `)
383
- // }
384
- while (true) {
385
- try {
386
- tnp_core_1.fse.moveSync(from, to, {
387
- overwrite: true,
388
- });
389
- break;
390
- }
391
- catch (error) {
392
- if (global['tnpNonInteractive']) {
393
- console.log(error);
394
- index_1.Helpers.error(`[${tnp_config_1.config.frameworkName}-helpers] Not able to move files
395
-
396
- from: ${from}
397
- to: ${to}
398
-
399
- `);
400
- }
401
- index_1.Helpers.info(`
402
- Moving things:
403
-
404
- from: ${from}
405
- to: ${to}
406
-
407
- `);
408
- index_1.Helpers.pressKeyAndContinue('Press any to try again this action');
409
- }
410
- }
411
- //#endregion
412
- }
413
- findChildren(location, createFn, options) {
414
- //#region @backendFunc
415
- const { allowAllNames } = options || {};
416
- let folders = index_1.Helpers.values(tnp_config_1.config.folder);
417
- folders = folders.filter(f => ![
418
- tnp_config_1.config.folder.shared,
419
- // TODO add something more here ?
420
- ].includes(f));
421
- const notAllowed = [
422
- '.vscode',
423
- 'node_modules',
424
- ...(allowAllNames
425
- ? []
426
- : [
427
- ...folders,
428
- 'e2e',
429
- 'tmp.*',
430
- 'dist.*',
431
- 'tests',
432
- 'module',
433
- 'browser',
434
- 'bundle*',
435
- 'components',
436
- '.git',
437
- 'bin',
438
- 'custom',
439
- ]),
440
- ]
441
- .filter(f => {
442
- return ![tnp_config_1.config.folder.external].includes(f) && tnp_core_1._.isString(f);
443
- })
444
- .map(s => new RegExp(`^${index_1.Helpers.escapeStringForRegEx(s)}$`));
445
- const isDirectory = (source) => tnp_core_1.fse.lstatSync(source).isDirectory();
446
- const getDirectories = (source) => tnp_core_1.fse
447
- .readdirSync(source)
448
- .map(name => tnp_core_1.path.join(source, name))
449
- .filter(isDirectory);
450
- let subdirectories = getDirectories(location).filter(f => {
451
- const folderNam = tnp_core_1.path.basename(f);
452
- const allowed = notAllowed.filter(p => p.test(folderNam)).length === 0;
453
- return allowed;
454
- });
455
- // console.log(subdirectories)
456
- return subdirectories
457
- .map(dir => {
458
- // console.log('child:', dir)
459
- return createFn(dir);
460
- })
461
- .filter(c => !!c);
462
- //#endregion
463
- }
464
- /**
465
- * @deprecated
466
- */
467
- findChildrenNavi(location, createFn) {
468
- //#region @backendFunc
469
- if (!tnp_core_1.fse.existsSync(location)) {
470
- return [];
471
- }
472
- const notAllowed = [
473
- '.vscode',
474
- 'node_modules',
475
- ...index_1.Helpers.values(tnp_config_1.config.folder),
476
- 'e2e',
477
- 'tmp.*',
478
- 'dist.*',
479
- 'tests',
480
- 'module',
481
- 'browser',
482
- 'bundle*',
483
- 'components',
484
- '.git',
485
- '.build',
486
- 'bin',
487
- 'custom',
488
- ].map(s => new RegExp(s));
489
- const isDirectory = source => tnp_core_1.fse.lstatSync(source).isDirectory();
490
- const getDirectories = source => tnp_core_1.fse
491
- .readdirSync(source)
492
- .map(name => tnp_core_1.path.join(source, name))
493
- .filter(isDirectory);
494
- let subdirectories = getDirectories(location).filter(f => {
495
- const folderName = tnp_core_1.path.basename(f);
496
- if (/.*es\-.*/.test(folderName)) {
497
- return true;
498
- }
499
- return notAllowed.filter(p => p.test(folderName)).length === 0;
500
- });
501
- return subdirectories
502
- .map(dir => {
503
- return createFn(dir);
504
- })
505
- .filter(c => !!c);
506
- //#endregion
507
- }
508
- /**
509
- * get all files from folder
510
- * absolute paths
511
- */
512
- getRecrusiveFilesFrom(dir, ommitFolders = [], options) {
513
- //#region @backendFunc
514
- options = options ? options : {};
515
- // const withNameOnly = options.withNameOnly;
516
- let files = [];
517
- const readedFilesAndFolders = tnp_core_1.fse.existsSync(dir)
518
- ? tnp_core_1.fse.readdirSync(dir)
519
- : [];
520
- const readed = readedFilesAndFolders
521
- .map(relativePathToFile => {
522
- const fullPath = (0, tnp_core_1.crossPlatformPath)([dir, relativePathToFile]);
523
- // console.log(`is direcotry ${fse.lstatSync(fullPath).isDirectory()} `, fullPath)
524
- if (tnp_core_1.fse.lstatSync(fullPath).isDirectory()) {
525
- if (ommitFolders.includes(tnp_core_1.path.basename(fullPath)) ||
526
- ommitFolders.includes(tnp_core_1.path.basename(tnp_core_1.path.dirname(fullPath)))) {
527
- // Helpers.log(`Omitting: ${fullPath}`)
528
- }
529
- else {
530
- index_1.Helpers.getRecrusiveFilesFrom(fullPath, ommitFolders, options).forEach(aa => files.push(aa));
531
- }
532
- return;
533
- }
534
- return fullPath;
535
- })
536
- .filter(f => !!f);
537
- if (Array.isArray(readed)) {
538
- readed.forEach(r => files.push(r));
539
- }
540
- return files;
541
- //#endregion
542
- }
543
- checkIfNameAllowedForTaonProj(folderName) {
544
- //#region @backendFunc
545
- const notAllowed = [
546
- '^.vscode$',
547
- '^node_modules$',
548
- ...index_1.Helpers.values(tnp_config_1.config.tempFolders).map(v => `^${v}$`),
549
- '^e2e$',
550
- '^tmp.*',
551
- '^dist.*',
552
- '^tests$',
553
- '^module$',
554
- '^browser',
555
- 'bundle*',
556
- '^components$',
557
- '.git',
558
- '^bin$',
559
- '^custom$',
560
- '^linked-repos$',
561
- ].map(s => new RegExp(s));
562
- return notAllowed.filter(p => p.test(folderName)).length === 0;
563
- //#endregion
564
- }
565
- getLinesFromFiles(filename, lineCount) {
566
- //#region @backendFunc
567
- return new Promise((resolve, reject) => {
568
- let stream = tnp_core_1.fse.createReadStream(filename, {
569
- flags: 'r',
570
- encoding: 'utf-8',
571
- fd: null,
572
- mode: 438, // 0666 in Octal
573
- // bufferSize: 64 * 1024 as any
574
- });
575
- let data = '';
576
- let lines = [];
577
- stream.on('data', function (moreData) {
578
- data += moreData;
579
- lines = data.split('\n');
580
- // probably that last line is "corrupt" - halfway read - why > not >=
581
- if (lines.length > lineCount + 1) {
582
- stream.destroy();
583
- lines = lines.slice(0, lineCount); // junk as above
584
- resolve(lines);
585
- }
586
- });
587
- stream.on('error', function () {
588
- reject(`Error reading ${filename}`);
589
- });
590
- stream.on('end', function () {
591
- resolve(lines);
592
- });
593
- });
594
- //#endregion
595
- }
596
- /**
597
- * Get the most recent changes file in direcory
598
- * @param dir absoulute path to file
599
- */
600
- getMostRecentFileName(dir) {
601
- //#region @backendFunc
602
- let files = index_1.Helpers.getRecrusiveFilesFrom(dir);
603
- // use underscore for max()
604
- return underscore.max(files, f => {
605
- // TODO refactor to lodash
606
- // console.log(f);
607
- // ctime = creation time is used
608
- // replace with mtime for modification time
609
- // console.log( `${fse.statSync(f).mtimeMs} for ${f}` )
610
- return tnp_core_1.fse.statSync(f).mtimeMs;
611
- });
612
- //#endregion
613
- }
614
- getMostRecentFilesNames(dir) {
615
- //#region @backendFunc
616
- const allFiles = index_1.Helpers.getRecrusiveFilesFrom(dir);
617
- const mrf = index_1.Helpers.getMostRecentFileName(dir);
618
- const mfrMtime = tnp_core_1.fse.lstatSync(mrf).mtimeMs;
619
- return allFiles.filter(f => {
620
- const info = tnp_core_1.fse.lstatSync(f);
621
- return info.mtimeMs === mfrMtime && !info.isDirectory();
622
- });
623
- //#endregion
624
- }
625
- removeExcept(fromPath, exceptFolderAndFiles) {
626
- //#region @backendFunc
627
- tnp_core_1.fse
628
- .readdirSync(fromPath)
629
- .filter(f => {
630
- return !exceptFolderAndFiles.includes(f);
631
- })
632
- .map(f => tnp_core_1.path.join(fromPath, f))
633
- .forEach(af => index_1.Helpers.removeFolderIfExists(af));
634
- glob
635
- .sync(`${fromPath}/*.*`)
636
- .filter(f => {
637
- return !exceptFolderAndFiles.includes(tnp_core_1.path.basename(f));
638
- })
639
- .forEach(af => index_1.Helpers.removeFileIfExists(af));
640
- //#endregion
641
- }
642
- copy(sourceDir, destinationDir, options) {
643
- //#region @backendFunc
644
- index_1.Helpers.log(`Copying from:
645
-
646
- ${sourceDir}
647
- to
648
- ${destinationDir}
649
-
650
- `, 1);
651
- index_1.Helpers.log(options, 1);
652
- // sourceDir = sourceDir ? (sourceDir.replace(/\/$/, '')) : sourceDir;
653
- // destinationDir = destinationDir ? (destinationDir.replace(/\/$/, '')) : destinationDir;
654
- if (!tnp_core_1.fse.existsSync(sourceDir)) {
655
- index_1.Helpers.warn(`[taon-helper][copy] Source dir doesnt exist: ${sourceDir} for destination: ${destinationDir}`);
656
- return;
657
- }
658
- if (!tnp_core_1.fse.existsSync(tnp_core_1.path.dirname(destinationDir))) {
659
- if (index_1.Helpers.isUnexistedLink(tnp_core_1.path.dirname(destinationDir))) {
660
- index_1.Helpers.removeFileIfExists(tnp_core_1.path.dirname(destinationDir));
661
- }
662
- index_1.Helpers.mkdirp(tnp_core_1.path.dirname(destinationDir));
663
- }
664
- if (!options) {
665
- options = {};
666
- }
667
- if (tnp_core_1._.isUndefined(options.overwrite)) {
668
- options.overwrite = true;
669
- }
670
- if (tnp_core_1._.isUndefined(options.recursive)) {
671
- options.recursive = true;
672
- }
673
- if (tnp_core_1._.isUndefined(options.useTempFolder)) {
674
- options.useTempFolder = false;
675
- }
676
- if (options.copySymlinksAsFiles) {
677
- options['dereference'] = true;
678
- }
679
- if (!options.omitFolders) {
680
- options.omitFolders = [];
681
- }
682
- if (options.asSeparatedFilesSymlinkAsFile) {
683
- options.asSeparatedFilesSymlinkAsFile = true;
684
- }
685
- // const [srcStat, destStat] = [
686
- // fse.existsSync(sourceDir) && fse.statSync(sourceDir),
687
- // fse.existsSync(destinationDir) && fse.statSync(destinationDir),
688
- // ];
689
- // if (destStat && destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {
690
- // Helpers.warn(`[taon-helper][copy] Same location stats.. Trying to copy same source and destination:
691
- // from: ${sourceDir}
692
- // to: ${destinationDir}
693
- // `);
694
- // return;
695
- // }
696
- if (tnp_core_1._.isArray(options.omitFolders) &&
697
- options.omitFolders.length >= 1 &&
698
- tnp_core_1._.isNil(options.filter) &&
699
- tnp_core_1._.isString(options.omitFoldersBaseFolder) &&
700
- tnp_core_1.path.isAbsolute(options.omitFoldersBaseFolder)) {
701
- options.filter = index_1.Helpers.filterDontCopy(options.omitFolders, options.omitFoldersBaseFolder);
702
- }
703
- if (options.copySymlinksAsFilesDeleteUnexistedLinksFromSourceFirst) {
704
- const files = index_1.Helpers.filesFrom(sourceDir, true, true);
705
- for (let index = 0; index < files.length; index++) {
706
- const file = files[index];
707
- if (index_1.Helpers.isUnexistedLink(file)) {
708
- index_1.Helpers.remove(file, true);
709
- }
710
- }
711
- }
712
- if ((0, tnp_core_1.crossPlatformPath)(sourceDir) === (0, tnp_core_1.crossPlatformPath)(destinationDir) ||
713
- (0, tnp_core_1.crossPlatformPath)(tnp_core_1.path.resolve(sourceDir)) ===
714
- (0, tnp_core_1.crossPlatformPath)(tnp_core_1.path.resolve(destinationDir))) {
715
- index_1.Helpers.warn(`[taon-helper][copy] Trying to copy same source and destination
716
- from: ${sourceDir}
717
- to: ${destinationDir}
718
- `);
719
- }
720
- else {
721
- // Helpers.warn('filter', _.isFunction(options.filter));
722
- // Helpers.warn('sourceDir', sourceDir);
723
- // Helpers.warn('destinationDir', destinationDir);
724
- // Helpers.log(JSON.stringify(options))
725
- // try {
726
- if (options.useTempFolder) {
727
- let tempDestination = `${tnp_core_1.os.platform() === 'darwin' ? '/private/tmp' : '/tmp'}/${tnp_core_1._.camelCase(destinationDir)}`;
728
- index_1.Helpers.removeFolderIfExists(tempDestination);
729
- tnp_core_1.fse.copySync(sourceDir, tempDestination, options);
730
- tnp_core_1.fse.copySync(tempDestination, destinationDir, options);
731
- }
732
- else {
733
- if ((0, tnp_core_1.crossPlatformPath)(sourceDir) ===
734
- (0, tnp_core_1.crossPlatformPath)(tnp_core_1.path.resolve(sourceDir)) &&
735
- index_1.Helpers.isExistedSymlink(sourceDir) &&
736
- !index_1.Helpers.exists(tnp_core_1.fse.readlinkSync(sourceDir))) {
737
- index_1.Helpers.warn(`[taon-helpers] Not copying empty link from: ${sourceDir}
738
- `);
739
- }
740
- else {
741
- const copyFn = () => {
742
- try {
743
- if (options.asSeparatedFiles) {
744
- const copyRecFn = (cwdForFiles) => {
745
- const files = index_1.Helpers.getRecrusiveFilesFrom(cwdForFiles, options.omitFolders);
746
- for (let index = 0; index < files.length; index++) {
747
- const from = files[index];
748
- const to = from.replace(sourceDir, destinationDir);
749
- if (index_1.Helpers.isFolder(from)) {
750
- if (options.omitFolders.includes(tnp_core_1.path.basename(tnp_core_1.path.dirname(from))) ||
751
- options.omitFolders.includes(tnp_core_1.path.basename(from))) {
752
- continue;
753
- }
754
- else {
755
- copyRecFn(from);
756
- }
757
- }
758
- else {
759
- const copyFileFn = () => {
760
- if (!options.asSeparatedFilesSymlinkAsFile &&
761
- index_1.Helpers.isExistedSymlink(from)) {
762
- index_1.Helpers.createSymLink(from, to);
763
- }
764
- else {
765
- index_1.Helpers.copyFile(from, to);
766
- }
767
- };
768
- if (options.asSeparatedFilesAllowNotCopied) {
769
- try {
770
- copyFileFn();
771
- }
772
- catch (e) { }
773
- }
774
- else {
775
- copyFileFn();
776
- }
777
- }
778
- }
779
- };
780
- copyRecFn(sourceDir);
781
- }
782
- else {
783
- tnp_core_1.fse.copySync(sourceDir, destinationDir, options);
784
- }
785
- }
786
- catch (error) {
787
- const exitOnError = global['tnpNonInteractive'];
788
- index_1.Helpers.log(error);
789
- if (!options.dontAskOnError) {
790
- index_1.Helpers.error(`[taon-helper] Not able to copy folder:
791
- from: ${(0, tnp_core_1.crossPlatformPath)(sourceDir)}
792
- to: ${(0, tnp_core_1.crossPlatformPath)(destinationDir)}
793
- options: ${tnp_core_1.json5.stringify(options)}
794
- error: ${error?.message}
795
- `, !exitOnError);
796
- index_1.Helpers.pressKeyAndContinue(`Press any key to repeat copy action...`);
797
- }
798
- copyFn();
799
- }
800
- };
801
- if (process.platform === 'win32') {
802
- while (true) {
803
- try {
804
- copyFn();
805
- break;
806
- }
807
- catch (error) {
808
- index_1.Helpers.warn(`WARNING not able to copy .. trying again`);
809
- index_1.Helpers.sleep(1);
810
- continue;
811
- }
812
- }
813
- }
814
- else {
815
- copyFn();
816
- }
817
- }
818
- }
819
- // } catch (error) {
820
- // console.trace(error);
821
- // process.exit(0)
822
- // }
823
- }
824
- //#endregion
825
- }
826
- filterDontCopy(basePathFoldersTosSkip, projectOrBasepath) {
827
- //#region @backendFunc
828
- return (src, dest) => {
829
- // console.log('src', src)
830
- src = (0, tnp_core_1.crossPlatformPath)(src);
831
- const baseFolder = tnp_core_1._.first((0, tnp_core_1.crossPlatformPath)(src)
832
- .replace((0, tnp_core_1.crossPlatformPath)(projectOrBasepath), '')
833
- .replace(/^\//, '')
834
- .split('/'));
835
- // console.log('baseFolder', baseFolder)
836
- if (!baseFolder || baseFolder.trim() === '') {
837
- return true;
838
- }
839
- const isAllowed = tnp_core_1._.isUndefined(basePathFoldersTosSkip.find(f => baseFolder.startsWith((0, tnp_core_1.crossPlatformPath)(f))));
840
- // console.log('isAllowed', isAllowed)
841
- return isAllowed;
842
- };
843
- //#endregion
844
- }
845
- filterOnlyCopy(basePathFoldersOnlyToInclude, projectOrBasepath) {
846
- //#region @backendFunc
847
- return (src, dest) => {
848
- src = (0, tnp_core_1.crossPlatformPath)(src);
849
- const baseFolder = tnp_core_1._.first((0, tnp_core_1.crossPlatformPath)(src)
850
- .replace((0, tnp_core_1.crossPlatformPath)(projectOrBasepath), '')
851
- .replace(/^\//, '')
852
- .split('/'));
853
- if (!baseFolder || baseFolder.trim() === '') {
854
- return true;
855
- }
856
- const isAllowed = !tnp_core_1._.isUndefined(basePathFoldersOnlyToInclude.find(f => baseFolder.startsWith((0, tnp_core_1.crossPlatformPath)(f))));
857
- return isAllowed;
858
- };
859
- //#endregion
860
- }
861
- copyFile(sourcePath, destinationPath, options) {
862
- //#region @backendFunc
863
- if (tnp_core_1._.isUndefined(options)) {
864
- options = {};
865
- }
866
- if (tnp_core_1._.isUndefined(options.debugMode)) {
867
- options.debugMode = false;
868
- }
869
- if (tnp_core_1._.isUndefined(options.debugMode)) {
870
- options.fast = true;
871
- }
872
- if (tnp_core_1._.isUndefined(options.dontCopySameContent)) {
873
- options.dontCopySameContent = true;
874
- }
875
- const { debugMode, fast, transformTextFn, dontCopySameContent } = options;
876
- if (tnp_core_1._.isFunction(transformTextFn) && fast) {
877
- index_1.Helpers.error(`[taon-helpers][copyFile] You cannot use transformTextFn in fast mode`);
878
- }
879
- if (!tnp_core_1.fse.existsSync(sourcePath)) {
880
- index_1.Helpers.logWarn(`[taon-helpers][copyFile] No able to find source of ${sourcePath}`);
881
- return false;
882
- }
883
- if (tnp_core_1.fse.lstatSync(sourcePath).isDirectory()) {
884
- index_1.Helpers.warn(`[taon-helpers][copyFile] Trying to copy directory as file: ${sourcePath}`, false);
885
- return false;
886
- }
887
- if (sourcePath === destinationPath) {
888
- index_1.Helpers.warn(`[taon-helpers][copyFile] Trying to copy same file ${sourcePath}`);
889
- return false;
890
- }
891
- let destDirPath = tnp_core_1.path.dirname(destinationPath);
892
- if (index_1.Helpers.isFolder(destinationPath)) {
893
- index_1.Helpers.removeFolderIfExists(destinationPath);
894
- }
895
- if (!index_1.Helpers.isSymlinkFileExitedOrUnexisted(destDirPath) &&
896
- !tnp_core_1.fse.existsSync(destDirPath)) {
897
- index_1.Helpers.mkdirp(destDirPath);
898
- }
899
- //#region it is good code
900
- if (index_1.Helpers.isExistedSymlink(destDirPath)) {
901
- destDirPath = tnp_core_1.fse.realpathSync(destDirPath);
902
- const newDestinationPath = (0, tnp_core_1.crossPlatformPath)(tnp_core_1.path.join(destDirPath, tnp_core_1.path.basename(destinationPath)));
903
- if (index_1.Helpers.isFolder(newDestinationPath)) {
904
- index_1.Helpers.removeFolderIfExists(newDestinationPath);
905
- }
906
- destinationPath = newDestinationPath;
907
- }
908
- //#endregion
909
- if (dontCopySameContent && tnp_core_1.fse.existsSync(destinationPath)) {
910
- const destinationContent = index_1.Helpers.readFile(destinationPath);
911
- const sourceContent = index_1.Helpers.readFile(sourcePath).toString();
912
- if (destinationContent === sourceContent) {
913
- // @REMEMBER uncomment if any problem
914
- // Helpers.log(`Destination has the same content as source: ${path.basename(sourcePath)}`);
915
- return false;
916
- }
917
- }
918
- debugMode &&
919
- index_1.Helpers.log(`path.extname(sourcePath) ${tnp_core_1.path.extname(sourcePath)}`);
920
- if (fast || !tnp_config_1.extAllowedToReplace.includes(tnp_core_1.path.extname(sourcePath))) {
921
- tnp_core_1.fse.copyFileSync(sourcePath, destinationPath);
922
- }
923
- else {
924
- let sourceData = index_1.Helpers.readFile(sourcePath).toString();
925
- if (tnp_core_1._.isFunction(transformTextFn)) {
926
- sourceData = transformTextFn(sourceData);
927
- }
928
- debugMode &&
929
- index_1.Helpers.log(`
930
- [taon-helpers][copyFile] Write to: ${destinationPath} file:
931
- ============================================================================================
932
- ${sourceData}
933
- ============================================================================================
934
- `);
935
- index_1.Helpers.writeFile(destinationPath, sourceData);
936
- }
937
- return true;
938
- //#endregion
939
- }
940
- /**
941
- * get real absolute path
942
- */
943
- resolve(fileOrFolderPath) {
944
- //#region @backendFunc
945
- if (fileOrFolderPath.startsWith('~')) {
946
- fileOrFolderPath = (0, tnp_core_1.crossPlatformPath)([
947
- tnp_core_1.os.homedir(),
948
- fileOrFolderPath.replace(`~/`, ''),
949
- ]);
950
- }
951
- return (0, tnp_core_1.crossPlatformPath)(tnp_core_1.path.resolve(fileOrFolderPath));
952
- //#endregion
953
- }
954
- }
955
- exports.HelpersFileFolders = HelpersFileFolders;
956
- //# sourceMappingURL=helpers-file-folders.backend.js.map