view-ignored 0.2.1 → 0.3.0
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 +23 -27
- package/bin/viewig +3 -1
- package/out/src/browser/binds/index.d.ts +40 -21
- package/out/src/browser/binds/index.js +62 -48
- package/out/src/browser/binds/plugins/git.d.ts +22 -3
- package/out/src/browser/binds/plugins/git.js +57 -21
- package/out/src/browser/binds/plugins/npm.d.ts +36 -9
- package/out/src/browser/binds/plugins/npm.js +125 -59
- package/out/src/browser/binds/plugins/vsce.d.ts +24 -8
- package/out/src/browser/binds/plugins/vsce.js +56 -16
- package/out/src/browser/binds/plugins/yarn.d.ts +5 -10
- package/out/src/browser/binds/plugins/yarn.js +18 -68
- package/out/src/browser/binds/scanner.d.ts +56 -0
- package/out/src/browser/binds/scanner.js +134 -0
- package/out/src/browser/binds/targets.d.ts +35 -11
- package/out/src/browser/binds/targets.js +10 -17
- package/out/src/browser/errors.d.ts +58 -7
- package/out/src/browser/errors.js +40 -12
- package/out/src/browser/filtering.d.ts +15 -0
- package/out/src/browser/filtering.js +12 -0
- package/out/src/browser/fs/directory.d.ts +181 -0
- package/out/src/browser/fs/directory.js +235 -0
- package/out/src/browser/{fileinfo.d.ts → fs/file-info.d.ts} +38 -27
- package/out/src/browser/fs/file-info.js +86 -0
- package/out/src/browser/fs/file.d.ts +41 -0
- package/out/src/browser/fs/file.js +43 -0
- package/out/src/browser/fs/index.d.ts +4 -0
- package/out/src/browser/fs/index.js +4 -0
- package/out/src/browser/fs/source-info.d.ts +29 -0
- package/out/src/browser/fs/source-info.js +31 -0
- package/out/src/browser/index.d.ts +2 -2
- package/out/src/browser/index.js +2 -2
- package/out/src/browser/lib.d.ts +102 -101
- package/out/src/browser/lib.js +86 -120
- package/out/src/browser/sorting.d.ts +22 -2
- package/out/src/browser/sorting.js +37 -32
- package/out/src/browser/styling.d.ts +41 -15
- package/out/src/browser/styling.js +28 -97
- package/out/src/cli.d.ts +73 -34
- package/out/src/cli.js +308 -155
- package/out/src/config.d.ts +163 -65
- package/out/src/config.js +285 -171
- package/out/src/errors.d.ts +7 -0
- package/out/src/errors.js +1 -0
- package/out/src/index.d.ts +2 -2
- package/out/src/index.js +2 -2
- package/out/src/lib.d.ts +4 -4
- package/out/src/lib.js +4 -4
- package/out/src/styling.d.ts +10 -4
- package/out/src/styling.js +46 -33
- package/package.json +37 -24
- package/out/src/bin.d.ts +0 -2
- package/out/src/bin.js +0 -3
- package/out/src/browser/fileinfo.js +0 -78
- package/out/src/browser/scanner.d.ts +0 -103
- package/out/src/browser/scanner.js +0 -161
- package/out/src/browser/sourceinfo.d.ts +0 -62
- package/out/src/browser/sourceinfo.js +0 -107
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
import path from
|
|
1
|
+
import path from 'node:path';
|
|
2
2
|
/**
|
|
3
3
|
* Contains all file sort names.
|
|
4
|
+
* @public
|
|
4
5
|
*/
|
|
5
|
-
export const sortNameList = [
|
|
6
|
+
export const sortNameList = ['firstFolders', 'firstFiles', 'type', 'mixed', 'modified'];
|
|
6
7
|
/**
|
|
7
8
|
* Checks if the value is the {@link SortName}.
|
|
9
|
+
* @public
|
|
8
10
|
*/
|
|
9
11
|
export function isSortName(value) {
|
|
10
|
-
return typeof value ===
|
|
12
|
+
return typeof value === 'string' && sortNameList.includes(value);
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
15
|
+
* @public
|
|
13
16
|
* @example
|
|
14
17
|
* "path/to/the/file" -> ["path", "to/the/file", false]
|
|
15
18
|
* "file" -> ["file", "file", true]
|
|
16
19
|
* "file/" -> ["file", "", false]
|
|
17
20
|
*/
|
|
18
|
-
function
|
|
19
|
-
const slashIndex = p.
|
|
20
|
-
const next = p.
|
|
21
|
-
const other = p.
|
|
22
|
-
const isLast = next === ''
|
|
21
|
+
export function shiftPath(p) {
|
|
22
|
+
const slashIndex = p.search(/[/\\]/);
|
|
23
|
+
const next = p.slice(0, Math.max(0, slashIndex));
|
|
24
|
+
const other = p.slice(Math.max(0, slashIndex + 1));
|
|
25
|
+
const isLast = next === '';
|
|
23
26
|
return [slashIndex < 0 ? other : next, other, isLast];
|
|
24
27
|
}
|
|
25
28
|
/**
|
|
26
29
|
* Files and folders are sorted by their names.
|
|
27
30
|
* Folders are displayed before files.
|
|
31
|
+
* @public
|
|
28
32
|
*/
|
|
29
33
|
export function firstFolders(a, b) {
|
|
30
34
|
let comp = 0;
|
|
31
|
-
let next1, others1, next2, others2, last1, last2;
|
|
32
35
|
for (; comp === 0;) {
|
|
33
|
-
[next1,
|
|
34
|
-
a =
|
|
35
|
-
[next2,
|
|
36
|
-
b =
|
|
36
|
+
const [next1, post1, last1] = shiftPath(a);
|
|
37
|
+
a = post1;
|
|
38
|
+
const [next2, post2, last2] = shiftPath(b);
|
|
39
|
+
b = post2;
|
|
37
40
|
comp = mixed(next1, next2);
|
|
38
41
|
if (last1 || last2) {
|
|
39
42
|
if (last1 === last2) {
|
|
40
43
|
break;
|
|
41
44
|
}
|
|
42
|
-
if (last1
|
|
45
|
+
if (!last1) {
|
|
43
46
|
return -1;
|
|
44
47
|
}
|
|
45
48
|
return +1;
|
|
@@ -50,21 +53,21 @@ export function firstFolders(a, b) {
|
|
|
50
53
|
/**
|
|
51
54
|
* Files and folders are sorted by their names.
|
|
52
55
|
* Files are displayed before folders.
|
|
56
|
+
* @public
|
|
53
57
|
*/
|
|
54
58
|
export function firstFiles(a, b) {
|
|
55
59
|
let comp = 0;
|
|
56
|
-
let next1, others1, next2, others2, last1, last2;
|
|
57
60
|
for (; comp === 0;) {
|
|
58
|
-
[next1,
|
|
59
|
-
a =
|
|
60
|
-
[next2,
|
|
61
|
-
b =
|
|
61
|
+
const [next1, post1, last1] = shiftPath(a);
|
|
62
|
+
a = post1;
|
|
63
|
+
const [next2, post2, last2] = shiftPath(b);
|
|
64
|
+
b = post2;
|
|
62
65
|
comp = mixed(next1, next2);
|
|
63
66
|
if (last1 || last2) {
|
|
64
67
|
if (last1 === last2) {
|
|
65
68
|
break;
|
|
66
69
|
}
|
|
67
|
-
if (last1
|
|
70
|
+
if (last1) {
|
|
68
71
|
return -1;
|
|
69
72
|
}
|
|
70
73
|
return +1;
|
|
@@ -75,21 +78,22 @@ export function firstFiles(a, b) {
|
|
|
75
78
|
/**
|
|
76
79
|
* Files and folders are sorted by last modified date in descending order.
|
|
77
80
|
* Folders are displayed before files.
|
|
81
|
+
* @see {@link makeMtimeCache}
|
|
82
|
+
* @public
|
|
78
83
|
*/
|
|
79
84
|
export function modified(a, b, map) {
|
|
80
85
|
let comp = 0;
|
|
81
|
-
let others1, others2, last1, last2;
|
|
82
86
|
for (; comp === 0;) {
|
|
83
|
-
[,
|
|
84
|
-
a =
|
|
85
|
-
[,
|
|
86
|
-
b =
|
|
87
|
+
const [, post1, last1] = shiftPath(a);
|
|
88
|
+
a = post1;
|
|
89
|
+
const [, post2, last2] = shiftPath(b);
|
|
90
|
+
b = post2;
|
|
87
91
|
comp = (map.get(a) ?? 0) - (map.get(b) ?? 0);
|
|
88
92
|
if (last1 || last2) {
|
|
89
93
|
if (last1 === last2) {
|
|
90
94
|
break;
|
|
91
95
|
}
|
|
92
|
-
if (last1
|
|
96
|
+
if (!last1) {
|
|
93
97
|
return -1;
|
|
94
98
|
}
|
|
95
99
|
return +1;
|
|
@@ -100,15 +104,15 @@ export function modified(a, b, map) {
|
|
|
100
104
|
/**
|
|
101
105
|
* Files and folders are grouped by extension type then sorted by thir names.
|
|
102
106
|
* Folders are displayed before files.
|
|
107
|
+
* @public
|
|
103
108
|
*/
|
|
104
109
|
export function type(a, b) {
|
|
105
110
|
let comp = 0;
|
|
106
|
-
let next1, others1, next2, others2, last1, last2;
|
|
107
111
|
for (; comp === 0;) {
|
|
108
|
-
[next1,
|
|
109
|
-
a =
|
|
110
|
-
[next2,
|
|
111
|
-
b =
|
|
112
|
+
const [next1, post1, last1] = shiftPath(a);
|
|
113
|
+
a = post1;
|
|
114
|
+
const [next2, post2, last2] = shiftPath(b);
|
|
115
|
+
b = post2;
|
|
112
116
|
const ppa = path.parse(next1);
|
|
113
117
|
const ppb = path.parse(next2);
|
|
114
118
|
comp = mixed(ppa.ext, ppb.ext) || mixed(ppa.name, ppb.name);
|
|
@@ -116,7 +120,7 @@ export function type(a, b) {
|
|
|
116
120
|
if (last1 === last2) {
|
|
117
121
|
break;
|
|
118
122
|
}
|
|
119
|
-
if (last1
|
|
123
|
+
if (!last1) {
|
|
120
124
|
return -1;
|
|
121
125
|
}
|
|
122
126
|
return +1;
|
|
@@ -127,6 +131,7 @@ export function type(a, b) {
|
|
|
127
131
|
/**
|
|
128
132
|
* Files and folders are sorted by their names.
|
|
129
133
|
* Files are interwoven with folders.
|
|
134
|
+
* @public
|
|
130
135
|
*/
|
|
131
136
|
export function mixed(a, b) {
|
|
132
137
|
return a.localeCompare(b, undefined, { ignorePunctuation: false });
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { type ChalkInstance } from 'chalk';
|
|
2
|
+
import { type Options } from 'boxen';
|
|
3
|
+
import { type FileInfo } from '../index.js';
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export type FormatFilesOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* On posix systems, this has no effect. But, on Windows, it means that
|
|
10
|
+
* paths will be `/` delimited, and absolute paths will be their full
|
|
11
|
+
* resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return
|
|
12
|
+
* `'//?/C:/foo/bar'`
|
|
13
|
+
* @default false
|
|
14
|
+
* @returns `/` delimited paths, even on Windows.
|
|
15
|
+
*/
|
|
16
|
+
posix?: boolean;
|
|
5
17
|
/**
|
|
6
18
|
* @default false
|
|
7
19
|
*/
|
|
@@ -14,40 +26,51 @@ export interface FormatFilesOptions {
|
|
|
14
26
|
* @default "paths"
|
|
15
27
|
*/
|
|
16
28
|
decor?: DecorName;
|
|
17
|
-
|
|
18
|
-
|
|
29
|
+
/**
|
|
30
|
+
* @default undefined
|
|
31
|
+
*/
|
|
32
|
+
chalk?: ChalkInstance;
|
|
33
|
+
};
|
|
19
34
|
/**
|
|
20
35
|
* @returns Prints a readable file list. Here is '\n' ending.
|
|
36
|
+
* @public
|
|
21
37
|
*/
|
|
22
38
|
export declare function formatFiles(files: FileInfo[], options: FormatFilesOptions): string;
|
|
23
39
|
/**
|
|
24
40
|
* Contains all style names.
|
|
41
|
+
* @public
|
|
25
42
|
*/
|
|
26
43
|
export declare const styleNameList: readonly ["tree", "paths"];
|
|
27
44
|
/**
|
|
28
45
|
* Contains all style names as a type.
|
|
46
|
+
* @public
|
|
29
47
|
*/
|
|
30
48
|
export type StyleName = typeof styleNameList[number];
|
|
31
49
|
/**
|
|
32
50
|
* Checks if the value is the {@link StyleName}.
|
|
51
|
+
* @public
|
|
33
52
|
*/
|
|
34
53
|
export declare function isStyleName(value: unknown): value is StyleName;
|
|
35
54
|
/**
|
|
36
55
|
* Contains all decor names.
|
|
56
|
+
* @public
|
|
37
57
|
*/
|
|
38
58
|
export declare const decorNameList: readonly ["normal", "emoji", "nerdfonts"];
|
|
39
59
|
/**
|
|
40
60
|
* Contains all decor names as a type.
|
|
61
|
+
* @public
|
|
41
62
|
*/
|
|
42
63
|
export type DecorName = typeof decorNameList[number];
|
|
43
64
|
/**
|
|
44
65
|
* Checks if the value is the {@link DecorName}.
|
|
66
|
+
* @public
|
|
45
67
|
*/
|
|
46
68
|
export declare function isDecorName(value: unknown): value is DecorName;
|
|
47
69
|
/**
|
|
48
70
|
* Formatting options for the {@link decorCondition}.
|
|
71
|
+
* @public
|
|
49
72
|
*/
|
|
50
|
-
export
|
|
73
|
+
export type DecorConditionOptions = {
|
|
51
74
|
/**
|
|
52
75
|
* @default ""
|
|
53
76
|
*/
|
|
@@ -71,20 +94,23 @@ export interface DecorConditionOptions {
|
|
|
71
94
|
* @default ""
|
|
72
95
|
*/
|
|
73
96
|
ifNerd?: string;
|
|
74
|
-
}
|
|
97
|
+
};
|
|
75
98
|
/**
|
|
76
99
|
* Formats the string for specific style types.
|
|
77
100
|
* @param decor The decor name.
|
|
78
101
|
* @param condition Formatting options.
|
|
102
|
+
* @public
|
|
79
103
|
*/
|
|
80
104
|
export declare function decorCondition(decor: DecorName, condition: DecorConditionOptions): string;
|
|
81
|
-
|
|
105
|
+
/**
|
|
106
|
+
* @see {@link boxError}
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
export type BoxOptions = {
|
|
82
110
|
noColor?: boolean;
|
|
83
|
-
}
|
|
84
|
-
export declare function boxError(message: string, options?: BoxOptions): string;
|
|
111
|
+
} & Options;
|
|
85
112
|
/**
|
|
86
|
-
*
|
|
87
|
-
* @
|
|
88
|
-
* @param filePath The full file path.
|
|
113
|
+
* Make a message in a red box. Or without color.
|
|
114
|
+
* @public
|
|
89
115
|
*/
|
|
90
|
-
export declare function
|
|
116
|
+
export declare function boxError(message: string, options?: BoxOptions): string;
|
|
@@ -1,47 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import PATH from 'node:path';
|
|
2
|
+
import { stripVTControlCharacters } from 'node:util';
|
|
3
|
+
import tree from 'treeify';
|
|
4
|
+
import jsonifyPaths from 'jsonify-paths';
|
|
5
|
+
import boxen from 'boxen';
|
|
6
6
|
/**
|
|
7
7
|
* @returns Prints a readable file list. Here is '\n' ending.
|
|
8
|
+
* @public
|
|
8
9
|
*/
|
|
9
10
|
export function formatFiles(files, options) {
|
|
10
|
-
const { showSources = false, chalk, decor =
|
|
11
|
-
const
|
|
12
|
-
const
|
|
11
|
+
const { showSources = false, chalk, decor = 'normal', style, posix = false } = options ?? {};
|
|
12
|
+
const patha = posix ? PATH.posix : PATH;
|
|
13
|
+
const isPaths = style === 'paths';
|
|
14
|
+
const paths = files.map(f => f.toString({
|
|
15
|
+
fileIcon: decor, usePrefix: true, chalk, source: showSources, entire: isPaths,
|
|
16
|
+
}));
|
|
13
17
|
if (isPaths) {
|
|
14
18
|
return paths.join('\n') + '\n';
|
|
15
19
|
}
|
|
16
|
-
//
|
|
17
|
-
const pathsAsObject = jsonifyPaths.from(paths, { delimiter:
|
|
20
|
+
// IsTree
|
|
21
|
+
const pathsAsObject = jsonifyPaths.from(paths, { delimiter: patha.sep });
|
|
18
22
|
const pathsAsTree = tree.asTree(pathsAsObject, true, true);
|
|
19
23
|
return pathsAsTree;
|
|
20
24
|
}
|
|
21
25
|
/**
|
|
22
26
|
* Contains all style names.
|
|
27
|
+
* @public
|
|
23
28
|
*/
|
|
24
29
|
export const styleNameList = ['tree', 'paths'];
|
|
25
30
|
/**
|
|
26
31
|
* Checks if the value is the {@link StyleName}.
|
|
32
|
+
* @public
|
|
27
33
|
*/
|
|
28
34
|
export function isStyleName(value) {
|
|
29
|
-
return typeof value ===
|
|
35
|
+
return typeof value === 'string' && styleNameList.includes(value);
|
|
30
36
|
}
|
|
31
37
|
/**
|
|
32
38
|
* Contains all decor names.
|
|
39
|
+
* @public
|
|
33
40
|
*/
|
|
34
41
|
export const decorNameList = ['normal', 'emoji', 'nerdfonts'];
|
|
35
42
|
/**
|
|
36
43
|
* Checks if the value is the {@link DecorName}.
|
|
44
|
+
* @public
|
|
37
45
|
*/
|
|
38
46
|
export function isDecorName(value) {
|
|
39
|
-
return typeof value ===
|
|
47
|
+
return typeof value === 'string' && decorNameList.includes(value);
|
|
40
48
|
}
|
|
41
49
|
/**
|
|
42
50
|
* Formats the string for specific style types.
|
|
43
51
|
* @param decor The decor name.
|
|
44
52
|
* @param condition Formatting options.
|
|
53
|
+
* @public
|
|
45
54
|
*/
|
|
46
55
|
export function decorCondition(decor, condition) {
|
|
47
56
|
let result = condition.ifNormal ?? '';
|
|
@@ -56,12 +65,16 @@ export function decorCondition(decor, condition) {
|
|
|
56
65
|
}
|
|
57
66
|
return result;
|
|
58
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Make a message in a red box. Or without color.
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
59
72
|
export function boxError(message, options) {
|
|
60
73
|
let result = ('\n' + boxen(message, {
|
|
61
|
-
titleAlignment:
|
|
74
|
+
titleAlignment: 'left',
|
|
62
75
|
padding: { left: 2, right: 2 },
|
|
63
|
-
borderColor:
|
|
64
|
-
borderStyle:
|
|
76
|
+
borderColor: 'redBright',
|
|
77
|
+
borderStyle: 'round',
|
|
65
78
|
...options,
|
|
66
79
|
}));
|
|
67
80
|
if (options?.noColor) {
|
|
@@ -69,85 +82,3 @@ export function boxError(message, options) {
|
|
|
69
82
|
}
|
|
70
83
|
return result;
|
|
71
84
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Returns file icon for the file name & extension.
|
|
74
|
-
* @param decor The decor name.
|
|
75
|
-
* @param filePath The full file path.
|
|
76
|
-
*/
|
|
77
|
-
export function decorFile(decor, filePath) {
|
|
78
|
-
const parsed = path.parse(filePath);
|
|
79
|
-
let icon = '';
|
|
80
|
-
switch (parsed.ext.toLocaleLowerCase()) {
|
|
81
|
-
case ".js":
|
|
82
|
-
case ".cjs":
|
|
83
|
-
case ".mjs":
|
|
84
|
-
icon = '\ue60c';
|
|
85
|
-
break;
|
|
86
|
-
case ".ts":
|
|
87
|
-
case ".cts":
|
|
88
|
-
case ".mts":
|
|
89
|
-
icon = '\ue628';
|
|
90
|
-
break;
|
|
91
|
-
case ".styl":
|
|
92
|
-
icon = '\ue600';
|
|
93
|
-
break;
|
|
94
|
-
case ".less":
|
|
95
|
-
icon = '\ue60b';
|
|
96
|
-
break;
|
|
97
|
-
case ".scss":
|
|
98
|
-
case ".sass":
|
|
99
|
-
icon = '\ue603';
|
|
100
|
-
break;
|
|
101
|
-
case ".go":
|
|
102
|
-
icon = '\ue65e';
|
|
103
|
-
break;
|
|
104
|
-
case ".json":
|
|
105
|
-
case ".jsonc":
|
|
106
|
-
case ".json5":
|
|
107
|
-
icon = '\ue60b';
|
|
108
|
-
break;
|
|
109
|
-
case ".yml":
|
|
110
|
-
case ".yaml":
|
|
111
|
-
icon = '\ue6a8';
|
|
112
|
-
break;
|
|
113
|
-
case ".gitignore":
|
|
114
|
-
icon = '\ue65d';
|
|
115
|
-
break;
|
|
116
|
-
case ".npmignore":
|
|
117
|
-
icon = '\ue616';
|
|
118
|
-
break;
|
|
119
|
-
case ".dockerignore":
|
|
120
|
-
icon = '\ue650';
|
|
121
|
-
break;
|
|
122
|
-
default:
|
|
123
|
-
icon = '\ue64e';
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
switch (parsed.name.toLocaleLowerCase()) {
|
|
127
|
-
case "readme":
|
|
128
|
-
icon = '\ue66a';
|
|
129
|
-
break;
|
|
130
|
-
case "changelog":
|
|
131
|
-
icon = '\ue641';
|
|
132
|
-
break;
|
|
133
|
-
case "tsconfig":
|
|
134
|
-
icon = '\ue69d';
|
|
135
|
-
break;
|
|
136
|
-
case "eslint.config":
|
|
137
|
-
icon = '\ue655';
|
|
138
|
-
break;
|
|
139
|
-
case "stylelint.config":
|
|
140
|
-
icon = '\ue695';
|
|
141
|
-
break;
|
|
142
|
-
default:
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
if (!decor) {
|
|
146
|
-
return '';
|
|
147
|
-
}
|
|
148
|
-
return decorCondition(decor, {
|
|
149
|
-
ifEmoji: '📄',
|
|
150
|
-
ifNerd: icon,
|
|
151
|
-
postfix: ' '
|
|
152
|
-
});
|
|
153
|
-
}
|
package/out/src/cli.d.ts
CHANGED
|
@@ -1,92 +1,131 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { FilterName } from
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { Argument, Option, Command } from 'commander';
|
|
2
|
+
import * as Config from './config.js';
|
|
3
|
+
import { type DecorName, type StyleName } from './browser/styling.js';
|
|
4
|
+
import { type SortName } from './browser/sorting.js';
|
|
5
|
+
import { type BoxOptions } from './styling.js';
|
|
6
|
+
import { type FilterName } from './browser/filtering.js';
|
|
7
|
+
/**
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
9
10
|
export declare function logError(message: string, options?: BoxOptions): void;
|
|
10
11
|
/**
|
|
11
|
-
* Use it instead of {@link program}.
|
|
12
|
+
* Use it instead of {@link program.parse}.
|
|
13
|
+
* @private
|
|
12
14
|
*/
|
|
13
15
|
export declare function programInit(): Promise<void>;
|
|
14
|
-
/** Chalk, but configured by view-ignored cli. */
|
|
15
|
-
export declare function getColorLevel(flags: ProgramFlags): ColorSupportLevel;
|
|
16
|
-
/** Chalk, but configured by view-ignored cli. */
|
|
17
|
-
export declare function getChalk(flags: ProgramFlags): ChalkInstance;
|
|
18
16
|
/**
|
|
19
17
|
* Command-line entire program flags.
|
|
18
|
+
* @public
|
|
20
19
|
*/
|
|
21
|
-
export
|
|
20
|
+
export type ProgramFlags = {
|
|
21
|
+
posix: boolean;
|
|
22
22
|
plugins: string[];
|
|
23
23
|
noColor: boolean;
|
|
24
|
-
color: string;
|
|
25
24
|
decor: DecorName;
|
|
26
|
-
|
|
25
|
+
parsable: boolean;
|
|
26
|
+
};
|
|
27
27
|
/**
|
|
28
28
|
* Command-line 'scan' command flags.
|
|
29
|
+
* @public
|
|
29
30
|
*/
|
|
30
|
-
export
|
|
31
|
+
export type ScanFlags = {
|
|
31
32
|
target: string;
|
|
32
33
|
filter: FilterName;
|
|
33
34
|
sort: SortName;
|
|
34
35
|
style: StyleName;
|
|
35
36
|
showSources: boolean;
|
|
36
37
|
depth: number;
|
|
37
|
-
|
|
38
|
-
}
|
|
38
|
+
concurrency: number;
|
|
39
|
+
};
|
|
39
40
|
/**
|
|
40
41
|
* Command-line 'cfg get' command flags.
|
|
42
|
+
* @public
|
|
41
43
|
*/
|
|
42
|
-
export
|
|
44
|
+
export type ConfigGetFlags = {
|
|
43
45
|
real: boolean;
|
|
44
|
-
|
|
46
|
+
types: boolean;
|
|
47
|
+
};
|
|
45
48
|
/**
|
|
46
49
|
* `view-ignored` command-line programl
|
|
50
|
+
* @public
|
|
47
51
|
*/
|
|
48
52
|
export declare const program: Command;
|
|
49
53
|
/**
|
|
50
54
|
* Command-line 'scan' command.
|
|
55
|
+
* @public
|
|
51
56
|
*/
|
|
52
57
|
export declare const scanProgram: Command;
|
|
53
58
|
/**
|
|
54
|
-
* Command-line 'config' command.
|
|
55
|
-
|
|
59
|
+
* Command-line 'config' command.
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
56
62
|
export declare const cfgProgram: Command;
|
|
57
63
|
/**
|
|
58
64
|
* Command-line argument: key=value pair.
|
|
59
|
-
* @see {@link
|
|
65
|
+
* @see {@link parseArgumentKeyValue}
|
|
66
|
+
* @public
|
|
60
67
|
*/
|
|
61
|
-
export declare const
|
|
68
|
+
export declare const argumentConfigKeyValue: Argument;
|
|
62
69
|
/**
|
|
63
70
|
* Command-line argument: config property.
|
|
64
71
|
* @see {@link Config.configKeyList}
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
export declare const argumentConfigKey: Argument;
|
|
75
|
+
/**
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
export declare const cfgRealOption: Option;
|
|
79
|
+
/**
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
export declare const cfgTypesOption: Option;
|
|
83
|
+
/**
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
export declare function parseArgumentArrayString(argument: string): string[];
|
|
87
|
+
/**
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
export declare function parseArgumentBoolean(argument: string): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
94
|
+
export declare function parseArgumentInteger(argument: string): number;
|
|
95
|
+
/**
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
export declare function createArgumentParserStringLiteral(choices: string[]): (argument: string) => string;
|
|
99
|
+
/**
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
102
|
+
export declare function parseArgumentKey(key: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* @public
|
|
65
105
|
*/
|
|
66
|
-
export declare
|
|
67
|
-
export declare const cfgGetOption: Option;
|
|
68
|
-
export declare function parseArgArrStr(arg: string): string[];
|
|
69
|
-
export declare function parseArgBool(arg: string): boolean;
|
|
70
|
-
export declare function parseArgInt(arg: string): number;
|
|
71
|
-
export declare function parseArgKey(key: string): Config.ConfigKey;
|
|
72
|
-
export declare function parseArgKeyVal(pair: string): Config.ConfigPair;
|
|
106
|
+
export declare function parseArgumentKeyValue(pair: string): Config.ConfigPair;
|
|
73
107
|
/**
|
|
74
108
|
* Command-line 'scan' command action.
|
|
109
|
+
* @public
|
|
75
110
|
*/
|
|
76
111
|
export declare function actionScan(): Promise<void>;
|
|
77
112
|
/**
|
|
78
113
|
* Command-line 'config path' command action.
|
|
114
|
+
* @public
|
|
79
115
|
*/
|
|
80
116
|
export declare function actionCfgPath(): void;
|
|
81
117
|
/**
|
|
82
118
|
* Command-line 'config set' command action
|
|
119
|
+
* @public
|
|
83
120
|
*/
|
|
84
|
-
export declare function actionCfgSet(pair
|
|
121
|
+
export declare function actionCfgSet(pair: Config.ConfigPair | undefined, options: ConfigGetFlags): void;
|
|
85
122
|
/**
|
|
86
123
|
* Command-line 'config unset' command action
|
|
124
|
+
* @public
|
|
87
125
|
*/
|
|
88
|
-
export declare function actionCfgUnset(key: Config.ConfigKey | undefined): void;
|
|
126
|
+
export declare function actionCfgUnset(key: Config.ConfigKey | undefined, options: ConfigGetFlags): void;
|
|
89
127
|
/**
|
|
90
128
|
* Command-line 'config unset' command action
|
|
129
|
+
* @public
|
|
91
130
|
*/
|
|
92
131
|
export declare function actionCfgGet(key: Config.ConfigKey | undefined, options: ConfigGetFlags): void;
|