tnp-core 1.0.23 → 1.0.27
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/browser/core-config.js +6 -0
- package/browser/core-config.js.map +1 -0
- package/browser/core-imports.js +13 -0
- package/browser/core-imports.js.map +1 -0
- package/browser/core-models.js +2 -0
- package/browser/core-models.js.map +1 -0
- package/browser/helpers-isomorphic.js +28 -0
- package/browser/helpers-isomorphic.js.map +1 -0
- package/browser/helpers-messages.js +67 -0
- package/browser/helpers-messages.js.map +1 -0
- package/browser/helpers.js +65 -0
- package/browser/helpers.js.map +1 -0
- package/browser/index.js +8 -0
- package/browser/index.js.map +1 -0
- package/browser/progress-data.js +46 -0
- package/browser/progress-data.js.map +1 -0
- package/browser/public-api.js +8 -0
- package/browser/public-api.js.map +1 -0
- package/client/core-config.js +6 -0
- package/client/core-config.js.map +1 -0
- package/client/core-imports.js +13 -0
- package/client/core-imports.js.map +1 -0
- package/client/core-models.js +2 -0
- package/client/core-models.js.map +1 -0
- package/client/helpers-isomorphic.js +28 -0
- package/client/helpers-isomorphic.js.map +1 -0
- package/client/helpers-messages.js +67 -0
- package/client/helpers-messages.js.map +1 -0
- package/client/helpers.js +65 -0
- package/client/helpers.js.map +1 -0
- package/client/index.js +8 -0
- package/client/index.js.map +1 -0
- package/client/package.json +28 -10
- package/client/progress-data.js +46 -0
- package/client/progress-data.js.map +1 -0
- package/client/public-api.js +8 -0
- package/client/public-api.js.map +1 -0
- package/package.json +15 -15
- package/package.json_devDependencies.json +4 -5
- package/package.json_tnp.json +1 -0
- package/tmp-environment.json +11 -10
- package/browser/README.md +0 -24
- package/browser/esm2015/core-config.js +0 -6
- package/browser/esm2015/core-config.ngsummary.json +0 -1
- package/browser/esm2015/core-imports.js +0 -13
- package/browser/esm2015/core-imports.ngsummary.json +0 -1
- package/browser/esm2015/core-models.js +0 -2
- package/browser/esm2015/core-models.ngsummary.json +0 -1
- package/browser/esm2015/helpers-isomorphic.js +0 -28
- package/browser/esm2015/helpers-isomorphic.ngsummary.json +0 -1
- package/browser/esm2015/helpers-messages.js +0 -67
- package/browser/esm2015/helpers-messages.ngsummary.json +0 -1
- package/browser/esm2015/helpers.js +0 -65
- package/browser/esm2015/helpers.ngsummary.json +0 -1
- package/browser/esm2015/index.js +0 -8
- package/browser/esm2015/index.ngsummary.json +0 -1
- package/browser/esm2015/progress-data.js +0 -46
- package/browser/esm2015/progress-data.ngsummary.json +0 -1
- package/browser/esm2015/public-api.js +0 -8
- package/browser/esm2015/public-api.ngsummary.json +0 -1
- package/browser/esm2015/tnp-core.js +0 -7
- package/browser/esm2015/tnp-core.ngsummary.json +0 -1
- package/browser/esm5/core-config.js +0 -6
- package/browser/esm5/core-imports.js +0 -13
- package/browser/esm5/core-models.js +0 -2
- package/browser/esm5/helpers-isomorphic.js +0 -38
- package/browser/esm5/helpers-messages.js +0 -79
- package/browser/esm5/helpers.js +0 -80
- package/browser/esm5/index.js +0 -8
- package/browser/esm5/progress-data.js +0 -50
- package/browser/esm5/public-api.js +0 -8
- package/browser/esm5/tnp-core.js +0 -7
- package/browser/package.json +0 -13
- package/browser/tnp-core.d.ts +0 -6
- package/browser/tnp-core.metadata.json +0 -1
- package/client/README.md +0 -24
- package/client/esm2015/core-config.js +0 -6
- package/client/esm2015/core-config.ngsummary.json +0 -1
- package/client/esm2015/core-imports.js +0 -13
- package/client/esm2015/core-imports.ngsummary.json +0 -1
- package/client/esm2015/core-models.js +0 -2
- package/client/esm2015/core-models.ngsummary.json +0 -1
- package/client/esm2015/helpers-isomorphic.js +0 -28
- package/client/esm2015/helpers-isomorphic.ngsummary.json +0 -1
- package/client/esm2015/helpers-messages.js +0 -67
- package/client/esm2015/helpers-messages.ngsummary.json +0 -1
- package/client/esm2015/helpers.js +0 -65
- package/client/esm2015/helpers.ngsummary.json +0 -1
- package/client/esm2015/index.js +0 -8
- package/client/esm2015/index.ngsummary.json +0 -1
- package/client/esm2015/progress-data.js +0 -46
- package/client/esm2015/progress-data.ngsummary.json +0 -1
- package/client/esm2015/public-api.js +0 -8
- package/client/esm2015/public-api.ngsummary.json +0 -1
- package/client/esm2015/tnp-core.js +0 -7
- package/client/esm2015/tnp-core.ngsummary.json +0 -1
- package/client/esm5/core-config.js +0 -6
- package/client/esm5/core-imports.js +0 -13
- package/client/esm5/core-models.js +0 -2
- package/client/esm5/helpers-isomorphic.js +0 -38
- package/client/esm5/helpers-messages.js +0 -79
- package/client/esm5/helpers.js +0 -80
- package/client/esm5/index.js +0 -8
- package/client/esm5/progress-data.js +0 -50
- package/client/esm5/public-api.js +0 -8
- package/client/esm5/tnp-core.js +0 -7
- package/client/tnp-core.d.ts +0 -6
- package/client/tnp-core.metadata.json +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"core-config.js","sourceRoot":"","sources":["../../tmp-src-bundle/core-config.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE;QACP,oBAAoB,EAAE,sBAAsB;KAC7C;CACF,CAAA"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import * as _ from 'lodash';
|
2
|
+
import * as q from 'q';
|
3
|
+
// export { Helpers as CoreHelpers } from './core-helpers';
|
4
|
+
export { _, q, }; /* import { _, path, fse, rimraf, crossPlatformPath, os, child_process, http, https, rimraf, net, } from 'tnp-core';
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
import { _ } from 'tnp-core';
|
9
|
+
|
10
|
+
import { } from 'tnp-core';
|
11
|
+
|
12
|
+
*/
|
13
|
+
//# sourceMappingURL=core-imports.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"core-imports.js","sourceRoot":"","sources":["../../tmp-src-bundle/core-imports.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC;AAIvB,4DAA4D;AAE5D,OAAO,EAAI,CAAC,EAAI,CAAC,GAAI,CAAC,CAAE;;;;;;;;EAQtB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"core-models.js","sourceRoot":"","sources":["../../tmp-src-bundle/core-models.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Helpers } from './index';
|
2
|
+
export class HelpersIsomorphic {
|
3
|
+
constructor() {
|
4
|
+
this.simulateBrowser = false;
|
5
|
+
}
|
6
|
+
get isBrowser() {
|
7
|
+
return Helpers.simulateBrowser || !!(typeof window !== 'undefined' && window.document);
|
8
|
+
}
|
9
|
+
get isNode() {
|
10
|
+
return Helpers.simulateBrowser || !Helpers.isBrowser;
|
11
|
+
}
|
12
|
+
contain(arr, item) {
|
13
|
+
return arr.filter(l => {
|
14
|
+
if (l instanceof RegExp) {
|
15
|
+
return l.test(item);
|
16
|
+
}
|
17
|
+
if (l === item) {
|
18
|
+
return true;
|
19
|
+
}
|
20
|
+
if ((item.match && typeof item.match === 'function') ? item.match(l) : false) {
|
21
|
+
return true;
|
22
|
+
}
|
23
|
+
return false;
|
24
|
+
}).length > 0;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
//#endregion
|
28
|
+
//# sourceMappingURL=helpers-isomorphic.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers-isomorphic.js","sourceRoot":"","sources":["../../tmp-src-bundle/helpers-isomorphic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,OAAO,iBAAiB;IAA9B;QACS,oBAAe,GAAG,KAAK,CAAC;IAyBjC,CAAC;IAvBC,IAAI,SAAS;QAEX,OAAO,OAAO,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;IACzF,CAAC;IACD,IAAI,MAAM;QAER,OAAO,OAAO,CAAC,eAAe,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACvD,CAAC;IACD,OAAO,CAAC,GAAU,EAAE,IAAS;QAC3B,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;YACpB,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;CAEF;AACD,YAAY"}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
// import { config } from 'tnp-config/browser';
|
2
|
+
// import { PROGRESS_DATA } from 'tnp-models/browser';
|
3
|
+
import { Helpers } from './index';
|
4
|
+
import { HelpersIsomorphic } from './helpers-isomorphic';
|
5
|
+
const KEY = {
|
6
|
+
LAST_ERROR: Symbol(),
|
7
|
+
LAST_INFO: Symbol(),
|
8
|
+
LAST_WARN: Symbol(),
|
9
|
+
LAST_LOG: Symbol(),
|
10
|
+
};
|
11
|
+
// export class Log {
|
12
|
+
// private static _instance: Log;
|
13
|
+
// public Instance() {
|
14
|
+
// if (!Log._instance) {
|
15
|
+
// Log._instance = new Log();
|
16
|
+
// }
|
17
|
+
// return Log._instance;
|
18
|
+
// }
|
19
|
+
// create(name: string, level?: Level) {
|
20
|
+
// if (level === void 0) {
|
21
|
+
// level = Level.DATA;
|
22
|
+
// }
|
23
|
+
// return {
|
24
|
+
// d(details: string, debugLevel?: number) {
|
25
|
+
// return Helpers.log(`[${name}] ${details}`, debugLevel)
|
26
|
+
// },
|
27
|
+
// i(details: string) {
|
28
|
+
// return Helpers.info(`[${name}] ${details}`)
|
29
|
+
// },
|
30
|
+
// w(details: string, noExit = false, noTrace = false) {
|
31
|
+
// return Helpers.error(`[${name}] ${details}`, noExit, noTrace);
|
32
|
+
// },
|
33
|
+
// er(details: string, ) {
|
34
|
+
// return Helpers.info(`[${name}] ${details}`)
|
35
|
+
// },
|
36
|
+
// }
|
37
|
+
// }
|
38
|
+
// }
|
39
|
+
export class HelpersMessages extends HelpersIsomorphic {
|
40
|
+
msgCacheClear() {
|
41
|
+
}
|
42
|
+
error(details, noExit = false, noTrace = false) {
|
43
|
+
if (Helpers.isBrowser) {
|
44
|
+
console.error(details);
|
45
|
+
return;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
info(details, repeatable = false) {
|
49
|
+
if (Helpers.isBrowser) {
|
50
|
+
console.info(details);
|
51
|
+
return;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
log(details, debugLevel = 0) {
|
55
|
+
if (Helpers.isBrowser) {
|
56
|
+
console.log(details);
|
57
|
+
return;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
warn(details, trace = false) {
|
61
|
+
if (Helpers.isBrowser) {
|
62
|
+
console.warn(details);
|
63
|
+
return;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
//# sourceMappingURL=helpers-messages.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers-messages.js","sourceRoot":"","sources":["../../tmp-src-bundle/helpers-messages.ts"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,sDAAsD;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,MAAM,GAAG,GAAG;IACV,UAAU,EAAE,MAAM,EAAE;IACpB,SAAS,EAAE,MAAM,EAAE;IACnB,SAAS,EAAE,MAAM,EAAE;IACnB,QAAQ,EAAE,MAAM,EAAE;CACnB,CAAA;AAED,qBAAqB;AACrB,mCAAmC;AACnC,wBAAwB;AACxB,4BAA4B;AAC5B,mCAAmC;AACnC,QAAQ;AACR,4BAA4B;AAC5B,MAAM;AAEN,0CAA0C;AAC1C,8BAA8B;AAC9B,4BAA4B;AAC5B,QAAQ;AACR,eAAe;AACf,kDAAkD;AAClD,iEAAiE;AACjE,WAAW;AACX,6BAA6B;AAC7B,sDAAsD;AACtD,WAAW;AAEX,8DAA8D;AAC9D,yEAAyE;AACzE,WAAW;AACX,gCAAgC;AAChC,sDAAsD;AACtD,WAAW;AACX,QAAQ;AACR,MAAM;AAEN,IAAI;AAEJ,MAAM,OAAO,eAAgB,SAAQ,iBAAiB;IAEpD,aAAa;IAEb,CAAC;IAED,KAAK,CAAC,OAAY,EAAE,MAAM,GAAG,KAAK,EAAE,OAAO,GAAG,KAAK;QACjD,IAAI,OAAO,CAAC,SAAS,EAAE;YACrB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YACtB,OAAO;SACR;IAEH,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,UAAU,GAAG,KAAK;QACtC,IAAI,OAAO,CAAC,SAAS,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,OAAO;SACR;IAEH,CAAC;IAED,GAAG,CAAC,OAAe,EAAE,UAAU,GAAG,CAAC;QACjC,IAAI,OAAO,CAAC,SAAS,EAAE;YACrB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACrB,OAAO;SACR;IAEH,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,KAAK,GAAG,KAAK;QACjC,IAAI,OAAO,CAAC,SAAS,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,OAAO;SACR;IAEH,CAAC;CACF"}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import { __awaiter } from "tslib";
|
2
|
+
import { _, } from './core-imports';
|
3
|
+
import { HelpersMessages } from './helpers-messages';
|
4
|
+
const encoding = 'utf8';
|
5
|
+
export class HelpersCore extends HelpersMessages {
|
6
|
+
constructor() {
|
7
|
+
super();
|
8
|
+
//#endregion
|
9
|
+
this.bigMaxBuffer = 2024 * 500;
|
10
|
+
}
|
11
|
+
static get InstanceCore() {
|
12
|
+
if (!HelpersCore._instanceCore) {
|
13
|
+
HelpersCore._instanceCore = new HelpersCore();
|
14
|
+
}
|
15
|
+
return HelpersCore._instanceCore;
|
16
|
+
}
|
17
|
+
removeSlashAtEnd(s) {
|
18
|
+
s = (s === null || s === void 0 ? void 0 : s.endsWith(`/`)) ? s.slice(0, s.length - 1) : s;
|
19
|
+
return s;
|
20
|
+
}
|
21
|
+
stringify(inputObject) {
|
22
|
+
// if (_.isString(inputObject)) {
|
23
|
+
// return inputObject;
|
24
|
+
// }
|
25
|
+
// if (_.isObject(inputObject)) {
|
26
|
+
// config.log(inputObject)
|
27
|
+
// Helpers.error(`[tnp-helpers] trying to stringify not a object`, false, true);
|
28
|
+
// }
|
29
|
+
return JSON.stringify(inputObject, null, 2);
|
30
|
+
}
|
31
|
+
runSyncOrAsync(fn, ...firstArg) {
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
33
|
+
if (_.isUndefined(fn)) {
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
// let wasPromise = false;
|
37
|
+
let promisOrValue = _.isArray(fn) ? fn[1][fn[0]](...firstArg) : fn(...firstArg);
|
38
|
+
if (promisOrValue instanceof Promise) {
|
39
|
+
// wasPromise = true;
|
40
|
+
promisOrValue = Promise.resolve(promisOrValue);
|
41
|
+
}
|
42
|
+
// console.log('was promis ', wasPromise)
|
43
|
+
return promisOrValue;
|
44
|
+
});
|
45
|
+
}
|
46
|
+
run(command, options) {
|
47
|
+
return {};
|
48
|
+
}
|
49
|
+
/**
|
50
|
+
* Quick fix for object values
|
51
|
+
*/
|
52
|
+
values(obj) {
|
53
|
+
if (_.isObject(obj) && !Array.isArray(obj)) {
|
54
|
+
const values = [];
|
55
|
+
for (const key in obj) {
|
56
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
57
|
+
values.push(obj[key]);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
return values;
|
61
|
+
}
|
62
|
+
return [];
|
63
|
+
}
|
64
|
+
}
|
65
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../tmp-src-bundle/helpers.ts"],"names":[],"mappings":";AAEA,OAAO,EAAI,CAAC,GAAI,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,MAAM,QAAQ,GAAG,MAAM,CAAC;AAExB,MAAM,OAAO,WAAY,SAAQ,eAAe;IAe9C;QACE,KAAK,EAAE,CAAC;QANV,YAAY;QAIH,iBAAY,GAAG,IAAI,GAAG,GAAG,CAAC;IAInC,CAAC;IAdM,MAAM,KAAK,YAAY;QAC5B,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;YAC9B,WAAW,CAAC,aAAa,GAAG,IAAI,WAAW,EAAE,CAAC;SAC/C;QACD,OAAO,WAAW,CAAC,aAAa,CAAC;IACnC,CAAC;IAWD,gBAAgB,CAAC,CAAS;QACxB,CAAC,GAAG,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,CAAC,GAAG,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,CAAC;IACX,CAAC;IAED,SAAS,CAAC,WAAgB;QACxB,iCAAiC;QACjC,wBAAwB;QACxB,IAAI;QACJ,iCAAiC;QACjC,4BAA4B;QAC5B,kFAAkF;QAClF,IAAI;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;IAEK,cAAc,CAAC,EAA+B,EAAE,GAAG,QAAe;;YACtE,IAAI,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;gBACrB,OAAO;aACR;YACD,0BAA0B;YAC1B,IAAI,aAAa,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC;YAChF,IAAI,aAAa,YAAY,OAAO,EAAE;gBACpC,qBAAqB;gBACrB,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;aAC/C;YACD,yCAAyC;YACzC,OAAO,aAAa,CAAC;QACvB,CAAC;KAAA;IAcD,GAAG,CAAC,OAAe,EACjB,OAAoB;QAGpB,OAAO,EAEN,CAAA;IACH,CAAC;IAiBD;;OAEG;IACH,MAAM,CAAC,GAAQ;QACb,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC1C,MAAM,MAAM,GAAG,EAAE,CAAC;YAClB,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;gBACrB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;oBAClD,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;iBACvB;aACF;YACD,OAAO,MAAM,CAAC;SACf;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;CAwBF"}
|
package/browser/index.js
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
export * from './core-imports';
|
2
|
+
export * from './core-models';
|
3
|
+
import { HelpersCore as Base } from './helpers';
|
4
|
+
export * from './core-config';
|
5
|
+
export * from './progress-data';
|
6
|
+
export { HelpersCore as CoreHelpers } from './helpers';
|
7
|
+
export let Helpers = Base.InstanceCore;
|
8
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tmp-src-bundle/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACvD,MAAM,CAAC,IAAI,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { _ } from './core-imports';
|
2
|
+
export class PROGRESS_DATA {
|
3
|
+
constructor() {
|
4
|
+
this.type = 'event';
|
5
|
+
}
|
6
|
+
static log(log) {
|
7
|
+
}
|
8
|
+
static resolveFrom(chunk, callbackOnFounded, checkSplit = true) {
|
9
|
+
let progress;
|
10
|
+
let res = [];
|
11
|
+
if (!_.isString(chunk)) {
|
12
|
+
return [];
|
13
|
+
}
|
14
|
+
chunk = chunk.trim();
|
15
|
+
if (checkSplit) {
|
16
|
+
const split = chunk.split(/\r\n|\n|\r/);
|
17
|
+
if (split.length > 1) {
|
18
|
+
// console.log('split founded', split)
|
19
|
+
split.forEach(s => {
|
20
|
+
res = res.concat(this.resolveFrom(s, callbackOnFounded, false));
|
21
|
+
});
|
22
|
+
return res;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
if (/\[\[\[.*\]\]\]/g.test(chunk)) {
|
26
|
+
chunk = chunk.replace(/^\[\[\[/g, '').replace(/\]\]\]$/g, '');
|
27
|
+
progress = chunk;
|
28
|
+
}
|
29
|
+
if (!_.isUndefined(progress)) {
|
30
|
+
try {
|
31
|
+
const p = JSON.parse(progress);
|
32
|
+
const single = _.merge(new PROGRESS_DATA(), p);
|
33
|
+
res = res.concat([single]);
|
34
|
+
if (_.isFunction(callbackOnFounded)) {
|
35
|
+
callbackOnFounded(single);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
catch (err) {
|
39
|
+
console.log(err);
|
40
|
+
console.error(`ProgresssBarData: fail to parse "${progress}"`);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
return res;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
//# sourceMappingURL=progress-data.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"progress-data.js","sourceRoot":"","sources":["../../tmp-src-bundle/progress-data.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAenC,MAAM,OAAO,aAAa;IAA1B;QAmDS,SAAI,GAAuB,OAAO,CAAA;IAK3C,CAAC;IAtDQ,MAAM,CAAC,GAAG,CAAC,GAAmB;IAErC,CAAC;IAGM,MAAM,CAAC,WAAW,CAAC,KAAa,EACrC,iBAAgD,EAAE,UAAU,GAAG,IAAI;QAEnE,IAAI,QAAQ,CAAC;QACb,IAAI,GAAG,GAAoB,EAAE,CAAC;QAC9B,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACtB,OAAO,EAAE,CAAC;SACX;QACD,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAErB,IAAI,UAAU,EAAE;YACd,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YACxC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBACpB,sCAAsC;gBACtC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;oBAChB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,iBAAiB,EAAE,KAAK,CAAC,CAAC,CAAC;gBAClE,CAAC,CAAC,CAAC;gBACH,OAAO,GAAG,CAAC;aACZ;SACF;QAED,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YACjC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAC9D,QAAQ,GAAG,KAAK,CAAC;SAClB;QACD,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE;YAC5B,IAAI;gBACF,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAC/B,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;gBAC/C,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;gBAC1B,IAAI,CAAC,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE;oBACnC,iBAAiB,CAAC,MAAM,CAAC,CAAC;iBAC3B;aACF;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;gBAChB,OAAO,CAAC,KAAK,CAAC,oCAAoC,QAAQ,GAAG,CAAC,CAAA;aAC/D;SACF;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CAUF"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export * from './core-imports';
|
2
|
+
export * from './core-models';
|
3
|
+
import { HelpersCore as Base } from './helpers';
|
4
|
+
export * from './core-config';
|
5
|
+
export * from './progress-data';
|
6
|
+
export { HelpersCore as CoreHelpers } from './helpers';
|
7
|
+
export let Helpers = Base.InstanceCore;
|
8
|
+
//# sourceMappingURL=public-api.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../tmp-src-bundle/public-api.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACvD,MAAM,CAAC,IAAI,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"core-config.js","sourceRoot":"","sources":["../../tmp-src-bundle/core-config.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE;QACP,oBAAoB,EAAE,sBAAsB;KAC7C;CACF,CAAA"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import * as _ from 'lodash';
|
2
|
+
import * as q from 'q';
|
3
|
+
// export { Helpers as CoreHelpers } from './core-helpers';
|
4
|
+
export { _, q, }; /* import { _, path, fse, rimraf, crossPlatformPath, os, child_process, http, https, rimraf, net, } from 'tnp-core';
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
import { _ } from 'tnp-core';
|
9
|
+
|
10
|
+
import { } from 'tnp-core';
|
11
|
+
|
12
|
+
*/
|
13
|
+
//# sourceMappingURL=core-imports.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"core-imports.js","sourceRoot":"","sources":["../../tmp-src-bundle/core-imports.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC;AAIvB,4DAA4D;AAE5D,OAAO,EAAI,CAAC,EAAI,CAAC,GAAI,CAAC,CAAE;;;;;;;;EAQtB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"core-models.js","sourceRoot":"","sources":["../../tmp-src-bundle/core-models.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Helpers } from './index';
|
2
|
+
export class HelpersIsomorphic {
|
3
|
+
constructor() {
|
4
|
+
this.simulateBrowser = false;
|
5
|
+
}
|
6
|
+
get isBrowser() {
|
7
|
+
return Helpers.simulateBrowser || !!(typeof window !== 'undefined' && window.document);
|
8
|
+
}
|
9
|
+
get isNode() {
|
10
|
+
return Helpers.simulateBrowser || !Helpers.isBrowser;
|
11
|
+
}
|
12
|
+
contain(arr, item) {
|
13
|
+
return arr.filter(l => {
|
14
|
+
if (l instanceof RegExp) {
|
15
|
+
return l.test(item);
|
16
|
+
}
|
17
|
+
if (l === item) {
|
18
|
+
return true;
|
19
|
+
}
|
20
|
+
if ((item.match && typeof item.match === 'function') ? item.match(l) : false) {
|
21
|
+
return true;
|
22
|
+
}
|
23
|
+
return false;
|
24
|
+
}).length > 0;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
//#endregion
|
28
|
+
//# sourceMappingURL=helpers-isomorphic.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers-isomorphic.js","sourceRoot":"","sources":["../../tmp-src-bundle/helpers-isomorphic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,OAAO,iBAAiB;IAA9B;QACS,oBAAe,GAAG,KAAK,CAAC;IAyBjC,CAAC;IAvBC,IAAI,SAAS;QAEX,OAAO,OAAO,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;IACzF,CAAC;IACD,IAAI,MAAM;QAER,OAAO,OAAO,CAAC,eAAe,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACvD,CAAC;IACD,OAAO,CAAC,GAAU,EAAE,IAAS;QAC3B,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;YACpB,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;CAEF;AACD,YAAY"}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
// import { config } from 'tnp-config/browser';
|
2
|
+
// import { PROGRESS_DATA } from 'tnp-models/browser';
|
3
|
+
import { Helpers } from './index';
|
4
|
+
import { HelpersIsomorphic } from './helpers-isomorphic';
|
5
|
+
const KEY = {
|
6
|
+
LAST_ERROR: Symbol(),
|
7
|
+
LAST_INFO: Symbol(),
|
8
|
+
LAST_WARN: Symbol(),
|
9
|
+
LAST_LOG: Symbol(),
|
10
|
+
};
|
11
|
+
// export class Log {
|
12
|
+
// private static _instance: Log;
|
13
|
+
// public Instance() {
|
14
|
+
// if (!Log._instance) {
|
15
|
+
// Log._instance = new Log();
|
16
|
+
// }
|
17
|
+
// return Log._instance;
|
18
|
+
// }
|
19
|
+
// create(name: string, level?: Level) {
|
20
|
+
// if (level === void 0) {
|
21
|
+
// level = Level.DATA;
|
22
|
+
// }
|
23
|
+
// return {
|
24
|
+
// d(details: string, debugLevel?: number) {
|
25
|
+
// return Helpers.log(`[${name}] ${details}`, debugLevel)
|
26
|
+
// },
|
27
|
+
// i(details: string) {
|
28
|
+
// return Helpers.info(`[${name}] ${details}`)
|
29
|
+
// },
|
30
|
+
// w(details: string, noExit = false, noTrace = false) {
|
31
|
+
// return Helpers.error(`[${name}] ${details}`, noExit, noTrace);
|
32
|
+
// },
|
33
|
+
// er(details: string, ) {
|
34
|
+
// return Helpers.info(`[${name}] ${details}`)
|
35
|
+
// },
|
36
|
+
// }
|
37
|
+
// }
|
38
|
+
// }
|
39
|
+
export class HelpersMessages extends HelpersIsomorphic {
|
40
|
+
msgCacheClear() {
|
41
|
+
}
|
42
|
+
error(details, noExit = false, noTrace = false) {
|
43
|
+
if (Helpers.isBrowser) {
|
44
|
+
console.error(details);
|
45
|
+
return;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
info(details, repeatable = false) {
|
49
|
+
if (Helpers.isBrowser) {
|
50
|
+
console.info(details);
|
51
|
+
return;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
log(details, debugLevel = 0) {
|
55
|
+
if (Helpers.isBrowser) {
|
56
|
+
console.log(details);
|
57
|
+
return;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
warn(details, trace = false) {
|
61
|
+
if (Helpers.isBrowser) {
|
62
|
+
console.warn(details);
|
63
|
+
return;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
//# sourceMappingURL=helpers-messages.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers-messages.js","sourceRoot":"","sources":["../../tmp-src-bundle/helpers-messages.ts"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,sDAAsD;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,MAAM,GAAG,GAAG;IACV,UAAU,EAAE,MAAM,EAAE;IACpB,SAAS,EAAE,MAAM,EAAE;IACnB,SAAS,EAAE,MAAM,EAAE;IACnB,QAAQ,EAAE,MAAM,EAAE;CACnB,CAAA;AAED,qBAAqB;AACrB,mCAAmC;AACnC,wBAAwB;AACxB,4BAA4B;AAC5B,mCAAmC;AACnC,QAAQ;AACR,4BAA4B;AAC5B,MAAM;AAEN,0CAA0C;AAC1C,8BAA8B;AAC9B,4BAA4B;AAC5B,QAAQ;AACR,eAAe;AACf,kDAAkD;AAClD,iEAAiE;AACjE,WAAW;AACX,6BAA6B;AAC7B,sDAAsD;AACtD,WAAW;AAEX,8DAA8D;AAC9D,yEAAyE;AACzE,WAAW;AACX,gCAAgC;AAChC,sDAAsD;AACtD,WAAW;AACX,QAAQ;AACR,MAAM;AAEN,IAAI;AAEJ,MAAM,OAAO,eAAgB,SAAQ,iBAAiB;IAEpD,aAAa;IAEb,CAAC;IAED,KAAK,CAAC,OAAY,EAAE,MAAM,GAAG,KAAK,EAAE,OAAO,GAAG,KAAK;QACjD,IAAI,OAAO,CAAC,SAAS,EAAE;YACrB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YACtB,OAAO;SACR;IAEH,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,UAAU,GAAG,KAAK;QACtC,IAAI,OAAO,CAAC,SAAS,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,OAAO;SACR;IAEH,CAAC;IAED,GAAG,CAAC,OAAe,EAAE,UAAU,GAAG,CAAC;QACjC,IAAI,OAAO,CAAC,SAAS,EAAE;YACrB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACrB,OAAO;SACR;IAEH,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,KAAK,GAAG,KAAK;QACjC,IAAI,OAAO,CAAC,SAAS,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,OAAO;SACR;IAEH,CAAC;CACF"}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import { __awaiter } from "tslib";
|
2
|
+
import { _, } from './core-imports';
|
3
|
+
import { HelpersMessages } from './helpers-messages';
|
4
|
+
const encoding = 'utf8';
|
5
|
+
export class HelpersCore extends HelpersMessages {
|
6
|
+
constructor() {
|
7
|
+
super();
|
8
|
+
//#endregion
|
9
|
+
this.bigMaxBuffer = 2024 * 500;
|
10
|
+
}
|
11
|
+
static get InstanceCore() {
|
12
|
+
if (!HelpersCore._instanceCore) {
|
13
|
+
HelpersCore._instanceCore = new HelpersCore();
|
14
|
+
}
|
15
|
+
return HelpersCore._instanceCore;
|
16
|
+
}
|
17
|
+
removeSlashAtEnd(s) {
|
18
|
+
s = (s === null || s === void 0 ? void 0 : s.endsWith(`/`)) ? s.slice(0, s.length - 1) : s;
|
19
|
+
return s;
|
20
|
+
}
|
21
|
+
stringify(inputObject) {
|
22
|
+
// if (_.isString(inputObject)) {
|
23
|
+
// return inputObject;
|
24
|
+
// }
|
25
|
+
// if (_.isObject(inputObject)) {
|
26
|
+
// config.log(inputObject)
|
27
|
+
// Helpers.error(`[tnp-helpers] trying to stringify not a object`, false, true);
|
28
|
+
// }
|
29
|
+
return JSON.stringify(inputObject, null, 2);
|
30
|
+
}
|
31
|
+
runSyncOrAsync(fn, ...firstArg) {
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
33
|
+
if (_.isUndefined(fn)) {
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
// let wasPromise = false;
|
37
|
+
let promisOrValue = _.isArray(fn) ? fn[1][fn[0]](...firstArg) : fn(...firstArg);
|
38
|
+
if (promisOrValue instanceof Promise) {
|
39
|
+
// wasPromise = true;
|
40
|
+
promisOrValue = Promise.resolve(promisOrValue);
|
41
|
+
}
|
42
|
+
// console.log('was promis ', wasPromise)
|
43
|
+
return promisOrValue;
|
44
|
+
});
|
45
|
+
}
|
46
|
+
run(command, options) {
|
47
|
+
return {};
|
48
|
+
}
|
49
|
+
/**
|
50
|
+
* Quick fix for object values
|
51
|
+
*/
|
52
|
+
values(obj) {
|
53
|
+
if (_.isObject(obj) && !Array.isArray(obj)) {
|
54
|
+
const values = [];
|
55
|
+
for (const key in obj) {
|
56
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
57
|
+
values.push(obj[key]);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
return values;
|
61
|
+
}
|
62
|
+
return [];
|
63
|
+
}
|
64
|
+
}
|
65
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../tmp-src-bundle/helpers.ts"],"names":[],"mappings":";AAEA,OAAO,EAAI,CAAC,GAAI,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,MAAM,QAAQ,GAAG,MAAM,CAAC;AAExB,MAAM,OAAO,WAAY,SAAQ,eAAe;IAe9C;QACE,KAAK,EAAE,CAAC;QANV,YAAY;QAIH,iBAAY,GAAG,IAAI,GAAG,GAAG,CAAC;IAInC,CAAC;IAdM,MAAM,KAAK,YAAY;QAC5B,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;YAC9B,WAAW,CAAC,aAAa,GAAG,IAAI,WAAW,EAAE,CAAC;SAC/C;QACD,OAAO,WAAW,CAAC,aAAa,CAAC;IACnC,CAAC;IAWD,gBAAgB,CAAC,CAAS;QACxB,CAAC,GAAG,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,CAAC,GAAG,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,CAAC;IACX,CAAC;IAED,SAAS,CAAC,WAAgB;QACxB,iCAAiC;QACjC,wBAAwB;QACxB,IAAI;QACJ,iCAAiC;QACjC,4BAA4B;QAC5B,kFAAkF;QAClF,IAAI;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;IAEK,cAAc,CAAC,EAA+B,EAAE,GAAG,QAAe;;YACtE,IAAI,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;gBACrB,OAAO;aACR;YACD,0BAA0B;YAC1B,IAAI,aAAa,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC;YAChF,IAAI,aAAa,YAAY,OAAO,EAAE;gBACpC,qBAAqB;gBACrB,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;aAC/C;YACD,yCAAyC;YACzC,OAAO,aAAa,CAAC;QACvB,CAAC;KAAA;IAcD,GAAG,CAAC,OAAe,EACjB,OAAoB;QAGpB,OAAO,EAEN,CAAA;IACH,CAAC;IAiBD;;OAEG;IACH,MAAM,CAAC,GAAQ;QACb,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC1C,MAAM,MAAM,GAAG,EAAE,CAAC;YAClB,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;gBACrB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;oBAClD,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;iBACvB;aACF;YACD,OAAO,MAAM,CAAC;SACf;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;CAwBF"}
|
package/client/index.js
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
export * from './core-imports';
|
2
|
+
export * from './core-models';
|
3
|
+
import { HelpersCore as Base } from './helpers';
|
4
|
+
export * from './core-config';
|
5
|
+
export * from './progress-data';
|
6
|
+
export { HelpersCore as CoreHelpers } from './helpers';
|
7
|
+
export let Helpers = Base.InstanceCore;
|
8
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tmp-src-bundle/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACvD,MAAM,CAAC,IAAI,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC"}
|
package/client/package.json
CHANGED
@@ -1,13 +1,31 @@
|
|
1
1
|
{
|
2
|
+
"lastBuildTagHash": "39c20383dc5b367f57d21871994a5f01473c38f9",
|
2
3
|
"name": "tnp-core",
|
3
|
-
"version": "1.0.
|
4
|
-
"
|
5
|
-
"
|
6
|
-
"
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
4
|
+
"version": "1.0.27",
|
5
|
+
"license": "MIT",
|
6
|
+
"main": "index.js",
|
7
|
+
"dependencies": {
|
8
|
+
"@types/lodash": "~4.14.92",
|
9
|
+
"@types/q": "~1.5.5",
|
10
|
+
"chokidar": "~3.5.1",
|
11
|
+
"copy-paste": "~1.3.0",
|
12
|
+
"fkill": "~6.1.0",
|
13
|
+
"fs-extra": "~8.1.0",
|
14
|
+
"glob": "~7.1.2",
|
15
|
+
"is-elevated": "~3.0.0",
|
16
|
+
"json5": "~2.1.3",
|
17
|
+
"lodash": "~4.17.4",
|
18
|
+
"mkdirp": "~0.5.1",
|
19
|
+
"portfinder": "~1.0.21",
|
20
|
+
"ps-list": "~6.1.0",
|
21
|
+
"ps-node": "~0.1.6",
|
22
|
+
"q": "~1.5.1",
|
23
|
+
"rimraf": "~2.6.2"
|
24
|
+
},
|
25
|
+
"private": false,
|
26
|
+
"husky": {
|
27
|
+
"hooks": {
|
28
|
+
"pre-push": "tnp deps:show:if:standalone"
|
29
|
+
}
|
30
|
+
}
|
13
31
|
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { _ } from './core-imports';
|
2
|
+
export class PROGRESS_DATA {
|
3
|
+
constructor() {
|
4
|
+
this.type = 'event';
|
5
|
+
}
|
6
|
+
static log(log) {
|
7
|
+
}
|
8
|
+
static resolveFrom(chunk, callbackOnFounded, checkSplit = true) {
|
9
|
+
let progress;
|
10
|
+
let res = [];
|
11
|
+
if (!_.isString(chunk)) {
|
12
|
+
return [];
|
13
|
+
}
|
14
|
+
chunk = chunk.trim();
|
15
|
+
if (checkSplit) {
|
16
|
+
const split = chunk.split(/\r\n|\n|\r/);
|
17
|
+
if (split.length > 1) {
|
18
|
+
// console.log('split founded', split)
|
19
|
+
split.forEach(s => {
|
20
|
+
res = res.concat(this.resolveFrom(s, callbackOnFounded, false));
|
21
|
+
});
|
22
|
+
return res;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
if (/\[\[\[.*\]\]\]/g.test(chunk)) {
|
26
|
+
chunk = chunk.replace(/^\[\[\[/g, '').replace(/\]\]\]$/g, '');
|
27
|
+
progress = chunk;
|
28
|
+
}
|
29
|
+
if (!_.isUndefined(progress)) {
|
30
|
+
try {
|
31
|
+
const p = JSON.parse(progress);
|
32
|
+
const single = _.merge(new PROGRESS_DATA(), p);
|
33
|
+
res = res.concat([single]);
|
34
|
+
if (_.isFunction(callbackOnFounded)) {
|
35
|
+
callbackOnFounded(single);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
catch (err) {
|
39
|
+
console.log(err);
|
40
|
+
console.error(`ProgresssBarData: fail to parse "${progress}"`);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
return res;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
//# sourceMappingURL=progress-data.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"progress-data.js","sourceRoot":"","sources":["../../tmp-src-bundle/progress-data.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAenC,MAAM,OAAO,aAAa;IAA1B;QAmDS,SAAI,GAAuB,OAAO,CAAA;IAK3C,CAAC;IAtDQ,MAAM,CAAC,GAAG,CAAC,GAAmB;IAErC,CAAC;IAGM,MAAM,CAAC,WAAW,CAAC,KAAa,EACrC,iBAAgD,EAAE,UAAU,GAAG,IAAI;QAEnE,IAAI,QAAQ,CAAC;QACb,IAAI,GAAG,GAAoB,EAAE,CAAC;QAC9B,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACtB,OAAO,EAAE,CAAC;SACX;QACD,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAErB,IAAI,UAAU,EAAE;YACd,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YACxC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBACpB,sCAAsC;gBACtC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;oBAChB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,iBAAiB,EAAE,KAAK,CAAC,CAAC,CAAC;gBAClE,CAAC,CAAC,CAAC;gBACH,OAAO,GAAG,CAAC;aACZ;SACF;QAED,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YACjC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAC9D,QAAQ,GAAG,KAAK,CAAC;SAClB;QACD,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE;YAC5B,IAAI;gBACF,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAC/B,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;gBAC/C,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;gBAC1B,IAAI,CAAC,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE;oBACnC,iBAAiB,CAAC,MAAM,CAAC,CAAC;iBAC3B;aACF;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;gBAChB,OAAO,CAAC,KAAK,CAAC,oCAAoC,QAAQ,GAAG,CAAC,CAAA;aAC/D;SACF;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CAUF"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export * from './core-imports';
|
2
|
+
export * from './core-models';
|
3
|
+
import { HelpersCore as Base } from './helpers';
|
4
|
+
export * from './core-config';
|
5
|
+
export * from './progress-data';
|
6
|
+
export { HelpersCore as CoreHelpers } from './helpers';
|
7
|
+
export let Helpers = Base.InstanceCore;
|
8
|
+
//# sourceMappingURL=public-api.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../tmp-src-bundle/public-api.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACvD,MAAM,CAAC,IAAI,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC"}
|