tnp-core 1.0.33 → 1.0.36
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 +2 -1
- package/browser/README.md +24 -0
- package/browser/esm2020/lib/core-config.mjs +6 -0
- package/browser/esm2020/lib/core-imports.mjs +14 -0
- package/browser/esm2020/lib/core-models.mjs +2 -0
- package/browser/esm2020/lib/helpers-isomorphic.mjs +28 -0
- package/browser/esm2020/lib/helpers-messages.mjs +67 -0
- package/browser/esm2020/lib/helpers.mjs +66 -0
- package/browser/esm2020/lib/index.mjs +8 -0
- package/browser/esm2020/lib/progress-data.mjs +46 -0
- package/browser/esm2020/public-api.mjs +2 -0
- package/browser/esm2020/tnp-core.mjs +5 -0
- package/browser/fesm2015/tnp-core.mjs +224 -0
- package/browser/fesm2015/tnp-core.mjs.map +1 -0
- package/browser/fesm2020/tnp-core.mjs +221 -0
- package/browser/fesm2020/tnp-core.mjs.map +1 -0
- package/browser/{core-config.d.ts → lib/core-config.d.ts} +0 -0
- package/browser/lib/core-imports.d.ts +4 -0
- package/browser/{core-models.d.ts → lib/core-models.d.ts} +0 -0
- package/browser/{helpers-isomorphic.d.ts → lib/helpers-isomorphic.d.ts} +0 -0
- package/browser/{helpers-messages.d.ts → lib/helpers-messages.d.ts} +0 -0
- package/{client → browser/lib}/helpers.d.ts +1 -0
- package/browser/{index.d.ts → lib/index.d.ts} +0 -0
- package/{progress-data.d.ts → browser/lib/progress-data.d.ts} +3 -3
- package/browser/package.json +31 -0
- package/browser/public-api.d.ts +1 -7
- package/browser/tnp-core.d.ts +5 -0
- package/client/README.md +24 -0
- package/client/esm2020/lib/core-config.mjs +6 -0
- package/client/esm2020/lib/core-imports.mjs +14 -0
- package/client/esm2020/lib/core-models.mjs +2 -0
- package/client/esm2020/lib/helpers-isomorphic.mjs +28 -0
- package/client/esm2020/lib/helpers-messages.mjs +67 -0
- package/client/esm2020/lib/helpers.mjs +66 -0
- package/client/esm2020/lib/index.mjs +8 -0
- package/client/esm2020/lib/progress-data.mjs +46 -0
- package/client/esm2020/public-api.mjs +2 -0
- package/client/esm2020/tnp-core.mjs +5 -0
- package/client/fesm2015/tnp-core.mjs +224 -0
- package/client/fesm2015/tnp-core.mjs.map +1 -0
- package/client/fesm2020/tnp-core.mjs +221 -0
- package/client/fesm2020/tnp-core.mjs.map +1 -0
- package/client/{core-config.d.ts → lib/core-config.d.ts} +0 -0
- package/client/lib/core-imports.d.ts +4 -0
- package/client/{core-models.d.ts → lib/core-models.d.ts} +0 -0
- package/client/{helpers-isomorphic.d.ts → lib/helpers-isomorphic.d.ts} +0 -0
- package/client/{helpers-messages.d.ts → lib/helpers-messages.d.ts} +0 -0
- package/{browser → client/lib}/helpers.d.ts +1 -0
- package/client/{index.d.ts → lib/index.d.ts} +0 -0
- package/{browser → client/lib}/progress-data.d.ts +3 -3
- package/client/package.json +26 -21
- package/client/public-api.d.ts +1 -7
- package/client/tnp-core.d.ts +5 -0
- package/index.d.ts +1 -7
- package/index.js +3 -10
- package/index.js.map +1 -1
- package/{core-config.d.ts → lib/core-config.d.ts} +0 -0
- package/{core-config.js → lib/core-config.js} +2 -1
- package/lib/core-config.js.map +1 -0
- package/{core-imports.d.ts → lib/core-imports.d.ts} +2 -1
- package/{core-imports.js → lib/core-imports.js} +6 -3
- package/lib/core-imports.js.map +1 -0
- package/{core-models.d.ts → lib/core-models.d.ts} +0 -0
- package/{core-models.js → lib/core-models.js} +2 -1
- package/{core-models.js.map → lib/core-models.js.map} +1 -1
- package/{helpers-isomorphic.d.ts → lib/helpers-isomorphic.d.ts} +0 -0
- package/{helpers-isomorphic.js → lib/helpers-isomorphic.js} +2 -1
- package/lib/helpers-isomorphic.js.map +1 -0
- package/{helpers-messages.d.ts → lib/helpers-messages.d.ts} +0 -0
- package/{helpers-messages.js → lib/helpers-messages.js} +3 -2
- package/lib/helpers-messages.js.map +1 -0
- package/{helpers.d.ts → lib/helpers.d.ts} +3 -3
- package/{helpers.js → lib/helpers.js} +100 -60
- package/lib/helpers.js.map +1 -0
- package/{public-api.d.ts → lib/index.d.ts} +0 -0
- package/{public-api.js → lib/index.js} +6 -5
- package/lib/index.js.map +1 -0
- package/{client → lib}/progress-data.d.ts +3 -3
- package/{progress-data.js → lib/progress-data.js} +4 -3
- package/lib/progress-data.js.map +1 -0
- package/{client/index.js → lib/public-api.d.ts} +1 -2
- package/lib/public-api.js +14 -0
- package/lib/public-api.js.map +1 -0
- package/package.json +18 -18
- package/package.json_devDependencies.json +66 -85
- package/package.json_tnp.json +10 -6
- package/package.json_tnp.json5 +50 -0
- package/tmp-environment.json +72 -119
- package/browser/core-config.js +0 -6
- package/browser/core-config.js.map +0 -1
- package/browser/core-imports.d.ts +0 -3
- package/browser/core-imports.js +0 -13
- package/browser/core-imports.js.map +0 -1
- package/browser/core-models.js +0 -2
- package/browser/core-models.js.map +0 -1
- package/browser/helpers-isomorphic.js +0 -28
- package/browser/helpers-isomorphic.js.map +0 -1
- package/browser/helpers-messages.js +0 -67
- package/browser/helpers-messages.js.map +0 -1
- package/browser/helpers.js +0 -65
- package/browser/helpers.js.map +0 -1
- package/browser/index.js +0 -8
- package/browser/index.js.map +0 -1
- package/browser/progress-data.js +0 -46
- package/browser/progress-data.js.map +0 -1
- package/browser/public-api.js +0 -8
- package/browser/public-api.js.map +0 -1
- package/client/core-config.js +0 -6
- package/client/core-config.js.map +0 -1
- package/client/core-imports.d.ts +0 -3
- package/client/core-imports.js +0 -13
- package/client/core-imports.js.map +0 -1
- package/client/core-models.js +0 -2
- package/client/core-models.js.map +0 -1
- package/client/helpers-isomorphic.js +0 -28
- package/client/helpers-isomorphic.js.map +0 -1
- package/client/helpers-messages.js +0 -67
- package/client/helpers-messages.js.map +0 -1
- package/client/helpers.js +0 -65
- package/client/helpers.js.map +0 -1
- package/client/index.js.map +0 -1
- package/client/progress-data.js +0 -46
- package/client/progress-data.js.map +0 -1
- package/client/public-api.js +0 -8
- package/client/public-api.js.map +0 -1
- package/core-config.js.map +0 -1
- package/core-imports.js.map +0 -1
- package/helpers-isomorphic.js.map +0 -1
- package/helpers-messages.js.map +0 -1
- package/helpers.js.map +0 -1
- package/progress-data.js.map +0 -1
- package/public-api.js.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"core-config.js","sourceRoot":"","sources":["../../src/lib/core-config.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACxB,OAAO,EAAE;QACP,oBAAoB,EAAE,sBAAsB;KAC7C;CACF,CAAA"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as _ from 'lodash';
|
2
2
|
import * as q from 'q';
|
3
|
+
import * as moment from 'moment';
|
3
4
|
import * as path from 'path';
|
4
5
|
import * as os from 'os';
|
5
6
|
import * as child_process from 'child_process';
|
@@ -23,4 +24,4 @@ import * as fkill from 'fkill';
|
|
23
24
|
import * as portfinder from 'portfinder';
|
24
25
|
declare function win32Path(p: string): string;
|
25
26
|
declare function crossPlatformPath(p: string): string;
|
26
|
-
export { _, q, dateformat, spawn, chalk, glob, isElevated, chokidar, mkdirp, ncp, json5, path, fse, win32Path, crossPlatformPath, os, child_process, http, https, rimraf, net, ps, fkill, portfinder, psList, };
|
27
|
+
export { _, q, moment, dateformat, spawn, chalk, glob, isElevated, chokidar, mkdirp, ncp, json5, path, fse, win32Path, crossPlatformPath, os, child_process, http, https, rimraf, net, ps, fkill, portfinder, psList, };
|
@@ -1,10 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.psList = exports.portfinder = exports.fkill = exports.ps = exports.net = exports.rimraf = exports.https = exports.http = exports.child_process = exports.os = exports.crossPlatformPath = exports.win32Path = exports.fse = exports.path = exports.json5 = exports.ncp = exports.mkdirp = exports.chokidar = exports.isElevated = exports.glob = exports.chalk = exports.spawn = exports.dateformat = exports.q = exports._ = void 0;
|
3
|
+
exports.psList = exports.portfinder = exports.fkill = exports.ps = exports.net = exports.rimraf = exports.https = exports.http = exports.child_process = exports.os = exports.crossPlatformPath = exports.win32Path = exports.fse = exports.path = exports.json5 = exports.ncp = exports.mkdirp = exports.chokidar = exports.isElevated = exports.glob = exports.chalk = exports.spawn = exports.dateformat = exports.moment = exports.q = exports._ = void 0;
|
4
4
|
var _ = require("lodash");
|
5
5
|
exports._ = _;
|
6
6
|
var q = require("q");
|
7
7
|
exports.q = q;
|
8
|
+
var moment = require("moment");
|
9
|
+
exports.moment = moment;
|
8
10
|
//#region @backend
|
9
11
|
var path = require("path");
|
10
12
|
exports.path = path;
|
@@ -54,7 +56,7 @@ function win32Path(p) {
|
|
54
56
|
return p;
|
55
57
|
}
|
56
58
|
if (/^\/[a-z]\//.test(p)) {
|
57
|
-
p = p.replace(/^\/[a-z]\//, p.charAt(1).toUpperCase()
|
59
|
+
p = p.replace(/^\/[a-z]\//, "".concat(p.charAt(1).toUpperCase(), ":/"));
|
58
60
|
}
|
59
61
|
return path.win32.normalize(p);
|
60
62
|
}
|
@@ -97,4 +99,5 @@ import { _ } from 'tnp-core';
|
|
97
99
|
import { } from 'tnp-core';
|
98
100
|
|
99
101
|
*/
|
100
|
-
//# sourceMappingURL=core-imports.js.map
|
102
|
+
//# sourceMappingURL=core-imports.js.map
|
103
|
+
// @fixed
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"core-imports.js","sourceRoot":"","sources":["../../src/lib/core-imports.ts"],"names":[],"mappings":";;;AAAA,0BAA4B;AA6F1B,cAAC;AA5FH,qBAAuB;AA6FrB,cAAC;AA5FH,+BAAiC;AA6F/B,wBAAM;AA3FR,kBAAkB;AAClB,2BAA6B;AAqG3B,oBAAI;AApGN,uBAAyB;AAwGvB,gBAAE;AAvGJ,6CAA+C;AAwG7C,sCAAa;AAvGf,2BAA6B;AAwG3B,oBAAI;AAvGN,6BAA+B;AAuGvB,sBAAK;AAtGb,yBAA2B;AAwGzB,kBAAG;AAvGL,+BAA0B;AAwFxB,gBAxFK,eAAK,CAwF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C,CAAC;KACV;IAED,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAE7B,sCAAsC;IACtC,kCAAkC;IAClC,IAAI;IACJ,YAAY;AACd,CAAC;AAkDC,8CAAiB;AAanB;;;;;;;;;;;;;;;;;;EAkBE"}
|
File without changes
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"core-models.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"core-models.js","sourceRoot":"","sources":["../../src/lib/core-models.ts"],"names":[],"mappings":""}
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers-isomorphic.js","sourceRoot":"","sources":["../../src/lib/helpers-isomorphic.ts"],"names":[],"mappings":";;;AACA,iCAAkC;AAElC;IAAA;QACS,oBAAe,GAAG,KAAK,CAAC;QAC/B,kBAAkB;QACV,cAAS,GAAG,KAAK,CAAC;IAoC5B,CAAC;IAnCC,wCAAY,GAAZ;QACE,eAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,sBAAI,wCAAS;QADb,YAAY;aACZ;YACE,kBAAkB;YAClB,IAAI,eAAO,CAAC,SAAS,EAAE;gBACrB,OAAO,KAAK,CAAC;aACd;YACD,YAAY;YACZ,OAAO,eAAO,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;QACzF,CAAC;;;OAAA;IACD,sBAAI,qCAAM;aAAV;YACE,kBAAkB;YAClB,IAAI,eAAO,CAAC,SAAS,EAAE;gBACrB,OAAO,IAAI,CAAC;aACb;YACD,YAAY;YACZ,OAAO,eAAO,CAAC,eAAe,IAAI,CAAC,eAAO,CAAC,SAAS,CAAC;QACvD,CAAC;;;OAAA;IACD,mCAAO,GAAP,UAAQ,GAAU,EAAE,IAAS;QAC3B,OAAO,GAAG,CAAC,MAAM,CAAC,UAAA,CAAC;YACjB,IAAI,CAAC,YAAY,MAAM,EAAE;gBACvB,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aACpB;YACD,IAAI,CAAC,KAAK,IAAI,EAAE;gBACd,OAAO,IAAI,CAAC;aACb;YACD,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;gBAC5E,OAAO,IAAI,CAAA;aACZ;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAChB,CAAC;IAEH,wBAAC;AAAD,CAAC,AAvCD,IAuCC;AAvCY,8CAAiB;AAwC9B,YAAY"}
|
File without changes
|
@@ -45,7 +45,7 @@ var KEY = {
|
|
45
45
|
// }
|
46
46
|
// }
|
47
47
|
var HelpersMessages = /** @class */ (function (_super) {
|
48
|
-
tslib_1.__extends(HelpersMessages, _super);
|
48
|
+
(0, tslib_1.__extends)(HelpersMessages, _super);
|
49
49
|
function HelpersMessages() {
|
50
50
|
return _super !== null && _super.apply(this, arguments) || this;
|
51
51
|
}
|
@@ -246,4 +246,5 @@ var HelpersMessages = /** @class */ (function (_super) {
|
|
246
246
|
return HelpersMessages;
|
247
247
|
}(helpers_isomorphic_1.HelpersIsomorphic));
|
248
248
|
exports.HelpersMessages = HelpersMessages;
|
249
|
-
//# sourceMappingURL=helpers-messages.js.map
|
249
|
+
//# sourceMappingURL=helpers-messages.js.map
|
250
|
+
// @fixed
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers-messages.js","sourceRoot":"","sources":["../../src/lib/helpers-messages.ts"],"names":[],"mappings":";;;;AAEA,+CAAiD;AACjD,YAAY;AACZ,uCAAuC;AACvC,8CAA8C;AAC9C,iCAAkC;AAClC,2DAAyD;AACzD,iDAAgD;AAChD,6CAA2C;AAE3C,IAAM,GAAG,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CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,oBAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;SACvF;aAAM;YACL,CAAC,CAAC,MAAM,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;SACrF;QACD,YAAY;IACd,CAAC;IACH,sBAAC;AAAD,CAAC,AArLD,CAAqC,sCAAiB,GAqLrD;AArLY,0CAAe"}
|
@@ -29,7 +29,7 @@ export declare class HelpersCore extends HelpersMessages {
|
|
29
29
|
pathContainLink(p: string): boolean;
|
30
30
|
exists(folderOrFilePath: string | string[], allowUnexistedLinks?: boolean): boolean;
|
31
31
|
run(command: string, options?: RunOptions): {
|
32
|
-
sync():
|
32
|
+
sync(): string;
|
33
33
|
async(detach?: boolean): child_process.ChildProcess;
|
34
34
|
asyncAsPromise(): any;
|
35
35
|
unitlOutputContains(stdoutMsg: string | string[], stderMsg?: string | string[]): Promise<any>;
|
@@ -70,7 +70,7 @@ export declare class HelpersCore extends HelpersMessages {
|
|
70
70
|
* return absolute paths for folders inside folders
|
71
71
|
*/
|
72
72
|
foldersFrom(pathToFolder: string | string[]): string[];
|
73
|
-
linksToFoldersFrom(pathToFolder: string | string[]): string[];
|
73
|
+
linksToFoldersFrom(pathToFolder: string | string[], outputRealPath?: boolean): string[];
|
74
74
|
/**
|
75
75
|
* return absolute paths for folders inside folders
|
76
76
|
*/
|
@@ -81,6 +81,6 @@ export declare class HelpersCore extends HelpersMessages {
|
|
81
81
|
/**
|
82
82
|
* return absolute paths for folders inside folders
|
83
83
|
*/
|
84
|
-
filesFrom(pathToFolder: string | string[]): string[];
|
84
|
+
filesFrom(pathToFolder: string | string[], recrusive?: boolean): string[];
|
85
85
|
openFolderInFileExploer(folderPath: string): void;
|
86
86
|
}
|
@@ -7,7 +7,7 @@ var index_1 = require("./index");
|
|
7
7
|
var helpers_messages_1 = require("./helpers-messages");
|
8
8
|
var encoding = 'utf8';
|
9
9
|
var HelpersCore = /** @class */ (function (_super) {
|
10
|
-
tslib_1.__extends(HelpersCore, _super);
|
10
|
+
(0, tslib_1.__extends)(HelpersCore, _super);
|
11
11
|
function HelpersCore() {
|
12
12
|
var _this = _super.call(this) || this;
|
13
13
|
//#endregion
|
@@ -36,9 +36,9 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
36
36
|
index_1.Helpers.processes.forEach(function (p) {
|
37
37
|
p.kill('SIGINT');
|
38
38
|
p.kill('SIGTERM');
|
39
|
-
index_1.Helpers.log("Killing child process on "
|
39
|
+
index_1.Helpers.log("Killing child process on ".concat(p.pid));
|
40
40
|
});
|
41
|
-
index_1.Helpers.log("Killing parent on "
|
41
|
+
index_1.Helpers.log("Killing parent on ".concat(process.pid));
|
42
42
|
process.exit();
|
43
43
|
};
|
44
44
|
;
|
@@ -61,10 +61,10 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
61
61
|
for (var _i = 1; _i < arguments.length; _i++) {
|
62
62
|
firstArg[_i - 1] = arguments[_i];
|
63
63
|
}
|
64
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
64
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
65
65
|
var promisOrValue;
|
66
66
|
var _a;
|
67
|
-
return tslib_1.__generator(this, function (_b) {
|
67
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
68
68
|
if (core_imports_1._.isUndefined(fn)) {
|
69
69
|
return [2 /*return*/];
|
70
70
|
}
|
@@ -81,9 +81,9 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
81
81
|
//#endregion
|
82
82
|
//#region @backend
|
83
83
|
HelpersCore.prototype.createSymLink = function (existedFileOrFolder, destinationPath, options) {
|
84
|
-
existedFileOrFolder = core_imports_1.crossPlatformPath(existedFileOrFolder);
|
85
|
-
destinationPath = core_imports_1.crossPlatformPath(destinationPath);
|
86
|
-
index_1.Helpers.log("[tnp-helpers][create link] exited -> dest\n "
|
84
|
+
existedFileOrFolder = (0, core_imports_1.crossPlatformPath)(existedFileOrFolder);
|
85
|
+
destinationPath = (0, core_imports_1.crossPlatformPath)(destinationPath);
|
86
|
+
index_1.Helpers.log("[tnp-helpers][create link] exited -> dest\n ".concat(existedFileOrFolder, " ").concat(destinationPath));
|
87
87
|
options = options ? options : {};
|
88
88
|
if (core_imports_1._.isUndefined(options.continueWhenExistedFolderDoesntExists)) {
|
89
89
|
options.continueWhenExistedFolderDoesntExists = false;
|
@@ -106,7 +106,7 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
106
106
|
// just continue and create link to not existed folder
|
107
107
|
}
|
108
108
|
else {
|
109
|
-
index_1.Helpers.error("[helpers.createLink] target path doesn't exist: "
|
109
|
+
index_1.Helpers.error("[helpers.createLink] target path doesn't exist: ".concat(existedFileOrFolder));
|
110
110
|
}
|
111
111
|
}
|
112
112
|
/**
|
@@ -116,22 +116,22 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
116
116
|
* ln -s ./ /test/inside -> /test/inside/mysource
|
117
117
|
*/
|
118
118
|
if (link === '.' || link === './') {
|
119
|
-
link = core_imports_1.crossPlatformPath(process.cwd());
|
119
|
+
link = (0, core_imports_1.crossPlatformPath)(process.cwd());
|
120
120
|
}
|
121
121
|
if (!core_imports_1.path.isAbsolute(link)) {
|
122
|
-
link = core_imports_1.crossPlatformPath(core_imports_1.path.join(core_imports_1.crossPlatformPath(process.cwd()), link));
|
122
|
+
link = (0, core_imports_1.crossPlatformPath)(core_imports_1.path.join((0, core_imports_1.crossPlatformPath)(process.cwd()), link));
|
123
123
|
}
|
124
124
|
if (!core_imports_1.path.isAbsolute(target)) {
|
125
|
-
target = core_imports_1.crossPlatformPath(core_imports_1.path.join(core_imports_1.crossPlatformPath(process.cwd()), target));
|
125
|
+
target = (0, core_imports_1.crossPlatformPath)(core_imports_1.path.join((0, core_imports_1.crossPlatformPath)(process.cwd()), target));
|
126
126
|
}
|
127
127
|
if (link.endsWith('/')) {
|
128
|
-
link = core_imports_1.crossPlatformPath(core_imports_1.path.join(link, core_imports_1.path.basename(target)));
|
128
|
+
link = (0, core_imports_1.crossPlatformPath)(core_imports_1.path.join(link, core_imports_1.path.basename(target)));
|
129
129
|
}
|
130
130
|
if (!core_imports_1.fse.existsSync(core_imports_1.path.dirname(link))) {
|
131
131
|
index_1.Helpers.mkdirp(core_imports_1.path.dirname(link));
|
132
132
|
}
|
133
|
-
var resolvedLink = core_imports_1.crossPlatformPath(core_imports_1.path.resolve(link));
|
134
|
-
var resolvedTarget = core_imports_1.crossPlatformPath(core_imports_1.path.resolve(target));
|
133
|
+
var resolvedLink = (0, core_imports_1.crossPlatformPath)(core_imports_1.path.resolve(link));
|
134
|
+
var resolvedTarget = (0, core_imports_1.crossPlatformPath)(core_imports_1.path.resolve(target));
|
135
135
|
var targetIsFile = index_1.Helpers.isFile(resolvedTarget);
|
136
136
|
if (!speedUpProcess) {
|
137
137
|
var exactSameLocations = (resolvedLink === resolvedTarget);
|
@@ -163,30 +163,38 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
163
163
|
var targetContainerLink = index_1.Helpers.pathContainLink(resolvedTarget);
|
164
164
|
if ((!linkContainerLink && targetContainerLink)
|
165
165
|
|| (linkContainerLink && !targetContainerLink)) {
|
166
|
-
index_1.Helpers.warn("[createSymLink] Trying to override same file with link to itself:\n "
|
166
|
+
index_1.Helpers.warn("[createSymLink] Trying to override same file with link to itself:\n ".concat(resolvedLink, "\n to\n ").concat(resolvedTarget, "\n "));
|
167
167
|
return;
|
168
168
|
}
|
169
169
|
}
|
170
|
-
|
170
|
+
if (index_1.Helpers.exists(link)) {
|
171
|
+
core_imports_1.rimraf.sync(link);
|
172
|
+
}
|
173
|
+
}
|
174
|
+
if (index_1.Helpers.isFile(core_imports_1.path.dirname(link))) {
|
175
|
+
core_imports_1.fse.unlinkSync(core_imports_1.path.dirname(link));
|
176
|
+
}
|
177
|
+
if (!index_1.Helpers.exists(core_imports_1.path.dirname(link))) {
|
178
|
+
index_1.Helpers.mkdirp(core_imports_1.path.dirname(link));
|
171
179
|
}
|
172
180
|
if (process.platform === 'win32') {
|
173
181
|
if (index_1.Helpers.isLink(target)) {
|
174
182
|
index_1.Helpers.info("FIXING TARGET FOR WINDOWS");
|
175
|
-
target = core_imports_1.crossPlatformPath(core_imports_1.fse.realpathSync(target));
|
183
|
+
target = (0, core_imports_1.crossPlatformPath)(core_imports_1.fse.realpathSync(target));
|
176
184
|
// TODO QUICK_FIX on windows you can't create link to link
|
177
185
|
}
|
178
186
|
target = core_imports_1.path.win32.normalize(target).replace(/\\$/, '');
|
179
187
|
link = core_imports_1.path.win32.normalize(link).replace(/\\$/, '');
|
180
188
|
// const winLinkCommand = `cmd /c "mklink /D ${link} ${target}"`;
|
181
189
|
// const winLinkCommand = `export MSYS=winsymlinks:nativestrict && ln -s ${target} ${link}`;
|
182
|
-
var winLinkCommand = "mklink "
|
183
|
-
index_1.Helpers.log("windows link: lnk "
|
190
|
+
var winLinkCommand = "mklink ".concat(windowsHardLink ? '/D' : (targetIsFile ? '/H' : '/j'), " \"").concat(link, "\" \"").concat(target, "\"");
|
191
|
+
index_1.Helpers.log("windows link: lnk ".concat(target, " ").concat(link, "\n\n \"").concat(winLinkCommand, "'\n "));
|
184
192
|
try {
|
185
193
|
index_1.Helpers.run(winLinkCommand, { biggerBuffer: false }).sync();
|
186
194
|
}
|
187
195
|
catch (error) {
|
188
196
|
index_1.Helpers.error(error, true, false);
|
189
|
-
index_1.Helpers.error("\n command: \""
|
197
|
+
index_1.Helpers.error("\n command: \"".concat(winLinkCommand, "\"\n [tnp-helpers] windows link error\n target: \"").concat(target, "\"\n link: \"").concat(link, "\"\n command: \"").concat(winLinkCommand, "\"\n "), true, false);
|
190
198
|
}
|
191
199
|
}
|
192
200
|
else {
|
@@ -200,7 +208,7 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
200
208
|
folderPath = core_imports_1.path.join.apply(core_imports_1.path, folderPath);
|
201
209
|
}
|
202
210
|
if (!core_imports_1.path.isAbsolute(folderPath)) {
|
203
|
-
index_1.Helpers.warn("[helpers][mkdirp] Path is not absolute, abort "
|
211
|
+
index_1.Helpers.warn("[helpers][mkdirp] Path is not absolute, abort ".concat(folderPath), true);
|
204
212
|
return;
|
205
213
|
}
|
206
214
|
if (core_imports_1._.isString(folderPath) && folderPath.startsWith('/tmp ') && core_imports_1.os.platform() === 'darwin') {
|
@@ -208,7 +216,7 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
208
216
|
folderPath = folderPath.replace("/tmp/", '/private/tmp/');
|
209
217
|
}
|
210
218
|
if (core_imports_1.fse.existsSync(folderPath)) {
|
211
|
-
index_1.Helpers.warn("[helpers][mkdirp] folder path already exists: "
|
219
|
+
index_1.Helpers.warn("[helpers][mkdirp] folder path already exists: ".concat(folderPath), false);
|
212
220
|
}
|
213
221
|
else {
|
214
222
|
core_imports_1.fse.mkdirpSync(folderPath);
|
@@ -258,7 +266,7 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
258
266
|
HelpersCore.prototype.pathContainLink = function (p) {
|
259
267
|
var previous;
|
260
268
|
while (true) {
|
261
|
-
p = core_imports_1.crossPlatformPath(core_imports_1.path.dirname(p));
|
269
|
+
p = (0, core_imports_1.crossPlatformPath)(core_imports_1.path.dirname(p));
|
262
270
|
if (p === previous) {
|
263
271
|
return false;
|
264
272
|
}
|
@@ -272,23 +280,23 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
272
280
|
}
|
273
281
|
};
|
274
282
|
//#endregion
|
275
|
-
//#region @backend
|
276
283
|
HelpersCore.prototype.exists = function (folderOrFilePath, allowUnexistedLinks) {
|
277
284
|
if (allowUnexistedLinks === void 0) { allowUnexistedLinks = false; }
|
285
|
+
//#region @backendFunc
|
278
286
|
if (core_imports_1._.isArray(folderOrFilePath)) {
|
279
287
|
folderOrFilePath = core_imports_1.path.join.apply(core_imports_1.path, folderOrFilePath);
|
280
288
|
}
|
281
289
|
if (!folderOrFilePath) {
|
282
|
-
index_1.Helpers.warn("[helpers][exists] Path is not a string, abort.. \""
|
290
|
+
index_1.Helpers.warn("[helpers][exists] Path is not a string, abort.. \"".concat(folderOrFilePath, "\""), true);
|
283
291
|
return false;
|
284
292
|
}
|
285
293
|
if (!core_imports_1.path.isAbsolute(folderOrFilePath)) {
|
286
|
-
index_1.Helpers.warn("
|
294
|
+
index_1.Helpers.warn("\n\n ".concat(folderOrFilePath, "\n\n "), true);
|
287
295
|
return false;
|
288
296
|
}
|
289
297
|
return core_imports_1.fse.existsSync(folderOrFilePath);
|
298
|
+
//#endregion
|
290
299
|
};
|
291
|
-
//#endregion
|
292
300
|
HelpersCore.prototype.run = function (command, options) {
|
293
301
|
//#region @backend
|
294
302
|
if (!options)
|
@@ -298,7 +306,7 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
298
306
|
if (options.biggerBuffer === undefined)
|
299
307
|
options.biggerBuffer = false;
|
300
308
|
if (options.cwd === undefined)
|
301
|
-
options.cwd = core_imports_1.crossPlatformPath(process.cwd());
|
309
|
+
options.cwd = (0, core_imports_1.crossPlatformPath)(process.cwd());
|
302
310
|
if (!core_imports_1._.isString(command)) {
|
303
311
|
index_1.Helpers.error("[tnp-helper] command is not a string");
|
304
312
|
}
|
@@ -320,7 +328,6 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
320
328
|
// }
|
321
329
|
}
|
322
330
|
return index_1.Helpers.runSyncIn(command, options);
|
323
|
-
4;
|
324
331
|
},
|
325
332
|
async: function (detach) {
|
326
333
|
if (detach === void 0) { detach = false; }
|
@@ -360,7 +367,7 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
360
367
|
var proc = index_1.Helpers.runAsyncIn(command, options);
|
361
368
|
proc.stderr.on('data', function (message) {
|
362
369
|
var data = message.toString().trim();
|
363
|
-
if (!isResolved) {
|
370
|
+
if (!isResolved && core_imports_1._.isArray(stderMsg)) {
|
364
371
|
for (var index = 0; index < stderMsg.length; index++) {
|
365
372
|
var rejectm = stderMsg[index];
|
366
373
|
if ((data.search(rejectm) !== -1)) {
|
@@ -386,7 +393,7 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
386
393
|
}
|
387
394
|
}
|
388
395
|
}
|
389
|
-
if (!isResolved) {
|
396
|
+
if (!isResolved && core_imports_1._.isArray(stderMsg)) {
|
390
397
|
for (var index = 0; index < stderMsg.length; index++) {
|
391
398
|
var rejectm = stderMsg[index];
|
392
399
|
if ((data.search(rejectm) !== -1)) {
|
@@ -452,9 +459,9 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
452
459
|
if (detach) {
|
453
460
|
var cmd = core_imports_1._.first(command.split(' '));
|
454
461
|
var argsForCmd = command.split(' ').slice(1);
|
455
|
-
console.log("cmd: \""
|
462
|
+
console.log("cmd: \"".concat(cmd, "\", args: \"").concat(argsForCmd.join(' '), "\""));
|
456
463
|
if (process.platform === 'win32') {
|
457
|
-
proc = core_imports_1.spawn(cmd, argsForCmd, { cwd: cwd, detached: true });
|
464
|
+
proc = (0, core_imports_1.spawn)(cmd, argsForCmd, { cwd: cwd, detached: true });
|
458
465
|
// proc = child_process.spawn(cmd, argsForCmd, {
|
459
466
|
// cwd,
|
460
467
|
// detached: true,
|
@@ -469,12 +476,12 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
469
476
|
else {
|
470
477
|
proc = core_imports_1.child_process.spawn(cmd, argsForCmd, { cwd: cwd, detached: true });
|
471
478
|
}
|
472
|
-
console.log("\n\n DETACHED PROCESS IS WORKING ON PID: "
|
479
|
+
console.log("\n\n DETACHED PROCESS IS WORKING ON PID: ".concat(proc.pid, "\n\n "));
|
473
480
|
// proc = child.exec(`${command} &`, { cwd, maxBuffer, });
|
474
481
|
}
|
475
482
|
else {
|
476
483
|
// Helpers.log(`Command to execture: ${command}`)
|
477
|
-
var env = tslib_1.__assign(tslib_1.__assign({}, process.env), { FORCE_COLOR: '1' });
|
484
|
+
var env = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, process.env), { FORCE_COLOR: '1' });
|
478
485
|
proc = core_imports_1.child_process.exec(command, { cwd: cwd, maxBuffer: maxBuffer, env: env });
|
479
486
|
}
|
480
487
|
return index_1.Helpers.logProc(proc, detach ? true : output, detach ? void 0 : stdio, outputLineReplace, options.prefix, extractFromLine);
|
@@ -577,10 +584,10 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
577
584
|
//#region @backend
|
578
585
|
HelpersCore.prototype.checkProcess = function (dirPath, command) {
|
579
586
|
if (!core_imports_1.fse.existsSync(dirPath)) {
|
580
|
-
index_1.Helpers.error("\nPath for process cwd doesn't exist: "
|
587
|
+
index_1.Helpers.error("\nPath for process cwd doesn't exist: ".concat(dirPath, "\ncommand: ").concat(command, "\n"));
|
581
588
|
}
|
582
589
|
if (!command) {
|
583
|
-
index_1.Helpers.error("Bad command: "
|
590
|
+
index_1.Helpers.error("Bad command: ".concat(command));
|
584
591
|
}
|
585
592
|
};
|
586
593
|
//#endregion
|
@@ -608,7 +615,7 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
608
615
|
}
|
609
616
|
}
|
610
617
|
}
|
611
|
-
return prefix
|
618
|
+
return "".concat(prefix, " ").concat(singleLine);
|
612
619
|
}).join('\n');
|
613
620
|
}
|
614
621
|
return data;
|
@@ -699,31 +706,31 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
699
706
|
HelpersCore.prototype.compilationWrapper = function (fn, taskName, executionType) {
|
700
707
|
if (taskName === void 0) { taskName = 'Task'; }
|
701
708
|
if (executionType === void 0) { executionType = 'Compilation of'; }
|
702
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
709
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
703
710
|
function currentDate() {
|
704
|
-
return "["
|
711
|
+
return "[".concat((0, core_imports_1.dateformat)(new Date(), 'HH:MM:ss'), "]");
|
705
712
|
}
|
706
713
|
var error_1;
|
707
|
-
return tslib_1.__generator(this, function (_a) {
|
714
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
708
715
|
switch (_a.label) {
|
709
716
|
case 0:
|
710
717
|
if (!fn || !core_imports_1._.isFunction(fn)) {
|
711
|
-
index_1.Helpers.error(executionType
|
718
|
+
index_1.Helpers.error("".concat(executionType, " wrapper: \"").concat(fn, "\" is not a function."));
|
712
719
|
process.exit(1);
|
713
720
|
}
|
714
721
|
_a.label = 1;
|
715
722
|
case 1:
|
716
723
|
_a.trys.push([1, 3, , 4]);
|
717
|
-
index_1.Helpers.log(currentDate()
|
724
|
+
index_1.Helpers.log("".concat(currentDate(), " ").concat(executionType, " \"").concat(taskName, "\" Started.."));
|
718
725
|
return [4 /*yield*/, index_1.Helpers.runSyncOrAsync(fn)];
|
719
726
|
case 2:
|
720
727
|
_a.sent();
|
721
|
-
index_1.Helpers.log(currentDate()
|
728
|
+
index_1.Helpers.log("".concat(currentDate(), " ").concat(executionType, " \"").concat(taskName, "\" Done\u2713"));
|
722
729
|
return [3 /*break*/, 4];
|
723
730
|
case 3:
|
724
731
|
error_1 = _a.sent();
|
725
|
-
index_1.Helpers.
|
726
|
-
index_1.Helpers.log(currentDate()
|
732
|
+
index_1.Helpers.error(core_imports_1.chalk.red(error_1), false, true);
|
733
|
+
index_1.Helpers.log("".concat(currentDate(), " ").concat(executionType, " ").concat(taskName, " ERROR"));
|
727
734
|
process.exit(1);
|
728
735
|
return [3 /*break*/, 4];
|
729
736
|
case 4: return [2 /*return*/];
|
@@ -742,6 +749,10 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
742
749
|
absoluteFilePath = core_imports_1.path.join.apply(this, absoluteFilePath);
|
743
750
|
}
|
744
751
|
absoluteFilePath = absoluteFilePath;
|
752
|
+
if (index_1.Helpers.isLink(absoluteFilePath)) {
|
753
|
+
index_1.Helpers.warn("WRITTING JSON into real path");
|
754
|
+
absoluteFilePath = core_imports_1.fse.realpathSync(absoluteFilePath);
|
755
|
+
}
|
745
756
|
if (!core_imports_1.fse.existsSync(core_imports_1.path.dirname(absoluteFilePath))) {
|
746
757
|
index_1.Helpers.mkdirp(core_imports_1.path.dirname(absoluteFilePath));
|
747
758
|
}
|
@@ -800,7 +811,8 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
800
811
|
.map(function (f) { return core_imports_1.path.join(pathToFolder, f); })
|
801
812
|
.filter(function (f) { return core_imports_1.fse.lstatSync(f).isDirectory(); });
|
802
813
|
};
|
803
|
-
HelpersCore.prototype.linksToFoldersFrom = function (pathToFolder) {
|
814
|
+
HelpersCore.prototype.linksToFoldersFrom = function (pathToFolder, outputRealPath) {
|
815
|
+
if (outputRealPath === void 0) { outputRealPath = false; }
|
804
816
|
if (core_imports_1._.isArray(pathToFolder)) {
|
805
817
|
pathToFolder = core_imports_1.path.join.apply(core_imports_1.path, pathToFolder);
|
806
818
|
}
|
@@ -809,11 +821,19 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
809
821
|
}
|
810
822
|
return core_imports_1.fse.readdirSync(pathToFolder)
|
811
823
|
.map(function (f) { return core_imports_1.path.join(pathToFolder, f); })
|
812
|
-
.filter(function (f) { return core_imports_1.fse.lstatSync(f).isSymbolicLink(); })
|
813
|
-
.
|
824
|
+
.filter(function (f) { return core_imports_1.fse.existsSync(f) && core_imports_1.fse.lstatSync(f).isSymbolicLink(); })
|
825
|
+
.map(function (f) {
|
814
826
|
var realPath = core_imports_1.fse.realpathSync(f);
|
815
|
-
|
816
|
-
|
827
|
+
var isFolder = index_1.Helpers.isFolder(realPath);
|
828
|
+
if (isFolder) {
|
829
|
+
if (outputRealPath) {
|
830
|
+
return realPath;
|
831
|
+
}
|
832
|
+
else {
|
833
|
+
return f;
|
834
|
+
}
|
835
|
+
}
|
836
|
+
}).filter(function (f) { return !!f; });
|
817
837
|
};
|
818
838
|
//#endregion
|
819
839
|
//#region @backend
|
@@ -859,13 +879,32 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
859
879
|
/**
|
860
880
|
* return absolute paths for folders inside folders
|
861
881
|
*/
|
862
|
-
HelpersCore.prototype.filesFrom = function (pathToFolder) {
|
882
|
+
HelpersCore.prototype.filesFrom = function (pathToFolder, recrusive) {
|
883
|
+
var _this = this;
|
884
|
+
if (recrusive === void 0) { recrusive = false; }
|
863
885
|
if (core_imports_1._.isArray(pathToFolder)) {
|
864
886
|
pathToFolder = core_imports_1.path.join.apply(core_imports_1.path, pathToFolder);
|
865
887
|
}
|
866
888
|
if (!index_1.Helpers.exists(pathToFolder)) {
|
867
889
|
return [];
|
868
890
|
}
|
891
|
+
if (recrusive) {
|
892
|
+
var all = core_imports_1.fse.readdirSync(pathToFolder)
|
893
|
+
.map(function (f) { return core_imports_1.path.join(pathToFolder, f); });
|
894
|
+
var folders_1 = [];
|
895
|
+
var files = all.filter(function (f) {
|
896
|
+
if (core_imports_1.fse.lstatSync(f).isDirectory()) {
|
897
|
+
folders_1.push(f);
|
898
|
+
return false;
|
899
|
+
}
|
900
|
+
return true;
|
901
|
+
});
|
902
|
+
return (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], files, true), folders_1
|
903
|
+
.map(function (f) { return _this.filesFrom(f, recrusive); })
|
904
|
+
.reduce(function (a, b) {
|
905
|
+
return a.concat(b);
|
906
|
+
}, []), true);
|
907
|
+
}
|
869
908
|
return core_imports_1.fse.readdirSync(pathToFolder)
|
870
909
|
.map(function (f) { return core_imports_1.path.join(pathToFolder, f); })
|
871
910
|
.filter(function (f) { return !core_imports_1.fse.lstatSync(f).isDirectory(); });
|
@@ -874,27 +913,28 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
874
913
|
//#region @backend
|
875
914
|
HelpersCore.prototype.openFolderInFileExploer = function (folderPath) {
|
876
915
|
if (process.platform === 'win32') {
|
877
|
-
folderPath = core_imports_1.win32Path(folderPath);
|
916
|
+
folderPath = (0, core_imports_1.win32Path)(folderPath);
|
878
917
|
}
|
879
918
|
try {
|
880
|
-
index_1.Helpers.info("Opening path in file explorer: \""
|
919
|
+
index_1.Helpers.info("Opening path in file explorer: \"".concat(folderPath, "\""));
|
881
920
|
if (process.platform === 'win32') {
|
882
|
-
index_1.Helpers.run("explorer "
|
921
|
+
index_1.Helpers.run("explorer ".concat(folderPath)).sync();
|
883
922
|
return;
|
884
923
|
}
|
885
924
|
if (process.platform === 'darwin') {
|
886
|
-
index_1.Helpers.run("open "
|
925
|
+
index_1.Helpers.run("open ".concat(folderPath)).sync();
|
887
926
|
return;
|
888
927
|
}
|
889
|
-
index_1.Helpers.run("xdg-open "
|
928
|
+
index_1.Helpers.run("xdg-open ".concat(folderPath)).sync();
|
890
929
|
}
|
891
930
|
catch (error) {
|
892
931
|
if (process.platform !== 'win32') { // TODO QUICK fix explorer with path is triggering errro
|
893
|
-
index_1.Helpers.error("Not able to open in file explorer: \""
|
932
|
+
index_1.Helpers.error("Not able to open in file explorer: \"".concat(folderPath, "\""), false, true);
|
894
933
|
}
|
895
934
|
}
|
896
935
|
};
|
897
936
|
return HelpersCore;
|
898
937
|
}(helpers_messages_1.HelpersMessages));
|
899
938
|
exports.HelpersCore = HelpersCore;
|
900
|
-
//# sourceMappingURL=helpers.js.map
|
939
|
+
//# sourceMappingURL=helpers.js.map
|
940
|
+
// @fixed
|