view-ignored 0.1.1 → 0.2.1
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 +37 -54
- package/bin/viewig +2 -2
- package/out/src/bin.d.ts +2 -0
- package/out/src/bin.js +3 -0
- package/out/src/browser/binds/index.d.ts +45 -0
- package/out/src/browser/binds/index.js +78 -0
- package/out/src/browser/binds/plugins/git.d.ts +3 -0
- package/out/src/browser/binds/plugins/git.js +24 -0
- package/out/src/browser/binds/plugins/npm.d.ts +11 -0
- package/out/src/browser/binds/plugins/npm.js +71 -0
- package/out/src/browser/binds/plugins/vsce.d.ts +9 -0
- package/out/src/browser/binds/plugins/vsce.js +21 -0
- package/out/src/browser/binds/plugins/yarn.d.ts +16 -0
- package/out/src/browser/binds/plugins/yarn.js +78 -0
- package/out/src/browser/binds/targets.d.ts +64 -0
- package/out/src/browser/binds/targets.js +56 -0
- package/out/src/browser/errors.d.ts +10 -0
- package/out/src/browser/errors.js +20 -0
- package/out/src/browser/fileinfo.d.ts +82 -0
- package/out/src/browser/fileinfo.js +78 -0
- package/{lib → out/src/browser}/index.d.ts +0 -1
- package/{lib → out/src}/browser/index.js +0 -1
- package/out/src/browser/lib.d.ts +141 -0
- package/out/src/browser/lib.js +126 -0
- package/out/src/browser/scanner.d.ts +103 -0
- package/out/src/browser/scanner.js +161 -0
- package/out/src/browser/sorting.d.ts +41 -0
- package/out/src/browser/sorting.js +133 -0
- package/out/src/browser/sourceinfo.d.ts +62 -0
- package/out/src/browser/sourceinfo.js +107 -0
- package/out/src/browser/styling.d.ts +90 -0
- package/{lib → out/src}/browser/styling.js +64 -37
- package/out/src/cli.d.ts +92 -0
- package/out/src/cli.js +249 -0
- package/out/src/config.d.ts +141 -0
- package/out/src/config.js +257 -0
- package/{lib/browser → out/src}/index.d.ts +0 -1
- package/{lib → out/src}/index.js +0 -1
- package/{lib → out/src}/lib.d.ts +1 -2
- package/{lib → out/src}/lib.js +1 -2
- package/out/src/styling.d.ts +4 -0
- package/out/src/styling.js +40 -0
- package/package.json +21 -15
- package/lib/bin.d.ts +0 -3
- package/lib/bin.d.ts.map +0 -1
- package/lib/bin.js +0 -4
- package/lib/bin.js.map +0 -1
- package/lib/browser/binds/index.d.ts +0 -2
- package/lib/browser/binds/index.d.ts.map +0 -1
- package/lib/browser/binds/index.js +0 -2
- package/lib/browser/binds/index.js.map +0 -1
- package/lib/browser/binds/targets.d.ts +0 -52
- package/lib/browser/binds/targets.d.ts.map +0 -1
- package/lib/browser/binds/targets.js +0 -43
- package/lib/browser/binds/targets.js.map +0 -1
- package/lib/browser/binds.d.ts +0 -22
- package/lib/browser/binds.d.ts.map +0 -1
- package/lib/browser/binds.js +0 -14
- package/lib/browser/binds.js.map +0 -1
- package/lib/browser/fileinfo.d.ts +0 -72
- package/lib/browser/fileinfo.d.ts.map +0 -1
- package/lib/browser/fileinfo.js +0 -72
- package/lib/browser/fileinfo.js.map +0 -1
- package/lib/browser/index.d.ts.map +0 -1
- package/lib/browser/index.js.map +0 -1
- package/lib/browser/lib.d.ts +0 -141
- package/lib/browser/lib.d.ts.map +0 -1
- package/lib/browser/lib.js +0 -116
- package/lib/browser/lib.js.map +0 -1
- package/lib/browser/looker.d.ts +0 -79
- package/lib/browser/looker.d.ts.map +0 -1
- package/lib/browser/looker.js +0 -89
- package/lib/browser/looker.js.map +0 -1
- package/lib/browser/plugins/git.d.ts +0 -10
- package/lib/browser/plugins/git.d.ts.map +0 -1
- package/lib/browser/plugins/git.js +0 -23
- package/lib/browser/plugins/git.js.map +0 -1
- package/lib/browser/plugins/npm.d.ts +0 -12
- package/lib/browser/plugins/npm.d.ts.map +0 -1
- package/lib/browser/plugins/npm.js +0 -70
- package/lib/browser/plugins/npm.js.map +0 -1
- package/lib/browser/plugins/vsce.d.ts +0 -10
- package/lib/browser/plugins/vsce.d.ts.map +0 -1
- package/lib/browser/plugins/vsce.js +0 -23
- package/lib/browser/plugins/vsce.js.map +0 -1
- package/lib/browser/plugins/yarn.d.ts +0 -15
- package/lib/browser/plugins/yarn.d.ts.map +0 -1
- package/lib/browser/plugins/yarn.js +0 -46
- package/lib/browser/plugins/yarn.js.map +0 -1
- package/lib/browser/sorting.d.ts +0 -31
- package/lib/browser/sorting.d.ts.map +0 -1
- package/lib/browser/sorting.js +0 -121
- package/lib/browser/sorting.js.map +0 -1
- package/lib/browser/sourcepattern.d.ts +0 -35
- package/lib/browser/sourcepattern.d.ts.map +0 -1
- package/lib/browser/sourcepattern.js +0 -56
- package/lib/browser/sourcepattern.js.map +0 -1
- package/lib/browser/styling.d.ts +0 -47
- package/lib/browser/styling.d.ts.map +0 -1
- package/lib/browser/styling.js.map +0 -1
- package/lib/browser/tools/index.d.ts +0 -3
- package/lib/browser/tools/index.d.ts.map +0 -1
- package/lib/browser/tools/index.js +0 -3
- package/lib/browser/tools/index.js.map +0 -1
- package/lib/browser/tools/sorting.d.ts +0 -31
- package/lib/browser/tools/sorting.d.ts.map +0 -1
- package/lib/browser/tools/sorting.js +0 -121
- package/lib/browser/tools/sorting.js.map +0 -1
- package/lib/browser/tools/styles.d.ts +0 -16
- package/lib/browser/tools/styles.d.ts.map +0 -1
- package/lib/browser/tools/styles.js +0 -116
- package/lib/browser/tools/styles.js.map +0 -1
- package/lib/cli.d.ts +0 -61
- package/lib/cli.d.ts.map +0 -1
- package/lib/cli.js +0 -165
- package/lib/cli.js.map +0 -1
- package/lib/config.d.ts +0 -134
- package/lib/config.d.ts.map +0 -1
- package/lib/config.js +0 -142
- package/lib/config.js.map +0 -1
- package/lib/git.d.ts +0 -13
- package/lib/git.d.ts.map +0 -1
- package/lib/git.js +0 -37
- package/lib/git.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/lib.d.ts.map +0 -1
- package/lib/lib.js.map +0 -1
- package/lib/plugins/git.d.ts +0 -9
- package/lib/plugins/git.js +0 -22
- package/lib/plugins/git.js.map +0 -1
- package/lib/plugins/npm.d.ts +0 -12
- package/lib/plugins/npm.js +0 -74
- package/lib/plugins/npm.js.map +0 -1
- package/lib/plugins/vsce.d.ts +0 -9
- package/lib/plugins/vsce.js +0 -22
- package/lib/plugins/vsce.js.map +0 -1
- package/lib/plugins/yarn.d.ts +0 -15
- package/lib/plugins/yarn.js +0 -50
- package/lib/plugins/yarn.js.map +0 -1
- package/lib/tools/index.d.ts +0 -3
- package/lib/tools/index.js +0 -4
- package/lib/tools/index.js.map +0 -1
- package/lib/tools/methods.d.ts +0 -16
- package/lib/tools/methods.js +0 -81
- package/lib/tools/methods.js.map +0 -1
- package/lib/tools/sorting.d.ts +0 -30
- package/lib/tools/sorting.js +0 -121
- package/lib/tools/sorting.js.map +0 -1
- package/lib/tools/styles.d.ts +0 -15
- package/lib/tools/styles.js +0 -123
- package/lib/tools/styles.js.map +0 -1
- package/lib/util/index.d.ts +0 -3
- package/lib/util/index.js +0 -4
- package/lib/util/index.js.map +0 -1
- package/lib/util/presets.d.ts +0 -24
- package/lib/util/presets.js +0 -129
- package/lib/util/presets.js.map +0 -1
- package/lib/util/sorting.d.ts +0 -30
- package/lib/util/sorting.js +0 -121
- package/lib/util/sorting.js.map +0 -1
- package/lib/util/styles.d.ts +0 -8
- package/lib/util/styles.js +0 -52
- package/lib/util/styles.js.map +0 -1
package/lib/config.js
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { filterNameList, Binding, Sorting, Styling } from "./browser/index.js";
|
|
2
|
-
import * as os from "os";
|
|
3
|
-
import propertiesFile from "properties";
|
|
4
|
-
import path from "path";
|
|
5
|
-
import { existsSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
6
|
-
/**
|
|
7
|
-
* The full config file name - `".view-ignored"`.
|
|
8
|
-
*/
|
|
9
|
-
export const configFileName = ".view-ignored";
|
|
10
|
-
/**
|
|
11
|
-
* The user's home directory + the config file name.
|
|
12
|
-
* @see {@link os.homedir}
|
|
13
|
-
*/
|
|
14
|
-
export const configFilePath = path.join(os.homedir(), configFileName);
|
|
15
|
-
/**
|
|
16
|
-
* Command-line configuration property list.
|
|
17
|
-
*/
|
|
18
|
-
export const configKeyList = ["color", "target", "filter", "sort", "style"];
|
|
19
|
-
/**
|
|
20
|
-
* Command-line default config values.
|
|
21
|
-
*/
|
|
22
|
-
export const configDefault = {
|
|
23
|
-
color: "3",
|
|
24
|
-
target: "git",
|
|
25
|
-
filter: "included",
|
|
26
|
-
sort: "firstFolders",
|
|
27
|
-
style: "treeEmoji",
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Represents allowed values for each config property.
|
|
31
|
-
*/
|
|
32
|
-
export const configValues = {
|
|
33
|
-
color: ["1", "2", "3", "4"],
|
|
34
|
-
target: Binding.targetList(),
|
|
35
|
-
filter: filterNameList,
|
|
36
|
-
sort: Sorting.sortNameList,
|
|
37
|
-
style: Styling.styleNameList
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* @see {@link configValues}
|
|
41
|
-
* @returns `true` if the value is a {@link Config}.
|
|
42
|
-
*/
|
|
43
|
-
export function configPartialGood(cfg) {
|
|
44
|
-
if ((cfg === null || cfg === void 0 ? void 0 : cfg.constructor) !== Object) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
const jsonobj = cfg;
|
|
48
|
-
return Object.entries(configValues).every(([key, possible]) => key in jsonobj
|
|
49
|
-
? (possible.includes(String(jsonobj[key])))
|
|
50
|
-
: true);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* The config manipulator.
|
|
54
|
-
* @todo Convert to a *class instance* or *just methods* and hide the 'data' property.
|
|
55
|
-
*/
|
|
56
|
-
export const configManager = {
|
|
57
|
-
/**
|
|
58
|
-
* Do not change this value directly.
|
|
59
|
-
* @todo Make private.
|
|
60
|
-
* @see {@link configManager}.
|
|
61
|
-
*/
|
|
62
|
-
data: {},
|
|
63
|
-
/**
|
|
64
|
-
* Loads the config from the file to {@link configManager.data}. If the data is not valid, throws an error without loading.
|
|
65
|
-
* @returns `undefined` if the config file does not exist.
|
|
66
|
-
*/
|
|
67
|
-
load() {
|
|
68
|
-
const parsed = existsSync(configFilePath) ? propertiesFile.parse(readFileSync(configFilePath).toString()) : undefined;
|
|
69
|
-
if (parsed === undefined) {
|
|
70
|
-
return this;
|
|
71
|
-
}
|
|
72
|
-
if (!configPartialGood(parsed)) {
|
|
73
|
-
throw new TypeError(`Invalid config. Got ${parsed && JSON.stringify(parsed)}.`);
|
|
74
|
-
}
|
|
75
|
-
Object.assign(this.data, parsed);
|
|
76
|
-
return this;
|
|
77
|
-
},
|
|
78
|
-
/**
|
|
79
|
-
* Saves the partial config to the file. If there are no settings, the file will be deleted, if exists.
|
|
80
|
-
*/
|
|
81
|
-
save() {
|
|
82
|
-
if (Object.keys(this.data).length === 0) {
|
|
83
|
-
if (existsSync(configFilePath)) {
|
|
84
|
-
rmSync(configFilePath);
|
|
85
|
-
}
|
|
86
|
-
return this;
|
|
87
|
-
}
|
|
88
|
-
writeFileSync(configFilePath, propertiesFile.stringify(this.data));
|
|
89
|
-
return this;
|
|
90
|
-
},
|
|
91
|
-
/**
|
|
92
|
-
* Sets a new value for the specified config property.
|
|
93
|
-
* Expects a valid value.
|
|
94
|
-
* @param key The name of the config property.
|
|
95
|
-
* @param value The new value for the config property.
|
|
96
|
-
*/
|
|
97
|
-
set(key, value) {
|
|
98
|
-
this.data[key] = value;
|
|
99
|
-
return this;
|
|
100
|
-
},
|
|
101
|
-
/**
|
|
102
|
-
* Deletes the specified property from the config.
|
|
103
|
-
* If the property is not specified, then all properties will be deleted.
|
|
104
|
-
* @param key The config property.
|
|
105
|
-
*/
|
|
106
|
-
unset(key) {
|
|
107
|
-
if (key === undefined) {
|
|
108
|
-
for (const key of Object.keys(this.data)) {
|
|
109
|
-
delete this.data[key];
|
|
110
|
-
}
|
|
111
|
-
return this;
|
|
112
|
-
}
|
|
113
|
-
delete this.data[key];
|
|
114
|
-
return this;
|
|
115
|
-
},
|
|
116
|
-
/**
|
|
117
|
-
* Returns the value for the specified property.
|
|
118
|
-
* @param key The config property.
|
|
119
|
-
* @param fallbackDefault If `true`, the default value will be used when the value is `undefined`. Default `true`.
|
|
120
|
-
*/
|
|
121
|
-
get(key, fallbackDefault = true) {
|
|
122
|
-
const value = this.data[key];
|
|
123
|
-
if (fallbackDefault && value === undefined) {
|
|
124
|
-
return configDefault[key];
|
|
125
|
-
}
|
|
126
|
-
return value;
|
|
127
|
-
},
|
|
128
|
-
/**
|
|
129
|
-
* @param key The config property.
|
|
130
|
-
* @param fallbackDefault If `true`, the default value will be used when the value is `undefined`. Default `true`.
|
|
131
|
-
* @returns The string in the `"key=value"` format, if the property is specified.
|
|
132
|
-
* Otherwise in format `"key=value\nkey=value\n..."` without new line ending.
|
|
133
|
-
*/
|
|
134
|
-
getPairString(key, fallbackDefault = true) {
|
|
135
|
-
if (key === undefined) {
|
|
136
|
-
return configKeyList.map((key) => this.getPairString(key, fallbackDefault)).filter(Boolean).join('\n');
|
|
137
|
-
}
|
|
138
|
-
const val = this.get(key, fallbackDefault);
|
|
139
|
-
return val ? `${key}=${val}` : '';
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
//# sourceMappingURL=config.js.map
|
package/lib/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC1F,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,cAAc,MAAM,YAAY,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAEpE;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAA;AAE7C;;;GAGG;AACH,MAAM,CAAC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AAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAQ,CAAC,CAAA;YAC9B,CAAC;YACD,OAAO,IAAI,CAAA;QACf,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACrB,OAAO,IAAI,CAAA;IACf,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAsB,GAAM,EAAE,kBAA2B,IAAI;QAC5D,MAAM,KAAK,GAA0B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACnD,IAAI,eAAe,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzC,OAAO,aAAa,CAAC,GAAG,CAAC,CAAA;QAC7B,CAAC;QACD,OAAO,KAAK,CAAA;IAChB,CAAC;IAED;;;;;OAKG;IACH,aAAa,CAAsB,GAAO,EAAE,kBAA2B,IAAI;QACvE,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACpB,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC/G,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA;QAC1C,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACrC,CAAC;CACK,CAAA"}
|
package/lib/git.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Read git config value as string.
|
|
3
|
-
*/
|
|
4
|
-
export declare function CurrentBranch(cwd?: string): string | undefined;
|
|
5
|
-
/**
|
|
6
|
-
* Read git config value as string.
|
|
7
|
-
*/
|
|
8
|
-
export declare function String(key: string, cwd?: string): string | undefined;
|
|
9
|
-
/**
|
|
10
|
-
* Read git config value as boolean.
|
|
11
|
-
*/
|
|
12
|
-
export declare function Boolean(key: string, cwd?: string): boolean | undefined;
|
|
13
|
-
//# sourceMappingURL=git.d.ts.map
|
package/lib/git.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAM9D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMpE;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAQtE"}
|
package/lib/git.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { execSync } from "child_process";
|
|
2
|
-
/**
|
|
3
|
-
* Read git config value as string.
|
|
4
|
-
*/
|
|
5
|
-
export function CurrentBranch(cwd) {
|
|
6
|
-
try {
|
|
7
|
-
return execSync(`git rev-parse --abbrev-ref HEAD`, { cwd: cwd, }).toString().trim();
|
|
8
|
-
}
|
|
9
|
-
catch (error) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Read git config value as string.
|
|
15
|
-
*/
|
|
16
|
-
export function String(key, cwd) {
|
|
17
|
-
try {
|
|
18
|
-
return execSync(`git config ${key}`, { cwd: cwd, }).toString();
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Read git config value as boolean.
|
|
26
|
-
*/
|
|
27
|
-
export function Boolean(key, cwd) {
|
|
28
|
-
var _a;
|
|
29
|
-
const str = (_a = String(key, cwd)) === null || _a === void 0 ? void 0 : _a.trim();
|
|
30
|
-
if (str === "true") {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
if (str === "false") {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=git.js.map
|
package/lib/git.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,GAAY;IACzC,IAAI,CAAC;QACJ,OAAO,QAAQ,CAAC,iCAAiC,EAAE,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;IACrF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO;IACR,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,GAAW,EAAE,GAAY;IAC/C,IAAI,CAAC;QACJ,OAAO,QAAQ,CAAC,cAAc,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;IAChE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO;IACR,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,GAAW,EAAE,GAAY;;IAChD,MAAM,GAAG,GAAG,MAAA,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,0CAAE,IAAI,EAAE,CAAA;IACpC,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,IAAI,CAAA;IACZ,CAAC;IACD,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;QACrB,OAAO,KAAK,CAAA;IACb,CAAC;AACF,CAAC"}
|
package/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,UAAU,CAAA;AACvC,eAAe,WAAW,CAAA;AAC1B,cAAc,UAAU,CAAA"}
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,UAAU,CAAA;AACvC,eAAe,WAAW,CAAA;AAC1B,cAAc,UAAU,CAAA"}
|
package/lib/lib.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA"}
|
package/lib/lib.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA"}
|
package/lib/plugins/git.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { LookMethod, LookFolderOptions, Source, TargetBind } from "../index.js";
|
|
2
|
-
export declare const id = "git";
|
|
3
|
-
export declare const name = "Git";
|
|
4
|
-
export declare const check = "git ls-tree -r <git-branch-name> --name-only";
|
|
5
|
-
export declare const method: LookMethod;
|
|
6
|
-
export declare const sources: Source[];
|
|
7
|
-
export declare const scanOptions: LookFolderOptions;
|
|
8
|
-
declare const bind: TargetBind;
|
|
9
|
-
export default bind;
|
package/lib/plugins/git.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { SourcePattern, targetBind } from "../index.js";
|
|
2
|
-
export const id = "git";
|
|
3
|
-
export const name = "Git";
|
|
4
|
-
export const check = `git ls-tree -r <git-branch-name> --name-only`;
|
|
5
|
-
export const method = function (data) {
|
|
6
|
-
const { looker, sourceFile: source } = data;
|
|
7
|
-
if (!looker.isValidPattern(source.content)) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
looker.add(source.content);
|
|
11
|
-
return true;
|
|
12
|
-
};
|
|
13
|
-
export const sources = [
|
|
14
|
-
{ sources: new SourcePattern("**/.gitignore"), patternType: ".*ignore", method },
|
|
15
|
-
];
|
|
16
|
-
export const scanOptions = {
|
|
17
|
-
allowRelativePaths: false,
|
|
18
|
-
};
|
|
19
|
-
const bind = { id, name, sources, scanOptions, check };
|
|
20
|
-
targetBind(bind);
|
|
21
|
-
export default bind;
|
|
22
|
-
//# sourceMappingURL=git.js.map
|
package/lib/plugins/git.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/plugins/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,aAAa,EAAc,UAAU,EAAE,MAAM,aAAa,CAAA;AAE1G,MAAM,CAAC,MAAM,EAAE,GAAG,KAAK,CAAA;AACvB,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAA;AACzB,MAAM,CAAC,MAAM,KAAK,GAAG,8CAA8C,CAAA;AAEnE,MAAM,CAAC,MAAM,MAAM,GAAe,UAAU,IAAI;IAC5C,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC3C,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QACzC,OAAO,KAAK,CAAA;IAChB,CAAC;IACD,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC1B,OAAO,IAAI,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAa;IAC7B,EAAE,OAAO,EAAE,IAAI,aAAa,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE;CACnF,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC1C,kBAAkB,EAAE,KAAK;CAC5B,CAAA;AAED,MAAM,IAAI,GAAe,EAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAC,CAAA;AAChE,UAAU,CAAC,IAAI,CAAC,CAAA;AAChB,eAAe,IAAI,CAAA"}
|
package/lib/plugins/npm.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { LookMethod, LookFolderOptions, Source, TargetBind } from "../index.js";
|
|
2
|
-
export declare const id = "npm";
|
|
3
|
-
export declare const name = "NPM";
|
|
4
|
-
export declare const check = "npm pack --dry-run";
|
|
5
|
-
export declare const npmPatternExclude: string[];
|
|
6
|
-
export declare const npmPatternInclude: string[];
|
|
7
|
-
export declare const methodGit: LookMethod;
|
|
8
|
-
export declare const methodPackageJsonFiles: LookMethod;
|
|
9
|
-
export declare const sources: Source[];
|
|
10
|
-
export declare const scanOptions: LookFolderOptions;
|
|
11
|
-
declare const bind: TargetBind;
|
|
12
|
-
export default bind;
|
package/lib/plugins/npm.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { SourcePattern, targetBind } from "../index.js";
|
|
2
|
-
import getValue from "get-value";
|
|
3
|
-
export const id = "npm";
|
|
4
|
-
export const name = "NPM";
|
|
5
|
-
export const check = "npm pack --dry-run";
|
|
6
|
-
export const npmPatternExclude = [
|
|
7
|
-
'.*.swp',
|
|
8
|
-
'._*',
|
|
9
|
-
'.DS_Store',
|
|
10
|
-
'.git',
|
|
11
|
-
'.gitignore',
|
|
12
|
-
'.hg',
|
|
13
|
-
'.npmignore',
|
|
14
|
-
'.npmrc',
|
|
15
|
-
'.lock-wscript',
|
|
16
|
-
'.svn',
|
|
17
|
-
'.wafpickle-*',
|
|
18
|
-
'config.gypi',
|
|
19
|
-
'CVS',
|
|
20
|
-
'npm-debug.log',
|
|
21
|
-
];
|
|
22
|
-
export const npmPatternInclude = [
|
|
23
|
-
'bin/',
|
|
24
|
-
'package.json',
|
|
25
|
-
'README',
|
|
26
|
-
'README.*',
|
|
27
|
-
'LICENSE',
|
|
28
|
-
'LICENSE.*',
|
|
29
|
-
'LICENCE',
|
|
30
|
-
'LICENCE.*',
|
|
31
|
-
];
|
|
32
|
-
export const methodGit = function (data) {
|
|
33
|
-
const { looker, sourceFile: source } = data;
|
|
34
|
-
looker.patternType = "minimatch";
|
|
35
|
-
if (!looker.isValidPattern(source.content)) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
looker.add(source.content);
|
|
39
|
-
return true;
|
|
40
|
-
};
|
|
41
|
-
export const methodPackageJsonFiles = function (data) {
|
|
42
|
-
const { looker, sourceFile: source } = data;
|
|
43
|
-
looker.isNegated = true;
|
|
44
|
-
let parsed;
|
|
45
|
-
try {
|
|
46
|
-
const json = JSON.parse(source.content);
|
|
47
|
-
if ((json === null || json === void 0 ? void 0 : json.constructor) !== Object) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
parsed = json;
|
|
51
|
-
}
|
|
52
|
-
catch (_a) {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
const propVal = getValue(parsed, "files");
|
|
56
|
-
if (!Array.isArray(propVal)) {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
looker.add(propVal);
|
|
60
|
-
return true;
|
|
61
|
-
};
|
|
62
|
-
export const sources = [
|
|
63
|
-
{ sources: new SourcePattern("**/package.json"), patternType: "minimatch", method: methodPackageJsonFiles },
|
|
64
|
-
{ sources: new SourcePattern("**/.npmignore"), patternType: ".*ignore", method: methodGit },
|
|
65
|
-
{ sources: new SourcePattern("**/.gitignore"), patternType: ".*ignore", method: methodGit },
|
|
66
|
-
];
|
|
67
|
-
export const scanOptions = {
|
|
68
|
-
addPatterns: npmPatternInclude,
|
|
69
|
-
ignore: npmPatternExclude,
|
|
70
|
-
};
|
|
71
|
-
const bind = { id, name, sources, scanOptions, check };
|
|
72
|
-
targetBind(bind);
|
|
73
|
-
export default bind;
|
|
74
|
-
//# sourceMappingURL=npm.js.map
|
package/lib/plugins/npm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"npm.js","sourceRoot":"","sources":["../../src/plugins/npm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,aAAa,EAAc,UAAU,EAAE,MAAM,aAAa,CAAA;AAC1G,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,GAAG,KAAK,CAAA;AACvB,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAA;AACzB,MAAM,CAAC,MAAM,KAAK,GAAG,oBAAoB,CAAA;AAEzC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,QAAQ;IACR,KAAK;IACL,WAAW;IACX,MAAM;IACN,YAAY;IACZ,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,eAAe;IACf,MAAM;IACN,cAAc;IACd,aAAa;IACb,KAAK;IACL,eAAe;CAClB,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,MAAM;IACN,cAAc;IACd,QAAQ;IACR,UAAU;IACV,SAAS;IACT,WAAW;IACX,SAAS;IACT,WAAW;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAe,UAAU,IAAI;IAC/C,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC3C,M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E,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE;IAC3F,EAAE,OAAO,EAAE,IAAI,aAAa,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE;CAC9F,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC1C,WAAW,EAAE,iBAAiB;IAC9B,MAAM,EAAE,iBAAiB;CAC5B,CAAA;AAED,MAAM,IAAI,GAAe,EAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAC,CAAA;AAChE,UAAU,CAAC,IAAI,CAAC,CAAA;AAChB,eAAe,IAAI,CAAA"}
|
package/lib/plugins/vsce.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { LookMethod, Source, LookFolderOptions, TargetBind } from "../index.js";
|
|
2
|
-
export declare const id = "vsce";
|
|
3
|
-
export declare const name = "VSC Extension";
|
|
4
|
-
export declare const check = "vsce ls";
|
|
5
|
-
export declare const method: LookMethod;
|
|
6
|
-
export declare const sources: Source[];
|
|
7
|
-
export declare const scanOptions: LookFolderOptions;
|
|
8
|
-
declare const bind: TargetBind;
|
|
9
|
-
export default bind;
|
package/lib/plugins/vsce.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { SourcePattern, targetBind } from "../index.js";
|
|
2
|
-
export const id = "vsce";
|
|
3
|
-
export const name = "VSC Extension";
|
|
4
|
-
export const check = "vsce ls";
|
|
5
|
-
export const method = function (data) {
|
|
6
|
-
const { looker, sourceFile: source } = data;
|
|
7
|
-
if (!looker.isValidPattern(source.content)) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
looker.add(source.content);
|
|
11
|
-
return true;
|
|
12
|
-
};
|
|
13
|
-
export const sources = [
|
|
14
|
-
{ sources: new SourcePattern("**/.gitignore"), patternType: ".*ignore", method },
|
|
15
|
-
];
|
|
16
|
-
export const scanOptions = {
|
|
17
|
-
allowRelativePaths: false,
|
|
18
|
-
};
|
|
19
|
-
const bind = { id, name, sources, scanOptions, check };
|
|
20
|
-
targetBind(bind);
|
|
21
|
-
export default bind;
|
|
22
|
-
//# sourceMappingURL=vsce.js.map
|
package/lib/plugins/vsce.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vsce.js","sourceRoot":"","sources":["../../src/plugins/vsce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAiC,UAAU,EAAE,MAAM,aAAa,CAAA;AAE1G,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAA;AACxB,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAA;AACnC,MAAM,CAAC,MAAM,KAAK,GAAG,SAAS,CAAA;AAE9B,MAAM,CAAC,MAAM,MAAM,GAAe,UAAU,IAAI;IAC5C,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC3C,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QACzC,OAAO,KAAK,CAAA;IAChB,CAAC;IACD,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC1B,OAAO,IAAI,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAa;IAC7B,EAAE,OAAO,EAAE,IAAI,aAAa,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE;CACnF,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC1C,kBAAkB,EAAE,KAAK;CAC5B,CAAA;AAED,MAAM,IAAI,GAAe,EAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAC,CAAA;AAChE,UAAU,CAAC,IAAI,CAAC,CAAA;AAChB,eAAe,IAAI,CAAA"}
|
package/lib/plugins/yarn.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Source, LookFolderOptions, TargetBind } from "../index.js";
|
|
2
|
-
export declare const id = "yarn";
|
|
3
|
-
export declare const name = "Yarn";
|
|
4
|
-
/**
|
|
5
|
-
* [!WARNING] All patterns copied from npm plugin, so they should be verified with yarn docs.
|
|
6
|
-
*/
|
|
7
|
-
export declare const yarnPatternExclude: string[];
|
|
8
|
-
/**
|
|
9
|
-
* [!WARNING] All patterns copied from npm plugin, so they should be verified with yarn docs.
|
|
10
|
-
*/
|
|
11
|
-
export declare const yarnPatternInclude: string[];
|
|
12
|
-
export declare const sources: Source[];
|
|
13
|
-
export declare const scanOptions: LookFolderOptions;
|
|
14
|
-
declare const bind: TargetBind;
|
|
15
|
-
export default bind;
|
package/lib/plugins/yarn.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { SourcePattern, targetBind } from "../index.js";
|
|
2
|
-
import * as pluginNpm from "./npm.js";
|
|
3
|
-
export const id = "yarn";
|
|
4
|
-
export const name = "Yarn";
|
|
5
|
-
/**
|
|
6
|
-
* [!WARNING] All patterns copied from npm plugin, so they should be verified with yarn docs.
|
|
7
|
-
*/
|
|
8
|
-
export const yarnPatternExclude = [
|
|
9
|
-
'.*.swp',
|
|
10
|
-
'._*',
|
|
11
|
-
'.DS_Store',
|
|
12
|
-
'.git',
|
|
13
|
-
'.gitignore',
|
|
14
|
-
'.hg',
|
|
15
|
-
'.npmignore',
|
|
16
|
-
'.npmrc',
|
|
17
|
-
'.lock-wscript',
|
|
18
|
-
'.svn',
|
|
19
|
-
'.wafpickle-*',
|
|
20
|
-
'config.gypi',
|
|
21
|
-
'CVS',
|
|
22
|
-
'npm-debug.log',
|
|
23
|
-
];
|
|
24
|
-
/**
|
|
25
|
-
* [!WARNING] All patterns copied from npm plugin, so they should be verified with yarn docs.
|
|
26
|
-
*/
|
|
27
|
-
export const yarnPatternInclude = [
|
|
28
|
-
'bin/',
|
|
29
|
-
'package.json',
|
|
30
|
-
'README',
|
|
31
|
-
'README.*',
|
|
32
|
-
'LICENSE',
|
|
33
|
-
'LICENSE.*',
|
|
34
|
-
'LICENCE',
|
|
35
|
-
'LICENCE.*',
|
|
36
|
-
];
|
|
37
|
-
export const sources = [
|
|
38
|
-
{ sources: new SourcePattern("**/package.json"), patternType: "minimatch", method: pluginNpm.methodPackageJsonFiles },
|
|
39
|
-
{ sources: new SourcePattern("**/.yarnignore"), patternType: ".*ignore", method: pluginNpm.methodGit },
|
|
40
|
-
{ sources: new SourcePattern("**/.npmignore"), patternType: ".*ignore", method: pluginNpm.methodGit },
|
|
41
|
-
{ sources: new SourcePattern("**/.gitignore"), patternType: ".*ignore", method: pluginNpm.methodGit },
|
|
42
|
-
];
|
|
43
|
-
export const scanOptions = {
|
|
44
|
-
ignore: yarnPatternExclude,
|
|
45
|
-
addPatterns: yarnPatternInclude,
|
|
46
|
-
};
|
|
47
|
-
const bind = { id, name, sources, scanOptions };
|
|
48
|
-
targetBind(bind);
|
|
49
|
-
export default bind;
|
|
50
|
-
//# sourceMappingURL=yarn.js.map
|
package/lib/plugins/yarn.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../src/plugins/yarn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,aAAa,EAAiC,UAAU,EAAE,MAAM,aAAa,CAAA;AAC9F,OAAO,KAAK,SAAS,MAAM,UAAU,CAAA;AAErC,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAA;AACxB,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAA;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,QAAQ;IACR,KAAK;IACL,WAAW;IACX,MAAM;IACN,YAAY;IACZ,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,eAAe;IACf,MAAM;IACN,cAAc;IACd,aAAa;IACb,KAAK;IACL,eAAe;CAClB,CAAC;AACF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,MAAM;IACN,cAAc;IACd,QAAQ;IACR,UAAU;IACV,SAAS;IACT,WAAW;IACX,SAAS;IACT,WAAW;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAa;IAC7B,EAAE,OAAO,EAAE,IAAI,aAAa,CAAC,iBAAiB,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,sBAAsB,EAAE;IACrH,EAAE,OAAO,EAAE,IAAI,aAAa,CAAC,gBAAgB,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,EAAE;IACtG,EAAE,OAAO,EAAE,IAAI,aAAa,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,EAAE;IACrG,EAAE,OAAO,EAAE,IAAI,aAAa,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,EAAE;CACxG,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC1C,MAAM,EAAE,kBAAkB;IAC1B,WAAW,EAAE,kBAAkB;CAClC,CAAA;AAED,MAAM,IAAI,GAAe,EAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAC,CAAA;AACzD,UAAU,CAAC,IAAI,CAAC,CAAA;AAChB,eAAe,IAAI,CAAA"}
|
package/lib/tools/index.d.ts
DELETED
package/lib/tools/index.js
DELETED
package/lib/tools/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
|
package/lib/tools/methods.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LookMethodData, Looker } from "../browser/index.js";
|
|
2
|
-
export declare const patternsExclude: string[];
|
|
3
|
-
export declare const npmPatternExclude: string[];
|
|
4
|
-
export declare const npmPatternInclude: string[];
|
|
5
|
-
export type ParserFunction = (text: string) => object | undefined;
|
|
6
|
-
export declare const parserJSONDict: ParserFunction;
|
|
7
|
-
export declare function superPresetLookOptions(looker: Looker, options?: GetLookMethodGitOptions): void;
|
|
8
|
-
export interface GetLookMethodGitOptions {
|
|
9
|
-
negate?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface GetLookMethodPropJSONOptions extends GetLookMethodGitOptions {
|
|
12
|
-
parserFunc?: ParserFunction;
|
|
13
|
-
prop: string;
|
|
14
|
-
}
|
|
15
|
-
export declare function getLookMethodPropJSON(options: GetLookMethodPropJSONOptions): (data: LookMethodData) => boolean;
|
|
16
|
-
export declare function getLookMethodGit(options?: GetLookMethodGitOptions): (data: LookMethodData) => boolean;
|
package/lib/tools/methods.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import getValue from "get-value";
|
|
2
|
-
//#region predefined patterns
|
|
3
|
-
export const patternsExclude = [
|
|
4
|
-
".git/**",
|
|
5
|
-
"node_modules/**",
|
|
6
|
-
".DS_Store/**"
|
|
7
|
-
];
|
|
8
|
-
export const npmPatternExclude = [
|
|
9
|
-
'.*.swp',
|
|
10
|
-
'._*',
|
|
11
|
-
'.DS_Store',
|
|
12
|
-
'.git',
|
|
13
|
-
'.gitignore',
|
|
14
|
-
'.hg',
|
|
15
|
-
'.npmignore',
|
|
16
|
-
'.npmrc',
|
|
17
|
-
'.lock-wscript',
|
|
18
|
-
'.svn',
|
|
19
|
-
'.wafpickle-*',
|
|
20
|
-
'config.gypi',
|
|
21
|
-
'CVS',
|
|
22
|
-
'npm-debug.log',
|
|
23
|
-
];
|
|
24
|
-
export const npmPatternInclude = [
|
|
25
|
-
'bin/',
|
|
26
|
-
'package.json',
|
|
27
|
-
'README',
|
|
28
|
-
'README.*',
|
|
29
|
-
'LICENSE',
|
|
30
|
-
'LICENSE.*',
|
|
31
|
-
'LICENCE',
|
|
32
|
-
'LICENCE.*',
|
|
33
|
-
];
|
|
34
|
-
export const parserJSONDict = (text) => {
|
|
35
|
-
try {
|
|
36
|
-
const result = JSON.parse(text);
|
|
37
|
-
if ((result === null || result === void 0 ? void 0 : result.constructor) !== Object) {
|
|
38
|
-
throw new Error(`JSON is not dictionary`);
|
|
39
|
-
}
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region look methods
|
|
48
|
-
export function superPresetLookOptions(looker, options) {
|
|
49
|
-
const { negate = false } = options !== null && options !== void 0 ? options : {};
|
|
50
|
-
looker.isNegated = negate;
|
|
51
|
-
}
|
|
52
|
-
export function getLookMethodPropJSON(options) {
|
|
53
|
-
const { parserFunc = parserJSONDict, prop } = options;
|
|
54
|
-
return (function (data) {
|
|
55
|
-
const { looker, sourceFile: source } = data;
|
|
56
|
-
const parsed = parserFunc(source.content);
|
|
57
|
-
if (!parsed) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
const propVal = getValue(parsed, prop);
|
|
61
|
-
if (!Array.isArray(propVal)) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
superPresetLookOptions(looker, options);
|
|
65
|
-
looker.add(propVal);
|
|
66
|
-
return true;
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
export function getLookMethodGit(options) {
|
|
70
|
-
return (function (data) {
|
|
71
|
-
const { looker, sourceFile: source } = data;
|
|
72
|
-
if (!looker.isValidPattern(source.content)) {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
superPresetLookOptions(looker, options);
|
|
76
|
-
looker.add(source.content);
|
|
77
|
-
return true;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
81
|
-
//# sourceMappingURL=methods.js.map
|
package/lib/tools/methods.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../src/tools/methods.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,WAAW,CAAA;AAEhC,6BAA6B;AAC7B,MAAM,CAAC,MAAM,eAAe,GAAa;IACxC,SAAS;IACT,iBAAiB;IACjB,cAAc;CACd,CAAA;AACD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,QAAQ;IACR,KAAK;IACL,WAAW;IACX,MAAM;IACN,YAAY;IACZ,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,eAAe;IACf,MAAM;IACN,cAAc;IACd,aAAa;IACb,KAAK;IACL,eAAe;CACf,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,MAAM;IACN,cAAc;IACd,QAAQ;IACR,UAAU;IACV,SAAS;IACT,WAAW;IACX,SAAS;IACT,WAAW;CACX,CAAC;AAMF,MAAM,CAAC,MAAM,cAAc,GAAmB,CAAC,IAAI,EAAE,EAAE;IACtD,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC/B,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,MAAK,MAAM,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;QAC1C,CAAC;QACD,OAAO,MAAM,CAAA;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAM;IACP,CAAC;AACF,CAAC,CAAA;AACD,YAAY;AAEZ,sBAAsB;AACtB,MAAM,UAAU,sBAAsB,CAAC,MAAc,EAAE,OAAiC;IACvF,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;IACzC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAA;AA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", "type", "mixed", "modified"];
|
|
2
|
-
export type SortName = typeof sortNameList[number];
|
|
3
|
-
export type SortFunc = (a: string, b: string) => number;
|
|
4
|
-
export declare const Sorters: {
|
|
5
|
-
/**
|
|
6
|
-
* Files and folders are sorted by their names.
|
|
7
|
-
* Folders are displayed before files.
|
|
8
|
-
*/
|
|
9
|
-
readonly firstFolders: (a: string, b: string) => number;
|
|
10
|
-
/**
|
|
11
|
-
* Files and folders are sorted by their names.
|
|
12
|
-
* Files are displayed before folders.
|
|
13
|
-
*/
|
|
14
|
-
readonly firstFiles: (a: string, b: string) => number;
|
|
15
|
-
/**
|
|
16
|
-
* Files and folders are sorted by last modified date in descending order.
|
|
17
|
-
* Folders are displayed before files.
|
|
18
|
-
*/
|
|
19
|
-
readonly modified: (a: string, b: string, aDate: Date, bDate: Date) => number;
|
|
20
|
-
/**
|
|
21
|
-
* Files and folders are grouped by extension type then sorted by thir names.
|
|
22
|
-
* Folders are displayed before files.
|
|
23
|
-
*/
|
|
24
|
-
readonly type: (a: string, b: string) => number;
|
|
25
|
-
/**
|
|
26
|
-
* Files and folders are sorted by their names.
|
|
27
|
-
* Files are interwoven with folders.
|
|
28
|
-
*/
|
|
29
|
-
readonly mixed: (a: string, b: string) => number;
|
|
30
|
-
};
|