escover 1.2.3 → 1.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/ChangeLog +7 -0
- package/bin/escover.js +1 -1
- package/lib/escover.js +3 -1
- package/lib/exit.js +1 -1
- package/package.json +1 -1
- package/lib/config.js +0 -43
package/ChangeLog
CHANGED
package/bin/escover.js
CHANGED
package/lib/escover.js
CHANGED
|
@@ -10,6 +10,8 @@ global.__createC4 = createFileEntry;
|
|
|
10
10
|
|
|
11
11
|
process.once('exit', exit);
|
|
12
12
|
|
|
13
|
+
const EXCLUDE = ['.spec.', 'node_modules', '/fixture/', '.madrun.', '/test/'];
|
|
14
|
+
|
|
13
15
|
export async function load(url, context, defaultLoad) {
|
|
14
16
|
const {format, source: rawSource} = await defaultLoad(url, context, defaultLoad);
|
|
15
17
|
|
|
@@ -18,7 +20,7 @@ export async function load(url, context, defaultLoad) {
|
|
|
18
20
|
format,
|
|
19
21
|
};
|
|
20
22
|
|
|
21
|
-
if (exclude(url,
|
|
23
|
+
if (exclude(url, EXCLUDE))
|
|
22
24
|
return {
|
|
23
25
|
format,
|
|
24
26
|
source: rawSource,
|
package/lib/exit.js
CHANGED
package/package.json
CHANGED
package/lib/config.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import tryCatch from 'try-catch';
|
|
2
|
-
import {
|
|
3
|
-
writeFileSync,
|
|
4
|
-
readFileSync,
|
|
5
|
-
} from 'fs';
|
|
6
|
-
import {getFiles} from './c4.js';
|
|
7
|
-
import {transform} from './transform.js';
|
|
8
|
-
import {merge} from './merge.js';
|
|
9
|
-
import findCacheDir from 'find-cache-dir';
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
stringify,
|
|
13
|
-
parse,
|
|
14
|
-
} = JSON;
|
|
15
|
-
|
|
16
|
-
const NAME = 'escover';
|
|
17
|
-
const buildName = (a) => `${a}/${NAME}.json`;
|
|
18
|
-
|
|
19
|
-
export const write = () => {
|
|
20
|
-
const files = getFiles();
|
|
21
|
-
const parsed = transform(files);
|
|
22
|
-
const merged = merge(parsed);
|
|
23
|
-
const name = findCacheDir({
|
|
24
|
-
name: NAME,
|
|
25
|
-
create: true,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
writeFileSync(buildName(name), stringify(merged, null, 4));
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const read = () => {
|
|
32
|
-
const name = findCacheDir({
|
|
33
|
-
name: NAME,
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const [error, data] = tryCatch(readFileSync, buildName(name), 'utf8');
|
|
37
|
-
|
|
38
|
-
if (error)
|
|
39
|
-
return [];
|
|
40
|
-
|
|
41
|
-
return parse(data);
|
|
42
|
-
};
|
|
43
|
-
|