tnp-core 18.0.47 → 18.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 +1 -1
- package/assets/shared/shared_folder_info.txt +1 -1
- package/browser/esm2022/lib/core-imports.mjs +66 -5
- package/browser/esm2022/lib/core-models.mjs +51 -48
- package/browser/esm2022/lib/helpers-messages.mjs +9 -4
- package/browser/esm2022/lib/helpers.mjs +152 -369
- package/browser/esm2022/lib/utils.mjs +521 -8
- package/browser/fesm2022/tnp-core.mjs +1469 -1105
- package/browser/fesm2022/tnp-core.mjs.map +1 -1
- package/browser/lib/core-imports.d.ts +41 -1
- package/browser/lib/core-models.d.ts +51 -83
- package/browser/lib/helpers-messages.d.ts +6 -3
- package/browser/lib/helpers.d.ts +22 -0
- package/browser/lib/utils.d.ts +48 -0
- package/cli.backend.d.ts +1 -0
- package/cli.backend.js +15 -2
- package/cli.backend.js.map +1 -1
- package/client/esm2022/lib/core-imports.mjs +66 -5
- package/client/esm2022/lib/core-models.mjs +51 -48
- package/client/esm2022/lib/helpers-messages.mjs +9 -4
- package/client/esm2022/lib/helpers.mjs +152 -369
- package/client/esm2022/lib/utils.mjs +521 -8
- package/client/fesm2022/tnp-core.mjs +1469 -1105
- package/client/fesm2022/tnp-core.mjs.map +1 -1
- package/client/lib/core-imports.d.ts +41 -1
- package/client/lib/core-models.d.ts +51 -83
- package/client/lib/helpers-messages.d.ts +6 -3
- package/client/lib/helpers.d.ts +22 -0
- package/client/lib/utils.d.ts +48 -0
- package/index.js +15 -2
- package/index.js.map +1 -1
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/command-exists.js +20 -20
- package/lib/command-exists.js.map +1 -1
- package/lib/core-cli.js +49 -66
- package/lib/core-cli.js.map +1 -1
- package/lib/core-config.js.map +1 -1
- package/lib/core-imports.d.ts +41 -20
- package/lib/core-imports.js +202 -78
- package/lib/core-imports.js.map +1 -1
- package/lib/core-models.d.ts +51 -83
- package/lib/core-models.js +52 -47
- package/lib/core-models.js.map +1 -1
- package/lib/framework-name.js +2 -2
- package/lib/framework-name.js.map +1 -1
- package/lib/helpers-isomorphic.js +33 -52
- package/lib/helpers-isomorphic.js.map +1 -1
- package/lib/helpers-messages.d.ts +6 -3
- package/lib/helpers-messages.js +79 -102
- package/lib/helpers-messages.js.map +1 -1
- package/lib/helpers.d.ts +21 -3
- package/lib/helpers.js +718 -967
- package/lib/helpers.js.map +1 -1
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.js +23 -10
- 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 +21 -23
- package/lib/progress-data.js.map +1 -1
- package/lib/public-api.js +19 -6
- package/lib/public-api.js.map +1 -1
- package/lib/required-global-npm-packages.js.map +1 -1
- package/lib/required.d.ts +44 -0
- package/lib/safe-types/glob.d.ts +102 -0
- package/lib/safe-types/minimatch/assert-valid-pattern.d.ts +1 -0
- package/lib/safe-types/minimatch/ast.d.ts +17 -0
- package/lib/safe-types/minimatch/brace-expressions.d.ts +7 -0
- package/lib/safe-types/minimatch/escape.d.ts +11 -0
- package/lib/safe-types/minimatch/index.d copy.d.ts +93 -0
- package/lib/safe-types/minimatch/index.d.ts +93 -0
- package/lib/safe-types/minimatch/unescapd.d.ts +16 -0
- package/lib/safe-types/minimatch/unescape.d.ts +16 -0
- package/lib/safe-types/minimatch.d.ts +0 -0
- package/lib/safe-types/rimraf.d.ts +28 -0
- package/lib/utils.d.ts +48 -1
- package/lib/utils.js +1252 -1146
- package/lib/utils.js.map +1 -1
- package/migrations/index.js +15 -2
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/package.json +26 -89
- package/src.d.ts +1 -1
- package/taon.jsonc +48 -58
- package/tmp-environment.json +8 -403
- package/websql/esm2022/lib/core-imports.mjs +66 -5
- package/websql/esm2022/lib/core-models.mjs +51 -48
- package/websql/esm2022/lib/helpers-messages.mjs +9 -4
- package/websql/esm2022/lib/helpers.mjs +152 -369
- package/websql/esm2022/lib/utils.mjs +521 -8
- package/websql/fesm2022/tnp-core.mjs +1466 -1102
- package/websql/fesm2022/tnp-core.mjs.map +1 -1
- package/websql/lib/core-imports.d.ts +41 -1
- package/websql/lib/core-models.d.ts +51 -83
- package/websql/lib/helpers-messages.d.ts +6 -3
- package/websql/lib/helpers.d.ts +22 -0
- package/websql/lib/utils.d.ts +48 -0
- package/browser/package.json +0 -25
- package/websql/package.json +0 -25
@@ -7,9 +7,49 @@ import { Chalk } from 'chalk';
|
|
7
7
|
import * as json5 from 'json5';
|
8
8
|
import type jQueryType from 'jquery';
|
9
9
|
import type * as pathBaseType from 'path';
|
10
|
+
import type * as globBaseType from 'glob';
|
11
|
+
import type * as fseBaseType from 'fs-extra';
|
12
|
+
import type * as osBaseType from 'os';
|
13
|
+
import type * as child_processType from 'child_process';
|
14
|
+
import type * as httpBaseType from 'http';
|
15
|
+
import type * as httpsBaseType from 'https';
|
16
|
+
import type * as fkillBaseType from 'fkill';
|
17
|
+
import type * as psListBaseType from 'ps-list';
|
18
|
+
import type * as netBaseType from 'net';
|
19
|
+
import type * as spawnBaseType from 'cross-spawn';
|
20
|
+
import type * as fgBaseType from 'fast-glob';
|
21
|
+
import type { minimatch as minimatchBaseType } from 'minimatch';
|
22
|
+
import type * as rimrafBaseType from 'rimraf';
|
23
|
+
import type * as chokidarBaseType from 'chokidar';
|
24
|
+
import type * as mkdirpBaseType from 'mkdirp';
|
25
|
+
import type * as ncpBaseType from 'copy-paste';
|
26
|
+
import type * as psBaseType from 'ps-node';
|
10
27
|
declare let $: jQueryType;
|
11
28
|
declare let path: typeof pathBaseType;
|
12
29
|
declare let chalk: Chalk;
|
30
|
+
declare let glob: typeof globBaseType;
|
31
|
+
declare let fse: typeof fseBaseType;
|
32
|
+
declare let os: typeof osBaseType;
|
33
|
+
declare let child_process: typeof child_processType;
|
34
|
+
declare let http: typeof httpBaseType;
|
35
|
+
declare let https: typeof httpsBaseType;
|
36
|
+
/**
|
37
|
+
* check if the current process is elevated
|
38
|
+
* - sudo in unix/macos
|
39
|
+
* - admin in windows
|
40
|
+
*/
|
41
|
+
declare let isElevated: () => Promise<boolean>;
|
42
|
+
declare let fkill: typeof fkillBaseType;
|
43
|
+
declare let psList: typeof psListBaseType;
|
44
|
+
declare let net: typeof netBaseType;
|
45
|
+
declare let spawn: typeof spawnBaseType;
|
46
|
+
declare let minimatch: typeof minimatchBaseType;
|
47
|
+
declare let rimraf: typeof rimrafBaseType;
|
48
|
+
declare let chokidar: typeof chokidarBaseType;
|
49
|
+
declare let mkdirp: typeof mkdirpBaseType;
|
50
|
+
declare let ncp: typeof ncpBaseType;
|
51
|
+
declare let ps: typeof psBaseType;
|
52
|
+
declare let fg: typeof fgBaseType;
|
13
53
|
/**
|
14
54
|
* transform unix path to win32 path
|
15
55
|
*/
|
@@ -18,4 +58,4 @@ declare const win32Path: (p: string) => string;
|
|
18
58
|
* This funciton will replace // to /
|
19
59
|
*/
|
20
60
|
declare const crossPlatformPath: (pathStringOrPathParts: string | string[]) => string;
|
21
|
-
export { _, q, moment, dateformat, crossPlatformPath, win32Path, path, chalk, json5, $, };
|
61
|
+
export { _, q, moment, dateformat, crossPlatformPath, win32Path, path, chalk, json5, $, glob, fse, os, child_process, http, https, isElevated, fkill, psList, spawn, minimatch, fg, chokidar, mkdirp, ncp, rimraf, net, ps, };
|
@@ -1,4 +1,5 @@
|
|
1
1
|
// @ts-nocheck
|
2
|
+
import type { ChildProcess } from 'child_process';
|
2
3
|
export declare namespace CoreModels {
|
3
4
|
export type Package = {
|
4
5
|
name: string;
|
@@ -34,73 +35,69 @@ export declare namespace CoreModels {
|
|
34
35
|
};
|
35
36
|
export type InstalationType = '-g' | '--save' | '--save-dev' | 'remove';
|
36
37
|
export const InstalationTypeArr: string[];
|
37
|
-
export type
|
38
|
-
export
|
39
|
-
export
|
38
|
+
export type ReleaseVersionType = 'major' | 'minor' | 'patch';
|
39
|
+
export type PreReleaseVersionTag = 'alpha' | 'beta' | 'rc' | 'next';
|
40
|
+
export const NpmSpecialVersions: string[];
|
41
|
+
export type PROGRESS_DATA_TYPE = 'info' | 'error' | 'warning' | 'event';
|
40
42
|
/**
|
41
|
-
*
|
42
|
-
* for MANUAL/CLOUD release
|
43
|
+
* Available application environments.
|
43
44
|
*/
|
44
|
-
export
|
45
|
-
export const ReleaseArtifactTaonNames: Readonly<{
|
46
|
-
ANGULAR_ELECTRON_APP: ReleaseArtifactTaon;
|
45
|
+
export const EnvironmentName: Readonly<{
|
47
46
|
/**
|
48
|
-
*
|
47
|
+
* Default environment, typically for artifact without application
|
48
|
+
* or for storing common data
|
49
49
|
*/
|
50
|
-
|
50
|
+
__: "__";
|
51
51
|
/**
|
52
|
-
*
|
52
|
+
* Local development environment, typically the developer's machine.
|
53
53
|
*/
|
54
|
-
|
54
|
+
LOCALHOST: "localhost";
|
55
55
|
/**
|
56
|
-
*
|
56
|
+
* Development environment used by engineers to deploy and test new features.
|
57
57
|
*/
|
58
|
-
|
58
|
+
DEV: "dev";
|
59
59
|
/**
|
60
|
-
*
|
61
|
-
* (could be backend or frontend or microservice)
|
60
|
+
* Staging environment used for final validations before production.
|
62
61
|
*/
|
63
|
-
|
62
|
+
STAGE: "stage";
|
64
63
|
/**
|
65
|
-
*
|
64
|
+
* Production environment serving live users.
|
66
65
|
*/
|
67
|
-
|
66
|
+
PROD: "prod";
|
68
67
|
/**
|
69
|
-
*
|
68
|
+
* Automated test environment for running unit, integration, or automated tests.
|
70
69
|
*/
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
70
|
+
TEST: "test";
|
71
|
+
/**
|
72
|
+
* Quality assurance environment designated for manual and exploratory testing.
|
73
|
+
*/
|
74
|
+
QA: "qa";
|
75
|
+
/**
|
76
|
+
* Sandbox environment for experimenting and integration without affecting other environments.
|
77
|
+
*/
|
78
|
+
SANDBOX: "sandbox";
|
79
|
+
/**
|
80
|
+
* User Acceptance Testing environment where clients or stakeholders validate the release candidate.
|
81
|
+
*/
|
82
|
+
UAT: "uat";
|
83
|
+
/**
|
84
|
+
* Pre-production environment, closely mirroring production for final testing and validation.
|
85
|
+
*/
|
86
|
+
PREPROD: "preprod";
|
85
87
|
/**
|
86
|
-
*
|
88
|
+
* Demonstration environment specifically configured for client presentations and demos.
|
87
89
|
*/
|
88
|
-
|
90
|
+
DEMO: "demo";
|
89
91
|
/**
|
90
|
-
*
|
92
|
+
* Continuous Integration environment used by CI/CD pipelines for automated builds and deployments.
|
91
93
|
*/
|
92
|
-
|
94
|
+
CI: "ci";
|
95
|
+
/**
|
96
|
+
* Training environment dedicated to internal team onboarding and training activities.
|
97
|
+
*/
|
98
|
+
TRAINING: "training";
|
93
99
|
}>;
|
94
|
-
|
95
|
-
* Array with all possible local release types for taon
|
96
|
-
* inside LOCAL release
|
97
|
-
*/
|
98
|
-
export const LocalReleaseArtifactTaonNamesArr: LocalReleaseArtifactTaon[];
|
99
|
-
export type ReleaseVersionType = 'major' | 'minor' | 'patch';
|
100
|
-
export type PreReleaseVersionTag = 'alpha' | 'beta' | 'rc' | 'next';
|
101
|
-
export const NpmSpecialVersions: string[];
|
102
|
-
export type PROGRESS_DATA_TYPE = 'info' | 'error' | 'warning' | 'event';
|
103
|
-
export type EnvironmentName = 'local' | 'static' | 'dev' | 'stage' | 'prod' | 'online' | 'test' | 'qa' | 'custom';
|
100
|
+
export type EnvironmentNameTaon = (typeof EnvironmentName)[keyof typeof EnvironmentName];
|
104
101
|
export type PUSHTYPE = 'feat' | 'chore' | 'feature' | 'refactor' | 'perf' | 'styles' | 'ci' | 'build' | 'fix' | 'bugfix' | 'release' | 'docs';
|
105
102
|
/**
|
106
103
|
* @deprecated
|
@@ -114,12 +111,9 @@ export declare namespace CoreModels {
|
|
114
111
|
export type HttpMethod = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'head' | 'jsonp';
|
115
112
|
export type ParamType = 'Path' | 'Query' | 'Cookie' | 'Header' | 'Body';
|
116
113
|
export type TsUsage = 'import' | 'export';
|
117
|
-
export type BaseProjectType = 'typescript' | 'angular' | 'angular-lib' | '
|
114
|
+
export type BaseProjectType = 'typescript' | 'angular' | 'angular-lib' | 'unknown' | 'unknown-npm-project';
|
118
115
|
export const BaseProjectTypeArr: string[];
|
119
|
-
|
120
|
-
* @deprecated there will be only one lib type "isomorphic-lib"
|
121
|
-
*/
|
122
|
-
export type LibType = BaseProjectType | 'isomorphic-lib' | 'container' | 'docker' | 'vscode-ext' | 'chrome-ext' | 'unknow-npm-project';
|
116
|
+
export type LibType = BaseProjectType | 'isomorphic-lib' | 'container' | 'unknown-npm-project';
|
123
117
|
/**
|
124
118
|
* @deprecated
|
125
119
|
*/
|
@@ -161,6 +155,7 @@ export declare namespace CoreModels {
|
|
161
155
|
resolvePromiseMsgCallback?: {
|
162
156
|
stdout?: () => any;
|
163
157
|
stderr?: () => any;
|
158
|
+
exitCode?: (exitCode: number) => any;
|
164
159
|
};
|
165
160
|
prefix?: string;
|
166
161
|
detach?: boolean;
|
@@ -181,6 +176,7 @@ export declare namespace CoreModels {
|
|
181
176
|
*/
|
182
177
|
biggerBuffer?: boolean;
|
183
178
|
askToTryAgainOnError?: boolean;
|
179
|
+
onChildProcessChange?: (childProcess: ChildProcess) => void;
|
184
180
|
exitOnErrorCallback?: (code: number) => void;
|
185
181
|
/**
|
186
182
|
* From displaying in console
|
@@ -190,6 +186,8 @@ export declare namespace CoreModels {
|
|
190
186
|
stderr?: boolean;
|
191
187
|
acceptAllExitCodeAsSuccess?: boolean;
|
192
188
|
};
|
189
|
+
outputBuffer?: string[];
|
190
|
+
outputBufferMaxSize?: number;
|
193
191
|
}
|
194
192
|
/**
|
195
193
|
* @deprecated
|
@@ -470,35 +468,5 @@ export declare namespace CoreModels {
|
|
470
468
|
hideErrors?: boolean;
|
471
469
|
debug?: boolean;
|
472
470
|
}
|
473
|
-
export interface TaonJson {
|
474
|
-
type: CoreModels.LibType;
|
475
|
-
version?: CoreModels.FrameworkVersion;
|
476
|
-
smartContainerBuildTarget?: string;
|
477
|
-
smart?: boolean;
|
478
|
-
monorepo?: boolean;
|
479
|
-
libReleaseOptions: {
|
480
|
-
cliBuildObscure?: boolean;
|
481
|
-
cliBuildUglify?: boolean;
|
482
|
-
cliBuildNoDts?: boolean;
|
483
|
-
cliBuildIncludeNodeModules?: boolean;
|
484
|
-
};
|
485
|
-
/**
|
486
|
-
* project is template for other project
|
487
|
-
*/
|
488
|
-
isCoreProject: boolean;
|
489
|
-
scripts?: {
|
490
|
-
[script in string]: string;
|
491
|
-
};
|
492
|
-
description?: string;
|
493
|
-
license?: string;
|
494
|
-
private?: boolean;
|
495
|
-
author?: string;
|
496
|
-
homepage?: string;
|
497
|
-
overrided: {
|
498
|
-
dependencies?: {
|
499
|
-
[name: string]: string;
|
500
|
-
};
|
501
|
-
};
|
502
|
-
}
|
503
471
|
export {};
|
504
472
|
}
|
@@ -4,11 +4,14 @@ export declare class HelpersMessages extends HelpersIsomorphic {
|
|
4
4
|
msgCacheClear(): void;
|
5
5
|
renderError(err: Error): void;
|
6
6
|
/**
|
7
|
-
*
|
8
|
-
* make sure browser or nodejs will not continue
|
9
|
-
* @param details
|
7
|
+
* throw error
|
10
8
|
*/
|
11
9
|
throw(details: string): void;
|
10
|
+
/**
|
11
|
+
* throw error and stop application
|
12
|
+
* @param details
|
13
|
+
*/
|
14
|
+
stopApplication(details: string): void;
|
12
15
|
tryCatchError(error: any): void;
|
13
16
|
error(details: any, noExit?: boolean, noTrace?: boolean): void;
|
14
17
|
info(details: string, repeatable?: boolean): void;
|
package/websql/lib/helpers.d.ts
CHANGED
@@ -118,6 +118,9 @@ export declare class HelpersCore extends HelpersMessages {
|
|
118
118
|
*/
|
119
119
|
_fixCommand(command: string): string;
|
120
120
|
command(command: string): {};
|
121
|
+
/**
|
122
|
+
* @deprecated use UtilsTerminal.wait
|
123
|
+
*/
|
121
124
|
wait(second: number): Promise<void>;
|
122
125
|
timeout(seconds: number): Promise<void>;
|
123
126
|
killProcessByPort(portOrPortsToKill: number | number[], options?: {
|
@@ -164,6 +167,25 @@ export declare class HelpersCore extends HelpersMessages {
|
|
164
167
|
* @deprecated
|
165
168
|
*/
|
166
169
|
values(obj: any): any[];
|
170
|
+
/**
|
171
|
+
* does not make sense
|
172
|
+
* @deprecated
|
173
|
+
*/
|
174
|
+
private isFile;
|
175
|
+
tryReadFile(absoluteFilePath: string | string[], // @ts-ignore
|
176
|
+
defaultValueWhenNotExists?: string, notTrim?: boolean): Promise<string | undefined>;
|
177
|
+
/**
|
178
|
+
* wrapper for fs.readFileSync
|
179
|
+
*/
|
180
|
+
readFile(absoluteFilePath: string | string[], // @ts-ignore
|
181
|
+
defaultValueWhenNotExists?: string, notTrim?: boolean): string | undefined;
|
182
|
+
/**
|
183
|
+
* read json from absolute path
|
184
|
+
* @returns json object
|
185
|
+
*/
|
186
|
+
readJson(absoluteFilePath: string | string[], defaultValue?: {}, useJson5?: boolean): any;
|
187
|
+
readJson5(absoluteFilePath: string | string[], defaultValue?: any): any;
|
188
|
+
readJsonC(absoluteFilePath: string | string[], defaultValue?: any): any;
|
167
189
|
replaceLinesInFile(absoluteFilePath: string | string[], lineReplaceFn: (line: string) => string): void;
|
168
190
|
hideNodeWarnings(): void;
|
169
191
|
}
|
package/websql/lib/utils.d.ts
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
// @ts-nocheck
|
2
|
+
import { Blob } from 'buffer';
|
2
3
|
import { CoreModels } from './core-models';
|
3
4
|
export declare namespace Utils {
|
4
5
|
export const uniqArray: <T = any>(array: any[], uniqueProperty?: keyof T) => T[];
|
6
|
+
/**
|
7
|
+
* @param anyObject
|
8
|
+
* @returns object with sorted keys
|
9
|
+
*/
|
10
|
+
export const sortKeys: (anyObject: any) => any;
|
5
11
|
/**
|
6
12
|
* Example:
|
7
13
|
* new RegExp(escapeStringForRegEx('a.b.c'),'g') => /a\.b\.c/g
|
@@ -13,6 +19,12 @@ export declare namespace Utils {
|
|
13
19
|
export const getFreePort: (options?: {
|
14
20
|
startFrom?: number;
|
15
21
|
}) => Promise<number>;
|
22
|
+
export const requireUncached: (module: string) => any;
|
23
|
+
/**
|
24
|
+
* similar to camelCase but remove
|
25
|
+
* all non word / repeated characters
|
26
|
+
*/
|
27
|
+
export const camelize: (str?: string) => string;
|
16
28
|
interface AttrJsoncProp {
|
17
29
|
name: string;
|
18
30
|
value?: any;
|
@@ -141,6 +153,7 @@ export declare namespace UtilsProcess {
|
|
141
153
|
* TODO IMPLEMENT
|
142
154
|
* start async node process
|
143
155
|
*/
|
156
|
+
export const startAsync: (command: string, cwd: string, options?: Omit<CoreModels.ExecuteOptions, "tryAgainWhenFailAfter">) => Promise<void>;
|
144
157
|
/**
|
145
158
|
* This let you start child process and resolve promise when some
|
146
159
|
* condition is met. It is useful for example when you want to start
|
@@ -162,6 +175,34 @@ export declare namespace UtilsProcess {
|
|
162
175
|
*/
|
163
176
|
export const startInNewTerminalWindow: (command: string, options?: Pick<ProcessStartOptions, "cwd" | "hideOutput">) => any;
|
164
177
|
export const getBashOrShellName: () => "browser" | "cmd" | "powershell" | "gitbash" | "cygwin" | "unknown" | "bash" | "zsh" | "fish" | "sh";
|
178
|
+
/**
|
179
|
+
* Get CPU and memory usage for a single PID.
|
180
|
+
*/
|
181
|
+
export const getUsageForPid: (pid: number) => Promise<{
|
182
|
+
cpu: number;
|
183
|
+
memoryInGB: number;
|
184
|
+
memoryInMB: number;
|
185
|
+
}>;
|
186
|
+
/**
|
187
|
+
* Cross-platform function to list *direct* child PIDs of a given PID.
|
188
|
+
* Uses the appropriate command depending on `process.platform`.
|
189
|
+
*/
|
190
|
+
export function getChildPidsOnce(pid: number): Promise<number[]>;
|
191
|
+
/**
|
192
|
+
* Get CPU and memory usage for the current process (the Node.js process itself),
|
193
|
+
* plus any child processes spawned by it.
|
194
|
+
*/
|
195
|
+
export const getCurrentProcessAndChildUsage: () => Promise<{
|
196
|
+
current: {
|
197
|
+
cpu: number;
|
198
|
+
memoryInMB: number;
|
199
|
+
};
|
200
|
+
children: Array<{
|
201
|
+
pid: number;
|
202
|
+
cpu: number;
|
203
|
+
memoryInMB: number;
|
204
|
+
}>;
|
205
|
+
}>;
|
165
206
|
export {};
|
166
207
|
}
|
167
208
|
export declare namespace UtilsOs {
|
@@ -187,11 +228,17 @@ export declare namespace UtilsOs {
|
|
187
228
|
* Electron backend or browser.
|
188
229
|
*/
|
189
230
|
const isRunningInElectron: () => boolean;
|
231
|
+
/**
|
232
|
+
* Check whether the current process is running inside
|
233
|
+
* a Visual Studio Code extension.
|
234
|
+
*/
|
235
|
+
const isRunningInVscodeExtension: () => boolean;
|
190
236
|
/**
|
191
237
|
* Check wether the current process is running inside
|
192
238
|
* windows subsystem for linux (WSL).
|
193
239
|
*/
|
194
240
|
const isRunningInWsl: () => boolean;
|
241
|
+
const isRunningInWindowsCmd: () => boolean;
|
195
242
|
const isRunningInDocker: () => boolean;
|
196
243
|
const isRunningInLinuxGraphicsCapableEnvironment: () => boolean;
|
197
244
|
/**
|
@@ -246,6 +293,7 @@ export declare namespace UtilsTerminal {
|
|
246
293
|
visible?: boolean;
|
247
294
|
};
|
248
295
|
};
|
296
|
+
export const wait: (second: number) => Promise<void>;
|
249
297
|
export const clearConsole: () => void;
|
250
298
|
export const multiselect: <T = string>(options: {
|
251
299
|
question: string;
|
package/browser/package.json
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "tnp-core",
|
3
|
-
"version": "0.0.1",
|
4
|
-
"peerDependencies": {
|
5
|
-
"@angular/common": "^13.2.0",
|
6
|
-
"@angular/core": "^13.2.0"
|
7
|
-
},
|
8
|
-
"dependencies": {
|
9
|
-
"tslib": "^2.3.0"
|
10
|
-
},
|
11
|
-
"module": "fesm2022/tnp-core.mjs",
|
12
|
-
"typings": "index.d.ts",
|
13
|
-
"exports": {
|
14
|
-
"./package.json": {
|
15
|
-
"default": "./package.json"
|
16
|
-
},
|
17
|
-
".": {
|
18
|
-
"types": "./index.d.ts",
|
19
|
-
"esm2022": "./esm2022/tnp-core.mjs",
|
20
|
-
"esm": "./esm2022/tnp-core.mjs",
|
21
|
-
"default": "./fesm2022/tnp-core.mjs"
|
22
|
-
}
|
23
|
-
},
|
24
|
-
"sideEffects": false
|
25
|
-
}
|
package/websql/package.json
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "tnp-core",
|
3
|
-
"version": "0.0.1",
|
4
|
-
"peerDependencies": {
|
5
|
-
"@angular/common": "^13.2.0",
|
6
|
-
"@angular/core": "^13.2.0"
|
7
|
-
},
|
8
|
-
"dependencies": {
|
9
|
-
"tslib": "^2.3.0"
|
10
|
-
},
|
11
|
-
"module": "fesm2022/tnp-core.mjs",
|
12
|
-
"typings": "index.d.ts",
|
13
|
-
"exports": {
|
14
|
-
"./package.json": {
|
15
|
-
"default": "./package.json"
|
16
|
-
},
|
17
|
-
".": {
|
18
|
-
"types": "./index.d.ts",
|
19
|
-
"esm2022": "./esm2022/tnp-core.mjs",
|
20
|
-
"esm": "./esm2022/tnp-core.mjs",
|
21
|
-
"default": "./fesm2022/tnp-core.mjs"
|
22
|
-
}
|
23
|
-
},
|
24
|
-
"sideEffects": false
|
25
|
-
}
|