tnp-helpers 13.1.1 → 13.1.3

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 (185) hide show
  1. package/app.d.ts +1 -1
  2. package/app.js +6 -6
  3. package/browser/README.md +24 -24
  4. package/browser/esm2020/lib/base-component.mjs +47 -47
  5. package/browser/esm2020/lib/base-formly-component.mjs +125 -125
  6. package/browser/esm2020/lib/condition-wait.mjs +53 -53
  7. package/browser/esm2020/lib/constants.mjs +6 -6
  8. package/browser/esm2020/lib/dual-component-ctrl.mjs +120 -120
  9. package/browser/esm2020/lib/helpers-array-obj.mjs +80 -80
  10. package/browser/esm2020/lib/helpers-environment.mjs +30 -30
  11. package/browser/esm2020/lib/helpers-numbers.mjs +5 -5
  12. package/browser/esm2020/lib/helpers-strings-regexes.mjs +48 -48
  13. package/browser/esm2020/lib/helpers-strings.mjs +257 -257
  14. package/browser/esm2020/lib/helpers.mjs +276 -276
  15. package/browser/esm2020/lib/index.mjs +14 -14
  16. package/browser/esm2020/lib/long-press.directive.mjs +111 -111
  17. package/browser/esm2020/lib/project.mjs +413 -413
  18. package/browser/esm2020/lib/resize-service.mjs +19 -19
  19. package/browser/esm2020/public-api.mjs +1 -1
  20. package/browser/esm2020/tnp-helpers.mjs +4 -4
  21. package/browser/fesm2015/tnp-helpers.mjs +1535 -1535
  22. package/browser/fesm2020/tnp-helpers.mjs +1527 -1527
  23. package/browser/lib/base-component.d.ts +17 -17
  24. package/browser/lib/base-formly-component.d.ts +31 -31
  25. package/browser/lib/condition-wait.d.ts +8 -8
  26. package/browser/lib/constants.d.ts +6 -6
  27. package/browser/lib/dual-component-ctrl.d.ts +25 -25
  28. package/browser/lib/helpers-array-obj.d.ts +15 -15
  29. package/browser/lib/helpers-environment.d.ts +5 -5
  30. package/browser/lib/helpers-numbers.d.ts +3 -3
  31. package/browser/lib/helpers-strings-regexes.d.ts +28 -28
  32. package/browser/lib/helpers-strings.d.ts +50 -50
  33. package/browser/lib/helpers.d.ts +28 -28
  34. package/browser/lib/index.d.ts +9 -9
  35. package/browser/lib/long-press.directive.d.ts +25 -25
  36. package/browser/lib/project.d.ts +91 -91
  37. package/browser/lib/resize-service.d.ts +9 -9
  38. package/browser/public-api.d.ts +1 -1
  39. package/browser/tnp-helpers.d.ts +5 -5
  40. package/client/README.md +24 -24
  41. package/client/esm2020/lib/base-component.mjs +47 -47
  42. package/client/esm2020/lib/base-formly-component.mjs +125 -125
  43. package/client/esm2020/lib/condition-wait.mjs +53 -53
  44. package/client/esm2020/lib/constants.mjs +6 -6
  45. package/client/esm2020/lib/dual-component-ctrl.mjs +120 -120
  46. package/client/esm2020/lib/helpers-array-obj.mjs +80 -80
  47. package/client/esm2020/lib/helpers-environment.mjs +30 -30
  48. package/client/esm2020/lib/helpers-numbers.mjs +5 -5
  49. package/client/esm2020/lib/helpers-strings-regexes.mjs +48 -48
  50. package/client/esm2020/lib/helpers-strings.mjs +257 -257
  51. package/client/esm2020/lib/helpers.mjs +276 -276
  52. package/client/esm2020/lib/index.mjs +14 -14
  53. package/client/esm2020/lib/long-press.directive.mjs +111 -111
  54. package/client/esm2020/lib/project.mjs +413 -413
  55. package/client/esm2020/lib/resize-service.mjs +19 -19
  56. package/client/esm2020/public-api.mjs +1 -1
  57. package/client/esm2020/tnp-helpers.mjs +4 -4
  58. package/client/fesm2015/tnp-helpers.mjs +1535 -1535
  59. package/client/fesm2020/tnp-helpers.mjs +1527 -1527
  60. package/client/lib/base-component.d.ts +17 -17
  61. package/client/lib/base-formly-component.d.ts +31 -31
  62. package/client/lib/condition-wait.d.ts +8 -8
  63. package/client/lib/constants.d.ts +6 -6
  64. package/client/lib/dual-component-ctrl.d.ts +25 -25
  65. package/client/lib/helpers-array-obj.d.ts +15 -15
  66. package/client/lib/helpers-environment.d.ts +5 -5
  67. package/client/lib/helpers-numbers.d.ts +3 -3
  68. package/client/lib/helpers-strings-regexes.d.ts +28 -28
  69. package/client/lib/helpers-strings.d.ts +50 -50
  70. package/client/lib/helpers.d.ts +28 -28
  71. package/client/lib/index.d.ts +9 -9
  72. package/client/lib/long-press.directive.d.ts +25 -25
  73. package/client/lib/project.d.ts +91 -91
  74. package/client/lib/resize-service.d.ts +9 -9
  75. package/client/public-api.d.ts +1 -1
  76. package/client/tnp-helpers.d.ts +5 -5
  77. package/index.d.ts +1 -1
  78. package/index.js +5 -5
  79. package/lib/angular.helper.d.ts +22 -22
  80. package/lib/angular.helper.js +50 -50
  81. package/lib/base-component.d.ts +1 -1
  82. package/lib/base-component.js +6 -6
  83. package/lib/base-formly-component.d.ts +1 -1
  84. package/lib/base-formly-component.js +6 -6
  85. package/lib/condition-wait.d.ts +8 -8
  86. package/lib/condition-wait.js +94 -94
  87. package/lib/constants.d.ts +6 -6
  88. package/lib/constants.js +10 -10
  89. package/lib/dual-component-ctrl.d.ts +1 -1
  90. package/lib/dual-component-ctrl.js +6 -6
  91. package/lib/git-project.d.ts +44 -44
  92. package/lib/git-project.js +195 -195
  93. package/lib/helpers-array-obj.d.ts +15 -15
  94. package/lib/helpers-array-obj.js +88 -88
  95. package/lib/helpers-cli-tool.backend.d.ts +45 -45
  96. package/lib/helpers-cli-tool.backend.js +293 -293
  97. package/lib/helpers-dependencies.backend.d.ts +11 -11
  98. package/lib/helpers-dependencies.backend.js +105 -105
  99. package/lib/helpers-environment.d.ts +5 -5
  100. package/lib/helpers-environment.js +35 -35
  101. package/lib/helpers-file-folders.backend.d.ts +84 -84
  102. package/lib/helpers-file-folders.backend.js +736 -736
  103. package/lib/helpers-git.backend.d.ts +35 -35
  104. package/lib/helpers-git.backend.js +541 -545
  105. package/lib/helpers-git.backend.js.map +1 -1
  106. package/lib/helpers-json5.backend.d.ts +16 -16
  107. package/lib/helpers-json5.backend.js +70 -70
  108. package/lib/helpers-morphi-framework.backend.d.ts +4 -4
  109. package/lib/helpers-morphi-framework.backend.js +49 -49
  110. package/lib/helpers-network.backend.d.ts +8 -8
  111. package/lib/helpers-network.backend.js +48 -48
  112. package/lib/helpers-npm.backend.d.ts +3 -3
  113. package/lib/helpers-npm.backend.js +17 -17
  114. package/lib/helpers-numbers.d.ts +3 -3
  115. package/lib/helpers-numbers.js +11 -11
  116. package/lib/helpers-path.backend.d.ts +7 -7
  117. package/lib/helpers-path.backend.js +36 -36
  118. package/lib/helpers-process.backend.d.ts +57 -57
  119. package/lib/helpers-process.backend.js +529 -529
  120. package/lib/helpers-process.backend.js.map +1 -1
  121. package/lib/helpers-strings-regexes.d.ts +28 -28
  122. package/lib/helpers-strings-regexes.js +60 -60
  123. package/lib/helpers-strings.d.ts +50 -50
  124. package/lib/helpers-strings.js +265 -265
  125. package/lib/helpers-system-terminal.backend.d.ts +5 -5
  126. package/lib/helpers-system-terminal.backend.js +53 -53
  127. package/lib/helpers.d.ts +67 -67
  128. package/lib/helpers.js +391 -391
  129. package/lib/index.d.ts +6 -6
  130. package/lib/index.js +19 -19
  131. package/lib/long-press.directive.d.ts +22 -22
  132. package/lib/long-press.directive.js +141 -141
  133. package/lib/merge-helpers.backend.d.ts +23 -23
  134. package/lib/merge-helpers.backend.js +108 -108
  135. package/lib/project.d.ts +94 -94
  136. package/lib/project.js +422 -422
  137. package/lib/resize-service.d.ts +6 -6
  138. package/lib/resize-service.js +24 -24
  139. package/lib/ts-code/index.d.ts +1 -1
  140. package/lib/ts-code/index.js +7 -7
  141. package/lib/ts-code/ts-code-extractor.d.ts +14 -14
  142. package/lib/ts-code/ts-code-extractor.js +46 -46
  143. package/lib/ts-code/ts-code-modifier.backend.d.ts +12 -12
  144. package/lib/ts-code/ts-code-modifier.backend.js +70 -70
  145. package/package.json +5 -5
  146. package/package.json_devDependencies.json +222 -222
  147. package/package.json_tnp.json5 +41 -41
  148. package/tmp-environment.json +36 -35
  149. package/websql/README.md +24 -24
  150. package/websql/esm2020/lib/base-component.mjs +47 -47
  151. package/websql/esm2020/lib/base-formly-component.mjs +125 -125
  152. package/websql/esm2020/lib/condition-wait.mjs +53 -53
  153. package/websql/esm2020/lib/constants.mjs +6 -6
  154. package/websql/esm2020/lib/dual-component-ctrl.mjs +120 -120
  155. package/websql/esm2020/lib/helpers-array-obj.mjs +80 -80
  156. package/websql/esm2020/lib/helpers-environment.mjs +30 -30
  157. package/websql/esm2020/lib/helpers-numbers.mjs +5 -5
  158. package/websql/esm2020/lib/helpers-strings-regexes.mjs +48 -48
  159. package/websql/esm2020/lib/helpers-strings.mjs +257 -257
  160. package/websql/esm2020/lib/helpers.mjs +276 -276
  161. package/websql/esm2020/lib/index.mjs +14 -14
  162. package/websql/esm2020/lib/long-press.directive.mjs +111 -111
  163. package/websql/esm2020/lib/project.mjs +413 -413
  164. package/websql/esm2020/lib/resize-service.mjs +19 -19
  165. package/websql/esm2020/public-api.mjs +1 -1
  166. package/websql/esm2020/tnp-helpers.mjs +4 -4
  167. package/websql/fesm2015/tnp-helpers.mjs +1535 -1535
  168. package/websql/fesm2020/tnp-helpers.mjs +1527 -1527
  169. package/websql/lib/base-component.d.ts +17 -17
  170. package/websql/lib/base-formly-component.d.ts +31 -31
  171. package/websql/lib/condition-wait.d.ts +8 -8
  172. package/websql/lib/constants.d.ts +6 -6
  173. package/websql/lib/dual-component-ctrl.d.ts +25 -25
  174. package/websql/lib/helpers-array-obj.d.ts +15 -15
  175. package/websql/lib/helpers-environment.d.ts +5 -5
  176. package/websql/lib/helpers-numbers.d.ts +3 -3
  177. package/websql/lib/helpers-strings-regexes.d.ts +28 -28
  178. package/websql/lib/helpers-strings.d.ts +50 -50
  179. package/websql/lib/helpers.d.ts +28 -28
  180. package/websql/lib/index.d.ts +9 -9
  181. package/websql/lib/long-press.directive.d.ts +25 -25
  182. package/websql/lib/project.d.ts +91 -91
  183. package/websql/lib/resize-service.d.ts +9 -9
  184. package/websql/public-api.d.ts +1 -1
  185. package/websql/tnp-helpers.d.ts +5 -5
