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
@@ -0,0 +1,102 @@
|
|
1
|
+
import events = require('events');
|
2
|
+
import fs = require('fs');
|
3
|
+
import { MinimatchOptions, Minimatch } from './minimatch/index';
|
4
|
+
export declare function GLOB(pattern: string, cb: (err: Error | null, matches: string[]) => void): void;
|
5
|
+
export declare function GLOB(pattern: string, options: GLOB.IOptions, cb: (err: Error | null, matches: string[]) => void): void;
|
6
|
+
export declare namespace GLOB {
|
7
|
+
function __promisify__(pattern: string, options?: IOptions): Promise<string[]>;
|
8
|
+
function sync(pattern: string, options?: IOptions): string[];
|
9
|
+
function hasMagic(pattern: string, options?: IOptions): boolean;
|
10
|
+
let Glob: IGlobStatic;
|
11
|
+
let GlobSync: IGlobSyncStatic;
|
12
|
+
interface IOptions extends MinimatchOptions {
|
13
|
+
cwd?: string;
|
14
|
+
root?: string;
|
15
|
+
dot?: boolean;
|
16
|
+
nomount?: boolean;
|
17
|
+
mark?: boolean;
|
18
|
+
nosort?: boolean;
|
19
|
+
stat?: boolean;
|
20
|
+
silent?: boolean;
|
21
|
+
strict?: boolean;
|
22
|
+
cache?: {
|
23
|
+
[path: string]: any;
|
24
|
+
};
|
25
|
+
statCache?: {
|
26
|
+
[path: string]: fs.Stats;
|
27
|
+
};
|
28
|
+
symlinks?: any;
|
29
|
+
sync?: boolean;
|
30
|
+
nounique?: boolean;
|
31
|
+
nonull?: boolean;
|
32
|
+
debug?: boolean;
|
33
|
+
nobrace?: boolean;
|
34
|
+
noglobstar?: boolean;
|
35
|
+
noext?: boolean;
|
36
|
+
nocase?: boolean;
|
37
|
+
matchBase?: any;
|
38
|
+
nodir?: boolean;
|
39
|
+
ignore?: any;
|
40
|
+
follow?: boolean;
|
41
|
+
realpath?: boolean;
|
42
|
+
nonegate?: boolean;
|
43
|
+
nocomment?: boolean;
|
44
|
+
absolute?: boolean;
|
45
|
+
/** Deprecated. */
|
46
|
+
globDebug?: boolean;
|
47
|
+
}
|
48
|
+
interface IGlobStatic extends events.EventEmitter {
|
49
|
+
new (pattern: string, cb?: (err: Error | null, matches: string[]) => void): IGlob;
|
50
|
+
new (pattern: string, options: IOptions, cb?: (err: Error | null, matches: string[]) => void): IGlob;
|
51
|
+
prototype: IGlob;
|
52
|
+
}
|
53
|
+
interface IGlobSyncStatic {
|
54
|
+
new (pattern: string, options?: IOptions): IGlobBase;
|
55
|
+
prototype: IGlobBase;
|
56
|
+
}
|
57
|
+
interface IGlobBase {
|
58
|
+
minimatch: Minimatch;
|
59
|
+
options: IOptions;
|
60
|
+
aborted: boolean;
|
61
|
+
cache: {
|
62
|
+
[path: string]: any;
|
63
|
+
};
|
64
|
+
statCache: {
|
65
|
+
[path: string]: fs.Stats;
|
66
|
+
};
|
67
|
+
symlinks: {
|
68
|
+
[path: string]: boolean;
|
69
|
+
};
|
70
|
+
realpathCache: {
|
71
|
+
[path: string]: string;
|
72
|
+
};
|
73
|
+
found: string[];
|
74
|
+
}
|
75
|
+
interface IGlob extends IGlobBase, events.EventEmitter {
|
76
|
+
pause(): void;
|
77
|
+
resume(): void;
|
78
|
+
abort(): void;
|
79
|
+
/** Deprecated. */
|
80
|
+
EOF: any;
|
81
|
+
/** Deprecated. */
|
82
|
+
paused: boolean;
|
83
|
+
/** Deprecated. */
|
84
|
+
maxDepth: number;
|
85
|
+
/** Deprecated. */
|
86
|
+
maxLength: number;
|
87
|
+
/** Deprecated. */
|
88
|
+
changedCwd: boolean;
|
89
|
+
/** Deprecated. */
|
90
|
+
cwd: string;
|
91
|
+
/** Deprecated. */
|
92
|
+
root: string;
|
93
|
+
/** Deprecated. */
|
94
|
+
error: any;
|
95
|
+
/** Deprecated. */
|
96
|
+
matches: string[];
|
97
|
+
/** Deprecated. */
|
98
|
+
log(...args: any[]): void;
|
99
|
+
/** Deprecated. */
|
100
|
+
emitMatch(m: any): void;
|
101
|
+
}
|
102
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const assertValidPattern: (pattern: any) => void;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { MinimatchOptions, MMRegExp } from './index.js';
|
2
|
+
export type ExtglobType = '!' | '?' | '+' | '*' | '@';
|
3
|
+
export declare class AST {
|
4
|
+
type: ExtglobType | null;
|
5
|
+
constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions);
|
6
|
+
get hasMagic(): boolean | undefined;
|
7
|
+
toString(): string;
|
8
|
+
push(...parts: (string | AST)[]): void;
|
9
|
+
toJSON(): any[];
|
10
|
+
isStart(): boolean;
|
11
|
+
isEnd(): boolean;
|
12
|
+
copyIn(part: AST | string): void;
|
13
|
+
clone(parent: AST): AST;
|
14
|
+
static fromGlob(pattern: string, options?: MinimatchOptions): AST;
|
15
|
+
toMMPattern(): MMRegExp | string;
|
16
|
+
toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean];
|
17
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { MinimatchOptions } from './index.js';
|
2
|
+
/**
|
3
|
+
* Escape all magic characters in a glob pattern.
|
4
|
+
*
|
5
|
+
* If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}
|
6
|
+
* option is used, then characters are escaped by wrapping in `[]`, because
|
7
|
+
* a magic character wrapped in a character class can only be satisfied by
|
8
|
+
* that exact character. In this mode, `\` is _not_ escaped, because it is
|
9
|
+
* not interpreted as a magic character, but instead as a path separator.
|
10
|
+
*/
|
11
|
+
export declare const escape: (s: string, { windowsPathsNoEscape, }?: Pick<MinimatchOptions, 'windowsPathsNoEscape'>) => string;
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { AST } from './ast.js';
|
2
|
+
type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
|
3
|
+
export interface MinimatchOptions {
|
4
|
+
nobrace?: boolean;
|
5
|
+
nocomment?: boolean;
|
6
|
+
nonegate?: boolean;
|
7
|
+
debug?: boolean;
|
8
|
+
noglobstar?: boolean;
|
9
|
+
noext?: boolean;
|
10
|
+
nonull?: boolean;
|
11
|
+
windowsPathsNoEscape?: boolean;
|
12
|
+
allowWindowsEscape?: boolean;
|
13
|
+
partial?: boolean;
|
14
|
+
dot?: boolean;
|
15
|
+
nocase?: boolean;
|
16
|
+
nocaseMagicOnly?: boolean;
|
17
|
+
magicalBraces?: boolean;
|
18
|
+
matchBase?: boolean;
|
19
|
+
flipNegate?: boolean;
|
20
|
+
preserveMultipleSlashes?: boolean;
|
21
|
+
optimizationLevel?: number;
|
22
|
+
platform?: Platform;
|
23
|
+
windowsNoMagicRoot?: boolean;
|
24
|
+
}
|
25
|
+
export declare const minimatch: {
|
26
|
+
(p: string, pattern: string, options?: MinimatchOptions): boolean;
|
27
|
+
sep: Sep;
|
28
|
+
GLOBSTAR: typeof GLOBSTAR;
|
29
|
+
filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
|
30
|
+
defaults: (def: MinimatchOptions) => typeof minimatch;
|
31
|
+
braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
|
32
|
+
makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
|
33
|
+
match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
|
34
|
+
AST: typeof AST;
|
35
|
+
Minimatch: typeof Minimatch;
|
36
|
+
escape: (s: string, { windowsPathsNoEscape, }?: Pick<MinimatchOptions, "windowsPathsNoEscape">) => string;
|
37
|
+
unescape: (s: string, { windowsPathsNoEscape, }?: Pick<MinimatchOptions, "windowsPathsNoEscape">) => string;
|
38
|
+
};
|
39
|
+
type Sep = '\\' | '/';
|
40
|
+
export declare const sep: Sep;
|
41
|
+
export declare const GLOBSTAR: unique symbol;
|
42
|
+
export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
|
43
|
+
export declare const defaults: (def: MinimatchOptions) => typeof minimatch;
|
44
|
+
export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
|
45
|
+
export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
|
46
|
+
export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
|
47
|
+
export type MMRegExp = RegExp & {
|
48
|
+
_src?: string;
|
49
|
+
_glob?: string;
|
50
|
+
};
|
51
|
+
export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
|
52
|
+
export type ParseReturn = ParseReturnFiltered | false;
|
53
|
+
export declare class Minimatch {
|
54
|
+
options: MinimatchOptions;
|
55
|
+
set: ParseReturnFiltered[][];
|
56
|
+
pattern: string;
|
57
|
+
windowsPathsNoEscape: boolean;
|
58
|
+
nonegate: boolean;
|
59
|
+
negate: boolean;
|
60
|
+
comment: boolean;
|
61
|
+
empty: boolean;
|
62
|
+
preserveMultipleSlashes: boolean;
|
63
|
+
partial: boolean;
|
64
|
+
globSet: string[];
|
65
|
+
globParts: string[][];
|
66
|
+
nocase: boolean;
|
67
|
+
isWindows: boolean;
|
68
|
+
platform: Platform;
|
69
|
+
windowsNoMagicRoot: boolean;
|
70
|
+
regexp: false | null | MMRegExp;
|
71
|
+
constructor(pattern: string, options?: MinimatchOptions);
|
72
|
+
hasMagic(): boolean;
|
73
|
+
debug(..._: any[]): void;
|
74
|
+
make(): void;
|
75
|
+
preprocess(globParts: string[][]): string[][];
|
76
|
+
adjascentGlobstarOptimize(globParts: string[][]): string[][];
|
77
|
+
levelOneOptimize(globParts: string[][]): string[][];
|
78
|
+
levelTwoFileOptimize(parts: string | string[]): string[];
|
79
|
+
firstPhasePreProcess(globParts: string[][]): string[][];
|
80
|
+
secondPhasePreProcess(globParts: string[][]): string[][];
|
81
|
+
partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[];
|
82
|
+
parseNegate(): void;
|
83
|
+
matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
|
84
|
+
braceExpand(): string[];
|
85
|
+
parse(pattern: string): ParseReturn;
|
86
|
+
makeRe(): false | MMRegExp;
|
87
|
+
slashSplit(p: string): string[];
|
88
|
+
match(f: string, partial?: boolean): boolean;
|
89
|
+
static defaults(def: MinimatchOptions): typeof Minimatch;
|
90
|
+
}
|
91
|
+
export { AST } from './ast.js';
|
92
|
+
export { escape } from './escape.js';
|
93
|
+
export { unescape } from './unescape.js';
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { AST } from './ast.js';
|
2
|
+
type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
|
3
|
+
export interface MinimatchOptions {
|
4
|
+
nobrace?: boolean;
|
5
|
+
nocomment?: boolean;
|
6
|
+
nonegate?: boolean;
|
7
|
+
debug?: boolean;
|
8
|
+
noglobstar?: boolean;
|
9
|
+
noext?: boolean;
|
10
|
+
nonull?: boolean;
|
11
|
+
windowsPathsNoEscape?: boolean;
|
12
|
+
allowWindowsEscape?: boolean;
|
13
|
+
partial?: boolean;
|
14
|
+
dot?: boolean;
|
15
|
+
nocase?: boolean;
|
16
|
+
nocaseMagicOnly?: boolean;
|
17
|
+
magicalBraces?: boolean;
|
18
|
+
matchBase?: boolean;
|
19
|
+
flipNegate?: boolean;
|
20
|
+
preserveMultipleSlashes?: boolean;
|
21
|
+
optimizationLevel?: number;
|
22
|
+
platform?: Platform;
|
23
|
+
windowsNoMagicRoot?: boolean;
|
24
|
+
}
|
25
|
+
export declare const minimatch: {
|
26
|
+
(p: string, pattern: string, options?: MinimatchOptions): boolean;
|
27
|
+
sep: Sep;
|
28
|
+
GLOBSTAR: typeof GLOBSTAR;
|
29
|
+
filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
|
30
|
+
defaults: (def: MinimatchOptions) => typeof minimatch;
|
31
|
+
braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
|
32
|
+
makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
|
33
|
+
match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
|
34
|
+
AST: typeof AST;
|
35
|
+
Minimatch: typeof Minimatch;
|
36
|
+
escape: (s: string, { windowsPathsNoEscape, }?: Pick<MinimatchOptions, "windowsPathsNoEscape">) => string;
|
37
|
+
unescape: (s: string, { windowsPathsNoEscape, }?: Pick<MinimatchOptions, "windowsPathsNoEscape">) => string;
|
38
|
+
};
|
39
|
+
type Sep = '\\' | '/';
|
40
|
+
export declare const sep: Sep;
|
41
|
+
export declare const GLOBSTAR: unique symbol;
|
42
|
+
export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
|
43
|
+
export declare const defaults: (def: MinimatchOptions) => typeof minimatch;
|
44
|
+
export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
|
45
|
+
export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
|
46
|
+
export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
|
47
|
+
export type MMRegExp = RegExp & {
|
48
|
+
_src?: string;
|
49
|
+
_glob?: string;
|
50
|
+
};
|
51
|
+
export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
|
52
|
+
export type ParseReturn = ParseReturnFiltered | false;
|
53
|
+
export declare class Minimatch {
|
54
|
+
options: MinimatchOptions;
|
55
|
+
set: ParseReturnFiltered[][];
|
56
|
+
pattern: string;
|
57
|
+
windowsPathsNoEscape: boolean;
|
58
|
+
nonegate: boolean;
|
59
|
+
negate: boolean;
|
60
|
+
comment: boolean;
|
61
|
+
empty: boolean;
|
62
|
+
preserveMultipleSlashes: boolean;
|
63
|
+
partial: boolean;
|
64
|
+
globSet: string[];
|
65
|
+
globParts: string[][];
|
66
|
+
nocase: boolean;
|
67
|
+
isWindows: boolean;
|
68
|
+
platform: Platform;
|
69
|
+
windowsNoMagicRoot: boolean;
|
70
|
+
regexp: false | null | MMRegExp;
|
71
|
+
constructor(pattern: string, options?: MinimatchOptions);
|
72
|
+
hasMagic(): boolean;
|
73
|
+
debug(..._: any[]): void;
|
74
|
+
make(): void;
|
75
|
+
preprocess(globParts: string[][]): string[][];
|
76
|
+
adjascentGlobstarOptimize(globParts: string[][]): string[][];
|
77
|
+
levelOneOptimize(globParts: string[][]): string[][];
|
78
|
+
levelTwoFileOptimize(parts: string | string[]): string[];
|
79
|
+
firstPhasePreProcess(globParts: string[][]): string[][];
|
80
|
+
secondPhasePreProcess(globParts: string[][]): string[][];
|
81
|
+
partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[];
|
82
|
+
parseNegate(): void;
|
83
|
+
matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
|
84
|
+
braceExpand(): string[];
|
85
|
+
parse(pattern: string): ParseReturn;
|
86
|
+
makeRe(): false | MMRegExp;
|
87
|
+
slashSplit(p: string): string[];
|
88
|
+
match(f: string, partial?: boolean): boolean;
|
89
|
+
static defaults(def: MinimatchOptions): typeof Minimatch;
|
90
|
+
}
|
91
|
+
export { AST } from './ast.js';
|
92
|
+
export { escape } from './escape.js';
|
93
|
+
export { unescape } from './unescape.js';
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { MinimatchOptions } from './index.js';
|
2
|
+
/**
|
3
|
+
* Un-escape a string that has been escaped with {@link escape}.
|
4
|
+
*
|
5
|
+
* If the {@link windowsPathsNoEscape} option is used, then square-brace
|
6
|
+
* escapes are removed, but not backslash escapes. For example, it will turn
|
7
|
+
* the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
|
8
|
+
* becuase `\` is a path separator in `windowsPathsNoEscape` mode.
|
9
|
+
*
|
10
|
+
* When `windowsPathsNoEscape` is not set, then both brace escapes and
|
11
|
+
* backslash escapes are removed.
|
12
|
+
*
|
13
|
+
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
|
14
|
+
* or unescaped.
|
15
|
+
*/
|
16
|
+
export declare const unescape: (s: string, { windowsPathsNoEscape, }?: Pick<MinimatchOptions, 'windowsPathsNoEscape'>) => string;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { MinimatchOptions } from './index.js';
|
2
|
+
/**
|
3
|
+
* Un-escape a string that has been escaped with {@link escape}.
|
4
|
+
*
|
5
|
+
* If the {@link windowsPathsNoEscape} option is used, then square-brace
|
6
|
+
* escapes are removed, but not backslash escapes. For example, it will turn
|
7
|
+
* the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
|
8
|
+
* becuase `\` is a path separator in `windowsPathsNoEscape` mode.
|
9
|
+
*
|
10
|
+
* When `windowsPathsNoEscape` is not set, then both brace escapes and
|
11
|
+
* backslash escapes are removed.
|
12
|
+
*
|
13
|
+
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
|
14
|
+
* or unescaped.
|
15
|
+
*/
|
16
|
+
export declare const unescape: (s: string, { windowsPathsNoEscape, }?: Pick<MinimatchOptions, 'windowsPathsNoEscape'>) => string;
|
File without changes
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import fs = require('fs');
|
2
|
+
import { GLOB } from './glob';
|
3
|
+
export declare function RIMRAF(path: string, options: RIMRAF.Options, callback: (error: Error) => void): void;
|
4
|
+
export declare function RIMRAF(path: string, callback: (error: Error) => void): void;
|
5
|
+
export declare namespace RIMRAF {
|
6
|
+
function __promisify__(path: string, options?: Options): Promise<void>;
|
7
|
+
function sync(path: string, options?: Options): void;
|
8
|
+
let EMFILE_MAX: number;
|
9
|
+
let BUSYTRIES_MAX: number;
|
10
|
+
interface Options {
|
11
|
+
maxBusyTries?: number;
|
12
|
+
emfileWait?: boolean;
|
13
|
+
disableGlob?: boolean;
|
14
|
+
glob?: GLOB.IOptions | false;
|
15
|
+
unlink?: typeof fs.unlink;
|
16
|
+
chmod?: typeof fs.chmod;
|
17
|
+
stat?: typeof fs.stat;
|
18
|
+
lstat?: typeof fs.lstat;
|
19
|
+
rmdir?: typeof fs.rmdir;
|
20
|
+
readdir?: typeof fs.readdir;
|
21
|
+
unlinkSync?: typeof fs.unlinkSync;
|
22
|
+
chmodSync?: typeof fs.chmodSync;
|
23
|
+
statSync?: typeof fs.statSync;
|
24
|
+
lstatSync?: typeof fs.lstatSync;
|
25
|
+
rmdirSync?: typeof fs.rmdirSync;
|
26
|
+
readdirSync?: typeof fs.readdirSync;
|
27
|
+
}
|
28
|
+
}
|
package/lib/utils.d.ts
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
-
import { CoreModels } from './core-models';
|
2
1
|
import { Blob } from 'buffer';
|
2
|
+
import { CoreModels } from './core-models';
|
3
3
|
export declare namespace Utils {
|
4
4
|
export const uniqArray: <T = any>(array: any[], uniqueProperty?: keyof T) => T[];
|
5
|
+
/**
|
6
|
+
* @param anyObject
|
7
|
+
* @returns object with sorted keys
|
8
|
+
*/
|
9
|
+
export const sortKeys: (anyObject: any) => any;
|
5
10
|
/**
|
6
11
|
* Example:
|
7
12
|
* new RegExp(escapeStringForRegEx('a.b.c'),'g') => /a\.b\.c/g
|
@@ -13,6 +18,12 @@ export declare namespace Utils {
|
|
13
18
|
export const getFreePort: (options?: {
|
14
19
|
startFrom?: number;
|
15
20
|
}) => Promise<number>;
|
21
|
+
export const requireUncached: (module: string) => any;
|
22
|
+
/**
|
23
|
+
* similar to camelCase but remove
|
24
|
+
* all non word / repeated characters
|
25
|
+
*/
|
26
|
+
export const camelize: (str?: string) => string;
|
16
27
|
interface AttrJsoncProp {
|
17
28
|
name: string;
|
18
29
|
value?: any;
|
@@ -149,6 +160,7 @@ export declare namespace UtilsProcess {
|
|
149
160
|
* TODO IMPLEMENT
|
150
161
|
* start async node process
|
151
162
|
*/
|
163
|
+
export const startAsync: (command: string, cwd: string, options?: Omit<CoreModels.ExecuteOptions, "tryAgainWhenFailAfter">) => Promise<void>;
|
152
164
|
/**
|
153
165
|
* This let you start child process and resolve promise when some
|
154
166
|
* condition is met. It is useful for example when you want to start
|
@@ -170,6 +182,34 @@ export declare namespace UtilsProcess {
|
|
170
182
|
*/
|
171
183
|
export const startInNewTerminalWindow: (command: string, options?: Pick<ProcessStartOptions, "cwd" | "hideOutput">) => any;
|
172
184
|
export const getBashOrShellName: () => "browser" | "cmd" | "powershell" | "gitbash" | "cygwin" | "unknown" | "bash" | "zsh" | "fish" | "sh";
|
185
|
+
/**
|
186
|
+
* Get CPU and memory usage for a single PID.
|
187
|
+
*/
|
188
|
+
export const getUsageForPid: (pid: number) => Promise<{
|
189
|
+
cpu: number;
|
190
|
+
memoryInGB: number;
|
191
|
+
memoryInMB: number;
|
192
|
+
}>;
|
193
|
+
/**
|
194
|
+
* Cross-platform function to list *direct* child PIDs of a given PID.
|
195
|
+
* Uses the appropriate command depending on `process.platform`.
|
196
|
+
*/
|
197
|
+
export function getChildPidsOnce(pid: number): Promise<number[]>;
|
198
|
+
/**
|
199
|
+
* Get CPU and memory usage for the current process (the Node.js process itself),
|
200
|
+
* plus any child processes spawned by it.
|
201
|
+
*/
|
202
|
+
export const getCurrentProcessAndChildUsage: () => Promise<{
|
203
|
+
current: {
|
204
|
+
cpu: number;
|
205
|
+
memoryInMB: number;
|
206
|
+
};
|
207
|
+
children: Array<{
|
208
|
+
pid: number;
|
209
|
+
cpu: number;
|
210
|
+
memoryInMB: number;
|
211
|
+
}>;
|
212
|
+
}>;
|
173
213
|
export {};
|
174
214
|
}
|
175
215
|
export declare namespace UtilsOs {
|
@@ -195,11 +235,17 @@ export declare namespace UtilsOs {
|
|
195
235
|
* Electron backend or browser.
|
196
236
|
*/
|
197
237
|
const isRunningInElectron: () => boolean;
|
238
|
+
/**
|
239
|
+
* Check whether the current process is running inside
|
240
|
+
* a Visual Studio Code extension.
|
241
|
+
*/
|
242
|
+
const isRunningInVscodeExtension: () => boolean;
|
198
243
|
/**
|
199
244
|
* Check wether the current process is running inside
|
200
245
|
* windows subsystem for linux (WSL).
|
201
246
|
*/
|
202
247
|
const isRunningInWsl: () => boolean;
|
248
|
+
const isRunningInWindowsCmd: () => boolean;
|
203
249
|
const isRunningInDocker: () => boolean;
|
204
250
|
const isRunningInLinuxGraphicsCapableEnvironment: () => boolean;
|
205
251
|
/**
|
@@ -254,6 +300,7 @@ export declare namespace UtilsTerminal {
|
|
254
300
|
visible?: boolean;
|
255
301
|
};
|
256
302
|
};
|
303
|
+
export const wait: (second: number) => Promise<void>;
|
257
304
|
export const clearConsole: () => void;
|
258
305
|
export const multiselect: <T = string>(options: {
|
259
306
|
question: string;
|