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,6 +4,19 @@ 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 };
|
9
|
+
import { Subject } from 'rxjs';
|
10
|
+
|
11
|
+
let isBrowser = false;
|
12
|
+
isBrowser = true;
|
13
|
+
const frameworkNameBe = (''
|
14
|
+
/* */
|
15
|
+
/* */
|
16
|
+
);
|
17
|
+
const frameworkName = isBrowser ? 'firedev' : frameworkNameBe;
|
18
|
+
;
|
19
|
+
({}); // @--end-of-file-for-module=tnp-core lib/framework-name.ts
|
7
20
|
|
8
21
|
/* */
|
9
22
|
/* */
|
@@ -546,6 +559,7 @@ class HelpersMessages extends HelpersIsomorphic {
|
|
546
559
|
/* */
|
547
560
|
/* */
|
548
561
|
/* */
|
562
|
+
/* */
|
549
563
|
}
|
550
564
|
}
|
551
565
|
function transformData(details) {
|
@@ -567,6 +581,8 @@ function transformData(details) {
|
|
567
581
|
({}); // @--end-of-file-for-module=tnp-core lib/helpers-messages.ts
|
568
582
|
|
569
583
|
const encoding = 'utf8';
|
584
|
+
const WEBSQL_PROC_MOCK_PROCESSES_PID = {};
|
585
|
+
const WEBSQL_PROC_MOCK_PROCESSES_PPID = {};
|
570
586
|
class HelpersCore extends HelpersMessages {
|
571
587
|
constructor() {
|
572
588
|
super();
|
@@ -1028,6 +1044,13 @@ class HelpersCore extends HelpersMessages {
|
|
1028
1044
|
/* */
|
1029
1045
|
};
|
1030
1046
|
}
|
1047
|
+
wait(second) {
|
1048
|
+
return new Promise((resolve, reject) => {
|
1049
|
+
setTimeout(() => {
|
1050
|
+
resolve(void 0);
|
1051
|
+
}, second * 1000);
|
1052
|
+
});
|
1053
|
+
}
|
1031
1054
|
/* */
|
1032
1055
|
/* */
|
1033
1056
|
/* */
|
@@ -1098,103 +1121,7 @@ class HelpersCore extends HelpersMessages {
|
|
1098
1121
|
/* */
|
1099
1122
|
/* */
|
1100
1123
|
/* */
|
1101
|
-
|
1102
|
-
command = Helpers._fixCommand(command);
|
1103
|
-
/* */
|
1104
|
-
/* */
|
1105
|
-
/* */
|
1106
|
-
/* */
|
1107
|
-
/* */
|
1108
|
-
/* */
|
1109
|
-
/* */
|
1110
|
-
/* */
|
1111
|
-
return {
|
1112
|
-
/* */
|
1113
|
-
/* */
|
1114
|
-
/* */
|
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
|
-
/* */
|
1124
|
+
killProcess(byPid) {
|
1198
1125
|
/* */
|
1199
1126
|
/* */
|
1200
1127
|
/* */
|
@@ -1215,6 +1142,9 @@ class HelpersCore extends HelpersMessages {
|
|
1215
1142
|
/* */
|
1216
1143
|
/* */
|
1217
1144
|
/* */
|
1145
|
+
}
|
1146
|
+
run(command, options) {
|
1147
|
+
command = Helpers._fixCommand(command);
|
1218
1148
|
/* */
|
1219
1149
|
/* */
|
1220
1150
|
/* */
|
@@ -1223,6 +1153,197 @@ class HelpersCore extends HelpersMessages {
|
|
1223
1153
|
/* */
|
1224
1154
|
/* */
|
1225
1155
|
/* */
|
1156
|
+
return {
|
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
|
+
async(detach = false, mockFun) {
|
1182
|
+
if (mockFun) {
|
1183
|
+
const subStdoutSub = new Subject();
|
1184
|
+
const subStderSub = new Subject();
|
1185
|
+
const exitSub = new Subject();
|
1186
|
+
const subscribtions = [];
|
1187
|
+
const procDummy = {
|
1188
|
+
stdout: {
|
1189
|
+
on(action, stdoutCallback) {
|
1190
|
+
if (action == 'data') {
|
1191
|
+
subscribtions.push(subStdoutSub.subscribe(d => {
|
1192
|
+
stdoutCallback(d);
|
1193
|
+
}));
|
1194
|
+
}
|
1195
|
+
}
|
1196
|
+
},
|
1197
|
+
stderr: {
|
1198
|
+
on(action, stdoutCallback) {
|
1199
|
+
if (action == 'data') {
|
1200
|
+
subscribtions.push(subStderSub.subscribe(d => {
|
1201
|
+
stdoutCallback(d);
|
1202
|
+
}));
|
1203
|
+
}
|
1204
|
+
}
|
1205
|
+
},
|
1206
|
+
on(action, exitFun) {
|
1207
|
+
if (action == 'exit') {
|
1208
|
+
subscribtions.push(exitSub.subscribe(d => {
|
1209
|
+
exitFun(d);
|
1210
|
+
}));
|
1211
|
+
}
|
1212
|
+
},
|
1213
|
+
ppid: void 0,
|
1214
|
+
pid: void 0,
|
1215
|
+
};
|
1216
|
+
procDummy.pid = Math.round(Math.random() * (1000 - 100)) + 100;
|
1217
|
+
procDummy.ppid = procDummy.pid + 9999;
|
1218
|
+
WEBSQL_PROC_MOCK_PROCESSES_PID[procDummy.pid] = procDummy;
|
1219
|
+
if (!WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid]) {
|
1220
|
+
WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid] = {
|
1221
|
+
childProcesses: [],
|
1222
|
+
};
|
1223
|
+
}
|
1224
|
+
WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid].childProcesses.push(procDummy.pid);
|
1225
|
+
const checkIfProcessShouldBeDead = () => {
|
1226
|
+
return _.isNil(WEBSQL_PROC_MOCK_PROCESSES_PID[procDummy.pid]) || _.isNil(WEBSQL_PROC_MOCK_PROCESSES_PPID[procDummy.ppid]);
|
1227
|
+
};
|
1228
|
+
const f = Helpers.runSyncOrAsync(mockFun, (d) => {
|
1229
|
+
setTimeout(() => {
|
1230
|
+
subStdoutSub.next(d);
|
1231
|
+
});
|
1232
|
+
}, (d) => {
|
1233
|
+
setTimeout(() => {
|
1234
|
+
subStderSub.next(d);
|
1235
|
+
});
|
1236
|
+
}, () => {
|
1237
|
+
const shouldBeDead = checkIfProcessShouldBeDead();
|
1238
|
+
return shouldBeDead;
|
1239
|
+
});
|
1240
|
+
f.then(exitCode => {
|
1241
|
+
if (_.isNil(exitCode)) {
|
1242
|
+
exitCode = 0;
|
1243
|
+
}
|
1244
|
+
setTimeout(() => {
|
1245
|
+
exitSub.next(exitCode);
|
1246
|
+
subscribtions.forEach(s => s.unsubscribe());
|
1247
|
+
});
|
1248
|
+
}).catch((e) => {
|
1249
|
+
console.error(e);
|
1250
|
+
console.error(`Something wrong with your mock funciton`);
|
1251
|
+
exitSub.next(1);
|
1252
|
+
subscribtions.forEach(s => s.unsubscribe());
|
1253
|
+
});
|
1254
|
+
return procDummy;
|
1255
|
+
}
|
1256
|
+
/* */
|
1257
|
+
/* */
|
1258
|
+
/* */
|
1259
|
+
return (void 0);
|
1260
|
+
},
|
1261
|
+
/* */
|
1262
|
+
/* */
|
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
|
+
/* */
|
1226
1347
|
};
|
1227
1348
|
}
|
1228
1349
|
/* */
|
@@ -1669,5 +1790,5 @@ let Helpers = HelpersCore.InstanceCore;
|
|
1669
1790
|
* Generated bundle index. Do not edit.
|
1670
1791
|
*/
|
1671
1792
|
|
1672
|
-
export { CoreConfig, HelpersCore as CoreHelpers, Helpers, PROGRESS_DATA, crossPlatformPath, win32Path };
|
1793
|
+
export { CoreConfig, HelpersCore as CoreHelpers, Helpers, PROGRESS_DATA, crossPlatformPath, frameworkName, frameworkNameBe, win32Path };
|
1673
1794
|
//# sourceMappingURL=tnp-core.mjs.map
|
@@ -2,6 +2,7 @@
|
|
2
2
|
import * as _ from 'lodash';
|
3
3
|
import * as q from 'q';
|
4
4
|
import * as moment from 'moment';
|
5
|
+
import * as dateformat from 'dateformat';
|
5
6
|
declare function win32Path(p: string): any;
|
6
7
|
declare function crossPlatformPath(p: string): string;
|
7
|
-
export { _, q, moment, crossPlatformPath, win32Path, };
|
8
|
+
export { _, q, moment, dateformat, crossPlatformPath, win32Path, };
|
package/client/lib/helpers.d.ts
CHANGED
@@ -39,7 +39,11 @@ export declare class HelpersCore extends HelpersMessages {
|
|
39
39
|
exists(folderOrFilePath: string | string[]): any;
|
40
40
|
_fixCommand(command: string): string;
|
41
41
|
command(command: string): {};
|
42
|
-
|
42
|
+
wait(second: number): Promise<unknown>;
|
43
|
+
killProcess(byPid: number): void;
|
44
|
+
run(command: string, options?: RunOptions): {
|
45
|
+
async(detach?: boolean, mockFun?: (stdoutCallback: (dataForStdout: any) => any, stdErrcCallback: (dataForStder: any) => any, shouldProcesBeDead?: () => boolean) => Promise<number> | number): any;
|
46
|
+
};
|
43
47
|
/**
|
44
48
|
* Quick fix for object values
|
45
49
|
*/
|
package/client/lib/index.d.ts
CHANGED
package/lib/core-imports.d.ts
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
import * as _ from 'lodash';
|
3
3
|
import * as q from 'q';
|
4
4
|
import * as moment from 'moment';
|
5
|
+
import * as dateformat from 'dateformat';
|
5
6
|
import * as pathBase from 'path';
|
6
7
|
import * as os from 'os';
|
7
8
|
import * as child_process from 'child_process';
|
@@ -9,7 +10,6 @@ import * as http from 'http';
|
|
9
10
|
import * as https from 'https';
|
10
11
|
import * as net from 'net';
|
11
12
|
import chalk from 'chalk';
|
12
|
-
import * as dateformat from 'dateformat';
|
13
13
|
import * as spawn from 'cross-spawn';
|
14
14
|
import * as glob from 'glob';
|
15
15
|
import * as fse from 'fs-extra';
|
@@ -26,6 +26,6 @@ declare function isElevated(): Promise<any>;
|
|
26
26
|
declare let path: typeof pathBase;
|
27
27
|
declare function win32Path(p: string): string;
|
28
28
|
declare function crossPlatformPath(p: string): string;
|
29
|
-
export { _, q, moment, crossPlatformPath, win32Path, };
|
29
|
+
export { _, q, moment, dateformat, crossPlatformPath, win32Path, };
|
30
30
|
export { path };
|
31
|
-
export {
|
31
|
+
export { spawn, chalk, glob, isElevated, chokidar, mkdirp, ncp, json5, fse, os, child_process, http, https, rimraf, net, ps, fkill, portfinder, psList, };
|
package/lib/core-imports.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.psList = exports.portfinder = exports.fkill = exports.ps = exports.net = exports.rimraf = exports.https = exports.http = exports.child_process = exports.os = exports.fse = exports.json5 = exports.ncp = exports.mkdirp = exports.chokidar = exports.isElevated = exports.glob = exports.chalk = exports.spawn = exports.
|
3
|
+
exports.psList = exports.portfinder = exports.fkill = exports.ps = exports.net = exports.rimraf = exports.https = exports.http = exports.child_process = exports.os = exports.fse = exports.json5 = exports.ncp = exports.mkdirp = exports.chokidar = exports.isElevated = exports.glob = exports.chalk = exports.spawn = exports.path = exports.win32Path = exports.crossPlatformPath = exports.dateformat = exports.moment = exports.q = exports._ = void 0;
|
4
4
|
var tslib_1 = require("tslib");
|
5
5
|
var _ = require("lodash");
|
6
6
|
exports._ = _;
|
@@ -8,6 +8,8 @@ var q = require("q");
|
|
8
8
|
exports.q = q;
|
9
9
|
var moment = require("moment");
|
10
10
|
exports.moment = moment;
|
11
|
+
var dateformat = require("dateformat");
|
12
|
+
exports.dateformat = dateformat;
|
11
13
|
//#region @backend
|
12
14
|
var pathBase = require("path");
|
13
15
|
var os = require("os");
|
@@ -22,8 +24,6 @@ var net = require("net");
|
|
22
24
|
exports.net = net;
|
23
25
|
var chalk_1 = require("chalk");
|
24
26
|
exports.chalk = chalk_1.default;
|
25
|
-
var dateformat = require("dateformat");
|
26
|
-
exports.dateformat = dateformat;
|
27
27
|
var spawn = require("cross-spawn");
|
28
28
|
exports.spawn = spawn;
|
29
29
|
var glob = require("glob");
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.frameworkName = exports.frameworkNameBe = void 0;
|
4
|
+
var isBrowser = false;
|
5
|
+
/* */
|
6
|
+
/* */
|
7
|
+
exports.frameworkNameBe = (''
|
8
|
+
//#region @backend
|
9
|
+
|| (global['frameworkName'] ? global['frameworkName'] : 'tnp')
|
10
|
+
//#endregion
|
11
|
+
);
|
12
|
+
exports.frameworkName = isBrowser ? 'firedev' : exports.frameworkNameBe;
|
13
|
+
//# sourceMappingURL=framework-name.js.map
|
package/lib/helpers.d.ts
CHANGED
@@ -62,11 +62,13 @@ export declare class HelpersCore extends HelpersMessages {
|
|
62
62
|
gatherColors?: boolean;
|
63
63
|
}): Promise<string>;
|
64
64
|
};
|
65
|
+
wait(second: number): Promise<unknown>;
|
65
66
|
commnadOutputAsStringAsync(command: string, cwd?: string, options?: CommandOutputOptions): Promise<string>;
|
66
67
|
commnadOutputAsString(command: string, cwd?: string, options?: CommandOutputOptions): string;
|
68
|
+
killProcess(byPid: number): void;
|
67
69
|
run(command: string, options?: RunOptions): {
|
68
70
|
sync(): string;
|
69
|
-
async(detach?: boolean):
|
71
|
+
async(detach?: boolean, mockFun?: (stdoutCallback: (dataForStdout: any) => any, stdErrcCallback: (dataForStder: any) => any, shouldProcesBeDead?: () => boolean) => Promise<number> | number): any;
|
70
72
|
asyncAsPromise(): any;
|
71
73
|
unitlOutputContains(stdoutMsg: string | string[], stderMsg?: string | string[]): Promise<any>;
|
72
74
|
};
|
@@ -124,4 +126,4 @@ export declare class HelpersCore extends HelpersMessages {
|
|
124
126
|
*/
|
125
127
|
filesFrom(pathToFolder: string | string[], recrusive?: boolean): string[];
|
126
128
|
openFolderInFileExploer(folderPath: string): void;
|
127
|
-
}
|
129
|
+
}
|
package/lib/helpers.js
CHANGED
@@ -8,6 +8,8 @@ var helpers_messages_1 = require("./helpers-messages");
|
|
8
8
|
var encoding = 'utf8';
|
9
9
|
//#region @backend
|
10
10
|
var trace = !global.hideLog;
|
11
|
+
var WEBSQL_PROC_MOCK_PROCESSES_PID = {};
|
12
|
+
var WEBSQL_PROC_MOCK_PROCESSES_PPID = {};
|
11
13
|
var HelpersCore = /** @class */ (function (_super) {
|
12
14
|
tslib_1.__extends(HelpersCore, _super);
|
13
15
|
function HelpersCore() {
|
@@ -263,7 +265,7 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
263
265
|
index_1.Helpers.remove(folderPath);
|
264
266
|
}
|
265
267
|
if (core_imports_1.fse.existsSync(folderPath)) {
|
266
|
-
index_1.Helpers.
|
268
|
+
index_1.Helpers.log("[firedev-core][mkdirp] folder path already exists: ".concat(folderPath));
|
267
269
|
}
|
268
270
|
else {
|
269
271
|
// if(Helpers.isSymlinkFileExitedOrUnexisted(folderPath)) {
|
@@ -445,6 +447,13 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
445
447
|
//#endregion
|
446
448
|
};
|
447
449
|
};
|
450
|
+
HelpersCore.prototype.wait = function (second) {
|
451
|
+
return new Promise(function (resolve, reject) {
|
452
|
+
setTimeout(function () {
|
453
|
+
resolve(void 0);
|
454
|
+
}, second * 1000);
|
455
|
+
});
|
456
|
+
};
|
448
457
|
//#region command output as string async
|
449
458
|
//#region @backend
|
450
459
|
HelpersCore.prototype.commnadOutputAsStringAsync = function (command, cwd, options) {
|
@@ -526,20 +535,43 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
526
535
|
};
|
527
536
|
//#endregion
|
528
537
|
//#endregion
|
538
|
+
HelpersCore.prototype.killProcess = function (byPid) {
|
539
|
+
/* */
|
540
|
+
/* */
|
541
|
+
/* */
|
542
|
+
/* */
|
543
|
+
/* */
|
544
|
+
/* */
|
545
|
+
/* */
|
546
|
+
/* */
|
547
|
+
/* */
|
548
|
+
/* */
|
549
|
+
/* */
|
550
|
+
/* */
|
551
|
+
/* */
|
552
|
+
/* */
|
553
|
+
/* */
|
554
|
+
/* */
|
555
|
+
/* */
|
556
|
+
/* */
|
557
|
+
//#region @backend
|
558
|
+
index_1.Helpers.run("kill -9 ".concat(byPid)).sync();
|
559
|
+
//#endregion
|
560
|
+
};
|
529
561
|
HelpersCore.prototype.run = function (command, options) {
|
530
562
|
command = index_1.Helpers._fixCommand(command);
|
531
563
|
// console.log({ command })
|
532
564
|
//#region @backend
|
533
565
|
if (!options)
|
534
566
|
options = {};
|
535
|
-
if (options.output ===
|
567
|
+
if (options.output === void 0)
|
536
568
|
options.output = true;
|
537
|
-
if (options.biggerBuffer ===
|
569
|
+
if (options.biggerBuffer === void 0)
|
538
570
|
options.biggerBuffer = false;
|
539
|
-
if (options.cwd ===
|
571
|
+
if (options.cwd === void 0)
|
540
572
|
options.cwd = (0, core_imports_1.crossPlatformPath)(process.cwd());
|
541
573
|
if (!core_imports_1._.isString(command)) {
|
542
|
-
index_1.Helpers.error("[
|
574
|
+
index_1.Helpers.error("[firedev-helpers] command is not a string");
|
543
575
|
}
|
544
576
|
//#endregion
|
545
577
|
return {
|
@@ -560,11 +592,103 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
560
592
|
}
|
561
593
|
return index_1.Helpers.runSyncIn(command, options);
|
562
594
|
},
|
595
|
+
//#endregion
|
596
|
+
//#region websql
|
563
597
|
async: function (detach) {
|
598
|
+
//#region mock of process
|
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
|
+
/* */
|
646
|
+
/* */
|
647
|
+
/* */
|
648
|
+
/* */
|
649
|
+
/* */
|
650
|
+
/* */
|
651
|
+
/* */
|
652
|
+
/* */
|
653
|
+
/* */
|
654
|
+
/* */
|
655
|
+
/* */
|
656
|
+
/* */
|
657
|
+
/* */
|
658
|
+
/* */
|
659
|
+
/* */
|
660
|
+
/* */
|
661
|
+
/* */
|
662
|
+
/* */
|
663
|
+
/* */
|
664
|
+
/* */
|
665
|
+
/* */
|
666
|
+
/* */
|
667
|
+
/* */
|
668
|
+
/* */
|
669
|
+
/* */
|
670
|
+
/* */
|
671
|
+
/* */
|
672
|
+
/* */
|
673
|
+
/* */
|
674
|
+
/* */
|
675
|
+
/* */
|
676
|
+
/* */
|
677
|
+
/* */
|
678
|
+
/* */
|
679
|
+
/* */
|
680
|
+
/* */
|
681
|
+
/* */
|
682
|
+
/* */
|
564
683
|
if (detach === void 0) { detach = false; }
|
684
|
+
//#endregion
|
685
|
+
//#region @backendFunc
|
565
686
|
options.detach = detach;
|
566
687
|
return index_1.Helpers.runAsyncIn(command, options);
|
688
|
+
//#endregion
|
567
689
|
},
|
690
|
+
//#endregion
|
691
|
+
//#region @backend
|
568
692
|
asyncAsPromise: function () {
|
569
693
|
var isResolved = false;
|
570
694
|
return new Promise(function (resolve, reject) {
|
@@ -583,6 +707,8 @@ var HelpersCore = /** @class */ (function (_super) {
|
|
583
707
|
});
|
584
708
|
});
|
585
709
|
},
|
710
|
+
//#endregion
|
711
|
+
//#region @backend
|
586
712
|
unitlOutputContains: function (stdoutMsg, stderMsg) {
|
587
713
|
var isResolved = false;
|
588
714
|
return new Promise(function (resolve, reject) {
|
package/lib/index.d.ts
CHANGED