tnp-helpers 16.444.21 → 16.444.23

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 (112) hide show
  1. package/assets/shared/shared_folder_info.txt +1 -1
  2. package/browser/esm2022/lib/base/base-git.mjs +65 -2
  3. package/browser/esm2022/lib/base/base-library-build.mjs +4 -2
  4. package/browser/esm2022/lib/base/base-npm-helpers.mjs +131 -14
  5. package/browser/esm2022/lib/base/base-project.mjs +8 -1
  6. package/browser/esm2022/lib/base/base-release-process.mjs +381 -3
  7. package/browser/esm2022/lib/base/base-vscode.mjs +10 -1
  8. package/browser/esm2022/lib/base/commit-data.mjs +116 -44
  9. package/browser/esm2022/lib/base/core-project.mjs +1 -1
  10. package/browser/esm2022/lib/base/index.mjs +3 -1
  11. package/browser/esm2022/lib/models.mjs +1 -1
  12. package/browser/fesm2022/tnp-helpers.mjs +925 -84
  13. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  14. package/browser/lib/base/base-git.d.ts +15 -4
  15. package/browser/lib/base/base-library-build.d.ts +1 -1
  16. package/browser/lib/base/base-npm-helpers.d.ts +25 -1
  17. package/browser/lib/base/base-project.d.ts +4 -0
  18. package/browser/lib/base/base-release-process.d.ts +32 -2
  19. package/browser/lib/base/commit-data.d.ts +18 -13
  20. package/browser/lib/base/core-project.d.ts +3 -0
  21. package/browser/lib/base/index.d.ts +1 -0
  22. package/browser/lib/models.d.ts +5 -0
  23. package/client/esm2022/lib/base/base-git.mjs +65 -2
  24. package/client/esm2022/lib/base/base-library-build.mjs +4 -2
  25. package/client/esm2022/lib/base/base-npm-helpers.mjs +131 -14
  26. package/client/esm2022/lib/base/base-project.mjs +8 -1
  27. package/client/esm2022/lib/base/base-release-process.mjs +381 -3
  28. package/client/esm2022/lib/base/base-vscode.mjs +10 -1
  29. package/client/esm2022/lib/base/commit-data.mjs +116 -44
  30. package/client/esm2022/lib/base/core-project.mjs +1 -1
  31. package/client/esm2022/lib/base/index.mjs +3 -1
  32. package/client/esm2022/lib/models.mjs +1 -1
  33. package/client/fesm2022/tnp-helpers.mjs +925 -84
  34. package/client/fesm2022/tnp-helpers.mjs.map +1 -1
  35. package/client/lib/base/base-git.d.ts +15 -4
  36. package/client/lib/base/base-library-build.d.ts +1 -1
  37. package/client/lib/base/base-npm-helpers.d.ts +25 -1
  38. package/client/lib/base/base-project.d.ts +4 -0
  39. package/client/lib/base/base-release-process.d.ts +32 -2
  40. package/client/lib/base/commit-data.d.ts +18 -13
  41. package/client/lib/base/core-project.d.ts +3 -0
  42. package/client/lib/base/index.d.ts +1 -0
  43. package/client/lib/models.d.ts +5 -0
  44. package/client/package.json +30 -30
  45. package/lib/base/base-command-line.backend.d.ts +3 -0
  46. package/lib/base/base-command-line.backend.js +51 -0
  47. package/lib/base/base-command-line.backend.js.map +1 -1
  48. package/lib/base/base-git.d.ts +12 -1
  49. package/lib/base/base-git.js +118 -41
  50. package/lib/base/base-git.js.map +1 -1
  51. package/lib/base/base-library-build.d.ts +1 -1
  52. package/lib/base/base-library-build.js +33 -31
  53. package/lib/base/base-library-build.js.map +1 -1
  54. package/lib/base/base-npm-helpers.d.ts +27 -2
  55. package/lib/base/base-npm-helpers.js +157 -16
  56. package/lib/base/base-npm-helpers.js.map +1 -1
  57. package/lib/base/base-project.d.ts +4 -0
  58. package/lib/base/base-project.js +13 -0
  59. package/lib/base/base-project.js.map +1 -1
  60. package/lib/base/base-release-process.d.ts +32 -2
  61. package/lib/base/base-release-process.js +621 -16
  62. package/lib/base/base-release-process.js.map +1 -1
  63. package/lib/base/base-vscode.js +9 -0
  64. package/lib/base/base-vscode.js.map +1 -1
  65. package/lib/base/commit-data.d.ts +17 -12
  66. package/lib/base/commit-data.js +138 -78
  67. package/lib/base/commit-data.js.map +1 -1
  68. package/lib/base/core-project.d.ts +3 -0
  69. package/lib/base/core-project.js.map +1 -1
  70. package/lib/base/index.d.ts +2 -0
  71. package/lib/base/index.js +2 -0
  72. package/lib/base/index.js.map +1 -1
  73. package/lib/base/translate.d.ts +227 -1
  74. package/lib/base/translate.js +566 -54
  75. package/lib/base/translate.js.map +1 -1
  76. package/lib/helpers/for-backend/helpers-console-gui.d.ts +1 -0
  77. package/lib/helpers/for-backend/helpers-console-gui.js +3 -2
  78. package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
  79. package/lib/helpers/for-backend/helpers-git.backend.d.ts +16 -1
  80. package/lib/helpers/for-backend/helpers-git.backend.js +123 -16
  81. package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
  82. package/lib/helpers/for-backend/helpers-process.backend.d.ts +10 -8
  83. package/lib/helpers/for-backend/helpers-process.backend.js +56 -56
  84. package/lib/helpers/for-backend/helpers-process.backend.js.map +1 -1
  85. package/lib/helpers/for-browser/angular.helper.js +3 -3
  86. package/lib/models.d.ts +5 -0
  87. package/lib/old/base-component.js +3 -3
  88. package/lib/old/base-formly-component.js +3 -3
  89. package/lib/old/dual-component-ctrl.js +3 -3
  90. package/package.json +4 -4
  91. package/tmp-environment.json +34 -34
  92. package/websql/esm2022/lib/base/base-git.mjs +65 -2
  93. package/websql/esm2022/lib/base/base-library-build.mjs +4 -2
  94. package/websql/esm2022/lib/base/base-npm-helpers.mjs +131 -14
  95. package/websql/esm2022/lib/base/base-project.mjs +8 -1
  96. package/websql/esm2022/lib/base/base-release-process.mjs +381 -3
  97. package/websql/esm2022/lib/base/base-vscode.mjs +10 -1
  98. package/websql/esm2022/lib/base/commit-data.mjs +116 -44
  99. package/websql/esm2022/lib/base/core-project.mjs +1 -1
  100. package/websql/esm2022/lib/base/index.mjs +3 -1
  101. package/websql/esm2022/lib/models.mjs +1 -1
  102. package/websql/fesm2022/tnp-helpers.mjs +925 -84
  103. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  104. package/websql/lib/base/base-git.d.ts +15 -4
  105. package/websql/lib/base/base-library-build.d.ts +1 -1
  106. package/websql/lib/base/base-npm-helpers.d.ts +26 -4
  107. package/websql/lib/base/base-project.d.ts +4 -0
  108. package/websql/lib/base/base-release-process.d.ts +32 -2
  109. package/websql/lib/base/commit-data.d.ts +18 -13
  110. package/websql/lib/base/core-project.d.ts +3 -0
  111. package/websql/lib/base/index.d.ts +1 -0
  112. package/websql/lib/models.d.ts +5 -0
