tnp-helpers 19.0.74 → 19.0.76

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 (101) hide show
  1. package/browser/fesm2022/tnp-helpers.mjs +111 -53
  2. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  3. package/browser/lib/base/classes/base-git.d.ts +3 -1
  4. package/browser/lib/base/classes/base-global-command-line.d.ts +28 -15
  5. package/browser/lib/build-info._auto-generated_.d.ts +1 -1
  6. package/browser/package.json +1 -1
  7. package/lib/base/classes/base-git.d.ts +3 -1
  8. package/lib/base/classes/base-git.js +8 -3
  9. package/lib/base/classes/base-git.js.map +1 -1
  10. package/lib/base/classes/base-global-command-line.backend.d.ts +1 -13
  11. package/lib/base/classes/base-global-command-line.backend.js +11 -416
  12. package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
  13. package/lib/base/classes/base-global-command-line.d.ts +25 -12
  14. package/lib/base/classes/base-global-command-line.js +128 -77
  15. package/lib/base/classes/base-global-command-line.js.map +1 -1
  16. package/lib/base/classes/base-node-modules.js +7 -7
  17. package/lib/base/classes/base-node-modules.js.map +1 -1
  18. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
  19. package/lib/build-info._auto-generated_.d.ts +1 -1
  20. package/lib/build-info._auto-generated_.js +1 -1
  21. package/lib/env/env.angular-node-app.d.ts +1 -0
  22. package/lib/env/env.angular-node-app.js +3 -2
  23. package/lib/env/env.angular-node-app.js.map +1 -1
  24. package/lib/env/env.docs-webapp.d.ts +1 -0
  25. package/lib/env/env.docs-webapp.js +3 -2
  26. package/lib/env/env.docs-webapp.js.map +1 -1
  27. package/lib/env/env.electron-app.d.ts +1 -0
  28. package/lib/env/env.electron-app.js +3 -2
  29. package/lib/env/env.electron-app.js.map +1 -1
  30. package/lib/env/env.mobile-app.d.ts +1 -0
  31. package/lib/env/env.mobile-app.js +3 -2
  32. package/lib/env/env.mobile-app.js.map +1 -1
  33. package/lib/env/env.npm-lib-and-cli-tool.d.ts +1 -0
  34. package/lib/env/env.npm-lib-and-cli-tool.js +3 -2
  35. package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
  36. package/lib/env/env.vscode-plugin.d.ts +1 -0
  37. package/lib/env/env.vscode-plugin.js +3 -2
  38. package/lib/env/env.vscode-plugin.js.map +1 -1
  39. package/lib/helpers/for-backend/helpers-dependencies.backend.d.ts +1 -0
  40. package/lib/helpers/for-backend/helpers-dependencies.backend.js +27 -0
  41. package/lib/helpers/for-backend/helpers-dependencies.backend.js.map +1 -1
  42. package/lib/helpers/for-browser/angular.helper.js +2 -2
  43. package/lib/old/base-component.js +2 -2
  44. package/lib/old/base-formly-component.js +2 -2
  45. package/lib/old/dual-component-ctrl.js +2 -2
  46. package/lib/validators/validators-git.js.map +1 -1
  47. package/package.json +1 -1
  48. package/tmp-environment.json +11 -7
  49. package/websql/fesm2022/tnp-helpers.mjs +111 -53
  50. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  51. package/websql/lib/base/classes/base-git.d.ts +3 -1
  52. package/websql/lib/base/classes/base-global-command-line.d.ts +28 -15
  53. package/websql/lib/build-info._auto-generated_.d.ts +1 -1
  54. package/websql/package.json +1 -1
  55. package/lib/base/classes/base-process/base-process-api.service.d.ts +0 -7
  56. package/lib/base/classes/base-process/base-process.context.d.ts +0 -19
  57. package/lib/base/classes/base-process/base-process.context.js +0 -22
  58. package/lib/base/classes/base-process/base-process.context.js.map +0 -1
  59. package/lib/base/classes/base-process/base-process.controller.d.ts +0 -17
  60. package/lib/base/classes/base-process/base-process.controller.js +0 -91
  61. package/lib/base/classes/base-process/base-process.controller.js.map +0 -1
  62. package/lib/base/classes/base-process/base-process.d.ts +0 -8
  63. package/lib/base/classes/base-process/base-process.defaults-values.d.ts +0 -2
  64. package/lib/base/classes/base-process/base-process.defaults-values.js +0 -9
  65. package/lib/base/classes/base-process/base-process.defaults-values.js.map +0 -1
  66. package/lib/base/classes/base-process/base-process.js +0 -62
  67. package/lib/base/classes/base-process/base-process.js.map +0 -1
  68. package/lib/base/classes/base-process/base-process.models.d.ts +0 -6
  69. package/lib/base/classes/base-process/base-process.models.js +0 -3
  70. package/lib/base/classes/base-process/base-process.models.js.map +0 -1
  71. package/lib/base/classes/base-process/base-process.provider.d.ts +0 -16
  72. package/lib/base/classes/base-process/base-process.provider.js +0 -69
  73. package/lib/base/classes/base-process/base-process.provider.js.map +0 -1
  74. package/lib/base/classes/base-process/base-process.repository copy.d.ts +0 -8
  75. package/lib/base/classes/base-process/base-process.repository copy.js +0 -32
  76. package/lib/base/classes/base-process/base-process.repository copy.js.map +0 -1
  77. package/lib/base/classes/base-process/base-process.repository.d.ts +0 -8
  78. package/lib/base/classes/base-process/base-process.repository.js +0 -32
  79. package/lib/base/classes/base-process/base-process.repository.js.map +0 -1
  80. package/lib/base/classes/base-process/base-process.terminal-ui.d.ts +0 -11
  81. package/lib/base/classes/base-process/base-process.terminal-ui.js +0 -54
  82. package/lib/base/classes/base-process/base-process.terminal-ui.js.map +0 -1
  83. package/lib/base/classes/base-process/base-process.worker.d.ts +0 -16
  84. package/lib/base/classes/base-process/base-process.worker.js +0 -29
  85. package/lib/base/classes/base-process/base-process.worker.js.map +0 -1
  86. package/lib/base/classes/base-process/index.d.ts +0 -1
  87. package/lib/base/classes/base-process/index.js +0 -22
  88. package/lib/base/classes/base-process/index.js.map +0 -1
  89. package/lib/base/classes/base-process/processes.repository.d.ts +0 -0
  90. package/lib/base/classes/base-process/processes.repository.js +0 -5
  91. package/lib/base/classes/base-process/processes.repository.js.map +0 -1
  92. package/lib/env-backend._auto-generated_.d.ts +0 -34
  93. package/lib/env-backend._auto-generated_.js +0 -38
  94. package/lib/env-backend._auto-generated_.js.map +0 -1
  95. package/lib/env-browser._auto-generated_.d.ts +0 -34
  96. package/lib/env-browser._auto-generated_.js +0 -38
  97. package/lib/env-browser._auto-generated_.js.map +0 -1
  98. package/lib/env.backend.d.ts +0 -34
  99. package/lib/env.backend.js +0 -40
  100. package/lib/env.backend.js.map +0 -1
  101. package/lib/env.browser.d.ts +0 -34
@@ -24,7 +24,6 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
24
24
  * TODO return argument not need for now
25
25
  */
26
26
  async cwdIsProject(options) {
27
- //#region @backendFunc
28
27
  const { requireProjectWithGitRoot } = options || {};
29
28
  if (!!this.project && !requireProjectWithGitRoot) {
30
29
  return true;
@@ -54,28 +53,22 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
54
53
  }
55
54
  }
56
55
  return true;
57
- //#endregion
58
56
  }
59
57
  //#endregion
60
58
  //#region commands / hosts
61
59
  hosts() {
62
- //#region @backendFunc
63
60
  index_1.Helpers.run(`code ${(0, lib_3.crossPlatformPath)(lib_5.UtilsNetwork.getEtcHostsPath())}`).sync();
64
61
  process.exit(0);
65
- //#endregion
66
62
  }
67
63
  //#endregion
68
64
  //#region commands / count commits
69
65
  countCommits() {
70
- //#region @backendFunc
71
66
  console.log(index_1.Helpers.git.countCommits(this.cwd));
72
67
  this._exit();
73
- //#endregion
74
68
  }
75
69
  //#endregion
76
70
  //#region commands / remove submodules
