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.
- package/assets/shared/shared_folder_info.txt +1 -1
- package/browser/esm2022/lib/base/base-git.mjs +65 -2
- package/browser/esm2022/lib/base/base-library-build.mjs +4 -2
- package/browser/esm2022/lib/base/base-npm-helpers.mjs +131 -14
- package/browser/esm2022/lib/base/base-project.mjs +8 -1
- package/browser/esm2022/lib/base/base-release-process.mjs +381 -3
- package/browser/esm2022/lib/base/base-vscode.mjs +10 -1
- package/browser/esm2022/lib/base/commit-data.mjs +116 -44
- package/browser/esm2022/lib/base/core-project.mjs +1 -1
- package/browser/esm2022/lib/base/index.mjs +3 -1
- package/browser/esm2022/lib/models.mjs +1 -1
- package/browser/fesm2022/tnp-helpers.mjs +925 -84
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base/base-git.d.ts +15 -4
- package/browser/lib/base/base-library-build.d.ts +1 -1
- package/browser/lib/base/base-npm-helpers.d.ts +25 -1
- package/browser/lib/base/base-project.d.ts +4 -0
- package/browser/lib/base/base-release-process.d.ts +32 -2
- package/browser/lib/base/commit-data.d.ts +18 -13
- package/browser/lib/base/core-project.d.ts +3 -0
- package/browser/lib/base/index.d.ts +1 -0
- package/browser/lib/models.d.ts +5 -0
- package/client/esm2022/lib/base/base-git.mjs +65 -2
- package/client/esm2022/lib/base/base-library-build.mjs +4 -2
- package/client/esm2022/lib/base/base-npm-helpers.mjs +131 -14
- package/client/esm2022/lib/base/base-project.mjs +8 -1
- package/client/esm2022/lib/base/base-release-process.mjs +381 -3
- package/client/esm2022/lib/base/base-vscode.mjs +10 -1
- package/client/esm2022/lib/base/commit-data.mjs +116 -44
- package/client/esm2022/lib/base/core-project.mjs +1 -1
- package/client/esm2022/lib/base/index.mjs +3 -1
- package/client/esm2022/lib/models.mjs +1 -1
- package/client/fesm2022/tnp-helpers.mjs +925 -84
- package/client/fesm2022/tnp-helpers.mjs.map +1 -1
- package/client/lib/base/base-git.d.ts +15 -4
- package/client/lib/base/base-library-build.d.ts +1 -1
- package/client/lib/base/base-npm-helpers.d.ts +25 -1
- package/client/lib/base/base-project.d.ts +4 -0
- package/client/lib/base/base-release-process.d.ts +32 -2
- package/client/lib/base/commit-data.d.ts +18 -13
- package/client/lib/base/core-project.d.ts +3 -0
- package/client/lib/base/index.d.ts +1 -0
- package/client/lib/models.d.ts +5 -0
- package/client/package.json +30 -30
- package/lib/base/base-command-line.backend.d.ts +3 -0
- package/lib/base/base-command-line.backend.js +51 -0
- package/lib/base/base-command-line.backend.js.map +1 -1
- package/lib/base/base-git.d.ts +12 -1
- package/lib/base/base-git.js +118 -41
- package/lib/base/base-git.js.map +1 -1
- package/lib/base/base-library-build.d.ts +1 -1
- package/lib/base/base-library-build.js +33 -31
- package/lib/base/base-library-build.js.map +1 -1
- package/lib/base/base-npm-helpers.d.ts +27 -2
- package/lib/base/base-npm-helpers.js +157 -16
- package/lib/base/base-npm-helpers.js.map +1 -1
- package/lib/base/base-project.d.ts +4 -0
- package/lib/base/base-project.js +13 -0
- package/lib/base/base-project.js.map +1 -1
- package/lib/base/base-release-process.d.ts +32 -2
- package/lib/base/base-release-process.js +621 -16
- package/lib/base/base-release-process.js.map +1 -1
- package/lib/base/base-vscode.js +9 -0
- package/lib/base/base-vscode.js.map +1 -1
- package/lib/base/commit-data.d.ts +17 -12
- package/lib/base/commit-data.js +138 -78
- package/lib/base/commit-data.js.map +1 -1
- package/lib/base/core-project.d.ts +3 -0
- package/lib/base/core-project.js.map +1 -1
- package/lib/base/index.d.ts +2 -0
- package/lib/base/index.js +2 -0
- package/lib/base/index.js.map +1 -1
- package/lib/base/translate.d.ts +227 -1
- package/lib/base/translate.js +566 -54
- package/lib/base/translate.js.map +1 -1
- package/lib/helpers/for-backend/helpers-console-gui.d.ts +1 -0
- package/lib/helpers/for-backend/helpers-console-gui.js +3 -2
- package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
- package/lib/helpers/for-backend/helpers-git.backend.d.ts +16 -1
- package/lib/helpers/for-backend/helpers-git.backend.js +123 -16
- package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-process.backend.d.ts +10 -8
- package/lib/helpers/for-backend/helpers-process.backend.js +56 -56
- package/lib/helpers/for-backend/helpers-process.backend.js.map +1 -1
- package/lib/helpers/for-browser/angular.helper.js +3 -3
- package/lib/models.d.ts +5 -0
- package/lib/old/base-component.js +3 -3
- package/lib/old/base-formly-component.js +3 -3
- package/lib/old/dual-component-ctrl.js +3 -3
- package/package.json +4 -4
- package/tmp-environment.json +34 -34
- package/websql/esm2022/lib/base/base-git.mjs +65 -2
- package/websql/esm2022/lib/base/base-library-build.mjs +4 -2
- package/websql/esm2022/lib/base/base-npm-helpers.mjs +131 -14
- package/websql/esm2022/lib/base/base-project.mjs +8 -1
- package/websql/esm2022/lib/base/base-release-process.mjs +381 -3
- package/websql/esm2022/lib/base/base-vscode.mjs +10 -1
- package/websql/esm2022/lib/base/commit-data.mjs +116 -44
- package/websql/esm2022/lib/base/core-project.mjs +1 -1
- package/websql/esm2022/lib/base/index.mjs +3 -1
- package/websql/esm2022/lib/models.mjs +1 -1
- package/websql/fesm2022/tnp-helpers.mjs +925 -84
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base/base-git.d.ts +15 -4
- package/websql/lib/base/base-library-build.d.ts +1 -1
- package/websql/lib/base/base-npm-helpers.d.ts +26 -4
- package/websql/lib/base/base-project.d.ts +4 -0
- package/websql/lib/base/base-release-process.d.ts +32 -2
- package/websql/lib/base/commit-data.d.ts +18 -13
- package/websql/lib/base/core-project.d.ts +3 -0
- package/websql/lib/base/index.d.ts +1 -0
- package/websql/lib/models.d.ts +5 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as core from 'tnp-core/websql';
|
|
2
|
-
import { _, CoreHelpers, crossPlatformPath, path } from 'tnp-core/websql';
|
|
2
|
+
import { _, CoreHelpers, crossPlatformPath, path, chalk } from 'tnp-core/websql';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
import * as fuzzy from 'fuzzy';
|
|
5
5
|
import { CLASS } from 'typescript-class-helpers/websql';
|
|
@@ -1706,6 +1706,7 @@ class BaseProject {
|
|
|
1706
1706
|
/* */
|
|
1707
1707
|
/* */
|
|
1708
1708
|
/* */
|
|
1709
|
+
/* */
|
|
1709
1710
|
return (void 0);
|
|
1710
1711
|
}
|
|
1711
1712
|
readJson(fileRelativeToProjectPath) {
|
|
@@ -1973,6 +1974,12 @@ class BaseProject {
|
|
|
1973
1974
|
async build(buildOptions) {
|
|
1974
1975
|
throw new Error('TODO IMPLEMENT');
|
|
1975
1976
|
}
|
|
1977
|
+
/**
|
|
1978
|
+
* publish project to npm
|
|
1979
|
+
*/
|
|
1980
|
+
async publish(publishOptions) {
|
|
1981
|
+
throw new Error('TODO IMPLEMENT');
|
|
1982
|
+
}
|
|
1976
1983
|
async release(releaseOptions) {
|
|
1977
1984
|
throw new Error('TODO IMPLEMENT');
|
|
1978
1985
|
}
|
|
@@ -2185,7 +2192,9 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
2185
2192
|
/**
|
|
2186
2193
|
* Angular library build
|
|
2187
2194
|
*/
|
|
2188
|
-
async buildLibraries({ watch = false, strategy, buildType, copylink_to_node_modules, } = {}) {
|
|
2195
|
+
async buildLibraries({ watch = false, strategy, releaseBuild = false, buildType, copylink_to_node_modules, } = {}) {
|
|
2196
|
+
/* */
|
|
2197
|
+
/* */
|
|
2189
2198
|
/* */
|
|
2190
2199
|
/* */
|
|
2191
2200
|
/* */
|
|
@@ -2421,12 +2430,26 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
2421
2430
|
;
|
|
2422
2431
|
({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-library-build.ts
|
|
2423
2432
|
|
|
2433
|
+
/* */
|
|
2434
|
+
/* */
|
|
2435
|
+
/* */
|
|
2436
|
+
/* */
|
|
2437
|
+
/* */
|
|
2438
|
+
/* */
|
|
2424
2439
|
/* */
|
|
2425
2440
|
/* */
|
|
2426
2441
|
class BaseNpmHelpers extends BaseFeatureForProject {
|
|
2427
2442
|
constructor(project) {
|
|
2428
2443
|
super(project);
|
|
2429
|
-
this.
|
|
2444
|
+
this.project = project;
|
|
2445
|
+
this.reloadPackageJsonInMemory();
|
|
2446
|
+
}
|
|
2447
|
+
/**
|
|
2448
|
+
* if something else change package.json in this project
|
|
2449
|
+
* and you know that you need to reload it..
|
|
2450
|
+
*/
|
|
2451
|
+
reloadPackageJsonInMemory() {
|
|
2452
|
+
this.packageJSON = this.project.readJson(config.file.package_json);
|
|
2430
2453
|
}
|
|
2431
2454
|
get name() {
|
|
2432
2455
|
return this.packageJSON?.name || '';
|
|
@@ -2437,6 +2460,23 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
2437
2460
|
get version() {
|
|
2438
2461
|
return this.packageJSON?.version;
|
|
2439
2462
|
}
|
|
2463
|
+
set version(newVersion) {
|
|
2464
|
+
this.packageJSON.version = newVersion;
|
|
2465
|
+
this.project.writeJson(config.file.package_json, this.packageJSON);
|
|
2466
|
+
}
|
|
2467
|
+
updateDependency(packageName, version) {
|
|
2468
|
+
/* */
|
|
2469
|
+
/* */
|
|
2470
|
+
/* */
|
|
2471
|
+
/* */
|
|
2472
|
+
/* */
|
|
2473
|
+
/* */
|
|
2474
|
+
/* */
|
|
2475
|
+
/* */
|
|
2476
|
+
/* */
|
|
2477
|
+
/* */
|
|
2478
|
+
return (void 0);
|
|
2479
|
+
}
|
|
2440
2480
|
get versionWithPatchPlusOne() {
|
|
2441
2481
|
const ver = this.version.split('.');
|
|
2442
2482
|
if (ver.length > 0) {
|
|
@@ -2569,18 +2609,6 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
2569
2609
|
...(packageJson.resolutions || {}),
|
|
2570
2610
|
});
|
|
2571
2611
|
}
|
|
2572
|
-
checkIfLogginInToNpm() {
|
|
2573
|
-
/* */
|
|
2574
|
-
/* */
|
|
2575
|
-
/* */
|
|
2576
|
-
/* */
|
|
2577
|
-
/* */
|
|
2578
|
-
/* */
|
|
2579
|
-
/* */
|
|
2580
|
-
/* */
|
|
2581
|
-
/* */
|
|
2582
|
-
return (void 0);
|
|
2583
|
-
}
|
|
2584
2612
|
linkNodeModulesTo(proj) {
|
|
2585
2613
|
/* */
|
|
2586
2614
|
/* */
|
|
@@ -2776,6 +2804,104 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
2776
2804
|
}
|
|
2777
2805
|
return command;
|
|
2778
2806
|
}
|
|
2807
|
+
/**
|
|
2808
|
+
*
|
|
2809
|
+
* @param registry without specified registr is checking npm registry
|
|
2810
|
+
* @returns
|
|
2811
|
+
*/
|
|
2812
|
+
async isLoggedInToRegistry(registry) {
|
|
2813
|
+
/* */
|
|
2814
|
+
/* */
|
|
2815
|
+
/* */
|
|
2816
|
+
/* */
|
|
2817
|
+
/* */
|
|
2818
|
+
/* */
|
|
2819
|
+
/* */
|
|
2820
|
+
/* */
|
|
2821
|
+
/* */
|
|
2822
|
+
/* */
|
|
2823
|
+
/* */
|
|
2824
|
+
/* */
|
|
2825
|
+
/* */
|
|
2826
|
+
/* */
|
|
2827
|
+
/* */
|
|
2828
|
+
/* */
|
|
2829
|
+
/* */
|
|
2830
|
+
/* */
|
|
2831
|
+
/* */
|
|
2832
|
+
/* */
|
|
2833
|
+
/* */
|
|
2834
|
+
/* */
|
|
2835
|
+
return (void 0);
|
|
2836
|
+
}
|
|
2837
|
+
/**
|
|
2838
|
+
* Prompt the user to log in to a specific npm registry.
|
|
2839
|
+
* @param {string} [registry] - Optional npm registry URL.
|
|
2840
|
+
* @returns {Promise<void>} - A promise that resolves when the login process completes.
|
|
2841
|
+
*/
|
|
2842
|
+
async loginToRegistry(registry) {
|
|
2843
|
+
/* */
|
|
2844
|
+
/* */
|
|
2845
|
+
/* */
|
|
2846
|
+
/* */
|
|
2847
|
+
/* */
|
|
2848
|
+
/* */
|
|
2849
|
+
/* */
|
|
2850
|
+
/* */
|
|
2851
|
+
/* */
|
|
2852
|
+
/* */
|
|
2853
|
+
/* */
|
|
2854
|
+
/* */
|
|
2855
|
+
/* */
|
|
2856
|
+
/* */
|
|
2857
|
+
/* */
|
|
2858
|
+
/* */
|
|
2859
|
+
/* */
|
|
2860
|
+
/* */
|
|
2861
|
+
return (void 0);
|
|
2862
|
+
}
|
|
2863
|
+
async makeSureLoggedInToNpmRegistry(registry) {
|
|
2864
|
+
/* */
|
|
2865
|
+
/* */
|
|
2866
|
+
/* */
|
|
2867
|
+
/* */
|
|
2868
|
+
/* */
|
|
2869
|
+
/* */
|
|
2870
|
+
/* */
|
|
2871
|
+
/* */
|
|
2872
|
+
/* */
|
|
2873
|
+
/* */
|
|
2874
|
+
/* */
|
|
2875
|
+
/* */
|
|
2876
|
+
/* */
|
|
2877
|
+
/* */
|
|
2878
|
+
/* */
|
|
2879
|
+
/* */
|
|
2880
|
+
/* */
|
|
2881
|
+
/* */
|
|
2882
|
+
/* */
|
|
2883
|
+
/* */
|
|
2884
|
+
/* */
|
|
2885
|
+
/* */
|
|
2886
|
+
/* */
|
|
2887
|
+
return (void 0);
|
|
2888
|
+
}
|
|
2889
|
+
/**
|
|
2890
|
+
* @deprecated
|
|
2891
|
+
* use makeSureLoggedInToNpmRegistry()
|
|
2892
|
+
*/
|
|
2893
|
+
checkIfLogginInToNpm() {
|
|
2894
|
+
/* */
|
|
2895
|
+
/* */
|
|
2896
|
+
/* */
|
|
2897
|
+
/* */
|
|
2898
|
+
/* */
|
|
2899
|
+
/* */
|
|
2900
|
+
/* */
|
|
2901
|
+
/* */
|
|
2902
|
+
/* */
|
|
2903
|
+
return (void 0);
|
|
2904
|
+
}
|
|
2779
2905
|
}
|
|
2780
2906
|
;
|
|
2781
2907
|
({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-npm-helpers.ts
|
|
@@ -3113,7 +3239,7 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3113
3239
|
/* */
|
|
3114
3240
|
return (void 0);
|
|
3115
3241
|
}
|
|
3116
|
-
restoreLastVersion(
|
|
3242
|
+
restoreLastVersion(relativeFilePath) {
|
|
3117
3243
|
/* */
|
|
3118
3244
|
/* */
|
|
3119
3245
|
return (void 0);
|
|
@@ -3275,6 +3401,11 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3275
3401
|
/* */
|
|
3276
3402
|
return (void 0);
|
|
3277
3403
|
}
|
|
3404
|
+
async penultimateCommitMessage() {
|
|
3405
|
+
/* */
|
|
3406
|
+
/* */
|
|
3407
|
+
return (void 0);
|
|
3408
|
+
}
|
|
3278
3409
|
async getCommitMessageByIndex(index) {
|
|
3279
3410
|
/* */
|
|
3280
3411
|
/* */
|
|
@@ -3283,6 +3414,14 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3283
3414
|
/* */
|
|
3284
3415
|
return (void 0);
|
|
3285
3416
|
}
|
|
3417
|
+
async getCommitMessageByHash(hash) {
|
|
3418
|
+
/* */
|
|
3419
|
+
/* */
|
|
3420
|
+
/* */
|
|
3421
|
+
/* */
|
|
3422
|
+
/* */
|
|
3423
|
+
return (void 0);
|
|
3424
|
+
}
|
|
3286
3425
|
async getCommitHashByIndex(index) {
|
|
3287
3426
|
/* */
|
|
3288
3427
|
/* */
|
|
@@ -3634,6 +3773,37 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3634
3773
|
/* */
|
|
3635
3774
|
/* */
|
|
3636
3775
|
/* */
|
|
3776
|
+
/* */
|
|
3777
|
+
/* */
|
|
3778
|
+
/* */
|
|
3779
|
+
/* */
|
|
3780
|
+
/* */
|
|
3781
|
+
/* */
|
|
3782
|
+
/* */
|
|
3783
|
+
/* */
|
|
3784
|
+
/* */
|
|
3785
|
+
/* */
|
|
3786
|
+
/* */
|
|
3787
|
+
/* */
|
|
3788
|
+
/* */
|
|
3789
|
+
/* */
|
|
3790
|
+
/* */
|
|
3791
|
+
/* */
|
|
3792
|
+
/* */
|
|
3793
|
+
/* */
|
|
3794
|
+
/* */
|
|
3795
|
+
/* */
|
|
3796
|
+
/* */
|
|
3797
|
+
/* */
|
|
3798
|
+
/* */
|
|
3799
|
+
/* */
|
|
3800
|
+
/* */
|
|
3801
|
+
/* */
|
|
3802
|
+
/* */
|
|
3803
|
+
/* */
|
|
3804
|
+
/* */
|
|
3805
|
+
/* */
|
|
3806
|
+
/* */
|
|
3637
3807
|
return (void 0);
|
|
3638
3808
|
}
|
|
3639
3809
|
_beforeAnyActionOnGitRoot() {
|
|
@@ -3736,23 +3906,18 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3736
3906
|
duringPushWarnIfProjectNotOnSpecyficDevBranch() {
|
|
3737
3907
|
return void 0;
|
|
3738
3908
|
}
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-git.ts
|
|
3742
|
-
|
|
3743
|
-
const regexTeamsID = /[A-Z0-9]+\#/;
|
|
3744
|
-
const regexCommitModuleInArgs = /\[[a-z|\-|\,]+\]/;
|
|
3745
|
-
const regexCommitModuleInBranch = /\-\-[a-z|\-|\_]+\-\-/;
|
|
3746
|
-
class CommitData {
|
|
3747
|
-
/**
|
|
3748
|
-
*
|
|
3749
|
-
* @returns jiras (from oldest to newset)
|
|
3750
|
-
*/
|
|
3751
|
-
static extractAndOrderJiraNumbers(commitOrBranchName) {
|
|
3909
|
+
async getChangedFilesInCommitByHash(hash) {
|
|
3910
|
+
/* */
|
|
3752
3911
|
/* */
|
|
3753
3912
|
/* */
|
|
3754
3913
|
/* */
|
|
3755
3914
|
/* */
|
|
3915
|
+
return (void 0);
|
|
3916
|
+
}
|
|
3917
|
+
/**
|
|
3918
|
+
* @param index 0 - means last commit
|
|
3919
|
+
*/
|
|
3920
|
+
async getChangedFilesInCommitByIndex(index) {
|
|
3756
3921
|
/* */
|
|
3757
3922
|
/* */
|
|
3758
3923
|
/* */
|
|
@@ -3760,46 +3925,59 @@ class CommitData {
|
|
|
3760
3925
|
/* */
|
|
3761
3926
|
return (void 0);
|
|
3762
3927
|
}
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3928
|
+
}
|
|
3929
|
+
;
|
|
3930
|
+
({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-git.ts
|
|
3931
|
+
|
|
3932
|
+
/* */
|
|
3933
|
+
/* */
|
|
3934
|
+
class BaseReleaseProcess extends BaseFeatureForProject {
|
|
3935
|
+
constructor() {
|
|
3936
|
+
super(...arguments);
|
|
3937
|
+
/**
|
|
3938
|
+
* Automatic release process of patch plus one version
|
|
3939
|
+
*/
|
|
3940
|
+
this.automaticRelease = false;
|
|
3941
|
+
this.commitsForChangelog = [];
|
|
3942
|
+
}
|
|
3943
|
+
getReleaseWords() {
|
|
3944
|
+
return ['release'];
|
|
3945
|
+
}
|
|
3946
|
+
async startRelease(options) {
|
|
3947
|
+
while (true) {
|
|
3948
|
+
Helpers.clearConsole();
|
|
3949
|
+
this.newVersion = options?.newVersion;
|
|
3950
|
+
this.automaticRelease = options?.automaticRelease || false;
|
|
3951
|
+
await this.resetReleaseFiles();
|
|
3952
|
+
this.project.npmHelpers.reloadPackageJsonInMemory();
|
|
3953
|
+
this.lastChangesSummary = await this.generateLastChangesSummary();
|
|
3954
|
+
console.log(`${chalk.bold.underline(`Release process for ${this.project.name}`)}:\n` +
|
|
3955
|
+
(await this.lastChangesSummary));
|
|
3956
|
+
this.type = await this.selectReleaseType();
|
|
3957
|
+
await this.confirmNewVersion();
|
|
3958
|
+
this.commitsForChangelog = await this.selectChangelogCommits();
|
|
3959
|
+
await this.updateChangeLogFromCommits();
|
|
3960
|
+
await this.bumpNewVersionEverywhere();
|
|
3961
|
+
await this.buildAllLibraries();
|
|
3962
|
+
if (!(await this.testBeforePublish())) {
|
|
3963
|
+
continue;
|
|
3964
|
+
}
|
|
3965
|
+
if (!(await this.publishToNpm())) {
|
|
3966
|
+
continue;
|
|
3797
3967
|
}
|
|
3968
|
+
await this.reinstallNodeModules();
|
|
3969
|
+
if (!(await this.testAfterPublish())) {
|
|
3970
|
+
continue;
|
|
3971
|
+
}
|
|
3972
|
+
await this.commitAndPush();
|
|
3798
3973
|
}
|
|
3799
|
-
commitModuleName = commitModuleName?.replace(/^\-\-/, '')?.replace(/\-\-$/, '').replace(/\_/, ',');
|
|
3800
|
-
return { commitModuleName };
|
|
3801
3974
|
}
|
|
3802
|
-
|
|
3975
|
+
async reinstallNodeModules() {
|
|
3976
|
+
Helpers.taskStarted(`Reinstalling node_modules to recreate package-lock.json`);
|
|
3977
|
+
this.project.npmHelpers.reinstalNodeModules();
|
|
3978
|
+
Helpers.taskDone(`Reinstalling node_modules to recreate package-lock.json`);
|
|
3979
|
+
}
|
|
3980
|
+
async selectChangelogCommits() {
|
|
3803
3981
|
/* */
|
|
3804
3982
|
/* */
|
|
3805
3983
|
/* */
|
|
@@ -3824,6 +4002,10 @@ class CommitData {
|
|
|
3824
4002
|
/* */
|
|
3825
4003
|
/* */
|
|
3826
4004
|
/* */
|
|
4005
|
+
/* */
|
|
4006
|
+
return (void 0);
|
|
4007
|
+
}
|
|
4008
|
+
async getCommitsUpToReleaseCommit() {
|
|
3827
4009
|
/* */
|
|
3828
4010
|
/* */
|
|
3829
4011
|
/* */
|
|
@@ -3839,7 +4021,9 @@ class CommitData {
|
|
|
3839
4021
|
/* */
|
|
3840
4022
|
return (void 0);
|
|
3841
4023
|
}
|
|
3842
|
-
|
|
4024
|
+
async publishToNpm() {
|
|
4025
|
+
/* */
|
|
4026
|
+
/* */
|
|
3843
4027
|
/* */
|
|
3844
4028
|
/* */
|
|
3845
4029
|
/* */
|
|
@@ -3854,6 +4038,12 @@ class CommitData {
|
|
|
3854
4038
|
/* */
|
|
3855
4039
|
/* */
|
|
3856
4040
|
/* */
|
|
4041
|
+
/* */
|
|
4042
|
+
/* */
|
|
4043
|
+
/* */
|
|
4044
|
+
return (void 0);
|
|
4045
|
+
}
|
|
4046
|
+
async testAfterPublish() {
|
|
3857
4047
|
/* */
|
|
3858
4048
|
/* */
|
|
3859
4049
|
/* */
|
|
@@ -3870,6 +4060,9 @@ class CommitData {
|
|
|
3870
4060
|
/* */
|
|
3871
4061
|
/* */
|
|
3872
4062
|
/* */
|
|
4063
|
+
return (void 0);
|
|
4064
|
+
}
|
|
4065
|
+
async testBeforePublish() {
|
|
3873
4066
|
/* */
|
|
3874
4067
|
/* */
|
|
3875
4068
|
/* */
|
|
@@ -3888,17 +4081,505 @@ class CommitData {
|
|
|
3888
4081
|
/* */
|
|
3889
4082
|
return (void 0);
|
|
3890
4083
|
}
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
4084
|
+
async commitAndPush() {
|
|
4085
|
+
/* */
|
|
4086
|
+
/* */
|
|
4087
|
+
/* */
|
|
4088
|
+
/* */
|
|
4089
|
+
/* */
|
|
4090
|
+
/* */
|
|
4091
|
+
/* */
|
|
4092
|
+
/* */
|
|
4093
|
+
/* */
|
|
4094
|
+
/* */
|
|
4095
|
+
/* */
|
|
4096
|
+
/* */
|
|
4097
|
+
/* */
|
|
4098
|
+
/* */
|
|
4099
|
+
/* */
|
|
4100
|
+
/* */
|
|
4101
|
+
/* */
|
|
4102
|
+
/* */
|
|
4103
|
+
return (void 0);
|
|
4104
|
+
}
|
|
4105
|
+
releaseCommitTemplate() {
|
|
4106
|
+
return `Release v${this.newVersion} + changelog.md update`;
|
|
4107
|
+
}
|
|
4108
|
+
async testLibraries() {
|
|
4109
|
+
try {
|
|
4110
|
+
this.project.run('npm run test', { output: true }).sync();
|
|
4111
|
+
return true;
|
|
4112
|
+
}
|
|
4113
|
+
catch (error) {
|
|
4114
|
+
Helpers.info(`Test failed, you can run test manually`);
|
|
4115
|
+
return false;
|
|
4116
|
+
}
|
|
4117
|
+
}
|
|
4118
|
+
async buildAllLibraries() {
|
|
4119
|
+
await this.project.libraryBuild.buildLibraries({
|
|
4120
|
+
watch: false,
|
|
4121
|
+
releaseBuild: true,
|
|
4122
|
+
buildType: 'angular',
|
|
4123
|
+
});
|
|
4124
|
+
}
|
|
4125
|
+
async resetReleaseFiles() {
|
|
4126
|
+
/* */
|
|
4127
|
+
/* */
|
|
4128
|
+
/* */
|
|
4129
|
+
/* */
|
|
4130
|
+
/* */
|
|
4131
|
+
/* */
|
|
4132
|
+
return (void 0);
|
|
4133
|
+
}
|
|
4134
|
+
get toBumpProjects() {
|
|
4135
|
+
const toBumpProjects = [
|
|
4136
|
+
this.project,
|
|
4137
|
+
...this.project.libraryBuild.libraries,
|
|
4138
|
+
];
|
|
4139
|
+
return toBumpProjects;
|
|
4140
|
+
}
|
|
4141
|
+
async bumpNewVersionEverywhere() {
|
|
4142
|
+
/* */
|
|
4143
|
+
/* */
|
|
4144
|
+
/* */
|
|
4145
|
+
/* */
|
|
4146
|
+
/* */
|
|
4147
|
+
/* */
|
|
4148
|
+
/* */
|
|
4149
|
+
/* */
|
|
4150
|
+
/* */
|
|
4151
|
+
/* */
|
|
4152
|
+
/* */
|
|
4153
|
+
/* */
|
|
4154
|
+
/* */
|
|
4155
|
+
/* */
|
|
4156
|
+
/* */
|
|
4157
|
+
return (void 0);
|
|
4158
|
+
}
|
|
4159
|
+
async confirmNewVersion() {
|
|
4160
|
+
/* */
|
|
4161
|
+
/* */
|
|
4162
|
+
/* */
|
|
4163
|
+
/* */
|
|
4164
|
+
/* */
|
|
4165
|
+
/* */
|
|
4166
|
+
/* */
|
|
4167
|
+
/* */
|
|
4168
|
+
/* */
|
|
4169
|
+
/* */
|
|
4170
|
+
/* */
|
|
4171
|
+
/* */
|
|
4172
|
+
/* */
|
|
4173
|
+
/* */
|
|
4174
|
+
/* */
|
|
4175
|
+
/* */
|
|
4176
|
+
/* */
|
|
4177
|
+
/* */
|
|
4178
|
+
/* */
|
|
4179
|
+
/* */
|
|
4180
|
+
/* */
|
|
4181
|
+
/* */
|
|
4182
|
+
/* */
|
|
4183
|
+
/* */
|
|
4184
|
+
/* */
|
|
4185
|
+
/* */
|
|
4186
|
+
/* */
|
|
4187
|
+
/* */
|
|
4188
|
+
/* */
|
|
4189
|
+
/* */
|
|
4190
|
+
/* */
|
|
4191
|
+
/* */
|
|
4192
|
+
/* */
|
|
4193
|
+
/* */
|
|
4194
|
+
/* */
|
|
4195
|
+
/* */
|
|
4196
|
+
/* */
|
|
4197
|
+
/* */
|
|
4198
|
+
/* */
|
|
4199
|
+
/* */
|
|
4200
|
+
return (void 0);
|
|
4201
|
+
}
|
|
4202
|
+
async selectReleaseType() {
|
|
4203
|
+
/* */
|
|
4204
|
+
/* */
|
|
4205
|
+
/* */
|
|
4206
|
+
/* */
|
|
4207
|
+
/* */
|
|
4208
|
+
/* */
|
|
4209
|
+
/* */
|
|
4210
|
+
/* */
|
|
4211
|
+
/* */
|
|
4212
|
+
/* */
|
|
4213
|
+
/* */
|
|
4214
|
+
/* */
|
|
4215
|
+
/* */
|
|
4216
|
+
/* */
|
|
4217
|
+
/* */
|
|
4218
|
+
/* */
|
|
4219
|
+
/* */
|
|
4220
|
+
/* */
|
|
4221
|
+
/* */
|
|
4222
|
+
/* */
|
|
4223
|
+
/* */
|
|
4224
|
+
/* */
|
|
4225
|
+
/* */
|
|
4226
|
+
return (void 0);
|
|
4227
|
+
}
|
|
4228
|
+
async commitMessageInChangelogTransformFn(message) {
|
|
4229
|
+
return message;
|
|
4230
|
+
}
|
|
4231
|
+
async getChangelogContentToAppend(askForEveryItem) {
|
|
4232
|
+
/* */
|
|
4233
|
+
/* */
|
|
4234
|
+
/* */
|
|
4235
|
+
/* */
|
|
4236
|
+
/* */
|
|
4237
|
+
/* */
|
|
4238
|
+
/* */
|
|
4239
|
+
/* */
|
|
4240
|
+
/* */
|
|
4241
|
+
/* */
|
|
4242
|
+
/* */
|
|
4243
|
+
/* */
|
|
4244
|
+
/* */
|
|
4245
|
+
/* */
|
|
4246
|
+
/* */
|
|
4247
|
+
/* */
|
|
4248
|
+
/* */
|
|
4249
|
+
/* */
|
|
4250
|
+
return (void 0);
|
|
4251
|
+
}
|
|
4252
|
+
/**
|
|
4253
|
+
* TODO extend this to all commits from last release
|
|
4254
|
+
*/
|
|
4255
|
+
async updateChangeLogFromCommits() {
|
|
4256
|
+
/* */
|
|
4257
|
+
/* */
|
|
4258
|
+
/* */
|
|
4259
|
+
/* */
|
|
4260
|
+
/* */
|
|
4261
|
+
/* */
|
|
4262
|
+
/* */
|
|
4263
|
+
/* */
|
|
4264
|
+
/* */
|
|
4265
|
+
/* */
|
|
4266
|
+
/* */
|
|
4267
|
+
/* */
|
|
4268
|
+
/* */
|
|
4269
|
+
/* */
|
|
4270
|
+
/* */
|
|
4271
|
+
/* */
|
|
4272
|
+
/* */
|
|
4273
|
+
/* */
|
|
4274
|
+
/* */
|
|
4275
|
+
/* */
|
|
4276
|
+
/* */
|
|
4277
|
+
/* */
|
|
4278
|
+
/* */
|
|
4279
|
+
/* */
|
|
4280
|
+
/* */
|
|
4281
|
+
return (void 0);
|
|
4282
|
+
}
|
|
4283
|
+
async extractChangedLibrariesInCommit(hashOrIndex) {
|
|
4284
|
+
/* */
|
|
4285
|
+
/* */
|
|
4286
|
+
/* */
|
|
4287
|
+
/* */
|
|
4288
|
+
/* */
|
|
4289
|
+
/* */
|
|
4290
|
+
/* */
|
|
4291
|
+
/* */
|
|
4292
|
+
/* */
|
|
4293
|
+
/* */
|
|
4294
|
+
/* */
|
|
4295
|
+
/* */
|
|
4296
|
+
/* */
|
|
4297
|
+
/* */
|
|
4298
|
+
/* */
|
|
4299
|
+
/* */
|
|
4300
|
+
return (void 0);
|
|
4301
|
+
}
|
|
4302
|
+
async changelogItemTemplate(hashOrIndex, confirmEveryItem = false) {
|
|
4303
|
+
/* */
|
|
4304
|
+
/* */
|
|
4305
|
+
/* */
|
|
4306
|
+
/* */
|
|
4307
|
+
/* */
|
|
4308
|
+
/* */
|
|
4309
|
+
/* */
|
|
4310
|
+
/* */
|
|
4311
|
+
/* */
|
|
4312
|
+
/* */
|
|
4313
|
+
/* */
|
|
4314
|
+
/* */
|
|
4315
|
+
/* */
|
|
4316
|
+
/* */
|
|
4317
|
+
/* */
|
|
4318
|
+
/* */
|
|
4319
|
+
/* */
|
|
4320
|
+
/* */
|
|
4321
|
+
/* */
|
|
4322
|
+
/* */
|
|
4323
|
+
/* */
|
|
4324
|
+
/* */
|
|
4325
|
+
/* */
|
|
4326
|
+
/* */
|
|
4327
|
+
/* */
|
|
4328
|
+
/* */
|
|
4329
|
+
/* */
|
|
4330
|
+
/* */
|
|
4331
|
+
/* */
|
|
4332
|
+
/* */
|
|
4333
|
+
/* */
|
|
4334
|
+
/* */
|
|
4335
|
+
/* */
|
|
4336
|
+
/* */
|
|
4337
|
+
/* */
|
|
4338
|
+
/* */
|
|
4339
|
+
/* */
|
|
4340
|
+
/* */
|
|
4341
|
+
/* */
|
|
4342
|
+
/* */
|
|
4343
|
+
/* */
|
|
4344
|
+
/* */
|
|
4345
|
+
/* */
|
|
4346
|
+
/* */
|
|
4347
|
+
/* */
|
|
4348
|
+
/* */
|
|
4349
|
+
/* */
|
|
4350
|
+
return (void 0);
|
|
4351
|
+
}
|
|
4352
|
+
async generateLastChangesSummary() {
|
|
4353
|
+
const lastReleaseCommitData = await this.getLastReleaseCommitData();
|
|
4354
|
+
const hasLastReleaseCommit = lastReleaseCommitData.index !== -1;
|
|
4355
|
+
const lastReleaseCommitMsg = !hasLastReleaseCommit
|
|
4356
|
+
? '< nothing release yet >'
|
|
4357
|
+
: lastReleaseCommitData.lastRelaseCommitMsg;
|
|
4358
|
+
return `${chalk.bold.gray('Last changelog.md notes summary')}:
|
|
4359
|
+
${await this.getLastPackageVersionChangesFromChnagelog()}
|
|
4360
|
+
|
|
4361
|
+
${chalk.bold.gray(hasLastReleaseCommit ? 'Last commits up to relase commit' : 'Last 3 commits')}:
|
|
4362
|
+
${await this.getLastChangesFromCommits({
|
|
4363
|
+
maxMessagesToCheck: hasLastReleaseCommit ? Number.POSITIVE_INFINITY : 3,
|
|
4364
|
+
stopOnCommitMessage: hasLastReleaseCommit
|
|
4365
|
+
? lastReleaseCommitData.lastRelaseCommitMsg
|
|
4366
|
+
: '',
|
|
4367
|
+
})}
|
|
4368
|
+
`;
|
|
4369
|
+
}
|
|
4370
|
+
async getLastChangesFromCommits({ maxMessagesToCheck = 3, stopOnCommitMessage = '', } = {}) {
|
|
4371
|
+
/* */
|
|
4372
|
+
/* */
|
|
4373
|
+
/* */
|
|
4374
|
+
/* */
|
|
4375
|
+
/* */
|
|
4376
|
+
/* */
|
|
4377
|
+
/* */
|
|
4378
|
+
/* */
|
|
4379
|
+
/* */
|
|
4380
|
+
/* */
|
|
4381
|
+
/* */
|
|
4382
|
+
/* */
|
|
4383
|
+
/* */
|
|
4384
|
+
/* */
|
|
4385
|
+
/* */
|
|
4386
|
+
/* */
|
|
4387
|
+
/* */
|
|
4388
|
+
/* */
|
|
4389
|
+
/* */
|
|
4390
|
+
/* */
|
|
4391
|
+
/* */
|
|
4392
|
+
/* */
|
|
4393
|
+
return (void 0);
|
|
4394
|
+
}
|
|
4395
|
+
async getLastReleaseCommitData() {
|
|
4396
|
+
/* */
|
|
4397
|
+
/* */
|
|
4398
|
+
/* */
|
|
4399
|
+
/* */
|
|
4400
|
+
/* */
|
|
4401
|
+
/* */
|
|
4402
|
+
/* */
|
|
4403
|
+
/* */
|
|
4404
|
+
/* */
|
|
4405
|
+
/* */
|
|
4406
|
+
/* */
|
|
4407
|
+
/* */
|
|
4408
|
+
/* */
|
|
4409
|
+
/* */
|
|
4410
|
+
/* */
|
|
4411
|
+
/* */
|
|
4412
|
+
/* */
|
|
4413
|
+
/* */
|
|
4414
|
+
/* */
|
|
4415
|
+
/* */
|
|
4416
|
+
/* */
|
|
4417
|
+
/* */
|
|
4418
|
+
/* */
|
|
4419
|
+
/* */
|
|
4420
|
+
/* */
|
|
4421
|
+
/* */
|
|
4422
|
+
/* */
|
|
4423
|
+
return (void 0);
|
|
4424
|
+
}
|
|
4425
|
+
async getLastPackageVersionChangesFromChnagelog() {
|
|
4426
|
+
/* */
|
|
4427
|
+
/* */
|
|
4428
|
+
/* */
|
|
4429
|
+
/* */
|
|
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
|
+
/* */
|
|
4458
|
+
/* */
|
|
4459
|
+
/* */
|
|
4460
|
+
/* */
|
|
4461
|
+
/* */
|
|
4462
|
+
/* */
|
|
4463
|
+
return (void 0);
|
|
4464
|
+
}
|
|
4465
|
+
get changeLogPath() {
|
|
4466
|
+
/* */
|
|
4467
|
+
/* */
|
|
4468
|
+
/* */
|
|
4469
|
+
/* */
|
|
4470
|
+
return (void 0);
|
|
4471
|
+
}
|
|
4472
|
+
get changelogContent() {
|
|
4473
|
+
return this.project.readFile(this.changeLogPath) || '';
|
|
4474
|
+
}
|
|
4475
|
+
changeLogKeyWord() {
|
|
4476
|
+
return 'Changes in version';
|
|
4477
|
+
}
|
|
4478
|
+
getChnagelogData() {
|
|
4479
|
+
/* */
|
|
4480
|
+
/* */
|
|
4481
|
+
/* */
|
|
4482
|
+
/* */
|
|
4483
|
+
/* */
|
|
4484
|
+
/* */
|
|
4485
|
+
/* */
|
|
4486
|
+
/* */
|
|
4487
|
+
/* */
|
|
4488
|
+
/* */
|
|
4489
|
+
/* */
|
|
4490
|
+
/* */
|
|
4491
|
+
/* */
|
|
4492
|
+
/* */
|
|
4493
|
+
/* */
|
|
4494
|
+
/* */
|
|
4495
|
+
/* */
|
|
4496
|
+
/* */
|
|
4497
|
+
/* */
|
|
4498
|
+
/* */
|
|
4499
|
+
/* */
|
|
4500
|
+
/* */
|
|
4501
|
+
/* */
|
|
4502
|
+
/* */
|
|
4503
|
+
/* */
|
|
4504
|
+
/* */
|
|
4505
|
+
return (void 0);
|
|
4506
|
+
}
|
|
4507
|
+
}
|
|
4508
|
+
;
|
|
4509
|
+
({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-release-process.ts
|
|
4510
|
+
|
|
4511
|
+
const regexTeamsID = /[A-Z0-9]+\#/;
|
|
4512
|
+
const regexCommitModuleInArgs = /\[[a-z|\-|\,]+\]/;
|
|
4513
|
+
const regexCommitModuleInBranch = /\-\-[a-z|\-|\_]+\-\-/;
|
|
4514
|
+
class CommitData {
|
|
4515
|
+
static cleanHttpFromCommitMessage(commitMsg) {
|
|
4516
|
+
if (!commitMsg) {
|
|
4517
|
+
return commitMsg;
|
|
4518
|
+
}
|
|
4519
|
+
commitMsg = commitMsg.replace('https://', '');
|
|
4520
|
+
commitMsg = commitMsg.replace('http://', '');
|
|
4521
|
+
return commitMsg;
|
|
4522
|
+
}
|
|
4523
|
+
static getTeamsIdFrom(commitMsg) {
|
|
4524
|
+
let teamID = _.first(commitMsg.match(regexTeamsID));
|
|
4525
|
+
if (teamID) {
|
|
4526
|
+
commitMsg = commitMsg.replace(teamID, '');
|
|
4527
|
+
}
|
|
4528
|
+
return {
|
|
4529
|
+
commitMsgOrBranchName: commitMsg,
|
|
4530
|
+
teamID,
|
|
4531
|
+
};
|
|
4532
|
+
}
|
|
4533
|
+
static getModuleNameFrom(commitMsg) {
|
|
4534
|
+
let commitModuleName = _.first(commitMsg.match(regexCommitModuleInArgs));
|
|
4535
|
+
if (commitModuleName) {
|
|
4536
|
+
commitMsg = commitMsg.replace(commitModuleName, '');
|
|
4537
|
+
}
|
|
4538
|
+
commitModuleName = commitModuleName?.replace(/\[/g, '').replace(/\]/g, '');
|
|
4539
|
+
return {
|
|
4540
|
+
commitMsg,
|
|
4541
|
+
commitModuleName,
|
|
4542
|
+
};
|
|
4543
|
+
}
|
|
4544
|
+
/**
|
|
4545
|
+
*
|
|
4546
|
+
* @returns jiras (from oldest to newset)
|
|
4547
|
+
*/
|
|
4548
|
+
static extractAndOrderJiraNumbers(commitOrBranchName) {
|
|
4549
|
+
/* */
|
|
4550
|
+
/* */
|
|
4551
|
+
/* */
|
|
4552
|
+
/* */
|
|
4553
|
+
/* */
|
|
4554
|
+
/* */
|
|
4555
|
+
/* */
|
|
4556
|
+
/* */
|
|
4557
|
+
/* */
|
|
4558
|
+
/* */
|
|
4559
|
+
/* */
|
|
4560
|
+
/* */
|
|
4561
|
+
/* */
|
|
4562
|
+
/* */
|
|
4563
|
+
/* */
|
|
4564
|
+
/* */
|
|
4565
|
+
/* */
|
|
4566
|
+
/* */
|
|
4567
|
+
return (void 0);
|
|
4568
|
+
}
|
|
4569
|
+
static cleanMessageFromJiraNumTeamIdEtc(message, optinos) {
|
|
4570
|
+
message = message || '';
|
|
4571
|
+
let { teamID, commitModuleName, jiraNumbers } = optinos || {};
|
|
4572
|
+
teamID = teamID || this.getTeamsIdFrom(message).teamID || '';
|
|
4573
|
+
commitModuleName =
|
|
4574
|
+
commitModuleName ||
|
|
4575
|
+
this.getModuleNameFrom(message).commitModuleName ||
|
|
4576
|
+
'';
|
|
4577
|
+
jiraNumbers = jiraNumbers || this.extractAndOrderJiraNumbers(message) || [];
|
|
4578
|
+
if (!!teamID.trim()) {
|
|
4579
|
+
message = message.replace(teamID.toLowerCase().replace('-', ' '), ' ');
|
|
4580
|
+
message = message.replace(teamID.toUpperCase().replace('-', ' '), ' ');
|
|
3900
4581
|
}
|
|
3901
|
-
for (const jira of
|
|
4582
|
+
for (const jira of jiraNumbers || []) {
|
|
3902
4583
|
message = message.replace(jira.toLowerCase().replace('-', ' '), ' ');
|
|
3903
4584
|
message = message.replace(jira.toUpperCase().replace('-', ' '), ' ');
|
|
3904
4585
|
message = message.replace(jira, ' ');
|
|
@@ -3907,15 +4588,143 @@ class CommitData {
|
|
|
3907
4588
|
message = message.replace(regexCommitModuleInBranch, ' ');
|
|
3908
4589
|
message = message.replace(/\ \ /g, ' ');
|
|
3909
4590
|
}
|
|
3910
|
-
if (
|
|
4591
|
+
if (!!teamID.trim()) {
|
|
3911
4592
|
message = message.replace(/\_/g, ' ');
|
|
3912
4593
|
}
|
|
3913
|
-
if (
|
|
3914
|
-
message = message.replace(
|
|
3915
|
-
message = message.replace(
|
|
3916
|
-
message = message.replace(
|
|
4594
|
+
if (!!commitModuleName.trim()) {
|
|
4595
|
+
message = message.replace(commitModuleName.replace(/\-/g, ' '), ' ');
|
|
4596
|
+
message = message.replace(commitModuleName.replace(/\,/g, ' '), ' ');
|
|
4597
|
+
message = message.replace(commitModuleName.replace(/\,/g, '_'), ' ');
|
|
3917
4598
|
}
|
|
3918
|
-
return message
|
|
4599
|
+
return message
|
|
4600
|
+
.replace(/\ \ /g, ' ')
|
|
4601
|
+
.replace(/\ \ /g, ' ')
|
|
4602
|
+
.replace(/\ \ /g, ' ');
|
|
4603
|
+
}
|
|
4604
|
+
static getModuleNameFromBranch(branchName) {
|
|
4605
|
+
let commitModuleName = _.first(branchName.match(regexCommitModuleInBranch));
|
|
4606
|
+
if (commitModuleName) {
|
|
4607
|
+
branchName = branchName.replace(commitModuleName, '');
|
|
4608
|
+
commitModuleName = commitModuleName
|
|
4609
|
+
?.replace(/^\-\-/, '')
|
|
4610
|
+
?.replace(/\-\-$/, '');
|
|
4611
|
+
if (commitModuleName.startsWith('-')) {
|
|
4612
|
+
commitModuleName = commitModuleName.replace(/^\-/, '');
|
|
4613
|
+
}
|
|
4614
|
+
}
|
|
4615
|
+
commitModuleName = commitModuleName
|
|
4616
|
+
?.replace(/^\-\-/, '')
|
|
4617
|
+
?.replace(/\-\-$/, '')
|
|
4618
|
+
.replace(/\_/, ',');
|
|
4619
|
+
return { commitModuleName };
|
|
4620
|
+
}
|
|
4621
|
+
static async getFromArgs(args, typeOfCommit) {
|
|
4622
|
+
/* */
|
|
4623
|
+
/* */
|
|
4624
|
+
/* */
|
|
4625
|
+
/* */
|
|
4626
|
+
/* */
|
|
4627
|
+
/* */
|
|
4628
|
+
/* */
|
|
4629
|
+
/* */
|
|
4630
|
+
/* */
|
|
4631
|
+
/* */
|
|
4632
|
+
/* */
|
|
4633
|
+
/* */
|
|
4634
|
+
/* */
|
|
4635
|
+
/* */
|
|
4636
|
+
/* */
|
|
4637
|
+
/* */
|
|
4638
|
+
/* */
|
|
4639
|
+
/* */
|
|
4640
|
+
/* */
|
|
4641
|
+
/* */
|
|
4642
|
+
/* */
|
|
4643
|
+
/* */
|
|
4644
|
+
/* */
|
|
4645
|
+
/* */
|
|
4646
|
+
/* */
|
|
4647
|
+
/* */
|
|
4648
|
+
/* */
|
|
4649
|
+
/* */
|
|
4650
|
+
/* */
|
|
4651
|
+
/* */
|
|
4652
|
+
/* */
|
|
4653
|
+
/* */
|
|
4654
|
+
/* */
|
|
4655
|
+
/* */
|
|
4656
|
+
/* */
|
|
4657
|
+
/* */
|
|
4658
|
+
return (void 0);
|
|
4659
|
+
}
|
|
4660
|
+
static async getFromBranch(currentBranchName) {
|
|
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
|
+
/* */
|
|
4693
|
+
/* */
|
|
4694
|
+
/* */
|
|
4695
|
+
/* */
|
|
4696
|
+
/* */
|
|
4697
|
+
/* */
|
|
4698
|
+
/* */
|
|
4699
|
+
/* */
|
|
4700
|
+
/* */
|
|
4701
|
+
/* */
|
|
4702
|
+
/* */
|
|
4703
|
+
/* */
|
|
4704
|
+
/* */
|
|
4705
|
+
/* */
|
|
4706
|
+
/* */
|
|
4707
|
+
/* */
|
|
4708
|
+
/* */
|
|
4709
|
+
/* */
|
|
4710
|
+
/* */
|
|
4711
|
+
/* */
|
|
4712
|
+
/* */
|
|
4713
|
+
/* */
|
|
4714
|
+
/* */
|
|
4715
|
+
return (void 0);
|
|
4716
|
+
}
|
|
4717
|
+
static from(options) {
|
|
4718
|
+
options = (options ? options : {});
|
|
4719
|
+
const opt = _.merge(new CommitData(), _.cloneDeep(options));
|
|
4720
|
+
return opt;
|
|
4721
|
+
}
|
|
4722
|
+
clearMessage(message) {
|
|
4723
|
+
return CommitData.cleanMessageFromJiraNumTeamIdEtc(message, {
|
|
4724
|
+
teamID: this.teamID,
|
|
4725
|
+
commitModuleName: this.commitModuleName,
|
|
4726
|
+
jiraNumbers: this.jiraNumbers,
|
|
4727
|
+
});
|
|
3919
4728
|
}
|
|
3920
4729
|
/**
|
|
3921
4730
|
* pure message what was done (without jira or prefixes)
|
|
@@ -3941,6 +4750,29 @@ class CommitData {
|
|
|
3941
4750
|
return (void 0);
|
|
3942
4751
|
}
|
|
3943
4752
|
get commitMessage() {
|
|
4753
|
+
/* */
|
|
4754
|
+
/* */
|
|
4755
|
+
/* */
|
|
4756
|
+
/* */
|
|
4757
|
+
/* */
|
|
4758
|
+
/* */
|
|
4759
|
+
/* */
|
|
4760
|
+
/* */
|
|
4761
|
+
/* */
|
|
4762
|
+
/* */
|
|
4763
|
+
/* */
|
|
4764
|
+
/* */
|
|
4765
|
+
/* */
|
|
4766
|
+
/* */
|
|
4767
|
+
/* */
|
|
4768
|
+
/* */
|
|
4769
|
+
/* */
|
|
4770
|
+
/* */
|
|
4771
|
+
/* */
|
|
4772
|
+
/* */
|
|
4773
|
+
/* */
|
|
4774
|
+
/* */
|
|
4775
|
+
/* */
|
|
3944
4776
|
/* */
|
|
3945
4777
|
/* */
|
|
3946
4778
|
/* */
|
|
@@ -3979,6 +4811,14 @@ class CommitData {
|
|
|
3979
4811
|
/* */
|
|
3980
4812
|
/* */
|
|
3981
4813
|
/* */
|
|
4814
|
+
/* */
|
|
4815
|
+
/* */
|
|
4816
|
+
/* */
|
|
4817
|
+
/* */
|
|
4818
|
+
/* */
|
|
4819
|
+
/* */
|
|
4820
|
+
/* */
|
|
4821
|
+
/* */
|
|
3982
4822
|
return (void 0);
|
|
3983
4823
|
}
|
|
3984
4824
|
get isActionCommit() {
|
|
@@ -4180,6 +5020,7 @@ class LinkedPorjectsConfig {
|
|
|
4180
5020
|
/* */
|
|
4181
5021
|
/* */
|
|
4182
5022
|
/* */
|
|
5023
|
+
/* */
|
|
4183
5024
|
;
|
|
4184
5025
|
({}); // @--end-of-file-for-module=tnp-helpers lib/base/index.ts
|
|
4185
5026
|
|
|
@@ -4200,5 +5041,5 @@ const Helpers = HelpersFiredev.Instance;
|
|
|
4200
5041
|
* Generated bundle index. Do not edit.
|
|
4201
5042
|
*/
|
|
4202
5043
|
|
|
4203
|
-
export { BaseFeatureForProject, BaseGit, BaseLibraryBuild, BaseLinkedProjects, BaseNpmHelpers, BaseProject, BaseProjectResolver, BaseProjectTypeArr, CommitData, CoreAngularProject, CoreProject, CoreTypescriptProject, Helpers, HelpersAngular, LinkedPorjectsConfig, LinkedProject, Validators };
|
|
5044
|
+
export { BaseFeatureForProject, BaseGit, BaseLibraryBuild, BaseLinkedProjects, BaseNpmHelpers, BaseProject, BaseProjectResolver, BaseProjectTypeArr, BaseReleaseProcess, CommitData, CoreAngularProject, CoreProject, CoreTypescriptProject, Helpers, HelpersAngular, LinkedPorjectsConfig, LinkedProject, Validators };
|
|
4204
5045
|
//# sourceMappingURL=tnp-helpers.mjs.map
|