tnp-core 19.0.48 → 19.0.50
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/README.md +20 -20
- package/browser/README.md +24 -24
- package/browser/fesm2022/tnp-core.mjs +277 -32
- package/browser/fesm2022/tnp-core.mjs.map +1 -1
- package/browser/lib/helpers.d.ts +10 -2
- package/browser/lib/utils.d.ts +19 -0
- package/browser/package.json +1 -1
- package/cli.backend.js +2 -2
- package/cli.backend.js.map +1 -1
- package/index.js.map +1 -1
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/command-exists.js.map +1 -1
- package/lib/core-cli.js.map +1 -1
- package/lib/core-config.js.map +1 -1
- package/lib/core-imports.js +2 -1
- package/lib/core-imports.js.map +1 -1
- package/lib/core-models.js.map +1 -1
- package/lib/env/env.angular-node-app.d.ts +1 -0
- package/lib/env/env.angular-node-app.js +3 -2
- package/lib/env/env.angular-node-app.js.map +1 -1
- package/lib/env/env.docs-webapp.d.ts +1 -0
- package/lib/env/env.docs-webapp.js +3 -2
- package/lib/env/env.docs-webapp.js.map +1 -1
- package/lib/env/env.electron-app.d.ts +1 -0
- package/lib/env/env.electron-app.js +3 -2
- package/lib/env/env.electron-app.js.map +1 -1
- package/lib/env/env.mobile-app.d.ts +1 -0
- package/lib/env/env.mobile-app.js +3 -2
- package/lib/env/env.mobile-app.js.map +1 -1
- package/lib/env/env.npm-lib-and-cli-tool.d.ts +1 -0
- package/lib/env/env.npm-lib-and-cli-tool.js +3 -2
- package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
- package/lib/env/env.vscode-plugin.d.ts +1 -0
- package/lib/env/env.vscode-plugin.js +3 -2
- package/lib/env/env.vscode-plugin.js.map +1 -1
- package/lib/env/index.js.map +1 -1
- package/lib/framework-name.d.ts +2 -2
- package/lib/framework-name.js.map +1 -1
- package/lib/helpers-isomorphic.js.map +1 -1
- package/lib/helpers-messages.js.map +1 -1
- package/lib/helpers.d.ts +12 -2
- package/lib/helpers.js +25 -27
- package/lib/helpers.js.map +1 -1
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/node-chalk-mock.js +2 -2
- package/lib/node-chalk-mock.js.map +1 -1
- package/lib/node-path-mock.js +2 -2
- package/lib/node-path-mock.js.map +1 -1
- package/lib/progress-data.js.map +1 -1
- package/lib/public-api.js.map +1 -1
- package/lib/required-global-npm-packages.js.map +1 -1
- package/lib/utils.d.ts +19 -0
- package/lib/utils.js +226 -5
- package/lib/utils.js.map +1 -1
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/package.json +1 -1
- package/websql/README.md +24 -24
- package/websql/fesm2022/tnp-core.mjs +277 -32
- package/websql/fesm2022/tnp-core.mjs.map +1 -1
- package/websql/lib/helpers.d.ts +10 -2
- package/websql/lib/utils.d.ts +19 -0
- package/websql/package.json +1 -1
- package/tmp-environment.json +0 -33
@@ -729,7 +729,8 @@ const crossPlatformPath = (pathStringOrPathParts) => {
|
|
729
729
|
}
|
730
730
|
if (hasNonAscii) {
|
731
731
|
const allNonAscii = pathStringOrPathParts.match(/[^\u0000-\u0080]+/g) || '';
|
732
|
-
Helpers.logWarn(`[taon-core][crossPlatformPath]:
|
732
|
+
Helpers.logWarn(`[taon-core][crossPlatformPath]: path below contains non-ascii characters (${allNonAscii}):
|
733
|
+
"${pathStringOrPathParts}"`);
|
733
734
|
Helpers.logWarn(pathStringOrPathParts);
|
734
735
|
}
|
735
736
|
pathStringOrPathParts = (pathStringOrPathParts || '')
|
@@ -2132,6 +2133,7 @@ var UtilsProcess;
|
|
2132
2133
|
return (void 0);
|
2133
2134
|
};
|
2134
2135
|
//#endregion
|
2136
|
+
//#region utils process / get current process and child processes usage
|
2135
2137
|
/**
|
2136
2138
|
* Get CPU and memory usage for a single PID.
|
2137
2139
|
*/
|
@@ -2159,6 +2161,8 @@ var UtilsProcess;
|
|
2159
2161
|
/* */
|
2160
2162
|
return (void 0);
|
2161
2163
|
};
|
2164
|
+
//#endregion
|
2165
|
+
//#region utils process / get child PIDs
|
2162
2166
|
/**
|
2163
2167
|
* Return a list of direct child PIDs for the given PID on a Unix-like system.
|
2164
2168
|
* Uses `ps -o pid= --ppid <pid>` to find child processes.
|
@@ -2181,6 +2185,8 @@ var UtilsProcess;
|
|
2181
2185
|
/* */
|
2182
2186
|
return (void 0);
|
2183
2187
|
}
|
2188
|
+
//#endregion
|
2189
|
+
//#region utils process / get child PIDs on Windows
|
2184
2190
|
/**
|
2185
2191
|
* Return a list of direct child PIDs for the given PID on Windows.
|
2186
2192
|
* Uses `wmic process where (ParentProcessId=<pid>) get ProcessId` to find child processes.
|
@@ -2204,6 +2210,8 @@ var UtilsProcess;
|
|
2204
2210
|
/* */
|
2205
2211
|
return (void 0);
|
2206
2212
|
}
|
2213
|
+
//#endregion
|
2214
|
+
//#region utils process / get child PIDs once
|
2207
2215
|
/**
|
2208
2216
|
* Cross-platform function to list *direct* child PIDs of a given PID.
|
2209
2217
|
* Uses the appropriate command depending on `process.platform`.
|
@@ -2218,6 +2226,8 @@ var UtilsProcess;
|
|
2218
2226
|
return (void 0);
|
2219
2227
|
}
|
2220
2228
|
UtilsProcess.getChildPidsOnce = getChildPidsOnce;
|
2229
|
+
//#endregion
|
2230
|
+
//#region utils process / get current process and child usage
|
2221
2231
|
/**
|
2222
2232
|
* Get CPU and memory usage for the current process (the Node.js process itself),
|
2223
2233
|
* plus any child processes spawned by it.
|
@@ -2250,6 +2260,72 @@ var UtilsProcess;
|
|
2250
2260
|
/* */
|
2251
2261
|
return (void 0);
|
2252
2262
|
};
|
2263
|
+
//#endregion
|
2264
|
+
//#region kill process on port
|
2265
|
+
UtilsProcess.killProcessOnPort = async (port) => {
|
2266
|
+
if (!port || isNaN(port) || UtilsOs.isBrowser) {
|
2267
|
+
Helpers.warn(`[UtilsProcess.killProcessOnPort]: Invalid port number: ${port}`);
|
2268
|
+
return false;
|
2269
|
+
}
|
2270
|
+
/* */
|
2271
|
+
/* */
|
2272
|
+
/* */
|
2273
|
+
/* */
|
2274
|
+
/* */
|
2275
|
+
/* */
|
2276
|
+
/* */
|
2277
|
+
/* */
|
2278
|
+
/* */
|
2279
|
+
/* */
|
2280
|
+
/* */
|
2281
|
+
/* */
|
2282
|
+
/* */
|
2283
|
+
/* */
|
2284
|
+
/* */
|
2285
|
+
/* */
|
2286
|
+
/* */
|
2287
|
+
/* */
|
2288
|
+
/* */
|
2289
|
+
/* */
|
2290
|
+
/* */
|
2291
|
+
/* */
|
2292
|
+
/* */
|
2293
|
+
/* */
|
2294
|
+
/* */
|
2295
|
+
/* */
|
2296
|
+
/* */
|
2297
|
+
/* */
|
2298
|
+
/* */
|
2299
|
+
/* */
|
2300
|
+
/* */
|
2301
|
+
/* */
|
2302
|
+
/* */
|
2303
|
+
/* */
|
2304
|
+
/* */
|
2305
|
+
/* */
|
2306
|
+
/* */
|
2307
|
+
/* */
|
2308
|
+
/* */
|
2309
|
+
/* */
|
2310
|
+
/* */
|
2311
|
+
/* */
|
2312
|
+
/* */
|
2313
|
+
/* */
|
2314
|
+
/* */
|
2315
|
+
/* */
|
2316
|
+
/* */
|
2317
|
+
/* */
|
2318
|
+
/* */
|
2319
|
+
/* */
|
2320
|
+
/* */
|
2321
|
+
/* */
|
2322
|
+
/* */
|
2323
|
+
/* */
|
2324
|
+
/* */
|
2325
|
+
/* */
|
2326
|
+
return (void 0);
|
2327
|
+
};
|
2328
|
+
//#endregion
|
2253
2329
|
})(UtilsProcess || (UtilsProcess = {}));
|
2254
2330
|
//#endregion
|
2255
2331
|
//#region utils os
|
@@ -2448,6 +2524,44 @@ var UtilsOs;
|
|
2448
2524
|
/* */
|
2449
2525
|
/* */
|
2450
2526
|
/* */
|
2527
|
+
/* */
|
2528
|
+
/* */
|
2529
|
+
/* */
|
2530
|
+
/* */
|
2531
|
+
/* */
|
2532
|
+
/* */
|
2533
|
+
/* */
|
2534
|
+
/* */
|
2535
|
+
/* */
|
2536
|
+
/* */
|
2537
|
+
/* */
|
2538
|
+
/* */
|
2539
|
+
/* */
|
2540
|
+
/* */
|
2541
|
+
/* */
|
2542
|
+
/* */
|
2543
|
+
/* */
|
2544
|
+
/* */
|
2545
|
+
/* */
|
2546
|
+
/* */
|
2547
|
+
/* */
|
2548
|
+
/* */
|
2549
|
+
/* */
|
2550
|
+
/* */
|
2551
|
+
/* */
|
2552
|
+
/* */
|
2553
|
+
/* */
|
2554
|
+
/* */
|
2555
|
+
/* */
|
2556
|
+
/* */
|
2557
|
+
/* */
|
2558
|
+
/* */
|
2559
|
+
/* */
|
2560
|
+
/* */
|
2561
|
+
/* */
|
2562
|
+
/* */
|
2563
|
+
/* */
|
2564
|
+
/* */
|
2451
2565
|
return (void 0);
|
2452
2566
|
};
|
2453
2567
|
//#endregion
|
@@ -2541,6 +2655,27 @@ var UtilsOs;
|
|
2541
2655
|
return (void 0);
|
2542
2656
|
};
|
2543
2657
|
//#endregion
|
2658
|
+
//#region utils os / is docker available
|
2659
|
+
UtilsOs.isDockerAvailable = async () => {
|
2660
|
+
if (UtilsOs.isBrowser) {
|
2661
|
+
return false;
|
2662
|
+
}
|
2663
|
+
/* */
|
2664
|
+
/* */
|
2665
|
+
/* */
|
2666
|
+
/* */
|
2667
|
+
/* */
|
2668
|
+
/* */
|
2669
|
+
/* */
|
2670
|
+
/* */
|
2671
|
+
/* */
|
2672
|
+
/* */
|
2673
|
+
/* */
|
2674
|
+
/* */
|
2675
|
+
/* */
|
2676
|
+
return (void 0);
|
2677
|
+
};
|
2678
|
+
//#endregion
|
2544
2679
|
UtilsOs.openFolderInVSCode = (folderPath) => {
|
2545
2680
|
/* */
|
2546
2681
|
/* */
|
@@ -2666,6 +2801,17 @@ var UtilsTerminal;
|
|
2666
2801
|
});
|
2667
2802
|
};
|
2668
2803
|
//#endregion
|
2804
|
+
//#region wait
|
2805
|
+
UtilsTerminal.waitMiliseconds = (miliseconds) => {
|
2806
|
+
// Helpers.taskStarted(`Waiting ${miliseconds} miliseconds...`);
|
2807
|
+
return new Promise((resolve, reject) => {
|
2808
|
+
setTimeout(() => {
|
2809
|
+
// Helpers.taskDone(`Done waiting ${miliseconds} miliseconds`);
|
2810
|
+
resolve(void 0);
|
2811
|
+
}, miliseconds);
|
2812
|
+
});
|
2813
|
+
};
|
2814
|
+
//#endregion
|
2669
2815
|
//#region clear
|
2670
2816
|
UtilsTerminal.clearConsole = () => {
|
2671
2817
|
/* */
|
@@ -3212,6 +3358,103 @@ var UtilsTerminal;
|
|
3212
3358
|
//#endregion
|
3213
3359
|
})(UtilsTerminal || (UtilsTerminal = {}));
|
3214
3360
|
//#endregion
|
3361
|
+
//#region utils json
|
3362
|
+
var UtilsJson;
|
3363
|
+
(function (UtilsJson) {
|
3364
|
+
//#region read json
|
3365
|
+
/**
|
3366
|
+
* read json from absolute path
|
3367
|
+
* @returns json object
|
3368
|
+
*/
|
3369
|
+
UtilsJson.readJson = (absoluteFilePath, defaultValue = {}, useJson5 = false) => {
|
3370
|
+
/* */
|
3371
|
+
/* */
|
3372
|
+
/* */
|
3373
|
+
/* */
|
3374
|
+
/* */
|
3375
|
+
/* */
|
3376
|
+
/* */
|
3377
|
+
/* */
|
3378
|
+
/* */
|
3379
|
+
/* */
|
3380
|
+
/* */
|
3381
|
+
/* */
|
3382
|
+
/* */
|
3383
|
+
/* */
|
3384
|
+
/* */
|
3385
|
+
/* */
|
3386
|
+
/* */
|
3387
|
+
/* */
|
3388
|
+
/* */
|
3389
|
+
return (void 0);
|
3390
|
+
};
|
3391
|
+
//#endregion
|
3392
|
+
//#region read json with comments
|
3393
|
+
UtilsJson.readJsonWithComments = (absoluteFilePath, defaultValue = {}) => {
|
3394
|
+
/* */
|
3395
|
+
/* */
|
3396
|
+
return (void 0);
|
3397
|
+
};
|
3398
|
+
//#endregion
|
3399
|
+
})(UtilsJson || (UtilsJson = {}));
|
3400
|
+
//#endregion
|
3401
|
+
var UtilsYaml;
|
3402
|
+
(function (UtilsYaml) {
|
3403
|
+
UtilsYaml.yamlToJson = (yamlString) => {
|
3404
|
+
/* */
|
3405
|
+
/* */
|
3406
|
+
/* */
|
3407
|
+
/* */
|
3408
|
+
/* */
|
3409
|
+
/* */
|
3410
|
+
/* */
|
3411
|
+
/* */
|
3412
|
+
/* */
|
3413
|
+
return (void 0);
|
3414
|
+
};
|
3415
|
+
UtilsYaml.jsonToYaml = (json) => {
|
3416
|
+
/* */
|
3417
|
+
/* */
|
3418
|
+
/* */
|
3419
|
+
/* */
|
3420
|
+
/* */
|
3421
|
+
/* */
|
3422
|
+
/* */
|
3423
|
+
/* */
|
3424
|
+
/* */
|
3425
|
+
/* */
|
3426
|
+
/* */
|
3427
|
+
/* */
|
3428
|
+
return (void 0);
|
3429
|
+
};
|
3430
|
+
//#region read yaml as json
|
3431
|
+
UtilsYaml.readYamlAsJson = (absFilePathToYamlOrYmlFile, options) => {
|
3432
|
+
/* */
|
3433
|
+
/* */
|
3434
|
+
/* */
|
3435
|
+
/* */
|
3436
|
+
/* */
|
3437
|
+
/* */
|
3438
|
+
/* */
|
3439
|
+
/* */
|
3440
|
+
/* */
|
3441
|
+
/* */
|
3442
|
+
/* */
|
3443
|
+
return (void 0);
|
3444
|
+
};
|
3445
|
+
//#endregion
|
3446
|
+
//#region write json to yaml
|
3447
|
+
UtilsYaml.writeJsonToYaml = (destinationYamlfileAbsPath, json) => {
|
3448
|
+
/* */
|
3449
|
+
/* */
|
3450
|
+
/* */
|
3451
|
+
/* */
|
3452
|
+
/* */
|
3453
|
+
/* */
|
3454
|
+
return (void 0);
|
3455
|
+
};
|
3456
|
+
//#endregion
|
3457
|
+
})(UtilsYaml || (UtilsYaml = {}));
|
3215
3458
|
|
3216
3459
|
class HelpersIsomorphic {
|
3217
3460
|
/**
|
@@ -4979,6 +5222,9 @@ class HelpersCore extends HelpersMessages {
|
|
4979
5222
|
/* */
|
4980
5223
|
//#endregion
|
4981
5224
|
//#region methods / kill process by port
|
5225
|
+
/**
|
5226
|
+
* @deprecated use UtilsProcess.killProcessOnPort
|
5227
|
+
*/
|
4982
5228
|
async killProcessByPort(portOrPortsToKill, options) {
|
4983
5229
|
/* */
|
4984
5230
|
/* */
|
@@ -5831,42 +6077,22 @@ class HelpersCore extends HelpersMessages {
|
|
5831
6077
|
//#endregion
|
5832
6078
|
//#region methods / read json
|
5833
6079
|
/**
|
5834
|
-
*
|
5835
|
-
* @returns json object
|
6080
|
+
* @deprecated use UtilsJson.readJson or UtilsJson.readJson5
|
5836
6081
|
*/
|
5837
6082
|
readJson(absoluteFilePath, defaultValue = {}, useJson5 = false) {
|
5838
|
-
|
5839
|
-
/* */
|
5840
|
-
/* */
|
5841
|
-
/* */
|
5842
|
-
/* */
|
5843
|
-
/* */
|
5844
|
-
/* */
|
5845
|
-
/* */
|
5846
|
-
/* */
|
5847
|
-
/* */
|
5848
|
-
/* */
|
5849
|
-
/* */
|
5850
|
-
/* */
|
5851
|
-
/* */
|
5852
|
-
/* */
|
5853
|
-
/* */
|
5854
|
-
/* */
|
5855
|
-
/* */
|
5856
|
-
/* */
|
5857
|
-
/* */
|
5858
|
-
/* */
|
5859
|
-
return (void 0);
|
6083
|
+
return UtilsJson.readJson(absoluteFilePath, defaultValue, useJson5);
|
5860
6084
|
}
|
6085
|
+
/**
|
6086
|
+
* @deprecated use UtilsJson.readJsonWithComments
|
6087
|
+
*/
|
5861
6088
|
readJson5(absoluteFilePath, defaultValue = {}) {
|
5862
|
-
|
5863
|
-
/* */
|
5864
|
-
return (void 0);
|
6089
|
+
return UtilsJson.readJsonWithComments(absoluteFilePath, defaultValue);
|
5865
6090
|
}
|
6091
|
+
/**
|
6092
|
+
* @deprecated use UtilsJson.readJsonWithComments
|
6093
|
+
*/
|
5866
6094
|
readJsonC(absoluteFilePath, defaultValue = {}) {
|
5867
|
-
|
5868
|
-
/* */
|
5869
|
-
return (void 0);
|
6095
|
+
return UtilsJson.readJsonWithComments(absoluteFilePath, defaultValue);
|
5870
6096
|
}
|
5871
6097
|
//#endregion
|
5872
6098
|
//#region methods / parse
|
@@ -6134,6 +6360,25 @@ class HelpersCore extends HelpersMessages {
|
|
6134
6360
|
/* */
|
6135
6361
|
/* */
|
6136
6362
|
/* */
|
6363
|
+
/* */
|
6364
|
+
/* */
|
6365
|
+
/* */
|
6366
|
+
/* */
|
6367
|
+
/* */
|
6368
|
+
/* */
|
6369
|
+
/* */
|
6370
|
+
/* */
|
6371
|
+
/* */
|
6372
|
+
/* */
|
6373
|
+
/* */
|
6374
|
+
/* */
|
6375
|
+
/* */
|
6376
|
+
/* */
|
6377
|
+
/* */
|
6378
|
+
/* */
|
6379
|
+
/* */
|
6380
|
+
/* */
|
6381
|
+
/* */
|
6137
6382
|
//#endregion
|
6138
6383
|
//#region methods / links from
|
6139
6384
|
/* */
|
@@ -6471,5 +6716,5 @@ let Helpers = HelpersCore.InstanceCore;
|
|
6471
6716
|
* Generated bundle index. Do not edit.
|
6472
6717
|
*/
|
6473
6718
|
|
6474
|
-
export { $, CLI, CoreConfig, HelpersCore as CoreHelpers, CoreModels, Helpers, PROGRESS_DATA, Utils, UtilsMigrations, UtilsOs, UtilsProcess, UtilsString, UtilsTerminal, chalk, child_process, chokidar, crossPlatformPath, fg, fkill, frameworkName, frameworkNameBe, fse, glob, http, https, isElevated, mkdirp, ncp, net, os, path, ps, psList, requiredForDev, rimraf, spawn, win32Path };
|
6719
|
+
export { $, CLI, CoreConfig, HelpersCore as CoreHelpers, CoreModels, Helpers, PROGRESS_DATA, Utils, UtilsJson, UtilsMigrations, UtilsOs, UtilsProcess, UtilsString, UtilsTerminal, UtilsYaml, chalk, child_process, chokidar, crossPlatformPath, fg, fkill, frameworkName, frameworkNameBe, fse, glob, http, https, isElevated, mkdirp, ncp, net, os, path, ps, psList, requiredForDev, rimraf, spawn, win32Path };
|
6475
6720
|
//# sourceMappingURL=tnp-core.mjs.map
|