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