77
71
  removeSubmodules() {
78
- //#region @backendFunc
79
72
  index_1.Helpers.taskStarted('Removing submodules...');
80
73
  for (const folderAbsPath of index_1.Helpers.foldersFrom(this.cwd, {
81
74
  recursive: false,
@@ -89,10 +82,8 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
89
82
  }
90
83
  index_1.Helpers.taskDone('Done');
91
84
  this._exit();
92
- //#endregion
93
85
  }
94
86
  removeSubmodule() {
95
- //#region @backendFunc
96
87
  index_1.Helpers.taskStarted(`Removing submodules.. ${this.firstArg}`);
97
88
  if (index_1.Helpers.exists((0, lib_3.crossPlatformPath)([this.cwd, this.firstArg || '', '.git']))) {
98
89
  try {
@@ -102,30 +93,22 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
102
93
  }
103
94
  index_1.Helpers.taskDone('Done');
104
95
  this._exit();
105
- //#endregion
106
96
  }
107
97
  //#endregion
108
98
  //#region commands / set editor
109
99
  async setEditor() {
110
- //#region @backendFunc
111
100
  await this.ins.configDb.selectCodeEditor();
112
101
  this._exit();
113
- //#endregion
114
102
  }
115
103
  //#endregion
116
104
  //#region commands / api update
117
105
  async upapi() {
118
- //#region @backendFunc
119
106
  await this.apiUpdate();
120
- //#endregion
121
107
  }
122
108
  async apiup() {
123
- //#region @backendFunc
124
109
  await this.apiUpdate();
125
- //#endregion
126
110
  }
127
111
  async apiUpdate() {
128
- //#region @backendFunc
129
112
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
130
113
  return;
131
114
  }
@@ -140,26 +123,19 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
140
123
  });
141
124
  index_1.Helpers.info('Done');
142
125
  this._exit();
143
- //#endregion
144
126
  }
145
127
  //#endregion
146
128
  //#region commands / chore update
147
129
  async cu() {
148
- //#region @backendFunc
149
130
  await this.update();
150
- //#endregion
151
131
  }
152
132
  async choreUpdate() {
153
- //#region @backendFunc
154
133
  await this.update();
155
- //#endregion
156
134
  }
157
135
  //#endregion
158
136
  //#region commands / color vscode
159
137
  colorvscode() {
160
- //#region @backendFunc
161
138
  this.settingsVscode();
162
- //#endregion
163
139
  }
164
140
  //#endregion
165
141
  //#region commands / settings vscode
@@ -167,20 +143,14 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
167
143
  * Generate or update .vscode/settings.json file color settings
168
144
  */
169
145
  settingsVscode() {
170
- //#region @backendFunc
171
146
  this.refreshVscodeColors();
172
- //#endregion
173
147
  }
174
148
  refreshVscodeColors() {
175
- //#region @backendFunc
176
149
  this._regenerateVscodeSettingsColors();
177
150
  this._exit();
178
- //#endregion
179
151
  }
180
152
  _regenerateVscodeSettingsColors(overideBottomColor) {
181
- //#region @backendFunc
182
153
  index_1.UtilsVSCode.regenerateVsCodeSettingsColors(this.cwd, overideBottomColor);
183
- //#endregion
184
154
  }
185
155
  //#endregion
186
156
  //#region commands / quick git update
@@ -188,7 +158,6 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
188
158
  * quick git update push
189
159
  */
190
160
  async update() {
191
- //#region @backendFunc
192
161
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
193
162
  return;
194
163
  }
@@ -203,10 +172,8 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
203
172
  });
204
173
  index_1.Helpers.info('Done');
205
174
  this._exit();
206
- //#endregion
207
175
  }
208
176
  async updateProject(project, force = false) {
209
- //#region @backendFunc
210
177
  try {
211
178
  await project.packageJson.bumpPatchVersion();
212
179
  }
@@ -227,20 +194,14 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
227
194
  }
228
195
  }
229
196
  }
230
- //#endregion
231
197
  }
232
198
  async deepUp(noExit = false) {
233
- //#region @backendFunc
234
199
  await this.deepUpdate(noExit);
235
- //#endregion
236
200
  }
237
201
  async deepUpForce(noExit = false) {
238
- //#region @backendFunc
239
202
  await this.deepUpdateForce(noExit);
240
- //#endregion
241
203
  }
242
204
  async deepUpdateForce(noExit = false) {
243
- //#region @backendFunc
244
205
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
245
206
  return;
246
207
  }
@@ -248,10 +209,8 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
248
209
  await this.updateProject(this.project, true);
249
210
  index_1.Helpers.info('Done');
250
211
  this._exit();
251
- //#endregion
252
212
  }
253
213
  async deepUpdate(noExit = false) {
254
- //#region @backendFunc
255
214
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
256
215
  return;
257
216
  }
@@ -259,28 +218,22 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
259
218
  await this.updateProject(this.project);
260
219
  index_1.Helpers.info('Done');
261
220
  this._exit();
262
- //#endregion
263
221
  }
264
222
  /**
265
223
  * Push update
266
224
  */
267
225
  async up() {
268
- //#region @backendFunc
269
226
  await this.update();
270
- //#endregion
271
227
  }
272
228
  /**
273
229
  * Push update
274
230
  */
275
231
  async pu() {
276
- //#region @backendFunc
277
232
  await this.update();
278
- //#endregion
279
233
  }
280
234
  //#endregion
281
235
  //#region commands / develop
282
236
  async develop() {
283
- //#region @backendFunc
284
237
  // Helpers.clearConsole();
285
238
  index_1.Helpers.taskStarted(`getting all projects...`);
286
239
  const founded = ((await this.ins.projectsDb.getAllProjectsFromDB()) || [])
@@ -344,38 +297,28 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
344
297
  await openInEditor(this.ins.From(res));
345
298
  }
346
299
  this._exit();
347
- //#endregion
348
300
  }
349
301
  async dev() {
350
- //#region @backendFunc
351
302
  return await this.develop();
352
- //#endregion
353
303
  }
354
304
  //#endregion
355
305
  //#region commands / repulll
356
306
  async repul() {
357
- //#region @backendFunc
358
307
  await this.repull();
359
- //#endregion
360
308
  }
361
309
  async repull() {
362
- //#region @backendFunc
363
310
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
364
311
  return;
365
312
  }
366
313
  await this.project.git.resetHard({ HEAD: 10 });
367
314
  await this.pull();
368
- //#endregion
369
315
  }
370
316
  //#endregion
371
317
  //#region commands / pull
372
318
  async pul() {
373
- //#region @backendFunc
374
319
  await this.pull();
375
- //#endregion
376
320
  }
377
321
  async pull() {
378
- //#region @backendFunc
379
322
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
380
323
  return;
381
324
  }
@@ -383,12 +326,10 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
383
326
  setOrigin: this.params['setOrigin'],
384
327
  });
385
328
  this._exit();
386
- //#endregion
387
329
  }
388
330
  //#endregion
389
331
  //#region commands / pull all
390
332
  async pullAll() {
391
- //#region @backendFunc
392
333
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
393
334
  return;
394
335
  }
@@ -396,24 +337,20 @@ class BaseGlobalCommandLine extends base_command_line_feature_1.BaseCommandLineF
396
337
  setOrigin: this.params['setOrigin'],
397
338
  });
398
339
  this._exit();
399
- //#endregion
400
340
  }
401
341
  //#endregion
402
342
  //#region commands / push and pull
403
343
  async pp() {
404
- //#region @backendFunc
405
344
  const currentBranch = this.project.git.currentBranchName;
406
345
  this.project
407
346
  .run(`git push origin ${currentBranch} && git pull origin ${currentBranch}`)
408
347
  .sync();
409
348
  console.log('Done push and pull');
410
349
  this._exit();
411
- //#endregion
412
350
  }
413
351
  //#endregion
414
352
  //#region commands / reset
415
353
  __resetInfo(branchToReset, withChildren) {
416
- //#region @backendFunc
417
354
  index_1.Helpers.info(`
418
355
 
419
356
  YOU ARE RESETING ${withChildren ? 'EVERYTHING' : 'PROJECT'} ` +
@@ -428,19 +365,15 @@ ${withChildren &&
428
365
  .join('\n')}`
429
366
  : ''}
430
367
  `);
431
- //#endregion
432
368
  }
433
369
  async fetch() {
434
- //#region @backendFunc
435
370
  try {
436
371
  this.project?.git?.fetch();
437
372
  }
438
373
  catch (error) { }
439
374
  this._exit();
440
- //#endregion
441
375
  }
