tnp-core 19.0.49 → 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/browser/fesm2022/tnp-core.mjs +110 -0
- package/browser/fesm2022/tnp-core.mjs.map +1 -1
- package/browser/lib/helpers.d.ts +3 -0
- package/browser/lib/utils.d.ts +3 -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.map +1 -1
- package/lib/core-models.js.map +1 -1
- package/lib/env/env.angular-node-app.js.map +1 -1
- package/lib/env/env.docs-webapp.js.map +1 -1
- package/lib/env/env.electron-app.js.map +1 -1
- package/lib/env/env.mobile-app.js.map +1 -1
- package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
- package/lib/env/env.vscode-plugin.js.map +1 -1
- package/lib/env/index.js.map +1 -1
- 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 +3 -0
- package/lib/helpers.js +3 -0
- 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 +3 -0
- package/lib/utils.js +106 -8
- 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/fesm2022/tnp-core.mjs +110 -0
- package/websql/fesm2022/tnp-core.mjs.map +1 -1
- package/websql/lib/helpers.d.ts +3 -0
- package/websql/lib/utils.d.ts +3 -0
- package/websql/package.json +1 -1
@@ -2133,6 +2133,7 @@ var UtilsProcess;
|
|
2133
2133
|
return (void 0);
|
2134
2134
|
};
|
2135
2135
|
//#endregion
|
2136
|
+
//#region utils process / get current process and child processes usage
|
2136
2137
|
/**
|
2137
2138
|
* Get CPU and memory usage for a single PID.
|
2138
2139
|
*/
|
@@ -2160,6 +2161,8 @@ var UtilsProcess;
|
|
2160
2161
|
/* */
|
2161
2162
|
return (void 0);
|
2162
2163
|
};
|
2164
|
+
//#endregion
|
2165
|
+
//#region utils process / get child PIDs
|
2163
2166
|
/**
|
2164
2167
|
* Return a list of direct child PIDs for the given PID on a Unix-like system.
|
2165
2168
|
* Uses `ps -o pid= --ppid <pid>` to find child processes.
|
@@ -2182,6 +2185,8 @@ var UtilsProcess;
|
|
2182
2185
|
/* */
|
2183
2186
|
return (void 0);
|
2184
2187
|
}
|
2188
|
+
//#endregion
|
2189
|
+
//#region utils process / get child PIDs on Windows
|
2185
2190
|
/**
|
2186
2191
|
* Return a list of direct child PIDs for the given PID on Windows.
|
2187
2192
|
* Uses `wmic process where (ParentProcessId=<pid>) get ProcessId` to find child processes.
|
@@ -2205,6 +2210,8 @@ var UtilsProcess;
|
|
2205
2210
|
/* */
|
2206
2211
|
return (void 0);
|
2207
2212
|
}
|
2213
|
+
//#endregion
|
2214
|
+
//#region utils process / get child PIDs once
|
2208
2215
|
/**
|
2209
2216
|
* Cross-platform function to list *direct* child PIDs of a given PID.
|
2210
2217
|
* Uses the appropriate command depending on `process.platform`.
|
@@ -2219,6 +2226,8 @@ var UtilsProcess;
|
|
2219
2226
|
return (void 0);
|
2220
2227
|
}
|
2221
2228
|
UtilsProcess.getChildPidsOnce = getChildPidsOnce;
|
2229
|
+
//#endregion
|
2230
|
+
//#region utils process / get current process and child usage
|
2222
2231
|
/**
|
2223
2232
|
* Get CPU and memory usage for the current process (the Node.js process itself),
|
2224
2233
|
* plus any child processes spawned by it.
|
@@ -2251,6 +2260,72 @@ var UtilsProcess;
|
|
2251
2260
|
/* */
|
2252
2261
|
return (void 0);
|
2253
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
|
2254
2329
|
})(UtilsProcess || (UtilsProcess = {}));
|
2255
2330
|
//#endregion
|
2256
2331
|
//#region utils os
|
@@ -2579,6 +2654,27 @@ var UtilsOs;
|
|
2579
2654
|
return (void 0);
|
2580
2655
|
};
|
2581
2656
|
//#endregion
|
2657
|
+
//#region utils os / is docker available
|
2658
|
+
UtilsOs.isDockerAvailable = async () => {
|
2659
|
+
if (UtilsOs.isBrowser) {
|
2660
|
+
return false;
|
2661
|
+
}
|
2662
|
+
/* */
|
2663
|
+
/* */
|
2664
|
+
/* */
|
2665
|
+
/* */
|
2666
|
+
/* */
|
2667
|
+
/* */
|
2668
|
+
/* */
|
2669
|
+
/* */
|
2670
|
+
/* */
|
2671
|
+
/* */
|
2672
|
+
/* */
|
2673
|
+
/* */
|
2674
|
+
/* */
|
2675
|
+
return (void 0);
|
2676
|
+
};
|
2677
|
+
//#endregion
|
2582
2678
|
UtilsOs.openFolderInVSCode = (folderPath) => {
|
2583
2679
|
/* */
|
2584
2680
|
/* */
|
@@ -2704,6 +2800,17 @@ var UtilsTerminal;
|
|
2704
2800
|
});
|
2705
2801
|
};
|
2706
2802
|
//#endregion
|
2803
|
+
//#region wait
|
2804
|
+
UtilsTerminal.waitMiliseconds = (miliseconds) => {
|
2805
|
+
// Helpers.taskStarted(`Waiting ${miliseconds} miliseconds...`);
|
2806
|
+
return new Promise((resolve, reject) => {
|
2807
|
+
setTimeout(() => {
|
2808
|
+
// Helpers.taskDone(`Done waiting ${miliseconds} miliseconds`);
|
2809
|
+
resolve(void 0);
|
2810
|
+
}, miliseconds);
|
2811
|
+
});
|
2812
|
+
};
|
2813
|
+
//#endregion
|
2707
2814
|
//#region clear
|
2708
2815
|
UtilsTerminal.clearConsole = () => {
|
2709
2816
|
/* */
|
@@ -5114,6 +5221,9 @@ class HelpersCore extends HelpersMessages {
|
|
5114
5221
|
/* */
|
5115
5222
|
//#endregion
|
5116
5223
|
//#region methods / kill process by port
|
5224
|
+
/**
|
5225
|
+
* @deprecated use UtilsProcess.killProcessOnPort
|
5226
|
+
*/
|
5117
5227
|
async killProcessByPort(portOrPortsToKill, options) {
|
5118
5228
|
/* */
|
5119
5229
|
/* */
|