tnp-core 1.0.6 → 1.0.13
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/es5/core-config.js +11 -0
- package/browser/es5/core-imports.js +24 -0
- package/browser/es5/core-models.js +5 -0
- package/browser/es5/helpers-isomorphic.js +52 -0
- package/browser/es5/helpers-messages.js +114 -0
- package/browser/es5/helpers.js +131 -0
- package/browser/es5/index.js +65 -0
- package/browser/es5/progress-data.js +73 -0
- package/browser/es5/public-api.js +65 -0
- package/browser/helpers-isomorphic.d.ts +6 -0
- package/browser/helpers-isomorphic.js +28 -0
- package/browser/helpers-isomorphic.js.map +1 -0
- package/browser/helpers-messages.d.ts +8 -0
- package/browser/helpers-messages.js +67 -0
- package/browser/helpers-messages.js.map +1 -0
- package/browser/helpers.d.ts +16 -0
- package/browser/helpers.js +65 -0
- package/browser/helpers.js.map +1 -0
- package/browser/index.d.ts +7 -0
- package/browser/index.js +8 -0
- package/browser/index.js.map +1 -0
- package/{client/fesm2015/tnp-core.js → browser/progress-data.js} +7 -24
- package/browser/progress-data.js.map +1 -0
- package/browser/public-api.d.ts +3 -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/es5/core-config.js +11 -0
- package/client/es5/core-imports.js +24 -0
- package/client/es5/core-models.js +5 -0
- package/client/es5/helpers-isomorphic.js +52 -0
- package/client/es5/helpers-messages.js +114 -0
- package/client/es5/helpers.js +131 -0
- package/client/es5/index.js +65 -0
- package/client/es5/progress-data.js +73 -0
- package/client/es5/public-api.js +65 -0
- package/client/helpers-isomorphic.d.ts +6 -0
- package/client/helpers-isomorphic.js +28 -0
- package/client/helpers-isomorphic.js.map +1 -0
- package/client/helpers-messages.d.ts +8 -0
- package/client/helpers-messages.js +67 -0
- package/client/helpers-messages.js.map +1 -0
- package/client/helpers.d.ts +16 -0
- package/client/helpers.js +65 -0
- package/client/helpers.js.map +1 -0
- package/client/index.d.ts +7 -0
- package/client/index.js +8 -0
- package/client/index.js.map +1 -0
- package/client/package.json +27 -14
- package/{browser/fesm2015/tnp-core.js → client/progress-data.js} +7 -24
- package/client/progress-data.js.map +1 -0
- package/client/public-api.d.ts +3 -0
- package/client/public-api.js +8 -0
- package/client/public-api.js.map +1 -0
- package/helpers.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/package.json +13 -14
- package/package.json_devDependencies.json +32 -44
- package/package.json_tnp.json +1 -1
- package/public-api.d.ts +3 -0
- package/public-api.js +5 -0
- package/public-api.js.map +1 -1
- package/tmp-environment.json +38 -50
- package/browser/README.md +0 -24
- package/browser/bundles/tnp-core.umd.js +0 -69
- package/browser/bundles/tnp-core.umd.js.map +0 -1
- package/browser/bundles/tnp-core.umd.min.js +0 -2
- package/browser/bundles/tnp-core.umd.min.js.map +0 -1
- 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/progress-data.js +0 -46
- package/browser/esm2015/progress-data.ngsummary.json +0 -1
- package/browser/esm2015/public-api.js +0 -5
- package/browser/esm2015/public-api.ngsummary.json +0 -1
- package/browser/esm2015/tnp-core.js +0 -5
- 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/progress-data.js +0 -50
- package/browser/esm5/public-api.js +0 -5
- package/browser/esm5/tnp-core.js +0 -5
- package/browser/fesm2015/tnp-core.js.map +0 -1
- package/browser/fesm5/tnp-core.js +0 -66
- package/browser/fesm5/tnp-core.js.map +0 -1
- package/browser/package.json +0 -17
- package/browser/tnp-core.d.ts +0 -4
- package/browser/tnp-core.metadata.json +0 -1
- package/client/README.md +0 -24
- package/client/bundles/tnp-core.umd.js +0 -69
- package/client/bundles/tnp-core.umd.js.map +0 -1
- package/client/bundles/tnp-core.umd.min.js +0 -2
- package/client/bundles/tnp-core.umd.min.js.map +0 -1
- 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/progress-data.js +0 -46
- package/client/esm2015/progress-data.ngsummary.json +0 -1
- package/client/esm2015/public-api.js +0 -5
- package/client/esm2015/public-api.ngsummary.json +0 -1
- package/client/esm2015/tnp-core.js +0 -5
- 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/progress-data.js +0 -50
- package/client/esm5/public-api.js +0 -5
- package/client/esm5/tnp-core.js +0 -5
- package/client/fesm2015/tnp-core.js.map +0 -1
- package/client/fesm5/tnp-core.js +0 -66
- package/client/fesm5/tnp-core.js.map +0 -1
- package/client/tnp-core.d.ts +0 -4
- package/client/tnp-core.metadata.json +0 -1
@@ -0,0 +1,65 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Helpers = exports.CoreHelpers = undefined;
|
7
|
+
|
8
|
+
var _coreImports = require('./core-imports');
|
9
|
+
|
10
|
+
Object.keys(_coreImports).forEach(function (key) {
|
11
|
+
if (key === "default" || key === "__esModule") return;
|
12
|
+
Object.defineProperty(exports, key, {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _coreImports[key];
|
16
|
+
}
|
17
|
+
});
|
18
|
+
});
|
19
|
+
|
20
|
+
var _coreModels = require('./core-models');
|
21
|
+
|
22
|
+
Object.keys(_coreModels).forEach(function (key) {
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
24
|
+
Object.defineProperty(exports, key, {
|
25
|
+
enumerable: true,
|
26
|
+
get: function get() {
|
27
|
+
return _coreModels[key];
|
28
|
+
}
|
29
|
+
});
|
30
|
+
});
|
31
|
+
|
32
|
+
var _coreConfig = require('./core-config');
|
33
|
+
|
34
|
+
Object.keys(_coreConfig).forEach(function (key) {
|
35
|
+
if (key === "default" || key === "__esModule") return;
|
36
|
+
Object.defineProperty(exports, key, {
|
37
|
+
enumerable: true,
|
38
|
+
get: function get() {
|
39
|
+
return _coreConfig[key];
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
43
|
+
|
44
|
+
var _progressData = require('./progress-data');
|
45
|
+
|
46
|
+
Object.keys(_progressData).forEach(function (key) {
|
47
|
+
if (key === "default" || key === "__esModule") return;
|
48
|
+
Object.defineProperty(exports, key, {
|
49
|
+
enumerable: true,
|
50
|
+
get: function get() {
|
51
|
+
return _progressData[key];
|
52
|
+
}
|
53
|
+
});
|
54
|
+
});
|
55
|
+
|
56
|
+
var _helpers = require('./helpers');
|
57
|
+
|
58
|
+
Object.defineProperty(exports, 'CoreHelpers', {
|
59
|
+
enumerable: true,
|
60
|
+
get: function get() {
|
61
|
+
return _helpers.HelpersCore;
|
62
|
+
}
|
63
|
+
});
|
64
|
+
var Helpers = exports.Helpers = _helpers.HelpersCore.InstanceCore;
|
65
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1,73 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.PROGRESS_DATA = undefined;
|
7
|
+
|
8
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
9
|
+
|
10
|
+
var _coreImports = require('./core-imports');
|
11
|
+
|
12
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
13
|
+
|
14
|
+
var PROGRESS_DATA = function () {
|
15
|
+
function PROGRESS_DATA() {
|
16
|
+
_classCallCheck(this, PROGRESS_DATA);
|
17
|
+
|
18
|
+
this.type = 'event';
|
19
|
+
}
|
20
|
+
|
21
|
+
_createClass(PROGRESS_DATA, null, [{
|
22
|
+
key: 'log',
|
23
|
+
value: function log(_log) {}
|
24
|
+
}, {
|
25
|
+
key: 'resolveFrom',
|
26
|
+
value: function resolveFrom(chunk, callbackOnFounded) {
|
27
|
+
var _this = this;
|
28
|
+
|
29
|
+
var checkSplit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
30
|
+
|
31
|
+
var progress = void 0;
|
32
|
+
var res = [];
|
33
|
+
if (!_coreImports._.isString(chunk)) {
|
34
|
+
return [];
|
35
|
+
}
|
36
|
+
chunk = chunk.trim();
|
37
|
+
if (checkSplit) {
|
38
|
+
var split = chunk.split(/\r\n|\n|\r/);
|
39
|
+
if (split.length > 1) {
|
40
|
+
// console.log('split founded', split)
|
41
|
+
split.forEach(function (s) {
|
42
|
+
res = res.concat(_this.resolveFrom(s, callbackOnFounded, false));
|
43
|
+
});
|
44
|
+
return res;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
if (/\[\[\[.*\]\]\]/g.test(chunk)) {
|
48
|
+
chunk = chunk.replace(/^\[\[\[/g, '').replace(/\]\]\]$/g, '');
|
49
|
+
progress = chunk;
|
50
|
+
}
|
51
|
+
if (!_coreImports._.isUndefined(progress)) {
|
52
|
+
try {
|
53
|
+
var p = JSON.parse(progress);
|
54
|
+
var single = _coreImports._.merge(new PROGRESS_DATA(), p);
|
55
|
+
res = res.concat([single]);
|
56
|
+
if (_coreImports._.isFunction(callbackOnFounded)) {
|
57
|
+
callbackOnFounded(single);
|
58
|
+
}
|
59
|
+
} catch (err) {
|
60
|
+
console.log(err);
|
61
|
+
console.error('ProgresssBarData: fail to parse "' + progress + '"');
|
62
|
+
}
|
63
|
+
}
|
64
|
+
return res;
|
65
|
+
}
|
66
|
+
}]);
|
67
|
+
|
68
|
+
return PROGRESS_DATA;
|
69
|
+
}();
|
70
|
+
//# sourceMappingURL=progress-data.js.map
|
71
|
+
|
72
|
+
|
73
|
+
exports.PROGRESS_DATA = PROGRESS_DATA;
|
@@ -0,0 +1,65 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Helpers = exports.CoreHelpers = undefined;
|
7
|
+
|
8
|
+
var _coreImports = require('./core-imports');
|
9
|
+
|
10
|
+
Object.keys(_coreImports).forEach(function (key) {
|
11
|
+
if (key === "default" || key === "__esModule") return;
|
12
|
+
Object.defineProperty(exports, key, {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _coreImports[key];
|
16
|
+
}
|
17
|
+
});
|
18
|
+
});
|
19
|
+
|
20
|
+
var _coreModels = require('./core-models');
|
21
|
+
|
22
|
+
Object.keys(_coreModels).forEach(function (key) {
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
24
|
+
Object.defineProperty(exports, key, {
|
25
|
+
enumerable: true,
|
26
|
+
get: function get() {
|
27
|
+
return _coreModels[key];
|
28
|
+
}
|
29
|
+
});
|
30
|
+
});
|
31
|
+
|
32
|
+
var _coreConfig = require('./core-config');
|
33
|
+
|
34
|
+
Object.keys(_coreConfig).forEach(function (key) {
|
35
|
+
if (key === "default" || key === "__esModule") return;
|
36
|
+
Object.defineProperty(exports, key, {
|
37
|
+
enumerable: true,
|
38
|
+
get: function get() {
|
39
|
+
return _coreConfig[key];
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
43
|
+
|
44
|
+
var _progressData = require('./progress-data');
|
45
|
+
|
46
|
+
Object.keys(_progressData).forEach(function (key) {
|
47
|
+
if (key === "default" || key === "__esModule") return;
|
48
|
+
Object.defineProperty(exports, key, {
|
49
|
+
enumerable: true,
|
50
|
+
get: function get() {
|
51
|
+
return _progressData[key];
|
52
|
+
}
|
53
|
+
});
|
54
|
+
});
|
55
|
+
|
56
|
+
var _helpers = require('./helpers');
|
57
|
+
|
58
|
+
Object.defineProperty(exports, 'CoreHelpers', {
|
59
|
+
enumerable: true,
|
60
|
+
get: function get() {
|
61
|
+
return _helpers.HelpersCore;
|
62
|
+
}
|
63
|
+
});
|
64
|
+
var Helpers = exports.Helpers = _helpers.HelpersCore.InstanceCore;
|
65
|
+
//# sourceMappingURL=public-api.js.map
|
@@ -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,8 @@
|
|
1
|
+
import { HelpersIsomorphic } from './helpers-isomorphic';
|
2
|
+
export declare class HelpersMessages extends HelpersIsomorphic {
|
3
|
+
msgCacheClear(): void;
|
4
|
+
error(details: any, noExit?: boolean, noTrace?: boolean): void;
|
5
|
+
info(details: string, repeatable?: boolean): void;
|
6
|
+
log(details: string, debugLevel?: number): void;
|
7
|
+
warn(details: string, trace?: boolean): void;
|
8
|
+
}
|
@@ -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,16 @@
|
|
1
|
+
import { HelpersMessages } from './helpers-messages';
|
2
|
+
import { RunOptions } from './core-models';
|
3
|
+
export declare class HelpersCore extends HelpersMessages {
|
4
|
+
private static _instanceCore;
|
5
|
+
static get InstanceCore(): HelpersCore;
|
6
|
+
readonly bigMaxBuffer: number;
|
7
|
+
constructor();
|
8
|
+
removeSlashAtEnd(s: string): string;
|
9
|
+
stringify(inputObject: any): string;
|
10
|
+
runSyncOrAsync(fn: Function | [string, object], ...firstArg: any[]): Promise<any>;
|
11
|
+
run(command: string, options?: RunOptions): {};
|
12
|
+
/**
|
13
|
+
* Quick fix for object values
|
14
|
+
*/
|
15
|
+
values(obj: any): any[];
|
16
|
+
}
|
@@ -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,GAAE,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"}
|
@@ -0,0 +1,7 @@
|
|
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 declare let Helpers: Base;
|
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,17 +1,30 @@
|
|
1
1
|
{
|
2
|
+
"lastBuildTagHash": "c164209252acc6eee796e130e604b8f8ffa25d6e",
|
2
3
|
"name": "tnp-core",
|
3
|
-
"version": "1.0.
|
4
|
-
"
|
5
|
-
"
|
6
|
-
"
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
4
|
+
"version": "1.0.13",
|
5
|
+
"license": "MIT",
|
6
|
+
"main": "index.js",
|
7
|
+
"dependencies": {
|
8
|
+
"@types/lodash": "~4.14.92",
|
9
|
+
"chokidar": "~3.5.1",
|
10
|
+
"copy-paste": "~1.3.0",
|
11
|
+
"fkill": "~6.1.0",
|
12
|
+
"fs-extra": "~8.1.0",
|
13
|
+
"glob": "~7.1.2",
|
14
|
+
"is-elevated": "~3.0.0",
|
15
|
+
"json5": "~2.1.3",
|
16
|
+
"lodash": "~4.17.4",
|
17
|
+
"mkdirp": "~0.5.1",
|
18
|
+
"portfinder": "~1.0.21",
|
19
|
+
"ps-list": "~6.1.0",
|
20
|
+
"ps-node": "~0.1.6",
|
21
|
+
"q": "~1.5.1",
|
22
|
+
"rimraf": "~2.6.2"
|
23
|
+
},
|
24
|
+
"private": false,
|
25
|
+
"husky": {
|
26
|
+
"hooks": {
|
27
|
+
"pre-push": "tnp deps:show:if:standalone"
|
28
|
+
}
|
29
|
+
}
|
17
30
|
}
|
@@ -1,16 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
export { _ };
|
4
|
-
import * as q from 'q';
|
5
|
-
export { q };
|
6
|
-
|
7
|
-
const CoreConfig = {
|
8
|
-
message: {
|
9
|
-
globalSystemToolMode: 'globalSystemToolMode'
|
10
|
-
}
|
11
|
-
};
|
12
|
-
|
13
|
-
class PROGRESS_DATA {
|
1
|
+
import { _ } from './core-imports';
|
2
|
+
export class PROGRESS_DATA {
|
14
3
|
constructor() {
|
15
4
|
this.type = 'event';
|
16
5
|
}
|
@@ -19,7 +8,7 @@ class PROGRESS_DATA {
|
|
19
8
|
static resolveFrom(chunk, callbackOnFounded, checkSplit = true) {
|
20
9
|
let progress;
|
21
10
|
let res = [];
|
22
|
-
if (!isString(chunk)) {
|
11
|
+
if (!_.isString(chunk)) {
|
23
12
|
return [];
|
24
13
|
}
|
25
14
|
chunk = chunk.trim();
|
@@ -37,12 +26,12 @@ class PROGRESS_DATA {
|
|
37
26
|
chunk = chunk.replace(/^\[\[\[/g, '').replace(/\]\]\]$/g, '');
|
38
27
|
progress = chunk;
|
39
28
|
}
|
40
|
-
if (!isUndefined(progress)) {
|
29
|
+
if (!_.isUndefined(progress)) {
|
41
30
|
try {
|
42
31
|
const p = JSON.parse(progress);
|
43
|
-
const single = merge(new PROGRESS_DATA(), p);
|
32
|
+
const single = _.merge(new PROGRESS_DATA(), p);
|
44
33
|
res = res.concat([single]);
|
45
|
-
if (isFunction(callbackOnFounded)) {
|
34
|
+
if (_.isFunction(callbackOnFounded)) {
|
46
35
|
callbackOnFounded(single);
|
47
36
|
}
|
48
37
|
}
|
@@ -54,10 +43,4 @@ class PROGRESS_DATA {
|
|
54
43
|
return res;
|
55
44
|
}
|
56
45
|
}
|
57
|
-
|
58
|
-
/**
|
59
|
-
* Generated bundle index. Do not edit.
|
60
|
-
*/
|
61
|
-
|
62
|
-
export { CoreConfig, PROGRESS_DATA };
|
63
|
-
//# sourceMappingURL=tnp-core.js.map
|
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"}
|
package/client/public-api.d.ts
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
export * from './core-imports';
|
2
2
|
export * from './core-models';
|
3
|
+
import { HelpersCore as Base } from './helpers';
|
3
4
|
export * from './core-config';
|
4
5
|
export * from './progress-data';
|
6
|
+
export { HelpersCore as CoreHelpers } from './helpers';
|
7
|
+
export declare let Helpers: Base;
|
@@ -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"}
|