442
376
  async reset() {
443
- //#region @backendFunc
444
377
  // Helpers.clearConsole();
445
378
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
446
379
  return;
@@ -499,12 +432,10 @@ ${withChildren &&
499
432
  await resetProject.resetProcess(overrideBranchToReset);
500
433
  }
501
434
  this._exit();
502
- //#endregion
503
435
  }
504
436
  //#endregion
505
437
  //#region commands / soft
506
438
  async soft() {
507
- //#region @backendFunc
508
439
  // TODO when aciton commit
509
440
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
510
441
  return;
@@ -515,12 +446,10 @@ ${withChildren &&
515
446
  this.project.git.resetSoftHEAD(1);
516
447
  });
517
448
  this._exit();
518
- //#endregion
519
449
  }
520
450
  //#endregion
521
451
  //#region commands / rebase
522
452
  async rebase() {
523
- //#region @backendFunc
524
453
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
525
454
  return;
526
455
  }
@@ -580,7 +509,6 @@ ${withChildren &&
580
509
  index_1.Helpers.error('Not able to rebase', true, true);
581
510
  }
582
511
  this._exit();
583
- //#endregion
584
512
  }
585
513
  //#endregion
586
514
  //#region commands / stash
@@ -588,14 +516,12 @@ ${withChildren &&
588
516
  * stash only staged files
589
517
  */
590
518
  async stash() {
591
- //#region @backendFunc
592
519
  index_1.Helpers.info(`Stashing only staged files...`);
593
520
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
594
521
  return;
595
522
  }
596
523
  this.project.git.stash({ onlyStaged: true });
597
524
  this._exit();
598
- //#endregion
599
525
  }
600
526
  //#endregion
601
527
  //#region commands / stash all
@@ -603,14 +529,12 @@ ${withChildren &&
603
529
  * stash all files
604
530
  */
605
531
  async stashAll() {
606
- //#region @backendFunc
607
532
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
608
533
  return;
609
534
  }
610
535
  this.project.git.stageAllFiles();
611
536
  this.project.git.stash();
612
537
  this._exit();
613
- //#endregion
614
538
  }
615
539
  //#endregion
616
540
  //#region commands / push all origins
@@ -618,33 +542,24 @@ ${withChildren &&
618
542
  * push force to all orgins
619
543
  */
620
544
  async pushAllForce() {
621
- //#region @backendFunc
622
545
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
623
546
  return;
624
547
  }
625
548
  await this.pushAll(true);
626
- //#endregion
627
549
  }
628
550
  async pAllForce() {
629
- //#region @backendFunc
630
551
  await this.pushAllForce();
631
- //#endregion
632
552
  }
633
553
  async pAllf() {
634
- //#region @backendFunc
635
554
  await this.pushAllForce();
636
- //#endregion
637
555
  }
638
556
  async pAll() {
639
- //#region @backendFunc
640
557
  await this.pushAll();
641
- //#endregion
642
558
  }
643
559
  /**
644
560
  * push to all origins
645
561
  */
646
562
  async pushAll(force = false) {
647
- //#region @backendFunc
648
563
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
649
564
  return;
650
565
  }
@@ -663,19 +578,14 @@ ${remotes.map((r, i) => `${i + 1}. ${r.origin} ${r.url}`).join('\n')}
663
578
  index_1.Helpers.taskDone(`Pushed to ${origin}`);
664
579
  }
665
580
  this._exit();
666
- //#endregion
667
581
  }
668
582
  //#endregion
669
583
  //#region commands / push force
670
584
  async forcePush() {
671
- //#region @backendFunc
672
585
  await this.push({ force: true, typeofCommit: 'feature' });
673
- //#endregion
674
586
  }
675
587
  async pushForce() {
676
- //#region @backendFunc
677
588
  await this.push({ force: true, typeofCommit: 'feature' });
678
- //#endregion
679
589
  }
680
590
  //#endregion
681
591
  //#region commands / commit
@@ -683,7 +593,6 @@ ${remotes.map((r, i) => `${i + 1}. ${r.origin} ${r.url}`).join('\n')}
683
593
  * Commit and push this for single repo
684
594
  */
685
595
  async commit(options = {}) {
686
- //#region @backendFunc
687
596
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
688
597
  return;
689
598
  }
@@ -704,12 +613,10 @@ ${remotes.map((r, i) => `${i + 1}. ${r.origin} ${r.url}`).join('\n')}
704
613
  return;
705
614
  }
706
615
  this._exit();
707
- //#endregion
708
616
  }
709
617
  //#endregion
710
618
  //#region commands / push
711
619
  async _preventPushPullFromNotCorrectBranch() {
712
- //#region @backendFunc
713
620
  while (true) {
714
621
  const devBranch = this.project.git.duringPushWarnIfProjectNotOnSpecyficDevBranch();
715
622
  if (!!devBranch && devBranch !== this.project.git.currentBranchName) {
@@ -747,25 +654,17 @@ ${remotes.map((r, i) => `${i + 1}. ${r.origin} ${r.url}`).join('\n')}
747
654
  }
748
655
  return;
749
656
  }
750
- //#endregion
751
657
  }
752
658
  async qPush() {
753
- //#region @backendFunc
754
659
  await this.quickPush();
755
- //#endregion
756
660
  }
757
661
  async quickPush() {
758
- //#region @backendFunc
759
662
  await this.push({ skipLint: true });
760
- //#endregion
761
663
  }
762
664
  async repushauto() {
763
- //#region @backendFunc
764
665
  await this.rePush(true);
765
- //#endregion
766
666
  }
767
667
  async rePush(skipQuesion = false) {
768
- //#region @backendFunc
769
668
  const lastCommitMessage = this.project.git.lastCommitMessage();
770
669
  this.project.git.resetSoftHEAD();
771
670
  this.project.git.stageAllFiles();
@@ -784,10 +683,8 @@ ${lastCommitMessage}
784
683
  force: true,
785
684
  });
786
685
  this._exit();
787
- //#endregion
788
686
  }
789
687
  async push(options = {}) {
790
- //#region @backendFunc
791
688
  // console.log('args', this.args);
792
689
  // console.log(`argsWithParams "${this.argsWithParams}"` );
793
690
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
@@ -820,23 +717,19 @@ ${lastCommitMessage}
820
717
  return;
821
718
  }
822
719
  this._exit();
823
- //#endregion
824
720
  }
825
721
  //#endregion
826
722
  //#region commands / melt
827
723
  async melt() {
828
- //#region @backendFunc
829
724
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
830
725
  return;
831
726
  }
832
727
  await this.meltUpdateCommits({ hideInfo: true });
833
728
  this._exit();
834
- //#endregion
835
729
  }
836
730
  //#endregion
837
731
  //#region commands / melt
838
732
  async meltUp() {
839
- //#region @backendFunc
840
733
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
841
734
  return;
842
735
  }
@@ -858,12 +751,10 @@ ${lastCommitMessage}
858
751
  await processProject(this.project);
859
752
  index_1.Helpers.info('All projects are up to date with remote');
860
753
  this._exit();
861
- //#endregion
862
754
  }
863
755
  //#endregion
864
756
  //#region commands / melt
865
757
  async meltAll() {
866
- //#region @backendFunc
867
758
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
868
759
  return;
869
760
  }
@@ -872,12 +763,10 @@ ${lastCommitMessage}
872
763
  await this.__meltCommitsFunc(child, { hideInfo: true });
873
764
  }
874
765
  this._exit();
875
- //#endregion
876
766
  }
877
767
  //#endregion
878
768
  //#region commands / melt updat ecommits
