tnp-helpers 18.0.9 → 18.0.12

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.
Files changed (135) hide show
  1. package/assets/shared/shared_folder_info.txt +1 -1
  2. package/browser/README.md +24 -24
  3. package/browser/esm2022/lib/base/base-compiler-for-project.mjs +48 -0
  4. package/browser/esm2022/lib/base/base-debounce-compiler-for-project.mjs +37 -0
  5. package/browser/esm2022/lib/base/base-git.mjs +49 -2
  6. package/browser/esm2022/lib/base/base-project.mjs +97 -26
  7. package/browser/esm2022/lib/base/base-vscode.mjs +32 -4
  8. package/browser/esm2022/lib/base/commit-data.mjs +8 -1
  9. package/browser/esm2022/lib/base/index.mjs +4 -1
  10. package/browser/esm2022/lib/helpers/helpers-array-obj.mjs +31 -25
  11. package/browser/esm2022/lib/helpers/helpers.mjs +5 -1
  12. package/browser/esm2022/lib/utils.mjs +250 -1
  13. package/browser/fesm2022/tnp-helpers.mjs +637 -53
  14. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  15. package/browser/lib/base/base-compiler-for-project.d.ts +6 -0
  16. package/browser/lib/base/base-debounce-compiler-for-project.d.ts +21 -0
  17. package/browser/lib/base/base-git.d.ts +3 -1
  18. package/browser/lib/base/base-npm-helpers.d.ts +4 -4
  19. package/browser/lib/base/base-project.d.ts +23 -9
  20. package/browser/lib/base/base-vscode.d.ts +7 -1
  21. package/browser/lib/base/commit-data.d.ts +1 -0
  22. package/browser/lib/base/index.d.ts +3 -0
  23. package/browser/lib/helpers/helpers-array-obj.d.ts +2 -2
  24. package/browser/lib/helpers/helpers.d.ts +4 -0
  25. package/browser/lib/utils.d.ts +17 -0
  26. package/client/README.md +24 -24
  27. package/client/esm2022/lib/base/base-compiler-for-project.mjs +48 -0
  28. package/client/esm2022/lib/base/base-debounce-compiler-for-project.mjs +37 -0
  29. package/client/esm2022/lib/base/base-git.mjs +49 -2
  30. package/client/esm2022/lib/base/base-project.mjs +97 -26
  31. package/client/esm2022/lib/base/base-vscode.mjs +32 -4
  32. package/client/esm2022/lib/base/commit-data.mjs +8 -1
  33. package/client/esm2022/lib/base/index.mjs +4 -1
  34. package/client/esm2022/lib/helpers/helpers-array-obj.mjs +31 -25
  35. package/client/esm2022/lib/helpers/helpers.mjs +5 -1
  36. package/client/esm2022/lib/utils.mjs +250 -1
  37. package/client/fesm2022/tnp-helpers.mjs +637 -53
  38. package/client/fesm2022/tnp-helpers.mjs.map +1 -1
  39. package/client/lib/base/base-compiler-for-project.d.ts +6 -0
  40. package/client/lib/base/base-debounce-compiler-for-project.d.ts +21 -0
  41. package/client/lib/base/base-git.d.ts +3 -1
  42. package/client/lib/base/base-npm-helpers.d.ts +4 -4
  43. package/client/lib/base/base-project.d.ts +23 -9
  44. package/client/lib/base/base-vscode.d.ts +7 -1
  45. package/client/lib/base/commit-data.d.ts +1 -0
  46. package/client/lib/base/index.d.ts +3 -0
  47. package/client/lib/helpers/helpers-array-obj.d.ts +2 -2
  48. package/client/lib/helpers/helpers.d.ts +4 -0
  49. package/client/lib/utils.d.ts +17 -0
  50. package/lib/base/base-command-line.backend.d.ts +15 -1
  51. package/lib/base/base-command-line.backend.js +275 -40
  52. package/lib/base/base-command-line.backend.js.map +1 -1
  53. package/lib/base/base-compiler-for-project.d.ts +7 -0
  54. package/lib/base/base-compiler-for-project.js +61 -0
  55. package/lib/base/base-compiler-for-project.js.map +1 -0
  56. package/lib/base/base-debounce-compiler-for-project.d.ts +20 -0
  57. package/lib/base/base-debounce-compiler-for-project.js +61 -0
  58. package/lib/base/base-debounce-compiler-for-project.js.map +1 -0
  59. package/lib/base/base-git.d.ts +3 -1
  60. package/lib/base/base-git.js +55 -11
  61. package/lib/base/base-git.js.map +1 -1
  62. package/lib/base/base-ignore-hide.d.ts +14 -0
  63. package/lib/base/base-ignore-hide.js +55 -0
  64. package/lib/base/base-ignore-hide.js.map +1 -0
  65. package/lib/base/base-npm-helpers.d.ts +4 -4
  66. package/lib/base/base-project-resolver.js +3 -2
  67. package/lib/base/base-project-resolver.js.map +1 -1
  68. package/lib/base/base-project.d.ts +19 -7
  69. package/lib/base/base-project.js +112 -41
  70. package/lib/base/base-project.js.map +1 -1
  71. package/lib/base/base-vscode.d.ts +7 -1
  72. package/lib/base/base-vscode.js +24 -3
  73. package/lib/base/base-vscode.js.map +1 -1
  74. package/lib/base/command-line-feature.backend.d.ts +4 -0
  75. package/lib/base/command-line-feature.backend.js +10 -0
  76. package/lib/base/command-line-feature.backend.js.map +1 -1
  77. package/lib/base/commit-data.d.ts +1 -0
  78. package/lib/base/commit-data.js +13 -8
  79. package/lib/base/commit-data.js.map +1 -1
  80. package/lib/base/gh-temp-code.d.ts +12 -0
  81. package/lib/base/gh-temp-code.js +125 -0
  82. package/lib/base/gh-temp-code.js.map +1 -0
  83. package/lib/base/index.d.ts +3 -0
  84. package/lib/base/index.js +3 -0
  85. package/lib/base/index.js.map +1 -1
  86. package/lib/helpers/for-backend/helpers-cli-tool.backend.js +2 -2
  87. package/lib/helpers/for-backend/helpers-cli-tool.backend.js.map +1 -1
  88. package/lib/helpers/for-backend/helpers-git.backend.d.ts +1 -0
  89. package/lib/helpers/for-backend/helpers-git.backend.js +53 -3
  90. package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
  91. package/lib/helpers/for-backend/helpers-process.backend.js +3 -3
  92. package/lib/helpers/for-backend/helpers-process.backend.js.map +1 -1
  93. package/lib/helpers/for-browser/angular.helper.js +2 -2
  94. package/lib/helpers/helpers-array-obj.d.ts +2 -2
  95. package/lib/helpers/helpers-array-obj.js +29 -21
  96. package/lib/helpers/helpers-array-obj.js.map +1 -1
  97. package/lib/helpers/helpers.d.ts +4 -0
  98. package/lib/helpers/helpers.js +10 -6
  99. package/lib/helpers/helpers.js.map +1 -1
  100. package/lib/index._auto-generated_.d.ts +0 -0
  101. package/lib/index._auto-generated_.js +6 -0
  102. package/lib/index._auto-generated_.js.map +1 -0
  103. package/lib/old/base-component.js +2 -2
  104. package/lib/old/base-formly-component.js +2 -2
  105. package/lib/old/dual-component-ctrl.js +2 -2
  106. package/lib/utils.d.ts +17 -0
  107. package/lib/utils.js +209 -10
  108. package/lib/utils.js.map +1 -1
  109. package/package.json +7 -5
  110. package/taon.jsonc +49 -48
  111. package/tmp-environment.json +33 -31
  112. package/websql/README.md +24 -24
  113. package/websql/esm2022/lib/base/base-compiler-for-project.mjs +48 -0
  114. package/websql/esm2022/lib/base/base-debounce-compiler-for-project.mjs +37 -0
  115. package/websql/esm2022/lib/base/base-git.mjs +49 -2
  116. package/websql/esm2022/lib/base/base-project.mjs +97 -26
  117. package/websql/esm2022/lib/base/base-vscode.mjs +32 -4
  118. package/websql/esm2022/lib/base/commit-data.mjs +8 -1
  119. package/websql/esm2022/lib/base/index.mjs +4 -1
  120. package/websql/esm2022/lib/helpers/helpers-array-obj.mjs +31 -25
  121. package/websql/esm2022/lib/helpers/helpers.mjs +5 -1
  122. package/websql/esm2022/lib/utils.mjs +250 -1
  123. package/websql/fesm2022/tnp-helpers.mjs +637 -53
  124. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  125. package/websql/lib/base/base-compiler-for-project.d.ts +6 -0
  126. package/websql/lib/base/base-debounce-compiler-for-project.d.ts +21 -0
  127. package/websql/lib/base/base-git.d.ts +3 -1
  128. package/websql/lib/base/base-npm-helpers.d.ts +4 -4
  129. package/websql/lib/base/base-project.d.ts +25 -9
  130. package/websql/lib/base/base-vscode.d.ts +7 -1
  131. package/websql/lib/base/commit-data.d.ts +1 -0
  132. package/websql/lib/base/index.d.ts +3 -0
  133. package/websql/lib/helpers/helpers-array-obj.d.ts +2 -2
  134. package/websql/lib/helpers/helpers.d.ts +4 -0
  135. package/websql/lib/utils.d.ts +17 -0
