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