879
769
  async __meltCommitsFunc(project, options) {
880
- //#region @backendFunc
881
770
  options = options || {};
882
771
  const meltedCommits = project.git.meltActionCommits();
883
772
  if (meltedCommits > 0) {
@@ -886,32 +775,22 @@ ${lastCommitMessage}
886
775
  else {
887
776
  index_1.Helpers.logInfo(`No commits to melt for project ${project.genericName}`);
888
777
  }
889
- //#endregion
890
778
  }
891
779
  async meltUpdateCommits(options) {
892
- //#region @backendFunc
893
780
  await this.__meltCommitsFunc(this.project, options);
894
- //#endregion
895
781
  }
896
782
  //#endregion
897
783
  //#region commands / push feature
898
784
  async pf() {
899
- //#region @backendFunc
900
785
  await this.pushFeature();
901
- //#endregion
902
786
  }
903
787
  async pRel() {
904
- //#region @backendFunc
905
788
  await this.pushRelease();
906
- //#endregion
907
789
  }
908
790
  async pRelease() {
909
- //#region @backendFunc
910
791
  await this.pushRelease();
911
- //#endregion
912
792
  }
913
793
  async pushRelease() {
914
- //#region @backendFunc
915
794
  await this.meltUpdateCommits();
916
795
  await this.push({
917
796
  typeofCommit: 'release',
@@ -919,174 +798,120 @@ ${lastCommitMessage}
919
798
  overrideCommitMessage: `${lib_2._.first(this.project.releaseProcess.getReleaseWords())} ` +
920
799
  `version ${this.project.packageJson.version}`,
921
800
  });
922
- //#endregion
923
801
  }
924
802
  async mPush() {
925
- //#region @backendFunc
926
803
  await this.meltPush();
927
- //#endregion
928
804
  }
929
805
  async fmPush() {
930
- //#region @backendFunc
931
806
  await this.forceMeltPush();
932
- //#endregion
933
807
  }
934
808
  async mfPush() {
935
- //#region @backendFunc
936
809
  await this.forceMeltPush();
937
- //#endregion
938
810
  }
939
811
  async mforcePush() {
940
- //#region @backendFunc
941
812
  await this.forceMeltPush();
942
- //#endregion
943
813
  }
944
814
  async meltforcePush() {
945
- //#region @backendFunc
946
815
  await this.forceMeltPush();
947
- //#endregion
948
816
  }
949
817
  async forceMeltPush() {
950
- //#region @backendFunc
951
818
  await this.meltPush(true);
952
- //#endregion
953
819
  }
954
820
  async meltPush(force = false) {
955
- //#region @backendFunc
956
821
  await this.meltUpdateCommits();
957
822
  await this.push({
958
823
  mergeUpdateCommits: true,
959
824
  force,
960
825
  });
961
- //#endregion
962
826
  }
963
827
  async pushFeature() {
964
- //#region @backendFunc
965
828
  await this.meltUpdateCommits();
966
829
  await this.push({ typeofCommit: 'feature', commitMessageRequired: true });
967
- //#endregion
968
830
  }
969
831
  //#endregion
970
832
  //#region commands / push fix
971
833
  async pushFix() {
972
- //#region @backendFunc
973
834
  await this.meltUpdateCommits();
974
835
  await this.push({ typeofCommit: 'bugfix', commitMessageRequired: true });
975
- //#endregion
976
836
  }
977
837
  pfix() {
978
- //#region @backendFunc
979
838
  this.pushFix();
980
- //#endregion
981
839
  }
982
840
  //#endregion
983
841
  //#region commands / push chore
984
842
  async pushChore() {
985
- //#region @backendFunc
986
843
  await this.meltUpdateCommits();
987
844
  await this.push({ typeofCommit: 'chore', commitMessageRequired: true });
988
- //#endregion
989
845
  }
990
846
  async pc() {
991
- //#region @backendFunc
992
847
  await this.pushChore();
993
- //#endregion
994
848
  }
995
849
  //#endregion
996
850
  //#region commands / push refactor
997
851
  async pushRefactor() {
998
- //#region @backendFunc
999
852
  await this.meltUpdateCommits();
1000
853
  await this.push({ typeofCommit: 'refactor', commitMessageRequired: true });
1001
- //#endregion
1002
854
  }
1003
855
  async pushref() {
1004
- //#region @backendFunc
1005
856
  await this.pushRefactor();
1006
- //#endregion
1007
857
  }
1008
858
  async pref() {
1009
- //#region @backendFunc
1010
859
  await this.pushRefactor();
1011
- //#endregion
1012
860
  }
1013
861
  //#endregion
1014
862
  //#region commands / push style
1015
863
  async pushStyle() {
1016
- //#region @backendFunc
1017
864
  await this.meltUpdateCommits();
1018
865
  await this.push({ typeofCommit: 'style', commitMessageRequired: true });
1019
- //#endregion
1020
866
  }
1021
867
  async pstyl() {
1022
- //#region @backendFunc
1023
868
  await this.pushStyle();
1024
- //#endregion
1025
869
  }
1026
870
  async pstyle() {
1027
- //#region @backendFunc
1028
871
  await this.pushStyle();
1029
- //#endregion
1030
872
  }
1031
873
  //#endregion
1032
874
  //#region commands / push docs
1033
875
  async pushDocs() {
1034
- //#region @backendFunc
1035
876
  await this.meltUpdateCommits();
1036
877
  await this.push({ typeofCommit: 'docs', commitMessageRequired: true });
1037
- //#endregion
1038
878
  }
1039
879
  async pd() {
1040
- //#region @backendFunc
1041
880
  await this.pushDocs();
1042
- //#endregion
1043
881
  }
1044
882
  async pdocs() {
1045
- //#region @backendFunc
1046
883
  await this.pushDocs();
1047
- //#endregion
1048
884
  }
1049
885
  //#endregion
1050
886
  //#region commands / push test
1051
887
  async pushTest() {
1052
- //#region @backendFunc
1053
888
  await this.meltUpdateCommits();
1054
889
  await this.push({ typeofCommit: 'test', commitMessageRequired: true });
1055
- //#endregion
1056
890
  }
1057
891
  async pTest() {
1058
- //#region @backendFunc
1059
892
  await this.pushTest();
1060
- //#endregion
1061
893
  }
1062
894
  async pTests() {
1063
- //#region @backendFunc
1064
895
  await this.pushTest();
1065
- //#endregion
1066
896
  }
1067
897
  //#endregion
1068
898
  //#region commands / push perf
1069
899
  async pushPerf() {
1070
- //#region @backendFunc
1071
900
  await this.meltUpdateCommits();
1072
901
  await this.push({
1073
902
  typeofCommit: 'performance',
1074
903
  commitMessageRequired: true,
1075
904
  });
1076
- //#endregion
1077
905
  }
1078
906
  //#endregion
1079
907
  //#region commands / push ci
1080
908
  async pushCi() {
1081
- //#region @backendFunc
1082
909
  await this.meltUpdateCommits();
1083
910
  await this.push({ typeofCommit: 'ci', commitMessageRequired: true });
1084
- //#endregion
1085
911
  }
1086
912
  //#endregion
1087
913
  //#region commands / select branch
1088
914
  async branch() {
1089
- //#region @backendFunc
1090
915
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
1091
916
  return;
1092
917
  }
@@ -1110,20 +935,16 @@ ${lastCommitMessage}
1110
935
  catch (error) { }
1111
936
  this.project.git.checkout(branchName);
1112
937
  this._exit();
1113
- //#endregion
1114
938
  }
1115
939
  //#endregion
1116
940
  //#region commands / push build
1117
941
  async pushBuild() {
1118
- //#region @backendFunc
1119
942
  await this.meltUpdateCommits();
1120
943
  await this.push({ typeofCommit: 'build', commitMessageRequired: true });
1121
- //#endregion
1122
944
  }
1123
945
  //#endregion
1124
946
  //#region commands / set origin
1125
947
  async SET_ORIGIN() {
1126
- //#region @backendFunc
1127
948
  let newOriginNameOrUrl = this.firstArg;
1128
949
  if (newOriginNameOrUrl === 'ssh') {
1129
950
  newOriginNameOrUrl = index_1.Helpers.git.originHttpToSsh(index_1.Helpers.git.getOriginURL(this.cwd));
@@ -1142,12 +963,10 @@ ${lastCommitMessage}
1142
963
  index_1.Helpers.error(`This folder is not a git repo... `, false, true);
1143
964
  }
1144
965
  this._exit();
1145
- //#endregion
1146
966
  }
1147
967
  //#endregion
1148
968
  //#region commands / rename origin
1149
969
  async RENAME_ORIGIN() {
1150
- //#region @backendFunc
1151
970
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
1152
971
  return;
1153
972
  }
@@ -1160,23 +979,19 @@ ${lastCommitMessage}
1160
979
  index_1.Helpers.error(`This folder is not a git repo... `, false, true);
1161
980
  }
1162
981
  this._exit();
1163
- //#endregion
1164
982
  }
1165
983
  //#endregion
1166
984
  //#region commands / last hash tag
1167
985
  async LAST_TAG_HASH() {
1168
- //#region @backendFunc
1169
986
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
1170
987
  return;
1171
988
  }
1172
989
  index_1.Helpers.info(this.project.git.lastTagHash());
1173
990
  this._exit();
1174
- //#endregion
1175
991
  }
1176
992
  //#endregion
1177
993
  //#region commands / last tag
