tnp-core 13.1.58 → 13.1.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app.js +3 -3
- package/browser/esm2020/lib/core-imports.mjs +3 -2
- package/browser/esm2020/lib/framework-name.mjs +10 -0
- package/browser/esm2020/lib/helpers-messages.mjs +2 -1
- package/browser/esm2020/lib/helpers.mjs +206 -98
- package/browser/esm2020/lib/index.mjs +2 -1
- package/browser/fesm2015/tnp-core.mjs +219 -98
- package/browser/fesm2020/tnp-core.mjs +219 -98
- package/browser/lib/core-imports.d.ts +2 -1
- package/browser/lib/framework-name.d.ts +3 -0
- package/browser/lib/helpers.d.ts +5 -1
- package/browser/lib/index.d.ts +1 -0
- package/cli.backend.js +3 -3
- package/client/esm2020/lib/core-imports.mjs +3 -2
- package/client/esm2020/lib/framework-name.mjs +10 -0
- package/client/esm2020/lib/helpers-messages.mjs +2 -1
- package/client/esm2020/lib/helpers.mjs +206 -98
- package/client/esm2020/lib/index.mjs +2 -1
- package/client/fesm2015/tnp-core.mjs +219 -98
- package/client/fesm2020/tnp-core.mjs +219 -98
- package/client/lib/core-imports.d.ts +2 -1
- package/client/lib/framework-name.d.ts +3 -0
- package/client/lib/helpers.d.ts +5 -1
- package/client/lib/index.d.ts +1 -0
- package/lib/core-imports.d.ts +3 -3
- package/lib/core-imports.js +3 -3
- package/lib/framework-name.d.ts +2 -0
- package/lib/framework-name.js +13 -0
- package/lib/helpers.d.ts +4 -2
- package/lib/helpers.js +131 -5
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/package.json +2 -2
- package/tmp-environment.json +15 -14
- package/websql/esm2020/lib/core-imports.mjs +4 -2
- package/websql/esm2020/lib/framework-name.mjs +10 -0
- package/websql/esm2020/lib/helpers-messages.mjs +2 -1
- package/websql/esm2020/lib/helpers.mjs +221 -115
- package/websql/esm2020/lib/index.mjs +2 -1
- package/websql/fesm2015/tnp-core.mjs +234 -115
- package/websql/fesm2020/tnp-core.mjs +234 -115
- package/websql/lib/core-imports.d.ts +2 -1
- package/websql/lib/framework-name.d.ts +3 -0
- package/websql/lib/helpers.d.ts +5 -1
- package/websql/lib/index.d.ts +1 -0
@@ -4,7 +4,20 @@ import * as q from 'q';
|
|
4
4
|
export { q };
|
5
5
|
import * as moment from 'moment';
|
6
6
|
export { moment };
|
7
|
+
import * as dateformat from 'dateformat';
|
8
|
+
export { dateformat };
|
7
9
|
import { __awaiter } from 'tslib';
|
10
|
+
import { Subject } from 'rxjs';
|
11
|
+
|
12
|
+
let isBrowser = false;
|
13
|
+
isBrowser = true;
|
14
|
+
const frameworkNameBe = (''
|
15
|
+
/* */
|
16
|
+
/* */
|
17
|
+
);
|
18
|
+
const frameworkName = isBrowser ? 'firedev' : frameworkNameBe;
|
19
|
+
;
|
20
|
+
({}); // @--end-of-file-for-module=tnp-core lib/framework-name.ts
|
8
21
|
|
9
22
|
/* */
|
10
23
|
/* */
|
@@ -547,6 +560,7 @@ class HelpersMessages extends HelpersIsomorphic {
|
|
547
560
|
/* */
|
548
561
|
/* */
|
549
562
|
/* */
|
563
|
+
/* */
|
550
564
|
}
|
551
565
|
}
|
552
566
|
function transformData(details) {
|
@@ -568,6 +582,8 @@ function transformData(details) {
|
|
568
582
|
({}); // @--end-of-file-for-module=tnp-core lib/helpers-messages.ts
|
569
583
|
|
570
584
|
const encoding = 'utf8';
|
585
|
+
const WEBSQL_PROC_MOCK_PROCESSES_PID = {};
|
586
|
+
const WEBSQL_PROC_MOCK_PROCESSES_PPID = {};
|
571
587
|
class HelpersCore extends HelpersMessages {
|
572
588
|
constructor() {
|
573
589
|
super();
|
@@ -1031,6 +1047,13 @@ class HelpersCore extends HelpersMessages {
|
|
1031
1047
|
/* */
|
1032
1048
|
};
|
1033
1049
|
}
|
1050
|
+
wait(second) {
|
1051
|
+
return new Promise((resolve, reject) => {
|
1052
|
+
setTimeout(() => {
|
1053
|
+
resolve(void 0);
|
1054
|
+
}, second * 1000);
|
1055
|
+
});
|
1056
|
+
}
|
1034
1057
|
/* */
|
1035
1058
|
/* */
|
1036
1059
|
/* */
|
@@ -1101,103 +1124,7 @@ class HelpersCore extends HelpersMessages {
|
|
1101
1124
|
/* */
|
1102
1125
|
/* */
|
1103
1126
|
/* */
|
1104
|
-
|
1105
|
-
command = Helpers._fixCommand(command);
|
1106
|
-
/* */
|
1107
|
-
/* */
|
1108
|
-
/* */
|
1109
|
-
/* */
|
1110
|
-
/* */
|
1111
|
-
/* */
|
1112
|
-
/* */
|
1113
|
-
/* */
|
1114
|
-
return {
|
1115
|
-
/* */
|
1116
|
-
/* */
|
1117
|
-
/* */
|
1118
|
-
/* */
|
1119
|
-
/* */
|
1120
|
-
/* */
|
1121
|
-
/* */
|
1122
|
-
/* */
|
1123
|
-
/* */
|
1124
|
-
/* */
|
1125
|
-
/* */
|
1126
|
-
/* */
|
1127
|
-
/* */
|
1128
|
-
/* */
|
1129
|
-
/* */
|
1130
|
-
/* */
|
1131
|
-
/* */
|
1132
|
-
/* */
|
1133
|
-
/* */
|
1134
|
-
/* */
|
1135
|
-
/* */
|
1136
|
-
/* */
|
1137
|
-
/* */
|
1138
|
-
/* */
|
1139
|
-
/* */
|
1140
|
-
/* */
|
1141
|
-
/* */
|
1142
|
-
/* */
|
1143
|
-
/* */
|
1144
|
-
/* */
|
1145
|
-
/* */
|
1146
|
-
/* */
|
1147
|
-
/* */
|
1148
|
-
/* */
|
1149
|
-
/* */
|
1150
|
-
/* */
|
1151
|
-
/* */
|
1152
|
-
/* */
|
1153
|
-
/* */
|
1154
|
-
/* */
|
1155
|
-
/* */
|
1156
|
-
/* */
|
1157
|
-
/* */
|
1158
|
-
/* */
|
1159
|
-
/* */
|
1160
|
-
/* */
|
1161
|
-
/* */
|
1162
|
-
/* */
|
1163
|
-
/* */
|
1164
|
-
/* */
|
1165
|
-
/* */
|
1166
|
-
/* */
|
1167
|
-
/* */
|
1168
|
-
/* */
|
1169
|
-
/* */
|
1170
|
-
/* */
|
1171
|
-
/* */
|
1172
|
-
/* */
|
1173
|
-
/* */
|
1174
|
-
/* */
|
1175
|
-
/* */
|
1176
|
-
/* */
|
1177
|
-
/* */
|
1178
|
-
/* */
|
1179
|
-
/* */
|
1180
|
-
/* */
|
1181
|
-
/* */
|
1182
|
-
/* */
|
1183
|
-
/* */
|
1184
|
-
/* */
|
1185
|
-
/* */
|
1186
|
-
/* */
|
1187
|
-
/* */
|
1188
|
-
/* */
|
1189
|
-
/* */
|
1190
|
-
/* */
|
1191
|
-
/* */
|
1192
|
-
/* */
|
1193
|
-
/* */
|
1194
|
-
/* */
|
1195
|
-
/* */
|
1196
|
-
/* */
|
1197
|
-
/* */
|
1198
|
-
/* */
|
1199
|
-
/* */
|
1200
|
-
/* */
|
1127
|
+
killProcess(byPid) {
|
1201
1128
|
/* */
|
1202
1129
|
/* */
|
1203
1130
|
/* */
|
@@ -1218,6 +1145,9 @@ class HelpersCore extends HelpersMessages {
|
|
1218
1145
|
/* */
|
1219
1146
|
/* */
|
1220
1147
|
/* */
|
1148
|
+
}
|
1149
|
+
run(command, options) {
|
1150
|
+
command = Helpers._fixCommand(command);
|
1221
1151
|
/* */
|
1222
1152
|
/* */
|
1223
1153
|
/* */
|
@@ -1226,6 +1156,197 @@ class HelpersCore extends HelpersMessages {
|
|
1226
1156
|
/* */
|
1227
1157
|
/* */
|
1228
1158
|
/* */
|
1159
|
+
return {
|
1160
|
+
/* */
|
1161
|
+
/* */
|
1162
|
+
/* */
|
1163
|
+
/* */
|
1164
|
+
/* */
|
1165
|
+
/* */
|
1166
|
+
/* */
|
1167
|
+
/* */
|
1168
|
+
/* */
|
1169
|
+
/* */
|
1170
|
+
/* */
|
1171
|
+
/* */
|
1172
|
+
/* */
|
1173
|
+
/* */
|
1174
|
+
/* */
|
1175
|
+
/* */
|
1176
|
+
/* */
|
1177
|
+
/* */
|
1178
|
+
/* */
|
1179
|
+
/* */
|
1180
|
+
/* */
|
1181
|
+
/* */
|
1182
|
+
/* */
|
1183
|
+
/* */
|
1184
|
+
async(detach = false, mockFun) {
|
1185
|
+
if (mockFun) {
|
1186
|
+
const subStdoutSub = new Subject();
|
1187
|
+
const subStderSub = new Subject();
|
1188
|
+
const exitSub = new Subject();
|
1189
|
+
const subscribtions = [];
|
1190
|
+
const procDummy = {
|
1191
|
+
stdout: {
|
1192
|
+
on(action, stdoutCallback) {
|
1193
|
+
if (action == 'data') {
|
1194
|
+
subscribtions.push(subStdoutSub.subscribe(d => {
|
1195
|
+
stdoutCallback(d);
|
1196
|
+
}));
|
1197
|
+
}
|
1198
|
+
}
|
1199
|
+
},
|
1200
|
+
stderr: {
|
1201
|
+
on(action, stdoutCallback) {
|
1202
|
+
if (action == 'data') {
|
1203
|
+
subscribtions.push(subStderSub.subscribe(d => {
|
1204
|
+
stdoutCallback(d);
|
1205
|
+
}));
|
1206
|
+
}
|
1207
|
+
}
|
1208
|
+
},
|
1209
|
+
on(action, exitFun) {
|
1210
|
+
if (action == 'exit') {
|
1211
|
+
subscribtions.push(exitSub.subscribe(d => {
|
1212
|
+
exitFun(d);
|
1213
|
+
}));
|
1214
|
+
}
|
1215
|
+
},
|
1216
|
+
ppid: void 0,
|
1217
|
+
pid: void 0,
|
1218
|
+
};
|
1219
|
+
procDummy.pid = Math.round(Math.random() * (1000 - 100)) + 100;
|
1220
|
+
procDummy.ppid = procDummy.pid + 9999;
|
1221
|
+
WEBSQL_PROC_MOCK_PROCESSES_PID[procDummy.pid] = procDummy;
|
1222
|
+
if (!WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid]) {
|
1223
|
+
WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid] = {
|
1224
|
+
childProcesses: [],
|
1225
|
+
};
|
1226
|
+
}
|
1227
|
+
WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid].childProcesses.push(procDummy.pid);
|
1228
|
+
const checkIfProcessShouldBeDead = () => {
|
1229
|
+
return _.isNil(WEBSQL_PROC_MOCK_PROCESSES_PID[procDummy.pid]) || _.isNil(WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid]);
|
1230
|
+
};
|
1231
|
+
const f = Helpers.runSyncOrAsync(mockFun, (d) => {
|
1232
|
+
setTimeout(() => {
|
1233
|
+
subStdoutSub.next(d);
|
1234
|
+
});
|
1235
|
+
}, (d) => {
|
1236
|
+
setTimeout(() => {
|
1237
|
+
subStderSub.next(d);
|
1238
|
+
});
|
1239
|
+
}, () => {
|
1240
|
+
const shouldBeDead = checkIfProcessShouldBeDead();
|
1241
|
+
return shouldBeDead;
|
1242
|
+
});
|
1243
|
+
f.then(exitCode => {
|
1244
|
+
if (_.isNil(exitCode)) {
|
1245
|
+
exitCode = 0;
|
1246
|
+
}
|
1247
|
+
setTimeout(() => {
|
1248
|
+
exitSub.next(exitCode);
|
1249
|
+
subscribtions.forEach(s => s.unsubscribe());
|
1250
|
+
});
|
1251
|
+
}).catch((e) => {
|
1252
|
+
console.error(e);
|
1253
|
+
console.error(`Something wrong with your mock funciton`);
|
1254
|
+
exitSub.next(1);
|
1255
|
+
subscribtions.forEach(s => s.unsubscribe());
|
1256
|
+
});
|
1257
|
+
return procDummy;
|
1258
|
+
}
|
1259
|
+
/* */
|
1260
|
+
/* */
|
1261
|
+
/* */
|
1262
|
+
return (void 0);
|
1263
|
+
},
|
1264
|
+
/* */
|
1265
|
+
/* */
|
1266
|
+
/* */
|
1267
|
+
/* */
|
1268
|
+
/* */
|
1269
|
+
/* */
|
1270
|
+
/* */
|
1271
|
+
/* */
|
1272
|
+
/* */
|
1273
|
+
/* */
|
1274
|
+
/* */
|
1275
|
+
/* */
|
1276
|
+
/* */
|
1277
|
+
/* */
|
1278
|
+
/* */
|
1279
|
+
/* */
|
1280
|
+
/* */
|
1281
|
+
/* */
|
1282
|
+
/* */
|
1283
|
+
/* */
|
1284
|
+
/* */
|
1285
|
+
/* */
|
1286
|
+
/* */
|
1287
|
+
/* */
|
1288
|
+
/* */
|
1289
|
+
/* */
|
1290
|
+
/* */
|
1291
|
+
/* */
|
1292
|
+
/* */
|
1293
|
+
/* */
|
1294
|
+
/* */
|
1295
|
+
/* */
|
1296
|
+
/* */
|
1297
|
+
/* */
|
1298
|
+
/* */
|
1299
|
+
/* */
|
1300
|
+
/* */
|
1301
|
+
/* */
|
1302
|
+
/* */
|
1303
|
+
/* */
|
1304
|
+
/* */
|
1305
|
+
/* */
|
1306
|
+
/* */
|
1307
|
+
/* */
|
1308
|
+
/* */
|
1309
|
+
/* */
|
1310
|
+
/* */
|
1311
|
+
/* */
|
1312
|
+
/* */
|
1313
|
+
/* */
|
1314
|
+
/* */
|
1315
|
+
/* */
|
1316
|
+
/* */
|
1317
|
+
/* */
|
1318
|
+
/* */
|
1319
|
+
/* */
|
1320
|
+
/* */
|
1321
|
+
/* */
|
1322
|
+
/* */
|
1323
|
+
/* */
|
1324
|
+
/* */
|
1325
|
+
/* */
|
1326
|
+
/* */
|
1327
|
+
/* */
|
1328
|
+
/* */
|
1329
|
+
/* */
|
1330
|
+
/* */
|
1331
|
+
/* */
|
1332
|
+
/* */
|
1333
|
+
/* */
|
1334
|
+
/* */
|
1335
|
+
/* */
|
1336
|
+
/* */
|
1337
|
+
/* */
|
1338
|
+
/* */
|
1339
|
+
/* */
|
1340
|
+
/* */
|
1341
|
+
/* */
|
1342
|
+
/* */
|
1343
|
+
/* */
|
1344
|
+
/* */
|
1345
|
+
/* */
|
1346
|
+
/* */
|
1347
|
+
/* */
|
1348
|
+
/* */
|
1349
|
+
/* */
|
1229
1350
|
};
|
1230
1351
|
}
|
1231
1352
|
/* */
|
@@ -1672,5 +1793,5 @@ let Helpers = HelpersCore.InstanceCore;
|
|
1672
1793
|
* Generated bundle index. Do not edit.
|
1673
1794
|
*/
|
1674
1795
|
|
1675
|
-
export { CoreConfig, HelpersCore as CoreHelpers, Helpers, PROGRESS_DATA, crossPlatformPath, win32Path };
|
1796
|
+
export { CoreConfig, HelpersCore as CoreHelpers, Helpers, PROGRESS_DATA, crossPlatformPath, frameworkName, frameworkNameBe, win32Path };
|
1676
1797
|
//# sourceMappingURL=tnp-core.mjs.map
|