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
|
|
@@ -681,10 +680,6 @@ class HelpersIsomorphic {
|
|
681
680
|
;
|
682
681
|
({}); // @--end-of-file-for-module=tnp-core lib/helpers-isomorphic.ts
|
683
682
|
|
684
|
-
/* */
|
685
|
-
/* */
|
686
|
-
/* */
|
687
|
-
/* */
|
688
683
|
/* */
|
689
684
|
/* */
|
690
685
|
/* */
|
@@ -747,11 +742,16 @@ class HelpersMessages extends HelpersIsomorphic {
|
|
747
742
|
/* */
|
748
743
|
}
|
749
744
|
renderError(err) {
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
745
|
+
if (this.isBrowser) {
|
746
|
+
console.error(err);
|
747
|
+
}
|
748
|
+
else {
|
749
|
+
/* */
|
750
|
+
/* */
|
751
|
+
/* */
|
752
|
+
/* */
|
753
|
+
/* */
|
754
|
+
}
|
755
755
|
}
|
756
756
|
error(details, noExit = false, noTrace = false) {
|
757
757
|
if (Helpers.isBrowser) {
|
@@ -1222,7 +1222,7 @@ class HelpersCore extends HelpersMessages {
|
|
1222
1222
|
}
|
1223
1223
|
mediaTypeFromSrc(src) {
|
1224
1224
|
const ext = path.extname(src);
|
1225
|
-
const media = mimeTypes[ext];
|
1225
|
+
const media = CoreModels.mimeTypes[ext];
|
1226
1226
|
return _.first(media?.split('/'));
|
1227
1227
|
}
|
1228
1228
|
/* */
|
@@ -1250,8 +1250,12 @@ class HelpersCore extends HelpersMessages {
|
|
1250
1250
|
/**
|
1251
1251
|
* check if function is class
|
1252
1252
|
*/
|
1253
|
-
isClass(
|
1254
|
-
|
1253
|
+
isClass(funcOrClass) {
|
1254
|
+
let isClass = false;
|
1255
|
+
if (typeof funcOrClass === 'function') {
|
1256
|
+
isClass = !!funcOrClass.prototype && Object.getOwnPropertyNames(funcOrClass.prototype).filter(f => f !== 'constructor').length > 0;
|
1257
|
+
}
|
1258
|
+
return isClass;
|
1255
1259
|
}
|
1256
1260
|
/**
|
1257
1261
|
* check if data is nodejs/browser blob
|
@@ -1286,23 +1290,14 @@ class HelpersCore extends HelpersMessages {
|
|
1286
1290
|
stringify(inputObject) {
|
1287
1291
|
return JSON.stringify(inputObject, null, 2);
|
1288
1292
|
}
|
1289
|
-
async runSyncOrAsync(fnOrOptions
|
1293
|
+
async runSyncOrAsync(fnOrOptions) {
|
1290
1294
|
if (_.isUndefined(fnOrOptions)) {
|
1291
1295
|
return void 0;
|
1292
1296
|
}
|
1293
1297
|
let promisOrValue;
|
1294
|
-
const
|
1295
|
-
|
1296
|
-
|
1297
|
-
&& !_.isNil(fnOrOptions);
|
1298
|
-
if (optionsMode) {
|
1299
|
-
const { functionFn, context, arrayOfParams } = fnOrOptions;
|
1300
|
-
promisOrValue = functionFn.apply(context, arrayOfParams);
|
1301
|
-
}
|
1302
|
-
else {
|
1303
|
-
// @ts-ignore
|
1304
|
-
promisOrValue = _.isArray(fnOrOptions) ? fnOrOptions[1][fnOrOptions[0]](...firstArg) : fnOrOptions(...firstArg);
|
1305
|
-
}
|
1298
|
+
const { functionFn, context, arrayOfParams } = fnOrOptions;
|
1299
|
+
promisOrValue = functionFn.apply(context, arrayOfParams);
|
1300
|
+
// // @ts-ignore
|
1306
1301
|
if (promisOrValue instanceof Promise) {
|
1307
1302
|
promisOrValue = Promise.resolve(promisOrValue);
|
1308
1303
|
}
|
@@ -1917,17 +1912,22 @@ class HelpersCore extends HelpersMessages {
|
|
1917
1912
|
const checkIfProcessShouldBeDead = () => {
|
1918
1913
|
return _.isNil(WEBSQL_PROC_MOCK_PROCESSES_PID[procDummy.pid]) || _.isNil(WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid]);
|
1919
1914
|
};
|
1920
|
-
const f = Helpers.runSyncOrAsync(
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1915
|
+
const f = Helpers.runSyncOrAsync({
|
1916
|
+
functionFn: mockFun,
|
1917
|
+
arrayOfParams: [
|
1918
|
+
(d) => {
|
1919
|
+
setTimeout(() => {
|
1920
|
+
subStdoutSub.next(d);
|
1921
|
+
});
|
1922
|
+
}, (d) => {
|
1923
|
+
setTimeout(() => {
|
1924
|
+
subStderSub.next(d);
|
1925
|
+
});
|
1926
|
+
}, () => {
|
1927
|
+
const shouldBeDead = checkIfProcessShouldBeDead();
|
1928
|
+
return shouldBeDead;
|
1929
|
+
}
|
1930
|
+
]
|
1931
1931
|
});
|
1932
1932
|
f.then(exitCode => {
|
1933
1933
|
if (_.isNil(exitCode)) {
|
@@ -2422,6 +2422,9 @@ class HelpersCore extends HelpersMessages {
|
|
2422
2422
|
/* */
|
2423
2423
|
/* */
|
2424
2424
|
/* */
|
2425
|
+
/* */
|
2426
|
+
/* */
|
2427
|
+
/* */
|
2425
2428
|
/**
|
2426
2429
|
* Quick fix for object values
|
2427
2430
|
* @deprecated
|
@@ -2722,7 +2725,7 @@ var Utils;
|
|
2722
2725
|
binary.blobToText = blobToText;
|
2723
2726
|
async function textToFile(text, fileRelativePathOrName) {
|
2724
2727
|
const ext = path.extname(fileRelativePathOrName);
|
2725
|
-
const type = mimeTypes[ext];
|
2728
|
+
const type = CoreModels.mimeTypes[ext];
|
2726
2729
|
const blob = new Blob([text], { type });
|
2727
2730
|
const file = await blobToFile(blob, fileRelativePathOrName);
|
2728
2731
|
return file;
|
@@ -2778,5 +2781,5 @@ let Helpers = HelpersCore.InstanceCore;
|
|
2778
2781
|
* Generated bundle index. Do not edit.
|
2779
2782
|
*/
|
2780
2783
|
|
2781
|
-
export { $, CoreConfig, HelpersCore as CoreHelpers,
|
2784
|
+
export { $, CoreConfig, HelpersCore as CoreHelpers, CoreModels, Helpers, PROGRESS_DATA, Utils, chalk, crossPlatformPath, frameworkName, frameworkNameBe, path, win32Path };
|
2782
2785
|
//# sourceMappingURL=tnp-core.mjs.map
|