1178
994
  async LAST_TAG() {
1179
- //#region @backendFunc
1180
995
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
1181
996
  return;
1182
997
  }
@@ -1188,15 +1003,12 @@ ${lastCommitMessage}
1188
1003
 
1189
1004
  `);
1190
1005
  this._exit();
1191
- //#endregion
1192
1006
  }
1193
1007
  //#endregion
1194
1008
  //#region commands / check tag exists
1195
1009
  CHECK_TAG_EXISTS() {
1196
- //#region @backendFunc
1197
1010
  index_1.Helpers.info(`tag "${this.firstArg}" exits = ${index_1.Helpers.git.checkTagExists(this.firstArg)} `);
1198
1011
  this._exit();
1199
- //#endregion
1200
1012
  }
1201
1013
  //#endregion
1202
1014
  //#region commands / lint
@@ -1204,12 +1016,10 @@ ${lastCommitMessage}
1204
1016
  * TODO move somewhere
1205
1017
  */
1206
1018
  async lint() {
1207
- //#region @backendFunc
1208
1019
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
1209
1020
  return;
1210
1021
  }
1211
1022
  await this.project.lint();
1212
- //#endregion
1213
1023
  }
1214
1024
  //#endregion
1215
1025
  //#region commands / version
@@ -1217,13 +1027,11 @@ ${lastCommitMessage}
1217
1027
  * TODO move somewhere
1218
1028
  */
1219
1029
  async version() {
1220
- //#region @backendFunc
1221
1030
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
1222
1031
  return;
1223
1032
  }
1224
1033
  console.log('Current project verison: ' + this.project.packageJson.version);
1225
1034
  this._exit();
1226
- //#endregion
1227
1035
  }
1228
1036
  //#endregion
1229
1037
  //#region commands / init
@@ -1231,19 +1039,16 @@ ${lastCommitMessage}
1231
1039
  * TODO move somewhere
1232
1040
  */
1233
1041
  async init() {
1234
- //#region @backendFunc
1235
1042
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
1236
1043
  return;
1237
1044
  }
1238
1045
  await this.project.init();
1239
1046
  this._exit();
1240
- //#endregion
1241
1047
  }
1242
1048
  /**
1243
1049
  * init parent and first level children
1244
1050
  */
1245
1051
  async initAll() {
1246
- //#region @backendFunc
1247
1052
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
1248
1053
  return;
1249
1054
  }
@@ -1252,7 +1057,6 @@ ${lastCommitMessage}
1252
1057
  await child.init();
1253
1058
  }
1254
1059
  this._exit();
1255
- //#endregion
1256
1060
  }
1257
1061
  //#endregion
1258
1062
  //#region commands / struct
@@ -1260,13 +1064,11 @@ ${lastCommitMessage}
1260
1064
  * TODO move somewhere
1261
1065
  */
1262
1066
  async struct() {
1263
- //#region @backendFunc
1264
1067
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
1265
1068
  return;
1266
1069
  }
1267
1070
  await this.project.struct();
1268
1071
  this._exit();
1269
- //#endregion
1270
1072
  }
1271
1073
  //#endregion
1272
1074
  //#region commands / info
@@ -1274,7 +1076,6 @@ ${lastCommitMessage}
1274
1076
  * TODO move somewhere
1275
1077
  */
1276
1078
  async info() {
1277
- //#region @backendFunc
1278
1079
  if (!(await this.cwdIsProject({
1279
1080
  requireProjectWithGitRoot: false,
1280
1081
  }))) {
@@ -1284,12 +1085,10 @@ ${lastCommitMessage}
1284
1085
  index_1.Helpers.info(await this.project.info());
1285
1086
  await this.project.linkedProjects.saveAllLinkedProjectsToDB();
1286
1087
  this._exit();
1287
- //#endregion
1288
1088
  }
1289
1089
  //#endregion
1290
1090
  //#region commands / info
1291
1091
  async modified() {
1292
- //#region @backendFunc
1293
1092
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
1294
1093
  return;
1295
1094
  }
@@ -1307,46 +1106,38 @@ ${lastCommitMessage}
1307
1106
  .join('\n')
1308
1107
  : 'Nothing modifed');
1309
1108
  this._exit();
1310
- //#endregion
1311
1109
  }
1312
1110
  //#endregion
1313
1111
  //#region commands / update
1314
1112
  async refresh() {
1315
- //#region @backendFunc
1316
1113
  await this.project.refreshChildrenProjects({
1317
1114
  askUserAboutUpdate: true,
1318
1115
  });
1319
1116
  this._exit(0);
1320
- //#endregion
1321
1117
  }
1322
1118
  //#endregion
1323
1119
  //#region commands / changes
1324
1120
  async changes() {
1325
- //#region @backendFunc
1326
1121
  index_1.Helpers.info(await this.project.git.changesSummary());
1327
1122
  index_1.Helpers.terminalLine();
1328
1123
  for (const chil of this.project.children) {
1329
1124
  index_1.Helpers.info(await chil.git.changesSummary());
1330
1125
  }
1331
1126
  this._exit();
1332
- //#endregion
1333
1127
  }
1334
1128
  //#endregion
1335
1129
  //#region commands / all tags
1336
1130
  async allTags() {
1337
- //#region @backendFunc
1338
1131
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: true }))) {
1339
1132
  return;
1340
1133
  }
1341
1134
  const allTags = await index_1.Helpers.git.getAllTags(this.cwd);
1342
1135
  console.log(allTags);
1343
1136
  this._exit();
1344
- //#endregion
1345
1137
  }
1346
1138
  //#endregion
1347
1139
  //#region commands / remove tag
1348
1140
  async removeTag() {
1349
- //#region @backendFunc
1350
1141
  let tagToRemove = this.firstArg;
1351
1142
  if (!tagToRemove) {
1352
1143
  const allTags = await index_1.Helpers.git.getAllTags(this.cwd);
@@ -1360,128 +1151,94 @@ ${lastCommitMessage}
1360
1151
  }
1361
1152
  index_1.Helpers.git.removeTag(this.cwd, tagToRemove);
1362
1153
  this._exit();
1363
- //#endregion
1364
1154
  }
1365
1155
  //#endregion
1366
1156
  //#region commands / branch name
1367
1157
  BRANCH_NAME() {
1368
- //#region @backendFunc
1369
1158
  console.log(`current branch name: "${index_1.Helpers.git.currentBranchName(process.cwd())}"`);
1370
1159
  this._exit();
1371
- //#endregion
1372
1160
  }
1373
1161
  //#endregion
1374
1162
  //#region commands / remotes
1375
1163
  REMOTES() {
1376
- //#region @backendFunc
1377
1164
  console.log(index_1.Helpers.git.allOrigins(this.cwd));
1378
1165
  this._exit();
1379
- //#endregion
1380
1166
  }
1381
1167
  async SET_REMOTE_SSH() {
1382
- //#region @backendFunc
1383
1168
  await index_1.Helpers.git.changeRemoteFromHttpsToSSh(this.cwd);
1384
1169
  this._exit();
1385
- //#endregion
1386
1170
  }
1387
1171
  async SET_REMOTE_http() {
1388
- //#region @backendFunc
1389
1172
  await index_1.Helpers.git.changeRemoveFromSshToHttps(this.cwd);
1390
1173
  this._exit();
1391
- //#endregion
1392
1174
  }
1393
1175
  async SET_REMOTE_https() {
1394
- //#region @backendFunc
1395
1176
  await this.SET_REMOTE_http();
1396
- //#endregion
1397
1177
  }
1398
1178
  _resolveChildFromArg() {
1399
- //#region @backendFunc
1400
1179
  const { resolved: projFromArg, clearedCommand } = index_1.Helpers.cliTool.resolveItemFromArgsBegin(this.args, arg => this.ins.From([this.cwd, arg]));
1401
1180
  if (!!projFromArg) {
1402
1181
  this.args = clearedCommand.split(' ');
1403
1182
  this.cwd = projFromArg.location;
1404
1183
  this.project = projFromArg;
1405
1184
  }
1406
- //#endregion
1407
1185
  }
1408
1186
  origin() {
1409
- //#region @backendFunc
1410
1187
  this._resolveChildFromArg();
1411
1188
  console.log(index_1.Helpers.git.getOriginURL(this.cwd));
1412
1189
  this._exit();
1413
- //#endregion
1414
1190
  }
1415
1191
  remote() {
1416
- //#region @backendFunc
1417
1192
  console.log(index_1.Helpers.git.getOriginURL(this.cwd));
1418
1193
  this._exit();
1419
- //#endregion
1420
1194
  }
1421
1195
  originHttp() {
1422
- //#region @backendFunc
1423
1196
  console.log(index_1.Helpers.git.originSshToHttp(index_1.Helpers.git.getOriginURL(this.cwd)));
1424
1197
  this._exit();
1425
- //#endregion
1426
1198
  }
1427
1199
  originHttps() {
1428
- //#region @backendFunc
1429
1200
  console.log(index_1.Helpers.git.originSshToHttp(index_1.Helpers.git.getOriginURL(this.cwd)));
1430
1201
  this._exit();
1431
- //#endregion
1432
1202
  }
1433
1203
  originssh() {
1434
- //#region @backendFunc
1435
1204
  console.log(index_1.Helpers.git.originHttpToSsh(index_1.Helpers.git.getOriginURL(this.cwd)));
1436
1205
  this._exit();
1437
- //#endregion
1438
1206
  }
1439
1207
  origins() {
1440
- //#region @backendFunc
1441
1208
  this.REMOTES();
1442
- //#endregion
1443
1209
  }
1444
1210
  //#endregion
1445
1211
  //#region commands / git config
1446
1212
  gitConfig() {
1447
- //#region @backendFunc
1448
1213
  const root = index_1.Helpers.git.findGitRoot(this.cwd);
1449
1214
  index_1.Helpers.run(`code ${(0, lib_3.crossPlatformPath)([root, '.git', 'config'])}`).sync();
1450
1215
  this._exit();
1451
- //#endregion
1452
1216
  }
1453
1217
  //#endregion
1454
1218
  //#region commands / lastCommitHash
1455
1219
  LAST_COMMIT_HASH() {
1456
- //#region @backendFunc
1457
1220
  console.log(index_1.Helpers.git.lastCommitHash(this.cwd));
1458
1221
  this._exit();
1459
- //#endregion
1460
1222
  }
1461
1223
  //#endregion
1462
1224
  //#region commands / commit message by hash
1463
1225
  async COMMIT_MESSAGE_BY_HASH() {
1464
- //#region @backendFunc
1465
1226
  const hash = this.firstArg;
1466
1227
  console.log(await this.project.git.getCommitMessageByHash(hash));
1467
1228
  this._exit();
1468
- //#endregion
1469
1229
  }
1470
1230
  //#endregion
1471
1231
  //#region commands / last 5 commit hashes
1472
1232
  async LAST_5_COMMITS() {
1473
- //#region @backendFunc
1474
1233
  for (let index = 0; index < 5; index++) {
1475
1234
  const hash = await this.project.git.getCommitHashByIndex(index);
1476
1235
  console.log(hash);
1477
1236
  }
1478
1237
  this._exit();
1479
- //#endregion
1480
1238
  }
1481
1239
  //#endregion
1482
1240
  //#region commands / update deps from
1483
1241
  async updateDepsFrom() {
1484
- //#region @backendFunc
1485
1242
  let locations = this.args.join(' ').trim() === '' ? [] : this.args;
1486
1243
  if (lib_2._.isArray(locations)) {
1487
1244
  locations = locations.map(l => {
@@ -1493,51 +1250,37 @@ ${lastCommitMessage}
1493
1250
  }
1494
1251
  this.project.packageJson.updateDepsFrom(locations);
1495
1252
  this._exit();
1496
- //#endregion
1497
1253
  }
1498
1254
  //#endregion
1499
1255
  //#region is terminal supported
1500
1256
  isSupportedTaonTerminal() {
1501
- //#region @backendFunc
1502
1257
  console.log(`Terminal is supported: ${index_1.Helpers.isSupportedTaonTerminal}`);
1503
1258
  this._exit();
1504
- //#endregion
1505
1259
  }
1506
1260
  //#endregion
1507
1261
  //#region is terminal running inside cmd
1508
1262
  isRunningInWindowsCmd() {
1509
- //#region @backendFunc
1510
1263
  console.log(`Is terminal running insdie cmd.exe: ${lib_2.UtilsOs.isRunningInWindowsCmd()}`);
1511
1264
  this._exit();
1512
- //#endregion
1513
1265
  }
1514
1266
  //#endregion
1515
1267
  //#region is running inside powershell
1516
1268
  isRunningInWindowsPowerShell() {
1517
- //#region @backendFunc
1518
1269
  console.log(`Is terminal running insdie powershell: ${lib_2.UtilsOs.isRunningInWindowsPowerShell()}`);
1519
1270
  this._exit();
1520
- //#endregion
1521
1271
  }
1522
1272
  //#endregion
1523
1273
  //#region prox ext
1524
1274
  async INSTALL_PROJECT_EXTENSIONS() {
1525
- //#region @backendFunc
1526
1275
  await this.INSTALL_PROJ_EXT();
1527
- //#endregion
1528
1276
  }
1529
1277
  async INSTALL_PROJECT_EXT() {
1530
- //#region @backendFunc
1531
1278
  await this.INSTALL_PROJ_EXT();
1532
- //#endregion
1533
1279
  }
1534
1280
  async INS_PROJ_EXT() {
1535
- //#region @backendFunc
1536
1281
  await this.INSTALL_PROJ_EXT();
1537
- //#endregion
1538
1282
  }
1539
1283
  async INSTALL_PROJ_EXT() {
1540
- //#region @backendFunc
1541
1284
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
1542
1285
  return;
1543
1286
  }
@@ -1547,12 +1290,10 @@ ${lastCommitMessage}
1547
1290
  index_1.Helpers.clearConsole();
1548
1291
  await this.project.vsCodeHelpers.installExtensions(extensions.recommendations, true);
1549
1292
  this._exit();
1550
- //#endregion
1551
1293
  }
1552
1294
  //#endregion
1553
1295
  //#region proj db
1554
1296
  async projdb() {
1555
- //#region @backendFunc
1556
1297
  if (!(await this.cwdIsProject({ requireProjectWithGitRoot: false }))) {
1557
1298
  return;
1558
1299
  }
@@ -1564,22 +1305,18 @@ ${lastCommitMessage}
1564
1305
  `);