@@ -8,6 +8,7 @@ var tnp_core_1 = require("tnp-core");
8
8
  var tnp_config_1 = require("tnp-config");
9
9
  var tnp_config_2 = require("tnp-config");
10
10
  var tnp_core_2 = require("tnp-core");
11
+ var gh_temp_code_1 = require("./gh-temp-code");
11
12
  var BaseCommandLine = /** @class */ (function (_super) {
12
13
  tslib_1.__extends(BaseCommandLine, _super);
13
14
  function BaseCommandLine() {
@@ -16,20 +17,25 @@ var BaseCommandLine = /** @class */ (function (_super) {
16
17
  BaseCommandLine.prototype._ = function () {
17
18
  index_1.Helpers.error('Please select git command');
18
19
  };
20
+ //#region commands / prevent cwd is not project
19
21
  /**
20
22
  * TODO return argument not need for now
21
23
  */
22
- BaseCommandLine.prototype.preventCwdIsNotProject = function () {
24
+ BaseCommandLine.prototype.cwdIsProject = function (options) {
23
25
  return tslib_1.__awaiter(this, void 0, void 0, function () {
24
- var proj, useRoot;
26
+ var requireProjectWithGitRoot, proj, useRoot;
25
27
  return tslib_1.__generator(this, function (_a) {
26
28
  switch (_a.label) {
27
29
  case 0:
28
- if (!(!this.project || !this.project.git.isGitRoot)) return [3 /*break*/, 3];
29
- if (!!this.project.git.isGitRoot) return [3 /*break*/, 2];
30
+ requireProjectWithGitRoot = (options || {}).requireProjectWithGitRoot;
31
+ if (!!this.project && !requireProjectWithGitRoot) {
32
+ return [2 /*return*/, true];
33
+ }
34
+ if (!(requireProjectWithGitRoot &&
35
+ (!this.project || !this.project.git.isGitRoot))) return [3 /*break*/, 3];
30
36
  proj = this.ins.nearestTo(this.cwd, { findGitRoot: true });
31
37
  if (!proj) return [3 /*break*/, 2];
32
- index_1.Helpers.info("\n Current folder (".concat(this.cwd, ")\n is not a git root folder, but nearest project with\n git root has been found in: ").concat(tnp_core_1.chalk.bold(proj.genericName), "\n\n "));
38
+ index_1.Helpers.info("\n Current folder (".concat(this.cwd, ")\n is not a git root folder, but nearest project with\n git root has been found in: ").concat(tnp_core_1.chalk.bold(proj.genericName), "\n\n "));
33
39
  return [4 /*yield*/, index_1.Helpers.questionYesNo('Would you like to use this project ?')];
34
40
  case 1:
35
41
  useRoot = _a.sent();
@@ -38,15 +44,19 @@ var BaseCommandLine = /** @class */ (function (_super) {
38
44
  this.cwd = proj.location;
39
45
  return [2 /*return*/, true];
40
46
  }
41
- _a.label = 2;
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];
42
51
  case 2:
43
- index_1.Helpers.error('This is not a project folder', false, true);
52
+ index_1.Helpers.error("[".concat(tnp_config_2.config.frameworkName, "] This folder is not project folder"), false, true);
44
53
  _a.label = 3;
45
54
  case 3: return [2 /*return*/, true];
46
55
  }
47
56
  });
48
57
  });
49
58
  };
59
+ //#endregion
50
60
  //#region commands / hosts
51
61
  BaseCommandLine.prototype.hosts = function () {
52
62
  index_1.Helpers.run("code ".concat((0, tnp_core_2.crossPlatformPath)(tnp_config_1.HOST_FILE_PATH))).sync();
@@ -110,7 +120,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
110
120
  return tslib_1.__awaiter(this, void 0, void 0, function () {
111
121
  return tslib_1.__generator(this, function (_a) {
112
122
  switch (_a.label) {
113
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
123
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
114
124
  case 1:
115
125
  if (!(_a.sent())) {
116
126
  return [2 /*return*/];
@@ -153,7 +163,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
153
163
  if (noExit === void 0) { noExit = false; }
154
164
  return tslib_1.__generator(this, function (_a) {
155
165
  switch (_a.label) {
156
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
166
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
157
167
  case 1:
158
168
  if (!(_a.sent())) {
159
169
  return [2 /*return*/];
@@ -347,12 +357,46 @@ var BaseCommandLine = /** @class */ (function (_super) {
347
357
  });
348
358
  };
349
359
  //#endregion
360
+ //#region commands / repulll
361
+ BaseCommandLine.prototype.repul = function () {
362
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
363
+ return tslib_1.__generator(this, function (_a) {
364
+ switch (_a.label) {
365
+ case 0: return [4 /*yield*/, this.repull()];
366
+ case 1:
367
+ _a.sent();
368
+ return [2 /*return*/];
369
+ }
370
+ });
371
+ });
372
+ };
373
+ BaseCommandLine.prototype.repull = function () {
374
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
375
+ return tslib_1.__generator(this, function (_a) {
376
+ switch (_a.label) {
377
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
378
+ case 1:
379
+ if (!(_a.sent())) {
380
+ return [2 /*return*/];
381
+ }
382
+ return [4 /*yield*/, this.project.git.resetHard({ HEAD: 10 })];
383
+ case 2:
384
+ _a.sent();
385
+ return [4 /*yield*/, this.pull()];
386
+ case 3:
387
+ _a.sent();
388
+ return [2 /*return*/];
389
+ }
390
+ });
391
+ });
392
+ };
393
+ //#endregion
350
394
  //#region commands / pull
351
395
  BaseCommandLine.prototype.pull = function () {
352
396
  return tslib_1.__awaiter(this, void 0, void 0, function () {
353
397
  return tslib_1.__generator(this, function (_a) {
354
398
  switch (_a.label) {
355
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
399
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
356
400
  case 1:
357
401
  if (!(_a.sent())) {
358
402
  return [2 /*return*/];
@@ -374,7 +418,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
374
418
  return tslib_1.__awaiter(this, void 0, void 0, function () {
375
419
  return tslib_1.__generator(this, function (_a) {
376
420
  switch (_a.label) {
377
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
421
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
378
422
  case 1:
379
423
  if (!(_a.sent())) {
380
424
  return [2 /*return*/];
@@ -400,6 +444,19 @@ var BaseCommandLine = /** @class */ (function (_super) {
400
444
  .join('\n'))
401
445
  : '', "\n "));
402
446
  };
447
+ BaseCommandLine.prototype.fetch = function () {
448
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
449
+ var _a, _b;
450
+ return tslib_1.__generator(this, function (_c) {
451
+ try {
452
+ (_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.git) === null || _b === void 0 ? void 0 : _b.fetch();
453
+ }
454
+ catch (error) { }
455
+ this._exit();
456
+ return [2 /*return*/];
457
+ });
458
+ });
459
+ };
403
460
  BaseCommandLine.prototype.reset = function () {
404
461
  return tslib_1.__awaiter(this, void 0, void 0, function () {
405
462
  var parent, branchFromLinkedProjectConfig, overrideBranchToReset, resetOnlyChildren, branches, resetProject, res;
@@ -407,7 +464,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
407
464
  var _a, _b, _c, _d, _e;
408
465
  return tslib_1.__generator(this, function (_f) {
409
466
  switch (_f.label) {
410
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
467
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
411
468
  case 1:
412
469
  // Helpers.clearConsole();
413
470
  if (!(_f.sent())) {
@@ -433,7 +490,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
433
490
  return [3 /*break*/, 5];
434
491
  case 2:
435
492
  if (!(branches.length > 0)) return [3 /*break*/, 4];
436
- return [4 /*yield*/, this.__selectBrach(branches)];
493
+ return [4 /*yield*/, this.__selectBrach(branches, 'reset')];
437
494
  case 3:
438
495
  overrideBranchToReset = _f.sent();
439
496
  return [3 /*break*/, 5];
@@ -479,7 +536,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
479
536
  return tslib_1.__awaiter(this, void 0, void 0, function () {
480
537
  return tslib_1.__generator(this, function (_a) {
481
538
  switch (_a.label) {
482
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
539
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
483
540
  case 1:
484
541
  // TODO when aciton commit
485
542
  if (!(_a.sent())) {
@@ -499,7 +556,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
499
556
  var currentBranch, safeReset, rebaseBranch, branches, error_3;
500
557
  return tslib_1.__generator(this, function (_a) {
501
558
  switch (_a.label) {
502
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
559
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
503
560
  case 1:
504
561
  if (!(_a.sent())) {
505
562
  return [2 /*return*/];
@@ -509,7 +566,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
509
566
  rebaseBranch = this.firstArg || this.project.getDefaultDevelopmentBranch();
510
567
  branches = this.__filterBranchesByPattern(rebaseBranch);
511
568
  if (!(branches.length > 0)) return [3 /*break*/, 3];
512
- return [4 /*yield*/, this.__selectBrach(branches)];
569
+ return [4 /*yield*/, this.__selectBrach(branches, 'reset')];
513
570
  case 2:
514
571
  rebaseBranch = _a.sent();
515
572
  return [3 /*break*/, 4];
@@ -550,7 +607,9 @@ var BaseCommandLine = /** @class */ (function (_super) {
550
607
  return tslib_1.__awaiter(this, void 0, void 0, function () {
551
608
  return tslib_1.__generator(this, function (_a) {
552
609
  switch (_a.label) {
553
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
610
+ case 0:
611
+ index_1.Helpers.info("Stashing only staged files...");
612
+ return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
554
613
  case 1:
555
614
  if (!(_a.sent())) {
556
615
  return [2 /*return*/];
@@ -571,7 +630,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
571
630
  return tslib_1.__awaiter(this, void 0, void 0, function () {
572
631
  return tslib_1.__generator(this, function (_a) {
573
632
  switch (_a.label) {
574
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
633
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
575
634
  case 1:
576
635
  if (!(_a.sent())) {
577
636
  return [2 /*return*/];
@@ -593,7 +652,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
593
652
  return tslib_1.__awaiter(this, void 0, void 0, function () {
594
653
  return tslib_1.__generator(this, function (_a) {
595
654
  switch (_a.label) {
596
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
655
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
597
656
  case 1:
598
657
  if (!(_a.sent())) {
599
658
  return [2 /*return*/];
@@ -651,7 +710,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
651
710
  if (force === void 0) { force = false; }
652
711
  return tslib_1.__generator(this, function (_b) {
653
712
  switch (_b.label) {
654
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
713
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
655
714
  case 1:
656
715
  if (!(_b.sent())) {
657
716
  return [2 /*return*/];
@@ -716,7 +775,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
716
775
  if (options === void 0) { options = {}; }
717
776
  return tslib_1.__generator(this, function (_a) {
718
777
  switch (_a.label) {
719
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
778
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
720
779
  case 1:
721
780
  if (!(_a.sent())) {
722
781
  return [2 /*return*/];
@@ -726,7 +785,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
726
785
  _a.sent();
727
786
  return [4 /*yield*/, this.project.git.pushProcess(tslib_1.__assign(tslib_1.__assign({}, options), { forcePushNoQuestion: options.force, args: this.args, exitCallBack: function () {
728
787
  _this._exit();
729
- }, skipChildren: true, setOrigin: this.params['setOrigin'], currentOrigin: this.project.git.originURL }))];
788
+ }, skipChildren: true, overrideCommitMessage: this.args.join(' '), setOrigin: this.params['setOrigin'], currentOrigin: this.project.git.originURL }))];
730
789
  case 3:
731
790
  _a.sent();
732
791
  if (options.noExit) {
@@ -804,7 +863,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
804
863
  if (options === void 0) { options = {}; }
805
864
  return tslib_1.__generator(this, function (_a) {
806
865
  switch (_a.label) {
807
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
866
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
808
867
  case 1:
809
868
  // console.log('args', this.args);
810
869
  // console.log(`argsWithParams "${this.argsWithParams}"` );
@@ -831,12 +890,12 @@ var BaseCommandLine = /** @class */ (function (_super) {
831
890
  });
832
891
  };
833
892
  //#endregion
834
- //#region commands / melt
893
+ //#region commands / melt
835
894
  BaseCommandLine.prototype.melt = function () {
836
895
  return tslib_1.__awaiter(this, void 0, void 0, function () {
837
896
  return tslib_1.__generator(this, function (_a) {
838
897
  switch (_a.label) {
839
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
898
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
840
899
  case 1:
841
900
  if (!(_a.sent())) {
842
901
  return [2 /*return*/];
@@ -851,7 +910,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
851
910
  });
852
911
  };
853
912
  //#endregion
854
- //#region melt updat ecommits
913
+ //#region commands / melt updat ecommits
855
914
  BaseCommandLine.prototype.meltUpdateCommits = function () {
856
915
  return tslib_1.__awaiter(this, arguments, void 0, function (hideInfo) {
857
916
  if (hideInfo === void 0) { hideInfo = false; }
@@ -1122,6 +1181,30 @@ var BaseCommandLine = /** @class */ (function (_super) {
1122
1181
  });
1123
1182
  });
1124
1183
  };
1184
+ BaseCommandLine.prototype.pTest = function () {
1185
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1186
+ return tslib_1.__generator(this, function (_a) {
1187
+ switch (_a.label) {
1188
+ case 0: return [4 /*yield*/, this.pushTest()];
1189
+ case 1:
1190
+ _a.sent();
1191
+ return [2 /*return*/];
1192
+ }
1193
+ });
1194
+ });
1195
+ };
1196
+ BaseCommandLine.prototype.pTests = function () {
1197
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1198
+ return tslib_1.__generator(this, function (_a) {
1199
+ switch (_a.label) {
1200
+ case 0: return [4 /*yield*/, this.pushTest()];
1201
+ case 1:
1202
+ _a.sent();
1203
+ return [2 /*return*/];
1204
+ }
1205
+ });
1206
+ });
1207
+ };
1125
1208
  //#endregion
1126
1209
  //#region commands / push perf
1127
1210
  BaseCommandLine.prototype.pushPerf = function () {
@@ -1160,6 +1243,39 @@ var BaseCommandLine = /** @class */ (function (_super) {
1160
1243
  });
1161
1244
  };
1162
1245
  //#endregion
1246
+ //#region commands / select branch
1247
+ BaseCommandLine.prototype.branch = function () {
1248
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1249
+ var branchName, branches;
1250
+ return tslib_1.__generator(this, function (_a) {
1251
+ switch (_a.label) {
1252
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1253
+ case 1:
1254
+ if (!(_a.sent())) {
1255
+ return [2 /*return*/];
1256
+ }
1257
+ return [4 /*yield*/, this.project.struct()];
1258
+ case 2:
1259
+ _a.sent();
1260
+ branchName = this.firstArg;
1261
+ branches = this.__filterBranchesByPattern(branchName);
1262
+ if (!(branches.length > 0)) return [3 /*break*/, 4];
1263
+ return [4 /*yield*/, this.__selectBrach(branches, 'checkout')];
1264
+ case 3:
1265
+ branchName = _a.sent();
1266
+ return [3 /*break*/, 5];
1267
+ case 4:
1268
+ index_1.Helpers.error("No branch found by name \"".concat(branchName, "\""), false, true);
1269
+ _a.label = 5;
1270
+ case 5:
1271
+ this.project.git.checkout(branchName);
1272
+ this._exit();
1273
+ return [2 /*return*/];
1274
+ }
1275
+ });
1276
+ });
1277
+ };
1278
+ //#endregion
1163
1279
  //#region commands / push build
1164
1280
  BaseCommandLine.prototype.pushBuild = function () {
1165
1281
  return tslib_1.__awaiter(this, void 0, void 0, function () {
@@ -1183,7 +1299,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1183
1299
  var newOriginNameOrUrl, proj;
1184
1300
  return tslib_1.__generator(this, function (_a) {
1185
1301
  switch (_a.label) {
1186
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
1302
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1187
1303
  case 1:
1188
1304
  if (!(_a.sent())) {
1189
1305
  return [2 /*return*/];
@@ -1211,7 +1327,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1211
1327
  var newOriginNameOrUrl, proj;
1212
1328
  return tslib_1.__generator(this, function (_a) {
1213
1329
  switch (_a.label) {
1214
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
1330
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1215
1331
  case 1:
1216
1332
  if (!(_a.sent())) {
1217
1333
  return [2 /*return*/];
@@ -1236,7 +1352,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1236
1352
  return tslib_1.__awaiter(this, void 0, void 0, function () {
1237
1353
  return tslib_1.__generator(this, function (_a) {
1238
1354
  switch (_a.label) {
1239
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
1355
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1240
1356
  case 1:
1241
1357
  if (!(_a.sent())) {
1242
1358
  return [2 /*return*/];
@@ -1255,7 +1371,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1255
1371
  var proj;
1256
1372
  return tslib_1.__generator(this, function (_a) {
1257
1373
  switch (_a.label) {
1258
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
1374
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1259
1375
  case 1:
1260
1376
  if (!(_a.sent())) {
1261
1377
  return [2 /*return*/];
@@ -1283,7 +1399,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1283
1399
  return tslib_1.__awaiter(this, void 0, void 0, function () {
1284
1400
  return tslib_1.__generator(this, function (_a) {
1285
1401
  switch (_a.label) {
1286
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
1402
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1287
1403
  case 1:
1288
1404
  if (!(_a.sent())) {
1289
1405
  return [2 /*return*/];
@@ -1305,7 +1421,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1305
1421
  return tslib_1.__awaiter(this, void 0, void 0, function () {
1306
1422
  return tslib_1.__generator(this, function (_a) {
1307
1423
  switch (_a.label) {
1308
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
1424
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1309
1425
  case 1:
1310
1426
  if (!(_a.sent())) {
1311
1427
  return [2 /*return*/];
@@ -1326,7 +1442,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1326
1442
  return tslib_1.__awaiter(this, void 0, void 0, function () {
1327
1443
  return tslib_1.__generator(this, function (_a) {
1328
1444
  switch (_a.label) {
1329
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
1445
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1330
1446
  case 1:
1331
1447
  if (!(_a.sent())) {
1332
1448
  return [2 /*return*/];
@@ -1349,7 +1465,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1349
1465
  return tslib_1.__awaiter(this, void 0, void 0, function () {
1350
1466
  return tslib_1.__generator(this, function (_a) {
1351
1467
  switch (_a.label) {
1352
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
1468
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1353
1469
  case 1:
1354
1470
  if (!(_a.sent())) {
1355
1471
  return [2 /*return*/];
@@ -1372,7 +1488,9 @@ var BaseCommandLine = /** @class */ (function (_super) {
1372
1488
  return tslib_1.__awaiter(this, void 0, void 0, function () {
1373
1489
  return tslib_1.__generator(this, function (_a) {
1374
1490
  switch (_a.label) {
1375
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
1491
+ case 0: return [4 /*yield*/, this.cwdIsProject({
1492
+ requireProjectWithGitRoot: false,
1493
+ })];
1376
1494
  case 1:
1377
1495
  if (!(_a.sent())) {
1378
1496
  return [2 /*return*/];
@@ -1397,7 +1515,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1397
1515
  var proj, libs;
1398
1516
  return tslib_1.__generator(this, function (_a) {
1399
1517
  switch (_a.label) {
1400
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
1518
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: true })];
1401
1519
  case 1:
1402
1520
  if (!(_a.sent())) {
1403
1521
  return [2 /*return*/];
@@ -1454,6 +1572,54 @@ var BaseCommandLine = /** @class */ (function (_super) {
1454
1572
  });
1455
1573
  };
1456
1574
  //#endregion
1575
+ //#region commands / changes
1576
+ BaseCommandLine.prototype.changes = function () {
1577
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1578
+ var _a, _b, _c, _d, chil, _e, _f, e_3_1;
1579
+ var e_3, _g;
1580
+ return tslib_1.__generator(this, function (_h) {
1581
+ switch (_h.label) {
1582
+ case 0:
1583
+ _b = (_a = index_1.Helpers).info;
1584
+ return [4 /*yield*/, this.project.git.changesSummary()];
1585
+ case 1:
1586
+ _b.apply(_a, [_h.sent()]);
1587
+ index_1.Helpers.terminalLine();
1588
+ _h.label = 2;
1589
+ case 2:
1590
+ _h.trys.push([2, 7, 8, 9]);
1591
+ _c = tslib_1.__values(this.project.children), _d = _c.next();
1592
+ _h.label = 3;
1593
+ case 3:
1594
+ if (!!_d.done) return [3 /*break*/, 6];
1595
+ chil = _d.value;
1596
+ _f = (_e = index_1.Helpers).info;
1597
+ return [4 /*yield*/, chil.git.changesSummary()];
1598
+ case 4:
1599
+ _f.apply(_e, [_h.sent()]);
1600
+ _h.label = 5;
1601
+ case 5:
1602
+ _d = _c.next();
1603
+ return [3 /*break*/, 3];
1604
+ case 6: return [3 /*break*/, 9];
1605
+ case 7:
1606
+ e_3_1 = _h.sent();
1607
+ e_3 = { error: e_3_1 };
1608
+ return [3 /*break*/, 9];
1609
+ case 8:
1610
+ try {
1611
+ if (_d && !_d.done && (_g = _c.return)) _g.call(_c);
1612
+ }
1613
+ finally { if (e_3) throw e_3.error; }
1614
+ return [7 /*endfinally*/];
1615
+ case 9:
1616
+ this._exit();
1617
+ return [2 /*return*/];
1618
+ }
1619
+ });
1620
+ });
1621
+ };
1622
+ //#endregion
1457
1623
  //#region commands / branch name
1458
1624
  BaseCommandLine.prototype.BRANCH_NAME = function () {
1459
1625
  console.log("current branch name: \"".concat(index_1.Helpers.git.currentBranchName(process.cwd()), "\""));
@@ -1503,7 +1669,23 @@ var BaseCommandLine = /** @class */ (function (_super) {
1503
1669
  });
1504
1670
  });
1505
1671
  };
1672
+ BaseCommandLine.prototype._resolveChildFromArg = function () {
1673
+ var _this = this;
1674
+ var _a = index_1.Helpers.cliTool.resolveItemFromArgsBegin(this.args, function (arg) {
1675
+ return _this.ins.From([_this.cwd, arg]);
1676
+ }), projFromArg = _a.resolved, clearedCommand = _a.clearedCommand;
1677
+ if (!!projFromArg) {
1678
+ this.args = clearedCommand.split(' ');
1679
+ this.cwd = projFromArg.location;
1680
+ this.project = projFromArg;
1681
+ }
1682
+ };
1506
1683
  BaseCommandLine.prototype.origin = function () {
1684
+ this._resolveChildFromArg();
1685
+ console.log(index_1.Helpers.git.getOriginURL(this.cwd));
1686
+ this._exit();
1687
+ };
1688
+ BaseCommandLine.prototype.remote = function () {
1507
1689
  console.log(index_1.Helpers.git.getOriginURL(this.cwd));
1508
1690
  this._exit();
1509
1691
  };
@@ -1652,7 +1834,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1652
1834
  var p, extensions, menuItems, extensionsToInstall, index, extname;
1653
1835
  return tslib_1.__generator(this, function (_a) {
1654
1836
  switch (_a.label) {
1655
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
1837
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1656
1838
  case 1:
1657
1839
  if (!(_a.sent())) {
1658
1840
  return [2 /*return*/];
@@ -1704,7 +1886,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1704
1886
  return tslib_1.__awaiter(this, void 0, void 0, function () {
1705
1887
  return tslib_1.__generator(this, function (_a) {
1706
1888
  switch (_a.label) {
1707
- case 0: return [4 /*yield*/, this.preventCwdIsNotProject()];
1889
+ case 0: return [4 /*yield*/, this.cwdIsProject({ requireProjectWithGitRoot: false })];
1708
1890
  case 1:
1709
1891
  if (!(_a.sent())) {
1710
1892
  return [2 /*return*/];
@@ -1727,7 +1909,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1727
1909
  };
1728
1910
  //#endregion
1729
1911
  //#region select branch from list of branches
1730
- BaseCommandLine.prototype.__selectBrach = function (branches) {
1912
+ BaseCommandLine.prototype.__selectBrach = function (branches, task) {
1731
1913
  return tslib_1.__awaiter(this, void 0, void 0, function () {
1732
1914
  var childrenMsg;
1733
1915
  return tslib_1.__generator(this, function (_a) {
@@ -1736,7 +1918,7 @@ var BaseCommandLine = /** @class */ (function (_super) {
1736
1918
  childrenMsg = this.project.children.length == 0
1737
1919
  ? '(no children in project)'
1738
1920
  : '(with children)';
1739
- return [4 /*yield*/, index_1.Helpers.autocompleteAsk("Choose branch to reset in this project ".concat(childrenMsg, ": "), branches.map(function (b) {
1921
+ return [4 /*yield*/, index_1.Helpers.autocompleteAsk("Choose branch to ".concat(task, " in this project ").concat(childrenMsg, ": "), branches.map(function (b) {
1740
1922
  return { name: b, value: b };
1741
1923
  }))];
1742
1924
  case 1: return [2 /*return*/, _a.sent()];
@@ -1744,6 +1926,59 @@ var BaseCommandLine = /** @class */ (function (_super) {
1744
1926
  });
1745
1927
  });
1746
1928
  };
1929
+ //#endregion
1930
+ //#region commands / clone
1931
+ BaseCommandLine.prototype.clone = function () {
1932
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1933
+ var url, originType;
1934
+ return tslib_1.__generator(this, function (_a) {
1935
+ url = this.firstArg;
1936
+ originType = this.params['setOrigin'];
1937
+ if (originType) {
1938
+ if (originType === 'ssh') {
1939
+ url = index_1.Helpers.git.originHttpToSsh(url);
1940
+ }
1941
+ if (originType === 'http') {
1942
+ url = index_1.Helpers.git.originSshToHttp(url);
1943
+ }
1944
+ }
1945
+ index_1.Helpers.git.clone({
1946
+ url: url,
1947
+ cwd: this.cwd,
1948
+ });
1949
+ this._exit();
1950
+ return [2 /*return*/];
1951
+ });
1952
+ });
1953
+ };
1954
+ //#endregion
1955
+ //#region commands / ghtemp
1956
+ BaseCommandLine.prototype.ghSave = function () {
1957
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1958
+ return tslib_1.__generator(this, function (_a) {
1959
+ switch (_a.label) {
1960
+ case 0: return [4 /*yield*/, new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().save()];
1961
+ case 1:
1962
+ _a.sent();
1963
+ this._exit();
1964
+ return [2 /*return*/];
1965
+ }
1966
+ });
1967
+ });
1968
+ };
1969
+ BaseCommandLine.prototype.ghRestore = function () {
1970
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
1971
+ return tslib_1.__generator(this, function (_a) {
1972
+ switch (_a.label) {
1973
+ case 0: return [4 /*yield*/, new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().restore()];
1974
+ case 1:
1975
+ _a.sent();
1976
+ this._exit();
1977
+ return [2 /*return*/];
1978
+ }
1979
+ });
1980
+ });
1981
+ };
1747
1982
  return BaseCommandLine;
1748
1983
  }(command_line_feature_backend_1.CommandLineFeature));
1749
1984
  exports.BaseCommandLine = BaseCommandLine;