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