1565
1306
  index_1.Helpers.run(`code ${this.project.linkedProjects.projectsDbLocation}`).sync();
1566
1307
  this._exit();
1567
- //#endregion
1568
1308
  }
1569
1309
  //#endregion
1570
1310
  //#region filter all project branches by pattern
1571
1311
  __filterBranchesByPattern(branchPatternOrBranchName) {
1572
- //#region @backendFunc
1573
1312
  const branches = index_1.Helpers.arrays.uniqArray(this.project.git.getBranchesNamesBy(branchPatternOrBranchName) ||
1574
1313
  this.project.getMainBranches());
1575
1314
  // console.log('branches', branches);
1576
1315
  return branches;
1577
- //#endregion
1578
1316
  }
1579
1317
  //#endregion
1580
1318
  //#region select branch from list of branches
1581
1319
  async __selectBrach(branches, task) {
1582
- //#region @backendFunc
1583
1320
  const actionWithoutChildren = task === 'reset' && !this.project.git.resetIsRestingAlsoChildren();
1584
1321
  const childrenMsg = actionWithoutChildren
1585
1322
  ? '(without children)'
@@ -1589,12 +1326,10 @@ ${lastCommitMessage}
1589
1326
  return await index_1.Helpers.autocompleteAsk(`Choose branch to ${task} in this project ${childrenMsg}: `, branches.map(b => {
1590
1327
  return { name: b, value: b };
1591
1328
  }));
1592
- //#endregion
1593
1329
  }
1594
1330
  //#endregion
1595
1331
  //#region commands / clone
1596
1332
  async clone() {
1597
- //#region @backendFunc
1598
1333
  let url = this.firstArg;
1599
1334
  const originType = this.params['setOrigin'];
1600
1335
  if (originType) {
@@ -1610,85 +1345,57 @@ ${lastCommitMessage}
1610
1345
  cwd: this.cwd,
1611
1346
  });
1612
1347
  this._exit();
1613
- //#endregion
1614
1348
  }
1615
1349
  //#endregion
1616
1350
  //#region commands / gh temp
1617
1351
  async ghSave() {
1618
- //#region @backendFunc
1619
1352
  await new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().save();
1620
1353
  this._exit();
1621
- //#endregion
1622
1354
  }
1623
1355
  async ghRestore() {
1624
- //#region @backendFunc
1625
1356
  await new gh_temp_code_1.GhTempCode(this.cwd, this.project).init().restore();
1626
1357
  this._exit();
1627
- //#endregion
1628
1358
  }
