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.
- package/app.d.ts +1 -1
- package/app.js +6 -6
- package/browser/README.md +24 -24
- package/browser/esm2020/lib/base-component.mjs +47 -47
- package/browser/esm2020/lib/base-formly-component.mjs +125 -125
- package/browser/esm2020/lib/condition-wait.mjs +53 -53
- package/browser/esm2020/lib/constants.mjs +6 -6
- package/browser/esm2020/lib/dual-component-ctrl.mjs +120 -120
- package/browser/esm2020/lib/helpers-array-obj.mjs +80 -80
- package/browser/esm2020/lib/helpers-environment.mjs +30 -30
- package/browser/esm2020/lib/helpers-numbers.mjs +5 -5
- package/browser/esm2020/lib/helpers-strings-regexes.mjs +48 -48
- package/browser/esm2020/lib/helpers-strings.mjs +257 -257
- package/browser/esm2020/lib/helpers.mjs +276 -276
- package/browser/esm2020/lib/index.mjs +14 -14
- package/browser/esm2020/lib/long-press.directive.mjs +111 -111
- package/browser/esm2020/lib/project.mjs +413 -413
- package/browser/esm2020/lib/resize-service.mjs +19 -19
- package/browser/esm2020/public-api.mjs +1 -1
- package/browser/esm2020/tnp-helpers.mjs +4 -4
- package/browser/fesm2015/tnp-helpers.mjs +1535 -1535
- package/browser/fesm2020/tnp-helpers.mjs +1527 -1527
- package/browser/lib/base-component.d.ts +17 -17
- package/browser/lib/base-formly-component.d.ts +31 -31
- package/browser/lib/condition-wait.d.ts +8 -8
- package/browser/lib/constants.d.ts +6 -6
- package/browser/lib/dual-component-ctrl.d.ts +25 -25
- package/browser/lib/helpers-array-obj.d.ts +15 -15
- package/browser/lib/helpers-environment.d.ts +5 -5
- package/browser/lib/helpers-numbers.d.ts +3 -3
- package/browser/lib/helpers-strings-regexes.d.ts +28 -28
- package/browser/lib/helpers-strings.d.ts +50 -50
- package/browser/lib/helpers.d.ts +28 -28
- package/browser/lib/index.d.ts +9 -9
- package/browser/lib/long-press.directive.d.ts +25 -25
- package/browser/lib/project.d.ts +91 -91
- package/browser/lib/resize-service.d.ts +9 -9
- package/browser/public-api.d.ts +1 -1
- package/browser/tnp-helpers.d.ts +5 -5
- package/client/README.md +24 -24
- package/client/esm2020/lib/base-component.mjs +47 -47
- package/client/esm2020/lib/base-formly-component.mjs +125 -125
- package/client/esm2020/lib/condition-wait.mjs +53 -53
- package/client/esm2020/lib/constants.mjs +6 -6
- package/client/esm2020/lib/dual-component-ctrl.mjs +120 -120
- package/client/esm2020/lib/helpers-array-obj.mjs +80 -80
- package/client/esm2020/lib/helpers-environment.mjs +30 -30
- package/client/esm2020/lib/helpers-numbers.mjs +5 -5
- package/client/esm2020/lib/helpers-strings-regexes.mjs +48 -48
- package/client/esm2020/lib/helpers-strings.mjs +257 -257
- package/client/esm2020/lib/helpers.mjs +276 -276
- package/client/esm2020/lib/index.mjs +14 -14
- package/client/esm2020/lib/long-press.directive.mjs +111 -111
- package/client/esm2020/lib/project.mjs +413 -413
- package/client/esm2020/lib/resize-service.mjs +19 -19
- package/client/esm2020/public-api.mjs +1 -1
- package/client/esm2020/tnp-helpers.mjs +4 -4
- package/client/fesm2015/tnp-helpers.mjs +1535 -1535
- package/client/fesm2020/tnp-helpers.mjs +1527 -1527
- package/client/lib/base-component.d.ts +17 -17
- package/client/lib/base-formly-component.d.ts +31 -31
- package/client/lib/condition-wait.d.ts +8 -8
- package/client/lib/constants.d.ts +6 -6
- package/client/lib/dual-component-ctrl.d.ts +25 -25
- package/client/lib/helpers-array-obj.d.ts +15 -15
- package/client/lib/helpers-environment.d.ts +5 -5
- package/client/lib/helpers-numbers.d.ts +3 -3
- package/client/lib/helpers-strings-regexes.d.ts +28 -28
- package/client/lib/helpers-strings.d.ts +50 -50
- package/client/lib/helpers.d.ts +28 -28
- package/client/lib/index.d.ts +9 -9
- package/client/lib/long-press.directive.d.ts +25 -25
- package/client/lib/project.d.ts +91 -91
- package/client/lib/resize-service.d.ts +9 -9
- package/client/public-api.d.ts +1 -1
- package/client/tnp-helpers.d.ts +5 -5
- package/index.d.ts +1 -1
- package/index.js +5 -5
- package/lib/angular.helper.d.ts +22 -22
- package/lib/angular.helper.js +50 -50
- package/lib/base-component.d.ts +1 -1
- package/lib/base-component.js +6 -6
- package/lib/base-formly-component.d.ts +1 -1
- package/lib/base-formly-component.js +6 -6
- package/lib/condition-wait.d.ts +8 -8
- package/lib/condition-wait.js +94 -94
- package/lib/constants.d.ts +6 -6
- package/lib/constants.js +10 -10
- package/lib/dual-component-ctrl.d.ts +1 -1
- package/lib/dual-component-ctrl.js +6 -6
- package/lib/git-project.d.ts +44 -44
- package/lib/git-project.js +195 -195
- package/lib/helpers-array-obj.d.ts +15 -15
- package/lib/helpers-array-obj.js +88 -88
- package/lib/helpers-cli-tool.backend.d.ts +45 -45
- package/lib/helpers-cli-tool.backend.js +293 -293
- package/lib/helpers-dependencies.backend.d.ts +11 -11
- package/lib/helpers-dependencies.backend.js +105 -105
- package/lib/helpers-environment.d.ts +5 -5
- package/lib/helpers-environment.js +35 -35
- package/lib/helpers-file-folders.backend.d.ts +84 -84
- package/lib/helpers-file-folders.backend.js +736 -736
- package/lib/helpers-git.backend.d.ts +35 -35
- package/lib/helpers-git.backend.js +541 -545
- package/lib/helpers-git.backend.js.map +1 -1
- package/lib/helpers-json5.backend.d.ts +16 -16
- package/lib/helpers-json5.backend.js +70 -70
- package/lib/helpers-morphi-framework.backend.d.ts +4 -4
- package/lib/helpers-morphi-framework.backend.js +49 -49
- package/lib/helpers-network.backend.d.ts +8 -8
- package/lib/helpers-network.backend.js +48 -48
- package/lib/helpers-npm.backend.d.ts +3 -3
- package/lib/helpers-npm.backend.js +17 -17
- package/lib/helpers-numbers.d.ts +3 -3
- package/lib/helpers-numbers.js +11 -11
- package/lib/helpers-path.backend.d.ts +7 -7
- package/lib/helpers-path.backend.js +36 -36
- package/lib/helpers-process.backend.d.ts +57 -57
- package/lib/helpers-process.backend.js +529 -529
- package/lib/helpers-process.backend.js.map +1 -1
- package/lib/helpers-strings-regexes.d.ts +28 -28
- package/lib/helpers-strings-regexes.js +60 -60
- package/lib/helpers-strings.d.ts +50 -50
- package/lib/helpers-strings.js +265 -265
- package/lib/helpers-system-terminal.backend.d.ts +5 -5
- package/lib/helpers-system-terminal.backend.js +53 -53
- package/lib/helpers.d.ts +67 -67
- package/lib/helpers.js +391 -391
- package/lib/index.d.ts +6 -6
- package/lib/index.js +19 -19
- package/lib/long-press.directive.d.ts +22 -22
- package/lib/long-press.directive.js +141 -141
- package/lib/merge-helpers.backend.d.ts +23 -23
- package/lib/merge-helpers.backend.js +108 -108
- package/lib/project.d.ts +94 -94
- package/lib/project.js +422 -422
- package/lib/resize-service.d.ts +6 -6
- package/lib/resize-service.js +24 -24
- package/lib/ts-code/index.d.ts +1 -1
- package/lib/ts-code/index.js +7 -7
- package/lib/ts-code/ts-code-extractor.d.ts +14 -14
- package/lib/ts-code/ts-code-extractor.js +46 -46
- package/lib/ts-code/ts-code-modifier.backend.d.ts +12 -12
- package/lib/ts-code/ts-code-modifier.backend.js +70 -70
- package/package.json +5 -5
- package/package.json_devDependencies.json +222 -222
- package/package.json_tnp.json5 +41 -41
- package/tmp-environment.json +36 -35
- package/websql/README.md +24 -24
- package/websql/esm2020/lib/base-component.mjs +47 -47
- package/websql/esm2020/lib/base-formly-component.mjs +125 -125
- package/websql/esm2020/lib/condition-wait.mjs +53 -53
- package/websql/esm2020/lib/constants.mjs +6 -6
- package/websql/esm2020/lib/dual-component-ctrl.mjs +120 -120
- package/websql/esm2020/lib/helpers-array-obj.mjs +80 -80
- package/websql/esm2020/lib/helpers-environment.mjs +30 -30
- package/websql/esm2020/lib/helpers-numbers.mjs +5 -5
- package/websql/esm2020/lib/helpers-strings-regexes.mjs +48 -48
- package/websql/esm2020/lib/helpers-strings.mjs +257 -257
- package/websql/esm2020/lib/helpers.mjs +276 -276
- package/websql/esm2020/lib/index.mjs +14 -14
- package/websql/esm2020/lib/long-press.directive.mjs +111 -111
- package/websql/esm2020/lib/project.mjs +413 -413
- package/websql/esm2020/lib/resize-service.mjs +19 -19
- package/websql/esm2020/public-api.mjs +1 -1
- package/websql/esm2020/tnp-helpers.mjs +4 -4
- package/websql/fesm2015/tnp-helpers.mjs +1535 -1535
- package/websql/fesm2020/tnp-helpers.mjs +1527 -1527
- package/websql/lib/base-component.d.ts +17 -17
- package/websql/lib/base-formly-component.d.ts +31 -31
- package/websql/lib/condition-wait.d.ts +8 -8
- package/websql/lib/constants.d.ts +6 -6
- package/websql/lib/dual-component-ctrl.d.ts +25 -25
- package/websql/lib/helpers-array-obj.d.ts +15 -15
- package/websql/lib/helpers-environment.d.ts +5 -5
- package/websql/lib/helpers-numbers.d.ts +3 -3
- package/websql/lib/helpers-strings-regexes.d.ts +28 -28
- package/websql/lib/helpers-strings.d.ts +50 -50
- package/websql/lib/helpers.d.ts +28 -28
- package/websql/lib/index.d.ts +9 -9
- package/websql/lib/long-press.directive.d.ts +25 -25
- package/websql/lib/project.d.ts +91 -91
- package/websql/lib/resize-service.d.ts +9 -9
- package/websql/public-api.d.ts +1 -1
- 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
|
|
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
|
|
1
|
+
export declare function dummy1669184709070(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
5
|
-
exports.
|
|
6
|
-
//# sourceMappingURL
|
|
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
|
package/lib/git-project.d.ts
CHANGED
|
@@ -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
|
+
}
|
package/lib/git-project.js
CHANGED
|
@@ -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
|
|
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
|
+
}
|