@@ -1,5 +1,5 @@
1
1
  import * as core from 'tnp-core/browser';
2
- import { _, CoreHelpers, crossPlatformPath, path } from 'tnp-core/browser';
2
+ import { _, CoreHelpers, crossPlatformPath, path, chalk } from 'tnp-core/browser';
3
3
  import { Subject } from 'rxjs';
4
4
  import * as fuzzy from 'fuzzy';
5
5
  import { CLASS } from 'typescript-class-helpers/browser';
@@ -1740,6 +1740,7 @@ class BaseProject {
1740
1740
  /* */
1741
1741
  /* */
1742
1742
  /* */
1743
+ /* */
1743
1744
  return (void 0);
1744
1745
  }
1745
1746
  readJson(fileRelativeToProjectPath) {
@@ -2007,6 +2008,12 @@ class BaseProject {
2007
2008
  async build(buildOptions) {
2008
2009
  throw new Error('TODO IMPLEMENT');
2009
2010
  }
2011
+ /**
2012
+ * publish project to npm
2013
+ */
2014
+ async publish(publishOptions) {
2015
+ throw new Error('TODO IMPLEMENT');
2016
+ }
2010
2017
  async release(releaseOptions) {
2011
2018
  throw new Error('TODO IMPLEMENT');
2012
2019
  }
@@ -2219,7 +2226,9 @@ class BaseLibraryBuild extends BaseFeatureForProject {
2219
2226
  /**
2220
2227
  * Angular library build
2221
2228
  */
2222
- async buildLibraries({ watch = false, strategy, buildType, copylink_to_node_modules, } = {}) {
2229
+ async buildLibraries({ watch = false, strategy, releaseBuild = false, buildType, copylink_to_node_modules, } = {}) {
2230
+ /* */
2231
+ /* */
2223
2232
  /* */
2224
2233
  /* */
2225
2234
  /* */
@@ -2455,12 +2464,26 @@ class BaseLibraryBuild extends BaseFeatureForProject {
2455
2464
  ;
2456
2465
  ({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-library-build.ts
2457
2466
 
2467
+ /* */
2468
+ /* */
2469
+ /* */
2470
+ /* */
2471
+ /* */
2472
+ /* */
2458
2473
  /* */
2459
2474
  /* */
2460
2475
  class BaseNpmHelpers extends BaseFeatureForProject {
2461
2476
  constructor(project) {
2462
2477
  super(project);
2463
- this.packageJSON = project.readJson(config.file.package_json);
2478
+ this.project = project;
2479
+ this.reloadPackageJsonInMemory();
2480
+ }
2481
+ /**
2482
+ * if something else change package.json in this project
2483
+ * and you know that you need to reload it..
2484
+ */
2485
+ reloadPackageJsonInMemory() {
2486
+ this.packageJSON = this.project.readJson(config.file.package_json);
2464
2487
  }
2465
2488
  get name() {
2466
2489
  return this.packageJSON?.name || '';
@@ -2471,6 +2494,23 @@ class BaseNpmHelpers extends BaseFeatureForProject {
2471
2494
  get version() {
2472
2495
  return this.packageJSON?.version;
2473
2496
  }
2497
+ set version(newVersion) {
2498
+ this.packageJSON.version = newVersion;
2499
+ this.project.writeJson(config.file.package_json, this.packageJSON);
2500
+ }
2501
+ updateDependency(packageName, version) {
2502
+ /* */
2503
+ /* */
2504
+ /* */
2505
+ /* */
2506
+ /* */
2507
+ /* */
2508
+ /* */
2509
+ /* */
2510
+ /* */
2511
+ /* */
2512
+ return (void 0);
2513
+ }
2474
2514
  get versionWithPatchPlusOne() {
2475
2515
  const ver = this.version.split('.');
2476
2516
  if (ver.length > 0) {
@@ -2603,18 +2643,6 @@ class BaseNpmHelpers extends BaseFeatureForProject {
2603
2643
  ...(packageJson.resolutions || {}),
2604
2644
  });
2605
2645
  }
2606
- checkIfLogginInToNpm() {
2607
- /* */
2608
- /* */
2609
- /* */
2610
- /* */
2611
- /* */
2612
- /* */
2613
- /* */
2614
- /* */
2615
- /* */
2616
- return (void 0);
2617
- }
2618
2646
  linkNodeModulesTo(proj) {
2619
2647
  /* */
2620
2648
  /* */
@@ -2810,6 +2838,104 @@ class BaseNpmHelpers extends BaseFeatureForProject {
2810
2838
  }
2811
2839
  return command;
2812
2840
  }
2841
+ /**
2842
+ *
2843
+ * @param registry without specified registr is checking npm registry
2844
+ * @returns
2845
+ */
2846
+ async isLoggedInToRegistry(registry) {
2847
+ /* */
2848
+ /* */
2849
+ /* */
2850
+ /* */
2851
+ /* */
2852
+ /* */
2853
+ /* */
2854
+ /* */
2855
+ /* */
2856
+ /* */
2857
+ /* */
2858
+ /* */
2859
+ /* */
2860
+ /* */
2861
+ /* */
2862
+ /* */
2863
+ /* */
2864
+ /* */
2865
+ /* */
2866
+ /* */
2867
+ /* */
2868
+ /* */
2869
+ return (void 0);
2870
+ }
2871
+ /**
2872
+ * Prompt the user to log in to a specific npm registry.
2873
+ * @param {string} [registry] - Optional npm registry URL.
2874
+ * @returns {Promise<void>} - A promise that resolves when the login process completes.
2875
+ */
2876
+ async loginToRegistry(registry) {
2877
+ /* */
2878
+ /* */
2879
+ /* */
2880
+ /* */
2881
+ /* */
2882
+ /* */
2883
+ /* */
2884
+ /* */
2885
+ /* */
2886
+ /* */
2887
+ /* */
2888
+ /* */
2889
+ /* */
2890
+ /* */
2891
+ /* */
2892
+ /* */
2893
+ /* */
2894
+ /* */
2895
+ return (void 0);
2896
+ }
2897
+ async makeSureLoggedInToNpmRegistry(registry) {
2898
+ /* */
2899
+ /* */
2900
+ /* */
2901
+ /* */
2902
+ /* */
2903
+ /* */
2904
+ /* */
2905
+ /* */
2906
+ /* */
2907
+ /* */
2908
+ /* */
2909
+ /* */
2910
+ /* */
2911
+ /* */
2912
+ /* */
2913
+ /* */
2914
+ /* */
2915
+ /* */
2916
+ /* */
2917
+ /* */
2918
+ /* */
2919
+ /* */
2920
+ /* */
2921
+ return (void 0);
2922
+ }
2923
+ /**
2924
+ * @deprecated
2925
+ * use makeSureLoggedInToNpmRegistry()
2926
+ */
2927
+ checkIfLogginInToNpm() {
2928
+ /* */
2929
+ /* */
2930
+ /* */
2931
+ /* */
2932
+ /* */
2933
+ /* */
2934
+ /* */
2935
+ /* */
2936
+ /* */
2937
+ return (void 0);
2938
+ }
2813
2939
  }
2814
2940
  ;
2815
2941
  ({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-npm-helpers.ts
@@ -3147,7 +3273,7 @@ class BaseGit extends BaseFeatureForProject {
3147
3273
  /* */
3148
3274
  return (void 0);
3149
3275
  }
3150
- restoreLastVersion(localFilePath) {
3276
+ restoreLastVersion(relativeFilePath) {
3151
3277
  /* */
3152
3278
  /* */
3153
3279
  return (void 0);
@@ -3309,6 +3435,11 @@ class BaseGit extends BaseFeatureForProject {
3309
3435
  /* */
3310
3436
  return (void 0);
3311
3437
  }
3438
+ async penultimateCommitMessage() {
3439
+ /* */
3440
+ /* */
3441
+ return (void 0);
3442
+ }
3312
3443
  async getCommitMessageByIndex(index) {
3313
3444
  /* */
3314
3445
  /* */
@@ -3317,6 +3448,14 @@ class BaseGit extends BaseFeatureForProject {
3317
3448
  /* */
3318
3449
  return (void 0);
3319
3450
  }
3451
+ async getCommitMessageByHash(hash) {
3452
+ /* */
3453
+ /* */
3454
+ /* */
3455
+ /* */
3456
+ /* */
3457
+ return (void 0);
3458
+ }
3320
3459
  async getCommitHashByIndex(index) {
3321
3460
  /* */
3322
3461
  /* */
@@ -3668,6 +3807,37 @@ class BaseGit extends BaseFeatureForProject {
3668
3807
  /* */
3669
3808
  /* */
3670
3809
  /* */
3810
+ /* */
3811
+ /* */
3812
+ /* */
3813
+ /* */
3814
+ /* */
3815
+ /* */
3816
+ /* */
3817
+ /* */
3818
+ /* */
3819
+ /* */
3820
+ /* */
3821
+ /* */
3822
+ /* */
3823
+ /* */
3824
+ /* */
3825
+ /* */
3826
+ /* */
3827
+ /* */
3828
+ /* */
3829
+ /* */
3830
+ /* */
3831
+ /* */
3832
+ /* */
3833
+ /* */
3834
+ /* */
3835
+ /* */
3836
+ /* */
3837
+ /* */
3838
+ /* */
3839
+ /* */
3840
+ /* */
3671
3841
  return (void 0);
3672
3842
  }
3673
3843
  _beforeAnyActionOnGitRoot() {
@@ -3770,23 +3940,18 @@ class BaseGit extends BaseFeatureForProject {
3770
3940
  duringPushWarnIfProjectNotOnSpecyficDevBranch() {
3771
3941
  return void 0;
3772
3942
  }
3773
- }
3774
- ;
3775
- ({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-git.ts
3776
-
3777
- const regexTeamsID = /[A-Z0-9]+\#/;
3778
- const regexCommitModuleInArgs = /\[[a-z|\-|\,]+\]/;
3779
- const regexCommitModuleInBranch = /\-\-[a-z|\-|\_]+\-\-/;
3780
- class CommitData {
3781
- /**
3782
- *
3783
- * @returns jiras (from oldest to newset)
3784
- */
3785
- static extractAndOrderJiraNumbers(commitOrBranchName) {
3943
+ async getChangedFilesInCommitByHash(hash) {
3944
+ /* */
3786
3945
  /* */
3787
3946
  /* */
3788
3947
  /* */
3789
3948
  /* */
3949
+ return (void 0);
3950
+ }
3951
+ /**
3952
+ * @param index 0 - means last commit
3953
+ */
3954
+ async getChangedFilesInCommitByIndex(index) {
3790
3955
  /* */
3791
3956
  /* */
3792
3957
  /* */
@@ -3794,46 +3959,59 @@ class CommitData {
3794
3959
  /* */
3795
3960
  return (void 0);
3796
3961
  }
3797
- static cleanHttpFromCommitMessage(commitMsg) {
3798
- if (!commitMsg) {
3799
- return commitMsg;
3800
- }
3801
- commitMsg = commitMsg.replace('https://', '');
3802
- commitMsg = commitMsg.replace('http://', '');
3803
- return commitMsg;
3804
- }
3805
- static getTeamsIdFrom(commitMsg) {
3806
- let teamID = _.first(commitMsg.match(regexTeamsID));
3807
- if (teamID) {
3808
- commitMsg = commitMsg.replace(teamID, '');
3809
- }
3810
- return {
3811
- commitMsgOrBranchName: commitMsg, teamID
3812
- };
3813
- }
3814
- static getModuleNameFrom(commitMsg) {
3815
- let commitModuleName = _.first(commitMsg.match(regexCommitModuleInArgs));
3816
- if (commitModuleName) {
3817
- commitMsg = commitMsg.replace(commitModuleName, '');
3818
- }
3819
- commitModuleName = commitModuleName?.replace(/\[/g, '').replace(/\]/g, '');
3820
- return {
3821
- commitMsg, commitModuleName,
3822
- };
3823
- }
3824
- static getModuleNameFromBranch(branchName) {
3825
- let commitModuleName = _.first(branchName.match(regexCommitModuleInBranch));
3826
- if (commitModuleName) {
3827
- branchName = branchName.replace(commitModuleName, '');
3828
- commitModuleName = commitModuleName?.replace(/^\-\-/, '')?.replace(/\-\-$/, '');
3829
- if (commitModuleName.startsWith('-')) {
3830
- commitModuleName = commitModuleName.replace(/^\-/, '');
3962
+ }
3963
+ ;
3964
+ ({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-git.ts
3965
+
3966
+ /* */
3967
+ /* */
3968
+ class BaseReleaseProcess extends BaseFeatureForProject {
3969
+ constructor() {
3970
+ super(...arguments);
3971
+ /**
3972
+ * Automatic release process of patch plus one version
3973
+ */
3974
+ this.automaticRelease = false;
3975
+ this.commitsForChangelog = [];
3976
+ }
3977
+ getReleaseWords() {
3978
+ return ['release'];
3979
+ }
3980
+ async startRelease(options) {
3981
+ while (true) {
3982
+ Helpers.clearConsole();
3983
+ this.newVersion = options?.newVersion;
3984
+ this.automaticRelease = options?.automaticRelease || false;
3985
+ await this.resetReleaseFiles();
3986
+ this.project.npmHelpers.reloadPackageJsonInMemory();
3987
+ this.lastChangesSummary = await this.generateLastChangesSummary();
3988
+ console.log(`${chalk.bold.underline(`Release process for ${this.project.name}`)}:\n` +
3989
+ (await this.lastChangesSummary));
3990
+ this.type = await this.selectReleaseType();
3991
+ await this.confirmNewVersion();
3992
+ this.commitsForChangelog = await this.selectChangelogCommits();
3993
+ await this.updateChangeLogFromCommits();
3994
+ await this.bumpNewVersionEverywhere();
3995
+ await this.buildAllLibraries();
3996
+ if (!(await this.testBeforePublish())) {
3997
+ continue;
3998
+ }
3999
+ if (!(await this.publishToNpm())) {
4000
+ continue;
3831
4001
  }
4002
+ await this.reinstallNodeModules();
4003
+ if (!(await this.testAfterPublish())) {
4004
+ continue;
4005
+ }
4006
+ await this.commitAndPush();
3832
4007
  }
3833
- commitModuleName = commitModuleName?.replace(/^\-\-/, '')?.replace(/\-\-$/, '').replace(/\_/, ',');
3834
- return { commitModuleName };
3835
4008
  }
3836
- static async getFromArgs(args, typeOfCommit) {
4009
+ async reinstallNodeModules() {
4010
+ Helpers.taskStarted(`Reinstalling node_modules to recreate package-lock.json`);
4011
+ this.project.npmHelpers.reinstalNodeModules();
4012
+ Helpers.taskDone(`Reinstalling node_modules to recreate package-lock.json`);
4013
+ }
4014
+ async selectChangelogCommits() {
3837
4015
  /* */
3838
4016
  /* */
3839
4017
  /* */
@@ -3858,6 +4036,10 @@ class CommitData {
3858
4036
  /* */
3859
4037
  /* */
3860
4038
  /* */
4039
+ /* */
4040
+ return (void 0);
4041
+ }
4042
+ async getCommitsUpToReleaseCommit() {
3861
4043
  /* */
3862
4044
  /* */
3863
4045
  /* */
@@ -3873,7 +4055,9 @@ class CommitData {
3873
4055
  /* */
3874
4056
  return (void 0);
3875
4057
  }
3876
- static async getFromBranch(currentBranchName) {
4058
+ async publishToNpm() {
4059
+ /* */
4060
+ /* */
3877
4061
  /* */
3878
4062
  /* */
3879
4063
  /* */
@@ -3888,6 +4072,12 @@ class CommitData {
3888
4072
  /* */
3889
4073
  /* */
3890
4074
  /* */
4075
+ /* */
4076
+ /* */
4077
+ /* */
4078
+ return (void 0);
4079
+ }
4080
+ async testAfterPublish() {
3891
4081
  /* */
3892
4082
  /* */
3893
4083
  /* */
@@ -3904,6 +4094,9 @@ class CommitData {
3904
4094
  /* */
3905
4095
  /* */
3906
4096
  /* */
4097
+ return (void 0);
4098
+ }
4099
+ async testBeforePublish() {
3907
4100
  /* */
3908
4101
  /* */
3909
4102
  /* */
@@ -3922,17 +4115,505 @@ class CommitData {
3922
4115
  /* */
3923
4116
  return (void 0);
3924
4117
  }
3925
- static from(options) {
3926
- options = (options ? options : {});
3927
- const opt = _.merge(new CommitData(), _.cloneDeep(options));
3928
- return opt;
3929
- }
3930
- clearMessage(message) {
3931
- if (this.teamID && _.isString(this.teamID)) {
3932
- message = message.replace(this.teamID.toLowerCase().replace('-', ' '), ' ');
3933
- message = message.replace(this.teamID.toUpperCase().replace('-', ' '), ' ');
4118
+ async commitAndPush() {
4119
+ /* */
4120
+ /* */
4121
+ /* */
4122
+ /* */
4123
+ /* */
4124
+ /* */
4125
+ /* */
4126
+ /* */
4127
+ /* */
4128
+ /* */
4129
+ /* */
4130
+ /* */
4131
+ /* */
4132
+ /* */
4133
+ /* */
4134
+ /* */
4135
+ /* */
4136
+ /* */
4137
+ return (void 0);
4138
+ }
4139
+ releaseCommitTemplate() {
4140
+ return `Release v${this.newVersion} + changelog.md update`;
4141
+ }
4142
+ async testLibraries() {
4143
+ try {
4144
+ this.project.run('npm run test', { output: true }).sync();
4145
+ return true;
4146
+ }
4147
+ catch (error) {
4148
+ Helpers.info(`Test failed, you can run test manually`);
4149
+ return false;
4150
+ }
4151
+ }
4152
+ async buildAllLibraries() {
4153
+ await this.project.libraryBuild.buildLibraries({
4154
+ watch: false,
4155
+ releaseBuild: true,
4156
+ buildType: 'angular',
4157
+ });
4158
+ }
4159
+ async resetReleaseFiles() {
4160
+ /* */
4161
+ /* */
4162
+ /* */
4163
+ /* */
4164
+ /* */
4165
+ /* */
4166
+ return (void 0);
4167
+ }
4168
+ get toBumpProjects() {
4169
+ const toBumpProjects = [
4170
+ this.project,
4171
+ ...this.project.libraryBuild.libraries,
4172
+ ];
4173
+ return toBumpProjects;
4174
+ }
4175
+ async bumpNewVersionEverywhere() {
4176
+ /* */
4177
+ /* */
4178
+ /* */
4179
+ /* */
4180
+ /* */
4181
+ /* */
4182
+ /* */
4183
+ /* */
4184
+ /* */
4185
+ /* */
4186
+ /* */
4187
+ /* */
4188
+ /* */
4189
+ /* */
4190
+ /* */
4191
+ return (void 0);
4192
+ }
4193
+ async confirmNewVersion() {
4194
+ /* */
4195
+ /* */
4196
+ /* */
4197
+ /* */
4198
+ /* */
4199
+ /* */
4200
+ /* */
4201
+ /* */
4202
+ /* */
4203
+ /* */
4204
+ /* */
4205
+ /* */
4206
+ /* */
4207
+ /* */
4208
+ /* */
4209
+ /* */
4210
+ /* */
4211
+ /* */
4212
+ /* */
4213
+ /* */
4214
+ /* */
4215
+ /* */
4216
+ /* */
4217
+ /* */
4218
+ /* */
4219
+ /* */
4220
+ /* */
4221
+ /* */
4222
+ /* */
4223
+ /* */
4224
+ /* */
4225
+ /* */
4226
+ /* */
4227
+ /* */
4228
+ /* */
4229
+ /* */
4230
+ /* */
4231
+ /* */
4232
+ /* */
4233
+ /* */
4234
+ return (void 0);
4235
+ }
4236
+ async selectReleaseType() {
4237
+ /* */
4238
+ /* */
4239
+ /* */
4240
+ /* */
4241
+ /* */
4242
+ /* */
4243
+ /* */
4244
+ /* */
4245
+ /* */
4246
+ /* */
4247
+ /* */
4248
+ /* */
4249
+ /* */
4250
+ /* */
4251
+ /* */
4252
+ /* */
4253
+ /* */
4254
+ /* */
4255
+ /* */
4256
+ /* */
4257
+ /* */
4258
+ /* */
4259
+ /* */
4260
+ return (void 0);
4261
+ }
4262
+ async commitMessageInChangelogTransformFn(message) {
4263
+ return message;
4264
+ }
4265
+ async getChangelogContentToAppend(askForEveryItem) {
4266
+ /* */
4267
+ /* */
4268
+ /* */
4269
+ /* */
4270
+ /* */
4271
+ /* */
4272
+ /* */
4273
+ /* */
4274
+ /* */
4275
+ /* */
4276
+ /* */
4277
+ /* */
4278
+ /* */
4279
+ /* */
4280
+ /* */
4281
+ /* */
4282
+ /* */
4283
+ /* */
4284
+ return (void 0);
4285
+ }
4286
+ /**
4287
+ * TODO extend this to all commits from last release
4288
+ */
4289
+ async updateChangeLogFromCommits() {
4290
+ /* */
4291
+ /* */
4292
+ /* */
4293
+ /* */
4294
+ /* */
4295
+ /* */
4296
+ /* */
4297
+ /* */
4298
+ /* */
4299
+ /* */
4300
+ /* */
4301
+ /* */
4302
+ /* */
4303
+ /* */
4304
+ /* */
4305
+ /* */
4306
+ /* */
4307
+ /* */
4308
+ /* */
4309
+ /* */
4310
+ /* */
4311
+ /* */
4312
+ /* */
4313
+ /* */
4314
+ /* */
4315
+ return (void 0);
4316
+ }
4317
+ async extractChangedLibrariesInCommit(hashOrIndex) {
4318
+ /* */
4319
+ /* */
4320
+ /* */
4321
+ /* */
4322
+ /* */
4323
+ /* */
4324
+ /* */
4325
+ /* */
4326
+ /* */
4327
+ /* */
4328
+ /* */
4329
+ /* */
4330
+ /* */
4331
+ /* */
4332
+ /* */
4333
+ /* */
4334
+ return (void 0);
4335
+ }
4336
+ async changelogItemTemplate(hashOrIndex, confirmEveryItem = false) {
4337
+ /* */
4338
+ /* */
4339
+ /* */
4340
+ /* */
4341
+ /* */
4342
+ /* */
4343
+ /* */
4344
+ /* */
4345
+ /* */
4346
+ /* */
4347
+ /* */
4348
+ /* */
4349
+ /* */
4350
+ /* */
4351
+ /* */
4352
+ /* */
4353
+ /* */
4354
+ /* */
4355
+ /* */
4356
+ /* */
4357
+ /* */
4358
+ /* */
4359
+ /* */
4360
+ /* */
4361
+ /* */
4362
+ /* */
4363
+ /* */
4364
+ /* */
4365
+ /* */
4366
+ /* */
4367
+ /* */
4368
+ /* */
4369
+ /* */
4370
+ /* */
4371
+ /* */
4372
+ /* */
4373
+ /* */
4374
+ /* */
4375
+ /* */
4376
+ /* */
4377
+ /* */
4378
+ /* */
4379
+ /* */
4380
+ /* */
4381
+ /* */
4382
+ /* */
4383
+ /* */
4384
+ return (void 0);
4385
+ }
4386
+ async generateLastChangesSummary() {
4387
+ const lastReleaseCommitData = await this.getLastReleaseCommitData();
4388
+ const hasLastReleaseCommit = lastReleaseCommitData.index !== -1;
4389
+ const lastReleaseCommitMsg = !hasLastReleaseCommit
4390
+ ? '< nothing release yet >'
4391
+ : lastReleaseCommitData.lastRelaseCommitMsg;
4392
+ return `${chalk.bold.gray('Last changelog.md notes summary')}:
4393
+ ${await this.getLastPackageVersionChangesFromChnagelog()}
4394
+
4395
+ ${chalk.bold.gray(hasLastReleaseCommit ? 'Last commits up to relase commit' : 'Last 3 commits')}:
4396
+ ${await this.getLastChangesFromCommits({
4397
+ maxMessagesToCheck: hasLastReleaseCommit ? Number.POSITIVE_INFINITY : 3,
4398
+ stopOnCommitMessage: hasLastReleaseCommit
4399
+ ? lastReleaseCommitData.lastRelaseCommitMsg
4400
+ : '',
4401
+ })}
4402
+ `;
4403
+ }
4404
+ async getLastChangesFromCommits({ maxMessagesToCheck = 3, stopOnCommitMessage = '', } = {}) {
4405
+ /* */
4406
+ /* */
4407
+ /* */
4408
+ /* */
4409
+ /* */
4410
+ /* */
4411
+ /* */
4412
+ /* */
4413
+ /* */
4414
+ /* */
4415
+ /* */
4416
+ /* */
4417
+ /* */
4418
+ /* */
4419
+ /* */
4420
+ /* */
4421
+ /* */
4422
+ /* */
4423
+ /* */
4424
+ /* */
4425
+ /* */
4426
+ /* */
4427
+ return (void 0);
4428
+ }
4429
+ async getLastReleaseCommitData() {
4430
+ /* */
4431
+ /* */
4432
+ /* */
4433
+ /* */
4434
+ /* */
4435
+ /* */
4436
+ /* */
4437
+ /* */
4438
+ /* */
4439
+ /* */
4440
+ /* */
4441
+ /* */
4442
+ /* */
4443
+ /* */
4444
+ /* */
4445
+ /* */
4446
+ /* */
4447
+ /* */
4448
+ /* */
4449
+ /* */
4450
+ /* */
4451
+ /* */
4452
+ /* */
4453
+ /* */
4454
+ /* */
4455
+ /* */
4456
+ /* */
4457
+ return (void 0);
4458
+ }
4459
+ async getLastPackageVersionChangesFromChnagelog() {
4460
+ /* */
4461
+ /* */
4462
+ /* */
4463
+ /* */
4464
+ /* */
4465
+ /* */
4466
+ /* */
4467
+ /* */
4468
+ /* */
4469
+ /* */
4470
+ /* */
4471
+ /* */
4472
+ /* */
4473
+ /* */
4474
+ /* */
4475
+ /* */
4476
+ /* */
4477
+ /* */
4478
+ /* */
4479
+ /* */
4480
+ /* */
4481
+ /* */
4482
+ /* */
4483
+ /* */
4484
+ /* */
4485
+ /* */
4486
+ /* */
4487
+ /* */
4488
+ /* */
4489
+ /* */
4490
+ /* */
4491
+ /* */
4492
+ /* */
4493
+ /* */
4494
+ /* */
4495
+ /* */
4496
+ /* */
4497
+ return (void 0);
4498
+ }
4499
+ get changeLogPath() {
4500
+ /* */
4501
+ /* */
4502
+ /* */
4503
+ /* */
4504
+ return (void 0);
4505
+ }
4506
+ get changelogContent() {
4507
+ return this.project.readFile(this.changeLogPath) || '';
4508
+ }
4509
+ changeLogKeyWord() {
4510
+ return 'Changes in version';
4511
+ }
4512
+ getChnagelogData() {
4513
+ /* */
4514
+ /* */
4515
+ /* */
4516
+ /* */
4517
+ /* */
4518
+ /* */
4519
+ /* */
4520
+ /* */
4521
+ /* */
4522
+ /* */
4523
+ /* */
4524
+ /* */
4525
+ /* */
4526
+ /* */
4527
+ /* */
4528
+ /* */
4529
+ /* */
4530
+ /* */
4531
+ /* */
4532
+ /* */
4533
+ /* */
4534
+ /* */
4535
+ /* */
4536
+ /* */
4537
+ /* */
4538
+ /* */
4539
+ return (void 0);
4540
+ }
4541
+ }
4542
+ ;
4543
+ ({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-release-process.ts
4544
+
4545
+ const regexTeamsID = /[A-Z0-9]+\#/;
4546
+ const regexCommitModuleInArgs = /\[[a-z|\-|\,]+\]/;
4547
+ const regexCommitModuleInBranch = /\-\-[a-z|\-|\_]+\-\-/;
4548
+ class CommitData {
4549
+ static cleanHttpFromCommitMessage(commitMsg) {
4550
+ if (!commitMsg) {
4551
+ return commitMsg;
4552
+ }
4553
+ commitMsg = commitMsg.replace('https://', '');
4554
+ commitMsg = commitMsg.replace('http://', '');
4555
+ return commitMsg;
4556
+ }
4557
+ static getTeamsIdFrom(commitMsg) {
4558
+ let teamID = _.first(commitMsg.match(regexTeamsID));
4559
+ if (teamID) {
4560
+ commitMsg = commitMsg.replace(teamID, '');
4561
+ }
4562
+ return {
4563
+ commitMsgOrBranchName: commitMsg,
4564
+ teamID,
4565
+ };
4566
+ }
4567
+ static getModuleNameFrom(commitMsg) {
4568
+ let commitModuleName = _.first(commitMsg.match(regexCommitModuleInArgs));
4569
+ if (commitModuleName) {
4570
+ commitMsg = commitMsg.replace(commitModuleName, '');
4571
+ }
4572
+ commitModuleName = commitModuleName?.replace(/\[/g, '').replace(/\]/g, '');
4573
+ return {
4574
+ commitMsg,
4575
+ commitModuleName,
4576
+ };
4577
+ }
4578
+ /**
4579
+ *
4580
+ * @returns jiras (from oldest to newset)
4581
+ */
4582
+ static extractAndOrderJiraNumbers(commitOrBranchName) {
4583
+ /* */
4584
+ /* */
4585
+ /* */
4586
+ /* */
4587
+ /* */
4588
+ /* */
4589
+ /* */
4590
+ /* */
4591
+ /* */
4592
+ /* */
4593
+ /* */
4594
+ /* */
4595
+ /* */
4596
+ /* */
4597
+ /* */
4598
+ /* */
4599
+ /* */
4600
+ /* */
4601
+ return (void 0);
4602
+ }
4603
+ static cleanMessageFromJiraNumTeamIdEtc(message, optinos) {
4604
+ message = message || '';
4605
+ let { teamID, commitModuleName, jiraNumbers } = optinos || {};
4606
+ teamID = teamID || this.getTeamsIdFrom(message).teamID || '';
4607
+ commitModuleName =
4608
+ commitModuleName ||
4609
+ this.getModuleNameFrom(message).commitModuleName ||
4610
+ '';
4611
+ jiraNumbers = jiraNumbers || this.extractAndOrderJiraNumbers(message) || [];
4612
+ if (!!teamID.trim()) {
4613
+ message = message.replace(teamID.toLowerCase().replace('-', ' '), ' ');
4614
+ message = message.replace(teamID.toUpperCase().replace('-', ' '), ' ');
3934
4615
  }
3935
- for (const jira of (this.jiraNumbers || [])) {
4616
+ for (const jira of jiraNumbers || []) {
3936
4617
  message = message.replace(jira.toLowerCase().replace('-', ' '), ' ');
3937
4618
  message = message.replace(jira.toUpperCase().replace('-', ' '), ' ');
3938
4619
  message = message.replace(jira, ' ');
@@ -3941,15 +4622,143 @@ class CommitData {
3941
4622
  message = message.replace(regexCommitModuleInBranch, ' ');
3942
4623
  message = message.replace(/\ \ /g, ' ');
3943
4624
  }
3944
- if (this.teamID && _.isString(this.teamID)) {
4625
+ if (!!teamID.trim()) {
3945
4626
  message = message.replace(/\_/g, ' ');
3946
4627
  }
3947
- if (this.commitModuleName) {
3948
- message = message.replace(this.commitModuleName.replace(/\-/g, ' '), ' ');
3949
- message = message.replace(this.commitModuleName.replace(/\,/g, ' '), ' ');
3950
- message = message.replace(this.commitModuleName.replace(/\,/g, '_'), ' ');
4628
+ if (!!commitModuleName.trim()) {
4629
+ message = message.replace(commitModuleName.replace(/\-/g, ' '), ' ');
4630
+ message = message.replace(commitModuleName.replace(/\,/g, ' '), ' ');
4631
+ message = message.replace(commitModuleName.replace(/\,/g, '_'), ' ');
3951
4632
  }
3952
- return message;
4633
+ return message
4634
+ .replace(/\ \ /g, ' ')
4635
+ .replace(/\ \ /g, ' ')
4636
+ .replace(/\ \ /g, ' ');
4637
+ }
4638
+ static getModuleNameFromBranch(branchName) {
4639
+ let commitModuleName = _.first(branchName.match(regexCommitModuleInBranch));
4640
+ if (commitModuleName) {
4641
+ branchName = branchName.replace(commitModuleName, '');
4642
+ commitModuleName = commitModuleName
4643
+ ?.replace(/^\-\-/, '')
4644
+ ?.replace(/\-\-$/, '');
4645
+ if (commitModuleName.startsWith('-')) {
4646
+ commitModuleName = commitModuleName.replace(/^\-/, '');
4647
+ }
4648
+ }
4649
+ commitModuleName = commitModuleName
4650
+ ?.replace(/^\-\-/, '')
4651
+ ?.replace(/\-\-$/, '')
4652
+ .replace(/\_/, ',');
4653
+ return { commitModuleName };
4654
+ }
4655
+ static async getFromArgs(args, typeOfCommit) {
4656
+ /* */
4657
+ /* */
4658
+ /* */
4659
+ /* */
4660
+ /* */
4661
+ /* */
4662
+ /* */
4663
+ /* */
4664
+ /* */
4665
+ /* */
4666
+ /* */
4667
+ /* */
4668
+ /* */
4669
+ /* */
4670
+ /* */
4671
+ /* */
4672
+ /* */
4673
+ /* */
4674
+ /* */
4675
+ /* */
4676
+ /* */
4677
+ /* */
4678
+ /* */
4679
+ /* */
4680
+ /* */
4681
+ /* */
4682
+ /* */
4683
+ /* */
4684
+ /* */
4685
+ /* */
4686
+ /* */
4687
+ /* */
4688
+ /* */
4689
+ /* */
4690
+ /* */
4691
+ /* */
4692
+ return (void 0);
4693
+ }
4694
+ static async getFromBranch(currentBranchName) {
4695
+ /* */
4696
+ /* */
4697
+ /* */
4698
+ /* */
4699
+ /* */
4700
+ /* */
4701
+ /* */
4702
+ /* */
4703
+ /* */
4704
+ /* */
4705
+ /* */
4706
+ /* */
4707
+ /* */
4708
+ /* */
4709
+ /* */
4710
+ /* */
4711
+ /* */
4712
+ /* */
4713
+ /* */
4714
+ /* */
4715
+ /* */
4716
+ /* */
4717
+ /* */
4718
+ /* */
4719
+ /* */
4720
+ /* */
4721
+ /* */
4722
+ /* */
4723
+ /* */
4724
+ /* */
4725
+ /* */
4726
+ /* */
4727
+ /* */
4728
+ /* */
4729
+ /* */
4730
+ /* */
4731
+ /* */
4732
+ /* */
4733
+ /* */
4734
+ /* */
4735
+ /* */
4736
+ /* */
4737
+ /* */
4738
+ /* */
4739
+ /* */
4740
+ /* */
4741
+ /* */
4742
+ /* */
4743
+ /* */
4744
+ /* */
4745
+ /* */
4746
+ /* */
4747
+ /* */
4748
+ /* */
4749
+ return (void 0);
4750
+ }
4751
+ static from(options) {
4752
+ options = (options ? options : {});
4753
+ const opt = _.merge(new CommitData(), _.cloneDeep(options));
4754
+ return opt;
4755
+ }
4756
+ clearMessage(message) {
4757
+ return CommitData.cleanMessageFromJiraNumTeamIdEtc(message, {
4758
+ teamID: this.teamID,
4759
+ commitModuleName: this.commitModuleName,
4760
+ jiraNumbers: this.jiraNumbers,
4761
+ });
3953
4762
  }
3954
4763
  /**
3955
4764
  * pure message what was done (without jira or prefixes)
@@ -3975,6 +4784,29 @@ class CommitData {
3975
4784
  return (void 0);
3976
4785
  }
3977
4786
  get commitMessage() {
4787
+ /* */
4788
+ /* */
4789
+ /* */
4790
+ /* */
4791
+ /* */
4792
+ /* */
4793
+ /* */
4794
+ /* */
4795
+ /* */
4796
+ /* */
4797
+ /* */
4798
+ /* */
4799
+ /* */
4800
+ /* */
4801
+ /* */
4802
+ /* */
4803
+ /* */
4804
+ /* */
4805
+ /* */
4806
+ /* */
4807
+ /* */
4808
+ /* */
4809
+ /* */
3978
4810
  /* */
3979
4811
  /* */
3980
4812
  /* */
@@ -4013,6 +4845,14 @@ class CommitData {
4013
4845
  /* */
4014
4846
  /* */
4015
4847
  /* */
4848
+ /* */
4849
+ /* */
4850
+ /* */
4851
+ /* */
4852
+ /* */
4853
+ /* */
4854
+ /* */
4855
+ /* */
4016
4856
  return (void 0);
4017
4857
  }
4018
4858
  get isActionCommit() {
@@ -4214,6 +5054,7 @@ class LinkedPorjectsConfig {
4214
5054
  /* */
4215
5055
  /* */
4216
5056
  /* */
5057
+ /* */
4217
5058
  ;
4218
5059
  ({}); // @--end-of-file-for-module=tnp-helpers lib/base/index.ts
4219
5060
 
@@ -4234,5 +5075,5 @@ const Helpers = HelpersFiredev.Instance;
4234
5075
  * Generated bundle index. Do not edit.
4235
5076
  */
4236
5077
 
4237
- export { BaseFeatureForProject, BaseGit, BaseLibraryBuild, BaseLinkedProjects, BaseNpmHelpers, BaseProject, BaseProjectResolver, BaseProjectTypeArr, CommitData, CoreAngularProject, CoreProject, CoreTypescriptProject, Helpers, HelpersAngular, LinkedPorjectsConfig, LinkedProject, Validators };
5078
+ export { BaseFeatureForProject, BaseGit, BaseLibraryBuild, BaseLinkedProjects, BaseNpmHelpers, BaseProject, BaseProjectResolver, BaseProjectTypeArr, BaseReleaseProcess, CommitData, CoreAngularProject, CoreProject, CoreTypescriptProject, Helpers, HelpersAngular, LinkedPorjectsConfig, LinkedProject, Validators };
4238
5079
  //# sourceMappingURL=tnp-helpers.mjs.map