1629
1359
  //#endregion
1630
1360
  //#region commands / start cli service ports worker
1631
1361
  async ports() {
1632
- //#region @backendFunc
1633
1362
  await this.ins.portsWorker.terminalUI.infoScreen();
1634
- //#endregion
1635
1363
  }
1636
1364
  /**
1637
1365
  * tnp startCliServicePortsWorker --restart
1638
1366
  */
1639
1367
  async startCliServicePortsWorker() {
1640
- //#region @backendFunc
1641
1368
  await this.ins.portsWorker.cliStartProcedure(this.params);
1642
- //#endregion
1643
- }
1644
- //#endregion
1645
- //#region commands / wait for any key
1646
- async waitForUserAnyKey() {
1647
- //#region @backendFunc
1648
- console.log('Press any key to exit...');
1649
- await lib_4.UtilsTerminal.waitForUserAnyKey(async () => {
1650
- console.log('Exiting...');
1651
- this._exit();
1652
- });
1653
- //#endregion
1654
1369
  }
1655
1370
  //#endregion
1656
1371
  //#region commands / pause terminal
1657
1372
  pauseTerminal() {
1658
- //#region @backendFunc
1659
1373
  index_1.Helpers.pressKeyAndContinue();
1660
1374
  this._exit();
1661
- //#endregion
1662
1375
  }
1663
1376
  //#endregion
1664
- //#region commands / sleep terminal
1377
+ //#region commands / pause terminal
1665
1378
  sleepTerminal() {
1666
- //#region @backendFunc
1667
1379
  index_1.Helpers.info(`Sleeping terminal for 1 second... before exit`);
1668
1380
  index_1.Helpers.sleep(1);
1669
1381
  this._exit();
1670
- //#endregion
1671
1382
  }
1672
1383
  //#endregion
1673
1384
  //#region commands / gh pages init
1674
1385
  async ghPagesInit() {
1675
- //#region @backendFunc
1676
1386
  await this.project.init();
1677
1387
  await this.project.staticPages.init(this.params['provider'] || 'github', !!this.params['full']);
1678
1388
  index_1.Helpers.run('code .', {
1679
1389
  cwd: this.project.staticPages.mainFolderAbsPath,
1680
1390
  }).sync();
1681
1391
  this._exit();
1682
- //#endregion
1683
1392
  }
1684
1393
  //#endregion
1685
1394
  //#region commands / is port in use
1686
1395
  async isPortInUse() {
1687
- //#region @backendFunc
1688
1396
  const port = parseInt(this.firstArg);
1689
1397
  console.log(`Port ${port} is in use: ${await lib_2.UtilsOs.isPortInUse(port)}`);
1690
1398
  this._exit();
1691
- //#endregion
1692
1399
  }
1693
1400
  //#endregion
1694
1401
  //#region commands / proc menu
@@ -1746,12 +1453,9 @@ ${lastCommitMessage}
1746
1453
  //#endregion
1747
1454
  //#region commands / proc info
1748
1455
  procInfo() {
1749
- //#region @backendFunc
1750
1456
  this.processInfo();
1751
- //#endregion
1752
1457
  }
1753
1458
  processInfo() {
1754
- //#region @backendFunc
1755
1459
  index_1.Helpers.info(`
1756
1460
 
1757
1461
  Is running in CLI mode: ${lib_2.UtilsOs.isRunningInCliMode()}
@@ -1767,26 +1471,20 @@ ${lastCommitMessage}
1767
1471
 
1768
1472
  `);
1769
1473
  this._exit();
1770
- //#endregion
1771
1474
  }
1772
1475
  //#endregion
1773
1476
  //#region commands / last git tag
1774
1477
  lastGitTag() {
1775
- //#region @backendFunc
1776
1478
  console.log('Latest tag');
1777
1479
  console.log(this.project?.git.lastTagVersionName);
1778
1480
  this._exit();
1779
- //#endregion
1780
1481
  }
1781
1482
  //#endregion
1782
1483
  //#region commands / check ports
1783
1484
  async checkPort() {
1784
- //#region @backendFunc
1785
1485
  await this.checkPorts();
1786
- //#endregion
1787
1486
  }
1788
1487
  async checkPorts() {
1789
- //#region @backendFunc
1790
1488
  const ports = this.args
1791
1489
  .join(' ')
1792
1490
  .replace(/\,/, '')
@@ -1803,47 +1501,37 @@ ${lastCommitMessage}
1803
1501
  console.log(`Port ${port} is in use: ${isPortInUse ? lib_2.chalk.red('YES') : lib_2.chalk.green('NO')}`);
1804
1502
  }
1805
1503
  this._exit();
1806
- //#endregion
1807
1504
  }
1808
1505
  //#endregion
1809
1506
  //#region commands / remove symlinks
1810
1507
  removeSymlinksDryRun() {
1811
- //#region @backendFunc
1812
1508
  index_1.Helpers.removeSymlinks(this.project.nodeModules.path, {
1813
1509
  dryRun: true,
1814
1510
  });
1815
- //#endregion
1816
1511
  }
1817
1512
  //#endregion
1818
1513
  //#region commands / select java
1819
1514
  async selectJava() {
1820
- //#region @backendFunc
1821
1515
  const selectedJava = await index_1.UtilsJava.selectJdkVersion();
1822
1516
  index_1.UtilsJava.updateJavaHomePath(selectedJava);
1823
- //#endregion
1824
1517
  }
1825
1518
  //#endregion
1826
1519
  //#region commands / select tomcat
1827
1520
  async selectTomcat() {
1828
- //#region @backendFunc
1829
1521
  const selectedTomcat = await index_1.UtilsJava.selectTomcatVersion();
1830
1522
  index_1.UtilsJava.updateTomcatHomePath(selectedTomcat);
1831
1523
  this._exit();
1832
- //#endregion
1833
1524
  }
1834
1525
  //#endregion
1835
1526
  //#region commands / ln
1836
1527
  LN() {
1837
- //#region @backendFunc
1838
1528
  const [source, dest] = this.args;
1839
1529
  index_1.Helpers.createSymLink(source, dest);
1840
1530
  this._exit();
1841
- //#endregion
1842
1531
  }
1843
1532
  //#endregion
1844
1533
  //#region commands / copy
1845
1534
  copy() {
1846
- //#region @backendFunc
1847
1535
  let [from, to] = this.args;
1848
1536
  from = lib_2.path.isAbsolute(from)
1849
1537
  ? (0, lib_3.crossPlatformPath)(from)
@@ -1866,7 +1554,6 @@ ${lastCommitMessage}
1866
1554
  }
1867
1555
  index_1.Helpers.taskDone(`Copied`);
1868
1556
  this._exit();
1869
- //#endregion
1870
1557
  }
1871
1558
  //#endregion
1872
1559
  //#region commands / simulate domain
@@ -1880,7 +1567,6 @@ ${lastCommitMessage}
1880
1567
  //#endregion
1881
1568
  //#region commands / preview
