tnp-helpers 18.0.20 → 18.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
- package/browser/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
- package/browser/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
- package/browser/esm2022/lib/base/classes/base-cli-worker.mjs +10 -2
- package/browser/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
- package/browser/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
- package/browser/esm2022/lib/base/classes/base-git.mjs +229 -4
- package/browser/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
- package/browser/esm2022/lib/base/classes/base-library-build.mjs +11 -7
- package/browser/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
- package/browser/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
- package/browser/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -429
- package/browser/esm2022/lib/base/classes/base-package-json.mjs +340 -0
- package/browser/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
- package/browser/esm2022/lib/base/classes/base-project-resolver.mjs +2 -11
- package/browser/esm2022/lib/base/classes/base-project.mjs +76 -61
- package/browser/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
- package/browser/esm2022/lib/base/classes/base-release-process.mjs +44 -11
- package/browser/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
- package/browser/esm2022/lib/base/classes/base-vscode.mjs +29 -1
- package/browser/esm2022/lib/base/classes/index.mjs +5 -1
- package/browser/esm2022/lib/base/commit-data.mjs +19 -1
- package/browser/esm2022/lib/base/core-project.mjs +3 -3
- package/browser/esm2022/lib/base/linked-project.mjs +4 -4
- package/browser/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
- package/browser/esm2022/lib/base/translate.mjs +566 -0
- package/browser/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
- package/browser/esm2022/lib/helpers/helpers.mjs +12 -6
- package/browser/esm2022/lib/index.mjs +2 -1
- package/browser/esm2022/lib/models.mjs +173 -3
- package/browser/esm2022/lib/utils.mjs +402 -41
- package/browser/fesm2022/tnp-helpers.mjs +4619 -2888
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base/classes/base-bower-json.d.ts +35 -0
- package/browser/lib/base/classes/base-cli-worker.d.ts +1 -1
- package/browser/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
- package/browser/lib/base/classes/base-feature-for-project.d.ts +2 -1
- package/browser/lib/base/classes/base-git.d.ts +34 -5
- package/browser/lib/base/classes/base-json-file-reader.d.ts +72 -0
- package/browser/lib/base/classes/base-library-build.d.ts +5 -5
- package/browser/lib/base/classes/base-linked-projects.d.ts +1 -2
- package/browser/lib/base/classes/base-node-modules.d.ts +56 -0
- package/browser/lib/base/classes/base-npm-helpers.d.ts +29 -112
- package/browser/lib/base/classes/base-package-json.d.ts +107 -0
- package/browser/lib/base/classes/base-process-manager.d.ts +31 -0
- package/browser/lib/base/classes/base-project-resolver.d.ts +2 -2
- package/browser/lib/base/classes/base-project.d.ts +14 -16
- package/browser/lib/base/classes/base-quick-fixes.d.ts +3 -1
- package/browser/lib/base/classes/base-release-process.d.ts +8 -9
- package/browser/lib/base/classes/{base-github-pages.d.ts → base-static-pages.d.ts} +3 -3
- package/browser/lib/base/classes/base-vscode.d.ts +4 -0
- package/browser/lib/base/classes/index.d.ts +5 -1
- package/browser/lib/base/commit-data.d.ts +14 -1
- package/browser/lib/base/linked-project.d.ts +1 -1
- package/browser/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
- package/browser/lib/base/translate.d.ts +228 -0
- package/browser/lib/helpers/helpers-array-obj.d.ts +3 -0
- package/browser/lib/helpers/helpers.d.ts +12 -8
- package/browser/lib/models.d.ts +68 -2
- package/browser/lib/utils.d.ts +72 -13
- package/client/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
- package/client/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
- package/client/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
- package/client/esm2022/lib/base/classes/base-cli-worker.mjs +10 -2
- package/client/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
- package/client/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
- package/client/esm2022/lib/base/classes/base-git.mjs +229 -4
- package/client/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
- package/client/esm2022/lib/base/classes/base-library-build.mjs +11 -7
- package/client/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
- package/client/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
- package/client/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -429
- package/client/esm2022/lib/base/classes/base-package-json.mjs +340 -0
- package/client/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
- package/client/esm2022/lib/base/classes/base-project-resolver.mjs +2 -11
- package/client/esm2022/lib/base/classes/base-project.mjs +76 -61
- package/client/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
- package/client/esm2022/lib/base/classes/base-release-process.mjs +44 -11
- package/client/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
- package/client/esm2022/lib/base/classes/base-vscode.mjs +29 -1
- package/client/esm2022/lib/base/classes/index.mjs +5 -1
- package/client/esm2022/lib/base/commit-data.mjs +19 -1
- package/client/esm2022/lib/base/core-project.mjs +3 -3
- package/client/esm2022/lib/base/linked-project.mjs +4 -4
- package/client/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
- package/client/esm2022/lib/base/translate.mjs +566 -0
- package/client/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
- package/client/esm2022/lib/helpers/helpers.mjs +12 -6
- package/client/esm2022/lib/index.mjs +2 -1
- package/client/esm2022/lib/models.mjs +173 -3
- package/client/esm2022/lib/utils.mjs +402 -41
- package/client/fesm2022/tnp-helpers.mjs +4619 -2888
- package/client/fesm2022/tnp-helpers.mjs.map +1 -1
- package/client/lib/base/classes/base-bower-json.d.ts +35 -0
- package/client/lib/base/classes/base-cli-worker.d.ts +1 -1
- package/client/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
- package/client/lib/base/classes/base-feature-for-project.d.ts +2 -1
- package/client/lib/base/classes/base-git.d.ts +34 -5
- package/client/lib/base/classes/base-json-file-reader.d.ts +72 -0
- package/client/lib/base/classes/base-library-build.d.ts +5 -5
- package/client/lib/base/classes/base-linked-projects.d.ts +1 -2
- package/client/lib/base/classes/base-node-modules.d.ts +56 -0
- package/client/lib/base/classes/base-npm-helpers.d.ts +29 -112
- package/client/lib/base/classes/base-package-json.d.ts +107 -0
- package/client/lib/base/classes/base-process-manager.d.ts +31 -0
- package/client/lib/base/classes/base-project-resolver.d.ts +2 -2
- package/client/lib/base/classes/base-project.d.ts +14 -16
- package/client/lib/base/classes/base-quick-fixes.d.ts +3 -1
- package/client/lib/base/classes/base-release-process.d.ts +8 -9
- package/{websql/lib/base/classes/base-github-pages.d.ts → client/lib/base/classes/base-static-pages.d.ts} +3 -3
- package/client/lib/base/classes/base-vscode.d.ts +4 -0
- package/client/lib/base/classes/index.d.ts +5 -1
- package/client/lib/base/commit-data.d.ts +14 -1
- package/client/lib/base/linked-project.d.ts +1 -1
- package/client/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
- package/client/lib/base/translate.d.ts +228 -0
- package/client/lib/helpers/helpers-array-obj.d.ts +3 -0
- package/client/lib/helpers/helpers.d.ts +12 -8
- package/client/lib/models.d.ts +68 -2
- package/client/lib/utils.d.ts +72 -13
- package/index.js +15 -2
- package/index.js.map +1 -1
- package/lib/base/base-cli-worker-config.d.ts +27 -0
- package/lib/base/base-cli-worker-config.js +53 -0
- package/lib/base/base-cli-worker-config.js.map +1 -0
- package/lib/base/base-cli-worker-controller.d.ts +15 -0
- package/lib/base/base-cli-worker-controller.js +154 -0
- package/lib/base/base-cli-worker-controller.js.map +1 -0
- package/lib/base/base-cli-worker.d.ts +82 -0
- package/lib/base/base-cli-worker.js +654 -0
- package/lib/base/base-cli-worker.js.map +1 -0
- package/lib/base/base-command-line.backend.d.ts +174 -0
- package/lib/base/base-command-line.backend.js +2221 -0
- package/lib/base/base-command-line.backend.js.map +1 -0
- package/lib/base/base-compiler-for-project.d.ts +7 -0
- package/lib/base/base-compiler-for-project.js +62 -0
- package/lib/base/base-compiler-for-project.js.map +1 -0
- package/lib/base/base-db.d.ts +12 -0
- package/lib/base/base-db.js +74 -0
- package/lib/base/base-db.js.map +1 -0
- package/lib/base/base-debounce-compiler-for-project.d.ts +28 -0
- package/lib/base/base-debounce-compiler-for-project.js +82 -0
- package/lib/base/base-debounce-compiler-for-project.js.map +1 -0
- package/lib/base/base-detached-service.d.ts +6 -0
- package/lib/base/base-detached-service.js +16 -0
- package/lib/base/base-detached-service.js.map +1 -0
- package/lib/base/base-feature-for-project.d.ts +5 -0
- package/lib/base/base-feature-for-project.js +11 -0
- package/lib/base/base-feature-for-project.js.map +1 -0
- package/lib/base/base-git.d.ts +148 -0
- package/lib/base/base-git.js +1202 -0
- package/lib/base/base-git.js.map +1 -0
- package/{client/lib/base/classes → lib/base}/base-github-pages.d.ts +4 -5
- package/lib/base/base-github-pages.js +173 -0
- package/lib/base/base-github-pages.js.map +1 -0
- package/lib/base/base-ignore-hide.d.ts +14 -0
- package/lib/base/base-ignore-hide.js +55 -0
- package/lib/base/base-ignore-hide.js.map +1 -0
- package/lib/base/base-library-build.d.ts +65 -0
- package/lib/base/base-library-build.js +717 -0
- package/lib/base/base-library-build.js.map +1 -0
- package/lib/base/base-linked-projects.d.ts +24 -0
- package/lib/base/base-linked-projects.js +408 -0
- package/lib/base/base-linked-projects.js.map +1 -0
- package/lib/base/base-npm-helpers.d.ts +128 -0
- package/lib/base/base-npm-helpers.js +774 -0
- package/lib/base/base-npm-helpers.js.map +1 -0
- package/lib/base/base-project-resolver.d.ts +41 -0
- package/lib/base/base-project-resolver.js +308 -0
- package/lib/base/base-project-resolver.js.map +1 -0
- package/lib/base/base-project.d.ts +244 -0
- package/lib/base/base-project.js +1223 -0
- package/lib/base/base-project.js.map +1 -0
- package/lib/base/base-quick-fixes.d.ts +6 -0
- package/lib/base/base-quick-fixes.js +31 -0
- package/lib/base/base-quick-fixes.js.map +1 -0
- package/lib/base/base-release-process.d.ts +69 -0
- package/lib/base/base-release-process.js +913 -0
- package/lib/base/base-release-process.js.map +1 -0
- package/lib/base/base-start-config.backend.d.ts +36 -0
- package/lib/base/base-start-config.backend.js +167 -0
- package/lib/base/base-start-config.backend.js.map +1 -0
- package/lib/base/base-vscode.d.ts +12 -0
- package/lib/base/base-vscode.js +139 -0
- package/lib/base/base-vscode.js.map +1 -0
- package/lib/base/classes/base-bower-json.d.ts +34 -0
- package/lib/base/classes/base-bower-json.js +19 -0
- package/lib/base/classes/base-bower-json.js.map +1 -0
- package/lib/base/classes/base-cli-worker-config.js +35 -24
- package/lib/base/classes/base-cli-worker-config.js.map +1 -1
- package/lib/base/classes/base-cli-worker-controller.js +98 -128
- package/lib/base/classes/base-cli-worker-controller.js.map +1 -1
- package/lib/base/classes/base-cli-worker.d.ts +1 -1
- package/lib/base/classes/base-cli-worker.js +402 -610
- package/lib/base/classes/base-cli-worker.js.map +1 -1
- package/lib/base/classes/base-command-line-feature.backend.d.ts +5 -9
- package/lib/base/classes/base-command-line-feature.backend.js +73 -132
- package/lib/base/classes/base-command-line-feature.backend.js.map +1 -1
- package/lib/base/classes/base-command-line.backend.d.ts +175 -0
- package/lib/base/classes/base-command-line.backend.js +2235 -0
- package/lib/base/classes/base-command-line.backend.js.map +1 -0
- package/lib/base/classes/base-compiler-for-project.js +27 -32
- package/lib/base/classes/base-compiler-for-project.js.map +1 -1
- package/lib/base/classes/base-db.js +43 -60
- package/lib/base/classes/base-db.js.map +1 -1
- package/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
- package/lib/base/classes/base-debounce-compiler-for-project.js +44 -70
- package/lib/base/classes/base-debounce-compiler-for-project.js.map +1 -1
- package/lib/base/classes/base-detached-service.js.map +1 -1
- package/lib/base/classes/base-feature-for-project.d.ts +2 -1
- package/lib/base/classes/base-feature-for-project.js +7 -4
- package/lib/base/classes/base-feature-for-project.js.map +1 -1
- package/lib/base/classes/base-git.d.ts +32 -3
- package/lib/base/classes/base-git.js +885 -975
- package/lib/base/classes/base-git.js.map +1 -1
- package/lib/base/classes/base-github-pages.js.map +1 -1
- package/lib/base/classes/base-global-command-line.backend.d.ts +7 -2
- package/lib/base/classes/base-global-command-line.backend.js +1055 -2021
- package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
- package/lib/base/classes/base-ignore-hide.d.ts +2 -2
- package/lib/base/classes/base-ignore-hide.js +24 -28
- package/lib/base/classes/base-ignore-hide.js.map +1 -1
- package/lib/base/classes/base-json-file-reader.d.ts +71 -0
- package/lib/base/classes/base-json-file-reader.js +141 -0
- package/lib/base/classes/base-json-file-reader.js.map +1 -0
- package/lib/base/classes/base-library-build.d.ts +5 -6
- package/lib/base/classes/base-library-build.js +431 -653
- package/lib/base/classes/base-library-build.js.map +1 -1
- package/lib/base/classes/base-linked-projects.d.ts +1 -3
- package/lib/base/classes/base-linked-projects.js +200 -314
- package/lib/base/classes/base-linked-projects.js.map +1 -1
- package/lib/base/classes/base-node-modules.d.ts +55 -0
- package/lib/base/classes/base-node-modules.js +415 -0
- package/lib/base/classes/base-node-modules.js.map +1 -0
- package/lib/base/classes/base-npm-helpers.d.ts +29 -99
- package/lib/base/classes/base-npm-helpers.js +178 -737
- package/lib/base/classes/base-npm-helpers.js.map +1 -1
- package/lib/base/classes/base-package-json.d.ts +106 -0
- package/lib/base/classes/base-package-json.js +381 -0
- package/lib/base/classes/base-package-json.js.map +1 -0
- package/lib/base/classes/base-process-manager.d.ts +30 -0
- package/lib/base/classes/base-process-manager.js +269 -0
- package/lib/base/classes/base-process-manager.js.map +1 -0
- package/lib/base/classes/base-project-resolver.d.ts +2 -3
- package/lib/base/classes/base-project-resolver.js +102 -119
- package/lib/base/classes/base-project-resolver.js.map +1 -1
- package/lib/base/classes/base-project.d.ts +17 -15
- package/lib/base/classes/base-project.js +551 -733
- package/lib/base/classes/base-project.js.map +1 -1
- package/lib/base/classes/base-quick-fixes.d.ts +3 -1
- package/lib/base/classes/base-quick-fixes.js +45 -17
- package/lib/base/classes/base-quick-fixes.js.map +1 -1
- package/lib/base/classes/base-release-process.d.ts +8 -9
- package/lib/base/classes/base-release-process.js +482 -757
- package/lib/base/classes/base-release-process.js.map +1 -1
- package/lib/base/classes/base-start-config.backend.js +115 -99
- package/lib/base/classes/base-start-config.backend.js.map +1 -1
- package/lib/base/classes/base-static-pages.d.ts +14 -0
- package/lib/base/classes/base-static-pages.js +105 -0
- package/lib/base/classes/base-static-pages.js.map +1 -0
- package/lib/base/classes/base-vscode.d.ts +4 -0
- package/lib/base/classes/base-vscode.js +446 -426
- package/lib/base/classes/base-vscode.js.map +1 -1
- package/lib/base/classes/index copy.d.ts +22 -0
- package/lib/base/classes/index copy.js +28 -0
- package/lib/base/classes/index copy.js.map +1 -0
- package/lib/base/classes/index.d.ts +4 -0
- package/lib/base/classes/index.js +36 -19
- package/lib/base/classes/index.js.map +1 -1
- package/lib/base/command-line-feature.backend.d.ts +51 -0
- package/lib/base/command-line-feature.backend.js +206 -0
- package/lib/base/command-line-feature.backend.js.map +1 -0
- package/lib/base/commit-data.d.ts +14 -1
- package/lib/base/commit-data.js +408 -460
- package/lib/base/commit-data.js.map +1 -1
- package/lib/base/config-database.js +33 -61
- package/lib/base/config-database.js.map +1 -1
- package/lib/base/core-project.js +110 -146
- package/lib/base/core-project.js.map +1 -1
- package/lib/base/gh-temp-code.d.ts +1 -0
- package/lib/base/gh-temp-code.js +62 -104
- package/lib/base/gh-temp-code.js.map +1 -1
- package/lib/base/index-rebuilder.backend.d.ts +1 -0
- package/lib/base/index-rebuilder.backend.js.map +1 -1
- package/lib/base/index.js +20 -7
- package/lib/base/index.js.map +1 -1
- package/lib/base/linked-project.d.ts +1 -1
- package/lib/base/linked-project.js +59 -38
- package/lib/base/linked-project.js.map +1 -1
- package/lib/base/ports-worker.d.ts +32 -0
- package/lib/base/ports-worker.js +244 -0
- package/lib/base/ports-worker.js.map +1 -0
- package/lib/base/project-database.js +12 -22
- package/lib/base/project-database.js.map +1 -1
- package/lib/base/tcp-udp-ports/index.js +17 -4
- package/lib/base/tcp-udp-ports/index.js.map +1 -1
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.d.ts +1 -0
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.js.map +1 -1
- package/lib/base/tcp-udp-ports/port.entity.d.ts +0 -0
- package/lib/base/tcp-udp-ports/port.entity.js +5 -0
- package/lib/base/tcp-udp-ports/port.entity.js.map +1 -0
- package/lib/base/tcp-udp-ports/ports.controller.js +195 -283
- package/lib/base/tcp-udp-ports/ports.controller.js.map +1 -1
- package/lib/base/tcp-udp-ports/ports.entity.d.ts +2 -2
- package/lib/base/tcp-udp-ports/ports.entity.js +74 -62
- package/lib/base/tcp-udp-ports/ports.entity.js.map +1 -1
- package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js +11 -14
- package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js.map +1 -1
- package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js +244 -427
- package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js.map +1 -1
- package/lib/base/tcp-upd-ports.worker.d.ts +13 -0
- package/lib/base/tcp-upd-ports.worker.js +99 -0
- package/lib/base/tcp-upd-ports.worker.js.map +1 -0
- package/lib/base/translate.d.ts +1 -1
- package/lib/base/translate.js +90 -119
- package/lib/base/translate.js.map +1 -1
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/helpers/for-backend/helpers-cli-tool.backend.js +109 -115
- package/lib/helpers/for-backend/helpers-cli-tool.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-console-gui.js +55 -102
- package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
- package/lib/helpers/for-backend/helpers-dependencies.backend.js +28 -45
- package/lib/helpers/for-backend/helpers-dependencies.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-file-folders.backend.d.ts +2 -2
- package/lib/helpers/for-backend/helpers-file-folders.backend.js +277 -266
- package/lib/helpers/for-backend/helpers-file-folders.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-git.backend.d.ts +28 -3
- package/lib/helpers/for-backend/helpers-git.backend.js +804 -864
- package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-network.backend.js +15 -18
- package/lib/helpers/for-backend/helpers-network.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-npm.backend.js +5 -8
- package/lib/helpers/for-backend/helpers-npm.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-path.backend.js +18 -26
- package/lib/helpers/for-backend/helpers-path.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-process.backend.d.ts +2 -2
- package/lib/helpers/for-backend/helpers-process.backend.js +285 -363
- package/lib/helpers/for-backend/helpers-process.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-system-terminal.backend.js +25 -42
- package/lib/helpers/for-backend/helpers-system-terminal.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-vscode.backend.js +9 -12
- package/lib/helpers/for-backend/helpers-vscode.backend.js.map +1 -1
- package/lib/helpers/for-backend/ts-code/index.js +0 -2
- package/lib/helpers/for-backend/ts-code/index.js.map +1 -1
- package/lib/helpers/for-backend/ts-code/ts-code-extractor.d.ts +26 -0
- package/lib/helpers/for-backend/ts-code/ts-code-extractor.js +62 -0
- package/lib/helpers/for-backend/ts-code/ts-code-extractor.js.map +1 -0
- package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.d.ts +19 -0
- package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.js +81 -0
- package/lib/helpers/for-backend/ts-code/ts-code-modifier.backend.js.map +1 -0
- package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.js +2 -2
- package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.js.map +1 -1
- package/lib/helpers/for-browser/angular.helper.js +2 -2
- package/lib/helpers/for-browser/angular.helper.js.map +1 -1
- package/lib/helpers/for-browser/helpers-browser.js +27 -40
- package/lib/helpers/for-browser/helpers-browser.js.map +1 -1
- package/lib/helpers/helpers-array-obj.d.ts +3 -0
- package/lib/helpers/helpers-array-obj.js +49 -61
- package/lib/helpers/helpers-array-obj.js.map +1 -1
- package/lib/helpers/helpers-json5.backend.js +44 -55
- package/lib/helpers/helpers-json5.backend.js.map +1 -1
- package/lib/helpers/helpers-numbers.js +7 -10
- package/lib/helpers/helpers-numbers.js.map +1 -1
- package/lib/helpers/helpers-strings-regexes.js +40 -47
- package/lib/helpers/helpers-strings-regexes.js.map +1 -1
- package/lib/helpers/helpers-strings.js +38 -41
- package/lib/helpers/helpers-strings.js.map +1 -1
- package/lib/helpers/helpers.d.ts +12 -8
- package/lib/helpers/helpers.js +313 -393
- package/lib/helpers/helpers.js.map +1 -1
- package/lib/index._auto-generated_.d.ts +1 -0
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +21 -7
- package/lib/index.js.map +1 -1
- package/lib/lowdb/adapters/Memory.js +14 -20
- package/lib/lowdb/adapters/Memory.js.map +1 -1
- package/lib/lowdb/adapters/browser/LocalStorage.js +5 -8
- package/lib/lowdb/adapters/browser/LocalStorage.js.map +1 -1
- package/lib/lowdb/adapters/browser/SessionStorage.js +5 -8
- package/lib/lowdb/adapters/browser/SessionStorage.js.map +1 -1
- package/lib/lowdb/adapters/browser/WebStorage.js +10 -9
- package/lib/lowdb/adapters/browser/WebStorage.js.map +1 -1
- package/lib/lowdb/adapters/node/DataFile.js +29 -38
- package/lib/lowdb/adapters/node/DataFile.js.map +1 -1
- package/lib/lowdb/adapters/node/JSONFile.js +13 -18
- package/lib/lowdb/adapters/node/JSONFile.js.map +1 -1
- package/lib/lowdb/adapters/node/TextFile.js +36 -44
- package/lib/lowdb/adapters/node/TextFile.js.map +1 -1
- package/lib/lowdb/adapters/node/steno.js +72 -122
- package/lib/lowdb/adapters/node/steno.js.map +1 -1
- package/lib/lowdb/browser.js +17 -4
- package/lib/lowdb/browser.js.map +1 -1
- package/lib/lowdb/core/Low.js +30 -60
- package/lib/lowdb/core/Low.js.map +1 -1
- package/lib/lowdb/examples/browser.js.map +1 -1
- package/lib/lowdb/examples/cli.d.ts +1 -0
- package/lib/lowdb/examples/cli.js.map +1 -1
- package/lib/lowdb/examples/in-memory.d.ts +1 -0
- package/lib/lowdb/examples/in-memory.js.map +1 -1
- package/lib/lowdb/examples/server.d.ts +1 -0
- package/lib/lowdb/examples/server.js.map +1 -1
- package/lib/lowdb/index.js +16 -3
- package/lib/lowdb/index.js.map +1 -1
- package/lib/lowdb/node.js +18 -5
- package/lib/lowdb/node.js.map +1 -1
- package/lib/lowdb/presets/browser.js +7 -7
- package/lib/lowdb/presets/browser.js.map +1 -1
- package/lib/lowdb/presets/node.js +12 -23
- package/lib/lowdb/presets/node.js.map +1 -1
- package/lib/models.d.ts +68 -2
- package/lib/models.js +197 -3
- package/lib/models.js.map +1 -1
- package/lib/old/base-component.d.ts +1 -0
- package/lib/old/base-component.js +2 -2
- package/lib/old/base-component.js.map +1 -1
- package/lib/old/base-formly-component.d.ts +1 -0
- package/lib/old/base-formly-component.js +2 -2
- package/lib/old/base-formly-component.js.map +1 -1
- package/lib/old/condition-wait.d.ts +1 -0
- package/lib/old/condition-wait.js.map +1 -1
- package/lib/old/dual-component-ctrl.d.ts +1 -0
- package/lib/old/dual-component-ctrl.js +2 -2
- package/lib/old/dual-component-ctrl.js.map +1 -1
- package/lib/old/execute-command.d.ts +11 -0
- package/lib/old/execute-command.js +564 -0
- package/lib/old/execute-command.js.map +1 -0
- package/lib/old/helpers.d.ts +62 -0
- package/lib/old/helpers.js +279 -0
- package/lib/old/helpers.js.map +1 -0
- package/lib/old/models.d.ts +80 -0
- package/lib/old/models.js +57 -0
- package/lib/old/models.js.map +1 -0
- package/lib/utils.d.ts +72 -13
- package/lib/utils.js +502 -179
- package/lib/utils.js.map +1 -1
- package/lib/validators/validators-firedev.js +5 -5
- package/lib/validators/validators-firedev.js.map +1 -1
- package/lib/validators/validators-git.js +2 -2
- package/lib/validators/validators-git.js.map +1 -1
- package/lib/validators/validators-network.js +1 -1
- package/lib/validators/validators-network.js.map +1 -1
- package/lib/validators/validators.js +2 -2
- package/lib/validators/validators.js.map +1 -1
- package/migrations/1736198527297_init.js +39 -58
- package/migrations/1736198527297_init.js.map +1 -1
- package/migrations/1736199486472_addingNotAssignablePorts.js +42 -93
- package/migrations/1736199486472_addingNotAssignablePorts.js.map +1 -1
- package/migrations/1736454437350_addFreePorts.js +48 -100
- package/migrations/1736454437350_addFreePorts.js.map +1 -1
- package/migrations/index.js +15 -2
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.js +3 -3
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/package.json +14 -61
- package/src.d.ts +1 -1
- package/taon.jsonc +26 -41
- package/tmp-environment.json +8 -389
- package/websql/esm2022/lib/base/classes/base-bower-json.mjs +14 -0
- package/websql/esm2022/lib/base/classes/base-cli-worker-config.mjs +1 -4
- package/websql/esm2022/lib/base/classes/base-cli-worker-controller.mjs +1 -1
- package/websql/esm2022/lib/base/classes/base-cli-worker.mjs +10 -2
- package/websql/esm2022/lib/base/classes/base-debounce-compiler-for-project.mjs +5 -5
- package/websql/esm2022/lib/base/classes/base-feature-for-project.mjs +4 -1
- package/websql/esm2022/lib/base/classes/base-git.mjs +229 -4
- package/websql/esm2022/lib/base/classes/base-json-file-reader.mjs +114 -0
- package/websql/esm2022/lib/base/classes/base-library-build.mjs +11 -7
- package/websql/esm2022/lib/base/classes/base-linked-projects.mjs +8 -5
- package/websql/esm2022/lib/base/classes/base-node-modules.mjs +495 -0
- package/websql/esm2022/lib/base/classes/base-npm-helpers.mjs +32 -429
- package/websql/esm2022/lib/base/classes/base-package-json.mjs +340 -0
- package/websql/esm2022/lib/base/classes/base-process-manager.mjs +285 -0
- package/websql/esm2022/lib/base/classes/base-project-resolver.mjs +2 -10
- package/websql/esm2022/lib/base/classes/base-project.mjs +75 -61
- package/websql/esm2022/lib/base/classes/base-quick-fixes.mjs +44 -1
- package/websql/esm2022/lib/base/classes/base-release-process.mjs +44 -11
- package/websql/esm2022/lib/base/classes/{base-github-pages.mjs → base-static-pages.mjs} +6 -6
- package/websql/esm2022/lib/base/classes/base-vscode.mjs +29 -1
- package/websql/esm2022/lib/base/classes/index.mjs +5 -1
- package/websql/esm2022/lib/base/commit-data.mjs +19 -1
- package/websql/esm2022/lib/base/core-project.mjs +3 -3
- package/websql/esm2022/lib/base/linked-project.mjs +4 -4
- package/websql/esm2022/lib/base/tcp-udp-ports/tcp-udp-ports.context.mjs +2 -4
- package/websql/esm2022/lib/base/translate.mjs +566 -0
- package/websql/esm2022/lib/helpers/helpers-array-obj.mjs +5 -10
- package/websql/esm2022/lib/helpers/helpers.mjs +12 -6
- package/websql/esm2022/lib/index.mjs +2 -1
- package/websql/esm2022/lib/models.mjs +173 -3
- package/websql/esm2022/lib/utils.mjs +402 -41
- package/websql/fesm2022/tnp-helpers.mjs +4738 -3007
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base/classes/base-bower-json.d.ts +35 -0
- package/websql/lib/base/classes/base-cli-worker.d.ts +1 -1
- package/websql/lib/base/classes/base-debounce-compiler-for-project.d.ts +5 -5
- package/websql/lib/base/classes/base-feature-for-project.d.ts +2 -1
- package/websql/lib/base/classes/base-git.d.ts +34 -5
- package/websql/lib/base/classes/base-json-file-reader.d.ts +72 -0
- package/websql/lib/base/classes/base-library-build.d.ts +5 -5
- package/websql/lib/base/classes/base-linked-projects.d.ts +1 -2
- package/websql/lib/base/classes/base-node-modules.d.ts +56 -0
- package/websql/lib/base/classes/base-npm-helpers.d.ts +29 -110
- package/websql/lib/base/classes/base-package-json.d.ts +107 -0
- package/websql/lib/base/classes/base-process-manager.d.ts +31 -0
- package/websql/lib/base/classes/base-project-resolver.d.ts +2 -2
- package/websql/lib/base/classes/base-project.d.ts +14 -16
- package/websql/lib/base/classes/base-quick-fixes.d.ts +3 -1
- package/websql/lib/base/classes/base-release-process.d.ts +8 -9
- package/websql/lib/base/classes/base-static-pages.d.ts +15 -0
- package/websql/lib/base/classes/base-vscode.d.ts +4 -0
- package/websql/lib/base/classes/index.d.ts +5 -1
- package/websql/lib/base/commit-data.d.ts +14 -1
- package/websql/lib/base/linked-project.d.ts +1 -1
- package/websql/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
- package/websql/lib/base/translate.d.ts +228 -0
- package/websql/lib/helpers/helpers-array-obj.d.ts +3 -0
- package/websql/lib/helpers/helpers.d.ts +12 -8
- package/websql/lib/models.d.ts +68 -2
- package/websql/lib/utils.d.ts +72 -13
- package/browser/package.json +0 -25
- package/websql/package.json +0 -25
|
@@ -1,2253 +1,1287 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseGlobalCommandLine = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function BaseGlobalCommandLine() {
|
|
15
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
16
|
-
}
|
|
17
|
-
BaseGlobalCommandLine.prototype._ = function () {
|
|
4
|
+
const tnp_config_1 = require("tnp-config");
|
|
5
|
+
const tnp_config_2 = require("tnp-config");
|
|
6
|
+
const tnp_core_1 = require("tnp-core");
|
|
7
|
+
const tnp_core_2 = require("tnp-core");
|
|
8
|
+
const tnp_core_3 = require("tnp-core");
|
|
9
|
+
const index_1 = require("../../index");
|
|
10
|
+
const gh_temp_code_1 = require("../gh-temp-code");
|
|
11
|
+
const base_command_line_feature_backend_1 = require("./base-command-line-feature.backend");
|
|
12
|
+
class BaseGlobalCommandLine extends base_command_line_feature_backend_1.BaseCommandLineFeature {
|
|
13
|
+
_() {
|
|
18
14
|
index_1.Helpers.error('Please select git command');
|
|
19
|
-
}
|
|
15
|
+
}
|
|
20
16
|
//#region commands / prevent cwd is not project
|
|
21
17
|
/**
|
|
22
18
|
* TODO return argument not need for now
|
|
23
19
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
else {
|
|
48
|
-
index_1.Helpers.error("[".concat(tnp_config_2.config.frameworkName, "] This is not git root project folder"), true, true);
|
|
49
|
-
}
|
|
50
|
-
return [3 /*break*/, 3];
|
|
51
|
-
case 2:
|
|
52
|
-
index_1.Helpers.error("[".concat(tnp_config_2.config.frameworkName, "] This folder is not project folder"), false, true);
|
|
53
|
-
_a.label = 3;
|
|
54
|
-
case 3: return [2 /*return*/, true];
|
|
20
|
+
async cwdIsProject(options) {
|
|
21
|
+
const { requireProjectWithGitRoot } = options || {};
|
|
22
|
+
if (!!this.project && !requireProjectWithGitRoot) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
if (requireProjectWithGitRoot &&
|
|
26
|
+
(!this.project || !this.project.git.isGitRoot)) {
|
|
27
|
+
const proj = this.ins.nearestTo(this.cwd, { findGitRoot: true });
|
|
28
|
+
if (proj) {
|
|
29
|
+
index_1.Helpers.info(`
|
|
30
|
+
Current folder (${this.cwd})
|
|
31
|
+
is not a git root folder, but nearest project with
|
|
32
|
+
git root has been found in: ${tnp_core_1.chalk.bold(proj.genericName)}
|
|
33
|
+
|
|
34
|
+
`);
|
|
35
|
+
const useRoot = await index_1.Helpers.questionYesNo('Would you like to use this project ?');
|
|
36
|
+
if (useRoot) {
|
|
37
|
+
this.project = proj;
|
|
38
|
+
this.cwd = proj.location;
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
index_1.Helpers.error(`[${tnp_config_2.config.frameworkName}] This is not git root project folder`, true, true);
|
|
55
43
|
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
index_1.Helpers.error(`[${tnp_config_2.config.frameworkName}] This folder is not project folder`, false, true);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
59
51
|
//#endregion
|
|
60
52
|
//#region commands / hosts
|
|
61
|
-
|
|
62
|
-
index_1.Helpers.run(
|
|
53
|
+
hosts() {
|
|
54
|
+
index_1.Helpers.run(`code ${(0, tnp_core_2.crossPlatformPath)(tnp_config_1.HOST_FILE_PATH)}`).sync();
|
|
63
55
|
process.exit(0);
|
|
64
|
-
}
|
|
56
|
+
}
|
|
65
57
|
//#endregion
|
|
66
58
|
//#region commands / count commits
|
|
67
|
-
|
|
59
|
+
countCommits() {
|
|
68
60
|
console.log(index_1.Helpers.git.countCommits(this.cwd));
|
|
69
61
|
this._exit();
|
|
70
|
-
}
|
|
62
|
+
}
|
|
71
63
|
//#endregion
|
|
72
64
|
//#region commands / remove submodules
|
|
73
|
-
|
|
74
|
-
var e_1, _a;
|
|
65
|
+
removeSubmodules() {
|
|
75
66
|
index_1.Helpers.taskStarted('Removing submodules...');
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
try {
|
|
83
|
-
index_1.Helpers.run("git rm --cached ".concat(tnp_core_1.path.basename(folderAbsPath))).sync();
|
|
84
|
-
}
|
|
85
|
-
catch (error) { }
|
|
67
|
+
for (const folderAbsPath of index_1.Helpers.foldersFrom(this.cwd, {
|
|
68
|
+
recursive: false,
|
|
69
|
+
})) {
|
|
70
|
+
if (index_1.Helpers.exists((0, tnp_core_2.crossPlatformPath)([folderAbsPath, '.git']))) {
|
|
71
|
+
try {
|
|
72
|
+
index_1.Helpers.run(`git rm --cached ${tnp_core_1.path.basename(folderAbsPath)}`).sync();
|
|
86
73
|
}
|
|
74
|
+
catch (error) { }
|
|
87
75
|
}
|
|
88
76
|
}
|
|
89
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
90
|
-
finally {
|
|
91
|
-
try {
|
|
92
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
93
|
-
}
|
|
94
|
-
finally { if (e_1) throw e_1.error; }
|
|
95
|
-
}
|
|
96
77
|
index_1.Helpers.taskDone('Done');
|
|
97
78
|
this._exit();
|
|
98
|
-
}
|
|
79
|
+
}
|
|
99
80
|
//#endregion
|
|
100
81
|
//#region commands / set editor
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
case 0: return [4 /*yield*/, this.ins.configDb.selectCodeEditor()];
|
|
106
|
-
case 1:
|
|
107
|
-
_a.sent();
|
|
108
|
-
this._exit();
|
|
109
|
-
return [2 /*return*/];
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
};
|
|
82
|
+
async setEditor() {
|
|
83
|
+
await this.ins.configDb.selectCodeEditor();
|
|
84
|
+
this._exit();
|
|
85
|
+
}
|
|
114
86
|
//#endregion
|
|
115
87
|
//#region commands / quick git update
|
|
116
88
|
/**
|
|
117
89
|
* quick git update push
|
|
118
90
|
*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
catch (error) { }
|
|
133
|
-
return [4 /*yield*/, this.project.git.pushCurrentBranch({
|
|
134
|
-
askToRetry: true,
|
|
135
|
-
forcePushNoQuestion: true,
|
|
136
|
-
})];
|
|
137
|
-
case 2:
|
|
138
|
-
_a.sent();
|
|
139
|
-
index_1.Helpers.info('Done');
|
|
140
|
-
this._exit();
|
|
141
|
-
return [2 /*return*/];
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
BaseGlobalCommandLine.prototype.deepUp = function () {
|
|
147
|
-
return tslib_1.__awaiter(this, arguments, void 0, function (noExit) {
|
|
148
|
-
if (noExit === void 0) { noExit = false; }
|
|
149
|
-
return tslib_1.__generator(this, function (_a) {
|
|
150
|
-
switch (_a.label) {
|
|
151
|
-
case 0: return [4 /*yield*/, this.deepUpdate(noExit)];
|
|
152
|
-
case 1:
|
|
153
|
-
_a.sent();
|
|
154
|
-
return [2 /*return*/];
|
|
155
|
-
}
|
|
156
|
-
});
|
|
91
|
+
async update() {
|
|
92
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
index_1.Helpers.info('Updating & push project...');
|
|
96
|
+
try {
|
|
97
|
+
this.project.git.addAndCommit(`chore: ${!!this.firstArg ? this.firstArg : 'update'}`);
|
|
98
|
+
}
|
|
99
|
+
catch (error) { }
|
|
100
|
+
await this.project.git.pushCurrentBranch({
|
|
101
|
+
askToRetry: true,
|
|
102
|
+
forcePushNoQuestion: true,
|
|
157
103
|
});
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
try {
|
|
188
|
-
project.git.addAndCommit("chore: ".concat(!!this.firstArg ? this.args.join(' ') : 'update'));
|
|
189
|
-
}
|
|
190
|
-
catch (error) { }
|
|
191
|
-
return [4 /*yield*/, project.git.pushCurrentBranch({
|
|
192
|
-
askToRetry: true,
|
|
193
|
-
forcePushNoQuestion: true,
|
|
194
|
-
})];
|
|
195
|
-
case 4:
|
|
196
|
-
_d.sent();
|
|
197
|
-
if (!!project.isMonorepo) return [3 /*break*/, 12];
|
|
198
|
-
_d.label = 5;
|
|
199
|
-
case 5:
|
|
200
|
-
_d.trys.push([5, 10, 11, 12]);
|
|
201
|
-
_a = tslib_1.__values(project.children), _b = _a.next();
|
|
202
|
-
_d.label = 6;
|
|
203
|
-
case 6:
|
|
204
|
-
if (!!_b.done) return [3 /*break*/, 9];
|
|
205
|
-
child = _b.value;
|
|
206
|
-
if (!child.git.isGitRoot) return [3 /*break*/, 8];
|
|
207
|
-
return [4 /*yield*/, updateProject(child)];
|
|
208
|
-
case 7:
|
|
209
|
-
_d.sent();
|
|
210
|
-
_d.label = 8;
|
|
211
|
-
case 8:
|
|
212
|
-
_b = _a.next();
|
|
213
|
-
return [3 /*break*/, 6];
|
|
214
|
-
case 9: return [3 /*break*/, 12];
|
|
215
|
-
case 10:
|
|
216
|
-
e_2_1 = _d.sent();
|
|
217
|
-
e_2 = { error: e_2_1 };
|
|
218
|
-
return [3 /*break*/, 12];
|
|
219
|
-
case 11:
|
|
220
|
-
try {
|
|
221
|
-
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
222
|
-
}
|
|
223
|
-
finally { if (e_2) throw e_2.error; }
|
|
224
|
-
return [7 /*endfinally*/];
|
|
225
|
-
case 12: return [2 /*return*/];
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
}); };
|
|
229
|
-
return [4 /*yield*/, updateProject(this.project)];
|
|
230
|
-
case 2:
|
|
231
|
-
_a.sent();
|
|
232
|
-
index_1.Helpers.info('Done');
|
|
233
|
-
this._exit();
|
|
234
|
-
return [2 /*return*/];
|
|
104
|
+
index_1.Helpers.info('Done');
|
|
105
|
+
this._exit();
|
|
106
|
+
}
|
|
107
|
+
async deepUp(noExit = false) {
|
|
108
|
+
await this.deepUpdate(noExit);
|
|
109
|
+
}
|
|
110
|
+
async deepUpdate(noExit = false) {
|
|
111
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
index_1.Helpers.info('Deep updating & pushing project with children...');
|
|
115
|
+
const updateProject = async (project) => {
|
|
116
|
+
try {
|
|
117
|
+
await project.packageJson.bumpPatchVersion();
|
|
118
|
+
}
|
|
119
|
+
catch (error) { }
|
|
120
|
+
try {
|
|
121
|
+
project.git.addAndCommit(`chore: ${!!this.firstArg ? this.args.join(' ') : 'update'}`);
|
|
122
|
+
}
|
|
123
|
+
catch (error) { }
|
|
124
|
+
await project.git.pushCurrentBranch({
|
|
125
|
+
askToRetry: true,
|
|
126
|
+
forcePushNoQuestion: true,
|
|
127
|
+
});
|
|
128
|
+
if (!project.isMonorepo) {
|
|
129
|
+
for (const child of project.children) {
|
|
130
|
+
if (child.git.isGitRoot) {
|
|
131
|
+
await updateProject(child);
|
|
132
|
+
}
|
|
235
133
|
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
await updateProject(this.project);
|
|
137
|
+
index_1.Helpers.info('Done');
|
|
138
|
+
this._exit();
|
|
139
|
+
}
|
|
239
140
|
/**
|
|
240
141
|
* Push update
|
|
241
142
|
*/
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
switch (_a.label) {
|
|
246
|
-
case 0: return [4 /*yield*/, this.update()];
|
|
247
|
-
case 1:
|
|
248
|
-
_a.sent();
|
|
249
|
-
return [2 /*return*/];
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
};
|
|
143
|
+
async up() {
|
|
144
|
+
await this.update();
|
|
145
|
+
}
|
|
254
146
|
/**
|
|
255
147
|
* Push update
|
|
256
148
|
*/
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
switch (_a.label) {
|
|
261
|
-
case 0: return [4 /*yield*/, this.update()];
|
|
262
|
-
case 1:
|
|
263
|
-
_a.sent();
|
|
264
|
-
return [2 /*return*/];
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
};
|
|
149
|
+
async pu() {
|
|
150
|
+
await this.update();
|
|
151
|
+
}
|
|
269
152
|
//#endregion
|
|
270
153
|
//#region commands / develop
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
case 2:
|
|
340
|
-
_a.sent();
|
|
341
|
-
return [3 /*break*/, 7];
|
|
342
|
-
case 3:
|
|
343
|
-
if (!(results.length === 0)) return [3 /*break*/, 4];
|
|
344
|
-
index_1.Helpers.error("No project found by name: \"".concat(this.args.join(' '), "\""), false, true);
|
|
345
|
-
return [3 /*break*/, 7];
|
|
346
|
-
case 4:
|
|
347
|
-
index_1.Helpers.info("Opening console gui to select project...");
|
|
348
|
-
return [4 /*yield*/, index_1.Helpers.consoleGui.select('Select project to open', results.map(function (p) {
|
|
349
|
-
return {
|
|
350
|
-
name: p.genericName,
|
|
351
|
-
value: p.location,
|
|
352
|
-
};
|
|
353
|
-
}), true)];
|
|
354
|
-
case 5:
|
|
355
|
-
res = _a.sent();
|
|
356
|
-
return [4 /*yield*/, openInEditor(this.ins.From(res))];
|
|
357
|
-
case 6:
|
|
358
|
-
_a.sent();
|
|
359
|
-
_a.label = 7;
|
|
360
|
-
case 7:
|
|
361
|
-
this._exit();
|
|
362
|
-
return [2 /*return*/];
|
|
363
|
-
}
|
|
364
|
-
});
|
|
365
|
-
});
|
|
366
|
-
};
|
|
367
|
-
BaseGlobalCommandLine.prototype.dev = function () {
|
|
368
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
369
|
-
return tslib_1.__generator(this, function (_a) {
|
|
370
|
-
switch (_a.label) {
|
|
371
|
-
case 0: return [4 /*yield*/, this.develop()];
|
|
372
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
});
|
|
376
|
-
};
|
|
154
|
+
async develop() {
|
|
155
|
+
// Helpers.clearConsole();
|
|
156
|
+
index_1.Helpers.taskStarted(`getting all projects...`);
|
|
157
|
+
const founded = ((await this.ins.projectsDb.getAllProjectsFromDB()) || [])
|
|
158
|
+
.filter(p => index_1.Helpers.exists(p.location))
|
|
159
|
+
.map(p => {
|
|
160
|
+
const proj = this.ins.From(p.location);
|
|
161
|
+
// console.log(`Proj for ${p.location} `, !!proj)
|
|
162
|
+
if (proj) {
|
|
163
|
+
return proj;
|
|
164
|
+
// return proj.embeddedProject ? proj.embeddedProject : proj;
|
|
165
|
+
}
|
|
166
|
+
// const nereset = this.ins.nearestTo(p.location);
|
|
167
|
+
// if (nereset) {
|
|
168
|
+
// const embeded = nereset.linkedProjects.find(l => crossPlatformPath([nereset.location, l.relativeClonePath]) === p.location);
|
|
169
|
+
// if (embeded) {
|
|
170
|
+
// return this.ins.From([nereset.location, embeded.relativeClonePath]);
|
|
171
|
+
// }
|
|
172
|
+
// }
|
|
173
|
+
})
|
|
174
|
+
.filter(p => !!p);
|
|
175
|
+
index_1.Helpers.taskDone(`found ${founded.length} projects...`);
|
|
176
|
+
index_1.Helpers.taskStarted(`searching for project...`);
|
|
177
|
+
// @ts-ignore
|
|
178
|
+
const results = index_1.Helpers.uniqArray([
|
|
179
|
+
...index_1.Helpers.arrays.fuzzy(this.args.join(' '), founded, p => p.name)
|
|
180
|
+
.results,
|
|
181
|
+
...index_1.Helpers.arrays.fuzzy(this.args.join(' '), founded, p => p.basename)
|
|
182
|
+
.results,
|
|
183
|
+
...index_1.Helpers.arrays.fuzzy(this.args.join(' '), founded, p => p.location)
|
|
184
|
+
.results,
|
|
185
|
+
], 'location');
|
|
186
|
+
index_1.Helpers.taskDone(`found ${results.length} projects...`);
|
|
187
|
+
const openInEditor = async (proj) => {
|
|
188
|
+
index_1.Helpers.taskStarted(`Getting code editor info...`);
|
|
189
|
+
const editor = await this.ins.configDb.getCodeEditor();
|
|
190
|
+
index_1.Helpers.taskDone(`Got code editor info...`);
|
|
191
|
+
const embededProject = proj.linkedProjects.embeddedProject;
|
|
192
|
+
const porjToOpen = embededProject || proj;
|
|
193
|
+
const locaitonFolderToOpen = porjToOpen.location;
|
|
194
|
+
index_1.Helpers.info('Initing and opening project...');
|
|
195
|
+
try {
|
|
196
|
+
await porjToOpen?.struct();
|
|
197
|
+
}
|
|
198
|
+
catch (error) { }
|
|
199
|
+
index_1.Helpers.run(`${editor} ${locaitonFolderToOpen}`).sync();
|
|
200
|
+
};
|
|
201
|
+
if (results.length === 1) {
|
|
202
|
+
await openInEditor(tnp_core_1._.first(results));
|
|
203
|
+
}
|
|
204
|
+
else if (results.length === 0) {
|
|
205
|
+
index_1.Helpers.error(`No project found by name: "${this.args.join(' ')}"`, false, true);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
index_1.Helpers.info(`Opening console gui to select project...`);
|
|
209
|
+
const res = await index_1.Helpers.consoleGui.select('Select project to open', results.map(p => {
|
|
210
|
+
return {
|
|
211
|
+
name: p.genericName,
|
|
212
|
+
value: p.location,
|
|
213
|
+
};
|
|
214
|
+
}), true);
|
|
215
|
+
await openInEditor(this.ins.From(res));
|
|
216
|
+
}
|
|
217
|
+
this._exit();
|
|
218
|
+
}
|
|
219
|
+
async dev() {
|
|
220
|
+
return await this.develop();
|
|
221
|
+
}
|
|
377
222
|
//#endregion
|
|
378
223
|
//#region commands / repulll
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
});
|
|
390
|
-
};
|
|
391
|
-
BaseGlobalCommandLine.prototype.repull = function () {
|
|
392
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
393
|
-
return tslib_1.__generator(this, function (_a) {
|
|
394
|
-
switch (_a.label) {
|
|
395
|
-
case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
|
|
396
|
-
case 1:
|
|
397
|
-
if (!(_a.sent())) {
|
|
398
|
-
return [2 /*return*/];
|
|
399
|
-
}
|
|
400
|
-
return [4 /*yield*/, this.project.git.resetHard({ HEAD: 10 })];
|
|
401
|
-
case 2:
|
|
402
|
-
_a.sent();
|
|
403
|
-
return [4 /*yield*/, this.pull()];
|
|
404
|
-
case 3:
|
|
405
|
-
_a.sent();
|
|
406
|
-
return [2 /*return*/];
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
});
|
|
410
|
-
};
|
|
224
|
+
async repul() {
|
|
225
|
+
await this.repull();
|
|
226
|
+
}
|
|
227
|
+
async repull() {
|
|
228
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
await this.project.git.resetHard({ HEAD: 10 });
|
|
232
|
+
await this.pull();
|
|
233
|
+
}
|
|
411
234
|
//#endregion
|
|
412
235
|
//#region commands / pull
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
return
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
if (!(_a.sent())) {
|
|
420
|
-
return [2 /*return*/];
|
|
421
|
-
}
|
|
422
|
-
return [4 /*yield*/, this.project.git.pullProcess({
|
|
423
|
-
setOrigin: this.params['setOrigin'],
|
|
424
|
-
})];
|
|
425
|
-
case 2:
|
|
426
|
-
_a.sent();
|
|
427
|
-
this._exit();
|
|
428
|
-
return [2 /*return*/];
|
|
429
|
-
}
|
|
430
|
-
});
|
|
236
|
+
async pull() {
|
|
237
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
await this.project.git.pullProcess({
|
|
241
|
+
setOrigin: this.params['setOrigin'],
|
|
431
242
|
});
|
|
432
|
-
|
|
243
|
+
this._exit();
|
|
244
|
+
}
|
|
433
245
|
//#endregion
|
|
434
246
|
//#region commands / pull all
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
return
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
return [2 /*return*/];
|
|
443
|
-
}
|
|
444
|
-
return [4 /*yield*/, this.project.git.pullProcess({
|
|
445
|
-
cloneChildren: true,
|
|
446
|
-
setOrigin: this.params['setOrigin'],
|
|
447
|
-
})];
|
|
448
|
-
case 2:
|
|
449
|
-
_a.sent();
|
|
450
|
-
this._exit();
|
|
451
|
-
return [2 /*return*/];
|
|
452
|
-
}
|
|
453
|
-
});
|
|
247
|
+
async pullAll() {
|
|
248
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
await this.project.git.pullProcess({
|
|
252
|
+
cloneChildren: true,
|
|
253
|
+
setOrigin: this.params['setOrigin'],
|
|
454
254
|
});
|
|
455
|
-
|
|
255
|
+
this._exit();
|
|
256
|
+
}
|
|
456
257
|
//#endregion
|
|
457
258
|
//#region commands / push and pull
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
console.log('Done push and pull');
|
|
467
|
-
this._exit();
|
|
468
|
-
return [2 /*return*/];
|
|
469
|
-
});
|
|
470
|
-
});
|
|
471
|
-
};
|
|
259
|
+
async pp() {
|
|
260
|
+
const currentBranch = this.project.git.currentBranchName;
|
|
261
|
+
this.project
|
|
262
|
+
.run(`git push origin ${currentBranch} && git pull origin ${currentBranch}`)
|
|
263
|
+
.sync();
|
|
264
|
+
console.log('Done push and pull');
|
|
265
|
+
this._exit();
|
|
266
|
+
}
|
|
472
267
|
//#endregion
|
|
473
268
|
//#region commands / reset
|
|
474
|
-
|
|
475
|
-
index_1.Helpers.info(
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
case 9:
|
|
558
|
-
_f.sent();
|
|
559
|
-
_f.label = 10;
|
|
560
|
-
case 10:
|
|
561
|
-
this._exit();
|
|
562
|
-
return [2 /*return*/];
|
|
563
|
-
}
|
|
564
|
-
});
|
|
565
|
-
});
|
|
566
|
-
};
|
|
269
|
+
__resetInfo(branchToReset, withChildren) {
|
|
270
|
+
index_1.Helpers.info(`
|
|
271
|
+
|
|
272
|
+
YOU ARE RESETING ${withChildren ? 'EVERYTHING' : 'PROJECT'} ` +
|
|
273
|
+
`TO BRANCH: ${tnp_core_1.chalk.bold(branchToReset)}
|
|
274
|
+
|
|
275
|
+
- curret project (${this.project.name})
|
|
276
|
+
${withChildren &&
|
|
277
|
+
tnp_core_1._.isArray(this.project.children) &&
|
|
278
|
+
this.project.children.length > 0
|
|
279
|
+
? `- modules:\n${this.project.children
|
|
280
|
+
.map(c => `\t${c.basename} (${tnp_core_1.chalk.yellow(c.name)})`)
|
|
281
|
+
.join('\n')}`
|
|
282
|
+
: ''}
|
|
283
|
+
`);
|
|
284
|
+
}
|
|
285
|
+
async fetch() {
|
|
286
|
+
try {
|
|
287
|
+
this.project?.git?.fetch();
|
|
288
|
+
}
|
|
289
|
+
catch (error) { }
|
|
290
|
+
this._exit();
|
|
291
|
+
}
|
|
292
|
+
async reset() {
|
|
293
|
+
// Helpers.clearConsole();
|
|
294
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const parent = this.project.parent;
|
|
298
|
+
const branchFromLinkedProjectConfig = parent?.linkedProjects?.linkedProjects.find(l => {
|
|
299
|
+
return ((0, tnp_core_2.crossPlatformPath)([parent.location, l.relativeClonePath]) ===
|
|
300
|
+
this.project.location);
|
|
301
|
+
})?.defaultBranch;
|
|
302
|
+
let overrideBranchToReset = this.firstArg ||
|
|
303
|
+
branchFromLinkedProjectConfig ||
|
|
304
|
+
this.project.core?.branch ||
|
|
305
|
+
this.project.git.getDefaultDevelopmentBranch() ||
|
|
306
|
+
this.project.git.currentBranchName;
|
|
307
|
+
if (this.project.core?.branch) {
|
|
308
|
+
index_1.Helpers.info(`
|
|
309
|
+
|
|
310
|
+
Core branch for project: ${this.project.core?.branch}
|
|
311
|
+
|
|
312
|
+
`);
|
|
313
|
+
}
|
|
314
|
+
const resetOnlyChildren = !!this.project.linkedProjects.getLinkedProjectsConfig().resetOnlyChildren;
|
|
315
|
+
const branches = index_1.Helpers.uniqArray([
|
|
316
|
+
...this.__filterBranchesByPattern(overrideBranchToReset),
|
|
317
|
+
...this.__filterBranchesByPattern(''),
|
|
318
|
+
]);
|
|
319
|
+
const resetChildren = this.project.git.resetIsRestingAlsoChildren();
|
|
320
|
+
if (resetChildren && resetOnlyChildren) {
|
|
321
|
+
index_1.Helpers.info(`Reseting only children...for defualt branches.`);
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
if (branches.length > 0) {
|
|
325
|
+
overrideBranchToReset = await this.__selectBrach(branches, 'reset');
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
index_1.Helpers.error(`No branch found by name "${overrideBranchToReset || this.firstArg}"`, false, true);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
overrideBranchToReset = overrideBranchToReset || '';
|
|
332
|
+
this.__resetInfo(overrideBranchToReset
|
|
333
|
+
? overrideBranchToReset
|
|
334
|
+
: this.project.git.getDefaultDevelopmentBranch(), resetChildren);
|
|
335
|
+
let resetProject = this.project;
|
|
336
|
+
if (this.project.git.isInsideGitRepo && !this.project.git.isGitRoot) {
|
|
337
|
+
index_1.Helpers.warn(`You are not in root of git repo...`, false);
|
|
338
|
+
resetProject = this.ins.nearestTo((0, tnp_core_2.crossPlatformPath)([this.project.location, '..']), {
|
|
339
|
+
findGitRoot: true,
|
|
340
|
+
});
|
|
341
|
+
if (!(await index_1.Helpers.questionYesNo(`Would you like to reset root repo instead (project=${tnp_core_1.chalk.bold.red(resetProject.genericName)}) ?`))) {
|
|
342
|
+
index_1.Helpers.error(`Aborted`, false, true);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
const res = await index_1.Helpers.questionYesNo(`Reset hard and pull current project ` +
|
|
346
|
+
`${resetChildren && resetProject.linkedProjects.linkedProjects.length > 0 ? '(and children)' : ''} ?`);
|
|
347
|
+
if (res) {
|
|
348
|
+
await resetProject.resetProcess(overrideBranchToReset);
|
|
349
|
+
}
|
|
350
|
+
this._exit();
|
|
351
|
+
}
|
|
567
352
|
//#endregion
|
|
568
353
|
//#region commands / soft
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
}
|
|
579
|
-
this.project.git.resetSoftHEAD(1);
|
|
580
|
-
this._exit();
|
|
581
|
-
return [2 /*return*/];
|
|
582
|
-
}
|
|
583
|
-
});
|
|
354
|
+
async soft() {
|
|
355
|
+
// TODO when aciton commit
|
|
356
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
const howManyCommits = Number(this.firstArg) || 1;
|
|
360
|
+
tnp_core_1._.times(howManyCommits, n => {
|
|
361
|
+
console.log(`Resetting soft ${n + 1} commit "${this.project.git.lastCommitMessage()}"`);
|
|
362
|
+
this.project.git.resetSoftHEAD(1);
|
|
584
363
|
});
|
|
585
|
-
|
|
364
|
+
this._exit();
|
|
365
|
+
}
|
|
586
366
|
//#endregion
|
|
587
367
|
//#region commands / rebase
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
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
|
-
|
|
368
|
+
async rebase() {
|
|
369
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
const currentBranch = this.project.git.currentBranchName;
|
|
373
|
+
let safeReset = 10;
|
|
374
|
+
let rebaseBranch = this.firstArg || this.project.git.getDefaultDevelopmentBranch();
|
|
375
|
+
const branches = this.__filterBranchesByPattern(rebaseBranch);
|
|
376
|
+
if (branches.length > 1) {
|
|
377
|
+
rebaseBranch = await this.__selectBrach(branches, 'rebase');
|
|
378
|
+
}
|
|
379
|
+
else if (branches.length === 1) {
|
|
380
|
+
rebaseBranch = tnp_core_1._.first(branches);
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
index_1.Helpers.error(`No rebase branch found by name "${rebaseBranch}"`, false, true);
|
|
384
|
+
}
|
|
385
|
+
index_1.Helpers.info(`
|
|
386
|
+
You are rebasing current branch (${currentBranch}) to ${rebaseBranch}
|
|
387
|
+
|
|
388
|
+
Files from last commit:
|
|
389
|
+
|
|
390
|
+
"${tnp_core_1.chalk.gray(await this.project.git.getCommitMessageByHash(this.project.git.lastCommitHash()))}"
|
|
391
|
+
(hash: ${tnp_core_1.chalk.gray(this.project.git.lastCommitHash())})
|
|
392
|
+
|
|
393
|
+
are going to be applied after rebase.
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
`);
|
|
397
|
+
if (!(await tnp_core_3.UtilsTerminal.confirm({
|
|
398
|
+
message: `Do you want to continue ?`,
|
|
399
|
+
defaultValue: true,
|
|
400
|
+
}))) {
|
|
401
|
+
this._exit();
|
|
402
|
+
}
|
|
403
|
+
try {
|
|
404
|
+
this.project.git.resetHard();
|
|
405
|
+
this.project.git.checkout(rebaseBranch);
|
|
406
|
+
this.project.git.resetHard({ HEAD: safeReset });
|
|
407
|
+
await this.project.git.pullCurrentBranch();
|
|
408
|
+
this.project.git.checkout(currentBranch);
|
|
409
|
+
this.project.git.resetSoftHEAD(1);
|
|
410
|
+
this.project.git.stageAllFiles();
|
|
411
|
+
this.project.git.stash();
|
|
412
|
+
this.project.git.resetHard({ HEAD: safeReset });
|
|
413
|
+
this.project.git.rebase(rebaseBranch);
|
|
414
|
+
this.project.git.stashApply();
|
|
415
|
+
await this.project.init();
|
|
416
|
+
index_1.Helpers.info('REBASE DONE');
|
|
417
|
+
}
|
|
418
|
+
catch (error) {
|
|
419
|
+
index_1.Helpers.renderError(error);
|
|
420
|
+
try {
|
|
421
|
+
// dummy init to get back to previous vscode settings
|
|
422
|
+
await this.project.init();
|
|
423
|
+
}
|
|
424
|
+
catch (error) { }
|
|
425
|
+
index_1.Helpers.error('Not able to rebase', true, true);
|
|
426
|
+
}
|
|
427
|
+
this._exit();
|
|
428
|
+
}
|
|
635
429
|
//#endregion
|
|
636
430
|
//#region commands / stash
|
|
637
431
|
/**
|
|
638
432
|
* stash only staged files
|
|
639
433
|
*/
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
if (!(_a.sent())) {
|
|
649
|
-
return [2 /*return*/];
|
|
650
|
-
}
|
|
651
|
-
this.project.git.stash({ onlyStaged: true });
|
|
652
|
-
this._exit();
|
|
653
|
-
return [2 /*return*/];
|
|
654
|
-
}
|
|
655
|
-
});
|
|
656
|
-
});
|
|
657
|
-
};
|
|
434
|
+
async stash() {
|
|
435
|
+
index_1.Helpers.info(`Stashing only staged files...`);
|
|
436
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
this.project.git.stash({ onlyStaged: true });
|
|
440
|
+
this._exit();
|
|
441
|
+
}
|
|
658
442
|
//#endregion
|
|
659
443
|
//#region commands / stash all
|
|
660
444
|
/**
|
|
661
445
|
* stash all files
|
|
662
446
|
*/
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
return
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
this.project.git.stageAllFiles();
|
|
673
|
-
this.project.git.stash({ onlyStaged: false });
|
|
674
|
-
this._exit();
|
|
675
|
-
return [2 /*return*/];
|
|
676
|
-
}
|
|
677
|
-
});
|
|
678
|
-
});
|
|
679
|
-
};
|
|
447
|
+
async stashAll() {
|
|
448
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
this.project.git.stageAllFiles();
|
|
452
|
+
this.project.git.stash();
|
|
453
|
+
this._exit();
|
|
454
|
+
}
|
|
680
455
|
//#endregion
|
|
681
456
|
//#region commands / push all origins
|
|
682
457
|
/**
|
|
683
458
|
* push force to all orgins
|
|
684
459
|
*/
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
return
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
});
|
|
701
|
-
};
|
|
702
|
-
BaseGlobalCommandLine.prototype.pAllForce = function () {
|
|
703
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
704
|
-
return tslib_1.__generator(this, function (_a) {
|
|
705
|
-
switch (_a.label) {
|
|
706
|
-
case 0: return [4 /*yield*/, this.pushAllForce()];
|
|
707
|
-
case 1:
|
|
708
|
-
_a.sent();
|
|
709
|
-
return [2 /*return*/];
|
|
710
|
-
}
|
|
711
|
-
});
|
|
712
|
-
});
|
|
713
|
-
};
|
|
714
|
-
BaseGlobalCommandLine.prototype.pAllf = function () {
|
|
715
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
716
|
-
return tslib_1.__generator(this, function (_a) {
|
|
717
|
-
switch (_a.label) {
|
|
718
|
-
case 0: return [4 /*yield*/, this.pushAllForce()];
|
|
719
|
-
case 1:
|
|
720
|
-
_a.sent();
|
|
721
|
-
return [2 /*return*/];
|
|
722
|
-
}
|
|
723
|
-
});
|
|
724
|
-
});
|
|
725
|
-
};
|
|
726
|
-
BaseGlobalCommandLine.prototype.pAll = function () {
|
|
727
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
728
|
-
return tslib_1.__generator(this, function (_a) {
|
|
729
|
-
switch (_a.label) {
|
|
730
|
-
case 0: return [4 /*yield*/, this.pushAll()];
|
|
731
|
-
case 1:
|
|
732
|
-
_a.sent();
|
|
733
|
-
return [2 /*return*/];
|
|
734
|
-
}
|
|
735
|
-
});
|
|
736
|
-
});
|
|
737
|
-
};
|
|
460
|
+
async pushAllForce() {
|
|
461
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
await this.pushAll(true);
|
|
465
|
+
}
|
|
466
|
+
async pAllForce() {
|
|
467
|
+
await this.pushAllForce();
|
|
468
|
+
}
|
|
469
|
+
async pAllf() {
|
|
470
|
+
await this.pushAllForce();
|
|
471
|
+
}
|
|
472
|
+
async pAll() {
|
|
473
|
+
await this.pushAll();
|
|
474
|
+
}
|
|
738
475
|
/**
|
|
739
476
|
* push to all origins
|
|
740
477
|
*/
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
case 3:
|
|
762
|
-
_b.sent();
|
|
763
|
-
index_1.Helpers.taskDone("Pushed to ".concat(origin_1));
|
|
764
|
-
_b.label = 4;
|
|
765
|
-
case 4:
|
|
766
|
-
index++;
|
|
767
|
-
return [3 /*break*/, 2];
|
|
768
|
-
case 5:
|
|
769
|
-
this._exit();
|
|
770
|
-
return [2 /*return*/];
|
|
771
|
-
}
|
|
772
|
-
});
|
|
773
|
-
});
|
|
774
|
-
};
|
|
478
|
+
async pushAll(force = false) {
|
|
479
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
const remotes = this.project.git.allOrigins;
|
|
483
|
+
index_1.Helpers.info(`
|
|
484
|
+
|
|
485
|
+
Remotes for repo:
|
|
486
|
+
|
|
487
|
+
${remotes.map((r, i) => `${i + 1}. ${r.origin} ${r.url}`).join('\n')}
|
|
488
|
+
|
|
489
|
+
`);
|
|
490
|
+
for (let index = 0; index < remotes.length; index++) {
|
|
491
|
+
const { origin, url } = remotes[index];
|
|
492
|
+
index_1.Helpers.taskStarted(`Pushing to ${tnp_core_1.chalk.bold(origin)} (${url})...`);
|
|
493
|
+
await this.push({ force, origin, noExit: true });
|
|
494
|
+
index_1.Helpers.taskDone(`Pushed to ${origin}`);
|
|
495
|
+
}
|
|
496
|
+
this._exit();
|
|
497
|
+
}
|
|
775
498
|
//#endregion
|
|
776
499
|
//#region commands / push force
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
_a.sent();
|
|
784
|
-
return [2 /*return*/];
|
|
785
|
-
}
|
|
786
|
-
});
|
|
787
|
-
});
|
|
788
|
-
};
|
|
789
|
-
BaseGlobalCommandLine.prototype.pushForce = function () {
|
|
790
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
791
|
-
return tslib_1.__generator(this, function (_a) {
|
|
792
|
-
switch (_a.label) {
|
|
793
|
-
case 0: return [4 /*yield*/, this.push({ force: true, typeofCommit: 'feature' })];
|
|
794
|
-
case 1:
|
|
795
|
-
_a.sent();
|
|
796
|
-
return [2 /*return*/];
|
|
797
|
-
}
|
|
798
|
-
});
|
|
799
|
-
});
|
|
800
|
-
};
|
|
500
|
+
async forcePush() {
|
|
501
|
+
await this.push({ force: true, typeofCommit: 'feature' });
|
|
502
|
+
}
|
|
503
|
+
async pushForce() {
|
|
504
|
+
await this.push({ force: true, typeofCommit: 'feature' });
|
|
505
|
+
}
|
|
801
506
|
//#endregion
|
|
802
507
|
//#region commands / commit
|
|
803
508
|
/**
|
|
804
509
|
* Commit and push this for single repo
|
|
805
510
|
*/
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
this._exit();
|
|
829
|
-
return [2 /*return*/];
|
|
830
|
-
}
|
|
831
|
-
});
|
|
832
|
-
});
|
|
833
|
-
};
|
|
511
|
+
async commit(options = {}) {
|
|
512
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
await this.project.git.meltActionCommits();
|
|
516
|
+
await this.project.git.pushProcess({
|
|
517
|
+
...options,
|
|
518
|
+
forcePushNoQuestion: options.force,
|
|
519
|
+
args: this.args,
|
|
520
|
+
exitCallBack: () => {
|
|
521
|
+
this._exit();
|
|
522
|
+
},
|
|
523
|
+
skipChildren: true,
|
|
524
|
+
overrideCommitMessage: this.args.join(' '),
|
|
525
|
+
setOrigin: this.params['setOrigin'],
|
|
526
|
+
currentOrigin: this.project.git.originURL,
|
|
527
|
+
});
|
|
528
|
+
if (options.noExit) {
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
this._exit();
|
|
532
|
+
}
|
|
834
533
|
//#endregion
|
|
835
534
|
//#region commands / push
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
}
|
|
871
|
-
if (res === 'continueForce') {
|
|
872
|
-
return [2 /*return*/, { value: void 0 }];
|
|
873
|
-
}
|
|
874
|
-
_b.label = 2;
|
|
875
|
-
case 2: return [2 /*return*/, { value: void 0 }];
|
|
876
|
-
}
|
|
877
|
-
});
|
|
878
|
-
};
|
|
879
|
-
this_1 = this;
|
|
880
|
-
_a.label = 1;
|
|
881
|
-
case 1:
|
|
882
|
-
if (!true) return [3 /*break*/, 3];
|
|
883
|
-
return [5 /*yield**/, _loop_1()];
|
|
884
|
-
case 2:
|
|
885
|
-
state_1 = _a.sent();
|
|
886
|
-
if (typeof state_1 === "object")
|
|
887
|
-
return [2 /*return*/, state_1.value];
|
|
888
|
-
return [3 /*break*/, 1];
|
|
889
|
-
case 3: return [2 /*return*/];
|
|
535
|
+
async _preventPushPullFromNotCorrectBranch() {
|
|
536
|
+
while (true) {
|
|
537
|
+
const devBranch = this.project.git.duringPushWarnIfProjectNotOnSpecyficDevBranch();
|
|
538
|
+
if (!!devBranch && devBranch !== this.project.git.currentBranchName) {
|
|
539
|
+
index_1.Helpers.warn(`
|
|
540
|
+
|
|
541
|
+
${this.project.genericName}
|
|
542
|
+
|
|
543
|
+
You are not on ${devBranch} branch. Please switch to this branch and try again
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
`, false);
|
|
548
|
+
const options = {
|
|
549
|
+
open: { name: 'Open in vscode' },
|
|
550
|
+
continue: { name: 'Continue (check again)' },
|
|
551
|
+
continueForce: { name: 'Continue (without checking)' },
|
|
552
|
+
exit: { name: 'Exit process' },
|
|
553
|
+
};
|
|
554
|
+
const res = await index_1.Helpers.selectChoicesAsk('What you want to do ?', Object.keys(options).map(k => {
|
|
555
|
+
return { name: options[k].name, value: k };
|
|
556
|
+
}));
|
|
557
|
+
if (res === 'continue') {
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
if (res === 'exit') {
|
|
561
|
+
this._exit();
|
|
562
|
+
}
|
|
563
|
+
if (res === 'open') {
|
|
564
|
+
this.project.run('code . ').sync();
|
|
565
|
+
continue;
|
|
566
|
+
}
|
|
567
|
+
if (res === 'continueForce') {
|
|
568
|
+
return;
|
|
890
569
|
}
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
})
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
return tslib_1.__awaiter(this, arguments, void 0, function (options) {
|
|
920
|
-
var _this = this;
|
|
921
|
-
if (options === void 0) { options = {}; }
|
|
922
|
-
return tslib_1.__generator(this, function (_a) {
|
|
923
|
-
switch (_a.label) {
|
|
924
|
-
case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
|
|
925
|
-
case 1:
|
|
926
|
-
// console.log('args', this.args);
|
|
927
|
-
// console.log(`argsWithParams "${this.argsWithParams}"` );
|
|
928
|
-
if (!(_a.sent())) {
|
|
929
|
-
return [2 /*return*/];
|
|
930
|
-
}
|
|
931
|
-
return [4 /*yield*/, this._preventPushPullFromNotCorrectBranch()];
|
|
932
|
-
case 2:
|
|
933
|
-
_a.sent();
|
|
934
|
-
return [4 /*yield*/, this.project.git.pushProcess(tslib_1.__assign(tslib_1.__assign({}, options), { forcePushNoQuestion: options.force, args: (options === null || options === void 0 ? void 0 : options.overrideCommitMessage)
|
|
935
|
-
? ((options === null || options === void 0 ? void 0 : options.overrideCommitMessage) || '').split(' ')
|
|
936
|
-
: this.args, exitCallBack: function () {
|
|
937
|
-
_this._exit();
|
|
938
|
-
}, setOrigin: this.params['setOrigin'], currentOrigin: this.project.git.originURL }))];
|
|
939
|
-
case 3:
|
|
940
|
-
_a.sent();
|
|
941
|
-
if (options.noExit) {
|
|
942
|
-
return [2 /*return*/];
|
|
943
|
-
}
|
|
944
|
-
this._exit();
|
|
945
|
-
return [2 /*return*/];
|
|
946
|
-
}
|
|
947
|
-
});
|
|
570
|
+
}
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
async qPush() {
|
|
575
|
+
await this.quickPush();
|
|
576
|
+
}
|
|
577
|
+
async quickPush() {
|
|
578
|
+
await this.push({ skipLint: true });
|
|
579
|
+
}
|
|
580
|
+
async push(options = {}) {
|
|
581
|
+
// console.log('args', this.args);
|
|
582
|
+
// console.log(`argsWithParams "${this.argsWithParams}"` );
|
|
583
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
await this._preventPushPullFromNotCorrectBranch();
|
|
587
|
+
await this.project.git.pushProcess({
|
|
588
|
+
...options,
|
|
589
|
+
forcePushNoQuestion: options.force,
|
|
590
|
+
args: options?.overrideCommitMessage
|
|
591
|
+
? (options?.overrideCommitMessage || '').split(' ')
|
|
592
|
+
: this.args,
|
|
593
|
+
exitCallBack: () => {
|
|
594
|
+
this._exit();
|
|
595
|
+
},
|
|
596
|
+
setOrigin: this.params['setOrigin'],
|
|
597
|
+
currentOrigin: this.project.git.originURL,
|
|
948
598
|
});
|
|
949
|
-
|
|
599
|
+
if (options.noExit) {
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
this._exit();
|
|
603
|
+
}
|
|
950
604
|
//#endregion
|
|
951
605
|
//#region commands / melt
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
return
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
return [2 /*return*/];
|
|
960
|
-
}
|
|
961
|
-
return [4 /*yield*/, this.meltUpdateCommits(true)];
|
|
962
|
-
case 2:
|
|
963
|
-
_a.sent();
|
|
964
|
-
this._exit();
|
|
965
|
-
return [2 /*return*/];
|
|
966
|
-
}
|
|
967
|
-
});
|
|
968
|
-
});
|
|
969
|
-
};
|
|
606
|
+
async melt() {
|
|
607
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
await this.meltUpdateCommits(true);
|
|
611
|
+
this._exit();
|
|
612
|
+
}
|
|
970
613
|
//#endregion
|
|
971
614
|
//#region commands / melt updat ecommits
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
if (hideInfo
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
if (!(this.project.git.meltActionCommits() > 0)) return [3 /*break*/, 2];
|
|
979
|
-
if (!!hideInfo) return [3 /*break*/, 2];
|
|
980
|
-
this.project.git.stageAllFiles();
|
|
981
|
-
return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo('Update commits has been reset. Continue with changes ?')];
|
|
982
|
-
case 1:
|
|
983
|
-
if (!(_a.sent())) {
|
|
984
|
-
this._exit();
|
|
985
|
-
}
|
|
986
|
-
_a.label = 2;
|
|
987
|
-
case 2: return [2 /*return*/];
|
|
615
|
+
async meltUpdateCommits(hideInfo = false) {
|
|
616
|
+
if (this.project.git.meltActionCommits() > 0) {
|
|
617
|
+
if (!hideInfo) {
|
|
618
|
+
this.project.git.stageAllFiles();
|
|
619
|
+
if (!(await index_1.Helpers.consoleGui.question.yesNo('Update commits has been reset. Continue with changes ?'))) {
|
|
620
|
+
this._exit();
|
|
988
621
|
}
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
}
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
992
625
|
//#endregion
|
|
993
626
|
//#region commands / push feature
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
case 0: return [4 /*yield*/, this.pushRelease()];
|
|
1011
|
-
case 1:
|
|
1012
|
-
_a.sent();
|
|
1013
|
-
return [2 /*return*/];
|
|
1014
|
-
}
|
|
1015
|
-
});
|
|
1016
|
-
});
|
|
1017
|
-
};
|
|
1018
|
-
BaseGlobalCommandLine.prototype.pRelease = function () {
|
|
1019
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1020
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1021
|
-
switch (_a.label) {
|
|
1022
|
-
case 0: return [4 /*yield*/, this.pushRelease()];
|
|
1023
|
-
case 1:
|
|
1024
|
-
_a.sent();
|
|
1025
|
-
return [2 /*return*/];
|
|
1026
|
-
}
|
|
1027
|
-
});
|
|
1028
|
-
});
|
|
1029
|
-
};
|
|
1030
|
-
BaseGlobalCommandLine.prototype.pushRelease = function () {
|
|
1031
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1032
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1033
|
-
switch (_a.label) {
|
|
1034
|
-
case 0: return [4 /*yield*/, this.meltUpdateCommits()];
|
|
1035
|
-
case 1:
|
|
1036
|
-
_a.sent();
|
|
1037
|
-
return [4 /*yield*/, this.push({
|
|
1038
|
-
typeofCommit: 'release',
|
|
1039
|
-
commitMessageRequired: true,
|
|
1040
|
-
overrideCommitMessage: "".concat(tnp_core_1._.first(this.project.releaseProcess.getReleaseWords()), " ") +
|
|
1041
|
-
"version ".concat(this.project.npmHelpers.version),
|
|
1042
|
-
})];
|
|
1043
|
-
case 2:
|
|
1044
|
-
_a.sent();
|
|
1045
|
-
return [2 /*return*/];
|
|
1046
|
-
}
|
|
1047
|
-
});
|
|
1048
|
-
});
|
|
1049
|
-
};
|
|
1050
|
-
BaseGlobalCommandLine.prototype.mPush = function () {
|
|
1051
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1052
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1053
|
-
switch (_a.label) {
|
|
1054
|
-
case 0: return [4 /*yield*/, this.meltPush()];
|
|
1055
|
-
case 1:
|
|
1056
|
-
_a.sent();
|
|
1057
|
-
return [2 /*return*/];
|
|
1058
|
-
}
|
|
1059
|
-
});
|
|
1060
|
-
});
|
|
1061
|
-
};
|
|
1062
|
-
BaseGlobalCommandLine.prototype.fmPush = function () {
|
|
1063
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1064
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1065
|
-
switch (_a.label) {
|
|
1066
|
-
case 0: return [4 /*yield*/, this.forceMeltPush()];
|
|
1067
|
-
case 1:
|
|
1068
|
-
_a.sent();
|
|
1069
|
-
return [2 /*return*/];
|
|
1070
|
-
}
|
|
1071
|
-
});
|
|
1072
|
-
});
|
|
1073
|
-
};
|
|
1074
|
-
BaseGlobalCommandLine.prototype.mfPush = function () {
|
|
1075
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1076
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1077
|
-
switch (_a.label) {
|
|
1078
|
-
case 0: return [4 /*yield*/, this.forceMeltPush()];
|
|
1079
|
-
case 1:
|
|
1080
|
-
_a.sent();
|
|
1081
|
-
return [2 /*return*/];
|
|
1082
|
-
}
|
|
1083
|
-
});
|
|
1084
|
-
});
|
|
1085
|
-
};
|
|
1086
|
-
BaseGlobalCommandLine.prototype.mforcePush = function () {
|
|
1087
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1088
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1089
|
-
switch (_a.label) {
|
|
1090
|
-
case 0: return [4 /*yield*/, this.forceMeltPush()];
|
|
1091
|
-
case 1:
|
|
1092
|
-
_a.sent();
|
|
1093
|
-
return [2 /*return*/];
|
|
1094
|
-
}
|
|
1095
|
-
});
|
|
1096
|
-
});
|
|
1097
|
-
};
|
|
1098
|
-
BaseGlobalCommandLine.prototype.meltforcePush = function () {
|
|
1099
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1100
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1101
|
-
switch (_a.label) {
|
|
1102
|
-
case 0: return [4 /*yield*/, this.forceMeltPush()];
|
|
1103
|
-
case 1:
|
|
1104
|
-
_a.sent();
|
|
1105
|
-
return [2 /*return*/];
|
|
1106
|
-
}
|
|
1107
|
-
});
|
|
1108
|
-
});
|
|
1109
|
-
};
|
|
1110
|
-
BaseGlobalCommandLine.prototype.forceMeltPush = function () {
|
|
1111
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1112
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1113
|
-
switch (_a.label) {
|
|
1114
|
-
case 0: return [4 /*yield*/, this.meltPush(true)];
|
|
1115
|
-
case 1:
|
|
1116
|
-
_a.sent();
|
|
1117
|
-
return [2 /*return*/];
|
|
1118
|
-
}
|
|
1119
|
-
});
|
|
1120
|
-
});
|
|
1121
|
-
};
|
|
1122
|
-
BaseGlobalCommandLine.prototype.meltPush = function () {
|
|
1123
|
-
return tslib_1.__awaiter(this, arguments, void 0, function (force) {
|
|
1124
|
-
if (force === void 0) { force = false; }
|
|
1125
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1126
|
-
switch (_a.label) {
|
|
1127
|
-
case 0: return [4 /*yield*/, this.meltUpdateCommits()];
|
|
1128
|
-
case 1:
|
|
1129
|
-
_a.sent();
|
|
1130
|
-
return [4 /*yield*/, this.push({
|
|
1131
|
-
mergeUpdateCommits: true,
|
|
1132
|
-
force: force,
|
|
1133
|
-
})];
|
|
1134
|
-
case 2:
|
|
1135
|
-
_a.sent();
|
|
1136
|
-
return [2 /*return*/];
|
|
1137
|
-
}
|
|
1138
|
-
});
|
|
627
|
+
async pf() {
|
|
628
|
+
await this.pushFeature();
|
|
629
|
+
}
|
|
630
|
+
async pRel() {
|
|
631
|
+
await this.pushRelease();
|
|
632
|
+
}
|
|
633
|
+
async pRelease() {
|
|
634
|
+
await this.pushRelease();
|
|
635
|
+
}
|
|
636
|
+
async pushRelease() {
|
|
637
|
+
await this.meltUpdateCommits();
|
|
638
|
+
await this.push({
|
|
639
|
+
typeofCommit: 'release',
|
|
640
|
+
commitMessageRequired: true,
|
|
641
|
+
overrideCommitMessage: `${tnp_core_1._.first(this.project.releaseProcess.getReleaseWords())} ` +
|
|
642
|
+
`version ${this.project.packageJson.version}`,
|
|
1139
643
|
});
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
644
|
+
}
|
|
645
|
+
async mPush() {
|
|
646
|
+
await this.meltPush();
|
|
647
|
+
}
|
|
648
|
+
async fmPush() {
|
|
649
|
+
await this.forceMeltPush();
|
|
650
|
+
}
|
|
651
|
+
async mfPush() {
|
|
652
|
+
await this.forceMeltPush();
|
|
653
|
+
}
|
|
654
|
+
async mforcePush() {
|
|
655
|
+
await this.forceMeltPush();
|
|
656
|
+
}
|
|
657
|
+
async meltforcePush() {
|
|
658
|
+
await this.forceMeltPush();
|
|
659
|
+
}
|
|
660
|
+
async forceMeltPush() {
|
|
661
|
+
await this.meltPush(true);
|
|
662
|
+
}
|
|
663
|
+
async meltPush(force = false) {
|
|
664
|
+
await this.meltUpdateCommits();
|
|
665
|
+
await this.push({
|
|
666
|
+
mergeUpdateCommits: true,
|
|
667
|
+
force,
|
|
1154
668
|
});
|
|
1155
|
-
}
|
|
669
|
+
}
|
|
670
|
+
async pushFeature() {
|
|
671
|
+
await this.meltUpdateCommits();
|
|
672
|
+
await this.push({ typeofCommit: 'feature', commitMessageRequired: true });
|
|
673
|
+
}
|
|
1156
674
|
//#endregion
|
|
1157
675
|
//#region commands / push fix
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
case 1:
|
|
1164
|
-
_a.sent();
|
|
1165
|
-
return [4 /*yield*/, this.push({ typeofCommit: 'bugfix', commitMessageRequired: true })];
|
|
1166
|
-
case 2:
|
|
1167
|
-
_a.sent();
|
|
1168
|
-
return [2 /*return*/];
|
|
1169
|
-
}
|
|
1170
|
-
});
|
|
1171
|
-
});
|
|
1172
|
-
};
|
|
1173
|
-
BaseGlobalCommandLine.prototype.pfix = function () {
|
|
676
|
+
async pushFix() {
|
|
677
|
+
await this.meltUpdateCommits();
|
|
678
|
+
await this.push({ typeofCommit: 'bugfix', commitMessageRequired: true });
|
|
679
|
+
}
|
|
680
|
+
pfix() {
|
|
1174
681
|
this.pushFix();
|
|
1175
|
-
}
|
|
682
|
+
}
|
|
1176
683
|
//#endregion
|
|
1177
684
|
//#region commands / push chore
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
return [4 /*yield*/, this.push({ typeofCommit: 'chore', commitMessageRequired: true })];
|
|
1186
|
-
case 2:
|
|
1187
|
-
_a.sent();
|
|
1188
|
-
return [2 /*return*/];
|
|
1189
|
-
}
|
|
1190
|
-
});
|
|
1191
|
-
});
|
|
1192
|
-
};
|
|
1193
|
-
BaseGlobalCommandLine.prototype.pc = function () {
|
|
1194
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1195
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1196
|
-
switch (_a.label) {
|
|
1197
|
-
case 0: return [4 /*yield*/, this.pushChore()];
|
|
1198
|
-
case 1:
|
|
1199
|
-
_a.sent();
|
|
1200
|
-
return [2 /*return*/];
|
|
1201
|
-
}
|
|
1202
|
-
});
|
|
1203
|
-
});
|
|
1204
|
-
};
|
|
685
|
+
async pushChore() {
|
|
686
|
+
await this.meltUpdateCommits();
|
|
687
|
+
await this.push({ typeofCommit: 'chore', commitMessageRequired: true });
|
|
688
|
+
}
|
|
689
|
+
async pc() {
|
|
690
|
+
await this.pushChore();
|
|
691
|
+
}
|
|
1205
692
|
//#endregion
|
|
1206
693
|
//#region commands / push refactor
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
return [2 /*return*/];
|
|
1230
|
-
}
|
|
1231
|
-
});
|
|
1232
|
-
});
|
|
1233
|
-
};
|
|
1234
|
-
BaseGlobalCommandLine.prototype.pref = function () {
|
|
1235
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1236
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1237
|
-
switch (_a.label) {
|
|
1238
|
-
case 0: return [4 /*yield*/, this.pushRefactor()];
|
|
1239
|
-
case 1:
|
|
1240
|
-
_a.sent();
|
|
1241
|
-
return [2 /*return*/];
|
|
1242
|
-
}
|
|
1243
|
-
});
|
|
1244
|
-
});
|
|
1245
|
-
};
|
|
1246
|
-
//#endregion
|
|
1247
|
-
//#region commands / push style
|
|
1248
|
-
BaseGlobalCommandLine.prototype.pushStyle = function () {
|
|
1249
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1250
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1251
|
-
switch (_a.label) {
|
|
1252
|
-
case 0: return [4 /*yield*/, this.meltUpdateCommits()];
|
|
1253
|
-
case 1:
|
|
1254
|
-
_a.sent();
|
|
1255
|
-
return [4 /*yield*/, this.push({ typeofCommit: 'style', commitMessageRequired: true })];
|
|
1256
|
-
case 2:
|
|
1257
|
-
_a.sent();
|
|
1258
|
-
return [2 /*return*/];
|
|
1259
|
-
}
|
|
1260
|
-
});
|
|
1261
|
-
});
|
|
1262
|
-
};
|
|
1263
|
-
BaseGlobalCommandLine.prototype.pstyl = function () {
|
|
1264
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1265
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1266
|
-
switch (_a.label) {
|
|
1267
|
-
case 0: return [4 /*yield*/, this.pushStyle()];
|
|
1268
|
-
case 1:
|
|
1269
|
-
_a.sent();
|
|
1270
|
-
return [2 /*return*/];
|
|
1271
|
-
}
|
|
1272
|
-
});
|
|
1273
|
-
});
|
|
1274
|
-
};
|
|
1275
|
-
BaseGlobalCommandLine.prototype.pstyle = function () {
|
|
1276
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1277
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1278
|
-
switch (_a.label) {
|
|
1279
|
-
case 0: return [4 /*yield*/, this.pushStyle()];
|
|
1280
|
-
case 1:
|
|
1281
|
-
_a.sent();
|
|
1282
|
-
return [2 /*return*/];
|
|
1283
|
-
}
|
|
1284
|
-
});
|
|
1285
|
-
});
|
|
1286
|
-
};
|
|
694
|
+
async pushRefactor() {
|
|
695
|
+
await this.meltUpdateCommits();
|
|
696
|
+
await this.push({ typeofCommit: 'refactor', commitMessageRequired: true });
|
|
697
|
+
}
|
|
698
|
+
async pushref() {
|
|
699
|
+
await this.pushRefactor();
|
|
700
|
+
}
|
|
701
|
+
async pref() {
|
|
702
|
+
await this.pushRefactor();
|
|
703
|
+
}
|
|
704
|
+
//#endregion
|
|
705
|
+
//#region commands / push style
|
|
706
|
+
async pushStyle() {
|
|
707
|
+
await this.meltUpdateCommits();
|
|
708
|
+
await this.push({ typeofCommit: 'style', commitMessageRequired: true });
|
|
709
|
+
}
|
|
710
|
+
async pstyl() {
|
|
711
|
+
await this.pushStyle();
|
|
712
|
+
}
|
|
713
|
+
async pstyle() {
|
|
714
|
+
await this.pushStyle();
|
|
715
|
+
}
|
|
1287
716
|
//#endregion
|
|
1288
717
|
//#region commands / push docs
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
return [2 /*return*/];
|
|
1300
|
-
}
|
|
1301
|
-
});
|
|
1302
|
-
});
|
|
1303
|
-
};
|
|
1304
|
-
BaseGlobalCommandLine.prototype.pd = function () {
|
|
1305
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1306
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1307
|
-
switch (_a.label) {
|
|
1308
|
-
case 0: return [4 /*yield*/, this.pushDocs()];
|
|
1309
|
-
case 1:
|
|
1310
|
-
_a.sent();
|
|
1311
|
-
return [2 /*return*/];
|
|
1312
|
-
}
|
|
1313
|
-
});
|
|
1314
|
-
});
|
|
1315
|
-
};
|
|
1316
|
-
BaseGlobalCommandLine.prototype.pdocs = function () {
|
|
1317
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1318
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1319
|
-
switch (_a.label) {
|
|
1320
|
-
case 0: return [4 /*yield*/, this.pushDocs()];
|
|
1321
|
-
case 1:
|
|
1322
|
-
_a.sent();
|
|
1323
|
-
return [2 /*return*/];
|
|
1324
|
-
}
|
|
1325
|
-
});
|
|
1326
|
-
});
|
|
1327
|
-
};
|
|
718
|
+
async pushDocs() {
|
|
719
|
+
await this.meltUpdateCommits();
|
|
720
|
+
await this.push({ typeofCommit: 'docs', commitMessageRequired: true });
|
|
721
|
+
}
|
|
722
|
+
async pd() {
|
|
723
|
+
await this.pushDocs();
|
|
724
|
+
}
|
|
725
|
+
async pdocs() {
|
|
726
|
+
await this.pushDocs();
|
|
727
|
+
}
|
|
1328
728
|
//#endregion
|
|
1329
729
|
//#region commands / push test
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
return [2 /*return*/];
|
|
1341
|
-
}
|
|
1342
|
-
});
|
|
1343
|
-
});
|
|
1344
|
-
};
|
|
1345
|
-
BaseGlobalCommandLine.prototype.pTest = function () {
|
|
1346
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1347
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1348
|
-
switch (_a.label) {
|
|
1349
|
-
case 0: return [4 /*yield*/, this.pushTest()];
|
|
1350
|
-
case 1:
|
|
1351
|
-
_a.sent();
|
|
1352
|
-
return [2 /*return*/];
|
|
1353
|
-
}
|
|
1354
|
-
});
|
|
1355
|
-
});
|
|
1356
|
-
};
|
|
1357
|
-
BaseGlobalCommandLine.prototype.pTests = function () {
|
|
1358
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1359
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1360
|
-
switch (_a.label) {
|
|
1361
|
-
case 0: return [4 /*yield*/, this.pushTest()];
|
|
1362
|
-
case 1:
|
|
1363
|
-
_a.sent();
|
|
1364
|
-
return [2 /*return*/];
|
|
1365
|
-
}
|
|
1366
|
-
});
|
|
1367
|
-
});
|
|
1368
|
-
};
|
|
730
|
+
async pushTest() {
|
|
731
|
+
await this.meltUpdateCommits();
|
|
732
|
+
await this.push({ typeofCommit: 'test', commitMessageRequired: true });
|
|
733
|
+
}
|
|
734
|
+
async pTest() {
|
|
735
|
+
await this.pushTest();
|
|
736
|
+
}
|
|
737
|
+
async pTests() {
|
|
738
|
+
await this.pushTest();
|
|
739
|
+
}
|
|
1369
740
|
//#endregion
|
|
1370
741
|
//#region commands / push perf
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
case 1:
|
|
1377
|
-
_a.sent();
|
|
1378
|
-
return [4 /*yield*/, this.push({
|
|
1379
|
-
typeofCommit: 'performance',
|
|
1380
|
-
commitMessageRequired: true,
|
|
1381
|
-
})];
|
|
1382
|
-
case 2:
|
|
1383
|
-
_a.sent();
|
|
1384
|
-
return [2 /*return*/];
|
|
1385
|
-
}
|
|
1386
|
-
});
|
|
742
|
+
async pushPerf() {
|
|
743
|
+
await this.meltUpdateCommits();
|
|
744
|
+
await this.push({
|
|
745
|
+
typeofCommit: 'performance',
|
|
746
|
+
commitMessageRequired: true,
|
|
1387
747
|
});
|
|
1388
|
-
}
|
|
748
|
+
}
|
|
1389
749
|
//#endregion
|
|
1390
750
|
//#region commands / push ci
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
case 0: return [4 /*yield*/, this.meltUpdateCommits()];
|
|
1396
|
-
case 1:
|
|
1397
|
-
_a.sent();
|
|
1398
|
-
return [4 /*yield*/, this.push({ typeofCommit: 'ci', commitMessageRequired: true })];
|
|
1399
|
-
case 2:
|
|
1400
|
-
_a.sent();
|
|
1401
|
-
return [2 /*return*/];
|
|
1402
|
-
}
|
|
1403
|
-
});
|
|
1404
|
-
});
|
|
1405
|
-
};
|
|
751
|
+
async pushCi() {
|
|
752
|
+
await this.meltUpdateCommits();
|
|
753
|
+
await this.push({ typeofCommit: 'ci', commitMessageRequired: true });
|
|
754
|
+
}
|
|
1406
755
|
//#endregion
|
|
1407
756
|
//#region commands / select branch
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
index_1.Helpers.error("No branch found by name \"".concat(branchName, "\""), false, true);
|
|
1434
|
-
_a.label = 5;
|
|
1435
|
-
case 5:
|
|
1436
|
-
try {
|
|
1437
|
-
this.project.git.stageAllFiles();
|
|
1438
|
-
this.project.git.stash();
|
|
1439
|
-
}
|
|
1440
|
-
catch (error) { }
|
|
1441
|
-
this.project.git.checkout(branchName);
|
|
1442
|
-
this._exit();
|
|
1443
|
-
return [2 /*return*/];
|
|
1444
|
-
}
|
|
1445
|
-
});
|
|
1446
|
-
});
|
|
1447
|
-
};
|
|
757
|
+
async branch() {
|
|
758
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
await this.project.struct();
|
|
762
|
+
try {
|
|
763
|
+
this.project.git.fetch();
|
|
764
|
+
}
|
|
765
|
+
catch (error) { }
|
|
766
|
+
let branchName = this.firstArg;
|
|
767
|
+
const branches = this.__filterBranchesByPattern(branchName);
|
|
768
|
+
if (branches.length > 0) {
|
|
769
|
+
branchName = await this.__selectBrach(branches, 'checkout');
|
|
770
|
+
}
|
|
771
|
+
else {
|
|
772
|
+
index_1.Helpers.error(`No branch found by name "${branchName}"`, false, true);
|
|
773
|
+
}
|
|
774
|
+
try {
|
|
775
|
+
this.project.git.stageAllFiles();
|
|
776
|
+
this.project.git.stash();
|
|
777
|
+
}
|
|
778
|
+
catch (error) { }
|
|
779
|
+
this.project.git.checkout(branchName);
|
|
780
|
+
this._exit();
|
|
781
|
+
}
|
|
1448
782
|
//#endregion
|
|
1449
783
|
//#region commands / push build
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
case 0: return [4 /*yield*/, this.meltUpdateCommits()];
|
|
1455
|
-
case 1:
|
|
1456
|
-
_a.sent();
|
|
1457
|
-
return [4 /*yield*/, this.push({ typeofCommit: 'build', commitMessageRequired: true })];
|
|
1458
|
-
case 2:
|
|
1459
|
-
_a.sent();
|
|
1460
|
-
return [2 /*return*/];
|
|
1461
|
-
}
|
|
1462
|
-
});
|
|
1463
|
-
});
|
|
1464
|
-
};
|
|
784
|
+
async pushBuild() {
|
|
785
|
+
await this.meltUpdateCommits();
|
|
786
|
+
await this.push({ typeofCommit: 'build', commitMessageRequired: true });
|
|
787
|
+
}
|
|
1465
788
|
//#endregion
|
|
1466
789
|
//#region commands / set origin
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
}
|
|
1484
|
-
else {
|
|
1485
|
-
index_1.Helpers.error("This folder is not a git repo... ", false, true);
|
|
1486
|
-
}
|
|
1487
|
-
this._exit();
|
|
1488
|
-
return [2 /*return*/];
|
|
1489
|
-
}
|
|
1490
|
-
});
|
|
1491
|
-
});
|
|
1492
|
-
};
|
|
790
|
+
async SET_ORIGIN() {
|
|
791
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
const newOriginNameOrUrl = this.firstArg;
|
|
795
|
+
const proj = this.project;
|
|
796
|
+
if (proj && proj.git.isInsideGitRepo) {
|
|
797
|
+
proj.run(`git remote rm origin`).sync();
|
|
798
|
+
proj.run(`git remote add origin ${newOriginNameOrUrl} `).sync();
|
|
799
|
+
index_1.Helpers.info(`Done`);
|
|
800
|
+
}
|
|
801
|
+
else {
|
|
802
|
+
index_1.Helpers.error(`This folder is not a git repo... `, false, true);
|
|
803
|
+
}
|
|
804
|
+
this._exit();
|
|
805
|
+
}
|
|
1493
806
|
//#endregion
|
|
1494
807
|
//#region commands / rename origin
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
}
|
|
1510
|
-
else {
|
|
1511
|
-
index_1.Helpers.error("This folder is not a git repo... ", false, true);
|
|
1512
|
-
}
|
|
1513
|
-
this._exit();
|
|
1514
|
-
return [2 /*return*/];
|
|
1515
|
-
}
|
|
1516
|
-
});
|
|
1517
|
-
});
|
|
1518
|
-
};
|
|
808
|
+
async RENAME_ORIGIN() {
|
|
809
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
const newOriginNameOrUrl = this.firstArg;
|
|
813
|
+
const proj = this.project;
|
|
814
|
+
if (proj && proj.git.isInsideGitRepo) {
|
|
815
|
+
proj.git.renameOrigin(newOriginNameOrUrl);
|
|
816
|
+
}
|
|
817
|
+
else {
|
|
818
|
+
index_1.Helpers.error(`This folder is not a git repo... `, false, true);
|
|
819
|
+
}
|
|
820
|
+
this._exit();
|
|
821
|
+
}
|
|
1519
822
|
//#endregion
|
|
1520
823
|
//#region commands / last hash tag
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
return
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
return [2 /*return*/];
|
|
1529
|
-
}
|
|
1530
|
-
index_1.Helpers.info(this.project.git.lastTagHash());
|
|
1531
|
-
this._exit();
|
|
1532
|
-
return [2 /*return*/];
|
|
1533
|
-
}
|
|
1534
|
-
});
|
|
1535
|
-
});
|
|
1536
|
-
};
|
|
824
|
+
async LAST_TAG_HASH() {
|
|
825
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
index_1.Helpers.info(this.project.git.lastTagHash());
|
|
829
|
+
this._exit();
|
|
830
|
+
}
|
|
1537
831
|
//#endregion
|
|
1538
832
|
//#region commands / last tag
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
return [2 /*return*/];
|
|
1553
|
-
}
|
|
1554
|
-
});
|
|
1555
|
-
});
|
|
1556
|
-
};
|
|
833
|
+
async LAST_TAG() {
|
|
834
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
835
|
+
return;
|
|
836
|
+
}
|
|
837
|
+
const proj = this.project;
|
|
838
|
+
index_1.Helpers.info(`
|
|
839
|
+
|
|
840
|
+
last tag: ${proj.git.lastTagVersionName}
|
|
841
|
+
last tag hash: ${proj.git.lastTagHash()}
|
|
842
|
+
|
|
843
|
+
`);
|
|
844
|
+
this._exit();
|
|
845
|
+
}
|
|
1557
846
|
//#endregion
|
|
1558
847
|
//#region commands / check tag exists
|
|
1559
|
-
|
|
1560
|
-
index_1.Helpers.info(
|
|
848
|
+
CHECK_TAG_EXISTS() {
|
|
849
|
+
index_1.Helpers.info(`tag "${this.firstArg}" exits = ${index_1.Helpers.git.checkTagExists(this.firstArg)} `);
|
|
1561
850
|
this._exit();
|
|
1562
|
-
}
|
|
851
|
+
}
|
|
1563
852
|
//#endregion
|
|
1564
853
|
//#region commands / lint
|
|
1565
854
|
/**
|
|
1566
855
|
* TODO move somewhere
|
|
1567
856
|
*/
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
return
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
if (!(_a.sent())) {
|
|
1575
|
-
return [2 /*return*/];
|
|
1576
|
-
}
|
|
1577
|
-
return [4 /*yield*/, this.project.lint()];
|
|
1578
|
-
case 2:
|
|
1579
|
-
_a.sent();
|
|
1580
|
-
return [2 /*return*/];
|
|
1581
|
-
}
|
|
1582
|
-
});
|
|
1583
|
-
});
|
|
1584
|
-
};
|
|
857
|
+
async lint() {
|
|
858
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
861
|
+
await this.project.lint();
|
|
862
|
+
}
|
|
1585
863
|
//#endregion
|
|
1586
864
|
//#region commands / version
|
|
1587
865
|
/**
|
|
1588
866
|
* TODO move somewhere
|
|
1589
867
|
*/
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
return
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
return [2 /*return*/];
|
|
1598
|
-
}
|
|
1599
|
-
console.log('Current project verison: ' + this.project.npmHelpers.version);
|
|
1600
|
-
this._exit();
|
|
1601
|
-
return [2 /*return*/];
|
|
1602
|
-
}
|
|
1603
|
-
});
|
|
1604
|
-
});
|
|
1605
|
-
};
|
|
868
|
+
async version() {
|
|
869
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
872
|
+
console.log('Current project verison: ' + this.project.packageJson.version);
|
|
873
|
+
this._exit();
|
|
874
|
+
}
|
|
1606
875
|
//#endregion
|
|
1607
876
|
//#region commands / init
|
|
1608
877
|
/**
|
|
1609
878
|
* TODO move somewhere
|
|
1610
879
|
*/
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
return
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
return [2 /*return*/];
|
|
1619
|
-
}
|
|
1620
|
-
return [4 /*yield*/, this.project.init()];
|
|
1621
|
-
case 2:
|
|
1622
|
-
_a.sent();
|
|
1623
|
-
this._exit();
|
|
1624
|
-
return [2 /*return*/];
|
|
1625
|
-
}
|
|
1626
|
-
});
|
|
1627
|
-
});
|
|
1628
|
-
};
|
|
880
|
+
async init() {
|
|
881
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
await this.project.init();
|
|
885
|
+
this._exit();
|
|
886
|
+
}
|
|
1629
887
|
/**
|
|
1630
888
|
* init parent and first level children
|
|
1631
889
|
*/
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
}
|
|
1643
|
-
return [4 /*yield*/, this.project.init()];
|
|
1644
|
-
case 2:
|
|
1645
|
-
_d.sent();
|
|
1646
|
-
_d.label = 3;
|
|
1647
|
-
case 3:
|
|
1648
|
-
_d.trys.push([3, 8, 9, 10]);
|
|
1649
|
-
_a = tslib_1.__values(this.project.children), _b = _a.next();
|
|
1650
|
-
_d.label = 4;
|
|
1651
|
-
case 4:
|
|
1652
|
-
if (!!_b.done) return [3 /*break*/, 7];
|
|
1653
|
-
child = _b.value;
|
|
1654
|
-
return [4 /*yield*/, child.init()];
|
|
1655
|
-
case 5:
|
|
1656
|
-
_d.sent();
|
|
1657
|
-
_d.label = 6;
|
|
1658
|
-
case 6:
|
|
1659
|
-
_b = _a.next();
|
|
1660
|
-
return [3 /*break*/, 4];
|
|
1661
|
-
case 7: return [3 /*break*/, 10];
|
|
1662
|
-
case 8:
|
|
1663
|
-
e_3_1 = _d.sent();
|
|
1664
|
-
e_3 = { error: e_3_1 };
|
|
1665
|
-
return [3 /*break*/, 10];
|
|
1666
|
-
case 9:
|
|
1667
|
-
try {
|
|
1668
|
-
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1669
|
-
}
|
|
1670
|
-
finally { if (e_3) throw e_3.error; }
|
|
1671
|
-
return [7 /*endfinally*/];
|
|
1672
|
-
case 10:
|
|
1673
|
-
this._exit();
|
|
1674
|
-
return [2 /*return*/];
|
|
1675
|
-
}
|
|
1676
|
-
});
|
|
1677
|
-
});
|
|
1678
|
-
};
|
|
890
|
+
async initAll() {
|
|
891
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
894
|
+
await this.project.init();
|
|
895
|
+
for (const child of this.project.children) {
|
|
896
|
+
await child.init();
|
|
897
|
+
}
|
|
898
|
+
this._exit();
|
|
899
|
+
}
|
|
1679
900
|
//#endregion
|
|
1680
901
|
//#region commands / struct
|
|
1681
902
|
/**
|
|
1682
903
|
* TODO move somewhere
|
|
1683
904
|
*/
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
return
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
return [2 /*return*/];
|
|
1692
|
-
}
|
|
1693
|
-
return [4 /*yield*/, this.project.struct()];
|
|
1694
|
-
case 2:
|
|
1695
|
-
_a.sent();
|
|
1696
|
-
this._exit();
|
|
1697
|
-
return [2 /*return*/];
|
|
1698
|
-
}
|
|
1699
|
-
});
|
|
1700
|
-
});
|
|
1701
|
-
};
|
|
905
|
+
async struct() {
|
|
906
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
|
|
907
|
+
return;
|
|
908
|
+
}
|
|
909
|
+
await this.project.struct();
|
|
910
|
+
this._exit();
|
|
911
|
+
}
|
|
1702
912
|
//#endregion
|
|
1703
913
|
//#region commands / info
|
|
1704
914
|
/**
|
|
1705
915
|
* TODO move somewhere
|
|
1706
916
|
*/
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
index_1.Helpers.clearConsole();
|
|
1719
|
-
return [4 /*yield*/, this.project.info()];
|
|
1720
|
-
case 2:
|
|
1721
|
-
_a.sent();
|
|
1722
|
-
return [4 /*yield*/, this.project.linkedProjects.saveAllLinkedProjectsToDB()];
|
|
1723
|
-
case 3:
|
|
1724
|
-
_a.sent();
|
|
1725
|
-
this._exit();
|
|
1726
|
-
return [2 /*return*/];
|
|
1727
|
-
}
|
|
1728
|
-
});
|
|
1729
|
-
});
|
|
1730
|
-
};
|
|
917
|
+
async info() {
|
|
918
|
+
if (!(await this.cwdIsProject({
|
|
919
|
+
requireProjectWithGitRoot: false,
|
|
920
|
+
}))) {
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
index_1.Helpers.clearConsole();
|
|
924
|
+
await this.project.info();
|
|
925
|
+
await this.project.linkedProjects.saveAllLinkedProjectsToDB();
|
|
926
|
+
this._exit();
|
|
927
|
+
}
|
|
1731
928
|
//#endregion
|
|
1732
929
|
//#region commands / info
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
? libs
|
|
1753
|
-
.map(function (c) {
|
|
1754
|
-
return "".concat(tnp_core_1.chalk.bold(c.name), " (").concat(c.git.uncommitedFiles.map(function (p) { return tnp_core_1.chalk.black(tnp_core_1.path.basename(p)); }).join(', '), ")");
|
|
1755
|
-
})
|
|
1756
|
-
.join('\n')
|
|
1757
|
-
: 'Nothing modifed');
|
|
1758
|
-
this._exit();
|
|
1759
|
-
return [2 /*return*/];
|
|
1760
|
-
}
|
|
1761
|
-
});
|
|
1762
|
-
});
|
|
1763
|
-
};
|
|
930
|
+
async modified() {
|
|
931
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
|
|
932
|
+
return;
|
|
933
|
+
}
|
|
934
|
+
const proj = this.project;
|
|
935
|
+
const libs = proj.children.filter(child => {
|
|
936
|
+
process.stdout.write('.');
|
|
937
|
+
return child.git.thereAreSomeUncommitedChangeExcept([
|
|
938
|
+
tnp_config_2.config.file.package_json,
|
|
939
|
+
]);
|
|
940
|
+
});
|
|
941
|
+
console.log('\n' + index_1.Helpers.terminalLine());
|
|
942
|
+
index_1.Helpers.info(libs.length
|
|
943
|
+
? libs
|
|
944
|
+
.map(c => `${tnp_core_1.chalk.bold(c.name)} (${c.git.uncommitedFiles.map(p => tnp_core_1.chalk.black(tnp_core_1.path.basename(p))).join(', ')})`)
|
|
945
|
+
.join('\n')
|
|
946
|
+
: 'Nothing modifed');
|
|
947
|
+
this._exit();
|
|
948
|
+
}
|
|
1764
949
|
//#endregion
|
|
1765
950
|
//#region commands / update
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
return [4 /*yield*/, this.project.init()];
|
|
1785
|
-
case 2:
|
|
1786
|
-
_a.sent();
|
|
1787
|
-
index_1.Helpers.info("Linked projects updated");
|
|
1788
|
-
this._exit(0);
|
|
1789
|
-
return [2 /*return*/];
|
|
1790
|
-
}
|
|
1791
|
-
});
|
|
1792
|
-
});
|
|
1793
|
-
};
|
|
951
|
+
async UPDATE() {
|
|
952
|
+
const linkedProjects = index_1.LinkedProject.detect(this.project.location).filter(linkedProj => this.project.ins.From([
|
|
953
|
+
this.project.location,
|
|
954
|
+
linkedProj.relativeClonePath,
|
|
955
|
+
]));
|
|
956
|
+
if (await index_1.Helpers.questionYesNo(`
|
|
957
|
+
|
|
958
|
+
Deteced project:
|
|
959
|
+
${linkedProjects.map(l => `- ${l.relativeClonePath}`).join('\n')}
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
Would you like to update current project configuration?`)) {
|
|
963
|
+
this.project.linkedProjects.addLinkedProjects(linkedProjects);
|
|
964
|
+
}
|
|
965
|
+
await this.project.init();
|
|
966
|
+
index_1.Helpers.info(`Linked projects updated`);
|
|
967
|
+
this._exit(0);
|
|
968
|
+
}
|
|
1794
969
|
//#endregion
|
|
1795
970
|
//#region commands / changes
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
return [4 /*yield*/, this.project.git.changesSummary()];
|
|
1805
|
-
case 1:
|
|
1806
|
-
_b.apply(_a, [_h.sent()]);
|
|
1807
|
-
index_1.Helpers.terminalLine();
|
|
1808
|
-
_h.label = 2;
|
|
1809
|
-
case 2:
|
|
1810
|
-
_h.trys.push([2, 7, 8, 9]);
|
|
1811
|
-
_c = tslib_1.__values(this.project.children), _d = _c.next();
|
|
1812
|
-
_h.label = 3;
|
|
1813
|
-
case 3:
|
|
1814
|
-
if (!!_d.done) return [3 /*break*/, 6];
|
|
1815
|
-
chil = _d.value;
|
|
1816
|
-
_f = (_e = index_1.Helpers).info;
|
|
1817
|
-
return [4 /*yield*/, chil.git.changesSummary()];
|
|
1818
|
-
case 4:
|
|
1819
|
-
_f.apply(_e, [_h.sent()]);
|
|
1820
|
-
_h.label = 5;
|
|
1821
|
-
case 5:
|
|
1822
|
-
_d = _c.next();
|
|
1823
|
-
return [3 /*break*/, 3];
|
|
1824
|
-
case 6: return [3 /*break*/, 9];
|
|
1825
|
-
case 7:
|
|
1826
|
-
e_4_1 = _h.sent();
|
|
1827
|
-
e_4 = { error: e_4_1 };
|
|
1828
|
-
return [3 /*break*/, 9];
|
|
1829
|
-
case 8:
|
|
1830
|
-
try {
|
|
1831
|
-
if (_d && !_d.done && (_g = _c.return)) _g.call(_c);
|
|
1832
|
-
}
|
|
1833
|
-
finally { if (e_4) throw e_4.error; }
|
|
1834
|
-
return [7 /*endfinally*/];
|
|
1835
|
-
case 9:
|
|
1836
|
-
this._exit();
|
|
1837
|
-
return [2 /*return*/];
|
|
1838
|
-
}
|
|
1839
|
-
});
|
|
1840
|
-
});
|
|
1841
|
-
};
|
|
971
|
+
async changes() {
|
|
972
|
+
index_1.Helpers.info(await this.project.git.changesSummary());
|
|
973
|
+
index_1.Helpers.terminalLine();
|
|
974
|
+
for (const chil of this.project.children) {
|
|
975
|
+
index_1.Helpers.info(await chil.git.changesSummary());
|
|
976
|
+
}
|
|
977
|
+
this._exit();
|
|
978
|
+
}
|
|
1842
979
|
//#endregion
|
|
1843
980
|
//#region commands / branch name
|
|
1844
|
-
|
|
1845
|
-
console.log(
|
|
981
|
+
BRANCH_NAME() {
|
|
982
|
+
console.log(`current branch name: "${index_1.Helpers.git.currentBranchName(process.cwd())}"`);
|
|
1846
983
|
this._exit();
|
|
1847
|
-
}
|
|
984
|
+
}
|
|
1848
985
|
//#endregion
|
|
1849
986
|
//#region commands / remotes
|
|
1850
|
-
|
|
987
|
+
REMOTES() {
|
|
1851
988
|
console.log(index_1.Helpers.git.allOrigins(this.cwd));
|
|
1852
989
|
this._exit();
|
|
1853
|
-
}
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
BaseGlobalCommandLine.prototype.SET_REMOTE_http = function () {
|
|
1868
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1869
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1870
|
-
switch (_a.label) {
|
|
1871
|
-
case 0: return [4 /*yield*/, index_1.Helpers.git.changeRemoveFromSshToHttps(this.cwd)];
|
|
1872
|
-
case 1:
|
|
1873
|
-
_a.sent();
|
|
1874
|
-
this._exit();
|
|
1875
|
-
return [2 /*return*/];
|
|
1876
|
-
}
|
|
1877
|
-
});
|
|
1878
|
-
});
|
|
1879
|
-
};
|
|
1880
|
-
BaseGlobalCommandLine.prototype.SET_REMOTE_https = function () {
|
|
1881
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1882
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1883
|
-
switch (_a.label) {
|
|
1884
|
-
case 0: return [4 /*yield*/, this.SET_REMOTE_http()];
|
|
1885
|
-
case 1:
|
|
1886
|
-
_a.sent();
|
|
1887
|
-
return [2 /*return*/];
|
|
1888
|
-
}
|
|
1889
|
-
});
|
|
1890
|
-
});
|
|
1891
|
-
};
|
|
1892
|
-
BaseGlobalCommandLine.prototype._resolveChildFromArg = function () {
|
|
1893
|
-
var _this = this;
|
|
1894
|
-
var _a = index_1.Helpers.cliTool.resolveItemFromArgsBegin(this.args, function (arg) {
|
|
1895
|
-
return _this.ins.From([_this.cwd, arg]);
|
|
1896
|
-
}), projFromArg = _a.resolved, clearedCommand = _a.clearedCommand;
|
|
990
|
+
}
|
|
991
|
+
async SET_REMOTE_SSH() {
|
|
992
|
+
await index_1.Helpers.git.changeRemoteFromHttpsToSSh(this.cwd);
|
|
993
|
+
this._exit();
|
|
994
|
+
}
|
|
995
|
+
async SET_REMOTE_http() {
|
|
996
|
+
await index_1.Helpers.git.changeRemoveFromSshToHttps(this.cwd);
|
|
997
|
+
this._exit();
|
|
998
|
+
}
|
|
999
|
+
async SET_REMOTE_https() {
|
|
1000
|
+
await this.SET_REMOTE_http();
|
|
1001
|
+
}
|
|
1002
|
+
_resolveChildFromArg() {
|
|
1003
|
+
const { resolved: projFromArg, clearedCommand } = index_1.Helpers.cliTool.resolveItemFromArgsBegin(this.args, arg => this.ins.From([this.cwd, arg]));
|
|
1897
1004
|
if (!!projFromArg) {
|
|
1898
1005
|
this.args = clearedCommand.split(' ');
|
|
1899
1006
|
this.cwd = projFromArg.location;
|
|
1900
1007
|
this.project = projFromArg;
|
|
1901
1008
|
}
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1009
|
+
}
|
|
1010
|
+
origin() {
|
|
1904
1011
|
this._resolveChildFromArg();
|
|
1905
1012
|
console.log(index_1.Helpers.git.getOriginURL(this.cwd));
|
|
1906
1013
|
this._exit();
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1014
|
+
}
|
|
1015
|
+
remote() {
|
|
1909
1016
|
console.log(index_1.Helpers.git.getOriginURL(this.cwd));
|
|
1910
1017
|
this._exit();
|
|
1911
|
-
}
|
|
1912
|
-
|
|
1018
|
+
}
|
|
1019
|
+
originHttp() {
|
|
1913
1020
|
console.log(index_1.Helpers.git.originSshToHttp(index_1.Helpers.git.getOriginURL(this.cwd)));
|
|
1914
1021
|
this._exit();
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1022
|
+
}
|
|
1023
|
+
originHttps() {
|
|
1917
1024
|
console.log(index_1.Helpers.git.originSshToHttp(index_1.Helpers.git.getOriginURL(this.cwd)));
|
|
1918
1025
|
this._exit();
|
|
1919
|
-
}
|
|
1920
|
-
|
|
1026
|
+
}
|
|
1027
|
+
originssh() {
|
|
1921
1028
|
console.log(index_1.Helpers.git.originHttpToSsh(index_1.Helpers.git.getOriginURL(this.cwd)));
|
|
1922
1029
|
this._exit();
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1030
|
+
}
|
|
1031
|
+
origins() {
|
|
1925
1032
|
this.REMOTES();
|
|
1926
|
-
}
|
|
1033
|
+
}
|
|
1927
1034
|
//#endregion
|
|
1928
1035
|
//#region commands / git config
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
index_1.Helpers.run(
|
|
1036
|
+
gitConfig() {
|
|
1037
|
+
const root = index_1.Helpers.git.findGitRoot(this.cwd);
|
|
1038
|
+
index_1.Helpers.run(`code ${(0, tnp_core_2.crossPlatformPath)([root, '.git', 'config'])}`).sync();
|
|
1932
1039
|
this._exit();
|
|
1933
|
-
}
|
|
1040
|
+
}
|
|
1934
1041
|
//#endregion
|
|
1935
1042
|
//#region commands / lastCommitHash
|
|
1936
|
-
|
|
1043
|
+
LAST_COMMIT_HASH() {
|
|
1937
1044
|
console.log(index_1.Helpers.git.lastCommitHash(this.cwd));
|
|
1938
1045
|
this._exit();
|
|
1939
|
-
}
|
|
1046
|
+
}
|
|
1940
1047
|
//#endregion
|
|
1941
1048
|
//#region commands / commit message by hash
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
case 0:
|
|
1948
|
-
hash = this.firstArg;
|
|
1949
|
-
_b = (_a = console).log;
|
|
1950
|
-
return [4 /*yield*/, this.project.git.getCommitMessageByHash(hash)];
|
|
1951
|
-
case 1:
|
|
1952
|
-
_b.apply(_a, [_c.sent()]);
|
|
1953
|
-
this._exit();
|
|
1954
|
-
return [2 /*return*/];
|
|
1955
|
-
}
|
|
1956
|
-
});
|
|
1957
|
-
});
|
|
1958
|
-
};
|
|
1049
|
+
async COMMIT_MESSAGE_BY_HASH() {
|
|
1050
|
+
const hash = this.firstArg;
|
|
1051
|
+
console.log(await this.project.git.getCommitMessageByHash(hash));
|
|
1052
|
+
this._exit();
|
|
1053
|
+
}
|
|
1959
1054
|
//#endregion
|
|
1960
1055
|
//#region commands / last 5 commit hashes
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
_a.label = 1;
|
|
1969
|
-
case 1:
|
|
1970
|
-
if (!(index < 5)) return [3 /*break*/, 4];
|
|
1971
|
-
return [4 /*yield*/, this.project.git.getCommitHashByIndex(index)];
|
|
1972
|
-
case 2:
|
|
1973
|
-
hash = _a.sent();
|
|
1974
|
-
console.log(hash);
|
|
1975
|
-
_a.label = 3;
|
|
1976
|
-
case 3:
|
|
1977
|
-
index++;
|
|
1978
|
-
return [3 /*break*/, 1];
|
|
1979
|
-
case 4:
|
|
1980
|
-
this._exit();
|
|
1981
|
-
return [2 /*return*/];
|
|
1982
|
-
}
|
|
1983
|
-
});
|
|
1984
|
-
});
|
|
1985
|
-
};
|
|
1056
|
+
async LAST_5_COMMITS() {
|
|
1057
|
+
for (let index = 0; index < 5; index++) {
|
|
1058
|
+
const hash = await this.project.git.getCommitHashByIndex(index);
|
|
1059
|
+
console.log(hash);
|
|
1060
|
+
}
|
|
1061
|
+
this._exit();
|
|
1062
|
+
}
|
|
1986
1063
|
//#endregion
|
|
1987
1064
|
//#region commands / update deps from
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
if (tnp_core_1._.isArray(locations)) {
|
|
1995
|
-
locations = locations.map(function (l) {
|
|
1996
|
-
if (tnp_core_1.path.isAbsolute(l)) {
|
|
1997
|
-
return tnp_core_1.path.resolve(l);
|
|
1998
|
-
}
|
|
1999
|
-
return tnp_core_1.path.resolve(tnp_core_1.path.join(_this.cwd, l));
|
|
2000
|
-
});
|
|
1065
|
+
async updateDepsFrom() {
|
|
1066
|
+
let locations = this.args.join(' ').trim() === '' ? [] : this.args;
|
|
1067
|
+
if (tnp_core_1._.isArray(locations)) {
|
|
1068
|
+
locations = locations.map(l => {
|
|
1069
|
+
if (tnp_core_1.path.isAbsolute(l)) {
|
|
1070
|
+
return tnp_core_1.path.resolve(l);
|
|
2001
1071
|
}
|
|
2002
|
-
|
|
2003
|
-
this._exit();
|
|
2004
|
-
return [2 /*return*/];
|
|
1072
|
+
return tnp_core_1.path.resolve(tnp_core_1.path.join(this.cwd, l));
|
|
2005
1073
|
});
|
|
2006
|
-
}
|
|
2007
|
-
|
|
1074
|
+
}
|
|
1075
|
+
this.project.packageJson.updateDepsFrom(locations);
|
|
1076
|
+
this._exit();
|
|
1077
|
+
}
|
|
2008
1078
|
//#endregion
|
|
2009
1079
|
//#region is terminal supported
|
|
2010
|
-
|
|
2011
|
-
console.log(
|
|
1080
|
+
isTerminalSupported() {
|
|
1081
|
+
console.log(`Terminal is supported: ${index_1.Helpers.isSupportedTaonTerminal}`);
|
|
2012
1082
|
this._exit();
|
|
2013
|
-
}
|
|
1083
|
+
}
|
|
2014
1084
|
//#endregion
|
|
2015
1085
|
//#region prox ext
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
})
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
}
|
|
2037
|
-
});
|
|
2038
|
-
});
|
|
2039
|
-
};
|
|
2040
|
-
BaseGlobalCommandLine.prototype.INS_PROJ_EXT = function () {
|
|
2041
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2042
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2043
|
-
switch (_a.label) {
|
|
2044
|
-
case 0: return [4 /*yield*/, this.INSTALL_PROJ_EXT()];
|
|
2045
|
-
case 1:
|
|
2046
|
-
_a.sent();
|
|
2047
|
-
return [2 /*return*/];
|
|
2048
|
-
}
|
|
2049
|
-
});
|
|
2050
|
-
});
|
|
2051
|
-
};
|
|
2052
|
-
BaseGlobalCommandLine.prototype.INSTALL_PROJ_EXT = function () {
|
|
2053
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2054
|
-
var p, extensions;
|
|
2055
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2056
|
-
switch (_a.label) {
|
|
2057
|
-
case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
|
|
2058
|
-
case 1:
|
|
2059
|
-
if (!(_a.sent())) {
|
|
2060
|
-
return [2 /*return*/];
|
|
2061
|
-
}
|
|
2062
|
-
this.project.vsCodeHelpers.recreateExtensions();
|
|
2063
|
-
p = this.project.pathFor('.vscode/extensions.json');
|
|
2064
|
-
extensions = index_1.Helpers.readJson(p, { recommendations: [] }, true);
|
|
2065
|
-
index_1.Helpers.clearConsole();
|
|
2066
|
-
return [4 /*yield*/, this.project.vsCodeHelpers.installExtensions(extensions.recommendations, true)];
|
|
2067
|
-
case 2:
|
|
2068
|
-
_a.sent();
|
|
2069
|
-
this._exit();
|
|
2070
|
-
return [2 /*return*/];
|
|
2071
|
-
}
|
|
2072
|
-
});
|
|
2073
|
-
});
|
|
2074
|
-
};
|
|
1086
|
+
async INSTALL_PROJECT_EXTENSIONS() {
|
|
1087
|
+
await this.INSTALL_PROJ_EXT();
|
|
1088
|
+
}
|
|
1089
|
+
async INSTALL_PROJECT_EXT() {
|
|
1090
|
+
await this.INSTALL_PROJ_EXT();
|
|
1091
|
+
}
|
|
1092
|
+
async INS_PROJ_EXT() {
|
|
1093
|
+
await this.INSTALL_PROJ_EXT();
|
|
1094
|
+
}
|
|
1095
|
+
async INSTALL_PROJ_EXT() {
|
|
1096
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
|
|
1097
|
+
return;
|
|
1098
|
+
}
|
|
1099
|
+
this.project.vsCodeHelpers.recreateExtensions();
|
|
1100
|
+
const p = this.project.pathFor('.vscode/extensions.json');
|
|
1101
|
+
const extensions = index_1.Helpers.readJson(p, { recommendations: [] }, true);
|
|
1102
|
+
index_1.Helpers.clearConsole();
|
|
1103
|
+
await this.project.vsCodeHelpers.installExtensions(extensions.recommendations, true);
|
|
1104
|
+
this._exit();
|
|
1105
|
+
}
|
|
2075
1106
|
//#endregion
|
|
2076
1107
|
//#region proj db
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
return
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
}
|
|
2091
|
-
});
|
|
2092
|
-
});
|
|
2093
|
-
};
|
|
1108
|
+
async projdb() {
|
|
1109
|
+
if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
|
|
1110
|
+
return;
|
|
1111
|
+
}
|
|
1112
|
+
index_1.Helpers.info(`Projects db location:
|
|
1113
|
+
${this.project.linkedProjects.projectsDbLocation}
|
|
1114
|
+
|
|
1115
|
+
opening in vscode...
|
|
1116
|
+
|
|
1117
|
+
`);
|
|
1118
|
+
index_1.Helpers.run(`code ${this.project.linkedProjects.projectsDbLocation}`).sync();
|
|
1119
|
+
this._exit();
|
|
1120
|
+
}
|
|
2094
1121
|
//#endregion
|
|
2095
1122
|
//#region filter all project branches by pattern
|
|
2096
|
-
|
|
2097
|
-
|
|
1123
|
+
__filterBranchesByPattern(branchPatternOrBranchName) {
|
|
1124
|
+
const branches = index_1.Helpers.arrays.uniqArray(this.project.git.getBranchesNamesBy(branchPatternOrBranchName) ||
|
|
2098
1125
|
this.project.getMainBranches());
|
|
2099
1126
|
// console.log('branches', branches);
|
|
2100
1127
|
return branches;
|
|
2101
|
-
}
|
|
1128
|
+
}
|
|
2102
1129
|
//#endregion
|
|
2103
1130
|
//#region select branch from list of branches
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
}))];
|
|
2116
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
2117
|
-
}
|
|
2118
|
-
});
|
|
2119
|
-
});
|
|
2120
|
-
};
|
|
1131
|
+
async __selectBrach(branches, task) {
|
|
1132
|
+
const actionWithoutChildren = task === 'reset' && !this.project.git.resetIsRestingAlsoChildren();
|
|
1133
|
+
const childrenMsg = actionWithoutChildren
|
|
1134
|
+
? '(without children)'
|
|
1135
|
+
: this.project.children.length == 0
|
|
1136
|
+
? '(no children in project)'
|
|
1137
|
+
: '(with children)';
|
|
1138
|
+
return await index_1.Helpers.autocompleteAsk(`Choose branch to ${task} in this project ${childrenMsg}: `, branches.map(b => {
|
|
1139
|
+
return { name: b, value: b };
|
|
1140
|
+
}));
|
|
1141
|
+
}
|
|
2121
1142
|
//#endregion
|
|
2122
1143
|
//#region commands / clone
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
index_1.Helpers.git.clone({
|
|
2138
|
-
url: url,
|
|
2139
|
-
cwd: this.cwd,
|
|
2140
|
-
});
|
|
2141
|
-
this._exit();
|
|
2142
|
-
return [2 /*return*/];
|
|
2143
|
-
});
|
|
2144
|
-
});
|
|
2145
|
-
};
|
|
2146
|
-
//#endregion
|
|
2147
|
-
//#region commands / ghtemp
|
|
2148
|
-
BaseGlobalCommandLine.prototype.ghSave = function () {
|
|
2149
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2150
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2151
|
-
switch (_a.label) {
|
|
2152
|
-
case 0: return [4 /*yield*/, new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().save()];
|
|
2153
|
-
case 1:
|
|
2154
|
-
_a.sent();
|
|
2155
|
-
this._exit();
|
|
2156
|
-
return [2 /*return*/];
|
|
2157
|
-
}
|
|
2158
|
-
});
|
|
2159
|
-
});
|
|
2160
|
-
};
|
|
2161
|
-
BaseGlobalCommandLine.prototype.ghRestore = function () {
|
|
2162
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2163
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2164
|
-
switch (_a.label) {
|
|
2165
|
-
case 0: return [4 /*yield*/, new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().restore()];
|
|
2166
|
-
case 1:
|
|
2167
|
-
_a.sent();
|
|
2168
|
-
this._exit();
|
|
2169
|
-
return [2 /*return*/];
|
|
2170
|
-
}
|
|
2171
|
-
});
|
|
1144
|
+
async clone() {
|
|
1145
|
+
let url = this.firstArg;
|
|
1146
|
+
const originType = this.params['setOrigin'];
|
|
1147
|
+
if (originType) {
|
|
1148
|
+
if (originType === 'ssh') {
|
|
1149
|
+
url = index_1.Helpers.git.originHttpToSsh(url);
|
|
1150
|
+
}
|
|
1151
|
+
if (originType === 'http') {
|
|
1152
|
+
url = index_1.Helpers.git.originSshToHttp(url);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
index_1.Helpers.git.clone({
|
|
1156
|
+
url,
|
|
1157
|
+
cwd: this.cwd,
|
|
2172
1158
|
});
|
|
2173
|
-
|
|
1159
|
+
this._exit();
|
|
1160
|
+
}
|
|
1161
|
+
//#endregion
|
|
1162
|
+
//#region commands / gh temp
|
|
1163
|
+
async ghSave() {
|
|
1164
|
+
await new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().save();
|
|
1165
|
+
this._exit();
|
|
1166
|
+
}
|
|
1167
|
+
async ghRestore() {
|
|
1168
|
+
await new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().restore();
|
|
1169
|
+
this._exit();
|
|
1170
|
+
}
|
|
2174
1171
|
//#endregion
|
|
2175
1172
|
//#region commands / start cli service ports worker
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
switch (_a.label) {
|
|
2180
|
-
case 0: return [4 /*yield*/, this.ins.portsWorker.infoScreen()];
|
|
2181
|
-
case 1:
|
|
2182
|
-
_a.sent();
|
|
2183
|
-
return [2 /*return*/];
|
|
2184
|
-
}
|
|
2185
|
-
});
|
|
2186
|
-
});
|
|
2187
|
-
};
|
|
1173
|
+
async ports() {
|
|
1174
|
+
await this.ins.portsWorker.infoScreen();
|
|
1175
|
+
}
|
|
2188
1176
|
/**
|
|
2189
1177
|
* tnp startCliServicePortsWorker --restart
|
|
2190
1178
|
*/
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
switch (_a.label) {
|
|
2195
|
-
case 0: return [4 /*yield*/, this.ins.portsWorker.cliStartProcedure(this.params)];
|
|
2196
|
-
case 1:
|
|
2197
|
-
_a.sent();
|
|
2198
|
-
return [2 /*return*/];
|
|
2199
|
-
}
|
|
2200
|
-
});
|
|
2201
|
-
});
|
|
2202
|
-
};
|
|
1179
|
+
async startCliServicePortsWorker() {
|
|
1180
|
+
await this.ins.portsWorker.cliStartProcedure(this.params);
|
|
1181
|
+
}
|
|
2203
1182
|
//#endregion
|
|
2204
1183
|
//#region commands / pause terminal
|
|
2205
|
-
|
|
1184
|
+
pauseTerminal() {
|
|
2206
1185
|
index_1.Helpers.pressKeyAndContinue();
|
|
2207
1186
|
this._exit();
|
|
2208
|
-
}
|
|
1187
|
+
}
|
|
2209
1188
|
//#endregion
|
|
2210
1189
|
//#region commands / gh pages init
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
case 2:
|
|
2220
|
-
_a.sent();
|
|
2221
|
-
index_1.Helpers.run('code .', {
|
|
2222
|
-
cwd: this.project.githubPages.mainFolderAbsPath,
|
|
2223
|
-
}).sync();
|
|
2224
|
-
this._exit();
|
|
2225
|
-
return [2 /*return*/];
|
|
2226
|
-
}
|
|
2227
|
-
});
|
|
2228
|
-
});
|
|
2229
|
-
};
|
|
1190
|
+
async ghPagesInit() {
|
|
1191
|
+
await this.project.init();
|
|
1192
|
+
await this.project.staticPages.init(this.params['provider'] || 'github', !!this.params['full']);
|
|
1193
|
+
index_1.Helpers.run('code .', {
|
|
1194
|
+
cwd: this.project.staticPages.mainFolderAbsPath,
|
|
1195
|
+
}).sync();
|
|
1196
|
+
this._exit();
|
|
1197
|
+
}
|
|
2230
1198
|
//#endregion
|
|
2231
1199
|
//#region commands / is port in use
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
1200
|
+
async isPortInUse() {
|
|
1201
|
+
const port = parseInt(this.firstArg);
|
|
1202
|
+
console.log(`Port ${port} is in use: ${await tnp_core_1.UtilsOs.isPortInUse(port)}`);
|
|
1203
|
+
this._exit();
|
|
1204
|
+
}
|
|
1205
|
+
//#endregion
|
|
1206
|
+
//#region commands / proc menu
|
|
1207
|
+
//#region @notForNpm
|
|
1208
|
+
async procMenu() {
|
|
1209
|
+
//#region @backendFunc
|
|
1210
|
+
const { BaseProcessManger, CommandConfig } = await Promise.resolve().then(() => require('./base-process-manager'));
|
|
1211
|
+
const ngBuildLibCommand = CommandConfig.from({
|
|
1212
|
+
name: 'TSC',
|
|
1213
|
+
cmd: 'node -e "let i = 0; setInterval(() => console.log(\'TSC lib Compiled success \' + (++i)), 1000)"',
|
|
1214
|
+
goToNextCommandWhenOutput: {
|
|
1215
|
+
stdoutContains: 'TSC lib Compiled success 5',
|
|
1216
|
+
},
|
|
1217
|
+
});
|
|
1218
|
+
const angularNormalNgServe = CommandConfig.from({
|
|
1219
|
+
shouldBeActiveOrAlreadyBuild: [ngBuildLibCommand],
|
|
1220
|
+
name: 'NG Normal',
|
|
1221
|
+
cmd: 'node -e "let i = 0; setInterval(() => console.log(\'NG NORMAL: Hello from ng --watch \' + (++i)), 1200)"',
|
|
1222
|
+
goToNextCommandWhenOutput: {
|
|
1223
|
+
stdoutContains: 'NG NORMAL: Hello from ng --watch 5',
|
|
1224
|
+
},
|
|
1225
|
+
});
|
|
1226
|
+
const angularWebsqlNgServe = CommandConfig.from({
|
|
1227
|
+
shouldBeActiveOrAlreadyBuild: [ngBuildLibCommand],
|
|
1228
|
+
name: 'NG websql',
|
|
1229
|
+
cmd: 'node -e "let i = 0; setInterval(() => console.log(\'NG WEBSQL: Hello from ng --watch \' + (++i)), 1200)"',
|
|
1230
|
+
goToNextCommandWhenOutput: {
|
|
1231
|
+
stdoutContains: 'NG WEBSQL: Hello from ng --watch 5',
|
|
1232
|
+
},
|
|
1233
|
+
});
|
|
1234
|
+
const electronNormalNgServe = CommandConfig.from({
|
|
1235
|
+
shouldBeActiveOrAlreadyBuild: [angularNormalNgServe],
|
|
1236
|
+
name: 'ELECTRON Normal',
|
|
1237
|
+
cmd: 'node -e "let i = 0; setInterval(() => console.log(\'ELECTRON Normal: Hello from electron \' + (++i)), 1500)"',
|
|
1238
|
+
});
|
|
1239
|
+
const updateAssets = CommandConfig.from({
|
|
1240
|
+
name: 'Update assets',
|
|
1241
|
+
cmd: 'node -e "let i = 0; setInterval(() => console.log(\'Updated assets \' + (++i)), 1000)"',
|
|
1242
|
+
});
|
|
1243
|
+
await new BaseProcessManger(this.project).init({
|
|
1244
|
+
title: 'What do you want to build?',
|
|
1245
|
+
header: 'Starting process selection...',
|
|
1246
|
+
watch: true,
|
|
1247
|
+
commands: [
|
|
1248
|
+
ngBuildLibCommand,
|
|
1249
|
+
angularNormalNgServe,
|
|
1250
|
+
angularWebsqlNgServe,
|
|
1251
|
+
electronNormalNgServe,
|
|
1252
|
+
updateAssets,
|
|
1253
|
+
],
|
|
1254
|
+
});
|
|
1255
|
+
//#endregion
|
|
1256
|
+
}
|
|
1257
|
+
//#endregion
|
|
1258
|
+
//#endregion
|
|
1259
|
+
//#region commands / proc info
|
|
1260
|
+
procInfo() {
|
|
1261
|
+
this.processInfo();
|
|
1262
|
+
}
|
|
1263
|
+
processInfo() {
|
|
1264
|
+
index_1.Helpers.info(`
|
|
1265
|
+
|
|
1266
|
+
Is running in CLI mode: ${tnp_core_1.UtilsOs.isRunningInCliMode()}
|
|
1267
|
+
Is running in Mocha test: ${tnp_core_1.UtilsOs.isRunningInMochaTest()}
|
|
1268
|
+
Is running in VSCode extension: ${tnp_core_1.UtilsOs.isRunningInVscodeExtension()}
|
|
1269
|
+
Is running in Electron: ${tnp_core_1.UtilsOs.isRunningInElectron()}
|
|
1270
|
+
Is running in Docker: ${tnp_core_1.UtilsOs.isRunningInDocker()}
|
|
1271
|
+
Is running in WebSQL: ${tnp_core_1.UtilsOs.isRunningInWebSQL()}
|
|
1272
|
+
Is running in WSL: ${tnp_core_1.UtilsOs.isRunningInWsl()}
|
|
1273
|
+
Is running in Linux graphics capable environment: ${tnp_core_1.UtilsOs.isRunningInLinuxGraphicsCapableEnvironment()}
|
|
1274
|
+
Is running in Node: ${tnp_core_1.UtilsOs.isRunningInNode()}
|
|
1275
|
+
Is running in Browser: ${tnp_core_1.UtilsOs.isRunningInBrowser()}
|
|
1276
|
+
|
|
1277
|
+
`);
|
|
1278
|
+
this._exit();
|
|
1279
|
+
}
|
|
1280
|
+
//#endregion
|
|
1281
|
+
lastGitTag() {
|
|
1282
|
+
console.log(this.project?.git.lastTagVersionName);
|
|
1283
|
+
this._exit();
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
2252
1286
|
exports.BaseGlobalCommandLine = BaseGlobalCommandLine;
|
|
2253
1287
|
//# sourceMappingURL=base-global-command-line.backend.js.map
|