tnp-helpers 18.0.20 → 18.0.22
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/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 +33 -410
- 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 +4630 -2879
- 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 +32 -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 +33 -410
- 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 +4630 -2879
- 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 +32 -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 +32 -99
- package/lib/base/classes/base-npm-helpers.js +194 -735
- 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 +33 -410
- 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 +4749 -2998
- 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 +32 -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
|
@@ -0,0 +1,1202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseGit = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
//#region imports
|
|
6
|
+
//#region @backend
|
|
7
|
+
var tnp_core_1 = require("tnp-core");
|
|
8
|
+
var translate_1 = require("./translate");
|
|
9
|
+
//#endregion
|
|
10
|
+
var base_feature_for_project_1 = require("./base-feature-for-project");
|
|
11
|
+
var index_1 = require("../index");
|
|
12
|
+
var tnp_core_2 = require("tnp-core");
|
|
13
|
+
//#endregion
|
|
14
|
+
var BaseGit = /** @class */ (function (_super) {
|
|
15
|
+
tslib_1.__extends(BaseGit, _super);
|
|
16
|
+
function BaseGit() {
|
|
17
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
18
|
+
}
|
|
19
|
+
//#region methods & getters / unstage all files
|
|
20
|
+
BaseGit.prototype.unstageAllFiles = function () {
|
|
21
|
+
//#region @backendFunc
|
|
22
|
+
index_1.Helpers.git.unstageAllFiles(this.project.location);
|
|
23
|
+
//#endregion
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region methods & getters / revert file changes
|
|
27
|
+
BaseGit.prototype.revertFileChanges = function (fileReletivePath) {
|
|
28
|
+
//#region @backendFunc
|
|
29
|
+
index_1.Helpers.git.revertFileChanges(this.project.location, fileReletivePath);
|
|
30
|
+
//#endregion
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region methods & getters / clone
|
|
34
|
+
BaseGit.prototype.clone = function (url_1) {
|
|
35
|
+
return tslib_1.__awaiter(this, arguments, void 0, function (url, destinationFolderName, branchName) {
|
|
36
|
+
var clondeFolderpath, error_1;
|
|
37
|
+
if (destinationFolderName === void 0) { destinationFolderName = ''; }
|
|
38
|
+
return tslib_1.__generator(this, function (_a) {
|
|
39
|
+
switch (_a.label) {
|
|
40
|
+
case 0: return [4 /*yield*/, index_1.Helpers.git.clone({
|
|
41
|
+
cwd: this.project.location,
|
|
42
|
+
url: url,
|
|
43
|
+
destinationFolderName: destinationFolderName,
|
|
44
|
+
})];
|
|
45
|
+
case 1:
|
|
46
|
+
clondeFolderpath = _a.sent();
|
|
47
|
+
if (!branchName) return [3 /*break*/, 5];
|
|
48
|
+
_a.label = 2;
|
|
49
|
+
case 2:
|
|
50
|
+
_a.trys.push([2, 4, , 5]);
|
|
51
|
+
index_1.Helpers.git.checkout(clondeFolderpath, branchName);
|
|
52
|
+
return [4 /*yield*/, index_1.Helpers.git.pullCurrentBranch(clondeFolderpath, {
|
|
53
|
+
askToRetry: true,
|
|
54
|
+
})];
|
|
55
|
+
case 3:
|
|
56
|
+
_a.sent();
|
|
57
|
+
return [3 /*break*/, 5];
|
|
58
|
+
case 4:
|
|
59
|
+
error_1 = _a.sent();
|
|
60
|
+
return [3 /*break*/, 5];
|
|
61
|
+
case 5: return [2 /*return*/, (0, tnp_core_2.crossPlatformPath)([
|
|
62
|
+
clondeFolderpath,
|
|
63
|
+
destinationFolderName || '',
|
|
64
|
+
]).replace(/\/$/g, '')];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region methods & getters / restore last version
|
|
71
|
+
BaseGit.prototype.restoreLastVersion = function (relativeFilePath) {
|
|
72
|
+
//#region @backendFunc
|
|
73
|
+
index_1.Helpers.git.restoreLastVersion(this.project.location, relativeFilePath);
|
|
74
|
+
//#endregion
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region methods & getters / stage all files
|
|
78
|
+
BaseGit.prototype.stageAllFiles = function () {
|
|
79
|
+
//#region @backendFunc
|
|
80
|
+
index_1.Helpers.git.stageAllFiles(this.project.location);
|
|
81
|
+
//#endregion
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region methods & getters / stash
|
|
85
|
+
BaseGit.prototype.stash = function (options) {
|
|
86
|
+
//#region @backendFunc
|
|
87
|
+
index_1.Helpers.git.stash(this.project.location, options);
|
|
88
|
+
//#endregion
|
|
89
|
+
};
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region methods & getters / stash apply
|
|
92
|
+
BaseGit.prototype.stashApply = function () {
|
|
93
|
+
//#region @backendFunc
|
|
94
|
+
index_1.Helpers.git.stashApply(this.project.location);
|
|
95
|
+
//#endregion
|
|
96
|
+
};
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region methods & getters / fetch
|
|
99
|
+
BaseGit.prototype.fetch = function (all) {
|
|
100
|
+
if (all === void 0) { all = false; }
|
|
101
|
+
//#region @backendFunc
|
|
102
|
+
index_1.Helpers.git.fetch(this.project.location, all);
|
|
103
|
+
//#endregion
|
|
104
|
+
};
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region methods & getters / reset files
|
|
107
|
+
BaseGit.prototype.resetFiles = function () {
|
|
108
|
+
var _a;
|
|
109
|
+
var relativePathes = [];
|
|
110
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
111
|
+
relativePathes[_i] = arguments[_i];
|
|
112
|
+
}
|
|
113
|
+
//#region @backendFunc
|
|
114
|
+
return (_a = index_1.Helpers.git).resetFiles.apply(_a, tslib_1.__spreadArray([this.project.location], tslib_1.__read(relativePathes), false));
|
|
115
|
+
//#endregion
|
|
116
|
+
};
|
|
117
|
+
Object.defineProperty(BaseGit.prototype, "isInsideGitRepo", {
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region methods & getters / is inside git repo
|
|
120
|
+
get: function () {
|
|
121
|
+
//#region @backendFunc
|
|
122
|
+
return index_1.Helpers.git.isInsideGitRepo(this.project.location);
|
|
123
|
+
//#endregion
|
|
124
|
+
},
|
|
125
|
+
enumerable: false,
|
|
126
|
+
configurable: true
|
|
127
|
+
});
|
|
128
|
+
Object.defineProperty(BaseGit.prototype, "isWithoutGitRepository", {
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region methods & getters / is without git repository
|
|
131
|
+
get: function () {
|
|
132
|
+
//#region @backendFunc
|
|
133
|
+
return !tnp_core_1.fse.existsSync(tnp_core_2.path.join(this.project.location, '.git'));
|
|
134
|
+
//#endregion
|
|
135
|
+
},
|
|
136
|
+
enumerable: false,
|
|
137
|
+
configurable: true
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(BaseGit.prototype, "isGitRoot", {
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region methods & getters / is git root
|
|
142
|
+
get: function () {
|
|
143
|
+
//#region @backendFunc
|
|
144
|
+
return index_1.Helpers.git.isGitRoot(this.project.location);
|
|
145
|
+
//#endregion
|
|
146
|
+
},
|
|
147
|
+
enumerable: false,
|
|
148
|
+
configurable: true
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(BaseGit.prototype, "originURL", {
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region methods & getters / origin url
|
|
153
|
+
get: function () {
|
|
154
|
+
//#region @backendFunc
|
|
155
|
+
return index_1.Helpers.git.getOriginURL(this.project.location);
|
|
156
|
+
//#endregion
|
|
157
|
+
},
|
|
158
|
+
enumerable: false,
|
|
159
|
+
configurable: true
|
|
160
|
+
});
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region methods & getters / commit
|
|
163
|
+
BaseGit.prototype.commit = function (commitMessage) {
|
|
164
|
+
//#region @backendFunc
|
|
165
|
+
return index_1.Helpers.git.commit(this.project.location, commitMessage);
|
|
166
|
+
//#endregion
|
|
167
|
+
};
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region methods & getters / add and commit
|
|
170
|
+
/**
|
|
171
|
+
* alias to stage all and commit
|
|
172
|
+
*/
|
|
173
|
+
BaseGit.prototype.addAndCommit = function (commitMessage) {
|
|
174
|
+
//#region @backendFunc
|
|
175
|
+
return index_1.Helpers.git.stageAllAndCommit(this.project.location, commitMessage);
|
|
176
|
+
//#endregion
|
|
177
|
+
};
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region methods & getters / stage all and commit
|
|
180
|
+
BaseGit.prototype.stageAllAndCommit = function (commitMessage) {
|
|
181
|
+
//#region @backendFunc
|
|
182
|
+
return index_1.Helpers.git.stageAllAndCommit(this.project.location, commitMessage);
|
|
183
|
+
//#endregion
|
|
184
|
+
};
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region methods & getters / push current branch
|
|
187
|
+
BaseGit.prototype.pushCurrentBranch = function (options) {
|
|
188
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
189
|
+
return tslib_1.__generator(this, function (_a) {
|
|
190
|
+
switch (_a.label) {
|
|
191
|
+
case 0: return [4 /*yield*/, index_1.Helpers.git.pushCurrentBranch(this.project.location, options)];
|
|
192
|
+
case 1:
|
|
193
|
+
//#region @backendFunc
|
|
194
|
+
return [2 /*return*/, _a.sent()];
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
Object.defineProperty(BaseGit.prototype, "allOrigins", {
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region methods & getters / all origins
|
|
202
|
+
get: function () {
|
|
203
|
+
//#region @backendFunc
|
|
204
|
+
return index_1.Helpers.git.allOrigins(this.project.location);
|
|
205
|
+
//#endregion
|
|
206
|
+
},
|
|
207
|
+
enumerable: false,
|
|
208
|
+
configurable: true
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(BaseGit.prototype, "uncommitedFiles", {
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region methods & getters / uncommited files
|
|
213
|
+
get: function () {
|
|
214
|
+
//#region @backendFunc
|
|
215
|
+
return index_1.Helpers.git.uncommitedFiles(this.project.location);
|
|
216
|
+
//#endregion
|
|
217
|
+
},
|
|
218
|
+
enumerable: false,
|
|
219
|
+
configurable: true
|
|
220
|
+
});
|
|
221
|
+
Object.defineProperty(BaseGit.prototype, "thereAreSomeUncommitedChange", {
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region methods & getters / there are some uncommited change
|
|
224
|
+
get: function () {
|
|
225
|
+
//#region @backendFunc
|
|
226
|
+
return index_1.Helpers.git.checkIfthereAreSomeUncommitedChange(this.project.location);
|
|
227
|
+
//#endregion
|
|
228
|
+
},
|
|
229
|
+
enumerable: false,
|
|
230
|
+
configurable: true
|
|
231
|
+
});
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region methods & getters / there are some uncommited change except
|
|
234
|
+
BaseGit.prototype.thereAreSomeUncommitedChangeExcept = function (filesList) {
|
|
235
|
+
if (filesList === void 0) { filesList = []; }
|
|
236
|
+
//#region @backendFunc
|
|
237
|
+
return index_1.Helpers.git.thereAreSomeUncommitedChangeExcept(filesList, this.project.location);
|
|
238
|
+
//#endregion
|
|
239
|
+
};
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region methods & getters / melt action commits
|
|
242
|
+
BaseGit.prototype.meltActionCommits = function () {
|
|
243
|
+
//#region @backend
|
|
244
|
+
return index_1.Helpers.git.meltActionCommits(this.project.location);
|
|
245
|
+
//#endregion
|
|
246
|
+
};
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region methods & getters / pull current branch
|
|
249
|
+
BaseGit.prototype.pullCurrentBranch = function (options) {
|
|
250
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
251
|
+
return tslib_1.__generator(this, function (_a) {
|
|
252
|
+
switch (_a.label) {
|
|
253
|
+
case 0:
|
|
254
|
+
//#region @backendFunc
|
|
255
|
+
return [4 /*yield*/, index_1.Helpers.git.pullCurrentBranch(this.project.location, tslib_1.__assign({}, options))];
|
|
256
|
+
case 1:
|
|
257
|
+
//#region @backendFunc
|
|
258
|
+
_a.sent();
|
|
259
|
+
return [2 /*return*/];
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
};
|
|
264
|
+
Object.defineProperty(BaseGit.prototype, "currentBranchName", {
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region methods & getters / current branch name
|
|
267
|
+
get: function () {
|
|
268
|
+
//#region @backendFunc
|
|
269
|
+
return index_1.Helpers.git.currentBranchName(this.project.location);
|
|
270
|
+
//#endregion
|
|
271
|
+
},
|
|
272
|
+
enumerable: false,
|
|
273
|
+
configurable: true
|
|
274
|
+
});
|
|
275
|
+
Object.defineProperty(BaseGit.prototype, "listOfCurrentGitChanges", {
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region methods & getters / list of current git changes
|
|
278
|
+
get: function () {
|
|
279
|
+
//#region @backendFunc
|
|
280
|
+
return index_1.Helpers.git.getListOfCurrentGitChanges(this.project.location);
|
|
281
|
+
//#endregion
|
|
282
|
+
},
|
|
283
|
+
enumerable: false,
|
|
284
|
+
configurable: true
|
|
285
|
+
});
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region methods & getters / get branches names by
|
|
288
|
+
BaseGit.prototype.getBranchesNamesBy = function (pattern) {
|
|
289
|
+
//#region @backendFunc
|
|
290
|
+
return index_1.Helpers.git.getBranchesNames(this.project.location, pattern);
|
|
291
|
+
//#endregion
|
|
292
|
+
};
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region methods & getters / reset soft HEAD
|
|
295
|
+
BaseGit.prototype.resetSoftHEAD = function (HEAD) {
|
|
296
|
+
if (HEAD === void 0) { HEAD = 1; }
|
|
297
|
+
//#region @backendFunc
|
|
298
|
+
index_1.Helpers.git.resetSoftHEAD(this.project.location, HEAD);
|
|
299
|
+
//#endregion
|
|
300
|
+
};
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region methods & getters / reset hard
|
|
303
|
+
BaseGit.prototype.resetHard = function (options) {
|
|
304
|
+
//#region @backendFunc
|
|
305
|
+
index_1.Helpers.git.resetHard(this.project.location, options);
|
|
306
|
+
//#endregion
|
|
307
|
+
};
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region methods & getters / count commits
|
|
310
|
+
BaseGit.prototype.countComits = function () {
|
|
311
|
+
//#region @backendFunc
|
|
312
|
+
return index_1.Helpers.git.countCommits(this.project.location);
|
|
313
|
+
//#endregion
|
|
314
|
+
};
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region methods & getters / has any commits
|
|
317
|
+
BaseGit.prototype.hasAnyCommits = function () {
|
|
318
|
+
//#region @backendFunc
|
|
319
|
+
return index_1.Helpers.git.hasAnyCommits(this.project.location);
|
|
320
|
+
//#endregion
|
|
321
|
+
};
|
|
322
|
+
Object.defineProperty(BaseGit.prototype, "isInMergeProcess", {
|
|
323
|
+
//#endregion
|
|
324
|
+
//#region methods & getters / is in merge process
|
|
325
|
+
get: function () {
|
|
326
|
+
//#region @backendFunc
|
|
327
|
+
return index_1.Helpers.git.isInMergeProcess(this.project.location);
|
|
328
|
+
//#endregion
|
|
329
|
+
},
|
|
330
|
+
enumerable: false,
|
|
331
|
+
configurable: true
|
|
332
|
+
});
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region methods & getters / last commit date
|
|
335
|
+
BaseGit.prototype.lastCommitDate = function () {
|
|
336
|
+
//#region @backendFunc
|
|
337
|
+
return index_1.Helpers.git.lastCommitDate(this.project.location);
|
|
338
|
+
//#endregion
|
|
339
|
+
};
|
|
340
|
+
//#endregion
|
|
341
|
+
//#region methods & getters / last commit hash
|
|
342
|
+
BaseGit.prototype.lastCommitHash = function () {
|
|
343
|
+
//#region @backendFunc
|
|
344
|
+
return index_1.Helpers.git.lastCommitHash(this.project.location);
|
|
345
|
+
//#endregion
|
|
346
|
+
};
|
|
347
|
+
//#endregion
|
|
348
|
+
//#region methods & getters / last commit message
|
|
349
|
+
BaseGit.prototype.lastCommitMessage = function () {
|
|
350
|
+
//#region @backendFunc
|
|
351
|
+
return index_1.Helpers.git.lastCommitMessage(this.project.location);
|
|
352
|
+
//#endregion
|
|
353
|
+
};
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region methods & getters / last commit message
|
|
356
|
+
BaseGit.prototype.penultimateCommitMessage = function () {
|
|
357
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
358
|
+
return tslib_1.__generator(this, function (_a) {
|
|
359
|
+
switch (_a.label) {
|
|
360
|
+
case 0: return [4 /*yield*/, index_1.Helpers.git.penultimateCommitMessage(this.project.location)];
|
|
361
|
+
case 1:
|
|
362
|
+
//#region @backendFunc
|
|
363
|
+
return [2 /*return*/, _a.sent()];
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
};
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region methods & getters / get commit message by index
|
|
370
|
+
BaseGit.prototype.getCommitMessageByIndex = function (index) {
|
|
371
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
372
|
+
return tslib_1.__generator(this, function (_a) {
|
|
373
|
+
switch (_a.label) {
|
|
374
|
+
case 0: return [4 /*yield*/, index_1.Helpers.git.getCommitMessageByIndex(this.project.location, index)];
|
|
375
|
+
case 1:
|
|
376
|
+
//#region @backendFunc
|
|
377
|
+
return [2 /*return*/, _a.sent()];
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
});
|
|
381
|
+
};
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region methods & getters / get commit message by hash
|
|
384
|
+
BaseGit.prototype.getCommitMessageByHash = function (hash) {
|
|
385
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
386
|
+
return tslib_1.__generator(this, function (_a) {
|
|
387
|
+
switch (_a.label) {
|
|
388
|
+
case 0: return [4 /*yield*/, index_1.Helpers.git.getCommitMessageByHash(this.project.location, hash)];
|
|
389
|
+
case 1:
|
|
390
|
+
//#region @backendFunc
|
|
391
|
+
return [2 /*return*/, _a.sent()];
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
});
|
|
395
|
+
};
|
|
396
|
+
//#endregion
|
|
397
|
+
//#region methods & getters / get commit hash by index
|
|
398
|
+
BaseGit.prototype.getCommitHashByIndex = function (index) {
|
|
399
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
400
|
+
return tslib_1.__generator(this, function (_a) {
|
|
401
|
+
switch (_a.label) {
|
|
402
|
+
case 0: return [4 /*yield*/, index_1.Helpers.git.getCommitHashByIndex(this.project.location, index)];
|
|
403
|
+
case 1:
|
|
404
|
+
//#region @backendFunc
|
|
405
|
+
return [2 /*return*/, _a.sent()];
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
};
|
|
410
|
+
//#endregion
|
|
411
|
+
//#region methods & getters / penultimate commit hash
|
|
412
|
+
BaseGit.prototype.penultimateCommitHash = function () {
|
|
413
|
+
//#region @backendFunc
|
|
414
|
+
return index_1.Helpers.git.penultimateCommitHash(this.project.location);
|
|
415
|
+
//#endregion
|
|
416
|
+
};
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region methods & getters / check tag exists
|
|
419
|
+
BaseGit.prototype.checkTagExists = function (tag) {
|
|
420
|
+
//#region @backendFunc
|
|
421
|
+
return index_1.Helpers.git.checkTagExists(tag, this.project.location);
|
|
422
|
+
//#endregion
|
|
423
|
+
};
|
|
424
|
+
//#endregion
|
|
425
|
+
//#region methods & getters / checkout
|
|
426
|
+
BaseGit.prototype.checkout = function (branchName, options) {
|
|
427
|
+
//#region @backendFunc
|
|
428
|
+
return index_1.Helpers.git.checkout(this.project.location, branchName, options);
|
|
429
|
+
//#endregion
|
|
430
|
+
};
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region methods & getters / checkout from to
|
|
433
|
+
BaseGit.prototype.checkoutFromTo = function (checkoutFromBranch, branch, origin) {
|
|
434
|
+
if (origin === void 0) { origin = 'origin'; }
|
|
435
|
+
//#region @backendFunc
|
|
436
|
+
return index_1.Helpers.git.checkoutFromTo(checkoutFromBranch, branch, origin, this.project.location);
|
|
437
|
+
//#endregion
|
|
438
|
+
};
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region methods & getters / last tag name for major version
|
|
441
|
+
/**
|
|
442
|
+
*
|
|
443
|
+
* @param majorVersion example: v1, v2 etc.
|
|
444
|
+
* @returns tag name
|
|
445
|
+
*/
|
|
446
|
+
BaseGit.prototype.lastTagNameForMajorVersion = function (majorVersion) {
|
|
447
|
+
//#region @backendFunc
|
|
448
|
+
return index_1.Helpers.git.lastTagNameForMajorVersion(this.project.location, majorVersion);
|
|
449
|
+
//#endregion
|
|
450
|
+
};
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region methods & getters / last tag hash
|
|
453
|
+
BaseGit.prototype.lastTagHash = function () {
|
|
454
|
+
//#region @backendFunc
|
|
455
|
+
return index_1.Helpers.git.lastTagHash(this.project.location);
|
|
456
|
+
//#endregion
|
|
457
|
+
};
|
|
458
|
+
Object.defineProperty(BaseGit.prototype, "remoteOriginUrl", {
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region methods & getters / remote origin url
|
|
461
|
+
get: function () {
|
|
462
|
+
//#region @backendFunc
|
|
463
|
+
return index_1.Helpers.git.getOriginURL(this.project.location);
|
|
464
|
+
//#endregion
|
|
465
|
+
},
|
|
466
|
+
enumerable: false,
|
|
467
|
+
configurable: true
|
|
468
|
+
});
|
|
469
|
+
Object.defineProperty(BaseGit.prototype, "lastTagVersionName", {
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region methods & getters / last tag version name
|
|
472
|
+
get: function () {
|
|
473
|
+
//#region @backendFunc
|
|
474
|
+
return index_1.Helpers.git.lastTagVersionName(this.project.location) || '';
|
|
475
|
+
//#endregion
|
|
476
|
+
},
|
|
477
|
+
enumerable: false,
|
|
478
|
+
configurable: true
|
|
479
|
+
});
|
|
480
|
+
Object.defineProperty(BaseGit.prototype, "stagedFiles", {
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region methods & getters / staged files
|
|
483
|
+
get: function () {
|
|
484
|
+
//#region @backendFunc
|
|
485
|
+
return index_1.Helpers.git.stagedFiles(this.project.location);
|
|
486
|
+
//#endregion
|
|
487
|
+
},
|
|
488
|
+
enumerable: false,
|
|
489
|
+
configurable: true
|
|
490
|
+
});
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region methods & getters / rename origin
|
|
493
|
+
/**
|
|
494
|
+
* TODO does this make any sense
|
|
495
|
+
*/
|
|
496
|
+
BaseGit.prototype.renameOrigin = function (newNameOrUlr) {
|
|
497
|
+
//#region @backendFunc
|
|
498
|
+
if (!newNameOrUlr.endsWith('.git')) {
|
|
499
|
+
newNameOrUlr = newNameOrUlr + '.git';
|
|
500
|
+
}
|
|
501
|
+
var oldOrigin = this.project.git.originURL;
|
|
502
|
+
if (!newNameOrUlr.startsWith('git@') &&
|
|
503
|
+
!newNameOrUlr.startsWith('https://')) {
|
|
504
|
+
newNameOrUlr = oldOrigin.replace(tnp_core_2.path.basename(oldOrigin), newNameOrUlr);
|
|
505
|
+
}
|
|
506
|
+
try {
|
|
507
|
+
this.project.run("git remote rm origin").sync();
|
|
508
|
+
}
|
|
509
|
+
catch (error) { }
|
|
510
|
+
try {
|
|
511
|
+
this.project.run("git remote add origin ".concat(newNameOrUlr)).sync();
|
|
512
|
+
index_1.Helpers.info("Origin changed:\n from: ".concat(oldOrigin, "\n to: ").concat(newNameOrUlr, "\n"));
|
|
513
|
+
}
|
|
514
|
+
catch (e) {
|
|
515
|
+
index_1.Helpers.error("Not able to change origin.. reverting to old", true, true);
|
|
516
|
+
this.project.run("git remote add origin ".concat(oldOrigin)).sync();
|
|
517
|
+
}
|
|
518
|
+
//#endregion
|
|
519
|
+
};
|
|
520
|
+
//#endregion
|
|
521
|
+
//#region getters & methods / translate git commit from args
|
|
522
|
+
/**
|
|
523
|
+
* By default no translation of commit
|
|
524
|
+
*/
|
|
525
|
+
BaseGit.prototype.transalteGitCommitFromArgs = function () {
|
|
526
|
+
return { from: void 0, to: void 0 };
|
|
527
|
+
};
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region getters & methods / us git branches when commiting and pushing
|
|
530
|
+
/**
|
|
531
|
+
* By defult true.. when commit branches will not function.
|
|
532
|
+
* (false is better for simple projects)
|
|
533
|
+
*/
|
|
534
|
+
BaseGit.prototype.useGitBranchesWhenCommitingAndPushing = function () {
|
|
535
|
+
return true;
|
|
536
|
+
};
|
|
537
|
+
//#endregion
|
|
538
|
+
//#region getters & methods / automatically add all changes when pushing to git
|
|
539
|
+
/**
|
|
540
|
+
* usefull when pushing in project with childrens as git repos
|
|
541
|
+
*/
|
|
542
|
+
BaseGit.prototype.automaticallyAddAllChangesWhenPushingToGit = function () {
|
|
543
|
+
return false;
|
|
544
|
+
};
|
|
545
|
+
//#endregion
|
|
546
|
+
//#region getters & methods / use git branches as metadata for commits
|
|
547
|
+
/**
|
|
548
|
+
* usefull when pushing in project with childrens as git repos
|
|
549
|
+
*/
|
|
550
|
+
BaseGit.prototype.useGitBranchesAsMetadataForCommits = function () {
|
|
551
|
+
return true;
|
|
552
|
+
};
|
|
553
|
+
//#endregion
|
|
554
|
+
//#region getters & methods / clone to
|
|
555
|
+
BaseGit.prototype.cloneTo = function (cwd, newProjectName) {
|
|
556
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
557
|
+
var dest, res;
|
|
558
|
+
return tslib_1.__generator(this, function (_a) {
|
|
559
|
+
switch (_a.label) {
|
|
560
|
+
case 0:
|
|
561
|
+
//#region @backendFunc
|
|
562
|
+
if (!newProjectName) {
|
|
563
|
+
newProjectName = tnp_core_2.path.basename(this.project.location);
|
|
564
|
+
}
|
|
565
|
+
dest = (0, tnp_core_2.crossPlatformPath)([newProjectName, newProjectName]);
|
|
566
|
+
if (!tnp_core_1.fse.existsSync(dest)) return [3 /*break*/, 2];
|
|
567
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo("Folder ".concat(newProjectName, " alredy exist, delete it ?"))];
|
|
568
|
+
case 1:
|
|
569
|
+
res = _a.sent();
|
|
570
|
+
if (res) {
|
|
571
|
+
index_1.Helpers.tryRemoveDir(dest);
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
index_1.Helpers.pressKeyAndContinue('Operation not completed... press any key');
|
|
575
|
+
return [2 /*return*/, false];
|
|
576
|
+
}
|
|
577
|
+
_a.label = 2;
|
|
578
|
+
case 2:
|
|
579
|
+
index_1.Helpers.info("Cloning ".concat(this.project.name, "..."));
|
|
580
|
+
// copy instead cloning
|
|
581
|
+
return [4 /*yield*/, index_1.Helpers.git.clone({
|
|
582
|
+
cwd: cwd,
|
|
583
|
+
url: this.project.git.remoteOriginUrl,
|
|
584
|
+
destinationFolderName: newProjectName,
|
|
585
|
+
})];
|
|
586
|
+
case 3:
|
|
587
|
+
// copy instead cloning
|
|
588
|
+
_a.sent();
|
|
589
|
+
index_1.Helpers.info("Clone success");
|
|
590
|
+
return [2 /*return*/, true];
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
});
|
|
594
|
+
};
|
|
595
|
+
Object.defineProperty(BaseGit.prototype, "gitChildren", {
|
|
596
|
+
//#endregion
|
|
597
|
+
//#region getters & methods / get children
|
|
598
|
+
/**
|
|
599
|
+
* This is only for push/pull process
|
|
600
|
+
*
|
|
601
|
+
* There are 2 types of projects:
|
|
602
|
+
* - with linked-projects.json
|
|
603
|
+
* - with children from external folder
|
|
604
|
+
*
|
|
605
|
+
* projects that are children of this project (with its own git repo)
|
|
606
|
+
*/
|
|
607
|
+
get: function () {
|
|
608
|
+
var _this = this;
|
|
609
|
+
var childrenRepos = [];
|
|
610
|
+
if (this.project.linkedProjects.linkedProjects.length > 0) {
|
|
611
|
+
childrenRepos = this.project.linkedProjects.linkedProjects
|
|
612
|
+
.map(function (c) {
|
|
613
|
+
return _this.project.ins.From([
|
|
614
|
+
_this.project.location,
|
|
615
|
+
c.relativeClonePath,
|
|
616
|
+
]);
|
|
617
|
+
})
|
|
618
|
+
.filter(function (f) { return !!f; });
|
|
619
|
+
}
|
|
620
|
+
else {
|
|
621
|
+
childrenRepos = this.project.children;
|
|
622
|
+
}
|
|
623
|
+
childrenRepos = childrenRepos.filter(function (f) { return f.git.isInsideGitRepo && f.git.isGitRoot; });
|
|
624
|
+
return childrenRepos;
|
|
625
|
+
},
|
|
626
|
+
enumerable: false,
|
|
627
|
+
configurable: true
|
|
628
|
+
});
|
|
629
|
+
//#endregion
|
|
630
|
+
//#region getters & methods / set remote origin type
|
|
631
|
+
BaseGit.prototype.setRemoteOriginType = function (setOrigin) {
|
|
632
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
633
|
+
return tslib_1.__generator(this, function (_a) {
|
|
634
|
+
switch (_a.label) {
|
|
635
|
+
case 0:
|
|
636
|
+
//#region @backendFunc
|
|
637
|
+
if (setOrigin === 'https') {
|
|
638
|
+
setOrigin = 'http';
|
|
639
|
+
}
|
|
640
|
+
if (!(setOrigin === 'ssh')) return [3 /*break*/, 2];
|
|
641
|
+
return [4 /*yield*/, index_1.Helpers.git.changeRemoteFromHttpsToSSh(this.project.location)];
|
|
642
|
+
case 1:
|
|
643
|
+
_a.sent();
|
|
644
|
+
return [3 /*break*/, 4];
|
|
645
|
+
case 2:
|
|
646
|
+
if (!(setOrigin === 'http')) return [3 /*break*/, 4];
|
|
647
|
+
return [4 /*yield*/, index_1.Helpers.git.changeRemoveFromSshToHttps(this.project.location)];
|
|
648
|
+
case 3:
|
|
649
|
+
_a.sent();
|
|
650
|
+
_a.label = 4;
|
|
651
|
+
case 4: return [2 /*return*/];
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
});
|
|
655
|
+
};
|
|
656
|
+
//#endregion
|
|
657
|
+
//#region methods & getters / push process
|
|
658
|
+
BaseGit.prototype.pullProcess = function () {
|
|
659
|
+
return tslib_1.__awaiter(this, arguments, void 0, function (options) {
|
|
660
|
+
var cloneChildren, setOrigin, uncommitedChanges, location, _a, _b, child, e_1_1;
|
|
661
|
+
var e_1, _c;
|
|
662
|
+
if (options === void 0) { options = {}; }
|
|
663
|
+
return tslib_1.__generator(this, function (_d) {
|
|
664
|
+
switch (_d.label) {
|
|
665
|
+
case 0:
|
|
666
|
+
//#region @backendFunc
|
|
667
|
+
options = options || {};
|
|
668
|
+
options.cloneChildren = !!options.cloneChildren;
|
|
669
|
+
cloneChildren = options.cloneChildren, setOrigin = options.setOrigin;
|
|
670
|
+
return [4 /*yield*/, this._beforePullProcessAction(setOrigin, cloneChildren)];
|
|
671
|
+
case 1:
|
|
672
|
+
_d.sent();
|
|
673
|
+
return [4 /*yield*/, this.setRemoteOriginType(setOrigin)];
|
|
674
|
+
case 2:
|
|
675
|
+
_d.sent();
|
|
676
|
+
uncommitedChanges = this.project.git.thereAreSomeUncommitedChange;
|
|
677
|
+
if (uncommitedChanges) {
|
|
678
|
+
index_1.Helpers.warn("Stashing uncommit changes... in ".concat(this.project.genericName));
|
|
679
|
+
try {
|
|
680
|
+
this.project.git.stageAllFiles();
|
|
681
|
+
}
|
|
682
|
+
catch (error) { }
|
|
683
|
+
try {
|
|
684
|
+
this.project.git.stash();
|
|
685
|
+
}
|
|
686
|
+
catch (error) { }
|
|
687
|
+
}
|
|
688
|
+
return [4 /*yield*/, this.project.git.pullCurrentBranch({ askToRetry: true })];
|
|
689
|
+
case 3:
|
|
690
|
+
_d.sent();
|
|
691
|
+
location = this.project.location;
|
|
692
|
+
this.project.ins.unload(this);
|
|
693
|
+
this.project.ins.add(this.project.ins.From(location));
|
|
694
|
+
return [4 /*yield*/, this.project.linkedProjects.saveLocationToDB()];
|
|
695
|
+
case 4:
|
|
696
|
+
_d.sent();
|
|
697
|
+
if (!(this.automaticallyAddAllChangesWhenPushingToGit() || cloneChildren)) return [3 /*break*/, 12];
|
|
698
|
+
_d.label = 5;
|
|
699
|
+
case 5:
|
|
700
|
+
_d.trys.push([5, 10, 11, 12]);
|
|
701
|
+
_a = tslib_1.__values(this.gitChildren), _b = _a.next();
|
|
702
|
+
_d.label = 6;
|
|
703
|
+
case 6:
|
|
704
|
+
if (!!_b.done) return [3 /*break*/, 9];
|
|
705
|
+
child = _b.value;
|
|
706
|
+
return [4 /*yield*/, child.git.pullProcess(options)];
|
|
707
|
+
case 7:
|
|
708
|
+
_d.sent();
|
|
709
|
+
_d.label = 8;
|
|
710
|
+
case 8:
|
|
711
|
+
_b = _a.next();
|
|
712
|
+
return [3 /*break*/, 6];
|
|
713
|
+
case 9: return [3 /*break*/, 12];
|
|
714
|
+
case 10:
|
|
715
|
+
e_1_1 = _d.sent();
|
|
716
|
+
e_1 = { error: e_1_1 };
|
|
717
|
+
return [3 /*break*/, 12];
|
|
718
|
+
case 11:
|
|
719
|
+
try {
|
|
720
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
721
|
+
}
|
|
722
|
+
finally { if (e_1) throw e_1.error; }
|
|
723
|
+
return [7 /*endfinally*/];
|
|
724
|
+
case 12: return [4 /*yield*/, this.project.linkedProjects.saveAllLinkedProjectsToDB()];
|
|
725
|
+
case 13:
|
|
726
|
+
_d.sent();
|
|
727
|
+
return [2 /*return*/];
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
});
|
|
731
|
+
};
|
|
732
|
+
//#endregion
|
|
733
|
+
//#region methods & getters / push process
|
|
734
|
+
BaseGit.prototype.pushProcess = function () {
|
|
735
|
+
return tslib_1.__awaiter(this, arguments, void 0, function (options) {
|
|
736
|
+
var _a, force, typeofCommit, skipLint, forcePushNoQuestion, _b, origin, exitCallBack, askToConfirmPush, askToConfirmCommit, askToConfirmBranchChange, _c, args, commitMessageRequired, overrideCommitMessage, skipChildren, setOrigin, currentOrigin, mergeUpdateCommits, commitData, mergeAction, action, _d, error_2, numberOfStagedFiles, error_3, commitMessageFromBranch, lastCommitMessage_1, _e, _f, child, e_2_1;
|
|
737
|
+
var e_2, _g;
|
|
738
|
+
var _this = this;
|
|
739
|
+
var _h, _j, _k, _l;
|
|
740
|
+
if (options === void 0) { options = {}; }
|
|
741
|
+
return tslib_1.__generator(this, function (_m) {
|
|
742
|
+
switch (_m.label) {
|
|
743
|
+
case 0:
|
|
744
|
+
_a = options.force, force = _a === void 0 ? false : _a, typeofCommit = options.typeofCommit, skipLint = options.skipLint, forcePushNoQuestion = options.forcePushNoQuestion, _b = options.origin, origin = _b === void 0 ? 'origin' : _b, exitCallBack = options.exitCallBack, askToConfirmPush = options.askToConfirmPush, askToConfirmCommit = options.askToConfirmCommit, askToConfirmBranchChange = options.askToConfirmBranchChange, _c = options.args, args = _c === void 0 ? [] : _c, commitMessageRequired = options.commitMessageRequired, overrideCommitMessage = options.overrideCommitMessage, skipChildren = options.skipChildren, setOrigin = options.setOrigin, currentOrigin = options.currentOrigin, mergeUpdateCommits = options.mergeUpdateCommits;
|
|
745
|
+
return [4 /*yield*/, this._beforePushProcessAction(setOrigin)];
|
|
746
|
+
case 1:
|
|
747
|
+
_m.sent();
|
|
748
|
+
return [4 /*yield*/, this.setRemoteOriginType(setOrigin)];
|
|
749
|
+
case 2:
|
|
750
|
+
_m.sent();
|
|
751
|
+
return [4 /*yield*/, this.project.linkedProjects.saveLocationToDB()];
|
|
752
|
+
case 3:
|
|
753
|
+
_m.sent();
|
|
754
|
+
return [4 /*yield*/, this._getCommitMessage(typeofCommit, args, commitMessageRequired, currentOrigin)];
|
|
755
|
+
case 4:
|
|
756
|
+
commitData = _m.sent();
|
|
757
|
+
if (!(mergeUpdateCommits && this.project.git.stagedFiles.length > 0)) return [3 /*break*/, 13];
|
|
758
|
+
//#region merge update commits
|
|
759
|
+
index_1.Helpers.logInfo("Pushing detailed changes to project: ".concat(this.project.genericName));
|
|
760
|
+
index_1.Helpers.logInfo("Modified files... ");
|
|
761
|
+
index_1.Helpers.logInfo(tslib_1.__spreadArray([], tslib_1.__read(this.project.git.stagedFiles), false).map(function (f) { return " - ".concat(tnp_core_1.chalk.underline(f)); })
|
|
762
|
+
.join('\n'));
|
|
763
|
+
_m.label = 5;
|
|
764
|
+
case 5:
|
|
765
|
+
if (!true) return [3 /*break*/, 13];
|
|
766
|
+
mergeAction = {
|
|
767
|
+
useUpdateCommit: {
|
|
768
|
+
name: "Use temporary update commit " +
|
|
769
|
+
"\"".concat(index_1.Helpers.git.ACTION_MSG_RESET_GIT_HARD_COMMIT, "\" and force push"),
|
|
770
|
+
},
|
|
771
|
+
provideCommitMessage: {
|
|
772
|
+
name: 'Provide commit message and force push',
|
|
773
|
+
},
|
|
774
|
+
resetRemoveChanges: {
|
|
775
|
+
name: 'Reset/remove changes and force push',
|
|
776
|
+
},
|
|
777
|
+
openInVscode: {
|
|
778
|
+
name: 'Open project in vscode',
|
|
779
|
+
},
|
|
780
|
+
};
|
|
781
|
+
if (!force) return [3 /*break*/, 6];
|
|
782
|
+
_d = 'useUpdateCommit';
|
|
783
|
+
return [3 /*break*/, 8];
|
|
784
|
+
case 6: return [4 /*yield*/, index_1.UtilsTerminal.select({
|
|
785
|
+
choices: mergeAction,
|
|
786
|
+
question: 'What to do ?',
|
|
787
|
+
})];
|
|
788
|
+
case 7:
|
|
789
|
+
_d = _m.sent();
|
|
790
|
+
_m.label = 8;
|
|
791
|
+
case 8:
|
|
792
|
+
action = _d;
|
|
793
|
+
if (action === 'openInVscode') {
|
|
794
|
+
index_1.Helpers.run("code .", { cwd: this.project.location }).sync();
|
|
795
|
+
return [3 /*break*/, 5];
|
|
796
|
+
}
|
|
797
|
+
if (action === 'resetRemoveChanges') {
|
|
798
|
+
force = true;
|
|
799
|
+
forcePushNoQuestion = true;
|
|
800
|
+
this.project.git.resetHard();
|
|
801
|
+
return [3 /*break*/, 13];
|
|
802
|
+
}
|
|
803
|
+
if (action === 'useUpdateCommit') {
|
|
804
|
+
force = true;
|
|
805
|
+
forcePushNoQuestion = true;
|
|
806
|
+
overrideCommitMessage = index_1.Helpers.git.ACTION_MSG_RESET_GIT_HARD_COMMIT;
|
|
807
|
+
}
|
|
808
|
+
if (!(action === 'provideCommitMessage')) return [3 /*break*/, 12];
|
|
809
|
+
force = true;
|
|
810
|
+
forcePushNoQuestion = true;
|
|
811
|
+
_m.label = 9;
|
|
812
|
+
case 9:
|
|
813
|
+
_m.trys.push([9, 11, , 12]);
|
|
814
|
+
return [4 /*yield*/, index_1.Helpers.input({
|
|
815
|
+
question: "Please provide commit message for current changes:",
|
|
816
|
+
defaultValue: 'update',
|
|
817
|
+
})];
|
|
818
|
+
case 10:
|
|
819
|
+
overrideCommitMessage = _m.sent();
|
|
820
|
+
return [3 /*break*/, 12];
|
|
821
|
+
case 11:
|
|
822
|
+
error_2 = _m.sent();
|
|
823
|
+
return [3 /*break*/, 12];
|
|
824
|
+
case 12:
|
|
825
|
+
if (overrideCommitMessage) {
|
|
826
|
+
return [3 /*break*/, 13];
|
|
827
|
+
}
|
|
828
|
+
return [3 /*break*/, 5];
|
|
829
|
+
case 13:
|
|
830
|
+
if (!(commitData.typeOfCommit === 'feature' &&
|
|
831
|
+
((_h = commitData.jiraNumbers) === null || _h === void 0 ? void 0 : _h.length) === 1 &&
|
|
832
|
+
((_j = commitData.issuesFromOtherProjects) === null || _j === void 0 ? void 0 : _j.length) === 0)) return [3 /*break*/, 15];
|
|
833
|
+
index_1.Helpers.info("\n\n You current feature branch \"".concat(this.project.git.currentBranchName, "\"\n doesn't have ").concat(tnp_core_1.chalk.bold('main-issue'), " and ").concat(tnp_core_1.chalk.bold('sub-issue'), " inlcueded.\n\n Proper example: feature/JIRANUM-<number-of-sub-issue>-JIRANUM-<number-of-main-issue>-commit-name\n\n "));
|
|
834
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo('Continue without sub-issue?')];
|
|
835
|
+
case 14:
|
|
836
|
+
if (!(_m.sent())) {
|
|
837
|
+
process.exit(0);
|
|
838
|
+
}
|
|
839
|
+
_m.label = 15;
|
|
840
|
+
case 15:
|
|
841
|
+
//#endregion
|
|
842
|
+
//#region automatic push to git
|
|
843
|
+
if (!this.automaticallyAddAllChangesWhenPushingToGit()) {
|
|
844
|
+
if ((_k = commitData.commitMessage) === null || _k === void 0 ? void 0 : _k.split(':').map(function (p) { return p.trim(); }).every(function (p) { return p === _this.project.git.currentBranchName; })) {
|
|
845
|
+
// QUICK_FIX
|
|
846
|
+
index_1.Helpers.error("\n\n Please provide more specific commit message than branch name\n or maybe you forgot ?\n TEAM ID? (example TEAM2# <= hash at the end)\n\n ", false, true);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
//#endregion
|
|
850
|
+
//#region lint
|
|
851
|
+
if (commitData.typeOfCommit === 'release') {
|
|
852
|
+
skipLint = true;
|
|
853
|
+
}
|
|
854
|
+
numberOfStagedFiles = this.project.git.stagedFiles.length;
|
|
855
|
+
if (numberOfStagedFiles === 0) {
|
|
856
|
+
index_1.Helpers.warn("No staged files...");
|
|
857
|
+
skipLint = true;
|
|
858
|
+
}
|
|
859
|
+
if (!!skipLint) return [3 /*break*/, 22];
|
|
860
|
+
_m.label = 16;
|
|
861
|
+
case 16:
|
|
862
|
+
if (!true) return [3 /*break*/, 22];
|
|
863
|
+
_m.label = 17;
|
|
864
|
+
case 17:
|
|
865
|
+
_m.trys.push([17, 19, , 21]);
|
|
866
|
+
return [4 /*yield*/, this.project.lint()];
|
|
867
|
+
case 18:
|
|
868
|
+
_m.sent();
|
|
869
|
+
return [3 /*break*/, 22];
|
|
870
|
+
case 19:
|
|
871
|
+
error_3 = _m.sent();
|
|
872
|
+
index_1.Helpers.warn('Fix your code...');
|
|
873
|
+
return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo('Try again lint before commit ?')];
|
|
874
|
+
case 20:
|
|
875
|
+
if (!(_m.sent())) {
|
|
876
|
+
return [3 /*break*/, 22];
|
|
877
|
+
}
|
|
878
|
+
return [3 /*break*/, 21];
|
|
879
|
+
case 21: return [3 /*break*/, 16];
|
|
880
|
+
case 22:
|
|
881
|
+
//#endregion
|
|
882
|
+
if (this.project.useFeatureInBranchNameForTests() &&
|
|
883
|
+
commitData.typeOfCommit === 'test') {
|
|
884
|
+
commitData.useFeatureBranchForTestBranch = true;
|
|
885
|
+
}
|
|
886
|
+
if (!!commitData.isActionCommit) return [3 /*break*/, 27];
|
|
887
|
+
return [4 /*yield*/, index_1.CommitData.getFromBranch(commitData.branchName, {
|
|
888
|
+
currentOrigin: currentOrigin,
|
|
889
|
+
})];
|
|
890
|
+
case 23:
|
|
891
|
+
commitMessageFromBranch = (_m.sent()).commitMessage;
|
|
892
|
+
index_1.Helpers.info("\n\n PROJECT: ".concat(this.project.genericName, "\n\n Current commit:\n - message to include {").concat(overrideCommitMessage ? overrideCommitMessage : commitData.commitMessage, "}\n ").concat(this.useGitBranchesAsMetadataForCommits() && !overrideCommitMessage
|
|
893
|
+
? "- branch to checkout {".concat(commitData.branchName, "}")
|
|
894
|
+
: "- using ".concat(tnp_core_1.chalk.bold('current'), " branch {").concat(this.project.git.currentBranchName, "} \n\n (generated would be: ").concat(commitData.branchName, ")\n ")));
|
|
895
|
+
if (!overrideCommitMessage &&
|
|
896
|
+
commitMessageFromBranch !== commitData.commitMessage) {
|
|
897
|
+
index_1.Helpers.logWarn("Commit from args and commit from branch are different\n commit message from args: ".concat(commitData.commitMessage, "\n commit message from branch: ").concat(commitMessageFromBranch, "\n\n ADVICE: Is is better to use words instead characters to describe multiple\n commit changes in one commit message\n\n "));
|
|
898
|
+
}
|
|
899
|
+
else {
|
|
900
|
+
index_1.Helpers.logInfo(tnp_core_1.chalk.gray("Commit from args and commit from branch are the same..."));
|
|
901
|
+
}
|
|
902
|
+
lastCommitMessage_1 = this.project.git.lastCommitMessage();
|
|
903
|
+
if (!(lastCommitMessage_1 &&
|
|
904
|
+
[commitData.commitMessage, overrideCommitMessage]
|
|
905
|
+
.filter(function (f) { return !!f; })
|
|
906
|
+
.some(function (m) { return m === lastCommitMessage_1; }))) return [3 /*break*/, 25];
|
|
907
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo('Soft reset last commit with same message ?')];
|
|
908
|
+
case 24:
|
|
909
|
+
if (_m.sent()) {
|
|
910
|
+
this.project.git.resetSoftHEAD(1);
|
|
911
|
+
}
|
|
912
|
+
_m.label = 25;
|
|
913
|
+
case 25: return [4 /*yield*/, index_1.Helpers.questionYesNo('Commit and push this ?')];
|
|
914
|
+
case 26:
|
|
915
|
+
if (!(_m.sent())) {
|
|
916
|
+
exitCallBack();
|
|
917
|
+
}
|
|
918
|
+
_m.label = 27;
|
|
919
|
+
case 27:
|
|
920
|
+
if (this.automaticallyAddAllChangesWhenPushingToGit()) {
|
|
921
|
+
// my project
|
|
922
|
+
this.project.git.stageAllFiles();
|
|
923
|
+
}
|
|
924
|
+
if (!(this.useGitBranchesAsMetadataForCommits() && !overrideCommitMessage)) return [3 /*break*/, 30];
|
|
925
|
+
index_1.Helpers.info('Checkingout branches (if needed)...');
|
|
926
|
+
if (!(((_l = this.project.git.currentBranchName) === null || _l === void 0 ? void 0 : _l.trim()) !== commitData.branchName)) return [3 /*break*/, 30];
|
|
927
|
+
if (!askToConfirmBranchChange) return [3 /*break*/, 29];
|
|
928
|
+
index_1.Helpers.info("Changing branch to: ".concat(commitData.branchName));
|
|
929
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo('Confirm branch change ?')];
|
|
930
|
+
case 28:
|
|
931
|
+
if (!(_m.sent())) {
|
|
932
|
+
exitCallBack();
|
|
933
|
+
}
|
|
934
|
+
_m.label = 29;
|
|
935
|
+
case 29:
|
|
936
|
+
try {
|
|
937
|
+
this.project.git.checkout(commitData.branchName, {
|
|
938
|
+
createBranchIfNotExists: true,
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
catch (error) {
|
|
942
|
+
index_1.Helpers.error('Please modyfiy you commit message or delete branch,');
|
|
943
|
+
}
|
|
944
|
+
_m.label = 30;
|
|
945
|
+
case 30:
|
|
946
|
+
if (!askToConfirmCommit) return [3 /*break*/, 32];
|
|
947
|
+
index_1.Helpers.info("Commit message: ".concat(overrideCommitMessage
|
|
948
|
+
? overrideCommitMessage
|
|
949
|
+
: commitData.commitMessage));
|
|
950
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo('Confirm commit ?')];
|
|
951
|
+
case 31:
|
|
952
|
+
if (!(_m.sent())) {
|
|
953
|
+
exitCallBack();
|
|
954
|
+
}
|
|
955
|
+
_m.label = 32;
|
|
956
|
+
case 32:
|
|
957
|
+
try {
|
|
958
|
+
this.project.git.commit(overrideCommitMessage
|
|
959
|
+
? overrideCommitMessage
|
|
960
|
+
: commitData.commitMessage);
|
|
961
|
+
}
|
|
962
|
+
catch (error) {
|
|
963
|
+
index_1.Helpers.warn("Not commiting anything... ");
|
|
964
|
+
}
|
|
965
|
+
if (!askToConfirmPush) return [3 /*break*/, 34];
|
|
966
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo('Confirm push ?')];
|
|
967
|
+
case 33:
|
|
968
|
+
if (!(_m.sent())) {
|
|
969
|
+
exitCallBack();
|
|
970
|
+
}
|
|
971
|
+
_m.label = 34;
|
|
972
|
+
case 34: return [4 /*yield*/, this.project.git.pushCurrentBranch({
|
|
973
|
+
force: force,
|
|
974
|
+
origin: origin,
|
|
975
|
+
forcePushNoQuestion: forcePushNoQuestion,
|
|
976
|
+
askToRetry: true,
|
|
977
|
+
})];
|
|
978
|
+
case 35:
|
|
979
|
+
_m.sent();
|
|
980
|
+
if (!(this.automaticallyAddAllChangesWhenPushingToGit() && !skipChildren)) return [3 /*break*/, 45];
|
|
981
|
+
if (this.project.linkedProjects.getLinkedProjectsConfig().skipRecrusivePush) {
|
|
982
|
+
index_1.Helpers.warn("Skipping recrusive (children) push for ".concat(this.project.genericName));
|
|
983
|
+
return [2 /*return*/];
|
|
984
|
+
}
|
|
985
|
+
_m.label = 36;
|
|
986
|
+
case 36:
|
|
987
|
+
_m.trys.push([36, 43, 44, 45]);
|
|
988
|
+
_e = tslib_1.__values(this.gitChildren), _f = _e.next();
|
|
989
|
+
_m.label = 37;
|
|
990
|
+
case 37:
|
|
991
|
+
if (!!_f.done) return [3 /*break*/, 42];
|
|
992
|
+
child = _f.value;
|
|
993
|
+
if (!mergeUpdateCommits) return [3 /*break*/, 39];
|
|
994
|
+
return [4 /*yield*/, child.git.meltActionCommits()];
|
|
995
|
+
case 38:
|
|
996
|
+
_m.sent();
|
|
997
|
+
_m.label = 39;
|
|
998
|
+
case 39: return [4 /*yield*/, child.git.pushProcess(options)];
|
|
999
|
+
case 40:
|
|
1000
|
+
_m.sent();
|
|
1001
|
+
_m.label = 41;
|
|
1002
|
+
case 41:
|
|
1003
|
+
_f = _e.next();
|
|
1004
|
+
return [3 /*break*/, 37];
|
|
1005
|
+
case 42: return [3 /*break*/, 45];
|
|
1006
|
+
case 43:
|
|
1007
|
+
e_2_1 = _m.sent();
|
|
1008
|
+
e_2 = { error: e_2_1 };
|
|
1009
|
+
return [3 /*break*/, 45];
|
|
1010
|
+
case 44:
|
|
1011
|
+
try {
|
|
1012
|
+
if (_f && !_f.done && (_g = _e.return)) _g.call(_e);
|
|
1013
|
+
}
|
|
1014
|
+
finally { if (e_2) throw e_2.error; }
|
|
1015
|
+
return [7 /*endfinally*/];
|
|
1016
|
+
case 45: return [4 /*yield*/, this.project.linkedProjects.saveAllLinkedProjectsToDB()];
|
|
1017
|
+
case 46:
|
|
1018
|
+
_m.sent();
|
|
1019
|
+
return [2 /*return*/];
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
});
|
|
1023
|
+
};
|
|
1024
|
+
//#endregion
|
|
1025
|
+
//#region methods & getters / before any action on git root
|
|
1026
|
+
BaseGit.prototype._beforeAnyActionOnGitRoot = function () {
|
|
1027
|
+
//#region @backendFunc
|
|
1028
|
+
if (!this.project.git.isInsideGitRepo) {
|
|
1029
|
+
index_1.Helpers.error("Project ".concat(tnp_core_1.chalk.bold(this.project.name), " is not a git repository\n locaiton: ").concat(this.project.location), false, true);
|
|
1030
|
+
}
|
|
1031
|
+
if (!this.project.git.isGitRoot) {
|
|
1032
|
+
index_1.Helpers.error("Project ".concat(tnp_core_1.chalk.bold(this.project.name), " is not a git root\n locaiton: ").concat(this.project.location), false, true);
|
|
1033
|
+
}
|
|
1034
|
+
//#endregion
|
|
1035
|
+
};
|
|
1036
|
+
//#endregion
|
|
1037
|
+
//#region methods & getters / before push action
|
|
1038
|
+
BaseGit.prototype._beforePushProcessAction = function (setOrigin) {
|
|
1039
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1040
|
+
var _a;
|
|
1041
|
+
return tslib_1.__generator(this, function (_b) {
|
|
1042
|
+
switch (_b.label) {
|
|
1043
|
+
case 0:
|
|
1044
|
+
//#region @backendFunc
|
|
1045
|
+
this._beforeAnyActionOnGitRoot();
|
|
1046
|
+
if (!(this.project.git.isInsideGitRepo &&
|
|
1047
|
+
this.project.git.isGitRoot &&
|
|
1048
|
+
!((_a = this.project.git.currentBranchName) === null || _a === void 0 ? void 0 : _a.trim()))) return [3 /*break*/, 2];
|
|
1049
|
+
return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo('Repository is empty...Commit "master" branch and commit all as "first commit" ?')];
|
|
1050
|
+
case 1:
|
|
1051
|
+
if (_b.sent()) {
|
|
1052
|
+
this.project.git.checkout('master');
|
|
1053
|
+
this.project.git.stageAllFiles();
|
|
1054
|
+
this.project.git.commit('first commit ');
|
|
1055
|
+
}
|
|
1056
|
+
_b.label = 2;
|
|
1057
|
+
case 2: return [4 /*yield*/, this.project.linkedProjects.cloneUnexistedLinkedProjects('push', setOrigin)];
|
|
1058
|
+
case 3:
|
|
1059
|
+
_b.sent();
|
|
1060
|
+
return [2 /*return*/];
|
|
1061
|
+
}
|
|
1062
|
+
});
|
|
1063
|
+
});
|
|
1064
|
+
};
|
|
1065
|
+
//#endregion
|
|
1066
|
+
//#region methods & getters / before push action
|
|
1067
|
+
BaseGit.prototype._beforePullProcessAction = function (setOrigin_1) {
|
|
1068
|
+
return tslib_1.__awaiter(this, arguments, void 0, function (setOrigin, cloneChildren) {
|
|
1069
|
+
if (cloneChildren === void 0) { cloneChildren = false; }
|
|
1070
|
+
return tslib_1.__generator(this, function (_a) {
|
|
1071
|
+
switch (_a.label) {
|
|
1072
|
+
case 0:
|
|
1073
|
+
//#region @backendFunc
|
|
1074
|
+
this._beforeAnyActionOnGitRoot();
|
|
1075
|
+
return [4 /*yield*/, this.project.linkedProjects.cloneUnexistedLinkedProjects('pull', setOrigin, cloneChildren)];
|
|
1076
|
+
case 1:
|
|
1077
|
+
_a.sent();
|
|
1078
|
+
return [2 /*return*/];
|
|
1079
|
+
}
|
|
1080
|
+
});
|
|
1081
|
+
});
|
|
1082
|
+
};
|
|
1083
|
+
//#endregion
|
|
1084
|
+
//#region methods & getters / resovle commit message
|
|
1085
|
+
BaseGit.prototype._getCommitMessage = function (typeOfCommit, args, commitMessageRequired,
|
|
1086
|
+
/**
|
|
1087
|
+
* only needed when push github
|
|
1088
|
+
* and I forgot to add my username before issue
|
|
1089
|
+
* taon pfix proper input my-repo#344
|
|
1090
|
+
* that should be
|
|
1091
|
+
* taon pfix proper input my-username/my-repo#344
|
|
1092
|
+
*/
|
|
1093
|
+
currentOrigin) {
|
|
1094
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1095
|
+
var commitData, argsCommitData, commitDataBranch, argsCommitData, _a, from, to, _b, _c, _d;
|
|
1096
|
+
return tslib_1.__generator(this, function (_e) {
|
|
1097
|
+
switch (_e.label) {
|
|
1098
|
+
case 0:
|
|
1099
|
+
if (!this.useGitBranchesWhenCommitingAndPushing()) return [3 /*break*/, 5];
|
|
1100
|
+
return [4 /*yield*/, index_1.CommitData.getFromArgs(args, {
|
|
1101
|
+
typeOfCommit: typeOfCommit,
|
|
1102
|
+
currentOrigin: currentOrigin,
|
|
1103
|
+
})];
|
|
1104
|
+
case 1:
|
|
1105
|
+
argsCommitData = _e.sent();
|
|
1106
|
+
if (!argsCommitData.message) return [3 /*break*/, 2];
|
|
1107
|
+
commitData = argsCommitData;
|
|
1108
|
+
return [3 /*break*/, 4];
|
|
1109
|
+
case 2: return [4 /*yield*/, index_1.CommitData.getFromBranch(this.project.git.currentBranchName, {
|
|
1110
|
+
releaseWords: this.project.releaseProcess.getReleaseWords(),
|
|
1111
|
+
currentOrigin: currentOrigin,
|
|
1112
|
+
})];
|
|
1113
|
+
case 3:
|
|
1114
|
+
commitDataBranch = _e.sent();
|
|
1115
|
+
commitData = commitDataBranch;
|
|
1116
|
+
_e.label = 4;
|
|
1117
|
+
case 4: return [3 /*break*/, 7];
|
|
1118
|
+
case 5: return [4 /*yield*/, index_1.CommitData.getFromArgs(args, {
|
|
1119
|
+
typeOfCommit: typeOfCommit,
|
|
1120
|
+
currentOrigin: currentOrigin,
|
|
1121
|
+
})];
|
|
1122
|
+
case 6:
|
|
1123
|
+
argsCommitData = _e.sent();
|
|
1124
|
+
// console.log({ argsCommitData })
|
|
1125
|
+
// console.log(argsCommitData)
|
|
1126
|
+
if (!argsCommitData.message && commitMessageRequired) {
|
|
1127
|
+
index_1.Helpers.error('Please provide message in argument', false, true);
|
|
1128
|
+
}
|
|
1129
|
+
if (!argsCommitData.message) {
|
|
1130
|
+
argsCommitData.message = index_1.Helpers.git.ACTION_MSG_RESET_GIT_HARD_COMMIT;
|
|
1131
|
+
}
|
|
1132
|
+
commitData = argsCommitData;
|
|
1133
|
+
_e.label = 7;
|
|
1134
|
+
case 7:
|
|
1135
|
+
if (!(commitData.message !== index_1.Helpers.git.ACTION_MSG_RESET_GIT_HARD_COMMIT)) return [3 /*break*/, 9];
|
|
1136
|
+
_a = this.transalteGitCommitFromArgs(), from = _a.from, to = _a.to;
|
|
1137
|
+
if (!(from && to)) return [3 /*break*/, 9];
|
|
1138
|
+
_b = commitData;
|
|
1139
|
+
_d = (_c = tnp_core_2._).kebabCase;
|
|
1140
|
+
return [4 /*yield*/, (0, translate_1.translate)(commitData.message, { from: from, to: to })];
|
|
1141
|
+
case 8:
|
|
1142
|
+
_b.message = _d.apply(_c, [_e.sent()]);
|
|
1143
|
+
_e.label = 9;
|
|
1144
|
+
case 9: return [2 /*return*/, commitData];
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
});
|
|
1148
|
+
};
|
|
1149
|
+
//#endregion
|
|
1150
|
+
//#region methods & getters / prevent accidental branch change for taon projects
|
|
1151
|
+
/**
|
|
1152
|
+
* This will prevent accidental branch change for taon projects
|
|
1153
|
+
* @returns branch name
|
|
1154
|
+
*/
|
|
1155
|
+
BaseGit.prototype.duringPushWarnIfProjectNotOnSpecyficDevBranch = function () {
|
|
1156
|
+
return void 0;
|
|
1157
|
+
};
|
|
1158
|
+
//#endregion
|
|
1159
|
+
//#region methods & getters / get changed files in commit by hash
|
|
1160
|
+
BaseGit.prototype.getChangedFilesInCommitByHash = function (hash) {
|
|
1161
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1162
|
+
return tslib_1.__generator(this, function (_a) {
|
|
1163
|
+
//#region @backendFunc
|
|
1164
|
+
return [2 /*return*/, index_1.Helpers.git.getChangedFilesInCommitByHash(this.project.location, hash)];
|
|
1165
|
+
});
|
|
1166
|
+
});
|
|
1167
|
+
};
|
|
1168
|
+
//#endregion
|
|
1169
|
+
//#region methods & getters / get changed files in commit
|
|
1170
|
+
/**
|
|
1171
|
+
* @param index 0 - means last commit
|
|
1172
|
+
*/
|
|
1173
|
+
BaseGit.prototype.getChangedFilesInCommitByIndex = function (index) {
|
|
1174
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1175
|
+
return tslib_1.__generator(this, function (_a) {
|
|
1176
|
+
//#region @backendFunc
|
|
1177
|
+
return [2 /*return*/, index_1.Helpers.git.getChangedFilesInCommitByIndex(this.project.location, index)];
|
|
1178
|
+
});
|
|
1179
|
+
});
|
|
1180
|
+
};
|
|
1181
|
+
//#endregion
|
|
1182
|
+
//#region methods & getters / get changes summary
|
|
1183
|
+
BaseGit.prototype.changesSummary = function () {
|
|
1184
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1185
|
+
var fillStringWithSpaceUpTo;
|
|
1186
|
+
return tslib_1.__generator(this, function (_a) {
|
|
1187
|
+
switch (_a.label) {
|
|
1188
|
+
case 0:
|
|
1189
|
+
fillStringWithSpaceUpTo = function (str, length, specialCharacter) {
|
|
1190
|
+
if (specialCharacter === void 0) { specialCharacter = ' '; }
|
|
1191
|
+
return str + specialCharacter.repeat(length - str.length);
|
|
1192
|
+
};
|
|
1193
|
+
return [4 /*yield*/, index_1.Helpers.git.changesSummary(this.project.location, "".concat(fillStringWithSpaceUpTo("[".concat(this.project.name, "]"), 40, '.'), " "))];
|
|
1194
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
});
|
|
1198
|
+
};
|
|
1199
|
+
return BaseGit;
|
|
1200
|
+
}(base_feature_for_project_1.BaseFeatureForProject));
|
|
1201
|
+
exports.BaseGit = BaseGit;
|
|
1202
|
+
//# sourceMappingURL=base-git.js.map
|