tnp-helpers 18.0.20 → 18.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
- package/browser/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
- package/browser/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
- package/browser/esm2022/lib/base/classes/base-cli-worker.mjs +10 -2
- package/browser/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
- package/browser/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
- package/browser/esm2022/lib/base/classes/base-git.mjs +229 -4
- package/browser/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
- package/browser/esm2022/lib/base/classes/base-library-build.mjs +11 -7
- package/browser/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
- package/browser/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
- package/browser/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -429
- package/browser/esm2022/lib/base/classes/base-package-json.mjs +340 -0
- package/browser/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
- package/browser/esm2022/lib/base/classes/base-project-resolver.mjs +2 -11
- package/browser/esm2022/lib/base/classes/base-project.mjs +76 -61
- package/browser/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
- package/browser/esm2022/lib/base/classes/base-release-process.mjs +44 -11
- package/browser/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
- package/browser/esm2022/lib/base/classes/base-vscode.mjs +29 -1
- package/browser/esm2022/lib/base/classes/index.mjs +5 -1
- package/browser/esm2022/lib/base/commit-data.mjs +19 -1
- package/browser/esm2022/lib/base/core-project.mjs +3 -3
- package/browser/esm2022/lib/base/linked-project.mjs +4 -4
- package/browser/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
- package/browser/esm2022/lib/base/translate.mjs +566 -0
- package/browser/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
- package/browser/esm2022/lib/helpers/helpers.mjs +12 -6
- package/browser/esm2022/lib/index.mjs +2 -1
- package/browser/esm2022/lib/models.mjs +173 -3
- package/browser/esm2022/lib/utils.mjs +402 -41
- package/browser/fesm2022/tnp-helpers.mjs +4619 -2888
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base/classes/base-bower-json.d.ts +35 -0
- package/browser/lib/base/classes/base-cli-worker.d.ts +1 -1
- package/browser/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
- package/browser/lib/base/classes/base-feature-for-project.d.ts +2 -1
- package/browser/lib/base/classes/base-git.d.ts +34 -5
- package/browser/lib/base/classes/base-json-file-reader.d.ts +72 -0
- package/browser/lib/base/classes/base-library-build.d.ts +5 -5
- package/browser/lib/base/classes/base-linked-projects.d.ts +1 -2
- package/browser/lib/base/classes/base-node-modules.d.ts +56 -0
- package/browser/lib/base/classes/base-npm-helpers.d.ts +29 -112
- package/browser/lib/base/classes/base-package-json.d.ts +107 -0
- package/browser/lib/base/classes/base-process-manager.d.ts +31 -0
- package/browser/lib/base/classes/base-project-resolver.d.ts +2 -2
- package/browser/lib/base/classes/base-project.d.ts +14 -16
- package/browser/lib/base/classes/base-quick-fixes.d.ts +3 -1
- package/browser/lib/base/classes/base-release-process.d.ts +8 -9
- package/browser/lib/base/classes/{base-github-pages.d.ts → base-static-pages.d.ts} +3 -3
- package/browser/lib/base/classes/base-vscode.d.ts +4 -0
- package/browser/lib/base/classes/index.d.ts +5 -1
- package/browser/lib/base/commit-data.d.ts +14 -1
- package/browser/lib/base/linked-project.d.ts +1 -1
- package/browser/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
- package/browser/lib/base/translate.d.ts +228 -0
- package/browser/lib/helpers/helpers-array-obj.d.ts +3 -0
- package/browser/lib/helpers/helpers.d.ts +12 -8
- package/browser/lib/models.d.ts +68 -2
- package/browser/lib/utils.d.ts +72 -13
- package/client/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
- package/client/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
- package/client/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
- package/client/esm2022/lib/base/classes/base-cli-worker.mjs +10 -2
- package/client/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
- package/client/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
- package/client/esm2022/lib/base/classes/base-git.mjs +229 -4
- package/client/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
- package/client/esm2022/lib/base/classes/base-library-build.mjs +11 -7
- package/client/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
- package/client/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
- package/client/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -429
- package/client/esm2022/lib/base/classes/base-package-json.mjs +340 -0
- package/client/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
- package/client/esm2022/lib/base/classes/base-project-resolver.mjs +2 -11
- package/client/esm2022/lib/base/classes/base-project.mjs +76 -61
- package/client/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
- package/client/esm2022/lib/base/classes/base-release-process.mjs +44 -11
- package/client/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
- package/client/esm2022/lib/base/classes/base-vscode.mjs +29 -1
- package/client/esm2022/lib/base/classes/index.mjs +5 -1
- package/client/esm2022/lib/base/commit-data.mjs +19 -1
- package/client/esm2022/lib/base/core-project.mjs +3 -3
- package/client/esm2022/lib/base/linked-project.mjs +4 -4
- package/client/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
- package/client/esm2022/lib/base/translate.mjs +566 -0
- package/client/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
- package/client/esm2022/lib/helpers/helpers.mjs +12 -6
- package/client/esm2022/lib/index.mjs +2 -1
- package/client/esm2022/lib/models.mjs +173 -3
- package/client/esm2022/lib/utils.mjs +402 -41
- package/client/fesm2022/tnp-helpers.mjs +4619 -2888
- package/client/fesm2022/tnp-helpers.mjs.map +1 -1
- package/client/lib/base/classes/base-bower-json.d.ts +35 -0
- package/client/lib/base/classes/base-cli-worker.d.ts +1 -1
- package/client/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
- package/client/lib/base/classes/base-feature-for-project.d.ts +2 -1
- package/client/lib/base/classes/base-git.d.ts +34 -5
- package/client/lib/base/classes/base-json-file-reader.d.ts +72 -0
- package/client/lib/base/classes/base-library-build.d.ts +5 -5
- package/client/lib/base/classes/base-linked-projects.d.ts +1 -2
- package/client/lib/base/classes/base-node-modules.d.ts +56 -0
- package/client/lib/base/classes/base-npm-helpers.d.ts +29 -112
- package/client/lib/base/classes/base-package-json.d.ts +107 -0
- package/client/lib/base/classes/base-process-manager.d.ts +31 -0
- package/client/lib/base/classes/base-project-resolver.d.ts +2 -2
- package/client/lib/base/classes/base-project.d.ts +14 -16
- package/client/lib/base/classes/base-quick-fixes.d.ts +3 -1
- package/client/lib/base/classes/base-release-process.d.ts +8 -9
- package/{websql/lib/base/classes/base-github-pages.d.ts → client/lib/base/classes/base-static-pages.d.ts} +3 -3
- package/client/lib/base/classes/base-vscode.d.ts +4 -0
- package/client/lib/base/classes/index.d.ts +5 -1
- package/client/lib/base/commit-data.d.ts +14 -1
- package/client/lib/base/linked-project.d.ts +1 -1
- package/client/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
- package/client/lib/base/translate.d.ts +228 -0
- package/client/lib/helpers/helpers-array-obj.d.ts +3 -0
- package/client/lib/helpers/helpers.d.ts +12 -8
- package/client/lib/models.d.ts +68 -2
- package/client/lib/utils.d.ts +72 -13
- package/index.js +15 -2
- package/index.js.map +1 -1
- package/lib/base/base-cli-worker-config.d.ts +27 -0
- package/lib/base/base-cli-worker-config.js +53 -0
- package/lib/base/base-cli-worker-config.js.map +1 -0
- package/lib/base/base-cli-worker-controller.d.ts +15 -0
- package/lib/base/base-cli-worker-controller.js +154 -0
- package/lib/base/base-cli-worker-controller.js.map +1 -0
- package/lib/base/base-cli-worker.d.ts +82 -0
- package/lib/base/base-cli-worker.js +654 -0
- package/lib/base/base-cli-worker.js.map +1 -0
- package/lib/base/base-command-line.backend.d.ts +174 -0
- package/lib/base/base-command-line.backend.js +2221 -0
- package/lib/base/base-command-line.backend.js.map +1 -0
- package/lib/base/base-compiler-for-project.d.ts +7 -0
- package/lib/base/base-compiler-for-project.js +62 -0
- package/lib/base/base-compiler-for-project.js.map +1 -0
- package/lib/base/base-db.d.ts +12 -0
- package/lib/base/base-db.js +74 -0
- package/lib/base/base-db.js.map +1 -0
- package/lib/base/base-debounce-compiler-for-project.d.ts +28 -0
- package/lib/base/base-debounce-compiler-for-project.js +82 -0
- package/lib/base/base-debounce-compiler-for-project.js.map +1 -0
- package/lib/base/base-detached-service.d.ts +6 -0
- package/lib/base/base-detached-service.js +16 -0
- package/lib/base/base-detached-service.js.map +1 -0
- package/lib/base/base-feature-for-project.d.ts +5 -0
- package/lib/base/base-feature-for-project.js +11 -0
- package/lib/base/base-feature-for-project.js.map +1 -0
- package/lib/base/base-git.d.ts +148 -0
- package/lib/base/base-git.js +1202 -0
- package/lib/base/base-git.js.map +1 -0
- package/{client/lib/base/classes → lib/base}/base-github-pages.d.ts +4 -5
- package/lib/base/base-github-pages.js +173 -0
- package/lib/base/base-github-pages.js.map +1 -0
- package/lib/base/base-ignore-hide.d.ts +14 -0
- package/lib/base/base-ignore-hide.js +55 -0
- package/lib/base/base-ignore-hide.js.map +1 -0
- package/lib/base/base-library-build.d.ts +65 -0
- package/lib/base/base-library-build.js +717 -0
- package/lib/base/base-library-build.js.map +1 -0
- package/lib/base/base-linked-projects.d.ts +24 -0
- package/lib/base/base-linked-projects.js +408 -0
- package/lib/base/base-linked-projects.js.map +1 -0
- package/lib/base/base-npm-helpers.d.ts +128 -0
- package/lib/base/base-npm-helpers.js +774 -0
- package/lib/base/base-npm-helpers.js.map +1 -0
- package/lib/base/base-project-resolver.d.ts +41 -0
- package/lib/base/base-project-resolver.js +308 -0
- package/lib/base/base-project-resolver.js.map +1 -0
- package/lib/base/base-project.d.ts +244 -0
- package/lib/base/base-project.js +1223 -0
- package/lib/base/base-project.js.map +1 -0
- package/lib/base/base-quick-fixes.d.ts +6 -0
- package/lib/base/base-quick-fixes.js +31 -0
- package/lib/base/base-quick-fixes.js.map +1 -0
- package/lib/base/base-release-process.d.ts +69 -0
- package/lib/base/base-release-process.js +913 -0
- package/lib/base/base-release-process.js.map +1 -0
- package/lib/base/base-start-config.backend.d.ts +36 -0
- package/lib/base/base-start-config.backend.js +167 -0
- package/lib/base/base-start-config.backend.js.map +1 -0
- package/lib/base/base-vscode.d.ts +12 -0
- package/lib/base/base-vscode.js +139 -0
- package/lib/base/base-vscode.js.map +1 -0
- package/lib/base/classes/base-bower-json.d.ts +34 -0
- package/lib/base/classes/base-bower-json.js +19 -0
- package/lib/base/classes/base-bower-json.js.map +1 -0
- package/lib/base/classes/base-cli-worker-config.js +35 -24
- package/lib/base/classes/base-cli-worker-config.js.map +1 -1
- package/lib/base/classes/base-cli-worker-controller.js +98 -128
- package/lib/base/classes/base-cli-worker-controller.js.map +1 -1
- package/lib/base/classes/base-cli-worker.d.ts +1 -1
- package/lib/base/classes/base-cli-worker.js +402 -610
- package/lib/base/classes/base-cli-worker.js.map +1 -1
- package/lib/base/classes/base-command-line-feature.backend.d.ts +5 -9
- package/lib/base/classes/base-command-line-feature.backend.js +73 -132
- package/lib/base/classes/base-command-line-feature.backend.js.map +1 -1
- package/lib/base/classes/base-command-line.backend.d.ts +175 -0
- package/lib/base/classes/base-command-line.backend.js +2235 -0
- package/lib/base/classes/base-command-line.backend.js.map +1 -0
- package/lib/base/classes/base-compiler-for-project.js +27 -32
- package/lib/base/classes/base-compiler-for-project.js.map +1 -1
- package/lib/base/classes/base-db.js +43 -60
- package/lib/base/classes/base-db.js.map +1 -1
- package/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
- package/lib/base/classes/base-debounce-compiler-for-project.js +44 -70
- package/lib/base/classes/base-debounce-compiler-for-project.js.map +1 -1
- package/lib/base/classes/base-detached-service.js.map +1 -1
- package/lib/base/classes/base-feature-for-project.d.ts +2 -1
- package/lib/base/classes/base-feature-for-project.js +7 -4
- package/lib/base/classes/base-feature-for-project.js.map +1 -1
- package/lib/base/classes/base-git.d.ts +32 -3
- package/lib/base/classes/base-git.js +885 -975
- package/lib/base/classes/base-git.js.map +1 -1
- package/lib/base/classes/base-github-pages.js.map +1 -1
- package/lib/base/classes/base-global-command-line.backend.d.ts +7 -2
- package/lib/base/classes/base-global-command-line.backend.js +1055 -2021
- package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
- package/lib/base/classes/base-ignore-hide.d.ts +2 -2
- package/lib/base/classes/base-ignore-hide.js +24 -28
- package/lib/base/classes/base-ignore-hide.js.map +1 -1
- package/lib/base/classes/base-json-file-reader.d.ts +71 -0
- package/lib/base/classes/base-json-file-reader.js +141 -0
- package/lib/base/classes/base-json-file-reader.js.map +1 -0
- package/lib/base/classes/base-library-build.d.ts +5 -6
- package/lib/base/classes/base-library-build.js +431 -653
- package/lib/base/classes/base-library-build.js.map +1 -1
- package/lib/base/classes/base-linked-projects.d.ts +1 -3
- package/lib/base/classes/base-linked-projects.js +200 -314
- package/lib/base/classes/base-linked-projects.js.map +1 -1
- package/lib/base/classes/base-node-modules.d.ts +55 -0
- package/lib/base/classes/base-node-modules.js +415 -0
- package/lib/base/classes/base-node-modules.js.map +1 -0
- package/lib/base/classes/base-npm-helpers.d.ts +29 -99
- package/lib/base/classes/base-npm-helpers.js +178 -737
- package/lib/base/classes/base-npm-helpers.js.map +1 -1
- package/lib/base/classes/base-package-json.d.ts +106 -0
- package/lib/base/classes/base-package-json.js +381 -0
- package/lib/base/classes/base-package-json.js.map +1 -0
- package/lib/base/classes/base-process-manager.d.ts +30 -0
- package/lib/base/classes/base-process-manager.js +269 -0
- package/lib/base/classes/base-process-manager.js.map +1 -0
- package/lib/base/classes/base-project-resolver.d.ts +2 -3
- package/lib/base/classes/base-project-resolver.js +102 -119
- package/lib/base/classes/base-project-resolver.js.map +1 -1
- package/lib/base/classes/base-project.d.ts +17 -15
- package/lib/base/classes/base-project.js +551 -733
- package/lib/base/classes/base-project.js.map +1 -1
- package/lib/base/classes/base-quick-fixes.d.ts +3 -1
- package/lib/base/classes/base-quick-fixes.js +45 -17
- package/lib/base/classes/base-quick-fixes.js.map +1 -1
- package/lib/base/classes/base-release-process.d.ts +8 -9
- package/lib/base/classes/base-release-process.js +482 -757
- package/lib/base/classes/base-release-process.js.map +1 -1
- package/lib/base/classes/base-start-config.backend.js +115 -99
- package/lib/base/classes/base-start-config.backend.js.map +1 -1
- package/lib/base/classes/base-static-pages.d.ts +14 -0
- package/lib/base/classes/base-static-pages.js +105 -0
- package/lib/base/classes/base-static-pages.js.map +1 -0
- package/lib/base/classes/base-vscode.d.ts +4 -0
- package/lib/base/classes/base-vscode.js +446 -426
- package/lib/base/classes/base-vscode.js.map +1 -1
- package/lib/base/classes/index copy.d.ts +22 -0
- package/lib/base/classes/index copy.js +28 -0
- package/lib/base/classes/index copy.js.map +1 -0
- package/lib/base/classes/index.d.ts +4 -0
- package/lib/base/classes/index.js +36 -19
- package/lib/base/classes/index.js.map +1 -1
- package/lib/base/command-line-feature.backend.d.ts +51 -0
- package/lib/base/command-line-feature.backend.js +206 -0
- package/lib/base/command-line-feature.backend.js.map +1 -0
- package/lib/base/commit-data.d.ts +14 -1
- package/lib/base/commit-data.js +408 -460
- package/lib/base/commit-data.js.map +1 -1
- package/lib/base/config-database.js +33 -61
- package/lib/base/config-database.js.map +1 -1
- package/lib/base/core-project.js +110 -146
- package/lib/base/core-project.js.map +1 -1
- package/lib/base/gh-temp-code.d.ts +1 -0
- package/lib/base/gh-temp-code.js +62 -104
- package/lib/base/gh-temp-code.js.map +1 -1
- package/lib/base/index-rebuilder.backend.d.ts +1 -0
- package/lib/base/index-rebuilder.backend.js.map +1 -1
- package/lib/base/index.js +20 -7
- package/lib/base/index.js.map +1 -1
- package/lib/base/linked-project.d.ts +1 -1
- package/lib/base/linked-project.js +59 -38
- package/lib/base/linked-project.js.map +1 -1
- package/lib/base/ports-worker.d.ts +32 -0
- package/lib/base/ports-worker.js +244 -0
- package/lib/base/ports-worker.js.map +1 -0
- package/lib/base/project-database.js +12 -22
- package/lib/base/project-database.js.map +1 -1
- package/lib/base/tcp-udp-ports/index.js +17 -4
- package/lib/base/tcp-udp-ports/index.js.map +1 -1
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.d.ts +1 -0
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.js.map +1 -1
- package/lib/base/tcp-udp-ports/port.entity.d.ts +0 -0
- package/lib/base/tcp-udp-ports/port.entity.js +5 -0
- package/lib/base/tcp-udp-ports/port.entity.js.map +1 -0
- package/lib/base/tcp-udp-ports/ports.controller.js +195 -283
- package/lib/base/tcp-udp-ports/ports.controller.js.map +1 -1
- package/lib/base/tcp-udp-ports/ports.entity.d.ts +2 -2
- package/lib/base/tcp-udp-ports/ports.entity.js +74 -62
- package/lib/base/tcp-udp-ports/ports.entity.js.map +1 -1
- package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js +11 -14
- package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js.map +1 -1
- package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js +244 -427
- package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js.map +1 -1
- package/lib/base/tcp-upd-ports.worker.d.ts +13 -0
- package/lib/base/tcp-upd-ports.worker.js +99 -0
- package/lib/base/tcp-upd-ports.worker.js.map +1 -0
- package/lib/base/translate.d.ts +1 -1
- package/lib/base/translate.js +90 -119
- package/lib/base/translate.js.map +1 -1
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/helpers/for-backend/helpers-cli-tool.backend.js +109 -115
- package/lib/helpers/for-backend/helpers-cli-tool.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-console-gui.js +55 -102
- package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
- package/lib/helpers/for-backend/helpers-dependencies.backend.js +28 -45
- package/lib/helpers/for-backend/helpers-dependencies.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-file-folders.backend.d.ts +2 -2
- package/lib/helpers/for-backend/helpers-file-folders.backend.js +277 -266
- package/lib/helpers/for-backend/helpers-file-folders.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-git.backend.d.ts +28 -3
- package/lib/helpers/for-backend/helpers-git.backend.js +804 -864
- package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-network.backend.js +15 -18
- package/lib/helpers/for-backend/helpers-network.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-npm.backend.js +5 -8
- package/lib/helpers/for-backend/helpers-npm.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-path.backend.js +18 -26
- package/lib/helpers/for-backend/helpers-path.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-process.backend.d.ts +2 -2
- package/lib/helpers/for-backend/helpers-process.backend.js +285 -363
- package/lib/helpers/for-backend/helpers-process.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-system-terminal.backend.js +25 -42
- package/lib/helpers/for-backend/helpers-system-terminal.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-vscode.backend.js +9 -12
- package/lib/helpers/for-backend/helpers-vscode.backend.js.map +1 -1
- package/lib/helpers/for-backend/ts-code/index.js +0 -2
- package/lib/helpers/for-backend/ts-code/index.js.map +1 -1
- package/lib/helpers/for-backend/ts-code/ts-code-extractor.d.ts +26 -0
- package/lib/helpers/for-backend/ts-code/ts-code-extractor.js +62 -0
- package/lib/helpers/for-backend/ts-code/ts-code-extractor.js.map +1 -0
- package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.d.ts +19 -0
- package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.js +81 -0
- package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.js.map +1 -0
- package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.js +2 -2
- package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.js.map +1 -1
- package/lib/helpers/for-browser/angular.helper.js +2 -2
- package/lib/helpers/for-browser/angular.helper.js.map +1 -1
- package/lib/helpers/for-browser/helpers-browser.js +27 -40
- package/lib/helpers/for-browser/helpers-browser.js.map +1 -1
- package/lib/helpers/helpers-array-obj.d.ts +3 -0
- package/lib/helpers/helpers-array-obj.js +49 -61
- package/lib/helpers/helpers-array-obj.js.map +1 -1
- package/lib/helpers/helpers-json5.backend.js +44 -55
- package/lib/helpers/helpers-json5.backend.js.map +1 -1
- package/lib/helpers/helpers-numbers.js +7 -10
- package/lib/helpers/helpers-numbers.js.map +1 -1
- package/lib/helpers/helpers-strings-regexes.js +40 -47
- package/lib/helpers/helpers-strings-regexes.js.map +1 -1
- package/lib/helpers/helpers-strings.js +38 -41
- package/lib/helpers/helpers-strings.js.map +1 -1
- package/lib/helpers/helpers.d.ts +12 -8
- package/lib/helpers/helpers.js +313 -393
- package/lib/helpers/helpers.js.map +1 -1
- package/lib/index._auto-generated_.d.ts +1 -0
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +21 -7
- package/lib/index.js.map +1 -1
- package/lib/lowdb/adapters/Memory.js +14 -20
- package/lib/lowdb/adapters/Memory.js.map +1 -1
- package/lib/lowdb/adapters/browser/LocalStorage.js +5 -8
- package/lib/lowdb/adapters/browser/LocalStorage.js.map +1 -1
- package/lib/lowdb/adapters/browser/SessionStorage.js +5 -8
- package/lib/lowdb/adapters/browser/SessionStorage.js.map +1 -1
- package/lib/lowdb/adapters/browser/WebStorage.js +10 -9
- package/lib/lowdb/adapters/browser/WebStorage.js.map +1 -1
- package/lib/lowdb/adapters/node/DataFile.js +29 -38
- package/lib/lowdb/adapters/node/DataFile.js.map +1 -1
- package/lib/lowdb/adapters/node/JSONFile.js +13 -18
- package/lib/lowdb/adapters/node/JSONFile.js.map +1 -1
- package/lib/lowdb/adapters/node/TextFile.js +36 -44
- package/lib/lowdb/adapters/node/TextFile.js.map +1 -1
- package/lib/lowdb/adapters/node/steno.js +72 -122
- package/lib/lowdb/adapters/node/steno.js.map +1 -1
- package/lib/lowdb/browser.js +17 -4
- package/lib/lowdb/browser.js.map +1 -1
- package/lib/lowdb/core/Low.js +30 -60
- package/lib/lowdb/core/Low.js.map +1 -1
- package/lib/lowdb/examples/browser.js.map +1 -1
- package/lib/lowdb/examples/cli.d.ts +1 -0
- package/lib/lowdb/examples/cli.js.map +1 -1
- package/lib/lowdb/examples/in-memory.d.ts +1 -0
- package/lib/lowdb/examples/in-memory.js.map +1 -1
- package/lib/lowdb/examples/server.d.ts +1 -0
- package/lib/lowdb/examples/server.js.map +1 -1
- package/lib/lowdb/index.js +16 -3
- package/lib/lowdb/index.js.map +1 -1
- package/lib/lowdb/node.js +18 -5
- package/lib/lowdb/node.js.map +1 -1
- package/lib/lowdb/presets/browser.js +7 -7
- package/lib/lowdb/presets/browser.js.map +1 -1
- package/lib/lowdb/presets/node.js +12 -23
- package/lib/lowdb/presets/node.js.map +1 -1
- package/lib/models.d.ts +68 -2
- package/lib/models.js +197 -3
- package/lib/models.js.map +1 -1
- package/lib/old/base-component.d.ts +1 -0
- package/lib/old/base-component.js +2 -2
- package/lib/old/base-component.js.map +1 -1
- package/lib/old/base-formly-component.d.ts +1 -0
- package/lib/old/base-formly-component.js +2 -2
- package/lib/old/base-formly-component.js.map +1 -1
- package/lib/old/condition-wait.d.ts +1 -0
- package/lib/old/condition-wait.js.map +1 -1
- package/lib/old/dual-component-ctrl.d.ts +1 -0
- package/lib/old/dual-component-ctrl.js +2 -2
- package/lib/old/dual-component-ctrl.js.map +1 -1
- package/lib/old/execute-command.d.ts +11 -0
- package/lib/old/execute-command.js +564 -0
- package/lib/old/execute-command.js.map +1 -0
- package/lib/old/helpers.d.ts +62 -0
- package/lib/old/helpers.js +279 -0
- package/lib/old/helpers.js.map +1 -0
- package/lib/old/models.d.ts +80 -0
- package/lib/old/models.js +57 -0
- package/lib/old/models.js.map +1 -0
- package/lib/utils.d.ts +72 -13
- package/lib/utils.js +502 -179
- package/lib/utils.js.map +1 -1
- package/lib/validators/validators-firedev.js +5 -5
- package/lib/validators/validators-firedev.js.map +1 -1
- package/lib/validators/validators-git.js +2 -2
- package/lib/validators/validators-git.js.map +1 -1
- package/lib/validators/validators-network.js +1 -1
- package/lib/validators/validators-network.js.map +1 -1
- package/lib/validators/validators.js +2 -2
- package/lib/validators/validators.js.map +1 -1
- package/migrations/1736198527297_init.js +39 -58
- package/migrations/1736198527297_init.js.map +1 -1
- package/migrations/1736199486472_addingNotAssignablePorts.js +42 -93
- package/migrations/1736199486472_addingNotAssignablePorts.js.map +1 -1
- package/migrations/1736454437350_addFreePorts.js +48 -100
- package/migrations/1736454437350_addFreePorts.js.map +1 -1
- package/migrations/index.js +15 -2
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.js +3 -3
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/package.json +14 -61
- package/src.d.ts +1 -1
- package/taon.jsonc +26 -41
- package/tmp-environment.json +8 -389
- package/websql/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
- package/websql/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
- package/websql/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
- package/websql/esm2022/lib/base/classes/base-cli-worker.mjs +10 -2
- package/websql/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
- package/websql/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
- package/websql/esm2022/lib/base/classes/base-git.mjs +229 -4
- package/websql/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
- package/websql/esm2022/lib/base/classes/base-library-build.mjs +11 -7
- package/websql/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
- package/websql/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
- package/websql/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -429
- package/websql/esm2022/lib/base/classes/base-package-json.mjs +340 -0
- package/websql/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
- package/websql/esm2022/lib/base/classes/base-project-resolver.mjs +2 -10
- package/websql/esm2022/lib/base/classes/base-project.mjs +75 -61
- package/websql/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
- package/websql/esm2022/lib/base/classes/base-release-process.mjs +44 -11
- package/websql/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
- package/websql/esm2022/lib/base/classes/base-vscode.mjs +29 -1
- package/websql/esm2022/lib/base/classes/index.mjs +5 -1
- package/websql/esm2022/lib/base/commit-data.mjs +19 -1
- package/websql/esm2022/lib/base/core-project.mjs +3 -3
- package/websql/esm2022/lib/base/linked-project.mjs +4 -4
- package/websql/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
- package/websql/esm2022/lib/base/translate.mjs +566 -0
- package/websql/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
- package/websql/esm2022/lib/helpers/helpers.mjs +12 -6
- package/websql/esm2022/lib/index.mjs +2 -1
- package/websql/esm2022/lib/models.mjs +173 -3
- package/websql/esm2022/lib/utils.mjs +402 -41
- package/websql/fesm2022/tnp-helpers.mjs +4738 -3007
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base/classes/base-bower-json.d.ts +35 -0
- package/websql/lib/base/classes/base-cli-worker.d.ts +1 -1
- package/websql/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
- package/websql/lib/base/classes/base-feature-for-project.d.ts +2 -1
- package/websql/lib/base/classes/base-git.d.ts +34 -5
- package/websql/lib/base/classes/base-json-file-reader.d.ts +72 -0
- package/websql/lib/base/classes/base-library-build.d.ts +5 -5
- package/websql/lib/base/classes/base-linked-projects.d.ts +1 -2
- package/websql/lib/base/classes/base-node-modules.d.ts +56 -0
- package/websql/lib/base/classes/base-npm-helpers.d.ts +29 -110
- package/websql/lib/base/classes/base-package-json.d.ts +107 -0
- package/websql/lib/base/classes/base-process-manager.d.ts +31 -0
- package/websql/lib/base/classes/base-project-resolver.d.ts +2 -2
- package/websql/lib/base/classes/base-project.d.ts +14 -16
- package/websql/lib/base/classes/base-quick-fixes.d.ts +3 -1
- package/websql/lib/base/classes/base-release-process.d.ts +8 -9
- package/websql/lib/base/classes/base-static-pages.d.ts +15 -0
- package/websql/lib/base/classes/base-vscode.d.ts +4 -0
- package/websql/lib/base/classes/index.d.ts +5 -1
- package/websql/lib/base/commit-data.d.ts +14 -1
- package/websql/lib/base/linked-project.d.ts +1 -1
- package/websql/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
- package/websql/lib/base/translate.d.ts +228 -0
- package/websql/lib/helpers/helpers-array-obj.d.ts +3 -0
- package/websql/lib/helpers/helpers.d.ts +12 -8
- package/websql/lib/models.d.ts +68 -2
- package/websql/lib/utils.d.ts +72 -13
- package/browser/package.json +0 -25
- package/websql/package.json +0 -25
package/lib/base/commit-data.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CommitData = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
4
|
//#region imports
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const tnp_core_1 = require("tnp-core");
|
|
6
|
+
const index_1 = require("../index");
|
|
7
|
+
const tnp_core_2 = require("tnp-core");
|
|
9
8
|
//#endregion
|
|
10
9
|
//#region open source proviers
|
|
11
|
-
|
|
10
|
+
const openSourceProvidersIssuePrefix = [
|
|
12
11
|
'GH',
|
|
13
12
|
// 'GITHUB',
|
|
14
13
|
// 'BB',
|
|
@@ -16,90 +15,81 @@ var openSourceProvidersIssuePrefix = [
|
|
|
16
15
|
// 'GL',
|
|
17
16
|
// 'GITLAB',
|
|
18
17
|
];
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//#region static
|
|
25
|
-
//#endregion
|
|
26
|
-
this.useFeatureBranchForTestBranch = false;
|
|
27
|
-
//#endregion
|
|
28
|
-
}
|
|
18
|
+
const regexTeamsID = /[A-Z0-9]+\#/;
|
|
19
|
+
const regexCommitModuleInArgs = /\[[a-z|\-|\,]+\]/;
|
|
20
|
+
const regexCommitModuleInBranch = /\-\-[a-z|\-|\_]+\-\-/;
|
|
21
|
+
class CommitData {
|
|
22
|
+
//#region static
|
|
29
23
|
//#region static / methods & getters / clean http(s) from commit message
|
|
30
|
-
|
|
24
|
+
static cleanHttpFromCommitMessage(commitMsg) {
|
|
31
25
|
if (!commitMsg) {
|
|
32
26
|
return commitMsg;
|
|
33
27
|
}
|
|
34
28
|
commitMsg = commitMsg.replace('https://', '');
|
|
35
29
|
commitMsg = commitMsg.replace('http://', '');
|
|
36
30
|
return commitMsg;
|
|
37
|
-
}
|
|
31
|
+
}
|
|
38
32
|
//#endregion
|
|
39
33
|
//#region static / methods & getters / get temas id from
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
static getTeamsIdFrom(commitMsg) {
|
|
35
|
+
let teamID = tnp_core_1._.first(commitMsg.match(regexTeamsID));
|
|
42
36
|
if (teamID) {
|
|
43
37
|
commitMsg = commitMsg.replace(teamID, '');
|
|
44
38
|
}
|
|
45
39
|
return {
|
|
46
40
|
commitMsgOrBranchName: commitMsg,
|
|
47
|
-
teamID
|
|
41
|
+
teamID,
|
|
48
42
|
};
|
|
49
|
-
}
|
|
43
|
+
}
|
|
50
44
|
//#endregion
|
|
51
45
|
//#region static / methods & getters / get module name from
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
static getModuleNameFrom(commitMsg) {
|
|
47
|
+
let commitModuleName = tnp_core_1._.first(commitMsg.match(regexCommitModuleInArgs));
|
|
54
48
|
if (commitModuleName) {
|
|
55
49
|
commitMsg = commitMsg.replace(commitModuleName, '');
|
|
56
50
|
}
|
|
57
|
-
commitModuleName = commitModuleName
|
|
51
|
+
commitModuleName = commitModuleName?.replace(/\[/g, '').replace(/\]/g, '');
|
|
58
52
|
return {
|
|
59
|
-
commitMsg
|
|
60
|
-
commitModuleName
|
|
53
|
+
commitMsg,
|
|
54
|
+
commitModuleName,
|
|
61
55
|
};
|
|
62
|
-
}
|
|
56
|
+
}
|
|
63
57
|
//#endregion
|
|
64
58
|
//#region static / methods & getters / extract jira numbers
|
|
65
59
|
/**
|
|
66
60
|
*
|
|
67
61
|
* @returns jiras (from oldest to newset)
|
|
68
62
|
*/
|
|
69
|
-
|
|
63
|
+
static extractAndOrderJiraNumbers(commitOrBranchName) {
|
|
70
64
|
//#region @backendFunc
|
|
71
65
|
return index_1.Helpers.uniqArray((tnp_core_1._.first(commitOrBranchName.split('\n')).match(/[A-Z0-9]+\-[0-9]+/g) ||
|
|
72
66
|
[])
|
|
73
|
-
.map(
|
|
67
|
+
.map(originalName => {
|
|
74
68
|
return {
|
|
75
|
-
originalName
|
|
69
|
+
originalName,
|
|
76
70
|
num: Number(originalName.replace(/[A-Z]+/g, '').replace(/\-+/g, '')),
|
|
77
71
|
};
|
|
78
72
|
})
|
|
79
|
-
.sort(
|
|
80
|
-
|
|
81
|
-
var b = _b.num;
|
|
82
|
-
return b - a;
|
|
83
|
-
})
|
|
84
|
-
.map(function (c) { return c.originalName; })
|
|
73
|
+
.sort(({ num: a }, { num: b }) => b - a)
|
|
74
|
+
.map(c => c.originalName)
|
|
85
75
|
.reverse()
|
|
86
|
-
.filter(
|
|
76
|
+
.filter(c => {
|
|
87
77
|
// is there is not letter in jira number skip it
|
|
88
|
-
|
|
78
|
+
const regexONlyNumbers = /^[0-9]+$/;
|
|
89
79
|
if (regexONlyNumbers.test(c.replace(/\-/g, ''))) {
|
|
90
80
|
return false;
|
|
91
81
|
}
|
|
92
82
|
return true;
|
|
93
83
|
}));
|
|
94
84
|
//#endregion
|
|
95
|
-
}
|
|
85
|
+
}
|
|
96
86
|
//#endregion
|
|
97
87
|
//#region static / methods & getters / extract jira numbers
|
|
98
88
|
/**
|
|
99
89
|
*
|
|
100
90
|
* @returns jiras (from oldest to newset)
|
|
101
91
|
*/
|
|
102
|
-
|
|
92
|
+
static extractAndOrderIssuesFromOtherProjects(
|
|
103
93
|
/**
|
|
104
94
|
* example:
|
|
105
95
|
* commit: proper git commands tnp/GH-9 darekf77/tnp-helpers/GH-10
|
|
@@ -111,58 +101,52 @@ var CommitData = /** @class */ (function () {
|
|
|
111
101
|
// console.trace('commitOrBranchName is empty');
|
|
112
102
|
return [];
|
|
113
103
|
}
|
|
114
|
-
|
|
104
|
+
const isBranch = !commitOrBranchName.trim().includes(' ');
|
|
115
105
|
// console.log(`is branch: "${isBranch}" "${commitOrBranchName}"`);
|
|
116
106
|
return index_1.Helpers.uniqArray((tnp_core_1._.first(commitOrBranchName.split('\n')).match(isBranch
|
|
117
107
|
? /\_\_(([a-zA-Z0-9\-])+\_)+[A-Z0-9]+\-[0-9]+\_\_/g
|
|
118
108
|
: /(([a-zA-Z0-9\-])+\/)+[A-Z0-9]+\-[0-9]+/g) || [])
|
|
119
|
-
.map(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
})
|
|
124
|
-
.map(function (originalName) {
|
|
109
|
+
.map(originalName => isBranch
|
|
110
|
+
? originalName.replace(/\_\_/g, '').replace(/\_/g, '/')
|
|
111
|
+
: originalName)
|
|
112
|
+
.map(originalName => {
|
|
125
113
|
// replace all non numbers
|
|
126
|
-
|
|
114
|
+
const issueNum = originalName
|
|
127
115
|
.replace(/\D/g, ' ')
|
|
128
116
|
.split(' ')
|
|
129
117
|
.pop();
|
|
130
118
|
// console.log({ originalName, issueNum });
|
|
131
119
|
return {
|
|
132
|
-
originalName
|
|
120
|
+
originalName,
|
|
133
121
|
num: Number(issueNum),
|
|
134
122
|
};
|
|
135
123
|
})
|
|
136
|
-
.sort(
|
|
137
|
-
|
|
138
|
-
var b = _b.num;
|
|
139
|
-
return b - a;
|
|
140
|
-
})
|
|
141
|
-
.map(function (c) { return c.originalName; })
|
|
124
|
+
.sort(({ num: a }, { num: b }) => b - a)
|
|
125
|
+
.map(c => c.originalName)
|
|
142
126
|
.reverse()
|
|
143
|
-
.filter(
|
|
127
|
+
.filter(c => {
|
|
144
128
|
// is there is not letter in jira number skip it
|
|
145
|
-
|
|
129
|
+
const regexONlyNumbers = /^[0-9]+$/;
|
|
146
130
|
if (regexONlyNumbers.test(c.replace(/\-/g, ''))) {
|
|
147
131
|
return false;
|
|
148
132
|
}
|
|
149
133
|
return true;
|
|
150
134
|
})
|
|
151
|
-
.map(
|
|
135
|
+
.map(issue => {
|
|
152
136
|
// console.log('MAPPING', issue);
|
|
153
137
|
// console.log('project', project?.name);
|
|
154
138
|
if (issue.split('/').length === 2 && !!currentOrigin) {
|
|
155
139
|
// console.log('issue', issue);
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
140
|
+
const origin = index_1.Helpers.git.originSshToHttp(currentOrigin);
|
|
141
|
+
const provider = tnp_core_1._.first(origin.replace('https://', '').split('/'));
|
|
142
|
+
const cleanUserWithPath = origin
|
|
159
143
|
.replace('https://', '')
|
|
160
144
|
.replace(provider + '/', '')
|
|
161
|
-
.replace(tnp_core_2.path.basename(
|
|
145
|
+
.replace(tnp_core_2.path.basename(origin).replace('.git', ''), '')
|
|
162
146
|
.replace('.git', '');
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
147
|
+
const issueFirstPart = tnp_core_1._.first(issue.split('/'));
|
|
148
|
+
const issueLastPart = tnp_core_1._.last(issue.split('/'));
|
|
149
|
+
const newPath = `${cleanUserWithPath}/${issueFirstPart}/${issueLastPart}`.replace(/\/\/+/g, '/');
|
|
166
150
|
// console.log({
|
|
167
151
|
// origin,
|
|
168
152
|
// provider,
|
|
@@ -176,13 +160,12 @@ var CommitData = /** @class */ (function () {
|
|
|
176
160
|
return issue;
|
|
177
161
|
}));
|
|
178
162
|
//#endregion
|
|
179
|
-
}
|
|
163
|
+
}
|
|
180
164
|
//#endregion
|
|
181
165
|
//#region static / methods & getters / clean message from jira numbers, team id and stuff
|
|
182
|
-
|
|
183
|
-
var e_1, _a, e_2, _b;
|
|
166
|
+
static cleanMessageFromJiraNumTeamIdEtc(message, optinos) {
|
|
184
167
|
message = message || '';
|
|
185
|
-
|
|
168
|
+
let { teamID, commitModuleName, jiraNumbers, issuesFromOtherProjects } = optinos || {};
|
|
186
169
|
teamID = teamID || this.getTeamsIdFrom(message).teamID || '';
|
|
187
170
|
commitModuleName =
|
|
188
171
|
commitModuleName ||
|
|
@@ -197,53 +180,33 @@ var CommitData = /** @class */ (function () {
|
|
|
197
180
|
message = message.replace(teamID.toLowerCase().replace('-', ' '), ' ');
|
|
198
181
|
message = message.replace(teamID.toUpperCase().replace('-', ' '), ' ');
|
|
199
182
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
message = message.replace(regexCommitModuleInBranch, ' ');
|
|
213
|
-
message = message.replace(/\ \ /g, ' ');
|
|
214
|
-
}
|
|
183
|
+
// console.log({ clere: 'CLEAR', issuesFromOtherProjects, message });
|
|
184
|
+
for (const issueFromOtherProj of issuesFromOtherProjects || []) {
|
|
185
|
+
// console.log('issueFromOtherProj', issueFromOtherProj);
|
|
186
|
+
// console.log('message', message);
|
|
187
|
+
message = message.replace(`__${issueFromOtherProj.replace(/\//g, '_').replace(/\-/g, ' ')}__`, ' ');
|
|
188
|
+
message = message.replace(issueFromOtherProj, ' ');
|
|
189
|
+
message = message.replace(issueFromOtherProj.toLowerCase().replace('-', ' '), ' ');
|
|
190
|
+
message = message.replace(issueFromOtherProj.toUpperCase().replace('-', ' '), ' ');
|
|
191
|
+
message = message.replace(issueFromOtherProj.toLowerCase(), ' ');
|
|
192
|
+
message = message.replace(regexCommitModuleInArgs, ' ');
|
|
193
|
+
message = message.replace(regexCommitModuleInBranch, ' ');
|
|
194
|
+
message = message.replace(/\ \ /g, ' ');
|
|
215
195
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
for (var _f = tslib_1.__values(jiraNumbers || []), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
225
|
-
var jira = _g.value;
|
|
226
|
-
message = message.replace(jira.toLowerCase().replace('-', ' '), ' ');
|
|
227
|
-
message = message.replace(jira.toUpperCase().replace('-', ' '), ' ');
|
|
228
|
-
message = message.replace(jira, ' ');
|
|
229
|
-
message = message.replace(jira.toLowerCase(), ' ');
|
|
230
|
-
message = message.replace(regexCommitModuleInArgs, ' ');
|
|
231
|
-
message = message.replace(regexCommitModuleInBranch, ' ');
|
|
232
|
-
message = message.replace(/\ \ /g, ' ');
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
236
|
-
finally {
|
|
237
|
-
try {
|
|
238
|
-
if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
|
|
239
|
-
}
|
|
240
|
-
finally { if (e_2) throw e_2.error; }
|
|
196
|
+
for (const jira of jiraNumbers || []) {
|
|
197
|
+
message = message.replace(jira.toLowerCase().replace('-', ' '), ' ');
|
|
198
|
+
message = message.replace(jira.toUpperCase().replace('-', ' '), ' ');
|
|
199
|
+
message = message.replace(jira, ' ');
|
|
200
|
+
message = message.replace(jira.toLowerCase(), ' ');
|
|
201
|
+
message = message.replace(regexCommitModuleInArgs, ' ');
|
|
202
|
+
message = message.replace(regexCommitModuleInBranch, ' ');
|
|
203
|
+
message = message.replace(/\ \ /g, ' ');
|
|
241
204
|
}
|
|
242
205
|
if (!!teamID.trim()) {
|
|
243
206
|
message = message.replace(/\_/g, ' ');
|
|
244
207
|
}
|
|
245
208
|
if (!!commitModuleName.trim()) {
|
|
246
|
-
|
|
209
|
+
const cleanedModuleName = commitModuleName
|
|
247
210
|
.replace(/\-/g, ' ')
|
|
248
211
|
.replace(/\,/g, '_');
|
|
249
212
|
message = message.replace(cleanedModuleName, ' ');
|
|
@@ -252,408 +215,393 @@ var CommitData = /** @class */ (function () {
|
|
|
252
215
|
.replace(/\ \ /g, ' ')
|
|
253
216
|
.replace(/\ \ /g, ' ')
|
|
254
217
|
.replace(/\ \ /g, ' ');
|
|
255
|
-
}
|
|
218
|
+
}
|
|
256
219
|
//#endregion
|
|
257
220
|
//#region static / methods & getters / get module name from branch
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
var commitModuleName = tnp_core_1._.first(branchName.match(regexCommitModuleInBranch));
|
|
221
|
+
static getModuleNameFromBranch(branchName) {
|
|
222
|
+
let commitModuleName = tnp_core_1._.first(branchName.match(regexCommitModuleInBranch));
|
|
261
223
|
if (commitModuleName) {
|
|
262
224
|
branchName = branchName.replace(commitModuleName, '');
|
|
263
|
-
commitModuleName =
|
|
225
|
+
commitModuleName = commitModuleName
|
|
226
|
+
?.replace(/^\-\-/, '')
|
|
227
|
+
?.replace(/\-\-$/, '');
|
|
264
228
|
if (commitModuleName.startsWith('-')) {
|
|
265
229
|
commitModuleName = commitModuleName.replace(/^\-/, '');
|
|
266
230
|
}
|
|
267
231
|
}
|
|
268
|
-
commitModuleName =
|
|
269
|
-
|
|
270
|
-
|
|
232
|
+
commitModuleName = commitModuleName
|
|
233
|
+
?.replace(/^\-\-/, '')
|
|
234
|
+
?.replace(/\-\-$/, '')
|
|
235
|
+
.replace(/\_/, ',');
|
|
236
|
+
return { commitModuleName };
|
|
237
|
+
}
|
|
271
238
|
//#endregion
|
|
272
239
|
//#region static / methods & getters / get from args
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
try {
|
|
287
|
-
for (var matches_1 = tslib_1.__values(matches), matches_1_1 = matches_1.next(); !matches_1_1.done; matches_1_1 = matches_1.next()) {
|
|
288
|
-
var match = matches_1_1.value;
|
|
289
|
-
var _b = tslib_1.__read(match.split('#'), 2), repo = _b[0], issue = _b[1];
|
|
290
|
-
// TODO last handle other providers than github
|
|
291
|
-
arg = arg.replace(match, "".concat(repo, "/GH-").concat(issue));
|
|
292
|
-
// console.log('fixing github issue', match, 'to', `${repo}/GH-${issue}`);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
296
|
-
finally {
|
|
297
|
-
try {
|
|
298
|
-
if (matches_1_1 && !matches_1_1.done && (_a = matches_1.return)) _a.call(matches_1);
|
|
299
|
-
}
|
|
300
|
-
finally { if (e_4) throw e_4.error; }
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
return arg;
|
|
304
|
-
});
|
|
305
|
-
messageFromArgs = args.join(' ');
|
|
306
|
-
teamIdData = this.getTeamsIdFrom(messageFromArgs);
|
|
307
|
-
issuesFromOtherProjects = this.extractAndOrderIssuesFromOtherProjects(messageFromArgs, currentOrigin);
|
|
308
|
-
try {
|
|
309
|
-
// console.log({ issuesFromOtherProjects });
|
|
310
|
-
for (issuesFromOtherProjects_1 = tslib_1.__values(issuesFromOtherProjects), issuesFromOtherProjects_1_1 = issuesFromOtherProjects_1.next(); !issuesFromOtherProjects_1_1.done; issuesFromOtherProjects_1_1 = issuesFromOtherProjects_1.next()) {
|
|
311
|
-
iterator = issuesFromOtherProjects_1_1.value;
|
|
312
|
-
messageFromArgs = messageFromArgs.replace(iterator, '');
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
316
|
-
finally {
|
|
317
|
-
try {
|
|
318
|
-
if (issuesFromOtherProjects_1_1 && !issuesFromOtherProjects_1_1.done && (_a = issuesFromOtherProjects_1.return)) _a.call(issuesFromOtherProjects_1);
|
|
319
|
-
}
|
|
320
|
-
finally { if (e_3) throw e_3.error; }
|
|
321
|
-
}
|
|
322
|
-
// console.log({ teamIdData })
|
|
323
|
-
messageFromArgs = teamIdData.commitMsgOrBranchName;
|
|
324
|
-
moduleNameData = this.getModuleNameFrom(messageFromArgs);
|
|
325
|
-
messageFromArgs = moduleNameData.commitMsg;
|
|
326
|
-
jiraNumbers = this.extractAndOrderJiraNumbers(messageFromArgs);
|
|
327
|
-
// console.log(`
|
|
328
|
-
// msg: '${message}'
|
|
329
|
-
// jiras: ${jiraNumbers.join(',')}
|
|
330
|
-
// `)
|
|
331
|
-
messageFromArgs = this.cleanHttpFromCommitMessage(messageFromArgs);
|
|
332
|
-
if (messageFromArgs.search(':') !== -1) {
|
|
333
|
-
split = messageFromArgs.split(':');
|
|
334
|
-
messageFromArgs = split.join(':\n');
|
|
335
|
-
}
|
|
336
|
-
if (messageFromArgs.search(' - ') !== -1) {
|
|
337
|
-
split = messageFromArgs.split(' - ');
|
|
338
|
-
messageFromArgs = split.join('\n- ');
|
|
240
|
+
static async getFromArgs(args, options) {
|
|
241
|
+
//#region @backendFunc
|
|
242
|
+
options = options || {};
|
|
243
|
+
const { typeOfCommit, currentOrigin } = options;
|
|
244
|
+
args = args.map(arg => {
|
|
245
|
+
const githubOtherIssueRegex = /[a-z0-9\-\/]+\#[0-9]+/g;
|
|
246
|
+
const matches = arg.match(githubOtherIssueRegex);
|
|
247
|
+
if (matches) {
|
|
248
|
+
for (const match of matches) {
|
|
249
|
+
const [repo, issue] = match.split('#');
|
|
250
|
+
// TODO last handle other providers than github
|
|
251
|
+
arg = arg.replace(match, `${repo}/GH-${issue}`);
|
|
252
|
+
// console.log('fixing github issue', match, 'to', `${repo}/GH-${issue}`);
|
|
339
253
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
message: messageFromArgs,
|
|
343
|
-
typeOfCommit: typeOfCommit,
|
|
344
|
-
jiraNumbers: jiraNumbers,
|
|
345
|
-
issuesFromOtherProjects: issuesFromOtherProjects,
|
|
346
|
-
commitModuleName: moduleNameData.commitModuleName,
|
|
347
|
-
teamID: teamIdData.teamID,
|
|
348
|
-
})];
|
|
349
|
-
});
|
|
254
|
+
}
|
|
255
|
+
return arg;
|
|
350
256
|
});
|
|
351
|
-
|
|
257
|
+
let messageFromArgs = args.join(' ');
|
|
258
|
+
const teamIdData = this.getTeamsIdFrom(messageFromArgs);
|
|
259
|
+
const issuesFromOtherProjects = this.extractAndOrderIssuesFromOtherProjects(messageFromArgs, currentOrigin);
|
|
260
|
+
// console.log({ issuesFromOtherProjects });
|
|
261
|
+
for (const iterator of issuesFromOtherProjects) {
|
|
262
|
+
messageFromArgs = messageFromArgs.replace(iterator, '');
|
|
263
|
+
}
|
|
264
|
+
// console.log({ teamIdData })
|
|
265
|
+
messageFromArgs = teamIdData.commitMsgOrBranchName;
|
|
266
|
+
const moduleNameData = this.getModuleNameFrom(messageFromArgs);
|
|
267
|
+
messageFromArgs = moduleNameData.commitMsg;
|
|
268
|
+
const jiraNumbers = this.extractAndOrderJiraNumbers(messageFromArgs);
|
|
269
|
+
// console.log(`
|
|
270
|
+
// msg: '${message}'
|
|
271
|
+
// jiras: ${jiraNumbers.join(',')}
|
|
272
|
+
// `)
|
|
273
|
+
messageFromArgs = this.cleanHttpFromCommitMessage(messageFromArgs);
|
|
274
|
+
if (messageFromArgs.search(':') !== -1) {
|
|
275
|
+
const split = messageFromArgs.split(':');
|
|
276
|
+
messageFromArgs = split.join(':\n');
|
|
277
|
+
}
|
|
278
|
+
if (messageFromArgs.search(' - ') !== -1) {
|
|
279
|
+
const split = messageFromArgs.split(' - ');
|
|
280
|
+
messageFromArgs = split.join('\n- ');
|
|
281
|
+
}
|
|
282
|
+
// console.log({ messageFromArgs })
|
|
283
|
+
return CommitData.from({
|
|
284
|
+
message: messageFromArgs,
|
|
285
|
+
typeOfCommit,
|
|
286
|
+
jiraNumbers,
|
|
287
|
+
issuesFromOtherProjects,
|
|
288
|
+
commitModuleName: moduleNameData.commitModuleName,
|
|
289
|
+
teamID: teamIdData.teamID,
|
|
290
|
+
jiraIssuesAreOutsideBrackets: !!options.jiraIssuesAreOutsideBrackets,
|
|
291
|
+
});
|
|
292
|
+
//#endregion
|
|
293
|
+
}
|
|
352
294
|
//#endregion
|
|
353
295
|
//#region static / methods & getters / get from bramch
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
messageFromBranch = messageFromBranch.replace(toReplaceReleaseVer1.trim(), "".concat(releaseWord, " ").concat(resolveReleseVersion));
|
|
417
|
-
}
|
|
418
|
-
result = CommitData.from({
|
|
419
|
-
message: messageFromBranch,
|
|
420
|
-
typeOfCommit: typeOfCommit,
|
|
421
|
-
jiraNumbers: jiraNumbers,
|
|
422
|
-
issuesFromOtherProjects: issuesFromOtherProjects,
|
|
423
|
-
commitModuleName: moduleNameData.commitModuleName,
|
|
424
|
-
teamID: teamIdData.teamID,
|
|
425
|
-
});
|
|
426
|
-
return [2 /*return*/, result];
|
|
427
|
-
});
|
|
296
|
+
static async getFromBranch(currentBranchName, options) {
|
|
297
|
+
//#region @backendFunc
|
|
298
|
+
options = options || { releaseWords: [] };
|
|
299
|
+
options.releaseWords = options.releaseWords || [];
|
|
300
|
+
const { releaseWords, currentOrigin } = options;
|
|
301
|
+
const typeOfCommit = tnp_core_1._.first(currentBranchName.split('/'));
|
|
302
|
+
const issuesFromOtherProjects = this.extractAndOrderIssuesFromOtherProjects(currentBranchName, currentOrigin);
|
|
303
|
+
// console.log({
|
|
304
|
+
// BEFORE: 'BEFOER',
|
|
305
|
+
// currentBranchName,
|
|
306
|
+
// });
|
|
307
|
+
for (const iterator of issuesFromOtherProjects) {
|
|
308
|
+
currentBranchName = currentBranchName.replace(`__${iterator.replace(/\//g, '_')}__`, '');
|
|
309
|
+
}
|
|
310
|
+
// console.log({
|
|
311
|
+
// BRANCHOTHERISSUE: issuesFromOtherProjects,
|
|
312
|
+
// currentBranchName,
|
|
313
|
+
// });
|
|
314
|
+
const teamIdData = this.getTeamsIdFrom(currentBranchName);
|
|
315
|
+
currentBranchName = teamIdData.commitMsgOrBranchName;
|
|
316
|
+
const jiraNumbers = this.extractAndOrderJiraNumbers(currentBranchName);
|
|
317
|
+
let messageFromBranch = tnp_core_1._.last(currentBranchName.split('/')).replace(/\-/g, ' ');
|
|
318
|
+
const versionRegex = new RegExp(`(${releaseWords.join('|')})\\-\\d+\\-\\d+\\-\\d+\\-`);
|
|
319
|
+
const secondPartOfCurrentBranchName = tnp_core_1._.last(currentBranchName.split('/'));
|
|
320
|
+
let resolveReleseVersionPart = versionRegex.test(secondPartOfCurrentBranchName)
|
|
321
|
+
? (tnp_core_1._.first(secondPartOfCurrentBranchName.match(versionRegex) || []) || '').replace(/^[a-z]+\-/g, '')
|
|
322
|
+
: '';
|
|
323
|
+
let resolveReleseVersion = resolveReleseVersionPart
|
|
324
|
+
.replace(/\-/g, '.')
|
|
325
|
+
.replace(/\.$/g, '');
|
|
326
|
+
const releaseWord = tnp_core_1._.first(secondPartOfCurrentBranchName.split(resolveReleseVersionPart)).replace(/\-/g, '');
|
|
327
|
+
const moduleNameData = this.getModuleNameFromBranch(currentBranchName);
|
|
328
|
+
if (moduleNameData.commitModuleName) {
|
|
329
|
+
messageFromBranch = messageFromBranch.replace(moduleNameData.commitModuleName.replace(/\,/g, '_'), '');
|
|
330
|
+
}
|
|
331
|
+
for (const jira of jiraNumbers) {
|
|
332
|
+
messageFromBranch = messageFromBranch.replace(jira.replace(/\-/g, ' '), '');
|
|
333
|
+
}
|
|
334
|
+
messageFromBranch = messageFromBranch.trim();
|
|
335
|
+
// const orgMessageFromBranch = messageFromBranch;
|
|
336
|
+
if (versionRegex.test(currentBranchName) && releaseWords.length > 0) {
|
|
337
|
+
var toReplaceReleaseVer1 = `${releaseWord}-${resolveReleseVersionPart}`.replace(/\-/g, ' ');
|
|
338
|
+
messageFromBranch = messageFromBranch.replace(toReplaceReleaseVer1.trim(), `${releaseWord} ${resolveReleseVersion}`);
|
|
339
|
+
}
|
|
340
|
+
// console.log({
|
|
341
|
+
// secondPartOfCurrentBranchName,
|
|
342
|
+
// resolveReleseVersionPart,
|
|
343
|
+
// releaseWord,
|
|
344
|
+
// toReplaceReleaseVer1,
|
|
345
|
+
// orgMessageFromBranch,
|
|
346
|
+
// messageFromBranch,
|
|
347
|
+
// resolveReleseVersion,
|
|
348
|
+
// versionRegex: versionRegex.source,
|
|
349
|
+
// });
|
|
350
|
+
const result = CommitData.from({
|
|
351
|
+
message: messageFromBranch,
|
|
352
|
+
typeOfCommit,
|
|
353
|
+
jiraNumbers,
|
|
354
|
+
issuesFromOtherProjects,
|
|
355
|
+
commitModuleName: moduleNameData.commitModuleName,
|
|
356
|
+
teamID: teamIdData.teamID,
|
|
357
|
+
jiraIssuesAreOutsideBrackets: !!options.jiraIssuesAreOutsideBrackets,
|
|
428
358
|
});
|
|
429
|
-
|
|
359
|
+
return result;
|
|
360
|
+
//#endregion
|
|
361
|
+
}
|
|
430
362
|
//#endregion
|
|
431
363
|
//#region static / methods & getters / from
|
|
432
|
-
|
|
364
|
+
static from(options) {
|
|
433
365
|
options = (options ? options : {});
|
|
434
366
|
// console.log(options)
|
|
435
|
-
|
|
367
|
+
const opt = tnp_core_1._.merge(new CommitData(), tnp_core_1._.cloneDeep(options));
|
|
436
368
|
return opt;
|
|
437
|
-
}
|
|
369
|
+
}
|
|
370
|
+
//#endregion
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region fields
|
|
373
|
+
_message;
|
|
374
|
+
typeOfCommit;
|
|
375
|
+
/**
|
|
376
|
+
* ex. JIRA-2132 or MYJIRAREFIX-234234
|
|
377
|
+
*/
|
|
378
|
+
jiraNumbers;
|
|
379
|
+
/**
|
|
380
|
+
* if true then jira issues are outside brackets
|
|
381
|
+
* feat: proper git commands JIRA-1234
|
|
382
|
+
*
|
|
383
|
+
* by default is false
|
|
384
|
+
* feat(JIRA-1234): proper git commands
|
|
385
|
+
*/
|
|
386
|
+
jiraIssuesAreOutsideBrackets;
|
|
387
|
+
/**
|
|
388
|
+
* when set -> jiraIssuesAreOutsideBrackets is true
|
|
389
|
+
*/
|
|
390
|
+
commitModuleName;
|
|
391
|
+
teamID;
|
|
438
392
|
//#endregion
|
|
439
393
|
//#region methods & getters / clear message
|
|
440
|
-
|
|
394
|
+
clearMessage(message) {
|
|
441
395
|
return CommitData.cleanMessageFromJiraNumTeamIdEtc(message, {
|
|
442
396
|
teamID: this.teamID,
|
|
443
397
|
commitModuleName: this.commitModuleName,
|
|
444
398
|
jiraNumbers: this.jiraNumbers,
|
|
445
399
|
issuesFromOtherProjects: this.issuesFromOtherProjects,
|
|
446
400
|
});
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
return 'perf';
|
|
477
|
-
}
|
|
478
|
-
return this.typeOfCommit || 'feat';
|
|
479
|
-
//#endregion
|
|
480
|
-
},
|
|
481
|
-
enumerable: false,
|
|
482
|
-
configurable: true
|
|
483
|
-
});
|
|
484
|
-
Object.defineProperty(CommitData.prototype, "issuesFromOtherProjects", {
|
|
485
|
-
//#endregion
|
|
486
|
-
//#region methods & getters / issues from other projects
|
|
487
|
-
/**
|
|
488
|
-
* ex. taon/GH-12 darekf77/tnp-helpers/GH-4
|
|
489
|
-
*/
|
|
490
|
-
get: function () {
|
|
491
|
-
return this.__issuesFromOtherProjects;
|
|
492
|
-
},
|
|
493
|
-
set: function (value) {
|
|
494
|
-
this.__issuesFromOtherProjects = value;
|
|
495
|
-
// this.__issuesFromOtherProjects = value.map(issue => {
|
|
496
|
-
// console.log('MAPPING', issue);
|
|
497
|
-
// console.log('project', this.project?.name);
|
|
498
|
-
// if (issue.split('/').length === 1 && !!this.project) {
|
|
499
|
-
// console.log('issue', issue);
|
|
500
|
-
// const origin = Helpers.git.originSshToHttp(this.project.git.originURL);
|
|
501
|
-
// const provider = _.first(origin.replace('https://', '').split('/'));
|
|
502
|
-
// const cleanUserWithPath = origin
|
|
503
|
-
// .replace('https://', '')
|
|
504
|
-
// .replace(provider + '/', '')
|
|
505
|
-
// .replace(path.basename(origin).replace('.git', ''), '');
|
|
506
|
-
// const issueLastPart = _.last(issue.split('/'));
|
|
507
|
-
// return `tnp/${cleanUserWithPath}/${issueLastPart}`;
|
|
508
|
-
// }
|
|
509
|
-
// return issue;
|
|
510
|
-
// });
|
|
511
|
-
},
|
|
512
|
-
enumerable: false,
|
|
513
|
-
configurable: true
|
|
514
|
-
});
|
|
515
|
-
Object.defineProperty(CommitData.prototype, "commitMessage", {
|
|
401
|
+
}
|
|
402
|
+
//#endregion
|
|
403
|
+
//#region methods & getters / message
|
|
404
|
+
/**
|
|
405
|
+
* pure message what was done (without jira or prefixes)
|
|
406
|
+
* => is included in this.commitMessage
|
|
407
|
+
*/
|
|
408
|
+
get message() {
|
|
409
|
+
return this.clearMessage(this._message);
|
|
410
|
+
}
|
|
411
|
+
set message(message) {
|
|
412
|
+
this._message = this.clearMessage(message);
|
|
413
|
+
}
|
|
414
|
+
//#endregion
|
|
415
|
+
useFeatureBranchForTestBranch = false;
|
|
416
|
+
//#region methods & getters / branch prefix
|
|
417
|
+
get branchPrefix() {
|
|
418
|
+
//#region @backendFunc
|
|
419
|
+
const typeOfCommit = this.typeOfCommit;
|
|
420
|
+
if (typeOfCommit === 'feature') {
|
|
421
|
+
return 'feat';
|
|
422
|
+
}
|
|
423
|
+
else if (typeOfCommit === 'bugfix') {
|
|
424
|
+
return 'fix';
|
|
425
|
+
}
|
|
426
|
+
else if (typeOfCommit === 'performance') {
|
|
427
|
+
return 'perf';
|
|
428
|
+
}
|
|
429
|
+
return this.typeOfCommit || 'feat';
|
|
516
430
|
//#endregion
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
431
|
+
}
|
|
432
|
+
//#endregion
|
|
433
|
+
//#region methods & getters / issues from other projects
|
|
434
|
+
/**
|
|
435
|
+
* ex. taon/GH-12 darekf77/tnp-helpers/GH-4
|
|
436
|
+
*/
|
|
437
|
+
get issuesFromOtherProjects() {
|
|
438
|
+
return this.__issuesFromOtherProjects;
|
|
439
|
+
}
|
|
440
|
+
set issuesFromOtherProjects(value) {
|
|
441
|
+
this.__issuesFromOtherProjects = value;
|
|
442
|
+
// this.__issuesFromOtherProjects = value.map(issue => {
|
|
443
|
+
// console.log('MAPPING', issue);
|
|
444
|
+
// console.log('project', this.project?.name);
|
|
445
|
+
// if (issue.split('/').length === 1 && !!this.project) {
|
|
446
|
+
// console.log('issue', issue);
|
|
447
|
+
// const origin = Helpers.git.originSshToHttp(this.project.git.originURL);
|
|
448
|
+
// const provider = _.first(origin.replace('https://', '').split('/'));
|
|
449
|
+
// const cleanUserWithPath = origin
|
|
450
|
+
// .replace('https://', '')
|
|
451
|
+
// .replace(provider + '/', '')
|
|
452
|
+
// .replace(path.basename(origin).replace('.git', ''), '');
|
|
453
|
+
// const issueLastPart = _.last(issue.split('/'));
|
|
454
|
+
// return `tnp/${cleanUserWithPath}/${issueLastPart}`;
|
|
455
|
+
// }
|
|
456
|
+
// return issue;
|
|
457
|
+
// });
|
|
458
|
+
}
|
|
459
|
+
__issuesFromOtherProjects;
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region methods & getters / commit message git commit -m
|
|
462
|
+
get commitMessage() {
|
|
463
|
+
//#region @backendFunc
|
|
464
|
+
if (this.message === index_1.Helpers.git.ACTION_MSG_RESET_GIT_HARD_COMMIT) {
|
|
465
|
+
return this.message;
|
|
466
|
+
}
|
|
467
|
+
const otherIssues = this.issuesFromOtherProjects || [];
|
|
468
|
+
const jiraNumbers = (this.jiraNumbers || []).filter(f => !otherIssues.some(o => o.endsWith(f)));
|
|
469
|
+
// console.log({ jiraNumbers, otherIssues });
|
|
470
|
+
const jirasExists = jiraNumbers.length > 0 || otherIssues.length > 0;
|
|
471
|
+
let issuesFromOtherProjectsConnected = (jiraNumbers.length > 0 ? ',' : '') +
|
|
472
|
+
otherIssues
|
|
473
|
+
.map(otherIssue => {
|
|
474
|
+
const num = tnp_core_1._.last(otherIssue.split('-'));
|
|
475
|
+
let providerPrefix = tnp_core_1._.last(otherIssue.split('/')).replace(`-${num}`, '');
|
|
476
|
+
// console.log({ jira, num, providerPrefix });
|
|
477
|
+
return `${otherIssue.replace(`/${providerPrefix}-`, '#')}`;
|
|
478
|
+
})
|
|
479
|
+
.join(',');
|
|
480
|
+
if (issuesFromOtherProjectsConnected === ',') {
|
|
481
|
+
// QUICK_FIX
|
|
482
|
+
issuesFromOtherProjectsConnected = '';
|
|
483
|
+
}
|
|
484
|
+
const jiras = (jiraNumbers || []).map(d => {
|
|
485
|
+
if (
|
|
486
|
+
// open source providers
|
|
487
|
+
openSourceProvidersIssuePrefix
|
|
488
|
+
.map(c => `${c}-`)
|
|
489
|
+
.some(gh => d.startsWith(gh))) {
|
|
490
|
+
const [jira, num] = d.split('-');
|
|
491
|
+
return `#${num}`;
|
|
539
492
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
commitMsg = "".concat((this.message || '')
|
|
493
|
+
return d;
|
|
494
|
+
});
|
|
495
|
+
let commitMsg = '';
|
|
496
|
+
if (this.typeOfCommit === 'release') {
|
|
497
|
+
commitMsg = `${(this.message || '')
|
|
498
|
+
.split('\n')
|
|
499
|
+
.map(c => c.replace(/\-/g, ' '))
|
|
500
|
+
.join('\n-')
|
|
501
|
+
.trim()}`;
|
|
502
|
+
}
|
|
503
|
+
else {
|
|
504
|
+
if (this.teamID) {
|
|
505
|
+
commitMsg = `${jiras.join(' - ') + issuesFromOtherProjectsConnected} - ${(this.message || '')
|
|
554
506
|
.split('\n')
|
|
555
|
-
.map(
|
|
507
|
+
.map(c => c.replace(/\-/g, ' '))
|
|
556
508
|
.join('\n-')
|
|
557
|
-
.trim()
|
|
509
|
+
.trim()}`;
|
|
558
510
|
}
|
|
559
511
|
else {
|
|
560
|
-
if (this.
|
|
561
|
-
commitMsg =
|
|
562
|
-
.
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
512
|
+
if (this.commitModuleName) {
|
|
513
|
+
commitMsg =
|
|
514
|
+
`${this.branchPrefix}${'(' + this.commitModuleName + ')'}:` +
|
|
515
|
+
` ${(this.message || '')
|
|
516
|
+
.split('\n')
|
|
517
|
+
.map(c => c.replace(/\-/g, ' '))
|
|
518
|
+
.join('\n-')
|
|
519
|
+
.trim()} ` +
|
|
520
|
+
`${jirasExists
|
|
521
|
+
? [tnp_core_1._.first(jiras)].join(',') + issuesFromOtherProjectsConnected
|
|
522
|
+
: ''}`;
|
|
566
523
|
}
|
|
567
524
|
else {
|
|
568
|
-
if (this.
|
|
525
|
+
if (this.jiraIssuesAreOutsideBrackets) {
|
|
569
526
|
commitMsg =
|
|
570
|
-
|
|
571
|
-
|
|
527
|
+
`${this.branchPrefix}:` +
|
|
528
|
+
` ${(this.message || '')
|
|
572
529
|
.split('\n')
|
|
573
|
-
.map(
|
|
530
|
+
.map(c => c.replace(/\-/g, ' '))
|
|
574
531
|
.join('\n-')
|
|
575
|
-
.trim()
|
|
576
|
-
|
|
577
|
-
? [tnp_core_1._.first(jiras)].join(',') +
|
|
578
|
-
|
|
532
|
+
.trim()} ` +
|
|
533
|
+
`${jirasExists
|
|
534
|
+
? [tnp_core_1._.first(jiras)].join(',') +
|
|
535
|
+
issuesFromOtherProjectsConnected
|
|
536
|
+
: ''}`;
|
|
579
537
|
}
|
|
580
538
|
else {
|
|
581
539
|
commitMsg =
|
|
582
|
-
|
|
540
|
+
`${this.branchPrefix}${jirasExists
|
|
583
541
|
? '(' +
|
|
584
542
|
[tnp_core_1._.first(jiras)].join(',') +
|
|
585
543
|
issuesFromOtherProjectsConnected +
|
|
586
544
|
')'
|
|
587
|
-
: ''
|
|
588
|
-
|
|
545
|
+
: ''}:` +
|
|
546
|
+
` ${(this.message || '')
|
|
589
547
|
.split('\n')
|
|
590
|
-
.map(
|
|
548
|
+
.map(c => c.replace(/\-/g, ' '))
|
|
591
549
|
.join('\n-')
|
|
592
|
-
.trim()
|
|
550
|
+
.trim()}`;
|
|
593
551
|
}
|
|
594
552
|
}
|
|
595
553
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
},
|
|
599
|
-
enumerable: false,
|
|
600
|
-
configurable: true
|
|
601
|
-
});
|
|
602
|
-
Object.defineProperty(CommitData.prototype, "branchName", {
|
|
554
|
+
}
|
|
555
|
+
return commitMsg.replace(': :', ': ');
|
|
603
556
|
//#endregion
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
}
|
|
645
|
-
|
|
557
|
+
}
|
|
558
|
+
//#endregion
|
|
559
|
+
//#region methods & getters / branch name
|
|
560
|
+
get branchName() {
|
|
561
|
+
//#region @backendFunc
|
|
562
|
+
let typeOfCommit = this.typeOfCommit;
|
|
563
|
+
if (typeOfCommit === 'test' && this.useFeatureBranchForTestBranch) {
|
|
564
|
+
typeOfCommit = 'feature';
|
|
565
|
+
}
|
|
566
|
+
const teamId = this.teamID ? `${this.teamID}` : '';
|
|
567
|
+
const otherIssues = (typeOfCommit === 'release' ? [] : this.issuesFromOtherProjects) || [];
|
|
568
|
+
const jiraNumbers = ((typeOfCommit === 'release' ? [] : this.jiraNumbers) || []).filter(jiraNum => !otherIssues.some(otherIssue => otherIssue.endsWith(jiraNum)));
|
|
569
|
+
const jirasExists = jiraNumbers.length > 0;
|
|
570
|
+
const jiraNumbsConneted = [
|
|
571
|
+
...jiraNumbers.map(c => c.toUpperCase()).join('-'),
|
|
572
|
+
jirasExists ? '-' : '',
|
|
573
|
+
...otherIssues.map(c => `__${c.replace(/\//g, '_')}__`).join(''),
|
|
574
|
+
otherIssues ? '-' : '',
|
|
575
|
+
].join('');
|
|
576
|
+
let branchName = '';
|
|
577
|
+
if (teamId) {
|
|
578
|
+
branchName =
|
|
579
|
+
`${typeOfCommit || 'feature'}/${teamId}${jiraNumbsConneted}` +
|
|
580
|
+
`${tnp_core_1._.snakeCase(this.message)}`;
|
|
581
|
+
}
|
|
582
|
+
else if (this.commitModuleName) {
|
|
583
|
+
branchName =
|
|
584
|
+
`${typeOfCommit || 'feature'}/${jiraNumbsConneted}` +
|
|
585
|
+
`--${this.commitModuleName.replace(/\,/g, '_')}--${tnp_core_1._.kebabCase(this.message)}`;
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
branchName =
|
|
589
|
+
`${typeOfCommit || 'feature'}/${jiraNumbsConneted}` +
|
|
590
|
+
`${tnp_core_1._.kebabCase(this.message)}`;
|
|
591
|
+
}
|
|
592
|
+
return branchName
|
|
593
|
+
.replace(/\/\-/g, '/') // QUICK_FIX
|
|
594
|
+
.replace(/\_\_\-/g, '__') // QUICK_FIX
|
|
595
|
+
.replace(/\-\-\-\-/g, '--'); // QUICK_FIX
|
|
596
|
+
//#endregion
|
|
597
|
+
}
|
|
598
|
+
//#endregion
|
|
599
|
+
//#region methods & getters / is action commit
|
|
600
|
+
get isActionCommit() {
|
|
601
|
+
//#region @backendFunc
|
|
602
|
+
return this.message === index_1.Helpers.git.ACTION_MSG_RESET_GIT_HARD_COMMIT;
|
|
646
603
|
//#endregion
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
//#region @backendFunc
|
|
650
|
-
return this.message === index_1.Helpers.git.ACTION_MSG_RESET_GIT_HARD_COMMIT;
|
|
651
|
-
//#endregion
|
|
652
|
-
},
|
|
653
|
-
enumerable: false,
|
|
654
|
-
configurable: true
|
|
655
|
-
});
|
|
656
|
-
return CommitData;
|
|
657
|
-
}());
|
|
604
|
+
}
|
|
605
|
+
}
|
|
658
606
|
exports.CommitData = CommitData;
|
|
659
607
|
//# sourceMappingURL=commit-data.js.map
|