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.
- package/assets/shared/shared_folder_info.txt +1 -1
- package/browser/README.md +24 -24
- package/browser/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
- package/browser/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
- package/browser/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
- package/browser/esm2022/lib/base/classes/base-cli-worker.mjs +14 -4
- package/browser/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
- package/browser/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
- package/browser/esm2022/lib/base/classes/base-git.mjs +244 -4
- package/browser/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
- package/browser/esm2022/lib/base/classes/base-library-build.mjs +35 -10
- package/browser/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
- package/browser/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
- package/browser/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -430
- package/browser/esm2022/lib/base/classes/base-package-json.mjs +340 -0
- package/browser/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
- package/browser/esm2022/lib/base/classes/base-project-resolver.mjs +2 -11
- package/browser/esm2022/lib/base/classes/base-project.mjs +83 -87
- package/browser/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
- package/browser/esm2022/lib/base/classes/base-release-process.mjs +34 -36
- package/browser/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
- package/browser/esm2022/lib/base/classes/base-vscode.mjs +31 -1
- package/browser/esm2022/lib/base/classes/index.mjs +5 -1
- package/browser/esm2022/lib/base/commit-data.mjs +21 -4
- package/browser/esm2022/lib/base/core-project.mjs +3 -3
- package/browser/esm2022/lib/base/linked-project.mjs +4 -4
- package/browser/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
- package/browser/esm2022/lib/base/translate.mjs +566 -0
- package/browser/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
- package/browser/esm2022/lib/helpers/helpers.mjs +12 -6
- package/browser/esm2022/lib/index.mjs +2 -4
- package/browser/esm2022/lib/models.mjs +173 -3
- package/browser/esm2022/lib/utils.mjs +402 -41
- package/browser/fesm2022/tnp-helpers.mjs +4616 -2904
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base/classes/base-bower-json.d.ts +35 -0
- package/browser/lib/base/classes/base-cli-worker.d.ts +2 -2
- package/browser/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
- package/browser/lib/base/classes/base-feature-for-project.d.ts +2 -1
- package/browser/lib/base/classes/base-git.d.ts +42 -5
- package/browser/lib/base/classes/base-json-file-reader.d.ts +72 -0
- package/browser/lib/base/classes/base-library-build.d.ts +8 -11
- package/browser/lib/base/classes/base-linked-projects.d.ts +1 -2
- package/browser/lib/base/classes/base-node-modules.d.ts +56 -0
- package/browser/lib/base/classes/base-npm-helpers.d.ts +29 -108
- package/browser/lib/base/classes/base-package-json.d.ts +107 -0
- package/browser/lib/base/classes/base-process-manager.d.ts +31 -0
- package/browser/lib/base/classes/base-project-resolver.d.ts +2 -2
- package/browser/lib/base/classes/base-project.d.ts +17 -18
- package/browser/lib/base/classes/base-quick-fixes.d.ts +3 -1
- package/browser/lib/base/classes/base-release-process.d.ts +15 -13
- package/browser/lib/base/classes/{base-github-pages.d.ts → base-static-pages.d.ts} +3 -3
- package/browser/lib/base/classes/base-vscode.d.ts +4 -0
- package/browser/lib/base/classes/index.d.ts +5 -1
- package/browser/lib/base/commit-data.d.ts +14 -1
- package/browser/lib/base/core-project.d.ts +1 -1
- package/browser/lib/base/linked-project.d.ts +1 -1
- package/browser/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
- package/browser/lib/base/translate.d.ts +228 -0
- package/browser/lib/helpers/helpers-array-obj.d.ts +3 -0
- package/browser/lib/helpers/helpers.d.ts +12 -8
- package/browser/lib/index.d.ts +1 -3
- package/browser/lib/models.d.ts +68 -8
- package/browser/lib/utils.d.ts +72 -13
- package/client/README.md +24 -24
- package/client/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
- package/client/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
- package/client/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
- package/client/esm2022/lib/base/classes/base-cli-worker.mjs +14 -4
- package/client/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
- package/client/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
- package/client/esm2022/lib/base/classes/base-git.mjs +244 -4
- package/client/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
- package/client/esm2022/lib/base/classes/base-library-build.mjs +35 -10
- package/client/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
- package/client/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
- package/client/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -430
- package/client/esm2022/lib/base/classes/base-package-json.mjs +340 -0
- package/client/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
- package/client/esm2022/lib/base/classes/base-project-resolver.mjs +2 -11
- package/client/esm2022/lib/base/classes/base-project.mjs +83 -87
- package/client/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
- package/client/esm2022/lib/base/classes/base-release-process.mjs +34 -36
- package/client/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
- package/client/esm2022/lib/base/classes/base-vscode.mjs +31 -1
- package/client/esm2022/lib/base/classes/index.mjs +5 -1
- package/client/esm2022/lib/base/commit-data.mjs +21 -4
- package/client/esm2022/lib/base/core-project.mjs +3 -3
- package/client/esm2022/lib/base/linked-project.mjs +4 -4
- package/client/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
- package/client/esm2022/lib/base/translate.mjs +566 -0
- package/client/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
- package/client/esm2022/lib/helpers/helpers.mjs +12 -6
- package/client/esm2022/lib/index.mjs +2 -4
- package/client/esm2022/lib/models.mjs +173 -3
- package/client/esm2022/lib/utils.mjs +402 -41
- package/client/fesm2022/tnp-helpers.mjs +4616 -2904
- package/client/fesm2022/tnp-helpers.mjs.map +1 -1
- package/client/lib/base/classes/base-bower-json.d.ts +35 -0
- package/client/lib/base/classes/base-cli-worker.d.ts +2 -2
- package/client/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
- package/client/lib/base/classes/base-feature-for-project.d.ts +2 -1
- package/client/lib/base/classes/base-git.d.ts +42 -5
- package/client/lib/base/classes/base-json-file-reader.d.ts +72 -0
- package/client/lib/base/classes/base-library-build.d.ts +8 -11
- package/client/lib/base/classes/base-linked-projects.d.ts +1 -2
- package/client/lib/base/classes/base-node-modules.d.ts +56 -0
- package/client/lib/base/classes/base-npm-helpers.d.ts +29 -108
- package/client/lib/base/classes/base-package-json.d.ts +107 -0
- package/client/lib/base/classes/base-process-manager.d.ts +31 -0
- package/client/lib/base/classes/base-project-resolver.d.ts +2 -2
- package/client/lib/base/classes/base-project.d.ts +17 -18
- package/client/lib/base/classes/base-quick-fixes.d.ts +3 -1
- package/client/lib/base/classes/base-release-process.d.ts +15 -13
- package/{websql/lib/base/classes/base-github-pages.d.ts → client/lib/base/classes/base-static-pages.d.ts} +3 -3
- package/client/lib/base/classes/base-vscode.d.ts +4 -0
- package/client/lib/base/classes/index.d.ts +5 -1
- package/client/lib/base/commit-data.d.ts +14 -1
- package/client/lib/base/core-project.d.ts +1 -1
- package/client/lib/base/linked-project.d.ts +1 -1
- package/client/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
- package/client/lib/base/translate.d.ts +228 -0
- package/client/lib/helpers/helpers-array-obj.d.ts +3 -0
- package/client/lib/helpers/helpers.d.ts +12 -8
- package/client/lib/index.d.ts +1 -3
- package/client/lib/models.d.ts +68 -8
- package/client/lib/utils.d.ts +72 -13
- package/index.js +15 -2
- package/index.js.map +1 -1
- package/lib/base/base-cli-worker-config.d.ts +27 -0
- package/lib/base/base-cli-worker-config.js +53 -0
- package/lib/base/base-cli-worker-config.js.map +1 -0
- package/lib/base/base-cli-worker-controller.d.ts +15 -0
- package/lib/base/base-cli-worker-controller.js +154 -0
- package/lib/base/base-cli-worker-controller.js.map +1 -0
- package/lib/base/base-cli-worker.d.ts +82 -0
- package/lib/base/base-cli-worker.js +654 -0
- package/lib/base/base-cli-worker.js.map +1 -0
- package/lib/base/base-command-line.backend.d.ts +174 -0
- package/lib/base/base-command-line.backend.js +2221 -0
- package/lib/base/base-command-line.backend.js.map +1 -0
- package/lib/base/base-compiler-for-project.d.ts +7 -0
- package/lib/base/base-compiler-for-project.js +62 -0
- package/lib/base/base-compiler-for-project.js.map +1 -0
- package/lib/base/base-db.d.ts +12 -0
- package/lib/base/base-db.js +74 -0
- package/lib/base/base-db.js.map +1 -0
- package/lib/base/base-debounce-compiler-for-project.d.ts +28 -0
- package/lib/base/base-debounce-compiler-for-project.js +82 -0
- package/lib/base/base-debounce-compiler-for-project.js.map +1 -0
- package/lib/base/base-detached-service.d.ts +6 -0
- package/lib/base/base-detached-service.js +16 -0
- package/lib/base/base-detached-service.js.map +1 -0
- package/lib/base/base-feature-for-project.d.ts +5 -0
- package/lib/base/base-feature-for-project.js +11 -0
- package/lib/base/base-feature-for-project.js.map +1 -0
- package/lib/base/base-git.d.ts +148 -0
- package/lib/base/base-git.js +1202 -0
- package/lib/base/base-git.js.map +1 -0
- package/{client/lib/base/classes → lib/base}/base-github-pages.d.ts +4 -5
- package/lib/base/base-github-pages.js +173 -0
- package/lib/base/base-github-pages.js.map +1 -0
- package/lib/base/base-ignore-hide.d.ts +14 -0
- package/lib/base/base-ignore-hide.js +55 -0
- package/lib/base/base-ignore-hide.js.map +1 -0
- package/lib/base/base-library-build.d.ts +65 -0
- package/lib/base/base-library-build.js +717 -0
- package/lib/base/base-library-build.js.map +1 -0
- package/lib/base/base-linked-projects.d.ts +24 -0
- package/lib/base/base-linked-projects.js +408 -0
- package/lib/base/base-linked-projects.js.map +1 -0
- package/lib/base/base-npm-helpers.d.ts +128 -0
- package/lib/base/base-npm-helpers.js +774 -0
- package/lib/base/base-npm-helpers.js.map +1 -0
- package/lib/base/base-project-resolver.d.ts +41 -0
- package/lib/base/base-project-resolver.js +308 -0
- package/lib/base/base-project-resolver.js.map +1 -0
- package/lib/base/base-project.d.ts +244 -0
- package/lib/base/base-project.js +1223 -0
- package/lib/base/base-project.js.map +1 -0
- package/lib/base/base-quick-fixes.d.ts +6 -0
- package/lib/base/base-quick-fixes.js +31 -0
- package/lib/base/base-quick-fixes.js.map +1 -0
- package/lib/base/base-release-process.d.ts +69 -0
- package/lib/base/base-release-process.js +913 -0
- package/lib/base/base-release-process.js.map +1 -0
- package/lib/base/base-start-config.backend.d.ts +36 -0
- package/lib/base/base-start-config.backend.js +167 -0
- package/lib/base/base-start-config.backend.js.map +1 -0
- package/lib/base/base-vscode.d.ts +12 -0
- package/lib/base/base-vscode.js +139 -0
- package/lib/base/base-vscode.js.map +1 -0
- package/lib/base/classes/base-bower-json.d.ts +34 -0
- package/lib/base/classes/base-bower-json.js +19 -0
- package/lib/base/classes/base-bower-json.js.map +1 -0
- package/lib/base/classes/base-cli-worker-config.js +35 -24
- package/lib/base/classes/base-cli-worker-config.js.map +1 -1
- package/lib/base/classes/base-cli-worker-controller.js +98 -128
- package/lib/base/classes/base-cli-worker-controller.js.map +1 -1
- package/lib/base/classes/base-cli-worker.d.ts +2 -2
- package/lib/base/classes/base-cli-worker.js +402 -606
- package/lib/base/classes/base-cli-worker.js.map +1 -1
- package/lib/base/classes/base-command-line-feature.backend.d.ts +5 -9
- package/lib/base/classes/base-command-line-feature.backend.js +73 -132
- package/lib/base/classes/base-command-line-feature.backend.js.map +1 -1
- package/lib/base/classes/base-command-line.backend.d.ts +175 -0
- package/lib/base/classes/base-command-line.backend.js +2235 -0
- package/lib/base/classes/base-command-line.backend.js.map +1 -0
- package/lib/base/classes/base-compiler-for-project.js +27 -32
- package/lib/base/classes/base-compiler-for-project.js.map +1 -1
- package/lib/base/classes/base-db.js +43 -60
- package/lib/base/classes/base-db.js.map +1 -1
- package/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
- package/lib/base/classes/base-debounce-compiler-for-project.js +44 -70
- package/lib/base/classes/base-debounce-compiler-for-project.js.map +1 -1
- package/lib/base/classes/base-detached-service.js.map +1 -1
- package/lib/base/classes/base-feature-for-project.d.ts +2 -1
- package/lib/base/classes/base-feature-for-project.js +7 -4
- package/lib/base/classes/base-feature-for-project.js.map +1 -1
- package/lib/base/classes/base-git.d.ts +40 -3
- package/lib/base/classes/base-git.js +885 -943
- package/lib/base/classes/base-git.js.map +1 -1
- package/lib/base/classes/base-github-pages.js.map +1 -1
- package/lib/base/classes/base-global-command-line.backend.d.ts +10 -2
- package/lib/base/classes/base-global-command-line.backend.js +1058 -2011
- package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
- package/lib/base/classes/base-ignore-hide.d.ts +2 -2
- package/lib/base/classes/base-ignore-hide.js +24 -28
- package/lib/base/classes/base-ignore-hide.js.map +1 -1
- package/lib/base/classes/base-json-file-reader.d.ts +71 -0
- package/lib/base/classes/base-json-file-reader.js +141 -0
- package/lib/base/classes/base-json-file-reader.js.map +1 -0
- package/lib/base/classes/base-library-build.d.ts +8 -12
- package/lib/base/classes/base-library-build.js +433 -638
- package/lib/base/classes/base-library-build.js.map +1 -1
- package/lib/base/classes/base-linked-projects.d.ts +1 -3
- package/lib/base/classes/base-linked-projects.js +200 -314
- package/lib/base/classes/base-linked-projects.js.map +1 -1
- package/lib/base/classes/base-node-modules.d.ts +55 -0
- package/lib/base/classes/base-node-modules.js +415 -0
- package/lib/base/classes/base-node-modules.js.map +1 -0
- package/lib/base/classes/base-npm-helpers.d.ts +29 -97
- package/lib/base/classes/base-npm-helpers.js +178 -729
- package/lib/base/classes/base-npm-helpers.js.map +1 -1
- package/lib/base/classes/base-package-json.d.ts +106 -0
- package/lib/base/classes/base-package-json.js +381 -0
- package/lib/base/classes/base-package-json.js.map +1 -0
- package/lib/base/classes/base-process-manager.d.ts +30 -0
- package/lib/base/classes/base-process-manager.js +269 -0
- package/lib/base/classes/base-process-manager.js.map +1 -0
- package/lib/base/classes/base-project-resolver.d.ts +2 -3
- package/lib/base/classes/base-project-resolver.js +102 -119
- package/lib/base/classes/base-project-resolver.js.map +1 -1
- package/lib/base/classes/base-project.d.ts +20 -17
- package/lib/base/classes/base-project.js +553 -760
- package/lib/base/classes/base-project.js.map +1 -1
- package/lib/base/classes/base-quick-fixes.d.ts +3 -1
- package/lib/base/classes/base-quick-fixes.js +45 -17
- package/lib/base/classes/base-quick-fixes.js.map +1 -1
- package/lib/base/classes/base-release-process.d.ts +15 -13
- package/lib/base/classes/base-release-process.js +487 -835
- package/lib/base/classes/base-release-process.js.map +1 -1
- package/lib/base/classes/base-start-config.backend.js +116 -100
- package/lib/base/classes/base-start-config.backend.js.map +1 -1
- package/lib/base/classes/base-static-pages.d.ts +14 -0
- package/lib/base/classes/base-static-pages.js +105 -0
- package/lib/base/classes/base-static-pages.js.map +1 -0
- package/lib/base/classes/base-vscode.d.ts +4 -0
- package/lib/base/classes/base-vscode.js +446 -424
- package/lib/base/classes/base-vscode.js.map +1 -1
- package/lib/base/classes/index copy.d.ts +22 -0
- package/lib/base/classes/index copy.js +28 -0
- package/lib/base/classes/index copy.js.map +1 -0
- package/lib/base/classes/index.d.ts +4 -0
- package/lib/base/classes/index.js +36 -19
- package/lib/base/classes/index.js.map +1 -1
- package/lib/base/command-line-feature.backend.d.ts +51 -0
- package/lib/base/command-line-feature.backend.js +206 -0
- package/lib/base/command-line-feature.backend.js.map +1 -0
- package/lib/base/commit-data.d.ts +14 -1
- package/lib/base/commit-data.js +411 -464
- package/lib/base/commit-data.js.map +1 -1
- package/lib/base/config-database.js +33 -61
- package/lib/base/config-database.js.map +1 -1
- package/lib/base/core-project.d.ts +1 -1
- package/lib/base/core-project.js +110 -146
- package/lib/base/core-project.js.map +1 -1
- package/lib/base/gh-temp-code.d.ts +1 -0
- package/lib/base/gh-temp-code.js +62 -104
- package/lib/base/gh-temp-code.js.map +1 -1
- package/lib/base/index-rebuilder.backend.d.ts +1 -0
- package/lib/base/index-rebuilder.backend.js.map +1 -1
- package/lib/base/index.js +20 -7
- package/lib/base/index.js.map +1 -1
- package/lib/base/linked-project.d.ts +1 -1
- package/lib/base/linked-project.js +59 -38
- package/lib/base/linked-project.js.map +1 -1
- package/lib/base/ports-worker.d.ts +32 -0
- package/lib/base/ports-worker.js +244 -0
- package/lib/base/ports-worker.js.map +1 -0
- package/lib/base/project-database.js +12 -22
- package/lib/base/project-database.js.map +1 -1
- package/lib/base/tcp-udp-ports/index.js +17 -4
- package/lib/base/tcp-udp-ports/index.js.map +1 -1
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.d.ts +1 -0
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.js.map +1 -1
- package/lib/base/tcp-udp-ports/port.entity.d.ts +0 -0
- package/lib/base/tcp-udp-ports/port.entity.js +5 -0
- package/lib/base/tcp-udp-ports/port.entity.js.map +1 -0
- package/lib/base/tcp-udp-ports/ports.controller.js +195 -283
- package/lib/base/tcp-udp-ports/ports.controller.js.map +1 -1
- package/lib/base/tcp-udp-ports/ports.entity.d.ts +2 -2
- package/lib/base/tcp-udp-ports/ports.entity.js +74 -62
- package/lib/base/tcp-udp-ports/ports.entity.js.map +1 -1
- package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js +11 -14
- package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js.map +1 -1
- package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js +244 -427
- package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js.map +1 -1
- package/lib/base/tcp-upd-ports.worker.d.ts +13 -0
- package/lib/base/tcp-upd-ports.worker.js +99 -0
- package/lib/base/tcp-upd-ports.worker.js.map +1 -0
- package/lib/base/translate.d.ts +1 -1
- package/lib/base/translate.js +90 -119
- package/lib/base/translate.js.map +1 -1
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/helpers/for-backend/helpers-cli-tool.backend.js +109 -115
- package/lib/helpers/for-backend/helpers-cli-tool.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-console-gui.js +55 -102
- package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
- package/lib/helpers/for-backend/helpers-dependencies.backend.js +28 -45
- package/lib/helpers/for-backend/helpers-dependencies.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-file-folders.backend.d.ts +2 -2
- package/lib/helpers/for-backend/helpers-file-folders.backend.js +277 -266
- package/lib/helpers/for-backend/helpers-file-folders.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-git.backend.d.ts +38 -3
- package/lib/helpers/for-backend/helpers-git.backend.js +806 -807
- package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-network.backend.js +15 -18
- package/lib/helpers/for-backend/helpers-network.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-npm.backend.js +5 -8
- package/lib/helpers/for-backend/helpers-npm.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-path.backend.js +18 -26
- package/lib/helpers/for-backend/helpers-path.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-process.backend.d.ts +2 -2
- package/lib/helpers/for-backend/helpers-process.backend.js +285 -363
- package/lib/helpers/for-backend/helpers-process.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-system-terminal.backend.js +25 -42
- package/lib/helpers/for-backend/helpers-system-terminal.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-vscode.backend.js +9 -12
- package/lib/helpers/for-backend/helpers-vscode.backend.js.map +1 -1
- package/lib/helpers/for-backend/ts-code/index.js +0 -2
- package/lib/helpers/for-backend/ts-code/index.js.map +1 -1
- package/lib/helpers/for-backend/ts-code/ts-code-extractor.d.ts +26 -0
- package/lib/helpers/for-backend/ts-code/ts-code-extractor.js +62 -0
- package/lib/helpers/for-backend/ts-code/ts-code-extractor.js.map +1 -0
- package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.d.ts +19 -0
- package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.js +81 -0
- package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.js.map +1 -0
- package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.js +2 -2
- package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.js.map +1 -1
- package/lib/helpers/for-browser/angular.helper.js +2 -2
- package/lib/helpers/for-browser/angular.helper.js.map +1 -1
- package/lib/helpers/for-browser/helpers-browser.js +27 -40
- package/lib/helpers/for-browser/helpers-browser.js.map +1 -1
- package/lib/helpers/helpers-array-obj.d.ts +3 -0
- package/lib/helpers/helpers-array-obj.js +49 -61
- package/lib/helpers/helpers-array-obj.js.map +1 -1
- package/lib/helpers/helpers-json5.backend.js +44 -55
- package/lib/helpers/helpers-json5.backend.js.map +1 -1
- package/lib/helpers/helpers-numbers.js +7 -10
- package/lib/helpers/helpers-numbers.js.map +1 -1
- package/lib/helpers/helpers-strings-regexes.js +40 -47
- package/lib/helpers/helpers-strings-regexes.js.map +1 -1
- package/lib/helpers/helpers-strings.js +38 -41
- package/lib/helpers/helpers-strings.js.map +1 -1
- package/lib/helpers/helpers.d.ts +12 -8
- package/lib/helpers/helpers.js +313 -393
- package/lib/helpers/helpers.js.map +1 -1
- package/lib/index._auto-generated_.d.ts +1 -0
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.d.ts +3 -4
- package/lib/index.js +21 -10
- package/lib/index.js.map +1 -1
- package/lib/lowdb/adapters/Memory.js +14 -20
- package/lib/lowdb/adapters/Memory.js.map +1 -1
- package/lib/lowdb/adapters/browser/LocalStorage.js +5 -8
- package/lib/lowdb/adapters/browser/LocalStorage.js.map +1 -1
- package/lib/lowdb/adapters/browser/SessionStorage.js +5 -8
- package/lib/lowdb/adapters/browser/SessionStorage.js.map +1 -1
- package/lib/lowdb/adapters/browser/WebStorage.js +10 -9
- package/lib/lowdb/adapters/browser/WebStorage.js.map +1 -1
- package/lib/lowdb/adapters/node/DataFile.js +29 -38
- package/lib/lowdb/adapters/node/DataFile.js.map +1 -1
- package/lib/lowdb/adapters/node/JSONFile.js +13 -18
- package/lib/lowdb/adapters/node/JSONFile.js.map +1 -1
- package/lib/lowdb/adapters/node/TextFile.js +36 -44
- package/lib/lowdb/adapters/node/TextFile.js.map +1 -1
- package/lib/lowdb/adapters/node/steno.js +72 -122
- package/lib/lowdb/adapters/node/steno.js.map +1 -1
- package/lib/lowdb/browser.js +17 -4
- package/lib/lowdb/browser.js.map +1 -1
- package/lib/lowdb/core/Low.js +30 -60
- package/lib/lowdb/core/Low.js.map +1 -1
- package/lib/lowdb/examples/browser.js.map +1 -1
- package/lib/lowdb/examples/cli.d.ts +1 -0
- package/lib/lowdb/examples/cli.js.map +1 -1
- package/lib/lowdb/examples/in-memory.d.ts +1 -0
- package/lib/lowdb/examples/in-memory.js.map +1 -1
- package/lib/lowdb/examples/server.d.ts +1 -0
- package/lib/lowdb/examples/server.js.map +1 -1
- package/lib/lowdb/index.js +16 -3
- package/lib/lowdb/index.js.map +1 -1
- package/lib/lowdb/node.js +18 -5
- package/lib/lowdb/node.js.map +1 -1
- package/lib/lowdb/presets/browser.js +7 -7
- package/lib/lowdb/presets/browser.js.map +1 -1
- package/lib/lowdb/presets/node.js +12 -23
- package/lib/lowdb/presets/node.js.map +1 -1
- package/lib/models.d.ts +68 -8
- package/lib/models.js +197 -3
- package/lib/models.js.map +1 -1
- package/lib/old/base-component.d.ts +1 -0
- package/lib/old/base-component.js +2 -2
- package/lib/old/base-component.js.map +1 -1
- package/lib/old/base-formly-component.d.ts +1 -0
- package/lib/old/base-formly-component.js +2 -2
- package/lib/old/base-formly-component.js.map +1 -1
- package/lib/old/condition-wait.d.ts +1 -0
- package/lib/old/condition-wait.js.map +1 -1
- package/lib/old/dual-component-ctrl.d.ts +1 -0
- package/lib/old/dual-component-ctrl.js +2 -2
- package/lib/old/dual-component-ctrl.js.map +1 -1
- package/lib/old/execute-command.d.ts +11 -0
- package/lib/old/execute-command.js +564 -0
- package/lib/old/execute-command.js.map +1 -0
- package/lib/old/helpers.d.ts +62 -0
- package/lib/old/helpers.js +279 -0
- package/lib/old/helpers.js.map +1 -0
- package/lib/old/models.d.ts +80 -0
- package/lib/old/models.js +57 -0
- package/lib/old/models.js.map +1 -0
- package/lib/utils.d.ts +72 -13
- package/lib/utils.js +502 -179
- package/lib/utils.js.map +1 -1
- package/lib/validators/validators-firedev.js +5 -5
- package/lib/validators/validators-firedev.js.map +1 -1
- package/lib/validators/validators-git.js +2 -2
- package/lib/validators/validators-git.js.map +1 -1
- package/lib/validators/validators-network.js +1 -1
- package/lib/validators/validators-network.js.map +1 -1
- package/lib/validators/validators.js +2 -2
- package/lib/validators/validators.js.map +1 -1
- package/migrations/1736198527297_init.js +39 -58
- package/migrations/1736198527297_init.js.map +1 -1
- package/migrations/1736199486472_addingNotAssignablePorts.js +42 -93
- package/migrations/1736199486472_addingNotAssignablePorts.js.map +1 -1
- package/migrations/1736454437350_addFreePorts.js +48 -100
- package/migrations/1736454437350_addFreePorts.js.map +1 -1
- package/migrations/index.js +15 -2
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.js +3 -3
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/package.json +14 -61
- package/src.d.ts +1 -1
- package/taon.jsonc +34 -49
- package/tmp-environment.json +8 -389
- package/websql/README.md +24 -24
- package/websql/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
- package/websql/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
- package/websql/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
- package/websql/esm2022/lib/base/classes/base-cli-worker.mjs +14 -4
- package/websql/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
- package/websql/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
- package/websql/esm2022/lib/base/classes/base-git.mjs +244 -4
- package/websql/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
- package/websql/esm2022/lib/base/classes/base-library-build.mjs +35 -10
- package/websql/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
- package/websql/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
- package/websql/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -430
- package/websql/esm2022/lib/base/classes/base-package-json.mjs +340 -0
- package/websql/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
- package/websql/esm2022/lib/base/classes/base-project-resolver.mjs +2 -10
- package/websql/esm2022/lib/base/classes/base-project.mjs +82 -87
- package/websql/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
- package/websql/esm2022/lib/base/classes/base-release-process.mjs +34 -36
- package/websql/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
- package/websql/esm2022/lib/base/classes/base-vscode.mjs +31 -1
- package/websql/esm2022/lib/base/classes/index.mjs +5 -1
- package/websql/esm2022/lib/base/commit-data.mjs +21 -4
- package/websql/esm2022/lib/base/core-project.mjs +3 -3
- package/websql/esm2022/lib/base/linked-project.mjs +4 -4
- package/websql/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
- package/websql/esm2022/lib/base/translate.mjs +566 -0
- package/websql/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
- package/websql/esm2022/lib/helpers/helpers.mjs +12 -6
- package/websql/esm2022/lib/index.mjs +2 -4
- package/websql/esm2022/lib/models.mjs +173 -3
- package/websql/esm2022/lib/utils.mjs +402 -41
- package/websql/fesm2022/tnp-helpers.mjs +4744 -3032
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base/classes/base-bower-json.d.ts +35 -0
- package/websql/lib/base/classes/base-cli-worker.d.ts +2 -2
- package/websql/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
- package/websql/lib/base/classes/base-feature-for-project.d.ts +2 -1
- package/websql/lib/base/classes/base-git.d.ts +42 -5
- package/websql/lib/base/classes/base-json-file-reader.d.ts +72 -0
- package/websql/lib/base/classes/base-library-build.d.ts +8 -11
- package/websql/lib/base/classes/base-linked-projects.d.ts +1 -2
- package/websql/lib/base/classes/base-node-modules.d.ts +56 -0
- package/websql/lib/base/classes/base-npm-helpers.d.ts +29 -108
- package/websql/lib/base/classes/base-package-json.d.ts +107 -0
- package/websql/lib/base/classes/base-process-manager.d.ts +31 -0
- package/websql/lib/base/classes/base-project-resolver.d.ts +2 -2
- package/websql/lib/base/classes/base-project.d.ts +17 -18
- package/websql/lib/base/classes/base-quick-fixes.d.ts +3 -1
- package/websql/lib/base/classes/base-release-process.d.ts +15 -13
- package/websql/lib/base/classes/base-static-pages.d.ts +15 -0
- package/websql/lib/base/classes/base-vscode.d.ts +4 -0
- package/websql/lib/base/classes/index.d.ts +5 -1
- package/websql/lib/base/commit-data.d.ts +14 -1
- package/websql/lib/base/core-project.d.ts +1 -1
- package/websql/lib/base/linked-project.d.ts +1 -1
- package/websql/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
- package/websql/lib/base/translate.d.ts +228 -0
- package/websql/lib/helpers/helpers-array-obj.d.ts +3 -0
- package/websql/lib/helpers/helpers.d.ts +12 -8
- package/websql/lib/index.d.ts +1 -3
- package/websql/lib/models.d.ts +68 -8
- package/websql/lib/utils.d.ts +72 -13
- package/browser/package.json +0 -25
- package/websql/package.json +0 -25
|
@@ -1,37 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseProject =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var base_project_resolver_1 = require("./base-project-resolver");
|
|
3
|
+
exports.BaseProject = void 0;
|
|
4
|
+
//#region import
|
|
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 tnp_core_4 = require("tnp-core");
|
|
10
|
+
const tnp_core_5 = require("tnp-core");
|
|
11
|
+
const index_1 = require("../../index");
|
|
12
|
+
const base_project_resolver_1 = require("./base-project-resolver");
|
|
14
13
|
//#endregion
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const takenPorts = [];
|
|
15
|
+
class BaseProject {
|
|
16
|
+
//#region static
|
|
17
|
+
//#region static / instance of resovle
|
|
18
|
+
static ins = new base_project_resolver_1.BaseProjectResolver(BaseProject, 'taon');
|
|
19
|
+
//#endregion
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region fields
|
|
22
|
+
cache = {};
|
|
23
|
+
static cache = {};
|
|
24
|
+
get globalCache() {
|
|
25
|
+
return BaseProject.cache;
|
|
26
|
+
}
|
|
27
|
+
type = 'unknow';
|
|
28
|
+
/**
|
|
29
|
+
* Unique free port for project instance
|
|
30
|
+
* only available after executing *this.assignFreePort()*
|
|
31
|
+
*/
|
|
32
|
+
port;
|
|
33
|
+
libraryBuild;
|
|
34
|
+
npmHelpers;
|
|
35
|
+
get packageJson() {
|
|
36
|
+
return this.npmHelpers.packageJson;
|
|
37
|
+
}
|
|
38
|
+
get nodeModules() {
|
|
39
|
+
return this.npmHelpers.nodeModules;
|
|
40
|
+
}
|
|
41
|
+
linkedProjects;
|
|
42
|
+
vsCodeHelpers;
|
|
43
|
+
releaseProcess;
|
|
44
|
+
git;
|
|
45
|
+
quickFixes;
|
|
46
|
+
staticPages;
|
|
47
|
+
//#endregion
|
|
48
|
+
__location;
|
|
49
|
+
get location() {
|
|
50
|
+
return this.__location;
|
|
51
|
+
}
|
|
52
|
+
set location(v) {
|
|
53
|
+
this.__location = (0, tnp_core_2.crossPlatformPath)(v);
|
|
54
|
+
}
|
|
17
55
|
//#region constructor
|
|
56
|
+
//#region @backend
|
|
18
57
|
// @ts-ignore
|
|
19
|
-
|
|
58
|
+
constructor(
|
|
20
59
|
/**
|
|
21
60
|
* doesn't need to be real path -> can be link
|
|
22
61
|
*/
|
|
23
62
|
location) {
|
|
24
|
-
var _this = this;
|
|
25
|
-
//#endregion
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region fields
|
|
28
|
-
this.cache = {};
|
|
29
|
-
this.type = 'unknow';
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region getters & methods / to string
|
|
32
|
-
this.toString = function () {
|
|
33
|
-
return "".concat(_this.name, "=>").concat(_this.location);
|
|
34
|
-
};
|
|
35
63
|
this.location = location;
|
|
36
64
|
//#region @backend
|
|
37
65
|
// @ts-ignore
|
|
@@ -44,251 +72,153 @@ var BaseProject = /** @class */ (function () {
|
|
|
44
72
|
this.git = new (require('./base-git').BaseGit)(this);
|
|
45
73
|
this.vsCodeHelpers = new (require('./base-vscode')
|
|
46
74
|
.BaseVscodeHelpers)(this);
|
|
47
|
-
this.
|
|
48
|
-
.
|
|
75
|
+
this.staticPages = new (require('./base-static-pages')
|
|
76
|
+
.BaseStaticPages)(this);
|
|
49
77
|
this.releaseProcess = new (require('./base-release-process')
|
|
50
78
|
.BaseReleaseProcess)(this);
|
|
51
79
|
//#endregion
|
|
52
80
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
set: function (v) {
|
|
65
|
-
this.__location = (0, tnp_core_3.crossPlatformPath)(v);
|
|
66
|
-
},
|
|
67
|
-
enumerable: false,
|
|
68
|
-
configurable: true
|
|
69
|
-
});
|
|
70
|
-
Object.defineProperty(BaseProject.prototype, "isMonorepo", {
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region methods & getters / is monorepo
|
|
73
|
-
get: function () {
|
|
74
|
-
return false;
|
|
75
|
-
},
|
|
76
|
-
enumerable: false,
|
|
77
|
-
configurable: true
|
|
78
|
-
});
|
|
81
|
+
//#endregion
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region methods & getters / is monorepo
|
|
84
|
+
/**
|
|
85
|
+
* TODO move this to framework
|
|
86
|
+
* Linked projects are actual inside repo
|
|
87
|
+
* not in separated folders/git sub repos
|
|
88
|
+
*/
|
|
89
|
+
get isMonorepo() {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
79
92
|
//#endregion
|
|
80
93
|
//#region getters & methods / order core projects
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
for (var coreProjects_1 = tslib_1.__values(coreProjects), coreProjects_1_1 = coreProjects_1.next(); !coreProjects_1_1.done; coreProjects_1_1 = coreProjects_1.next()) {
|
|
87
|
-
var project = coreProjects_1_1.value;
|
|
88
|
-
projectMap.set(project, []);
|
|
89
|
-
}
|
|
94
|
+
orderCoreProjects(coreProjects) {
|
|
95
|
+
const projectMap = new Map();
|
|
96
|
+
// Initialize the project map
|
|
97
|
+
for (const project of coreProjects) {
|
|
98
|
+
projectMap.set(project, []);
|
|
90
99
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
// Populate the project map with dependencies
|
|
101
|
+
for (const project of coreProjects) {
|
|
102
|
+
if (!projectMap.has(project.extends)) {
|
|
103
|
+
projectMap.set(project.extends, []);
|
|
95
104
|
}
|
|
96
|
-
|
|
105
|
+
projectMap.get(project.extends).push(project);
|
|
97
106
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
var project = coreProjects_2_1.value;
|
|
102
|
-
if (!projectMap.has(project.extends)) {
|
|
103
|
-
projectMap.set(project.extends, []);
|
|
104
|
-
}
|
|
105
|
-
projectMap.get(project.extends).push(project);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
109
|
-
finally {
|
|
110
|
-
try {
|
|
111
|
-
if (coreProjects_2_1 && !coreProjects_2_1.done && (_b = coreProjects_2.return)) _b.call(coreProjects_2);
|
|
112
|
-
}
|
|
113
|
-
finally { if (e_2) throw e_2.error; }
|
|
114
|
-
}
|
|
115
|
-
var orderedProjects = [];
|
|
116
|
-
var visited = new Set();
|
|
117
|
-
var visit = function (project) {
|
|
118
|
-
var e_4, _a;
|
|
107
|
+
const orderedProjects = [];
|
|
108
|
+
const visited = new Set();
|
|
109
|
+
const visit = (project) => {
|
|
119
110
|
if (!visited.has(project)) {
|
|
120
111
|
visited.add(project);
|
|
121
|
-
|
|
112
|
+
const dependencies = projectMap.get(project);
|
|
122
113
|
if (dependencies) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
var dep = dependencies_1_1.value;
|
|
126
|
-
visit(dep);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
130
|
-
finally {
|
|
131
|
-
try {
|
|
132
|
-
if (dependencies_1_1 && !dependencies_1_1.done && (_a = dependencies_1.return)) _a.call(dependencies_1);
|
|
133
|
-
}
|
|
134
|
-
finally { if (e_4) throw e_4.error; }
|
|
114
|
+
for (const dep of dependencies) {
|
|
115
|
+
visit(dep);
|
|
135
116
|
}
|
|
136
117
|
}
|
|
137
118
|
orderedProjects.push(project);
|
|
138
119
|
}
|
|
139
120
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
var project = coreProjects_3_1.value;
|
|
144
|
-
visit(project);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
148
|
-
finally {
|
|
149
|
-
try {
|
|
150
|
-
if (coreProjects_3_1 && !coreProjects_3_1.done && (_c = coreProjects_3.return)) _c.call(coreProjects_3);
|
|
151
|
-
}
|
|
152
|
-
finally { if (e_3) throw e_3.error; }
|
|
121
|
+
// Visit each project
|
|
122
|
+
for (const project of coreProjects) {
|
|
123
|
+
visit(project);
|
|
153
124
|
}
|
|
154
125
|
return orderedProjects.reverse();
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
var _this = this;
|
|
161
|
-
if (!tnp_core_4._.isUndefined(this.cache['core'])) {
|
|
162
|
-
return this.cache['core'];
|
|
163
|
-
}
|
|
164
|
-
// Helpers.taskStarted(`Detecting core project for ${this.genericName}`);
|
|
165
|
-
var coreProjects = index_1.CoreProject.coreProjects.filter(function (p) {
|
|
166
|
-
return p.recognizedFn(_this);
|
|
167
|
-
});
|
|
168
|
-
coreProjects = this.orderCoreProjects(coreProjects);
|
|
169
|
-
// Helpers.taskDone(`Core project detected for ${this.genericName}`);
|
|
170
|
-
// console.log('CoreProject.coreProjects', CoreProject.coreProjects.map(c => c.name));
|
|
171
|
-
this.cache['core'] = tnp_core_4._.first(coreProjects);
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region methods & getters / core
|
|
129
|
+
get core() {
|
|
130
|
+
if (!tnp_core_4._.isUndefined(this.cache['core'])) {
|
|
172
131
|
return this.cache['core'];
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
132
|
+
}
|
|
133
|
+
// Helpers.taskStarted(`Detecting core project for ${this.genericName}`);
|
|
134
|
+
let coreProjects = index_1.CoreProject.coreProjects.filter(p => p.recognizedFn(this));
|
|
135
|
+
coreProjects = this.orderCoreProjects(coreProjects);
|
|
136
|
+
// Helpers.taskDone(`Core project detected for ${this.genericName}`);
|
|
137
|
+
// console.log('CoreProject.coreProjects', CoreProject.coreProjects.map(c => c.name));
|
|
138
|
+
this.cache['core'] = tnp_core_4._.first(coreProjects);
|
|
139
|
+
return this.cache['core'];
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region getters & methods / link project exited
|
|
143
|
+
get linkedProjectsExisted() {
|
|
144
|
+
//#region @backendFunc
|
|
145
|
+
return this.linkedProjects.linkedProjects
|
|
146
|
+
.map(f => {
|
|
147
|
+
const proj = this.ins.From(this.pathFor(f.relativeClonePath));
|
|
148
|
+
return proj;
|
|
149
|
+
})
|
|
150
|
+
.filter(f => !!f);
|
|
178
151
|
//#endregion
|
|
179
|
-
|
|
180
|
-
get: function () {
|
|
181
|
-
var _this = this;
|
|
182
|
-
//#region @backendFunc
|
|
183
|
-
return this.linkedProjects.linkedProjects
|
|
184
|
-
.map(function (f) {
|
|
185
|
-
var proj = _this.ins.From(_this.pathFor(f.relativeClonePath));
|
|
186
|
-
return proj;
|
|
187
|
-
})
|
|
188
|
-
.filter(function (f) { return !!f; });
|
|
189
|
-
//#endregion
|
|
190
|
-
},
|
|
191
|
-
enumerable: false,
|
|
192
|
-
configurable: true
|
|
193
|
-
});
|
|
152
|
+
}
|
|
194
153
|
//#endregion
|
|
195
154
|
//#region methods & getters / set type
|
|
196
|
-
|
|
155
|
+
setType(type) {
|
|
197
156
|
// @ts-ignore
|
|
198
157
|
this.type = type;
|
|
199
|
-
}
|
|
158
|
+
}
|
|
200
159
|
//#endregion
|
|
201
160
|
//#region methods & getters / type is
|
|
202
|
-
|
|
203
|
-
var types = [];
|
|
204
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
205
|
-
types[_i] = arguments[_i];
|
|
206
|
-
}
|
|
161
|
+
typeIs(...types) {
|
|
207
162
|
return this.type && types.includes(this.type);
|
|
208
|
-
}
|
|
163
|
+
}
|
|
209
164
|
//#endregion
|
|
210
165
|
//#region methods & getters / type is not
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
//#region
|
|
221
|
-
|
|
222
|
-
* project folder basename
|
|
223
|
-
*/
|
|
224
|
-
get: function () {
|
|
225
|
-
//#region @websqlFunc
|
|
226
|
-
return tnp_core_3.path.basename(this.location);
|
|
227
|
-
//#endregion
|
|
228
|
-
},
|
|
229
|
-
enumerable: false,
|
|
230
|
-
configurable: true
|
|
231
|
-
});
|
|
232
|
-
Object.defineProperty(BaseProject.prototype, "parentBasename", {
|
|
166
|
+
typeIsNot(...types) {
|
|
167
|
+
return !this.typeIs(...types);
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region methods & getters / basename
|
|
171
|
+
/**
|
|
172
|
+
* project folder basename
|
|
173
|
+
*/
|
|
174
|
+
get basename() {
|
|
175
|
+
//#region @websqlFunc
|
|
176
|
+
return tnp_core_2.path.basename(this.location);
|
|
233
177
|
//#endregion
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
enumerable: false,
|
|
244
|
-
configurable: true
|
|
245
|
-
});
|
|
246
|
-
Object.defineProperty(BaseProject.prototype, "name", {
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region methods & getters / parent basename
|
|
181
|
+
/**
|
|
182
|
+
* project folder parent basename
|
|
183
|
+
*/
|
|
184
|
+
get parentBasename() {
|
|
185
|
+
//#region @websqlFunc
|
|
186
|
+
return tnp_core_2.path.basename(tnp_core_2.path.dirname(this.location));
|
|
247
187
|
//#endregion
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
if (match && match[1]) {
|
|
272
|
-
return match[1];
|
|
273
|
-
}
|
|
274
|
-
return '';
|
|
275
|
-
},
|
|
276
|
-
enumerable: false,
|
|
277
|
-
configurable: true
|
|
278
|
-
});
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region methods & getters / name
|
|
191
|
+
/**
|
|
192
|
+
* name from package.json
|
|
193
|
+
*/
|
|
194
|
+
get name() {
|
|
195
|
+
return this.packageJson?.name || this.nameFromPomXML;
|
|
196
|
+
}
|
|
197
|
+
get nameForCli() {
|
|
198
|
+
return this.name?.endsWith('-cli') ? this.name : `${this.name}-cli`;
|
|
199
|
+
}
|
|
200
|
+
get nameForNpmPackage() {
|
|
201
|
+
return this.name;
|
|
202
|
+
}
|
|
203
|
+
get nameFromPomXML() {
|
|
204
|
+
const artifactIdPattern = /<artifactId>([^<]+)<\/artifactId>/;
|
|
205
|
+
const match = (this.readFile('pom.xml') || '').match(artifactIdPattern);
|
|
206
|
+
if (match && match[1]) {
|
|
207
|
+
return match[1];
|
|
208
|
+
}
|
|
209
|
+
return '';
|
|
210
|
+
}
|
|
279
211
|
//#endregion
|
|
280
212
|
//#region methods & getters / get folder for possible project chhildrens
|
|
281
|
-
|
|
213
|
+
getFoldersForPossibleProjectChildren() {
|
|
282
214
|
//#region @backendFunc
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
var subdirectories = getDirectories(this.location).filter(function (f) {
|
|
291
|
-
var folderName = tnp_core_3.path.basename(f);
|
|
215
|
+
const isDirectory = source => tnp_core_3.fse.lstatSync(source).isDirectory();
|
|
216
|
+
const getDirectories = source => tnp_core_3.fse
|
|
217
|
+
.readdirSync(source)
|
|
218
|
+
.map(name => tnp_core_2.path.join(source, name))
|
|
219
|
+
.filter(isDirectory);
|
|
220
|
+
let subdirectories = getDirectories(this.location).filter(f => {
|
|
221
|
+
const folderName = tnp_core_2.path.basename(f);
|
|
292
222
|
return index_1.Helpers.checkIfNameAllowedForTaonProj(folderName);
|
|
293
223
|
});
|
|
294
224
|
// if (this.isTnp' && fse.existsSync(path.join(this.location, '../taon-projects'))) {
|
|
@@ -300,202 +230,171 @@ var BaseProject = /** @class */ (function () {
|
|
|
300
230
|
// }'
|
|
301
231
|
return subdirectories;
|
|
302
232
|
//#endregion
|
|
303
|
-
}
|
|
233
|
+
}
|
|
304
234
|
//#endregion
|
|
305
235
|
//#region methods & getters / get all childrens
|
|
306
|
-
|
|
307
|
-
var _this = this;
|
|
236
|
+
getAllChildren() {
|
|
308
237
|
//#region @backendFunc
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
.map(
|
|
238
|
+
const subdirectories = this.getFoldersForPossibleProjectChildren();
|
|
239
|
+
let res = subdirectories
|
|
240
|
+
.map(dir => {
|
|
312
241
|
// console.log('child:', dir)
|
|
313
|
-
return
|
|
242
|
+
return this.ins.From(dir);
|
|
314
243
|
})
|
|
315
|
-
.filter(
|
|
244
|
+
.filter(c => !!c);
|
|
316
245
|
return res;
|
|
317
246
|
//#endregion
|
|
318
|
-
}
|
|
319
|
-
|
|
247
|
+
}
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region methods & getters / children
|
|
250
|
+
/**
|
|
251
|
+
* alias to getAllChildren
|
|
252
|
+
*/
|
|
253
|
+
get children() {
|
|
254
|
+
//#region @websqlFunc
|
|
255
|
+
return this.getAllChildren();
|
|
320
256
|
//#endregion
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* alias to getAllChildren
|
|
324
|
-
*/
|
|
325
|
-
get: function () {
|
|
326
|
-
//#region @websqlFunc
|
|
327
|
-
return this.getAllChildren();
|
|
328
|
-
//#endregion
|
|
329
|
-
},
|
|
330
|
-
enumerable: false,
|
|
331
|
-
configurable: true
|
|
332
|
-
});
|
|
257
|
+
}
|
|
333
258
|
//#endregion
|
|
334
259
|
//#region methods & getters / get child
|
|
335
|
-
|
|
336
|
-
if (errors === void 0) { errors = true; }
|
|
260
|
+
getChildBy(nameOrBasename, errors = true) {
|
|
337
261
|
//#region @websqlFunc
|
|
338
|
-
|
|
262
|
+
const c = this.children.find(c => c.name === nameOrBasename || c.basename === nameOrBasename);
|
|
339
263
|
if (errors && !c) {
|
|
340
|
-
|
|
264
|
+
// TODO @LAST FIX THIS FOR DEEEP ARGGUMENTS
|
|
265
|
+
index_1.Helpers.warn(`Project doesnt contain child with name or basename: ${nameOrBasename}`);
|
|
341
266
|
}
|
|
342
267
|
return c;
|
|
343
268
|
//#endregion
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
return this.ins.From(tnp_core_3.path.join(this.location, '..'));
|
|
354
|
-
//#endregion
|
|
355
|
-
},
|
|
356
|
-
enumerable: false,
|
|
357
|
-
configurable: true
|
|
358
|
-
});
|
|
359
|
-
Object.defineProperty(BaseProject.prototype, "nearestParent", {
|
|
269
|
+
}
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region methods & getters / parent
|
|
272
|
+
get parent() {
|
|
273
|
+
//#region @websqlFunc
|
|
274
|
+
if (!tnp_core_4._.isString(this.location) || this.location.trim() === '') {
|
|
275
|
+
return void 0;
|
|
276
|
+
}
|
|
277
|
+
return this.ins.From(tnp_core_2.path.join(this.location, '..'));
|
|
360
278
|
//#endregion
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
enumerable: false,
|
|
378
|
-
configurable: true
|
|
379
|
-
});
|
|
380
|
-
Object.defineProperty(BaseProject.prototype, "grandpa", {
|
|
279
|
+
}
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region methods & getters / parent
|
|
282
|
+
get nearestParent() {
|
|
283
|
+
//#region @websqlFunc
|
|
284
|
+
if (this.cache['nearestParent']) {
|
|
285
|
+
return this.cache['nearestParent'];
|
|
286
|
+
}
|
|
287
|
+
const nearestParent = this.ins.nearestTo([this.location, '..']);
|
|
288
|
+
if (nearestParent) {
|
|
289
|
+
// console.log(`
|
|
290
|
+
// nearest parent for ${this.genericName} is ${nearestParent.genericName}
|
|
291
|
+
// `);
|
|
292
|
+
this.cache['nearestParent'] = nearestParent;
|
|
293
|
+
}
|
|
294
|
+
return nearestParent;
|
|
381
295
|
//#endregion
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
enumerable: false,
|
|
393
|
-
configurable: true
|
|
394
|
-
});
|
|
395
|
-
Object.defineProperty(BaseProject.prototype, "allNpmPackagesNames", {
|
|
296
|
+
}
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region methods & getters / grandpa
|
|
299
|
+
get grandpa() {
|
|
300
|
+
//#region @websqlFunc
|
|
301
|
+
if (!tnp_core_4._.isString(this.location) || this.location.trim() === '') {
|
|
302
|
+
return void 0;
|
|
303
|
+
}
|
|
304
|
+
const grandpa = this.ins.From(tnp_core_2.path.join(this.location, '..', '..'));
|
|
305
|
+
return grandpa;
|
|
396
306
|
//#endregion
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
enumerable: false,
|
|
418
|
-
configurable: true
|
|
419
|
-
});
|
|
420
|
-
Object.defineProperty(BaseProject.prototype, "genericName", {
|
|
421
|
-
get: function () {
|
|
422
|
-
//#region @websqlFunc
|
|
423
|
-
if (!tnp_core_4._.isUndefined(this.cache['genericName'])) {
|
|
424
|
-
return this.cache['genericName'];
|
|
425
|
-
}
|
|
426
|
-
var nameFromPackageJson = this.name;
|
|
427
|
-
//#region @backend
|
|
428
|
-
nameFromPackageJson = "".concat(tnp_core_1.chalk.bold.gray(this.name));
|
|
429
|
-
//#endregion
|
|
430
|
-
var sliceMinus = 8;
|
|
431
|
-
var shortPath = '/' +
|
|
432
|
-
(0, tnp_core_3.crossPlatformPath)(this.location)
|
|
433
|
-
.split('/')
|
|
434
|
-
.slice(-1 * sliceMinus)
|
|
435
|
-
.join('/');
|
|
436
|
-
var result = (shortPath.includes((0, tnp_core_3.crossPlatformPath)(this.location)) ? '/' : '(..)') +
|
|
437
|
-
this.checkAndBoldenPath(this.location)
|
|
438
|
-
.split('/')
|
|
439
|
-
.slice(-1 * sliceMinus)
|
|
440
|
-
.join('/') +
|
|
441
|
-
"(".concat(nameFromPackageJson, ")");
|
|
442
|
-
this.cache['genericName'] = result.replace(/\/\//g, '/');
|
|
307
|
+
}
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region methods & getters / generic name
|
|
310
|
+
get allNpmPackagesNames() {
|
|
311
|
+
return [this.name];
|
|
312
|
+
}
|
|
313
|
+
get titleBarName() {
|
|
314
|
+
const allPackagesNames = this.allNpmPackagesNames.filter(f => f !== this.basename).length === 0
|
|
315
|
+
? ''
|
|
316
|
+
: `(${this.allNpmPackagesNames.filter(f => f !== this.basename).join(',')})`;
|
|
317
|
+
if (this.parent) {
|
|
318
|
+
return (`${tnp_core_2.path.basename(tnp_core_2.path.dirname(this.parent.location))}/${this.parent.name}/` +
|
|
319
|
+
`${this.basename} ${allPackagesNames} [ \${activeEditorShort} ]`);
|
|
320
|
+
}
|
|
321
|
+
return (`${tnp_core_2.path.basename(tnp_core_2.path.dirname(this.location))}/` +
|
|
322
|
+
`${this.basename} (${allPackagesNames}) [ \${activeEditorShort}]`);
|
|
323
|
+
}
|
|
324
|
+
get genericName() {
|
|
325
|
+
//#region @websqlFunc
|
|
326
|
+
if (!tnp_core_4._.isUndefined(this.cache['genericName'])) {
|
|
443
327
|
return this.cache['genericName'];
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
328
|
+
}
|
|
329
|
+
let nameFromPackageJson = this.name;
|
|
330
|
+
//#region @backend
|
|
331
|
+
nameFromPackageJson = `${tnp_core_3.chalk.bold.gray(this.name)}`;
|
|
332
|
+
//#endregion
|
|
333
|
+
const sliceMinus = 8;
|
|
334
|
+
const shortPath = '/' +
|
|
335
|
+
(0, tnp_core_2.crossPlatformPath)(this.location)
|
|
336
|
+
.split('/')
|
|
337
|
+
.slice(-1 * sliceMinus)
|
|
338
|
+
.join('/');
|
|
339
|
+
const result = (shortPath.includes((0, tnp_core_2.crossPlatformPath)(this.location)) ? '/' : '(..)') +
|
|
340
|
+
this.checkAndBoldenPath(this.location)
|
|
341
|
+
.split('/')
|
|
342
|
+
.slice(-1 * sliceMinus)
|
|
343
|
+
.join('/') +
|
|
344
|
+
`(${nameFromPackageJson})`;
|
|
345
|
+
this.cache['genericName'] = result.replace(/\/\//g, '/');
|
|
346
|
+
return this.cache['genericName'];
|
|
347
|
+
//#endregion
|
|
348
|
+
}
|
|
449
349
|
//#endregion
|
|
450
350
|
//#region methods & getters / check and bolden path
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
var pathTocheck = parts.slice(0, index + 1).join('/');
|
|
351
|
+
checkAndBoldenPath(fullPath) {
|
|
352
|
+
const parts = fullPath.split('/');
|
|
353
|
+
const result = parts.map((part, index) => {
|
|
354
|
+
const pathTocheck = parts.slice(0, index + 1).join('/');
|
|
456
355
|
// console.log('pathTocheck', pathTocheck);
|
|
457
356
|
//#region @backend
|
|
458
|
-
if (
|
|
459
|
-
return
|
|
357
|
+
if (this.ins.From(pathTocheck)) {
|
|
358
|
+
return tnp_core_3.chalk.underline.italic.bold(part);
|
|
460
359
|
}
|
|
461
360
|
//#endregion
|
|
462
361
|
return part;
|
|
463
362
|
});
|
|
464
363
|
return result.join('/');
|
|
465
|
-
}
|
|
364
|
+
}
|
|
466
365
|
//#endregion
|
|
467
366
|
//#region methods & getters / path exits
|
|
468
367
|
/**
|
|
469
368
|
* same has project.hasFile();
|
|
470
369
|
*/
|
|
471
|
-
|
|
370
|
+
pathExists(relativePath) {
|
|
472
371
|
return this.hasFile(relativePath);
|
|
473
|
-
}
|
|
372
|
+
}
|
|
474
373
|
//#endregion
|
|
475
374
|
//#region methods & getters / has file
|
|
476
375
|
/**
|
|
477
376
|
* same as project.pathExists();
|
|
478
377
|
*/
|
|
479
|
-
|
|
378
|
+
hasFile(relativePath) {
|
|
480
379
|
//#region @backendFunc
|
|
481
380
|
// TODO prevent absolute path
|
|
482
381
|
return index_1.Helpers.exists(this.pathFor(relativePath));
|
|
483
382
|
//#endregion
|
|
484
|
-
}
|
|
485
|
-
|
|
383
|
+
}
|
|
384
|
+
hasFolder(relativePath) {
|
|
486
385
|
//#region @backendFunc
|
|
487
386
|
return (index_1.Helpers.exists(this.pathFor(relativePath)) &&
|
|
488
|
-
|
|
387
|
+
tnp_core_3.fse.lstatSync(this.pathFor(relativePath)).isDirectory());
|
|
489
388
|
//#endregion
|
|
490
|
-
}
|
|
389
|
+
}
|
|
491
390
|
//#endregion
|
|
492
391
|
//#region methods & getters / relative
|
|
493
392
|
/**
|
|
494
393
|
* Function will return relative path from project location
|
|
495
394
|
*/
|
|
496
|
-
|
|
497
|
-
return (0,
|
|
498
|
-
}
|
|
395
|
+
relative(absoultePath) {
|
|
396
|
+
return (0, tnp_core_2.crossPlatformPath)(tnp_core_2.path.relative((0, tnp_core_2.crossPlatformPath)(this.location), (0, tnp_core_2.crossPlatformPath)(absoultePath)));
|
|
397
|
+
}
|
|
499
398
|
//#endregion
|
|
500
399
|
//#region methods & getters / create folder
|
|
501
400
|
/**
|
|
@@ -503,11 +402,11 @@ var BaseProject = /** @class */ (function () {
|
|
|
503
402
|
* @param relativePath
|
|
504
403
|
* @param override it will remove ex
|
|
505
404
|
*/
|
|
506
|
-
|
|
405
|
+
createFolder(relativePath, options) {
|
|
507
406
|
//#region @backendFunc
|
|
508
|
-
|
|
407
|
+
const { override } = options || {};
|
|
509
408
|
try {
|
|
510
|
-
|
|
409
|
+
tnp_core_3.fse.unlinkSync(this.pathFor(relativePath));
|
|
511
410
|
}
|
|
512
411
|
catch (error) { }
|
|
513
412
|
if (this.hasFolder(relativePath)) {
|
|
@@ -516,81 +415,81 @@ var BaseProject = /** @class */ (function () {
|
|
|
516
415
|
}
|
|
517
416
|
return;
|
|
518
417
|
}
|
|
519
|
-
|
|
418
|
+
tnp_core_3.fse.mkdirSync(this.pathFor(relativePath), { recursive: true });
|
|
520
419
|
//#endregion
|
|
521
|
-
}
|
|
420
|
+
}
|
|
522
421
|
//#endregion
|
|
523
422
|
//#region methods & getters / format file(s) with prettier
|
|
524
|
-
|
|
423
|
+
formatFile(specificRelativePath) {
|
|
525
424
|
//#region @backendFunc
|
|
526
|
-
|
|
425
|
+
const absPathToFile = this.pathFor(specificRelativePath);
|
|
527
426
|
index_1.UtilsTypescript.formatFile(absPathToFile);
|
|
528
427
|
//#endregion
|
|
529
|
-
}
|
|
530
|
-
|
|
428
|
+
}
|
|
429
|
+
formatAllFiles() {
|
|
531
430
|
//#region @backendFunc
|
|
532
|
-
index_1.Helpers.info(
|
|
431
|
+
index_1.Helpers.info(`Formatting all files in ${this.genericName}`);
|
|
533
432
|
index_1.UtilsTypescript.formatAllFilesInsideFolder(this.location);
|
|
534
433
|
//#endregion
|
|
535
|
-
}
|
|
434
|
+
}
|
|
536
435
|
//#endregion
|
|
537
436
|
//#region methods & getters / contains file
|
|
538
437
|
/**
|
|
539
438
|
* same as project.pathhasFileExists();
|
|
540
439
|
* but with path.resolve
|
|
541
440
|
*/
|
|
542
|
-
|
|
543
|
-
|
|
441
|
+
containsFile(fileRelativeToProjectPath) {
|
|
442
|
+
const fullPath = tnp_core_2.path.resolve(tnp_core_2.path.join(this.location, fileRelativeToProjectPath));
|
|
544
443
|
return index_1.Helpers.exists(fullPath);
|
|
545
|
-
}
|
|
444
|
+
}
|
|
546
445
|
//#endregion
|
|
547
446
|
//#region methods & getters / path for
|
|
548
447
|
/**
|
|
549
448
|
* absolute path:
|
|
550
449
|
* concated project location with relative path
|
|
551
450
|
*/
|
|
552
|
-
|
|
451
|
+
pathFor(relativePath) {
|
|
553
452
|
//#region @backendFunc
|
|
554
453
|
if (Array.isArray(relativePath)) {
|
|
555
|
-
relativePath = (0,
|
|
454
|
+
relativePath = (0, tnp_core_2.crossPlatformPath)(relativePath);
|
|
556
455
|
}
|
|
557
|
-
if (
|
|
558
|
-
index_1.Helpers.error(
|
|
456
|
+
if (tnp_core_2.path.isAbsolute(relativePath)) {
|
|
457
|
+
index_1.Helpers.error(`Cannot join relative path with absolute: ${relativePath}`);
|
|
559
458
|
}
|
|
560
|
-
return (0,
|
|
459
|
+
return (0, tnp_core_2.crossPlatformPath)([this.location, relativePath]);
|
|
561
460
|
//#endregion
|
|
562
|
-
}
|
|
461
|
+
}
|
|
563
462
|
//#endregion
|
|
564
463
|
//#region methods & getters / write json
|
|
565
|
-
|
|
464
|
+
writeJson(relativePath, json) {
|
|
566
465
|
//#region @backendFunc
|
|
567
|
-
if (
|
|
568
|
-
index_1.Helpers.error(
|
|
466
|
+
if (tnp_core_2.path.isAbsolute(relativePath)) {
|
|
467
|
+
index_1.Helpers.error(`Cannot join relative path with absolute: ${relativePath}`);
|
|
569
468
|
}
|
|
570
|
-
index_1.Helpers.writeJson((0,
|
|
469
|
+
index_1.Helpers.writeJson((0, tnp_core_2.crossPlatformPath)([this.location, relativePath]), json);
|
|
571
470
|
//#endregion
|
|
572
|
-
}
|
|
471
|
+
}
|
|
573
472
|
//#endregion
|
|
574
473
|
//#region methods & getters / write json
|
|
575
|
-
|
|
474
|
+
writeJsonC(relativePath, json) {
|
|
576
475
|
//#region @backendFunc
|
|
577
|
-
if (
|
|
578
|
-
index_1.Helpers.error(
|
|
476
|
+
if (tnp_core_2.path.isAbsolute(relativePath)) {
|
|
477
|
+
index_1.Helpers.error(`Cannot join relative path with absolute: ${relativePath}`);
|
|
579
478
|
}
|
|
580
|
-
index_1.Helpers.writeJsonC((0,
|
|
479
|
+
index_1.Helpers.writeJsonC((0, tnp_core_2.crossPlatformPath)([this.location, relativePath]), json);
|
|
581
480
|
//#endregion
|
|
582
|
-
}
|
|
481
|
+
}
|
|
583
482
|
//#endregion
|
|
584
483
|
//#region methods & getters / run
|
|
585
484
|
/**
|
|
586
485
|
* @deprecated us execute instead
|
|
587
486
|
* use output from or more preciese crafted api
|
|
588
487
|
*/
|
|
589
|
-
|
|
590
|
-
|
|
488
|
+
run(command, options) {
|
|
489
|
+
let opt;
|
|
591
490
|
//#region @backend
|
|
592
491
|
options = tnp_core_4._.cloneDeep(options) || {};
|
|
593
|
-
index_1.Helpers.log(
|
|
492
|
+
index_1.Helpers.log(`command: ${command}`);
|
|
594
493
|
if (tnp_core_4._.isUndefined(options.showCommand)) {
|
|
595
494
|
options.showCommand = false;
|
|
596
495
|
}
|
|
@@ -599,46 +498,38 @@ var BaseProject = /** @class */ (function () {
|
|
|
599
498
|
opt.cwd = this.location;
|
|
600
499
|
}
|
|
601
500
|
if (opt.showCommand) {
|
|
602
|
-
index_1.Helpers.info(
|
|
501
|
+
index_1.Helpers.info(`[${tnp_core_1.CLI.chalk.underline('Executing shell command')}] "${command}" in [${opt.cwd}]`);
|
|
603
502
|
}
|
|
604
503
|
else {
|
|
605
|
-
index_1.Helpers.log(
|
|
504
|
+
index_1.Helpers.log(`[${tnp_core_1.CLI.chalk.underline('Executing shell command')}] "${command}" in [${opt.cwd}]`);
|
|
606
505
|
}
|
|
607
506
|
//#endregion
|
|
608
507
|
return index_1.Helpers.run(command, opt);
|
|
609
|
-
}
|
|
508
|
+
}
|
|
610
509
|
//#endregion
|
|
611
510
|
//#region methods & getters / execute
|
|
612
511
|
/**
|
|
613
512
|
* same as run but async
|
|
614
513
|
*/
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
index_1.Helpers.log("[".concat(tnp_core_2.CLI.chalk.underline('Executing shell command'), "] \"").concat(command, "\" in [").concat(cwd, "]"));
|
|
635
|
-
}
|
|
636
|
-
return [4 /*yield*/, index_1.Helpers.execute(command, cwd, options)];
|
|
637
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
638
|
-
}
|
|
639
|
-
});
|
|
640
|
-
});
|
|
641
|
-
};
|
|
514
|
+
async execute(command, options) {
|
|
515
|
+
//#region @backendFunc
|
|
516
|
+
options = options || {};
|
|
517
|
+
if (tnp_core_4._.isUndefined(options.showCommand)) {
|
|
518
|
+
options.showCommand = true;
|
|
519
|
+
}
|
|
520
|
+
if (!options) {
|
|
521
|
+
options = {};
|
|
522
|
+
}
|
|
523
|
+
const cwd = this.location;
|
|
524
|
+
if (options.showCommand) {
|
|
525
|
+
index_1.Helpers.logInfo(`[${tnp_core_1.CLI.chalk.underline('Executing shell command')}] "${command}" in [${cwd}]`);
|
|
526
|
+
}
|
|
527
|
+
else {
|
|
528
|
+
index_1.Helpers.log(`[${tnp_core_1.CLI.chalk.underline('Executing shell command')}] "${command}" in [${cwd}]`);
|
|
529
|
+
}
|
|
530
|
+
return await index_1.Helpers.execute(command, cwd, options);
|
|
531
|
+
//#endregion
|
|
532
|
+
}
|
|
642
533
|
//#endregion
|
|
643
534
|
//#region methods & getters / try run sync command
|
|
644
535
|
/**
|
|
@@ -647,7 +538,7 @@ var BaseProject = /** @class */ (function () {
|
|
|
647
538
|
* @param options
|
|
648
539
|
* @returns
|
|
649
540
|
*/
|
|
650
|
-
|
|
541
|
+
tryRunSync(command,
|
|
651
542
|
//#region @backend
|
|
652
543
|
options) {
|
|
653
544
|
//#region @backendFunc
|
|
@@ -655,36 +546,36 @@ var BaseProject = /** @class */ (function () {
|
|
|
655
546
|
this.run(command, options).sync();
|
|
656
547
|
}
|
|
657
548
|
catch (error) {
|
|
658
|
-
index_1.Helpers.warn(
|
|
549
|
+
index_1.Helpers.warn(`Not able to execute: ${command}`);
|
|
659
550
|
}
|
|
660
551
|
//#endregion
|
|
661
|
-
}
|
|
552
|
+
}
|
|
662
553
|
//#endregion
|
|
663
554
|
//#region methods & getters / output from command
|
|
664
|
-
|
|
555
|
+
outputFrom(command,
|
|
665
556
|
//#region @backend
|
|
666
557
|
options) {
|
|
667
558
|
//#region @backendFunc
|
|
668
559
|
return index_1.Helpers.commnadOutputAsString(command, this.location, options);
|
|
669
560
|
//#endregion
|
|
670
|
-
}
|
|
561
|
+
}
|
|
671
562
|
//#endregion
|
|
672
563
|
//#region methods & getters / remove file
|
|
673
|
-
|
|
564
|
+
removeFile(fileRelativeToProjectPath) {
|
|
674
565
|
//#region @backendFunc
|
|
675
|
-
|
|
566
|
+
const fullPath = tnp_core_2.path.resolve(tnp_core_2.path.join(this.location, fileRelativeToProjectPath));
|
|
676
567
|
return index_1.Helpers.removeFileIfExists(fullPath);
|
|
677
568
|
//#endregion
|
|
678
|
-
}
|
|
569
|
+
}
|
|
679
570
|
//#endregion
|
|
680
571
|
//#region methods & getters / read file
|
|
681
|
-
|
|
572
|
+
readFile(fileRelativeToProjectPath) {
|
|
682
573
|
//#region @backendFunc
|
|
683
|
-
|
|
574
|
+
const fullPath = tnp_core_2.path.resolve(tnp_core_2.path.join(this.location, fileRelativeToProjectPath));
|
|
684
575
|
// console.log('fullPath', fullPath);
|
|
685
576
|
return index_1.Helpers.readFile(fullPath);
|
|
686
577
|
//#endregion
|
|
687
|
-
}
|
|
578
|
+
}
|
|
688
579
|
//#endregion
|
|
689
580
|
//#region methods & getters / read file
|
|
690
581
|
/**
|
|
@@ -694,26 +585,25 @@ var BaseProject = /** @class */ (function () {
|
|
|
694
585
|
* @param fileRelativeToProjectPath
|
|
695
586
|
* @returns
|
|
696
587
|
*/
|
|
697
|
-
|
|
588
|
+
readJson(fileRelativeToProjectPath) {
|
|
698
589
|
//#region @backendFunc
|
|
699
|
-
|
|
590
|
+
const fullPath = tnp_core_2.path.resolve(tnp_core_2.path.join(this.location, fileRelativeToProjectPath));
|
|
700
591
|
return index_1.Helpers.readJson5(fullPath);
|
|
701
592
|
//#endregion
|
|
702
|
-
}
|
|
593
|
+
}
|
|
703
594
|
//#endregion
|
|
704
595
|
//#region methods & getters / copy files or folders
|
|
705
596
|
/**
|
|
706
597
|
* copy files or folders from
|
|
707
598
|
* project to destination
|
|
708
599
|
*/
|
|
709
|
-
|
|
710
|
-
var _this = this;
|
|
600
|
+
copy(filesOrFolderRelativePathes) {
|
|
711
601
|
return {
|
|
712
|
-
to:
|
|
602
|
+
to: (destination) => {
|
|
713
603
|
//#region @backendFunc
|
|
714
|
-
for (
|
|
715
|
-
|
|
716
|
-
|
|
604
|
+
for (let index = 0; index < filesOrFolderRelativePathes.length; index++) {
|
|
605
|
+
const source = this.pathFor(filesOrFolderRelativePathes[index]);
|
|
606
|
+
const dest = (0, tnp_core_2.crossPlatformPath)([
|
|
717
607
|
destination,
|
|
718
608
|
filesOrFolderRelativePathes[index],
|
|
719
609
|
]);
|
|
@@ -727,125 +617,85 @@ var BaseProject = /** @class */ (function () {
|
|
|
727
617
|
//#endregion
|
|
728
618
|
},
|
|
729
619
|
};
|
|
730
|
-
}
|
|
620
|
+
}
|
|
731
621
|
//#endregion
|
|
732
622
|
//#region methods & getters / remove (fiel or folder)
|
|
733
|
-
|
|
734
|
-
if (exactPath === void 0) { exactPath = true; }
|
|
623
|
+
remove(relativePath, exactPath = true) {
|
|
735
624
|
//#region @backendFunc
|
|
736
625
|
if (Array.isArray(relativePath)) {
|
|
737
|
-
relativePath = (0,
|
|
626
|
+
relativePath = (0, tnp_core_2.crossPlatformPath)(relativePath);
|
|
738
627
|
}
|
|
739
628
|
relativePath = relativePath.replace(/^\//, '');
|
|
740
|
-
if (
|
|
629
|
+
if (tnp_core_2.path.basename(relativePath) === tnp_config_1.config.folder.node_modules) {
|
|
741
630
|
index_1.Helpers.info('Removing node_modules folder...');
|
|
742
631
|
}
|
|
743
632
|
index_1.Helpers.remove([this.location, relativePath], exactPath);
|
|
744
633
|
//#endregion
|
|
745
|
-
}
|
|
634
|
+
}
|
|
746
635
|
//#endregion
|
|
747
636
|
//#region methods & getters / remove folder by relative path
|
|
748
|
-
|
|
637
|
+
removeFolderByRelativePath(relativePathToFolder) {
|
|
749
638
|
//#region @backend
|
|
750
639
|
relativePathToFolder = relativePathToFolder.replace(/^\//, '');
|
|
751
|
-
|
|
752
|
-
|
|
640
|
+
const location = this.location;
|
|
641
|
+
const p = tnp_core_2.path.join(location, relativePathToFolder);
|
|
753
642
|
index_1.Helpers.remove(p, true);
|
|
754
643
|
//#endregion
|
|
755
|
-
}
|
|
644
|
+
}
|
|
756
645
|
//#endregion
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
646
|
+
get isAngularLib() {
|
|
647
|
+
//#region @backendFunc
|
|
648
|
+
if (this.hasFile('ng-package.json')) {
|
|
649
|
+
return true;
|
|
650
|
+
}
|
|
651
|
+
const angularJson = this.parent?.readJson('angular.json') || {};
|
|
652
|
+
const projects = angularJson?.projects || {};
|
|
653
|
+
if (projects && projects[this.basename]?.projectType === 'library') {
|
|
654
|
+
return true;
|
|
655
|
+
}
|
|
656
|
+
return false;
|
|
657
|
+
//#endregion
|
|
658
|
+
}
|
|
659
|
+
getUniqueForTask(task) {
|
|
660
|
+
return `task(${task}) in ${this.genericName}`;
|
|
661
|
+
}
|
|
662
|
+
async registerAndAssignPort(taskName, options) {
|
|
663
|
+
//#region @backendFunc
|
|
664
|
+
taskName = this.getUniqueForTask(taskName);
|
|
665
|
+
options = options || {};
|
|
666
|
+
const ctrl = await this.ins.portsWorker.getControllerForRemoteConnection();
|
|
667
|
+
const data = await ctrl.registerAndAssignPort(encodeURIComponent(taskName), tnp_core_4._.isNumber(options.startFrom) ? options.startFrom : void 0).received;
|
|
668
|
+
return data.body.json.port;
|
|
669
|
+
//#endregion
|
|
670
|
+
}
|
|
780
671
|
//#region methods & getters / assign free port to project instance
|
|
781
672
|
/**
|
|
782
|
-
* @deprecated use registerAndAssignPort() instead
|
|
673
|
+
* @deprecated use this.registerAndAssignPort() or Utils.getFreePort() instead
|
|
783
674
|
*/
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
return tslib_1.__generator(this, function (_a) {
|
|
790
|
-
switch (_a.label) {
|
|
791
|
-
case 0:
|
|
792
|
-
//#region @backendFunc
|
|
793
|
-
if (tnp_core_4._.isNumber(this.port) && this.port >= startFrom) {
|
|
794
|
-
return [2 /*return*/, startFrom];
|
|
795
|
-
}
|
|
796
|
-
max = 2000;
|
|
797
|
-
i = 0;
|
|
798
|
-
while (takenPorts.includes(startFrom)) {
|
|
799
|
-
startFrom += 1 + howManyFreePortsAfterThatPort;
|
|
800
|
-
}
|
|
801
|
-
_a.label = 1;
|
|
802
|
-
case 1:
|
|
803
|
-
if (!true) return [3 /*break*/, 6];
|
|
804
|
-
_a.label = 2;
|
|
805
|
-
case 2:
|
|
806
|
-
_a.trys.push([2, 4, , 5]);
|
|
807
|
-
return [4 /*yield*/, tnp_core_1.portfinder.getPortPromise({ port: startFrom })];
|
|
808
|
-
case 3:
|
|
809
|
-
port = _a.sent();
|
|
810
|
-
takenPorts.push(port);
|
|
811
|
-
// @ts-ignore
|
|
812
|
-
this.port = port;
|
|
813
|
-
return [2 /*return*/, port];
|
|
814
|
-
case 4:
|
|
815
|
-
err_1 = _a.sent();
|
|
816
|
-
console.log(err_1);
|
|
817
|
-
index_1.Helpers.warn("Trying to assign port :".concat(startFrom, " but already in use."), false);
|
|
818
|
-
return [3 /*break*/, 5];
|
|
819
|
-
case 5:
|
|
820
|
-
startFrom += 1;
|
|
821
|
-
if (i++ === max) {
|
|
822
|
-
index_1.Helpers.error("[taon-helpers]] failed to assign free port after ".concat(max, " trys..."));
|
|
823
|
-
}
|
|
824
|
-
return [3 /*break*/, 1];
|
|
825
|
-
case 6: return [2 /*return*/];
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
});
|
|
829
|
-
};
|
|
675
|
+
async assignFreePort(startFrom = 4200) {
|
|
676
|
+
//#region @backendFunc
|
|
677
|
+
return tnp_core_5.Utils.getFreePort({ startFrom });
|
|
678
|
+
//#endregion
|
|
679
|
+
}
|
|
830
680
|
//#endregion
|
|
831
681
|
//#region methods & getters / remove project from disk/memory
|
|
832
|
-
|
|
682
|
+
removeItself() {
|
|
833
683
|
//#region @backend
|
|
834
684
|
this.ins.remove(this);
|
|
835
685
|
//#endregion
|
|
836
|
-
}
|
|
686
|
+
}
|
|
837
687
|
//#endregion
|
|
838
688
|
//#region methods & getters / define property
|
|
839
689
|
/**
|
|
840
690
|
* Purpose: not initializing all classes at the beginning
|
|
841
691
|
* Only for BaseFeatureForProject class
|
|
842
692
|
*/
|
|
843
|
-
|
|
693
|
+
defineProperty(variableName, classFn, options) {
|
|
844
694
|
//#region @backendFunc
|
|
845
|
-
|
|
846
|
-
|
|
695
|
+
const { customInstanceReturn } = options || {};
|
|
696
|
+
const that = this;
|
|
847
697
|
// @ts-ignore
|
|
848
|
-
|
|
698
|
+
const prefixedName = `__${variableName}`;
|
|
849
699
|
Object.defineProperty(this, variableName, {
|
|
850
700
|
get: function () {
|
|
851
701
|
if (!that[prefixedName]) {
|
|
@@ -858,7 +708,7 @@ var BaseProject = /** @class */ (function () {
|
|
|
858
708
|
}
|
|
859
709
|
}
|
|
860
710
|
else {
|
|
861
|
-
index_1.Helpers.warn(
|
|
711
|
+
index_1.Helpers.warn(`[taon-helpers] Cannot create dynamic instance of class "${tnp_core_4._.kebabCase(prefixedName.replace('__', ''))}".`);
|
|
862
712
|
}
|
|
863
713
|
// }
|
|
864
714
|
}
|
|
@@ -869,218 +719,179 @@ var BaseProject = /** @class */ (function () {
|
|
|
869
719
|
},
|
|
870
720
|
});
|
|
871
721
|
//#endregion
|
|
872
|
-
}
|
|
722
|
+
}
|
|
873
723
|
//#endregion
|
|
874
724
|
//#region methods & getters / filter only copy
|
|
875
725
|
/**
|
|
876
726
|
* fs.copy option filter function for copying only selected folders from project
|
|
877
727
|
*/
|
|
878
|
-
|
|
728
|
+
filterOnlyCopy(basePathFoldersOnlyToInclude) {
|
|
879
729
|
//#region @backendFunc
|
|
880
730
|
return index_1.Helpers.filterOnlyCopy(basePathFoldersOnlyToInclude, this.location);
|
|
881
731
|
//#endregion
|
|
882
|
-
}
|
|
732
|
+
}
|
|
883
733
|
//#endregion
|
|
884
734
|
//#region methods & getters / filter don't copy
|
|
885
735
|
/**
|
|
886
736
|
* fs.copy option filter function for copying only not selected folders from project
|
|
887
737
|
*/
|
|
888
|
-
|
|
738
|
+
filterDontCopy(basePathFoldersTosSkip) {
|
|
889
739
|
//#region @backendFunc
|
|
890
740
|
return index_1.Helpers.filterDontCopy(basePathFoldersTosSkip, this.location);
|
|
891
741
|
//#endregion
|
|
892
|
-
}
|
|
893
|
-
//#endregion
|
|
894
|
-
//#region methods & getters / get default develop Branch
|
|
895
|
-
/**
|
|
896
|
-
* general default development branch for all kinds of projects
|
|
897
|
-
*/
|
|
898
|
-
BaseProject.prototype.getDefaultDevelopmentBranch = function () {
|
|
899
|
-
return 'develop';
|
|
900
|
-
};
|
|
742
|
+
}
|
|
901
743
|
//#endregion
|
|
902
744
|
//#region methods & getters / get main branches
|
|
903
745
|
/**
|
|
904
746
|
* main/default hardcoded branches
|
|
905
747
|
*/
|
|
906
|
-
|
|
748
|
+
getMainBranches() {
|
|
907
749
|
return ['master', 'develop', 'stage', 'prod', 'test'];
|
|
908
|
-
}
|
|
909
|
-
//#endregion
|
|
910
|
-
//#region methods & getters / is using action commit
|
|
911
|
-
BaseProject.prototype.isUnsingActionCommit = function () {
|
|
912
|
-
return false;
|
|
913
|
-
};
|
|
750
|
+
}
|
|
914
751
|
//#endregion
|
|
915
752
|
//#region methods & getters / use feature in branch name for tests
|
|
916
|
-
|
|
753
|
+
useFeatureInBranchNameForTests() {
|
|
917
754
|
return false;
|
|
918
|
-
}
|
|
755
|
+
}
|
|
919
756
|
//#endregion
|
|
920
757
|
//#region methods & getters / reset process
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
if (!!_b.done) return [3 /*break*/, 7];
|
|
958
|
-
linked = _b.value;
|
|
959
|
-
child = this.ins.From(this.pathFor([linked.relativeClonePath]));
|
|
960
|
-
if (!child) return [3 /*break*/, 6];
|
|
961
|
-
return [4 /*yield*/, child.resetProcess(child.linkedProjects.resetLinkedProjectsOnlyToCoreBranches()
|
|
962
|
-
? void 0
|
|
963
|
-
: branchToReset, true)];
|
|
964
|
-
case 5:
|
|
965
|
-
_e.sent();
|
|
966
|
-
_e.label = 6;
|
|
967
|
-
case 6:
|
|
968
|
-
_b = _a.next();
|
|
969
|
-
return [3 /*break*/, 4];
|
|
970
|
-
case 7: return [3 /*break*/, 10];
|
|
971
|
-
case 8:
|
|
972
|
-
e_5_1 = _e.sent();
|
|
973
|
-
e_5 = { error: e_5_1 };
|
|
974
|
-
return [3 /*break*/, 10];
|
|
975
|
-
case 9:
|
|
976
|
-
try {
|
|
977
|
-
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
978
|
-
}
|
|
979
|
-
finally { if (e_5) throw e_5.error; }
|
|
980
|
-
return [7 /*endfinally*/];
|
|
981
|
-
case 10: return [2 /*return*/];
|
|
758
|
+
async resetProcess(overrideBranch, recrusive = false) {
|
|
759
|
+
//#region @backend
|
|
760
|
+
// console.log(`CORE PROJECT BRANCH ${this.name}: ${this.core?.branch}, overrideBranch: ${overrideBranch}`)
|
|
761
|
+
const resetChildren = this.git.resetIsRestingAlsoChildren();
|
|
762
|
+
const resetOnlyChildren = !!this.linkedProjects.getLinkedProjectsConfig().resetOnlyChildren;
|
|
763
|
+
index_1.Helpers.taskStarted(`
|
|
764
|
+
|
|
765
|
+
Starting reset process for ${this.name || this.basename}
|
|
766
|
+
|
|
767
|
+
`);
|
|
768
|
+
this.git._beforeAnyActionOnGitRoot();
|
|
769
|
+
let branchToReset = overrideBranch ||
|
|
770
|
+
this.core?.branch ||
|
|
771
|
+
this.git.getDefaultDevelopmentBranch();
|
|
772
|
+
index_1.Helpers.info(`fetch data in ${this.genericName}`);
|
|
773
|
+
this.git.fetch();
|
|
774
|
+
if (!resetOnlyChildren) {
|
|
775
|
+
index_1.Helpers.logInfo(`reseting hard in ${this.genericName}`);
|
|
776
|
+
this.git.resetHard();
|
|
777
|
+
index_1.Helpers.logInfo(`checking out branch "${branchToReset}" in ${this.genericName}`);
|
|
778
|
+
this.git.checkout(branchToReset);
|
|
779
|
+
index_1.Helpers.logInfo(`pulling current branch in ${this.genericName}`);
|
|
780
|
+
await this.git.pullCurrentBranch({ askToRetry: true });
|
|
781
|
+
index_1.Helpers.logInfo(`initing (struct) in ${this.genericName}`);
|
|
782
|
+
await this.struct();
|
|
783
|
+
index_1.Helpers.taskDone(`RESET DONE BRANCH: ${tnp_core_3.chalk.bold(branchToReset)} in ${this.genericName}`);
|
|
784
|
+
}
|
|
785
|
+
// console.log('resetOnlyChildren', resetOnlyChildren);
|
|
786
|
+
// console.log('resetChildren', resetChildren);
|
|
787
|
+
if (resetChildren) {
|
|
788
|
+
for (const linked of this.linkedProjects.linkedProjects) {
|
|
789
|
+
const child = this.ins.From(this.pathFor([linked.relativeClonePath]));
|
|
790
|
+
if (child) {
|
|
791
|
+
await child.resetProcess(child.linkedProjects.resetLinkedProjectsOnlyToCoreBranches()
|
|
792
|
+
? void 0
|
|
793
|
+
: branchToReset, true);
|
|
982
794
|
}
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
//#endregion
|
|
798
|
+
}
|
|
986
799
|
//#endregion
|
|
987
800
|
//#region methods & getters / link project to
|
|
988
|
-
|
|
801
|
+
linkTo(destPackageLocation) {
|
|
989
802
|
//#region @backend
|
|
990
803
|
index_1.Helpers.createSymLink(this.location, destPackageLocation);
|
|
991
804
|
//#endregion
|
|
992
|
-
}
|
|
805
|
+
}
|
|
993
806
|
//#endregion
|
|
994
807
|
//#region methods & getters / set value to json
|
|
995
|
-
|
|
808
|
+
setValueToJSON(relativePath, lodashGetPath, value) {
|
|
996
809
|
//#region @backendFunc
|
|
997
810
|
if (Array.isArray(relativePath)) {
|
|
998
|
-
relativePath = (0,
|
|
811
|
+
relativePath = (0, tnp_core_2.crossPlatformPath)(relativePath);
|
|
999
812
|
}
|
|
1000
813
|
index_1.Helpers.setValueToJSON(this.pathFor(relativePath), lodashGetPath, value);
|
|
1001
814
|
//#endregion
|
|
1002
|
-
}
|
|
815
|
+
}
|
|
1003
816
|
//#endregion
|
|
1004
817
|
//#region methods & getters / set value to json
|
|
1005
|
-
|
|
818
|
+
setValueToJSONC(relativePath, lodashGetPath, value) {
|
|
1006
819
|
//#region @backendFunc
|
|
1007
820
|
if (Array.isArray(relativePath)) {
|
|
1008
|
-
relativePath = (0,
|
|
821
|
+
relativePath = (0, tnp_core_2.crossPlatformPath)(relativePath);
|
|
1009
822
|
}
|
|
1010
823
|
index_1.Helpers.setValueToJSONC(this.pathFor(relativePath), lodashGetPath, value);
|
|
1011
824
|
//#endregion
|
|
1012
|
-
}
|
|
825
|
+
}
|
|
1013
826
|
//#endregion
|
|
1014
827
|
//#region methods & getters / set value to json
|
|
1015
|
-
|
|
828
|
+
setValueToJSON5(relativePath, lodashGetPath, value) {
|
|
1016
829
|
//#region @backendFunc
|
|
1017
830
|
if (Array.isArray(relativePath)) {
|
|
1018
|
-
relativePath = (0,
|
|
831
|
+
relativePath = (0, tnp_core_2.crossPlatformPath)(relativePath);
|
|
1019
832
|
}
|
|
1020
833
|
index_1.Helpers.setValueToJSONC(this.pathFor(relativePath), lodashGetPath, value);
|
|
1021
834
|
//#endregion
|
|
1022
|
-
}
|
|
835
|
+
}
|
|
1023
836
|
//#endregion
|
|
1024
837
|
//#region methods & getters / get value from json
|
|
1025
|
-
|
|
1026
|
-
if (defaultValue === void 0) { defaultValue = void 0; }
|
|
838
|
+
getValueFromJSON(relativePath, lodashGetPath, defaultValue = void 0) {
|
|
1027
839
|
//#region @backendFunc
|
|
1028
840
|
if (Array.isArray(relativePath)) {
|
|
1029
|
-
relativePath = (0,
|
|
841
|
+
relativePath = (0, tnp_core_2.crossPlatformPath)(relativePath);
|
|
1030
842
|
}
|
|
1031
843
|
return index_1.Helpers.getValueFromJSON(this.pathFor(relativePath), lodashGetPath, defaultValue);
|
|
1032
844
|
//#endregion
|
|
1033
|
-
}
|
|
845
|
+
}
|
|
1034
846
|
//#endregion
|
|
1035
847
|
//#region methods & getters / get value from jsonc
|
|
1036
|
-
|
|
1037
|
-
if (defaultValue === void 0) { defaultValue = void 0; }
|
|
848
|
+
getValueFromJSONC(relativePath, lodashGetPath, defaultValue = void 0) {
|
|
1038
849
|
//#region @backendFunc
|
|
1039
850
|
if (Array.isArray(relativePath)) {
|
|
1040
|
-
relativePath = (0,
|
|
851
|
+
relativePath = (0, tnp_core_2.crossPlatformPath)(relativePath);
|
|
1041
852
|
}
|
|
1042
853
|
return index_1.Helpers.getValueFromJSONC(this.pathFor(relativePath), lodashGetPath, defaultValue);
|
|
1043
854
|
//#endregion
|
|
1044
|
-
}
|
|
855
|
+
}
|
|
1045
856
|
//#endregion
|
|
1046
857
|
//#region methods & getters / write file
|
|
1047
|
-
|
|
858
|
+
writeFile(relativePath, content) {
|
|
1048
859
|
//#region @backend
|
|
1049
860
|
if (Array.isArray(relativePath)) {
|
|
1050
|
-
relativePath = (0,
|
|
861
|
+
relativePath = (0, tnp_core_2.crossPlatformPath)(relativePath);
|
|
1051
862
|
}
|
|
1052
863
|
index_1.Helpers.writeFile([this.location, relativePath], content);
|
|
1053
864
|
//#endregion
|
|
1054
|
-
}
|
|
865
|
+
}
|
|
1055
866
|
//#endregion
|
|
1056
867
|
//#region getters & methods / run command and get string
|
|
1057
|
-
|
|
868
|
+
runCommandGetString(command) {
|
|
1058
869
|
//#region @backendFunc
|
|
1059
870
|
return index_1.Helpers.commnadOutputAsString(command, this.location, {
|
|
1060
871
|
biggerBuffer: false,
|
|
1061
872
|
});
|
|
1062
873
|
//#endregion
|
|
874
|
+
}
|
|
875
|
+
//#endregion
|
|
876
|
+
//#region getters & methods / to string
|
|
877
|
+
toString = () => {
|
|
878
|
+
return `${this.name}=>${this.location}`;
|
|
1063
879
|
};
|
|
1064
|
-
|
|
880
|
+
//#endregion
|
|
881
|
+
//#region getters & methods / find partners names
|
|
882
|
+
get parentsNames() {
|
|
883
|
+
//#region @backendFunc
|
|
884
|
+
return this.findParentsNames();
|
|
1065
885
|
//#endregion
|
|
1066
|
-
|
|
1067
|
-
get: function () {
|
|
1068
|
-
//#region @backendFunc
|
|
1069
|
-
return this.findParentsNames();
|
|
1070
|
-
//#endregion
|
|
1071
|
-
},
|
|
1072
|
-
enumerable: false,
|
|
1073
|
-
configurable: true
|
|
1074
|
-
});
|
|
886
|
+
}
|
|
1075
887
|
//#region getters & methods / open location
|
|
1076
|
-
|
|
888
|
+
openLocation(relativeFolderPath) {
|
|
1077
889
|
//#region @backendFunc
|
|
1078
890
|
index_1.Helpers.openFolderInFileExploer(this.pathFor(relativeFolderPath));
|
|
1079
891
|
//#endregion
|
|
1080
|
-
}
|
|
892
|
+
}
|
|
1081
893
|
//#endregion
|
|
1082
|
-
|
|
1083
|
-
if (result === void 0) { result = []; }
|
|
894
|
+
findParentsNames(project, parent, result = []) {
|
|
1084
895
|
//#region @backendFunc
|
|
1085
896
|
if (!project && !parent) {
|
|
1086
897
|
project = this;
|
|
@@ -1089,150 +900,132 @@ var BaseProject = /** @class */ (function () {
|
|
|
1089
900
|
return result.reverse();
|
|
1090
901
|
}
|
|
1091
902
|
if (project && project.parent) {
|
|
1092
|
-
result.push(project.parent.name);
|
|
903
|
+
result.push(project.parent.basename, project.parent.name);
|
|
1093
904
|
}
|
|
1094
905
|
return this.findParentsNames(project.parent, project, result);
|
|
1095
906
|
//#endregion
|
|
1096
|
-
}
|
|
907
|
+
}
|
|
1097
908
|
//#endregion
|
|
1098
909
|
//#region getters & methods / kill all instance
|
|
1099
|
-
|
|
910
|
+
tryKillAllElectronInstances() {
|
|
1100
911
|
//#region @backendFunc
|
|
1101
912
|
index_1.Helpers.taskStarted('Killing all app instances');
|
|
1102
913
|
try {
|
|
1103
914
|
if (process.platform === 'win32') {
|
|
1104
|
-
index_1.Helpers.run(
|
|
915
|
+
index_1.Helpers.run(`taskkill /f /im ${this.name}.exe`).sync();
|
|
1105
916
|
}
|
|
1106
917
|
else {
|
|
1107
|
-
index_1.Helpers.run(
|
|
918
|
+
index_1.Helpers.run(`fkill -f ${this.name}`).sync();
|
|
1108
919
|
}
|
|
1109
920
|
}
|
|
1110
921
|
catch (error) { }
|
|
1111
922
|
index_1.Helpers.taskDone('Done kill all app instances');
|
|
1112
923
|
//#endregion
|
|
1113
|
-
}
|
|
924
|
+
}
|
|
1114
925
|
//#endregion
|
|
1115
926
|
//#region getters & methods / init
|
|
1116
927
|
/**
|
|
1117
928
|
* init project files structure and depedencies
|
|
1118
929
|
*/
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
throw new Error('TODO IMPLEMENT');
|
|
1123
|
-
});
|
|
1124
|
-
});
|
|
1125
|
-
};
|
|
930
|
+
async init(initOptions) {
|
|
931
|
+
throw new Error('TODO IMPLEMENT');
|
|
932
|
+
}
|
|
1126
933
|
//#endregion
|
|
1127
934
|
//#region getters & methods / link
|
|
1128
935
|
/**
|
|
1129
936
|
* globally link npm as package
|
|
1130
937
|
*/
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
throw new Error('TODO IMPLEMENT');
|
|
1135
|
-
});
|
|
1136
|
-
});
|
|
1137
|
-
};
|
|
938
|
+
async link() {
|
|
939
|
+
throw new Error('TODO IMPLEMENT');
|
|
940
|
+
}
|
|
1138
941
|
//#endregion
|
|
1139
942
|
//#region getters & methods / struct
|
|
1140
943
|
/**
|
|
1141
944
|
* init project files structure without depedencies
|
|
1142
945
|
*/
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
throw new Error('TODO IMPLEMENT');
|
|
1147
|
-
});
|
|
1148
|
-
});
|
|
1149
|
-
};
|
|
946
|
+
async struct(initOptions) {
|
|
947
|
+
throw new Error('TODO IMPLEMENT');
|
|
948
|
+
}
|
|
1150
949
|
//#endregion
|
|
1151
950
|
//#region getters & methods / build
|
|
1152
951
|
/**
|
|
1153
952
|
* init and build() project
|
|
1154
953
|
*/
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
throw new Error('TODO IMPLEMENT');
|
|
1159
|
-
});
|
|
1160
|
-
});
|
|
1161
|
-
};
|
|
954
|
+
async test(testOptions) {
|
|
955
|
+
throw new Error('TODO IMPLEMENT');
|
|
956
|
+
}
|
|
1162
957
|
//#endregion
|
|
1163
958
|
//#region getters & methods / build
|
|
1164
959
|
/**
|
|
1165
960
|
* init and build() project
|
|
1166
961
|
*/
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
throw new Error('TODO IMPLEMENT');
|
|
1171
|
-
});
|
|
1172
|
-
});
|
|
1173
|
-
};
|
|
962
|
+
async build(buildOptions) {
|
|
963
|
+
throw new Error('TODO IMPLEMENT');
|
|
964
|
+
}
|
|
1174
965
|
//#endregion
|
|
1175
966
|
//#region getters & methods / publish
|
|
1176
967
|
/**
|
|
1177
968
|
* publish project to npm
|
|
1178
969
|
*/
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
throw new Error('TODO IMPLEMENT');
|
|
1183
|
-
});
|
|
1184
|
-
});
|
|
1185
|
-
};
|
|
970
|
+
async publish(publishOptions) {
|
|
971
|
+
this.npmHelpers.publishToNpmRegistry();
|
|
972
|
+
}
|
|
1186
973
|
//#endregion
|
|
1187
974
|
//#region getters & methods / build
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
throw new Error('TODO IMPLEMENT');
|
|
1192
|
-
});
|
|
1193
|
-
});
|
|
1194
|
-
};
|
|
975
|
+
async release(releaseOptions) {
|
|
976
|
+
throw new Error('TODO IMPLEMENT');
|
|
977
|
+
}
|
|
1195
978
|
//#endregion
|
|
1196
979
|
//#region getters & methods / lint
|
|
1197
980
|
/**
|
|
1198
981
|
* lint porject
|
|
1199
982
|
*/
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
983
|
+
async lint(lintOptions) {
|
|
984
|
+
index_1.Helpers.info(`
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
COMMIT LINT NOT IMPLEMENTED
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
`);
|
|
991
|
+
}
|
|
1208
992
|
//#endregion
|
|
1209
993
|
//#region getters & methods / info
|
|
1210
994
|
/**
|
|
1211
995
|
* get info about porject
|
|
1212
996
|
*/
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
997
|
+
async info() {
|
|
998
|
+
//#region @backendFunc
|
|
999
|
+
const proj = this;
|
|
1000
|
+
index_1.Helpers.info(`
|
|
1001
|
+
|
|
1002
|
+
name: ${proj?.name}
|
|
1003
|
+
type: ${proj?.type}
|
|
1004
|
+
parent: ${proj?.parent?.genericName || '< none >'}
|
|
1005
|
+
core project name: '${proj?.core?.name}'
|
|
1006
|
+
embedded project: ${proj?.linkedProjects.embeddedProject?.genericName || '< none >'}
|
|
1007
|
+
children (${proj?.children.length}): ${!proj || !proj.children.length ? '< none >' : ''}
|
|
1008
|
+
${proj?.children.map(c => '+' + c.genericName).join('\n')}
|
|
1009
|
+
|
|
1010
|
+
libraries (${proj?.libraryBuild?.libraries?.length}): ${!proj || !proj.libraryBuild?.libraries?.length ? '< none >' : ''}
|
|
1011
|
+
${proj?.libraryBuild?.libraries?.map(c => '+' + c.genericName).join('\n')}
|
|
1012
|
+
` +
|
|
1013
|
+
`
|
|
1014
|
+
linked porject prefix: "${this.linkedProjects.linkedProjectsPrefix}"
|
|
1015
|
+
|
|
1016
|
+
linked projects from json (${this.linkedProjects.linkedProjects?.length || 0}):
|
|
1017
|
+
${(this.linkedProjects.linkedProjects || [])
|
|
1018
|
+
.map(c => {
|
|
1019
|
+
const proj = this.ins.From(this.pathFor(c.relativeClonePath));
|
|
1020
|
+
return '- ' + proj ? proj?.genericName : c.relativeClonePath;
|
|
1021
|
+
})
|
|
1022
|
+
.join('\n')}
|
|
1023
|
+
|
|
1024
|
+
`);
|
|
1025
|
+
// linked projects detected (${this.detectedLinkedProjects?.length || 0}):
|
|
1026
|
+
// ${(this.detectedLinkedProjects || []).map(c => '- ' + c.relativeClonePath).join('\n')}
|
|
1027
|
+
//#endregion
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1237
1030
|
exports.BaseProject = BaseProject;
|
|
1238
1031
|
//# sourceMappingURL=base-project.js.map
|