package/lib/constants.js CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PREFIXES = exports.BaselineSiteJoinprefix = void 0;
4
- exports.BaselineSiteJoinprefix = '__';
5
- exports.PREFIXES = {
6
- BASELINE: exports.BaselineSiteJoinprefix,
7
- DELETED: '____DELETED____',
8
- ORIGINAL: '____ORIGINAL____',
9
- };
10
- //# sourceMappingURL=C:/Users/darek/projects/npm/tnp-helpers/tmp-bundle-release/bundle/project/tnp-helpers/bundle-nocutsrc/lib/constants.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PREFIXES = exports.BaselineSiteJoinprefix = void 0;
4
+ exports.BaselineSiteJoinprefix = '__';
5
+ exports.PREFIXES = {
6
+ BASELINE: exports.BaselineSiteJoinprefix,
7
+ DELETED: '____DELETED____',
8
+ ORIGINAL: '____ORIGINAL____',
9
+ };
10
+ //# sourceMappingURL=/Users/dariusz/projects/npm/tnp-helpers/tmp-bundle-release/bundle/project/tnp-helpers/bundle-nocutsrc/lib/constants.js.map
@@ -1 +1 @@
1
- export declare function dummy1668426219857(): void;
1
+ export declare function dummy1669184709070(): void;
@@ -1,6 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dummy1668426219857 = void 0;
4
- function dummy1668426219857() { }
5
- exports.dummy1668426219857 = dummy1668426219857;
6
- //# sourceMappingURL=C:/Users/darek/projects/npm/tnp-helpers/tmp-bundle-release/bundle/project/tnp-helpers/bundle-nocutsrc/lib/dual-component-ctrl.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dummy1669184709070 = void 0;
4
+ function dummy1669184709070() { }
5
+ exports.dummy1669184709070 = dummy1669184709070;
6
+ //# sourceMappingURL=/Users/dariusz/projects/npm/tnp-helpers/tmp-bundle-release/bundle/project/tnp-helpers/bundle-nocutsrc/lib/dual-component-ctrl.js.map
@@ -1,44 +1,44 @@
1
- import { child_process } from 'tnp-core';
2
- import { Project } from './project';
3
- import { RunOptions, ExecuteOptions } from 'tnp-core';
4
- export declare abstract class ProjectGit {
5
- runCommandGetString(this: Project, command: string): string;
6
- execute(this: Project, command: string, options?: ExecuteOptions & {
7
- showCommand?: boolean;
8
- }): Promise<unknown>;
9
- run(this: Project, command: string, options?: RunOptions): {
10
- sync(): string;
11
- async(detach?: boolean): child_process.ChildProcess;
12
- asyncAsPromise(): any;
13
- unitlOutputContains(stdoutMsg: string | string[], stderMsg?: string | string[]): Promise<any>;
14
- };
15
- get git(this: Project): {
16
- clone(url: string, destinationFolderName?: string): void;
17
- restoreLastVersion(localFilePath: string): void;
18
- resetFiles(...relativePathes: string[]): void;
19
- readonly isGitRepo: boolean;
20
- readonly isGitRoot: boolean;
21
- readonly originURL: string;
22
- updateOrigin(askToRetry?: boolean): Promise<void>;
23
- commit(args?: string): void;
24
- pushCurrentBranch(force?: boolean, origin?: string): void;
25
- readonly thereAreSomeUncommitedChange: boolean;
26
- thereAreSomeUncommitedChangeExcept(filesList?: string[]): boolean;
27
- pullCurrentBranch(askToRetry?: boolean): Promise<void>;
28
- readonly currentBranchName: string;
29
- getBranchesNamesBy(pattern: string | RegExp): string[];
30
- resetHard(): void;
31
- countComits(): number;
32
- lastCommitDate(): Date;
33
- lastCommitHash(): string;
34
- lastCommitMessage(): string;
35
- penultimageCommitHash(): string;
36
- checkTagExists(tag: string): boolean;
37
- lastTagHash(): string;
38
- readonly lastTagVersionName: string;
39
- /**
40
- * TODO does this make any sense
41
- */
42
- renameOrigin(newNameOrUlr: string): void;
43
- };
44
- }
1
+ import { child_process } from 'tnp-core';
2
+ import { Project } from './project';
3
+ import { RunOptions, ExecuteOptions } from 'tnp-core';
4
+ export declare abstract class ProjectGit {
5
+ runCommandGetString(this: Project, command: string): string;
6
+ execute(this: Project, command: string, options?: ExecuteOptions & {
7
+ showCommand?: boolean;
8
+ }): Promise<unknown>;
9
+ run(this: Project, command: string, options?: RunOptions): {
10
+ sync(): string;
11
+ async(detach?: boolean): child_process.ChildProcess;
12
+ asyncAsPromise(): any;
13
+ unitlOutputContains(stdoutMsg: string | string[], stderMsg?: string | string[]): Promise<any>;
14
+ };
15
+ get git(this: Project): {
16
+ clone(url: string, destinationFolderName?: string): void;
17
+ restoreLastVersion(localFilePath: string): void;
18
+ resetFiles(...relativePathes: string[]): void;
19
+ readonly isGitRepo: boolean;
20
+ readonly isGitRoot: boolean;
21
+ readonly originURL: string;
22
+ updateOrigin(askToRetry?: boolean): Promise<void>;
23
+ commit(args?: string): void;
24
+ pushCurrentBranch(force?: boolean, origin?: string): void;
25
+ readonly thereAreSomeUncommitedChange: boolean;
26
+ thereAreSomeUncommitedChangeExcept(filesList?: string[]): boolean;
27
+ pullCurrentBranch(askToRetry?: boolean): Promise<void>;
28
+ readonly currentBranchName: string;
29
+ getBranchesNamesBy(pattern: string | RegExp): string[];
30
+ resetHard(): void;
31
+ countComits(): number;
32
+ lastCommitDate(): Date;
33
+ lastCommitHash(): string;
34
+ lastCommitMessage(): string;
35
+ penultimageCommitHash(): string;
36
+ checkTagExists(tag: string): boolean;
37
+ lastTagHash(): string;
38
+ readonly lastTagVersionName: string;
39
+ /**
40
+ * TODO does this make any sense
41
+ */
42
+ renameOrigin(newNameOrUlr: string): void;
43
+ };
44
+ }
@@ -1,195 +1,195 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProjectGit = void 0;
4
- var tslib_1 = require("tslib");
5
- var tnp_core_1 = require("tnp-core");
6
- var project_1 = require("./project");
7
- var helpers_1 = require("./helpers");
8
- //#region @backend
9
- var tnp_cli_1 = require("tnp-cli");
10
- //#endregion
11
- var Helpers = helpers_1.HelpersTnp.Instance;
12
- var ProjectGit = /** @class */ (function () {
13
- function ProjectGit() {
14
- }
15
- //#region @backend
16
- ProjectGit.prototype.runCommandGetString = function (command) {
17
- return Helpers.commnadOutputAsString(command, this.location, false);
18
- };
19
- ProjectGit.prototype.execute = function (command, options) {
20
- return tslib_1.__awaiter(this, void 0, void 0, function () {
21
- var cwd;
22
- return tslib_1.__generator(this, function (_a) {
23
- switch (_a.label) {
24
- case 0:
25
- if (tnp_core_1._.isUndefined(options.showCommand)) {
26
- options.showCommand = false;
27
- }
28
- if (!options) {
29
- options = {};
30
- }
31
- cwd = this.location;
32
- if (options.showCommand) {
33
- Helpers.info("[".concat(tnp_cli_1.CLI.chalk.underline('Executing shell command'), "] \"").concat(command, "\" in [").concat(cwd, "]"));
34
- }
35
- else {
36
- Helpers.log("[".concat(tnp_cli_1.CLI.chalk.underline('Executing shell command'), "] \"").concat(command, "\" in [").concat(cwd, "]"));
37
- }
38
- return [4 /*yield*/, Helpers.execute(tnp_core_1.child_process.exec(command, { cwd: cwd }), options)];
39
- case 1: return [2 /*return*/, _a.sent()];
40
- }
41
- });
42
- });
43
- };
44
- ProjectGit.prototype.run = function (command, options) {
45
- Helpers.log("command: ".concat(command));
46
- if (!options) {
47
- options = {};
48
- }
49
- if (tnp_core_1._.isUndefined(options.showCommand)) {
50
- options.showCommand = false;
51
- }
52
- if (!options.cwd) {
53
- options.cwd = this.location;
54
- }
55
- if (options.showCommand) {
56
- Helpers.info("[".concat(tnp_cli_1.CLI.chalk.underline('Executing shell command'), "] \"").concat(command, "\" in [").concat(options.cwd, "]"));
57
- }
58
- else {
59
- Helpers.log("[".concat(tnp_cli_1.CLI.chalk.underline('Executing shell command'), "] \"").concat(command, "\" in [").concat(options.cwd, "]"));
60
- }
61
- return Helpers.run(command, options);
62
- };
63
- Object.defineProperty(ProjectGit.prototype, "git", {
64
- //#endregion
65
- //#region @backend
66
- // @ts-ignore
67
- get: function () {
68
- var self = this;
69
- return {
70
- clone: function (url, destinationFolderName) {
71
- if (destinationFolderName === void 0) { destinationFolderName = ''; }
72
- return Helpers.git.clone({ cwd: self.location, url: url, destinationFolderName: destinationFolderName });
73
- },
74
- restoreLastVersion: function (localFilePath) {
75
- return Helpers.git.restoreLastVersion(self.location, localFilePath);
76
- },
77
- resetFiles: function () {
78
- var _a;
79
- var relativePathes = [];
80
- for (var _i = 0; _i < arguments.length; _i++) {
81
- relativePathes[_i] = arguments[_i];
82
- }
83
- return (_a = Helpers.git).resetFiles.apply(_a, tslib_1.__spreadArray([self.location], tslib_1.__read(relativePathes), false));
84
- },
85
- get isGitRepo() {
86
- return Helpers.git.isGitRepo(self.location);
87
- },
88
- get isGitRoot() {
89
- return Helpers.git.isGitRoot(self.location);
90
- },
91
- get originURL() {
92
- return Helpers.git.getOriginURL(self.location);
93
- },
94
- updateOrigin: function (askToRetry) {
95
- if (askToRetry === void 0) { askToRetry = false; }
96
- return tslib_1.__awaiter(this, void 0, void 0, function () {
97
- return tslib_1.__generator(this, function (_a) {
98
- switch (_a.label) {
99
- case 0: return [4 /*yield*/, Helpers.git.pullCurrentBranch(self.location, askToRetry)];
100
- case 1:
101
- _a.sent();
102
- return [2 /*return*/];
103
- }
104
- });
105
- });
106
- },
107
- commit: function (args) {
108
- return Helpers.git.commit(self.location, project_1.Project, args);
109
- },
110
- pushCurrentBranch: function (force, origin) {
111
- if (force === void 0) { force = false; }
112
- if (origin === void 0) { origin = 'origin'; }
113
- return Helpers.git.pushCurrentBranch(self.location, force, origin);
114
- },
115
- get thereAreSomeUncommitedChange() {
116
- return Helpers.git.checkIfthereAreSomeUncommitedChange(self.location);
117
- },
118
- thereAreSomeUncommitedChangeExcept: function (filesList) {
119
- if (filesList === void 0) { filesList = []; }
120
- return Helpers.git.thereAreSomeUncommitedChangeExcept(filesList, self.location);
121
- },
122
- pullCurrentBranch: function (askToRetry) {
123
- if (askToRetry === void 0) { askToRetry = false; }
124
- return Helpers.git.pullCurrentBranch(self.location, askToRetry);
125
- },
126
- get currentBranchName() {
127
- return Helpers.git.currentBranchName(self.location);
128
- },
129
- getBranchesNamesBy: function (pattern) {
130
- return Helpers.git.getBranchesNames(self.location, pattern);
131
- },
132
- resetHard: function () {
133
- self.run("git reset --hard").sync();
134
- },
135
- countComits: function () {
136
- // console.log('COUNT')
137
- return Helpers.git.countCommits(self.location);
138
- },
139
- lastCommitDate: function () {
140
- // console.log('LATS CMD ADDET')
141
- return Helpers.git.lastCommitDate(self.location);
142
- },
143
- lastCommitHash: function () {
144
- // console.log('LAST HASH')
145
- return Helpers.git.lastCommitHash(self.location);
146
- },
147
- lastCommitMessage: function () {
148
- return Helpers.git.lastCommitMessage(self.location);
149
- },
150
- penultimageCommitHash: function () {
151
- return Helpers.git.penultimageCommitHash(self.location);
152
- },
153
- checkTagExists: function (tag) {
154
- return Helpers.git.checkTagExists(tag, self.location);
155
- },
156
- lastTagHash: function () {
157
- return Helpers.git.lastTagHash(self.location);
158
- },
159
- get lastTagVersionName() {
160
- return (Helpers.git.lastTagVersionName(self.location) || '');
161
- },
162
- /**
163
- * TODO does this make any sense
164
- */
165
- renameOrigin: function (newNameOrUlr) {
166
- if (!newNameOrUlr.endsWith('.git')) {
167
- newNameOrUlr = (newNameOrUlr + '.git');
168
- }
169
- var oldOrigin = self.git.originURL;
170
- if (!newNameOrUlr.startsWith('git@') && !newNameOrUlr.startsWith('https://')) {
171
- newNameOrUlr = oldOrigin.replace(tnp_core_1.path.basename(oldOrigin), newNameOrUlr);
172
- }
173
- try {
174
- self.run("git remote rm origin").sync();
175
- }
176
- catch (error) { }
177
- try {
178
- self.run("git remote add origin ".concat(newNameOrUlr)).sync();
179
- Helpers.info("Origin changed:\n from: ".concat(oldOrigin, "\n to: ").concat(newNameOrUlr, "\n"));
180
- }
181
- catch (e) {
182
- Helpers.error("Not able to change origin.. reverting to old", true, true);
183
- self.run("git remote add origin ".concat(oldOrigin)).sync();
184
- }
185
- },
186
- };
187
- },
188
- enumerable: false,
189
- configurable: true
190
- });
191
- return ProjectGit;
192
- }());
193
- exports.ProjectGit = ProjectGit;
194
- // export interface ProjectGit extends Partial<Project> { }
195
- //# sourceMappingURL=C:/Users/darek/projects/npm/tnp-helpers/tmp-bundle-release/bundle/project/tnp-helpers/bundle-nocutsrc/lib/git-project.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProjectGit = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var tnp_core_1 = require("tnp-core");
6
+ var project_1 = require("./project");
7
+ var helpers_1 = require("./helpers");
8
+ //#region @backend
9
+ var tnp_cli_1 = require("tnp-cli");
10
+ //#endregion
11
+ var Helpers = helpers_1.HelpersTnp.Instance;
12
+ var ProjectGit = /** @class */ (function () {
13
+ function ProjectGit() {
14
+ }
15
+ //#region @backend
16
+ ProjectGit.prototype.runCommandGetString = function (command) {
17
+ return Helpers.commnadOutputAsString(command, this.location, false);
18
+ };
19
+ ProjectGit.prototype.execute = function (command, options) {
20
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
21
+ var cwd;
22
+ return tslib_1.__generator(this, function (_a) {
23
+ switch (_a.label) {
24
+ case 0:
25
+ if (tnp_core_1._.isUndefined(options.showCommand)) {
26
+ options.showCommand = false;
27
+ }
28
+ if (!options) {
29
+ options = {};
30
+ }
31
+ cwd = this.location;
32
+ if (options.showCommand) {
33
+ Helpers.info("[".concat(tnp_cli_1.CLI.chalk.underline('Executing shell command'), "] \"").concat(command, "\" in [").concat(cwd, "]"));
34
+ }
35
+ else {
36
+ Helpers.log("[".concat(tnp_cli_1.CLI.chalk.underline('Executing shell command'), "] \"").concat(command, "\" in [").concat(cwd, "]"));
37
+ }
38
+ return [4 /*yield*/, Helpers.execute(tnp_core_1.child_process.exec(command, { cwd: cwd }), options)];
39
+ case 1: return [2 /*return*/, _a.sent()];
40
+ }
41
+ });
42
+ });
43
+ };
44
+ ProjectGit.prototype.run = function (command, options) {
45
+ Helpers.log("command: ".concat(command));
46
+ if (!options) {
47
+ options = {};
48
+ }
49
+ if (tnp_core_1._.isUndefined(options.showCommand)) {
50
+ options.showCommand = false;
51
+ }
52
+ if (!options.cwd) {
53
+ options.cwd = this.location;
54
+ }
55
+ if (options.showCommand) {
56
+ Helpers.info("[".concat(tnp_cli_1.CLI.chalk.underline('Executing shell command'), "] \"").concat(command, "\" in [").concat(options.cwd, "]"));
57
+ }
58
+ else {
59
+ Helpers.log("[".concat(tnp_cli_1.CLI.chalk.underline('Executing shell command'), "] \"").concat(command, "\" in [").concat(options.cwd, "]"));
60
+ }
61
+ return Helpers.run(command, options);
62
+ };
63
+ Object.defineProperty(ProjectGit.prototype, "git", {
64
+ //#endregion
65
+ //#region @backend
66
+ // @ts-ignore
67
+ get: function () {
68
+ var self = this;
69
+ return {
70
+ clone: function (url, destinationFolderName) {
71
+ if (destinationFolderName === void 0) { destinationFolderName = ''; }
72
+ return Helpers.git.clone({ cwd: self.location, url: url, destinationFolderName: destinationFolderName });
73
+ },
74
+ restoreLastVersion: function (localFilePath) {
75
+ return Helpers.git.restoreLastVersion(self.location, localFilePath);
76
+ },
77
+ resetFiles: function () {
78
+ var _a;
79
+ var relativePathes = [];
80
+ for (var _i = 0; _i < arguments.length; _i++) {
81
+ relativePathes[_i] = arguments[_i];
82
+ }
83
+ return (_a = Helpers.git).resetFiles.apply(_a, tslib_1.__spreadArray([self.location], tslib_1.__read(relativePathes), false));
84
+ },
85
+ get isGitRepo() {
86
+ return Helpers.git.isGitRepo(self.location);
87
+ },
88
+ get isGitRoot() {
89
+ return Helpers.git.isGitRoot(self.location);
90
+ },
91
+ get originURL() {
92
+ return Helpers.git.getOriginURL(self.location);
93
+ },
94
+ updateOrigin: function (askToRetry) {
95
+ if (askToRetry === void 0) { askToRetry = false; }
96
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
97
+ return tslib_1.__generator(this, function (_a) {
98
+ switch (_a.label) {
99
+ case 0: return [4 /*yield*/, Helpers.git.pullCurrentBranch(self.location, askToRetry)];
100
+ case 1:
101
+ _a.sent();
102
+ return [2 /*return*/];
103
+ }
104
+ });
105
+ });
106
+ },
107
+ commit: function (args) {
108
+ return Helpers.git.commit(self.location, project_1.Project, args);
109
+ },
110
+ pushCurrentBranch: function (force, origin) {
111
+ if (force === void 0) { force = false; }
112
+ if (origin === void 0) { origin = 'origin'; }
113
+ return Helpers.git.pushCurrentBranch(self.location, force, origin);
114
+ },
115
+ get thereAreSomeUncommitedChange() {
116
+ return Helpers.git.checkIfthereAreSomeUncommitedChange(self.location);
117
+ },
118
+ thereAreSomeUncommitedChangeExcept: function (filesList) {
119
+ if (filesList === void 0) { filesList = []; }
120
+ return Helpers.git.thereAreSomeUncommitedChangeExcept(filesList, self.location);
121
+ },
122
+ pullCurrentBranch: function (askToRetry) {
123
+ if (askToRetry === void 0) { askToRetry = false; }
124
+ return Helpers.git.pullCurrentBranch(self.location, askToRetry);
125
+ },
126
+ get currentBranchName() {
127
+ return Helpers.git.currentBranchName(self.location);
128
+ },
129
+ getBranchesNamesBy: function (pattern) {
130
+ return Helpers.git.getBranchesNames(self.location, pattern);
131
+ },
132
+ resetHard: function () {
133
+ self.run("git reset --hard").sync();
134
+ },
135
+ countComits: function () {
136
+ // console.log('COUNT')
137
+ return Helpers.git.countCommits(self.location);
138
+ },
139
+ lastCommitDate: function () {
140
+ // console.log('LATS CMD ADDET')
141
+ return Helpers.git.lastCommitDate(self.location);
142
+ },
143
+ lastCommitHash: function () {
144
+ // console.log('LAST HASH')
145
+ return Helpers.git.lastCommitHash(self.location);
146
+ },
147
+ lastCommitMessage: function () {
148
+ return Helpers.git.lastCommitMessage(self.location);
149
+ },
150
+ penultimageCommitHash: function () {
151
+ return Helpers.git.penultimageCommitHash(self.location);
152
+ },
153
+ checkTagExists: function (tag) {
154
+ return Helpers.git.checkTagExists(tag, self.location);
155
+ },
156
+ lastTagHash: function () {
157
+ return Helpers.git.lastTagHash(self.location);
158
+ },
159
+ get lastTagVersionName() {
160
+ return (Helpers.git.lastTagVersionName(self.location) || '');
161
+ },
162
+ /**
163
+ * TODO does this make any sense
164
+ */
165
+ renameOrigin: function (newNameOrUlr) {
166
+ if (!newNameOrUlr.endsWith('.git')) {
167
+ newNameOrUlr = (newNameOrUlr + '.git');
168
+ }
169
+ var oldOrigin = self.git.originURL;
170
+ if (!newNameOrUlr.startsWith('git@') && !newNameOrUlr.startsWith('https://')) {
171
+ newNameOrUlr = oldOrigin.replace(tnp_core_1.path.basename(oldOrigin), newNameOrUlr);
172
+ }
173
+ try {
174
+ self.run("git remote rm origin").sync();
175
+ }
176
+ catch (error) { }
177
+ try {
178
+ self.run("git remote add origin ".concat(newNameOrUlr)).sync();
179
+ Helpers.info("Origin changed:\n from: ".concat(oldOrigin, "\n to: ").concat(newNameOrUlr, "\n"));
180
+ }
181
+ catch (e) {
182
+ Helpers.error("Not able to change origin.. reverting to old", true, true);
183
+ self.run("git remote add origin ".concat(oldOrigin)).sync();
184
+ }
185
+ },
186
+ };
187
+ },
188
+ enumerable: false,
189
+ configurable: true
190
+ });
191
+ return ProjectGit;
192
+ }());
193
+ exports.ProjectGit = ProjectGit;
194
+ // export interface ProjectGit extends Partial<Project> { }
195
+ //# sourceMappingURL=/Users/dariusz/projects/npm/tnp-helpers/tmp-bundle-release/bundle/project/tnp-helpers/bundle-nocutsrc/lib/git-project.js.map
@@ -1,15 +1,15 @@
1
- export declare class HelpersArrayObj {
2
- from(s: string | string[]): string[];
3
- second(arr: any): any;
4
- arrayMoveElementBefore<T = any>(arr: any[], a: any, b: any, prop?: keyof T): any[];
5
- arrayMoveElementAfterB<T = any>(arr: any[], a: any, b: any, prop?: keyof T): any[];
6
- uniqArray<T = any>(array: any[], uniqueProperty?: (keyof T)): T[];
7
- sortKeys(obj: any): any;
8
- /**
9
- * Fuzzy search
10
- */
11
- fuzzy<T = any>(query: string, list: T[], valueFn?: (modelFromList: T) => string): {
12
- matches: string[];
13
- results: T[];
14
- };
15
- }
1
+ export declare class HelpersArrayObj {
2
+ from(s: string | string[]): string[];
3
+ second(arr: any): any;
4
+ arrayMoveElementBefore<T = any>(arr: any[], a: any, b: any, prop?: keyof T): any[];
5
+ arrayMoveElementAfterB<T = any>(arr: any[], a: any, b: any, prop?: keyof T): any[];
6
+ uniqArray<T = any>(array: any[], uniqueProperty?: (keyof T)): T[];
7
+ sortKeys(obj: any): any;
8
+ /**
9
+ * Fuzzy search
10
+ */
11
+ fuzzy<T = any>(query: string, list: T[], valueFn?: (modelFromList: T) => string): {
12
+ matches: string[];
13
+ results: T[];
14
+ };
15
+ }