1882
1569
  async preview() {
1883
- //#region @backendFunc
1884
1570
  //#region handle preview of docker compose
1885
1571
  if ([lib_1.fileName.docker_compose_yml, lib_1.fileName.compose_yml].includes(lib_2.path.basename(this.firstArg))) {
1886
1572
  const simulateDomain = this.params['domain'] || this.params['domains'];
@@ -1893,8 +1579,8 @@ ${lastCommitMessage}
1893
1579
  // import { readFileSync } from 'fs';
1894
1580
  // import { resolve } from 'path';
1895
1581
  const envPath = (0, lib_3.crossPlatformPath)([cwd, '.env']);
1896
- const COMPOSE_PROJECT_NAME = lib_5.UtilsDotFile.getValueFromDotFile(envPath, 'COMPOSE_PROJECT_NAME');
1897
- const envContent = lib_5.UtilsDotFile.getValuesKeysAsJsonObject(envPath) || {};
1582
+ const COMPOSE_PROJECT_NAME = index_1.UtilsDotFile.getValueFromDotFile(envPath, 'COMPOSE_PROJECT_NAME');
1583
+ const envContent = index_1.UtilsDotFile.getValuesKeysAsJsonObject(envPath) || {};
1898
1584
  const allDomains = lib_2.Utils.uniqArray(Object.keys(envContent)
1899
1585
  .filter(key => {
1900
1586
  return key.startsWith('FRONTEND_HOST_URL_');
@@ -1920,7 +1606,7 @@ ${lastCommitMessage}
1920
1606
  triggerRevertChangesToEtcHosts,
1921
1607
  });
1922
1608
  }
1923
- const child = project.docker.getDockerComposeUpExecChildProcess('up');
1609
+ const child = this.project.docker.getDockerComposeUpExecChildProcess('up');
1924
1610
  console.log(`
1925
1611
 
1926
1612
 
@@ -1942,7 +1628,7 @@ ${lastCommitMessage}
1942
1628
  console.log('Stopping container...');
1943
1629
  child.kill('SIGINT');
1944
1630
  console.log('Exiting...');
1945
- const downProcess = project.docker.getDockerComposeUpExecChildProcess('down');
1631
+ const downProcess = this.project.docker.getDockerComposeUpExecChildProcess('down');
1946
1632
  downProcess.on('close', code => {
1947
1633
  console.log(`docker compose down exited with code ${code}`);
1948
1634
  process.exit(0);
@@ -1953,7 +1639,6 @@ ${lastCommitMessage}
1953
1639
  index_1.Helpers.error(`You can preview only docker-compose.yml or compose.yml files`, false, true);
1954
1640
  }
1955
1641
  //#endregion
1956
- //#endregion
1957
1642
  }
1958
1643
  //#endregion
1959
1644
  //#region commands / shorten
@@ -1982,7 +1667,6 @@ ${lastCommitMessage}
1982
1667
  //#endregion
1983
1668
  //#region commands / dump packages versions
1984
1669
  dumpPackagesVersions() {
1985
- //#region @backendFunc
1986
1670
  const getData = (location) => {
1987
1671
  const version = index_1.Helpers.readValueFromJson((0, lib_3.crossPlatformPath)([location, lib_1.fileName.package_json]), 'version');
1988
1672
  const name = index_1.Helpers.readValueFromJson((0, lib_3.crossPlatformPath)([location, lib_1.fileName.package_json]), 'name');
@@ -2008,12 +1692,10 @@ ${lastCommitMessage}
2008
1692
  index_1.Helpers.writeJson([this.cwd, 'packages-versions.json'], pkgs);
2009
1693
  index_1.Helpers.info(`packages-versions.json created with ${pkgs.length} packages`);
2010
1694
  this._exit();
2011
- //#endregion
2012
1695
  }
2013
1696
  //#endregion
2014
1697
  //#region commands / zip
2015
1698
  async zip() {
2016
- //#region @backendFunc
2017
1699
  let folderPath = (0, lib_3.crossPlatformPath)(this.firstArg);
2018
1700
  if (!lib_2.path.isAbsolute(folderPath)) {
2019
1701
  folderPath = (0, lib_3.crossPlatformPath)([this.cwd, this.firstArg]);
@@ -2029,12 +1711,10 @@ ${lastCommitMessage}
2029
1711
  });
2030
1712
  index_1.Helpers.info(`Created zip file: ${zipFilePath}`);
2031
1713
  this._exit();
2032
- //#endregion
2033
1714
  }
2034
1715
  //#endregion
2035
1716
  //#region commands / unzip
2036
1717
  async unzip() {
2037
- //#region @backendFunc
2038
1718
  let folderPath = (0, lib_3.crossPlatformPath)(this.firstArg);
2039
1719
  if (!lib_2.path.isAbsolute(folderPath)) {
2040
1720
  folderPath = (0, lib_3.crossPlatformPath)([this.cwd, this.firstArg]);
@@ -2045,12 +1725,10 @@ ${lastCommitMessage}
2045
1725
  await index_1.UtilsZip.unzipArchive(folderPath);
2046
1726
  index_1.Helpers.info(`Created zip file: ${folderPath.replace('.zip', '')}`);
2047
1727
  this._exit();
2048
- //#endregion
2049
1728
  }
2050
1729
  //#endregion
2051
1730
  //#region commands / start transmission
2052
1731
  async startTransmission() {
2053
- //#region @backendFunc
2054
1732
  await this._removeTransmission();
2055
1733
  const userProfile = process.env.USERPROFILE || lib_2.os.homedir();
2056
1734
  const downloadsDir = lib_2.path.join(userProfile, 'Downloads');
@@ -2097,10 +1775,8 @@ ${lastCommitMessage}
2097
1775
  }
2098
1776
  this._exit();
2099
1777
  });
2100
- //#endregion
2101
1778
  }
2102
1779
  async _removeTransmission() {
2103
- //#region @backendFunc
2104
1780
  return new Promise(resolve => {
2105
1781
  const args = ['rm', '-f', 'transmission'];
2106
1782
  console.log('Running:', 'docker', args.join(' '));
@@ -2116,96 +1792,15 @@ ${lastCommitMessage}
2116
1792
  resolve();
2117
1793
  });
2118
1794
  });
2119
- //#endregion
2120
1795
  }
2121
1796
  //#endregion
2122
- //#region commands / backup branch
2123
- async backupBranch() {
2124
- //#region @backendFunc
2125
- await this.project.git.backupBranch(this.firstArg);
1797
+ // projectName|-|www-domgrubegozwierzaka-pl||--||releaseType|-|manual||--||version|-|0.0.8||--||
1798
+ // envName|-|__||--||envNumber|-|||--||targetArtifact|-|angular-node-app|||||-1759151320202-fa12e3a5cfdd
1799
+ extractStringMetadata() {
1800
+ const str = this.firstArg || '';
1801
+ console.log(str);
1802
+ console.log(index_1.FilePathMetaData.extractData(str));
2126
1803
  this._exit();
2127
- //#endregion
2128
- }
2129
- async bb() {
2130
- //#region @backendFunc
2131
- await this.backupBranch();
2132
- //#endregion
2133
- }
2134
- //#endregion
2135
- //#region commands / count code lines
2136
- async countCodeLines() {
2137
- //#region @backendFunc
2138
- await this.countLines();
2139
- //#endregion
2140
- }
2141
- async countLines() {
2142
- //#region @backendFunc
2143
- let extensions = (this.args || []).filter(f => !!f).map(ext => `.${ext}`);
2144
- extensions = extensions.length ? extensions : ['.ts', '.tsx'];
2145
- console.log('Counting SLOC for extensions: ', extensions.join(', '));
2146
- const sloc = require('sloc');
2147
- let total = {
2148
- source: 0,
2149
- comment: 0,
2150
- single: 0,
2151
- block: 0,
2152
- empty: 0,
2153
- total: 0,
2154
- };
2155
- const skip = [
2156
- 'node_modules',
2157
- '.',
2158
- 'tmp-',
2159
- 'environments',
2160
- 'dist',
2161
- 'browser',
2162
- ];
2163
- const walk = (folder) => {
2164
- const entries = lib_2.fse.readdirSync(folder, { withFileTypes: true });
2165
- for (const entry of entries) {
2166
- const fullPath = lib_2.path.join(folder, entry.name);
2167
- if (skip.some(s => entry.name.startsWith(s))) {
2168
- continue;
2169
- }
2170
- if (entry.isDirectory()) {
2171
- console.log('Processing: ', lib_2.path.basename(fullPath));
2172
- walk(fullPath);
2173
- }
2174
- else if (extensions.includes(lib_2.path.extname(entry.name))) {
2175
- const code = lib_2.fse.readFileSync(fullPath, 'utf8');
2176
- const stats = sloc(code, lib_2.path.extname(entry.name).slice(1)); // e.g., "ts" or "js"
2177
- for (const key in total) {
2178
- total[key] += stats[key] ?? 0;
2179
- }
2180
- }
2181
- }
2182
- };
2183
- walk((0, lib_3.crossPlatformPath)([
2184
- this.cwd,
2185
- // 'src'
2186
- ]));
2187
- console.log('📊 SLOC Results:');
2188
- console.table(total);
2189
- this._exit?.(); // your existing exit hook
2190
- return total;
2191
- //#endregion
2192
- }
2193
- //#endregion
2194
- //#region commands / is node version ok
2195
- isNodeVersionOk() {
2196
- //#region @backendFunc
2197
- try {
2198
- lib_2.UtilsOs.isNodeVersionOk({
2199
- throwErrorIfNotOk: true,
2200
- });
2201
- console.info(`Node.js version is OK: ${process.version}`);
2202
- this._exit();
2203
- }
2204
- catch (error) {
2205
- console.error(error);
2206
- this._exit(1);
2207
- }
2208
- //#endregion
2209
1804
  }
2210
1805
  }
2211
1806
  exports.BaseGlobalCommandLine = BaseGlobalCommandLine;