tnp-helpers 16.444.20 → 16.444.22
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 +85 -2
- package/browser/esm2022/lib/base/base-library-build.mjs +4 -2
- package/browser/esm2022/lib/base/base-npm-helpers.mjs +168 -15
- package/browser/esm2022/lib/base/base-project.mjs +14 -1
- package/browser/esm2022/lib/base/base-release-process.mjs +582 -0
- 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 +1016 -113
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base/base-git.d.ts +22 -4
- package/browser/lib/base/base-library-build.d.ts +1 -1
- package/browser/lib/base/base-npm-helpers.d.ts +28 -1
- package/browser/lib/base/base-project.d.ts +7 -0
- package/browser/lib/base/base-release-process.d.ts +70 -0
- package/browser/lib/base/commit-data.d.ts +18 -13
- package/browser/lib/base/core-project.d.ts +9 -0
- package/browser/lib/base/index.d.ts +1 -0
- package/browser/lib/models.d.ts +11 -1
- package/client/esm2022/lib/base/base-git.mjs +85 -2
- package/client/esm2022/lib/base/base-library-build.mjs +4 -2
- package/client/esm2022/lib/base/base-npm-helpers.mjs +168 -15
- package/client/esm2022/lib/base/base-project.mjs +14 -1
- package/client/esm2022/lib/base/base-release-process.mjs +582 -0
- 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 +1016 -113
- package/client/fesm2022/tnp-helpers.mjs.map +1 -1
- package/client/lib/base/base-git.d.ts +22 -4
- package/client/lib/base/base-library-build.d.ts +1 -1
- package/client/lib/base/base-npm-helpers.d.ts +28 -1
- package/client/lib/base/base-project.d.ts +7 -0
- package/client/lib/base/base-release-process.d.ts +70 -0
- package/client/lib/base/commit-data.d.ts +18 -13
- package/client/lib/base/core-project.d.ts +9 -0
- package/client/lib/base/index.d.ts +1 -0
- package/client/lib/models.d.ts +11 -1
- package/client/package.json +32 -31
- package/lib/base/base-command-line.backend.d.ts +4 -0
- package/lib/base/base-command-line.backend.js +113 -1
- package/lib/base/base-command-line.backend.js.map +1 -1
- package/lib/base/base-git.d.ts +19 -1
- package/lib/base/base-git.js +156 -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 +30 -2
- package/lib/base/base-npm-helpers.js +212 -17
- package/lib/base/base-npm-helpers.js.map +1 -1
- package/lib/base/base-project.d.ts +7 -0
- package/lib/base/base-project.js +26 -2
- package/lib/base/base-project.js.map +1 -1
- package/lib/base/base-release-process.d.ts +69 -0
- package/lib/base/base-release-process.js +894 -0
- package/lib/base/base-release-process.js.map +1 -0
- 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 +9 -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 +2 -1
- 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-dependencies.backend.js +1 -2
- package/lib/helpers/for-backend/helpers-dependencies.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-git.backend.d.ts +29 -1
- package/lib/helpers/for-backend/helpers-git.backend.js +204 -15
- 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 +11 -1
- 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 +36 -35
- package/websql/esm2022/lib/base/base-git.mjs +85 -2
- package/websql/esm2022/lib/base/base-library-build.mjs +4 -2
- package/websql/esm2022/lib/base/base-npm-helpers.mjs +168 -15
- package/websql/esm2022/lib/base/base-project.mjs +16 -3
- package/websql/esm2022/lib/base/base-release-process.mjs +582 -0
- 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 +1018 -115
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base/base-git.d.ts +22 -4
- package/websql/lib/base/base-library-build.d.ts +1 -1
- package/websql/lib/base/base-npm-helpers.d.ts +28 -1
- package/websql/lib/base/base-project.d.ts +7 -0
- package/websql/lib/base/base-release-process.d.ts +70 -0
- package/websql/lib/base/commit-data.d.ts +18 -13
- package/websql/lib/base/core-project.d.ts +9 -0
- package/websql/lib/base/index.d.ts +1 -0
- package/websql/lib/models.d.ts +11 -1
|
@@ -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';
|
|
@@ -1384,6 +1384,9 @@ class BaseProject {
|
|
|
1384
1384
|
/* */
|
|
1385
1385
|
/* */
|
|
1386
1386
|
/* */
|
|
1387
|
+
/* */
|
|
1388
|
+
/* */
|
|
1389
|
+
/* */
|
|
1387
1390
|
}
|
|
1388
1391
|
get isMonorepo() {
|
|
1389
1392
|
return false;
|
|
@@ -1542,13 +1545,13 @@ class BaseProject {
|
|
|
1542
1545
|
.split('/')
|
|
1543
1546
|
.slice(-1 * sliceMinus)
|
|
1544
1547
|
.join('/');
|
|
1545
|
-
const result = (shortPath.includes(crossPlatformPath(this.location)) ? '' : '(..)') +
|
|
1548
|
+
const result = (shortPath.includes(crossPlatformPath(this.location)) ? '/' : '(..)') +
|
|
1546
1549
|
this.checkAndBoldenPath(this.location)
|
|
1547
1550
|
.split('/')
|
|
1548
1551
|
.slice(-1 * sliceMinus)
|
|
1549
1552
|
.join('/') +
|
|
1550
1553
|
`(${nameFromPackageJson})`;
|
|
1551
|
-
this.cache['genericName'] = result;
|
|
1554
|
+
this.cache['genericName'] = result.replace(/\/\//g, '/');
|
|
1552
1555
|
return this.cache['genericName'];
|
|
1553
1556
|
}
|
|
1554
1557
|
checkAndBoldenPath(fullPath) {
|
|
@@ -1703,6 +1706,7 @@ class BaseProject {
|
|
|
1703
1706
|
/* */
|
|
1704
1707
|
/* */
|
|
1705
1708
|
/* */
|
|
1709
|
+
/* */
|
|
1706
1710
|
return (void 0);
|
|
1707
1711
|
}
|
|
1708
1712
|
readJson(fileRelativeToProjectPath) {
|
|
@@ -1970,6 +1974,15 @@ class BaseProject {
|
|
|
1970
1974
|
async build(buildOptions) {
|
|
1971
1975
|
throw new Error('TODO IMPLEMENT');
|
|
1972
1976
|
}
|
|
1977
|
+
/**
|
|
1978
|
+
* publish project to npm
|
|
1979
|
+
*/
|
|
1980
|
+
async publish(publishOptions) {
|
|
1981
|
+
throw new Error('TODO IMPLEMENT');
|
|
1982
|
+
}
|
|
1983
|
+
async release(releaseOptions) {
|
|
1984
|
+
throw new Error('TODO IMPLEMENT');
|
|
1985
|
+
}
|
|
1973
1986
|
/**
|
|
1974
1987
|
* lint porject
|
|
1975
1988
|
*/
|
|
@@ -2179,7 +2192,9 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
2179
2192
|
/**
|
|
2180
2193
|
* Angular library build
|
|
2181
2194
|
*/
|
|
2182
|
-
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
|
+
/* */
|
|
2183
2198
|
/* */
|
|
2184
2199
|
/* */
|
|
2185
2200
|
/* */
|
|
@@ -2415,12 +2430,26 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
2415
2430
|
;
|
|
2416
2431
|
({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-library-build.ts
|
|
2417
2432
|
|
|
2433
|
+
/* */
|
|
2434
|
+
/* */
|
|
2435
|
+
/* */
|
|
2436
|
+
/* */
|
|
2437
|
+
/* */
|
|
2438
|
+
/* */
|
|
2418
2439
|
/* */
|
|
2419
2440
|
/* */
|
|
2420
2441
|
class BaseNpmHelpers extends BaseFeatureForProject {
|
|
2421
2442
|
constructor(project) {
|
|
2422
2443
|
super(project);
|
|
2423
|
-
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);
|
|
2424
2453
|
}
|
|
2425
2454
|
get name() {
|
|
2426
2455
|
return this.packageJSON?.name || '';
|
|
@@ -2431,6 +2460,56 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
2431
2460
|
get version() {
|
|
2432
2461
|
return this.packageJSON?.version;
|
|
2433
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
|
+
}
|
|
2480
|
+
get versionWithPatchPlusOne() {
|
|
2481
|
+
const ver = this.version.split('.');
|
|
2482
|
+
if (ver.length > 0) {
|
|
2483
|
+
ver[ver.length - 1] = (parseInt(_.last(ver)) + 1).toString();
|
|
2484
|
+
}
|
|
2485
|
+
return ver.join('.');
|
|
2486
|
+
}
|
|
2487
|
+
get versionWithMinorPlusOneAndPatchZero() {
|
|
2488
|
+
const ver = this.version.split('.');
|
|
2489
|
+
if (ver.length > 1) {
|
|
2490
|
+
ver[1] = (parseInt(ver[1]) + 1).toString();
|
|
2491
|
+
for (let index = 2; index < ver.length; index++) {
|
|
2492
|
+
ver[index] = '0';
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
else {
|
|
2496
|
+
Helpers.warn(`[npm-project] something went wrong with bumping minor version`);
|
|
2497
|
+
}
|
|
2498
|
+
return ver.join('.');
|
|
2499
|
+
}
|
|
2500
|
+
get versionWithMajorPlusOneAndMinorZeroAndPatchZero() {
|
|
2501
|
+
const ver = this.version.split('.');
|
|
2502
|
+
if (ver.length > 0) {
|
|
2503
|
+
ver[0] = (parseInt(_.first(ver)) + 1).toString();
|
|
2504
|
+
for (let index = 1; index < ver.length; index++) {
|
|
2505
|
+
ver[index] = '0';
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
else {
|
|
2509
|
+
Helpers.warn(`[npm-project] something went wrong with bumping major version`);
|
|
2510
|
+
}
|
|
2511
|
+
return ver.join('.');
|
|
2512
|
+
}
|
|
2434
2513
|
/**
|
|
2435
2514
|
* Major Version from package.json
|
|
2436
2515
|
*/
|
|
@@ -2530,18 +2609,6 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
2530
2609
|
...(packageJson.resolutions || {}),
|
|
2531
2610
|
});
|
|
2532
2611
|
}
|
|
2533
|
-
checkIfLogginInToNpm() {
|
|
2534
|
-
/* */
|
|
2535
|
-
/* */
|
|
2536
|
-
/* */
|
|
2537
|
-
/* */
|
|
2538
|
-
/* */
|
|
2539
|
-
/* */
|
|
2540
|
-
/* */
|
|
2541
|
-
/* */
|
|
2542
|
-
/* */
|
|
2543
|
-
return (void 0);
|
|
2544
|
-
}
|
|
2545
2612
|
linkNodeModulesTo(proj) {
|
|
2546
2613
|
/* */
|
|
2547
2614
|
/* */
|
|
@@ -2698,7 +2765,10 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
2698
2765
|
}
|
|
2699
2766
|
const command = `npm run ${taskName} ${additionalArguments ? ' -- ' + additionalArguments : ''}`;
|
|
2700
2767
|
Helpers.info(`Starting npm task: "${command}"`);
|
|
2701
|
-
return this.project.run(command, {
|
|
2768
|
+
return this.project.run(command, {
|
|
2769
|
+
output: true,
|
|
2770
|
+
biggerBuffer: true,
|
|
2771
|
+
});
|
|
2702
2772
|
}
|
|
2703
2773
|
async prepareCommand(optiosn) {
|
|
2704
2774
|
let { pkg, remove, silent, useYarn, force, removeYarnOrPackageJsonLock, generateYarnOrPackageJsonLock, ignoreOptional, } = optiosn || {};
|
|
@@ -2734,6 +2804,104 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
2734
2804
|
}
|
|
2735
2805
|
return command;
|
|
2736
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
|
+
}
|
|
2737
2905
|
}
|
|
2738
2906
|
;
|
|
2739
2907
|
({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-npm-helpers.ts
|
|
@@ -3071,7 +3239,7 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3071
3239
|
/* */
|
|
3072
3240
|
return (void 0);
|
|
3073
3241
|
}
|
|
3074
|
-
restoreLastVersion(
|
|
3242
|
+
restoreLastVersion(relativeFilePath) {
|
|
3075
3243
|
/* */
|
|
3076
3244
|
/* */
|
|
3077
3245
|
return (void 0);
|
|
@@ -3233,6 +3401,32 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3233
3401
|
/* */
|
|
3234
3402
|
return (void 0);
|
|
3235
3403
|
}
|
|
3404
|
+
async penultimateCommitMessage() {
|
|
3405
|
+
/* */
|
|
3406
|
+
/* */
|
|
3407
|
+
return (void 0);
|
|
3408
|
+
}
|
|
3409
|
+
async getCommitMessageByIndex(index) {
|
|
3410
|
+
/* */
|
|
3411
|
+
/* */
|
|
3412
|
+
/* */
|
|
3413
|
+
/* */
|
|
3414
|
+
/* */
|
|
3415
|
+
return (void 0);
|
|
3416
|
+
}
|
|
3417
|
+
async getCommitMessageByHash(hash) {
|
|
3418
|
+
/* */
|
|
3419
|
+
/* */
|
|
3420
|
+
/* */
|
|
3421
|
+
/* */
|
|
3422
|
+
/* */
|
|
3423
|
+
return (void 0);
|
|
3424
|
+
}
|
|
3425
|
+
async getCommitHashByIndex(index) {
|
|
3426
|
+
/* */
|
|
3427
|
+
/* */
|
|
3428
|
+
return (void 0);
|
|
3429
|
+
}
|
|
3236
3430
|
penultimateCommitHash() {
|
|
3237
3431
|
/* */
|
|
3238
3432
|
/* */
|
|
@@ -3568,20 +3762,6 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3568
3762
|
/* */
|
|
3569
3763
|
/* */
|
|
3570
3764
|
/* */
|
|
3571
|
-
/* */
|
|
3572
|
-
/* */
|
|
3573
|
-
/* */
|
|
3574
|
-
/* */
|
|
3575
|
-
/* */
|
|
3576
|
-
/* */
|
|
3577
|
-
/* */
|
|
3578
|
-
/* */
|
|
3579
|
-
/* */
|
|
3580
|
-
/* */
|
|
3581
|
-
/* */
|
|
3582
|
-
return (void 0);
|
|
3583
|
-
}
|
|
3584
|
-
_beforeAnyActionOnGitRoot() {
|
|
3585
3765
|
/* */
|
|
3586
3766
|
/* */
|
|
3587
3767
|
/* */
|
|
@@ -3598,10 +3778,6 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3598
3778
|
/* */
|
|
3599
3779
|
/* */
|
|
3600
3780
|
/* */
|
|
3601
|
-
/* */
|
|
3602
|
-
return (void 0);
|
|
3603
|
-
}
|
|
3604
|
-
async _beforePushProcessAction() {
|
|
3605
3781
|
/* */
|
|
3606
3782
|
/* */
|
|
3607
3783
|
/* */
|
|
@@ -3622,9 +3798,6 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3622
3798
|
/* */
|
|
3623
3799
|
/* */
|
|
3624
3800
|
/* */
|
|
3625
|
-
return (void 0);
|
|
3626
|
-
}
|
|
3627
|
-
async _beforePullProcessAction(cloneChildren = false) {
|
|
3628
3801
|
/* */
|
|
3629
3802
|
/* */
|
|
3630
3803
|
/* */
|
|
@@ -3633,8 +3806,7 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3633
3806
|
/* */
|
|
3634
3807
|
return (void 0);
|
|
3635
3808
|
}
|
|
3636
|
-
|
|
3637
|
-
/* */
|
|
3809
|
+
_beforeAnyActionOnGitRoot() {
|
|
3638
3810
|
/* */
|
|
3639
3811
|
/* */
|
|
3640
3812
|
/* */
|
|
@@ -3652,6 +3824,9 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3652
3824
|
/* */
|
|
3653
3825
|
/* */
|
|
3654
3826
|
/* */
|
|
3827
|
+
return (void 0);
|
|
3828
|
+
}
|
|
3829
|
+
async _beforePushProcessAction() {
|
|
3655
3830
|
/* */
|
|
3656
3831
|
/* */
|
|
3657
3832
|
/* */
|
|
@@ -3674,22 +3849,7 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
3674
3849
|
/* */
|
|
3675
3850
|
return (void 0);
|
|
3676
3851
|
}
|
|
3677
|
-
|
|
3678
|
-
;
|
|
3679
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-git.ts
|
|
3680
|
-
|
|
3681
|
-
const regexTeamsID = /[A-Z0-9]+\#/;
|
|
3682
|
-
const regexCommitModuleInArgs = /\[[a-z|\-|\,]+\]/;
|
|
3683
|
-
const regexCommitModuleInBranch = /\-\-[a-z|\-|\_]+\-\-/;
|
|
3684
|
-
class CommitData {
|
|
3685
|
-
/**
|
|
3686
|
-
*
|
|
3687
|
-
* @returns jiras (from oldest to newset)
|
|
3688
|
-
*/
|
|
3689
|
-
static extractAndOrderJiraNumbers(commitOrBranchName) {
|
|
3690
|
-
/* */
|
|
3691
|
-
/* */
|
|
3692
|
-
/* */
|
|
3852
|
+
async _beforePullProcessAction(cloneChildren = false) {
|
|
3693
3853
|
/* */
|
|
3694
3854
|
/* */
|
|
3695
3855
|
/* */
|
|
@@ -3698,46 +3858,8 @@ class CommitData {
|
|
|
3698
3858
|
/* */
|
|
3699
3859
|
return (void 0);
|
|
3700
3860
|
}
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
return commitMsg;
|
|
3704
|
-
}
|
|
3705
|
-
commitMsg = commitMsg.replace('https://', '');
|
|
3706
|
-
commitMsg = commitMsg.replace('http://', '');
|
|
3707
|
-
return commitMsg;
|
|
3708
|
-
}
|
|
3709
|
-
static getTeamsIdFrom(commitMsg) {
|
|
3710
|
-
let teamID = _.first(commitMsg.match(regexTeamsID));
|
|
3711
|
-
if (teamID) {
|
|
3712
|
-
commitMsg = commitMsg.replace(teamID, '');
|
|
3713
|
-
}
|
|
3714
|
-
return {
|
|
3715
|
-
commitMsgOrBranchName: commitMsg, teamID
|
|
3716
|
-
};
|
|
3717
|
-
}
|
|
3718
|
-
static getModuleNameFrom(commitMsg) {
|
|
3719
|
-
let commitModuleName = _.first(commitMsg.match(regexCommitModuleInArgs));
|
|
3720
|
-
if (commitModuleName) {
|
|
3721
|
-
commitMsg = commitMsg.replace(commitModuleName, '');
|
|
3722
|
-
}
|
|
3723
|
-
commitModuleName = commitModuleName?.replace(/\[/g, '').replace(/\]/g, '');
|
|
3724
|
-
return {
|
|
3725
|
-
commitMsg, commitModuleName,
|
|
3726
|
-
};
|
|
3727
|
-
}
|
|
3728
|
-
static getModuleNameFromBranch(branchName) {
|
|
3729
|
-
let commitModuleName = _.first(branchName.match(regexCommitModuleInBranch));
|
|
3730
|
-
if (commitModuleName) {
|
|
3731
|
-
branchName = branchName.replace(commitModuleName, '');
|
|
3732
|
-
commitModuleName = commitModuleName?.replace(/^\-\-/, '')?.replace(/\-\-$/, '');
|
|
3733
|
-
if (commitModuleName.startsWith('-')) {
|
|
3734
|
-
commitModuleName = commitModuleName.replace(/^\-/, '');
|
|
3735
|
-
}
|
|
3736
|
-
}
|
|
3737
|
-
commitModuleName = commitModuleName?.replace(/^\-\-/, '')?.replace(/\-\-$/, '').replace(/\_/, ',');
|
|
3738
|
-
return { commitModuleName };
|
|
3739
|
-
}
|
|
3740
|
-
static async getFromArgs(args, typeOfCommit) {
|
|
3861
|
+
async _getCommitMessage(typeofCommit, args, commitMessageRequired) {
|
|
3862
|
+
/* */
|
|
3741
3863
|
/* */
|
|
3742
3864
|
/* */
|
|
3743
3865
|
/* */
|
|
@@ -3777,7 +3899,508 @@ class CommitData {
|
|
|
3777
3899
|
/* */
|
|
3778
3900
|
return (void 0);
|
|
3779
3901
|
}
|
|
3780
|
-
|
|
3902
|
+
/**
|
|
3903
|
+
* This will prevent accidental branch change for firedev projects
|
|
3904
|
+
* @returns branch name
|
|
3905
|
+
*/
|
|
3906
|
+
duringPushWarnIfProjectNotOnSpecyficDevBranch() {
|
|
3907
|
+
return void 0;
|
|
3908
|
+
}
|
|
3909
|
+
async getChangedFilesInCommitByHash(hash) {
|
|
3910
|
+
/* */
|
|
3911
|
+
/* */
|
|
3912
|
+
/* */
|
|
3913
|
+
/* */
|
|
3914
|
+
/* */
|
|
3915
|
+
return (void 0);
|
|
3916
|
+
}
|
|
3917
|
+
/**
|
|
3918
|
+
* @param index 0 - means last commit
|
|
3919
|
+
*/
|
|
3920
|
+
async getChangedFilesInCommitByIndex(index) {
|
|
3921
|
+
/* */
|
|
3922
|
+
/* */
|
|
3923
|
+
/* */
|
|
3924
|
+
/* */
|
|
3925
|
+
/* */
|
|
3926
|
+
return (void 0);
|
|
3927
|
+
}
|
|
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;
|
|
3967
|
+
}
|
|
3968
|
+
await this.reinstallNodeModules();
|
|
3969
|
+
if (!(await this.testAfterPublish())) {
|
|
3970
|
+
continue;
|
|
3971
|
+
}
|
|
3972
|
+
await this.commitAndPush();
|
|
3973
|
+
}
|
|
3974
|
+
}
|
|
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() {
|
|
3981
|
+
/* */
|
|
3982
|
+
/* */
|
|
3983
|
+
/* */
|
|
3984
|
+
/* */
|
|
3985
|
+
/* */
|
|
3986
|
+
/* */
|
|
3987
|
+
/* */
|
|
3988
|
+
/* */
|
|
3989
|
+
/* */
|
|
3990
|
+
/* */
|
|
3991
|
+
/* */
|
|
3992
|
+
/* */
|
|
3993
|
+
/* */
|
|
3994
|
+
/* */
|
|
3995
|
+
/* */
|
|
3996
|
+
/* */
|
|
3997
|
+
/* */
|
|
3998
|
+
/* */
|
|
3999
|
+
/* */
|
|
4000
|
+
/* */
|
|
4001
|
+
/* */
|
|
4002
|
+
/* */
|
|
4003
|
+
/* */
|
|
4004
|
+
/* */
|
|
4005
|
+
/* */
|
|
4006
|
+
return (void 0);
|
|
4007
|
+
}
|
|
4008
|
+
async getCommitsUpToReleaseCommit() {
|
|
4009
|
+
/* */
|
|
4010
|
+
/* */
|
|
4011
|
+
/* */
|
|
4012
|
+
/* */
|
|
4013
|
+
/* */
|
|
4014
|
+
/* */
|
|
4015
|
+
/* */
|
|
4016
|
+
/* */
|
|
4017
|
+
/* */
|
|
4018
|
+
/* */
|
|
4019
|
+
/* */
|
|
4020
|
+
/* */
|
|
4021
|
+
/* */
|
|
4022
|
+
return (void 0);
|
|
4023
|
+
}
|
|
4024
|
+
async publishToNpm() {
|
|
4025
|
+
/* */
|
|
4026
|
+
/* */
|
|
4027
|
+
/* */
|
|
4028
|
+
/* */
|
|
4029
|
+
/* */
|
|
4030
|
+
/* */
|
|
4031
|
+
/* */
|
|
4032
|
+
/* */
|
|
4033
|
+
/* */
|
|
4034
|
+
/* */
|
|
4035
|
+
/* */
|
|
4036
|
+
/* */
|
|
4037
|
+
/* */
|
|
4038
|
+
/* */
|
|
4039
|
+
/* */
|
|
4040
|
+
/* */
|
|
4041
|
+
/* */
|
|
4042
|
+
/* */
|
|
4043
|
+
/* */
|
|
4044
|
+
return (void 0);
|
|
4045
|
+
}
|
|
4046
|
+
async testAfterPublish() {
|
|
4047
|
+
/* */
|
|
4048
|
+
/* */
|
|
4049
|
+
/* */
|
|
4050
|
+
/* */
|
|
4051
|
+
/* */
|
|
4052
|
+
/* */
|
|
4053
|
+
/* */
|
|
4054
|
+
/* */
|
|
4055
|
+
/* */
|
|
4056
|
+
/* */
|
|
4057
|
+
/* */
|
|
4058
|
+
/* */
|
|
4059
|
+
/* */
|
|
4060
|
+
/* */
|
|
4061
|
+
/* */
|
|
4062
|
+
/* */
|
|
4063
|
+
return (void 0);
|
|
4064
|
+
}
|
|
4065
|
+
async testBeforePublish() {
|
|
4066
|
+
/* */
|
|
4067
|
+
/* */
|
|
4068
|
+
/* */
|
|
4069
|
+
/* */
|
|
4070
|
+
/* */
|
|
4071
|
+
/* */
|
|
4072
|
+
/* */
|
|
4073
|
+
/* */
|
|
4074
|
+
/* */
|
|
4075
|
+
/* */
|
|
4076
|
+
/* */
|
|
4077
|
+
/* */
|
|
4078
|
+
/* */
|
|
4079
|
+
/* */
|
|
4080
|
+
/* */
|
|
4081
|
+
/* */
|
|
4082
|
+
return (void 0);
|
|
4083
|
+
}
|
|
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
|
+
/* */
|
|
3781
4404
|
/* */
|
|
3782
4405
|
/* */
|
|
3783
4406
|
/* */
|
|
@@ -3787,6 +4410,19 @@ class CommitData {
|
|
|
3787
4410
|
/* */
|
|
3788
4411
|
/* */
|
|
3789
4412
|
/* */
|
|
4413
|
+
/* */
|
|
4414
|
+
/* */
|
|
4415
|
+
/* */
|
|
4416
|
+
/* */
|
|
4417
|
+
/* */
|
|
4418
|
+
/* */
|
|
4419
|
+
/* */
|
|
4420
|
+
/* */
|
|
4421
|
+
/* */
|
|
4422
|
+
/* */
|
|
4423
|
+
return (void 0);
|
|
4424
|
+
}
|
|
4425
|
+
async getLastPackageVersionChangesFromChnagelog() {
|
|
3790
4426
|
/* */
|
|
3791
4427
|
/* */
|
|
3792
4428
|
/* */
|
|
@@ -3826,17 +4462,124 @@ class CommitData {
|
|
|
3826
4462
|
/* */
|
|
3827
4463
|
return (void 0);
|
|
3828
4464
|
}
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
4465
|
+
get changeLogPath() {
|
|
4466
|
+
/* */
|
|
4467
|
+
/* */
|
|
4468
|
+
/* */
|
|
4469
|
+
/* */
|
|
4470
|
+
return (void 0);
|
|
3833
4471
|
}
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
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('-', ' '), ' ');
|
|
3838
4581
|
}
|
|
3839
|
-
for (const jira of
|
|
4582
|
+
for (const jira of jiraNumbers || []) {
|
|
3840
4583
|
message = message.replace(jira.toLowerCase().replace('-', ' '), ' ');
|
|
3841
4584
|
message = message.replace(jira.toUpperCase().replace('-', ' '), ' ');
|
|
3842
4585
|
message = message.replace(jira, ' ');
|
|
@@ -3845,15 +4588,143 @@ class CommitData {
|
|
|
3845
4588
|
message = message.replace(regexCommitModuleInBranch, ' ');
|
|
3846
4589
|
message = message.replace(/\ \ /g, ' ');
|
|
3847
4590
|
}
|
|
3848
|
-
if (
|
|
4591
|
+
if (!!teamID.trim()) {
|
|
3849
4592
|
message = message.replace(/\_/g, ' ');
|
|
3850
4593
|
}
|
|
3851
|
-
if (
|
|
3852
|
-
message = message.replace(
|
|
3853
|
-
message = message.replace(
|
|
3854
|
-
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, '_'), ' ');
|
|
3855
4598
|
}
|
|
3856
|
-
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
|
+
});
|
|
3857
4728
|
}
|
|
3858
4729
|
/**
|
|
3859
4730
|
* pure message what was done (without jira or prefixes)
|
|
@@ -3879,6 +4750,29 @@ class CommitData {
|
|
|
3879
4750
|
return (void 0);
|
|
3880
4751
|
}
|
|
3881
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
|
+
/* */
|
|
3882
4776
|
/* */
|
|
3883
4777
|
/* */
|
|
3884
4778
|
/* */
|
|
@@ -3917,6 +4811,14 @@ class CommitData {
|
|
|
3917
4811
|
/* */
|
|
3918
4812
|
/* */
|
|
3919
4813
|
/* */
|
|
4814
|
+
/* */
|
|
4815
|
+
/* */
|
|
4816
|
+
/* */
|
|
4817
|
+
/* */
|
|
4818
|
+
/* */
|
|
4819
|
+
/* */
|
|
4820
|
+
/* */
|
|
4821
|
+
/* */
|
|
3920
4822
|
return (void 0);
|
|
3921
4823
|
}
|
|
3922
4824
|
get isActionCommit() {
|
|
@@ -4118,6 +5020,7 @@ class LinkedPorjectsConfig {
|
|
|
4118
5020
|
/* */
|
|
4119
5021
|
/* */
|
|
4120
5022
|
/* */
|
|
5023
|
+
/* */
|
|
4121
5024
|
;
|
|
4122
5025
|
({}); // @--end-of-file-for-module=tnp-helpers lib/base/index.ts
|
|
4123
5026
|
|
|
@@ -4138,5 +5041,5 @@ const Helpers = HelpersFiredev.Instance;
|
|
|
4138
5041
|
* Generated bundle index. Do not edit.
|
|
4139
5042
|
*/
|
|
4140
5043
|
|
|
4141
|
-
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 };
|
|
4142
5045
|
//# sourceMappingURL=tnp-helpers.mjs.map
|