tnp-helpers 13.1.7 → 13.1.9
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.js +3 -3
- package/browser/esm2020/lib/firedev-models.mjs +4 -0
- package/browser/esm2020/lib/helpers.mjs +2 -1
- package/browser/esm2020/lib/index.mjs +2 -1
- package/browser/esm2020/lib/long-press.directive.mjs +2 -2
- package/browser/fesm2015/tnp-helpers.mjs +5 -1
- package/browser/fesm2020/tnp-helpers.mjs +5 -1
- package/browser/lib/firedev-models.d.ts +14 -0
- package/browser/lib/index.d.ts +1 -0
- package/client/esm2020/lib/firedev-models.mjs +4 -0
- package/client/esm2020/lib/helpers.mjs +2 -1
- package/client/esm2020/lib/index.mjs +2 -1
- package/client/esm2020/lib/long-press.directive.mjs +2 -2
- package/client/fesm2015/tnp-helpers.mjs +5 -1
- package/client/fesm2020/tnp-helpers.mjs +5 -1
- package/client/lib/firedev-models.d.ts +14 -0
- package/client/lib/index.d.ts +1 -0
- package/lib/base-component.js +3 -3
- package/lib/base-formly-component.js +3 -3
- package/lib/dual-component-ctrl.js +3 -3
- package/lib/firedev-models.d.ts +13 -0
- package/lib/firedev-models.js +3 -0
- package/lib/git-project.d.ts +1 -0
- package/lib/git-project.js +3 -0
- package/lib/helpers-file-folders.backend.js +15 -13
- package/lib/helpers-git.backend.d.ts +7 -0
- package/lib/helpers-git.backend.js +76 -49
- package/lib/helpers-process.backend.js +1 -1
- package/lib/helpers-vscode.backend.d.ts +5 -0
- package/lib/helpers-vscode.backend.js +21 -0
- package/lib/helpers.d.ts +2 -0
- package/lib/helpers.js +5 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/long-press.directive.js +1 -1
- package/lib/merge-helpers.backend.js +1 -1
- package/lib/project.js +9 -9
- package/package.json +5 -5
- package/tmp-environment.json +162 -160
- package/websql/esm2020/lib/firedev-models.mjs +4 -0
- package/websql/esm2020/lib/helpers.mjs +2 -1
- package/websql/esm2020/lib/index.mjs +2 -1
- package/websql/esm2020/lib/long-press.directive.mjs +2 -2
- package/websql/fesm2015/tnp-helpers.mjs +5 -1
- package/websql/fesm2020/tnp-helpers.mjs +5 -1
- package/websql/lib/firedev-models.d.ts +14 -0
- package/websql/lib/index.d.ts +1 -0
- package/app.js.map +0 -1
- package/browser/fesm2015/tnp-helpers.mjs.map +0 -1
- package/browser/fesm2020/tnp-helpers.mjs.map +0 -1
- package/client/fesm2015/tnp-helpers.mjs.map +0 -1
- package/client/fesm2020/tnp-helpers.mjs.map +0 -1
- package/index.js.map +0 -1
- package/lib/angular.helper.js.map +0 -1
- package/lib/base-component.js.map +0 -1
- package/lib/base-formly-component.js.map +0 -1
- package/lib/condition-wait.js.map +0 -1
- package/lib/constants.js.map +0 -1
- package/lib/dual-component-ctrl.js.map +0 -1
- package/lib/git-project.js.map +0 -1
- package/lib/helpers-array-obj.js.map +0 -1
- package/lib/helpers-cli-tool.backend.js.map +0 -1
- package/lib/helpers-dependencies.backend.js.map +0 -1
- package/lib/helpers-environment.js.map +0 -1
- package/lib/helpers-file-folders.backend.js.map +0 -1
- package/lib/helpers-git.backend.js.map +0 -1
- package/lib/helpers-json5.backend.js.map +0 -1
- package/lib/helpers-morphi-framework.backend.js.map +0 -1
- package/lib/helpers-network.backend.js.map +0 -1
- package/lib/helpers-npm.backend.js.map +0 -1
- package/lib/helpers-numbers.js.map +0 -1
- package/lib/helpers-path.backend.js.map +0 -1
- package/lib/helpers-process.backend.js.map +0 -1
- package/lib/helpers-strings-regexes.js.map +0 -1
- package/lib/helpers-strings.js.map +0 -1
- package/lib/helpers-system-terminal.backend.js.map +0 -1
- package/lib/helpers.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/long-press.directive.js.map +0 -1
- package/lib/merge-helpers.backend.js.map +0 -1
- package/lib/project.js.map +0 -1
- package/lib/resize-service.js.map +0 -1
- package/lib/ts-code/index.js.map +0 -1
- package/lib/ts-code/ts-code-extractor.js.map +0 -1
- package/lib/ts-code/ts-code-modifier.backend.js.map +0 -1
- package/websql/fesm2015/tnp-helpers.mjs.map +0 -1
- package/websql/fesm2020/tnp-helpers.mjs.map +0 -1
|
@@ -8,7 +8,6 @@ var glob = require("glob");
|
|
|
8
8
|
var crypto = require("crypto");
|
|
9
9
|
var index_1 = require("./index");
|
|
10
10
|
var tnp_config_1 = require("tnp-config");
|
|
11
|
-
var trace = !global.hideLog;
|
|
12
11
|
var HelpersFileFolders = /** @class */ (function () {
|
|
13
12
|
function HelpersFileFolders() {
|
|
14
13
|
}
|
|
@@ -201,7 +200,7 @@ var HelpersFileFolders = /** @class */ (function () {
|
|
|
201
200
|
destination = (0, tnp_core_1.crossPlatformPath)(destination);
|
|
202
201
|
source = (0, tnp_core_1.crossPlatformPath)(source);
|
|
203
202
|
if (source === destination) {
|
|
204
|
-
index_1.Helpers.warn('[
|
|
203
|
+
index_1.Helpers.warn('[firedev-helpers] Probably error... trying to copy the same folder...');
|
|
205
204
|
return;
|
|
206
205
|
}
|
|
207
206
|
if (tnp_core_1.fse.existsSync(source) && !tnp_core_1.fse.lstatSync(source).isDirectory()) {
|
|
@@ -292,10 +291,10 @@ var HelpersFileFolders = /** @class */ (function () {
|
|
|
292
291
|
HelpersFileFolders.prototype.tryRemoveDir = function (dirpath, contentOnly) {
|
|
293
292
|
if (contentOnly === void 0) { contentOnly = false; }
|
|
294
293
|
if (!tnp_core_1.fse.existsSync(dirpath)) {
|
|
295
|
-
index_1.Helpers.warn("Folder ".concat(tnp_core_1.path.basename(dirpath), " doesn't exist."));
|
|
294
|
+
index_1.Helpers.warn("[firedev-helper][tryRemoveDir] Folder ".concat(tnp_core_1.path.basename(dirpath), " doesn't exist."));
|
|
296
295
|
return;
|
|
297
296
|
}
|
|
298
|
-
index_1.Helpers.log("[
|
|
297
|
+
index_1.Helpers.log("[firedev-helpers][tryRemoveDir]: ".concat(dirpath));
|
|
299
298
|
try {
|
|
300
299
|
if (contentOnly) {
|
|
301
300
|
tnp_core_1.rimraf.sync("".concat(dirpath, "/*"));
|
|
@@ -334,7 +333,7 @@ var HelpersFileFolders = /** @class */ (function () {
|
|
|
334
333
|
if (Array.isArray(fileOrFolderPathOrPatter)) {
|
|
335
334
|
fileOrFolderPathOrPatter = tnp_core_1.path.join.apply(tnp_core_1.path, tslib_1.__spreadArray([], tslib_1.__read(fileOrFolderPathOrPatter), false));
|
|
336
335
|
}
|
|
337
|
-
index_1.Helpers.log("[
|
|
336
|
+
index_1.Helpers.log("[firedev-helpers][remove]: ".concat(fileOrFolderPathOrPatter), 1);
|
|
338
337
|
if (exactFolder) {
|
|
339
338
|
tnp_core_1.rimraf.sync(fileOrFolderPathOrPatter, { glob: false, disableGlob: true, });
|
|
340
339
|
return;
|
|
@@ -499,10 +498,13 @@ var HelpersFileFolders = /** @class */ (function () {
|
|
|
499
498
|
// sourceDir = sourceDir ? (sourceDir.replace(/\/$/, '')) : sourceDir;
|
|
500
499
|
// destinationDir = destinationDir ? (destinationDir.replace(/\/$/, '')) : destinationDir;
|
|
501
500
|
if (!tnp_core_1.fse.existsSync(sourceDir)) {
|
|
502
|
-
index_1.Helpers.warn("[tnp-helper][copy] Source dir doesnt exist: ".concat(sourceDir, " for destination: ").concat(destinationDir)
|
|
501
|
+
index_1.Helpers.warn("[tnp-helper][copy] Source dir doesnt exist: ".concat(sourceDir, " for destination: ").concat(destinationDir));
|
|
503
502
|
return;
|
|
504
503
|
}
|
|
505
504
|
if (!tnp_core_1.fse.existsSync(tnp_core_1.path.dirname(destinationDir))) {
|
|
505
|
+
if (index_1.Helpers.isUnexistedLink(tnp_core_1.path.dirname(destinationDir))) {
|
|
506
|
+
index_1.Helpers.removeFileIfExists(tnp_core_1.path.dirname(destinationDir));
|
|
507
|
+
}
|
|
506
508
|
index_1.Helpers.mkdirp(tnp_core_1.path.dirname(destinationDir));
|
|
507
509
|
}
|
|
508
510
|
if (!options) {
|
|
@@ -561,7 +563,7 @@ var HelpersFileFolders = /** @class */ (function () {
|
|
|
561
563
|
if ((sourceDir === tnp_core_1.path.resolve(sourceDir))
|
|
562
564
|
&& index_1.Helpers.isExistedSymlink(sourceDir)
|
|
563
565
|
&& !index_1.Helpers.exists(tnp_core_1.fse.readlinkSync(sourceDir))) {
|
|
564
|
-
index_1.Helpers.warn("[
|
|
566
|
+
index_1.Helpers.warn("[firedev-helpers] Not copying empty link from: ".concat(sourceDir, "\n "));
|
|
565
567
|
}
|
|
566
568
|
else {
|
|
567
569
|
var copyFn_1 = function () {
|
|
@@ -617,7 +619,7 @@ var HelpersFileFolders = /** @class */ (function () {
|
|
|
617
619
|
catch (error) {
|
|
618
620
|
var exitOnError = global['tnpNonInteractive'];
|
|
619
621
|
index_1.Helpers.log(error);
|
|
620
|
-
index_1.Helpers.error("[tnp-helper] Not able to copy folder:\n from: ".concat(sourceDir, "\n to: ").concat(destinationDir, "\n options: ").concat(tnp_core_1.json5.stringify(options), "\n error: ").concat(error === null || error === void 0 ? void 0 : error.message, "\n "), !exitOnError
|
|
622
|
+
index_1.Helpers.error("[tnp-helper] Not able to copy folder:\n from: ".concat(sourceDir, "\n to: ").concat(destinationDir, "\n options: ").concat(tnp_core_1.json5.stringify(options), "\n error: ").concat(error === null || error === void 0 ? void 0 : error.message, "\n "), !exitOnError);
|
|
621
623
|
index_1.Helpers.pressKeyAndContinue("Press any key to repeat copy action...");
|
|
622
624
|
copyFn_1();
|
|
623
625
|
}
|
|
@@ -677,18 +679,18 @@ var HelpersFileFolders = /** @class */ (function () {
|
|
|
677
679
|
}
|
|
678
680
|
var debugMode = options.debugMode, fast = options.fast, transformTextFn = options.transformTextFn, dontCopySameContent = options.dontCopySameContent, modifiedFiles = options.modifiedFiles;
|
|
679
681
|
if (tnp_core_1._.isFunction(transformTextFn) && fast) {
|
|
680
|
-
index_1.Helpers.error("[copyFile] You cannot use transformTextFn in fast mode");
|
|
682
|
+
index_1.Helpers.error("[firedev-helpers][copyFile] You cannot use transformTextFn in fast mode");
|
|
681
683
|
}
|
|
682
684
|
if (!tnp_core_1.fse.existsSync(sourcePath)) {
|
|
683
|
-
index_1.Helpers.warn("[copyFile] No able to find source of ".concat(sourcePath));
|
|
685
|
+
index_1.Helpers.warn("[firedev-helpers][copyFile] No able to find source of ".concat(sourcePath));
|
|
684
686
|
return false;
|
|
685
687
|
}
|
|
686
688
|
if (tnp_core_1.fse.lstatSync(sourcePath).isDirectory()) {
|
|
687
|
-
index_1.Helpers.warn("[copyFile] Trying to copy directory as file: ".concat(sourcePath), false);
|
|
689
|
+
index_1.Helpers.warn("[firedev-helpers][copyFile] Trying to copy directory as file: ".concat(sourcePath), false);
|
|
688
690
|
return false;
|
|
689
691
|
}
|
|
690
692
|
if (sourcePath === destinationPath) {
|
|
691
|
-
index_1.Helpers.warn("[copyFile] Trying to copy same file ".concat(sourcePath));
|
|
693
|
+
index_1.Helpers.warn("[firedev-helpers][copyFile] Trying to copy same file ".concat(sourcePath));
|
|
692
694
|
return false;
|
|
693
695
|
}
|
|
694
696
|
var destDirPath = tnp_core_1.path.dirname(destinationPath);
|
|
@@ -726,7 +728,7 @@ var HelpersFileFolders = /** @class */ (function () {
|
|
|
726
728
|
if (tnp_core_1._.isFunction(transformTextFn)) {
|
|
727
729
|
sourceData = transformTextFn(sourceData);
|
|
728
730
|
}
|
|
729
|
-
debugMode && index_1.Helpers.log("\n[copyFile] Write to: ".concat(destinationPath, " file:\n============================================================================================\n").concat(sourceData, "\n============================================================================================\n "));
|
|
731
|
+
debugMode && index_1.Helpers.log("\n [firedev-helpers][copyFile] Write to: ".concat(destinationPath, " file:\n============================================================================================\n").concat(sourceData, "\n============================================================================================\n "));
|
|
730
732
|
index_1.Helpers.writeFile(destinationPath, sourceData);
|
|
731
733
|
}
|
|
732
734
|
if (modifiedFiles && tnp_core_1._.isArray(modifiedFiles.modifiedFiles)) {
|
|
@@ -9,10 +9,17 @@ export declare class HelpersGit {
|
|
|
9
9
|
lastCommitMessage(cwd: any): string;
|
|
10
10
|
countCommits(cwd: string): number;
|
|
11
11
|
hasAnyCommits(cwd: string): boolean;
|
|
12
|
+
isInMergeProcess(cwd: string): boolean;
|
|
12
13
|
getBranchesNames(cwd: string, pattern?: string | RegExp): string[];
|
|
13
14
|
currentBranchName(cwd: any): string;
|
|
14
15
|
commitWhatIs(cwd: string, customMessage?: string): void;
|
|
15
16
|
commit(cwd: string, ProjectClass: typeof Project, args?: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* example: https://github.com/darekf77/tnp-helpers.git
|
|
19
|
+
*
|
|
20
|
+
* Note: address ends with .git always
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
16
23
|
getOriginURL(cwd: string, differentOriginName?: string): string;
|
|
17
24
|
isGitRoot(cwd: string): boolean;
|
|
18
25
|
isGitRepo(cwd: string): boolean;
|
|
@@ -13,14 +13,14 @@ var HelpersGit = /** @class */ (function () {
|
|
|
13
13
|
}
|
|
14
14
|
//#region get last commit hash
|
|
15
15
|
HelpersGit.prototype.lastCommitHash = function (cwd) {
|
|
16
|
-
index_1.Helpers.log('[lastcommithash] ' + cwd, 1);
|
|
16
|
+
index_1.Helpers.log('[firedev-helpers][lastcommithash] ' + cwd, 1);
|
|
17
17
|
try {
|
|
18
18
|
var hash = this.isGitRepo(cwd) && tnp_core_1.child_process.execSync("git log -1 --format=\"%H\"", { cwd: cwd }).toString().trim();
|
|
19
19
|
return hash;
|
|
20
20
|
}
|
|
21
21
|
catch (e) {
|
|
22
22
|
index_1.Helpers.log(e, 1);
|
|
23
|
-
index_1.Helpers.log("[lastCommitHash] Not able to get last commit hash for repository in ".concat(cwd), 1);
|
|
23
|
+
index_1.Helpers.log("[firedev-helpers][lastCommitHash] Not able to get last commit hash for repository in ".concat(cwd), 1);
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
26
|
};
|
|
@@ -74,7 +74,7 @@ var HelpersGit = /** @class */ (function () {
|
|
|
74
74
|
};
|
|
75
75
|
//#region get last tag hash
|
|
76
76
|
HelpersGit.prototype.lastTagHash = function (cwd) {
|
|
77
|
-
index_1.Helpers.log('[lastTagHash] ' + cwd, 1);
|
|
77
|
+
index_1.Helpers.log('[firedev-helpers][lastTagHash] ' + cwd, 1);
|
|
78
78
|
try {
|
|
79
79
|
var tag = index_1.Helpers.git.lastTagVersionName(cwd);
|
|
80
80
|
if (!tag) {
|
|
@@ -85,14 +85,14 @@ var HelpersGit = /** @class */ (function () {
|
|
|
85
85
|
}
|
|
86
86
|
catch (e) {
|
|
87
87
|
index_1.Helpers.log(e, 1);
|
|
88
|
-
index_1.Helpers.log("[lastCommitHash] Not able to get last commit hash for repository in ".concat(cwd), 1);
|
|
88
|
+
index_1.Helpers.log("[firedev-helpers][lastCommitHash] Not able to get last commit hash for repository in ".concat(cwd), 1);
|
|
89
89
|
return null;
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region get last commit date
|
|
94
94
|
HelpersGit.prototype.lastCommitDate = function (cwd) {
|
|
95
|
-
index_1.Helpers.log('[lastCommitDate] ' + cwd, 1);
|
|
95
|
+
index_1.Helpers.log('[firedev-helpers][lastCommitDate] ' + cwd, 1);
|
|
96
96
|
try {
|
|
97
97
|
var unixTimestamp = this.isGitRepo(cwd)
|
|
98
98
|
&& tnp_core_1.child_process
|
|
@@ -103,33 +103,33 @@ var HelpersGit = /** @class */ (function () {
|
|
|
103
103
|
}
|
|
104
104
|
catch (e) {
|
|
105
105
|
index_1.Helpers.log(e, 1);
|
|
106
|
-
index_1.Helpers.log("[lastCommitDate] Cannot counts commits in branch in: ".concat(cwd), 1);
|
|
106
|
+
index_1.Helpers.log("[firedev-helpers][lastCommitDate] Cannot counts commits in branch in: ".concat(cwd), 1);
|
|
107
107
|
return null;
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region get last commit date
|
|
112
112
|
HelpersGit.prototype.lastCommitMessage = function (cwd) {
|
|
113
|
-
index_1.Helpers.log('[lastCommitMessage] ' + cwd, 1);
|
|
113
|
+
index_1.Helpers.log('[firedev-helpers][lastCommitMessage] ' + cwd, 1);
|
|
114
114
|
try {
|
|
115
115
|
var unixTimestamp = tnp_core_1.child_process.execSync("git log -1 --pretty=%B", { cwd: cwd }).toString().trim();
|
|
116
116
|
return unixTimestamp;
|
|
117
117
|
}
|
|
118
118
|
catch (e) {
|
|
119
119
|
index_1.Helpers.log(e, 1);
|
|
120
|
-
index_1.Helpers.log("[lastCommitMessage] Cannot display last commit message in branch in: ".concat(cwd), 1);
|
|
120
|
+
index_1.Helpers.log("[firedev-helpers]lastCommitMessage] Cannot display last commit message in branch in: ".concat(cwd), 1);
|
|
121
121
|
return null;
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
//#endregion
|
|
125
125
|
//#region get number of commit in repository
|
|
126
126
|
HelpersGit.prototype.countCommits = function (cwd) {
|
|
127
|
-
index_1.Helpers.log('[countCommits] ' + cwd, 1);
|
|
127
|
+
index_1.Helpers.log('[firedev-helpers][countCommits] ' + cwd, 1);
|
|
128
128
|
if (!index_1.Helpers.git.hasAnyCommits(cwd)) {
|
|
129
129
|
return 0;
|
|
130
130
|
}
|
|
131
131
|
try {
|
|
132
|
-
index_1.Helpers.log('RUNNING COUNT COMMITS');
|
|
132
|
+
index_1.Helpers.log('[firedev-helpers] RUNNING COUNT COMMITS');
|
|
133
133
|
// git rev-parse HEAD &> /dev/null check if any commits
|
|
134
134
|
var currentLocalBranch = this.currentBranchName(cwd);
|
|
135
135
|
var value = Number(this.isGitRepo(cwd) && index_1.Helpers
|
|
@@ -138,16 +138,21 @@ var HelpersGit = /** @class */ (function () {
|
|
|
138
138
|
}
|
|
139
139
|
catch (e) {
|
|
140
140
|
index_1.Helpers.log(e, 1);
|
|
141
|
-
index_1.Helpers.log("[countCommits] Cannot counts commits in branch in: ".concat(cwd), 1);
|
|
141
|
+
index_1.Helpers.log("[firedev-helpers][countCommits] Cannot counts commits in branch in: ".concat(cwd), 1);
|
|
142
142
|
return 0;
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
//#endregion
|
|
146
146
|
//#region get number of commit in repository
|
|
147
147
|
HelpersGit.prototype.hasAnyCommits = function (cwd) {
|
|
148
|
-
index_1.Helpers.log('[hasAnyCommits] ' + cwd, 1);
|
|
148
|
+
index_1.Helpers.log('[firedev-helpers][hasAnyCommits] ' + cwd, 1);
|
|
149
149
|
try {
|
|
150
|
-
|
|
150
|
+
if (process.platform === 'win32') {
|
|
151
|
+
tnp_core_1.child_process.execSync('git rev-parse HEAD', { cwd: cwd }).toString().trim();
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
tnp_core_1.child_process.execSync('git rev-parse HEAD &> /dev/null', { cwd: cwd }).toString().trim();
|
|
155
|
+
}
|
|
151
156
|
return true;
|
|
152
157
|
}
|
|
153
158
|
catch (e) {
|
|
@@ -155,9 +160,21 @@ var HelpersGit = /** @class */ (function () {
|
|
|
155
160
|
}
|
|
156
161
|
};
|
|
157
162
|
//#endregion
|
|
163
|
+
//#region get number of commit in repository
|
|
164
|
+
HelpersGit.prototype.isInMergeProcess = function (cwd) {
|
|
165
|
+
index_1.Helpers.log('[firedev-helpers][hasAnyCommits] ' + cwd, 1);
|
|
166
|
+
try {
|
|
167
|
+
var message = (tnp_core_1.child_process.execSync("git status", { cwd: cwd }) || '').toString().trim();
|
|
168
|
+
return message.search('Unmerged paths:') !== -1;
|
|
169
|
+
}
|
|
170
|
+
catch (e) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
//#endregion
|
|
158
175
|
//#region get branches names
|
|
159
176
|
HelpersGit.prototype.getBranchesNames = function (cwd, pattern) {
|
|
160
|
-
index_1.Helpers.log('[getBranchesNames] ' + cwd, 1);
|
|
177
|
+
index_1.Helpers.log('[firedev-helpers][getBranchesNames] ' + cwd, 1);
|
|
161
178
|
try {
|
|
162
179
|
var branchPattern_1 = pattern;
|
|
163
180
|
if (tnp_core_1._.isString(pattern)) {
|
|
@@ -187,13 +204,14 @@ var HelpersGit = /** @class */ (function () {
|
|
|
187
204
|
}
|
|
188
205
|
catch (e) {
|
|
189
206
|
index_1.Helpers.log(e);
|
|
207
|
+
index_1.Helpers.log('[firedev-helpers][getBranchesNames] not able to get branches names');
|
|
190
208
|
return [];
|
|
191
209
|
}
|
|
192
210
|
};
|
|
193
211
|
//#endregion
|
|
194
212
|
//#region get current branch name
|
|
195
213
|
HelpersGit.prototype.currentBranchName = function (cwd) {
|
|
196
|
-
index_1.Helpers.log('[currentBranchName] ' + cwd, 1);
|
|
214
|
+
index_1.Helpers.log('[firedev-helpers][currentBranchName] ' + cwd, 1);
|
|
197
215
|
try {
|
|
198
216
|
var branchName = tnp_core_1.child_process.execSync("git branch | sed -n '/* /s///p'", { cwd: cwd }).toString().trim();
|
|
199
217
|
return branchName;
|
|
@@ -206,7 +224,7 @@ var HelpersGit = /** @class */ (function () {
|
|
|
206
224
|
//#region commit "what is"
|
|
207
225
|
HelpersGit.prototype.commitWhatIs = function (cwd, customMessage) {
|
|
208
226
|
if (customMessage === void 0) { customMessage = 'changes'; }
|
|
209
|
-
index_1.Helpers.log('[commitWhatIs]');
|
|
227
|
+
index_1.Helpers.log('[firedev-helpers][commitWhatIs]');
|
|
210
228
|
try {
|
|
211
229
|
index_1.Helpers.run("git add --all . ", { cwd: cwd }).sync();
|
|
212
230
|
}
|
|
@@ -217,24 +235,24 @@ var HelpersGit = /** @class */ (function () {
|
|
|
217
235
|
index_1.Helpers.run("git commit -m \"".concat(customMessage, "\""), { cwd: cwd }).sync();
|
|
218
236
|
}
|
|
219
237
|
catch (error) {
|
|
220
|
-
index_1.Helpers.warn("Failed to git commit -m \"".concat(customMessage, "\""));
|
|
238
|
+
index_1.Helpers.warn("[firedev-helpers][git][commitWhatIs] Failed to git commit -m \"".concat(customMessage, "\""));
|
|
221
239
|
}
|
|
222
240
|
};
|
|
223
241
|
//#endregion
|
|
224
242
|
//#region commit
|
|
225
243
|
HelpersGit.prototype.commit = function (cwd, ProjectClass, args) {
|
|
226
|
-
index_1.Helpers.log('[commit] ' + cwd, 1);
|
|
244
|
+
index_1.Helpers.log('[firedev-helpers][commit] ' + cwd, 1);
|
|
227
245
|
if (!tnp_core_1._.isString(args)) {
|
|
228
246
|
args = 'update';
|
|
229
247
|
}
|
|
230
248
|
var gitRootProject = ProjectClass.nearestTo(cwd, { findGitRoot: true });
|
|
231
249
|
try {
|
|
232
|
-
index_1.Helpers.info("[git][commit] Adding current git changes in git root:\n ".concat(gitRootProject.location, "\n "));
|
|
250
|
+
index_1.Helpers.info("[firedev-helpers][git][commit] Adding current git changes in git root:\n ".concat(gitRootProject.location, "\n "));
|
|
233
251
|
gitRootProject.run("git add --all . ").sync();
|
|
234
252
|
}
|
|
235
253
|
catch (error) {
|
|
236
254
|
index_1.Helpers.log(error);
|
|
237
|
-
index_1.Helpers.warn("Failed to 'git add --all .' in:\n ".concat(gitRootProject.location));
|
|
255
|
+
index_1.Helpers.warn("[firedev-helpers][commit] Failed to 'git add --all .' in:\n ".concat(gitRootProject.location));
|
|
238
256
|
}
|
|
239
257
|
if (args.search('-m') === -1 && args.search('-msg') === -1) {
|
|
240
258
|
var addBrackets = !((args.startsWith('\'') ||
|
|
@@ -244,20 +262,26 @@ var HelpersGit = /** @class */ (function () {
|
|
|
244
262
|
args = "-m ".concat(addBrackets ? "\"".concat(args, "\"") : args);
|
|
245
263
|
}
|
|
246
264
|
try {
|
|
247
|
-
index_1.Helpers.info("[git][commit] trying to commit what it with argument:\n \"".concat(args, "\"\n location: ").concat(cwd, "\n "));
|
|
265
|
+
index_1.Helpers.info("[firedev-helpers][git][commit] trying to commit what it with argument:\n \"".concat(args, "\"\n location: ").concat(cwd, "\n "));
|
|
248
266
|
var cmdddd = "git commit --no-verify ".concat(args);
|
|
249
267
|
index_1.Helpers.run(cmdddd, { cwd: cwd }).sync();
|
|
250
268
|
}
|
|
251
269
|
catch (error) {
|
|
252
270
|
index_1.Helpers.log(error);
|
|
253
|
-
index_1.Helpers.warn("[git][commit] not able to commit what is with command: ".concat(cmdddd));
|
|
271
|
+
index_1.Helpers.warn("[firedev-helpers][git][commit] not able to commit what is with command: ".concat(cmdddd));
|
|
254
272
|
}
|
|
255
273
|
};
|
|
256
274
|
//#endregion
|
|
257
275
|
//#region get remote origin
|
|
276
|
+
/**
|
|
277
|
+
* example: https://github.com/darekf77/tnp-helpers.git
|
|
278
|
+
*
|
|
279
|
+
* Note: address ends with .git always
|
|
280
|
+
*
|
|
281
|
+
*/
|
|
258
282
|
HelpersGit.prototype.getOriginURL = function (cwd, differentOriginName) {
|
|
259
283
|
if (differentOriginName === void 0) { differentOriginName = ''; }
|
|
260
|
-
index_1.Helpers.log('[getOriginURL] ' + cwd, 1);
|
|
284
|
+
index_1.Helpers.log('[firedev-helpers][getOriginURL] ' + cwd, 1);
|
|
261
285
|
var url = '';
|
|
262
286
|
try {
|
|
263
287
|
// git config --get remote.origin.url
|
|
@@ -266,18 +290,21 @@ var HelpersGit = /** @class */ (function () {
|
|
|
266
290
|
catch (error) {
|
|
267
291
|
return '< not able to get origin >';
|
|
268
292
|
}
|
|
293
|
+
if (!url.endsWith('.git')) {
|
|
294
|
+
return "".concat(url, ".git");
|
|
295
|
+
}
|
|
269
296
|
return url;
|
|
270
297
|
};
|
|
271
298
|
//#endregion
|
|
272
299
|
//#region is git root
|
|
273
300
|
HelpersGit.prototype.isGitRoot = function (cwd) {
|
|
274
|
-
index_1.Helpers.log('[isGitRoot] ' + cwd, 1);
|
|
301
|
+
index_1.Helpers.log('[firedev-helpers][isGitRoot] ' + cwd, 1);
|
|
275
302
|
return this.isGitRepo(cwd) && tnp_core_1.fse.existsSync(tnp_core_1.path.join(cwd, '.git'));
|
|
276
303
|
};
|
|
277
304
|
//#endregion
|
|
278
305
|
//#region is git repo
|
|
279
306
|
HelpersGit.prototype.isGitRepo = function (cwd) {
|
|
280
|
-
index_1.Helpers.log('[isGitRepo] ' + cwd, 1);
|
|
307
|
+
index_1.Helpers.log('[firedev-helpers][isGitRepo] ' + cwd, 1);
|
|
281
308
|
if (!index_1.Helpers.git.hasAnyCommits(cwd)) {
|
|
282
309
|
return false;
|
|
283
310
|
}
|
|
@@ -297,7 +324,7 @@ var HelpersGit = /** @class */ (function () {
|
|
|
297
324
|
HelpersGit.prototype.pull = function (branchName, cwd) {
|
|
298
325
|
if (branchName === void 0) { branchName = 'master'; }
|
|
299
326
|
if (cwd === void 0) { cwd = (0, tnp_core_1.crossPlatformPath)(process.cwd()); }
|
|
300
|
-
index_1.Helpers.log('[pull] ' + cwd, 1);
|
|
327
|
+
index_1.Helpers.log('[firedev-helpers][pull] ' + cwd, 1);
|
|
301
328
|
tnp_core_1.child_process.execSync("git pull --tags --rebase origin ".concat(branchName), { cwd: cwd });
|
|
302
329
|
};
|
|
303
330
|
//#region pull current branch
|
|
@@ -309,23 +336,23 @@ var HelpersGit = /** @class */ (function () {
|
|
|
309
336
|
return tslib_1.__generator(this, function (_a) {
|
|
310
337
|
switch (_a.label) {
|
|
311
338
|
case 0:
|
|
312
|
-
index_1.Helpers.log('[pullBranch] ' + cwd, 1);
|
|
339
|
+
index_1.Helpers.log('[firedev-helpers][pullBranch] ' + cwd, 1);
|
|
313
340
|
if (this.getOriginURL(cwd) === '') {
|
|
314
341
|
index_1.Helpers.warn("Not pulling branch without "
|
|
315
342
|
+ "remote origin url.... in folder ".concat(tnp_core_1.path.basename(cwd)));
|
|
316
343
|
return [2 /*return*/];
|
|
317
344
|
}
|
|
318
|
-
index_1.Helpers.info("Pulling git changes in \"".concat(cwd, "\" , origin=").concat(index_1.Helpers.git.getOriginURL(cwd), " "));
|
|
345
|
+
index_1.Helpers.info("[firedev-helpers] Pulling git changes in \"".concat(cwd, "\" , origin=").concat(index_1.Helpers.git.getOriginURL(cwd), " "));
|
|
319
346
|
_a.label = 1;
|
|
320
347
|
case 1:
|
|
321
348
|
_a.trys.push([1, 2, , 5]);
|
|
322
349
|
index_1.Helpers.git.pull(branchName, cwd);
|
|
323
|
-
index_1.Helpers.info("Branch \"".concat(branchName, "\" updated successfully in ").concat(tnp_core_1.path.basename(cwd)));
|
|
350
|
+
index_1.Helpers.info("[firedev-helpers] Branch \"".concat(branchName, "\" updated successfully in ").concat(tnp_core_1.path.basename(cwd)));
|
|
324
351
|
return [3 /*break*/, 5];
|
|
325
352
|
case 2:
|
|
326
353
|
e_1 = _a.sent();
|
|
327
354
|
// console.log(e)
|
|
328
|
-
index_1.Helpers.error("Cannot update current branch in: ".concat(cwd), askToRetry, true);
|
|
355
|
+
index_1.Helpers.error("[firedev-helpers] Cannot update current branch in: ".concat(cwd), askToRetry, true);
|
|
329
356
|
if (!askToRetry) return [3 /*break*/, 4];
|
|
330
357
|
return [4 /*yield*/, index_1.Helpers.questionYesNo("Do you wanna try again ?", function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
331
358
|
return tslib_1.__generator(this, function (_a) {
|
|
@@ -358,7 +385,7 @@ var HelpersGit = /** @class */ (function () {
|
|
|
358
385
|
return tslib_1.__generator(this, function (_a) {
|
|
359
386
|
switch (_a.label) {
|
|
360
387
|
case 0:
|
|
361
|
-
index_1.Helpers.log('[pullCurrentBranch] ' + cwd, 1);
|
|
388
|
+
index_1.Helpers.log('[firedev-helpers][pullCurrentBranch] ' + cwd, 1);
|
|
362
389
|
if (global['tnpNonInteractive']) {
|
|
363
390
|
askToRetry = false;
|
|
364
391
|
}
|
|
@@ -368,18 +395,18 @@ var HelpersGit = /** @class */ (function () {
|
|
|
368
395
|
+ "remote origin url.... in folder ".concat(tnp_core_1.path.basename(cwd)));
|
|
369
396
|
return [2 /*return*/];
|
|
370
397
|
}
|
|
371
|
-
index_1.Helpers.info("Pulling git changes in \"".concat(cwd, "\", origin=").concat(index_1.Helpers.git.getOriginURL(cwd), " "));
|
|
398
|
+
index_1.Helpers.info("[firedev-helpers] Pulling git changes in \"".concat(cwd, "\", origin=").concat(index_1.Helpers.git.getOriginURL(cwd), " "));
|
|
372
399
|
_a.label = 1;
|
|
373
400
|
case 1:
|
|
374
401
|
_a.trys.push([1, 2, , 5]);
|
|
375
402
|
currentLocalBranch = tnp_core_1.child_process.execSync("git branch | sed -n '/* /s///p'", { cwd: cwd }).toString().trim();
|
|
376
403
|
index_1.Helpers.git.pull(currentLocalBranch, cwd);
|
|
377
|
-
index_1.Helpers.info("Branch \"".concat(currentLocalBranch, "\" updated successfully in ").concat(tnp_core_1.path.basename(cwd)));
|
|
404
|
+
index_1.Helpers.info("[firedev-helpers] Branch \"".concat(currentLocalBranch, "\" updated successfully in ").concat(tnp_core_1.path.basename(cwd)));
|
|
378
405
|
return [3 /*break*/, 5];
|
|
379
406
|
case 2:
|
|
380
407
|
e_2 = _a.sent();
|
|
381
408
|
console.log(e_2);
|
|
382
|
-
index_1.Helpers.error("Cannot update current branch in: ".concat(cwd), askToRetry, true);
|
|
409
|
+
index_1.Helpers.error("[firedev-helpers] Cannot update current branch in: ".concat(cwd), askToRetry, true);
|
|
383
410
|
if (!askToRetry) return [3 /*break*/, 4];
|
|
384
411
|
return [4 /*yield*/, index_1.Helpers.questionYesNo("Do you wanna try again ?", function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
385
412
|
return tslib_1.__generator(this, function (_a) {
|
|
@@ -409,7 +436,7 @@ var HelpersGit = /** @class */ (function () {
|
|
|
409
436
|
HelpersGit.prototype.pushCurrentBranch = function (cwd, force, origin) {
|
|
410
437
|
if (force === void 0) { force = false; }
|
|
411
438
|
if (origin === void 0) { origin = 'origin'; }
|
|
412
|
-
index_1.Helpers.log('[pushCurrentBranch] ' + cwd, 1);
|
|
439
|
+
index_1.Helpers.log('[firedev-helpers][pushCurrentBranch] ' + cwd, 1);
|
|
413
440
|
var currentBranchName = index_1.Helpers.git.currentBranchName(cwd);
|
|
414
441
|
var taskName = "\n Pushing current branch (remote=".concat(origin, "): ").concat(currentBranchName, "\n ");
|
|
415
442
|
index_1.Helpers.info(taskName);
|
|
@@ -423,7 +450,7 @@ var HelpersGit = /** @class */ (function () {
|
|
|
423
450
|
break;
|
|
424
451
|
}
|
|
425
452
|
catch (err) {
|
|
426
|
-
index_1.Helpers.error("[
|
|
453
|
+
index_1.Helpers.error("[firedev-helpers] Not able to push branch ".concat(currentBranchName, " in (origin=").concat(origin, "):\n ").concat(cwd), true, true);
|
|
427
454
|
index_1.Helpers.pressKeyAndContinue("Press any key to try again: ");
|
|
428
455
|
// TODO issue 1: issue with press any key
|
|
429
456
|
// TODO issue 2: Updates were rejected because the tag already exists in the remote
|
|
@@ -464,12 +491,12 @@ var HelpersGit = /** @class */ (function () {
|
|
|
464
491
|
// const ALWAYS_HTTPS = true;
|
|
465
492
|
if (url.split(' ').length > 2) {
|
|
466
493
|
// const [rUrl, rDest] = url.split(' ');
|
|
467
|
-
index_1.Helpers.error("[
|
|
494
|
+
index_1.Helpers.error("[firedev-helpers]incorrect clone url \"".concat(url, "\""));
|
|
468
495
|
}
|
|
469
496
|
if (url.split(' ').length === 2) {
|
|
470
497
|
var _e = tslib_1.__read(url.split(' '), 2), rUrl = _e[0], rDest = _e[1];
|
|
471
498
|
if (destinationFolderName) {
|
|
472
|
-
index_1.Helpers.error("[
|
|
499
|
+
index_1.Helpers.error("[firedev-helpers] wrong cloning argument\n\n url = \"".concat(url, "\"\n destinationFolderName = \"").concat(destinationFolderName, "\"\n\n cant use both at the same time\n "));
|
|
473
500
|
}
|
|
474
501
|
else {
|
|
475
502
|
destinationFolderName = rDest;
|
|
@@ -487,7 +514,7 @@ var HelpersGit = /** @class */ (function () {
|
|
|
487
514
|
index_1.Helpers.remove(cloneFolderPath);
|
|
488
515
|
}
|
|
489
516
|
else if (index_1.Helpers.exists(cloneFolderPath) && index_1.Helpers.exists(tnp_core_1.path.join(cloneFolderPath, '.git'))) {
|
|
490
|
-
index_1.Helpers.warn("
|
|
517
|
+
index_1.Helpers.warn("[firedev-helpers] Already cloned ".concat(tnp_core_1.path.basename(cloneFolderPath), "..."));
|
|
491
518
|
return;
|
|
492
519
|
}
|
|
493
520
|
var commnad = url.startsWith("https://")
|
|
@@ -503,17 +530,17 @@ var HelpersGit = /** @class */ (function () {
|
|
|
503
530
|
}
|
|
504
531
|
catch (error) {
|
|
505
532
|
if (((_c = (_b = error === null || error === void 0 ? void 0 : error.stderr) === null || _b === void 0 ? void 0 : _b.toString()) === null || _c === void 0 ? void 0 : _c.search('remote: Not Found')) !== -1) {
|
|
506
|
-
index_1.Helpers.warn("[
|
|
533
|
+
index_1.Helpers.warn("[firedev-helpers][git] Project not found :".concat(url));
|
|
507
534
|
}
|
|
508
535
|
else {
|
|
509
|
-
index_1.Helpers.error("Can't clone from url: ".concat(tnp_cli_1.CLI.chalk.bold(url), ".."), false, true);
|
|
536
|
+
index_1.Helpers.error("[firedev-helpers] Can't clone from url: ".concat(tnp_cli_1.CLI.chalk.bold(url), ".."), false, true);
|
|
510
537
|
}
|
|
511
538
|
}
|
|
512
539
|
}
|
|
513
540
|
var packageJson = tnp_core_1.path.join(cloneFolderPath, tnp_config_1.config.file.package_json);
|
|
514
541
|
// Helpers.info(packageJson)
|
|
515
542
|
if (!index_1.Helpers.exists(packageJson)) {
|
|
516
|
-
index_1.Helpers.info("Recreating unexited package.json for project ".concat(tnp_core_1.path.basename(cloneFolderPath), ".."));
|
|
543
|
+
index_1.Helpers.info("[firedev-helpers] Recreating unexited package.json for project ".concat(tnp_core_1.path.basename(cloneFolderPath), ".."));
|
|
517
544
|
try {
|
|
518
545
|
index_1.Helpers.run("npm init -y", { cwd: cloneFolderPath, output: false }).sync();
|
|
519
546
|
}
|
|
@@ -523,13 +550,13 @@ var HelpersGit = /** @class */ (function () {
|
|
|
523
550
|
//#endregion
|
|
524
551
|
//#region check if there are some uncommited changes
|
|
525
552
|
HelpersGit.prototype.checkIfthereAreSomeUncommitedChange = function (cwd) {
|
|
526
|
-
index_1.Helpers.log('[checkIfthereAreSomeUncommitedChange] ' + cwd, 1);
|
|
553
|
+
index_1.Helpers.log('[firedev-helpers][checkIfthereAreSomeUncommitedChange] ' + cwd, 1);
|
|
527
554
|
return index_1.Helpers.git.thereAreSomeUncommitedChangeExcept([], cwd);
|
|
528
555
|
};
|
|
529
556
|
//#endregion
|
|
530
557
|
HelpersGit.prototype.thereAreSomeUncommitedChangeExcept = function (filesList, cwd) {
|
|
531
558
|
if (filesList === void 0) { filesList = []; }
|
|
532
|
-
index_1.Helpers.log('[thereAreSomeUncommitedChangeExcept] ' + cwd, 1);
|
|
559
|
+
index_1.Helpers.log('[firedev-helpers][thereAreSomeUncommitedChangeExcept] ' + cwd, 1);
|
|
533
560
|
filesList = filesList.map(function (f) { return (0, tnp_core_1.crossPlatformPath)(f); });
|
|
534
561
|
try {
|
|
535
562
|
var res = index_1.Helpers.run("git ls-files --deleted --modified --others --exclude-standard", { output: false, cwd: cwd }).sync().toString().trim();
|
|
@@ -547,13 +574,13 @@ var HelpersGit = /** @class */ (function () {
|
|
|
547
574
|
};
|
|
548
575
|
//#region restore last version
|
|
549
576
|
HelpersGit.prototype.restoreLastVersion = function (cwd, localFilePath) {
|
|
550
|
-
index_1.Helpers.log('[restoreLastVersion] ' + cwd, 1);
|
|
577
|
+
index_1.Helpers.log('[firedev-helpers][restoreLastVersion] ' + cwd, 1);
|
|
551
578
|
try {
|
|
552
|
-
index_1.Helpers.info("[git] restoring last verion of file ".concat(tnp_core_1.path.basename(cwd), "/").concat(localFilePath));
|
|
579
|
+
index_1.Helpers.info("[firedev-helpers][git] restoring last verion of file ".concat(tnp_core_1.path.basename(cwd), "/").concat(localFilePath));
|
|
553
580
|
index_1.Helpers.run("git checkout -- ".concat(localFilePath), { cwd: cwd }).sync();
|
|
554
581
|
}
|
|
555
582
|
catch (error) {
|
|
556
|
-
index_1.Helpers.warn("[
|
|
583
|
+
index_1.Helpers.warn("[firedev-helpers][git] Not able to resotre last version of file ".concat(localFilePath));
|
|
557
584
|
}
|
|
558
585
|
};
|
|
559
586
|
//#endregion
|
|
@@ -563,13 +590,13 @@ var HelpersGit = /** @class */ (function () {
|
|
|
563
590
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
564
591
|
relativePathes[_i - 1] = arguments[_i];
|
|
565
592
|
}
|
|
566
|
-
index_1.Helpers.log('[resetFiles] ' + cwd, 1);
|
|
593
|
+
index_1.Helpers.log('[firedev-helpers][resetFiles] ' + cwd, 1);
|
|
567
594
|
relativePathes.forEach(function (p) {
|
|
568
595
|
try {
|
|
569
596
|
index_1.Helpers.run("git checkout HEAD -- ".concat(p), { cwd: cwd }).sync();
|
|
570
597
|
}
|
|
571
598
|
catch (err) {
|
|
572
|
-
index_1.Helpers.error("[
|
|
599
|
+
index_1.Helpers.error("[firedev-helpers][git] Not able to reset files: ".concat(p, " inside project ").concat(tnp_core_1.path.basename(cwd), "."), true, true);
|
|
573
600
|
}
|
|
574
601
|
});
|
|
575
602
|
};
|
|
@@ -388,7 +388,7 @@ var HelpersProcess = /** @class */ (function () {
|
|
|
388
388
|
org = port;
|
|
389
389
|
port = Number(port);
|
|
390
390
|
if (!tnp_core_1._.isNumber(port)) {
|
|
391
|
-
index_1.Helpers.warn("[
|
|
391
|
+
index_1.Helpers.warn("[firedev-helpers] Can't kill on port: \"".concat(org, "\""));
|
|
392
392
|
return [2 /*return*/];
|
|
393
393
|
}
|
|
394
394
|
_a.label = 2;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HelpersVscode = void 0;
|
|
4
|
+
var tnp_core_1 = require("tnp-core");
|
|
5
|
+
var index_1 = require("./index");
|
|
6
|
+
var JSON5 = require("json5");
|
|
7
|
+
var HelpersVscode = /** @class */ (function () {
|
|
8
|
+
function HelpersVscode() {
|
|
9
|
+
}
|
|
10
|
+
HelpersVscode.prototype.getSettingsFrom = function (project) {
|
|
11
|
+
var settings;
|
|
12
|
+
var pathSettingsVScode = tnp_core_1.path.join(project.location, '.vscode', 'settings.json');
|
|
13
|
+
if (index_1.Helpers.exists(pathSettingsVScode)) {
|
|
14
|
+
settings = JSON5.parse(index_1.Helpers.readFile(pathSettingsVScode));
|
|
15
|
+
}
|
|
16
|
+
return settings;
|
|
17
|
+
};
|
|
18
|
+
return HelpersVscode;
|
|
19
|
+
}());
|
|
20
|
+
exports.HelpersVscode = HelpersVscode;
|
|
21
|
+
//# sourceMappingURL=helpers-vscode.backend.js.map
|
package/lib/helpers.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { HelpersPath } from './helpers-path.backend';
|
|
|
18
18
|
import { HelpersNetwork } from './helpers-network.backend';
|
|
19
19
|
import { HelpersJSON5 } from './helpers-json5.backend';
|
|
20
20
|
import { TsCodeExtractor } from './ts-code/ts-code-extractor';
|
|
21
|
+
import { HelpersVscode } from './helpers-vscode.backend';
|
|
21
22
|
import { ConfigModels } from 'tnp-config';
|
|
22
23
|
import { CoreHelpers } from 'tnp-core';
|
|
23
24
|
import { HelpersNumber } from './helpers-numbers';
|
|
@@ -34,6 +35,7 @@ export declare class HelpersTnp extends CoreHelpers {
|
|
|
34
35
|
path: HelpersPath;
|
|
35
36
|
network: HelpersNetwork;
|
|
36
37
|
json5: HelpersJSON5;
|
|
38
|
+
vscode: HelpersVscode;
|
|
37
39
|
arrays: HelpersArrayObj;
|
|
38
40
|
strings: HelpersStrings;
|
|
39
41
|
numbers: HelpersNumber;
|
package/lib/helpers.js
CHANGED
|
@@ -27,6 +27,7 @@ var helpers_network_backend_1 = require("./helpers-network.backend");
|
|
|
27
27
|
var helpers_json5_backend_1 = require("./helpers-json5.backend");
|
|
28
28
|
var ts_code_extractor_1 = require("./ts-code/ts-code-extractor");
|
|
29
29
|
var tnp_cli_1 = require("tnp-cli");
|
|
30
|
+
var helpers_vscode_backend_1 = require("./helpers-vscode.backend");
|
|
30
31
|
//#endregion
|
|
31
32
|
var tnp_config_1 = require("tnp-config");
|
|
32
33
|
var index_1 = require("./index");
|
|
@@ -47,7 +48,7 @@ var HelpersTnp = /** @class */ (function (_super) {
|
|
|
47
48
|
tslib_1.__extends(HelpersTnp, _super);
|
|
48
49
|
function HelpersTnp(
|
|
49
50
|
//#region @backend
|
|
50
|
-
tsCodeModifier, tsCodeExtractor, cliTool, terminal, git, npm, morphi, deps, path, network, json5,
|
|
51
|
+
tsCodeModifier, tsCodeExtractor, cliTool, terminal, git, npm, morphi, deps, path, network, json5, vscode,
|
|
51
52
|
//#endregion
|
|
52
53
|
arrays, strings, numbers) {
|
|
53
54
|
if (tsCodeModifier === void 0) { tsCodeModifier = new ts_code_1.TsCodeModifer(); }
|
|
@@ -61,6 +62,7 @@ var HelpersTnp = /** @class */ (function (_super) {
|
|
|
61
62
|
if (path === void 0) { path = new helpers_path_backend_1.HelpersPath(); }
|
|
62
63
|
if (network === void 0) { network = new helpers_network_backend_1.HelpersNetwork(); }
|
|
63
64
|
if (json5 === void 0) { json5 = new helpers_json5_backend_1.HelpersJSON5(); }
|
|
65
|
+
if (vscode === void 0) { vscode = new helpers_vscode_backend_1.HelpersVscode(); }
|
|
64
66
|
if (arrays === void 0) { arrays = new helpers_array_obj_1.HelpersArrayObj(); }
|
|
65
67
|
if (strings === void 0) { strings = new helpers_strings_1.HelpersStrings(); }
|
|
66
68
|
if (numbers === void 0) { numbers = new helpers_numbers_1.HelpersNumber(); }
|
|
@@ -76,6 +78,7 @@ var HelpersTnp = /** @class */ (function (_super) {
|
|
|
76
78
|
_this.path = path;
|
|
77
79
|
_this.network = network;
|
|
78
80
|
_this.json5 = json5;
|
|
81
|
+
_this.vscode = vscode;
|
|
79
82
|
_this.arrays = arrays;
|
|
80
83
|
_this.strings = strings;
|
|
81
84
|
_this.numbers = numbers;
|
|
@@ -152,7 +155,7 @@ var HelpersTnp = /** @class */ (function (_super) {
|
|
|
152
155
|
case 1:
|
|
153
156
|
//#region @backend
|
|
154
157
|
if (!(_a.sent())) {
|
|
155
|
-
index_1.Helpers.error("[
|
|
158
|
+
index_1.Helpers.error("[firedev-helpers] Please run this program as sudo (or admin on windows)", false, true);
|
|
156
159
|
}
|
|
157
160
|
return [2 /*return*/];
|
|
158
161
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { Condition } from './condition-wait';
|
|
|
4
4
|
export * from './merge-helpers.backend';
|
|
5
5
|
export declare const Helpers: Base & import("tnp-core").CoreHelpers;
|
|
6
6
|
export * from './project';
|
|
7
|
+
export * from './firedev-models';
|
|
7
8
|
export { BaseComponent, BaseComponentForRouter } from './base-component';
|
|
8
9
|
export { BaseFormlyComponent } from './base-formly-component';
|
|
9
10
|
export { DualComponentController } from './dual-component-ctrl';
|