tnp-core 16.5.23 → 16.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/shared/shared_folder_info.txt +1 -1
- package/browser/esm2022/lib/core-imports.mjs +1 -3
- package/browser/esm2022/lib/core-models.mjs +88 -87
- package/browser/esm2022/lib/helpers-messages.mjs +11 -10
- package/browser/esm2022/lib/helpers.mjs +32 -29
- package/browser/esm2022/lib/progress-data.mjs +1 -1
- package/browser/esm2022/lib/utils.mjs +3 -3
- package/browser/fesm2022/tnp-core.mjs +129 -126
- package/browser/fesm2022/tnp-core.mjs.map +1 -1
- package/browser/lib/core-models.d.ts +250 -125
- package/browser/lib/helpers.d.ts +5 -5
- package/browser/lib/progress-data.d.ts +3 -3
- package/browser/lib/utils.d.ts +4 -4
- package/cli.backend.js +3 -3
- package/client/esm2022/lib/core-imports.mjs +1 -3
- package/client/esm2022/lib/core-models.mjs +88 -87
- package/client/esm2022/lib/helpers-messages.mjs +11 -10
- package/client/esm2022/lib/helpers.mjs +32 -29
- package/client/esm2022/lib/progress-data.mjs +1 -1
- package/client/esm2022/lib/utils.mjs +3 -3
- package/client/fesm2022/tnp-core.mjs +129 -126
- package/client/fesm2022/tnp-core.mjs.map +1 -1
- package/client/lib/core-models.d.ts +250 -125
- package/client/lib/helpers.d.ts +5 -5
- package/client/lib/progress-data.d.ts +3 -3
- package/client/lib/utils.d.ts +4 -4
- package/client/package.json +37 -34
- package/lib/core-imports.d.ts +1 -2
- package/lib/core-imports.js +1 -4
- package/lib/core-imports.js.map +1 -1
- package/lib/core-models.d.ts +250 -124
- package/lib/core-models.js +92 -88
- package/lib/core-models.js.map +1 -1
- package/lib/helpers-messages.js +13 -37
- package/lib/helpers-messages.js.map +1 -1
- package/lib/helpers.d.ts +9 -9
- package/lib/helpers.js +27 -24
- package/lib/helpers.js.map +1 -1
- package/lib/node-chalk-mock.js +3 -3
- package/lib/node-path-mock.js +3 -3
- package/lib/progress-data.d.ts +3 -3
- package/lib/progress-data.js.map +1 -1
- package/lib/utils.d.ts +6 -6
- package/lib/utils.js +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +6 -3
- package/package.json_tnp.json5 +4 -1
- package/tmp-environment.json +41 -45
- package/websql/esm2022/lib/core-imports.mjs +1 -3
- package/websql/esm2022/lib/core-models.mjs +88 -87
- package/websql/esm2022/lib/helpers-messages.mjs +11 -10
- package/websql/esm2022/lib/helpers.mjs +32 -29
- package/websql/esm2022/lib/progress-data.mjs +1 -1
- package/websql/esm2022/lib/utils.mjs +3 -3
- package/websql/fesm2022/tnp-core.mjs +129 -126
- package/websql/fesm2022/tnp-core.mjs.map +1 -1
- package/websql/lib/core-models.d.ts +250 -125
- package/websql/lib/helpers.d.ts +5 -5
- package/websql/lib/progress-data.d.ts +3 -3
- package/websql/lib/utils.d.ts +4 -4
@@ -506,8 +506,6 @@ const chalk$1 = allObj;
|
|
506
506
|
/* */
|
507
507
|
/* */
|
508
508
|
/* */
|
509
|
-
/* */
|
510
|
-
/* */
|
511
509
|
let $;
|
512
510
|
$ = jQuery;
|
513
511
|
let path;
|
@@ -557,92 +555,93 @@ const crossPlatformPath = (pathStringOrPathParts) => {
|
|
557
555
|
};
|
558
556
|
({}); // @--end-of-file-for-module=tnp-core lib/core-imports.ts
|
559
557
|
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
558
|
+
var CoreModels;
|
559
|
+
(function (CoreModels) {
|
560
|
+
CoreModels.mimeTypes = {
|
561
|
+
".aac": "audio/aac",
|
562
|
+
".abw": "application/x-abiword",
|
563
|
+
".arc": "application/x-freearc",
|
564
|
+
".avi": "video/x-msvideo",
|
565
|
+
".azw": "application/vnd.amazon.ebook",
|
566
|
+
".bin": "application/octet-stream",
|
567
|
+
".bmp": "image/bmp",
|
568
|
+
".bz": "application/x-bzip",
|
569
|
+
".bz2": "application/x-bzip2",
|
570
|
+
".csh": "application/x-csh",
|
571
|
+
".css": "text/css",
|
572
|
+
".csv": "text/csv",
|
573
|
+
".doc": "application/msword",
|
574
|
+
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
575
|
+
".eot": "application/vnd.ms-fontobject",
|
576
|
+
".epub": "application/epub+zip",
|
577
|
+
".gz": "application/gzip",
|
578
|
+
".gif": "image/gif",
|
579
|
+
".htm": "text/html",
|
580
|
+
".html": "text/html",
|
581
|
+
".ico": "image/vnd.microsoft.icon",
|
582
|
+
".ics": "text/calendar",
|
583
|
+
".jar": "application/java-archive",
|
584
|
+
".jpeg": "image/jpeg",
|
585
|
+
".jpg": "image/jpeg",
|
586
|
+
".js": "text/javascript",
|
587
|
+
".json": "application/json",
|
588
|
+
".jsonld": "application/ld+json",
|
589
|
+
".mid": "application/midi",
|
590
|
+
".midi": "application/midi",
|
591
|
+
".mjs": "text/javascript",
|
592
|
+
".mp3": "audio/mpeg",
|
593
|
+
".mp4": "video/mp4",
|
594
|
+
".mpeg": "video/mpeg",
|
595
|
+
".mpkg": "application/vnd.apple.installer+xml",
|
596
|
+
".odp": "application/vnd.oasis.opendocument.presentation",
|
597
|
+
".ods": "application/vnd.oasis.opendocument.spreadsheet",
|
598
|
+
".odt": "application/vnd.oasis.opendocument.text",
|
599
|
+
".oga": "audio/ogg",
|
600
|
+
".ogg": "audio/ogg",
|
601
|
+
".ogv": "video/ogg",
|
602
|
+
".ogx": "application/ogg",
|
603
|
+
".opus": "audio/opus",
|
604
|
+
".otf": "font/otf",
|
605
|
+
".png": "image/png",
|
606
|
+
".pdf": "application/pdf",
|
607
|
+
".php": "application/php",
|
608
|
+
".ppt": "application/vnd.ms-powerpoint",
|
609
|
+
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
610
|
+
".rar": "application/vnd.rar",
|
611
|
+
".rtf": "application/rtf",
|
612
|
+
".sh": "application/x-sh",
|
613
|
+
".svg": "image/svg+xml",
|
614
|
+
".swf": "application/x-shockwave-flash",
|
615
|
+
".tar": "application/x-tar",
|
616
|
+
".tif": "image/tiff",
|
617
|
+
".tiff": "image/tiff",
|
618
|
+
".ts": "video/mp2t",
|
619
|
+
".ttf": "font/ttf",
|
620
|
+
".txt": "text/plain",
|
621
|
+
".vsd": "application/vnd.visio",
|
622
|
+
".wav": "audio/wav",
|
623
|
+
".weba": "audio/webm",
|
624
|
+
".webm": "video/webm",
|
625
|
+
".webp": "image/webp",
|
626
|
+
".woff": "font/woff",
|
627
|
+
".woff2": "font/woff2",
|
628
|
+
".xhtml": "application/xhtml+xml",
|
629
|
+
".xls": "application/vnd.ms-excel",
|
630
|
+
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
631
|
+
".xml": "application/xml",
|
632
|
+
".xul": "application/vnd.mozilla.xul+xml",
|
633
|
+
".zip": "application/zip",
|
634
|
+
".3gp": "video/3gpp",
|
635
|
+
".3g2": "video/3gpp2",
|
636
|
+
".7z": "application/x-7z-compressed"
|
637
|
+
};
|
638
|
+
CoreModels.MediaTypeAllArr = [
|
639
|
+
'text', 'image', 'audio', 'video', 'font',
|
640
|
+
'application', 'multipart', 'message', 'model'
|
641
|
+
];
|
642
|
+
CoreModels.MimeTypesObj = CoreModels.mimeTypes;
|
643
|
+
;
|
644
|
+
})(CoreModels || (CoreModels = {}));
|
646
645
|
;
|
647
646
|
({}); // @--end-of-file-for-module=tnp-core lib/core-models.ts
|
648
647
|
|
@@ -682,10 +681,6 @@ class HelpersIsomorphic {
|
|
682
681
|
;
|
683
682
|
({}); // @--end-of-file-for-module=tnp-core lib/helpers-isomorphic.ts
|
684
683
|
|
685
|
-
/* */
|
686
|
-
/* */
|
687
|
-
/* */
|
688
|
-
/* */
|
689
684
|
/* */
|
690
685
|
/* */
|
691
686
|
/* */
|
@@ -748,11 +743,16 @@ class HelpersMessages extends HelpersIsomorphic {
|
|
748
743
|
/* */
|
749
744
|
}
|
750
745
|
renderError(err) {
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
746
|
+
if (this.isBrowser) {
|
747
|
+
console.error(err);
|
748
|
+
}
|
749
|
+
else {
|
750
|
+
/* */
|
751
|
+
/* */
|
752
|
+
/* */
|
753
|
+
/* */
|
754
|
+
/* */
|
755
|
+
}
|
756
756
|
}
|
757
757
|
error(details, noExit = false, noTrace = false) {
|
758
758
|
if (Helpers.isBrowser) {
|
@@ -1223,7 +1223,7 @@ class HelpersCore extends HelpersMessages {
|
|
1223
1223
|
}
|
1224
1224
|
mediaTypeFromSrc(src) {
|
1225
1225
|
const ext = path.extname(src);
|
1226
|
-
const media = mimeTypes[ext];
|
1226
|
+
const media = CoreModels.mimeTypes[ext];
|
1227
1227
|
return _.first(media?.split('/'));
|
1228
1228
|
}
|
1229
1229
|
/* */
|
@@ -1251,8 +1251,12 @@ class HelpersCore extends HelpersMessages {
|
|
1251
1251
|
/**
|
1252
1252
|
* check if function is class
|
1253
1253
|
*/
|
1254
|
-
isClass(
|
1255
|
-
|
1254
|
+
isClass(funcOrClass) {
|
1255
|
+
let isClass = false;
|
1256
|
+
if (typeof funcOrClass === 'function') {
|
1257
|
+
isClass = !!funcOrClass.prototype && Object.getOwnPropertyNames(funcOrClass.prototype).filter(f => f !== 'constructor').length > 0;
|
1258
|
+
}
|
1259
|
+
return isClass;
|
1256
1260
|
}
|
1257
1261
|
/**
|
1258
1262
|
* check if data is nodejs/browser blob
|
@@ -1287,23 +1291,14 @@ class HelpersCore extends HelpersMessages {
|
|
1287
1291
|
stringify(inputObject) {
|
1288
1292
|
return JSON.stringify(inputObject, null, 2);
|
1289
1293
|
}
|
1290
|
-
async runSyncOrAsync(fnOrOptions
|
1294
|
+
async runSyncOrAsync(fnOrOptions) {
|
1291
1295
|
if (_.isUndefined(fnOrOptions)) {
|
1292
1296
|
return void 0;
|
1293
1297
|
}
|
1294
1298
|
let promisOrValue;
|
1295
|
-
const
|
1296
|
-
|
1297
|
-
|
1298
|
-
&& !_.isNil(fnOrOptions);
|
1299
|
-
if (optionsMode) {
|
1300
|
-
const { functionFn, context, arrayOfParams } = fnOrOptions;
|
1301
|
-
promisOrValue = functionFn.apply(context, arrayOfParams);
|
1302
|
-
}
|
1303
|
-
else {
|
1304
|
-
// @ts-ignore
|
1305
|
-
promisOrValue = _.isArray(fnOrOptions) ? fnOrOptions[1][fnOrOptions[0]](...firstArg) : fnOrOptions(...firstArg);
|
1306
|
-
}
|
1299
|
+
const { functionFn, context, arrayOfParams } = fnOrOptions;
|
1300
|
+
promisOrValue = functionFn.apply(context, arrayOfParams);
|
1301
|
+
// // @ts-ignore
|
1307
1302
|
if (promisOrValue instanceof Promise) {
|
1308
1303
|
promisOrValue = Promise.resolve(promisOrValue);
|
1309
1304
|
}
|
@@ -1920,17 +1915,22 @@ class HelpersCore extends HelpersMessages {
|
|
1920
1915
|
const checkIfProcessShouldBeDead = () => {
|
1921
1916
|
return _.isNil(WEBSQL_PROC_MOCK_PROCESSES_PID[procDummy.pid]) || _.isNil(WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid]);
|
1922
1917
|
};
|
1923
|
-
const f = Helpers.runSyncOrAsync(
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
1918
|
+
const f = Helpers.runSyncOrAsync({
|
1919
|
+
functionFn: mockFun,
|
1920
|
+
arrayOfParams: [
|
1921
|
+
(d) => {
|
1922
|
+
setTimeout(() => {
|
1923
|
+
subStdoutSub.next(d);
|
1924
|
+
});
|
1925
|
+
}, (d) => {
|
1926
|
+
setTimeout(() => {
|
1927
|
+
subStderSub.next(d);
|
1928
|
+
});
|
1929
|
+
}, () => {
|
1930
|
+
const shouldBeDead = checkIfProcessShouldBeDead();
|
1931
|
+
return shouldBeDead;
|
1932
|
+
}
|
1933
|
+
]
|
1934
1934
|
});
|
1935
1935
|
f.then(exitCode => {
|
1936
1936
|
if (_.isNil(exitCode)) {
|
@@ -2425,6 +2425,9 @@ class HelpersCore extends HelpersMessages {
|
|
2425
2425
|
/* */
|
2426
2426
|
/* */
|
2427
2427
|
/* */
|
2428
|
+
/* */
|
2429
|
+
/* */
|
2430
|
+
/* */
|
2428
2431
|
/**
|
2429
2432
|
* Quick fix for object values
|
2430
2433
|
* @deprecated
|
@@ -2725,7 +2728,7 @@ var Utils;
|
|
2725
2728
|
binary.blobToText = blobToText;
|
2726
2729
|
async function textToFile(text, fileRelativePathOrName) {
|
2727
2730
|
const ext = path.extname(fileRelativePathOrName);
|
2728
|
-
const type = mimeTypes[ext];
|
2731
|
+
const type = CoreModels.mimeTypes[ext];
|
2729
2732
|
const blob = new Blob([text], { type });
|
2730
2733
|
const file = await blobToFile(blob, fileRelativePathOrName);
|
2731
2734
|
return file;
|
@@ -2781,5 +2784,5 @@ let Helpers = HelpersCore.InstanceCore;
|
|
2781
2784
|
* Generated bundle index. Do not edit.
|
2782
2785
|
*/
|
2783
2786
|
|
2784
|
-
export { $, CoreConfig, HelpersCore as CoreHelpers,
|
2787
|
+
export { $, CoreConfig, HelpersCore as CoreHelpers, CoreModels, Helpers, PROGRESS_DATA, Utils, chalk, crossPlatformPath, frameworkName, frameworkNameBe, path, win32Path };
|
2785
2788
|
//# sourceMappingURL=tnp-core.mjs.map
|