escover 3.3.2 → 3.5.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 +17 -0
- package/lib/cli/cli.js +2 -6
- package/lib/cli/version.js +0 -1
- package/lib/config.js +0 -1
- package/lib/coverage-file/coverage-file.js +0 -1
- package/lib/coverage-file/lcov.js +0 -1
- package/lib/escover.js +13 -6
- package/lib/exclude.js +0 -1
- package/lib/exit.js +0 -1
- package/lib/formatters/files.js +1 -4
- package/lib/instrument/index.js +0 -1
- package/lib/instrument/plugin-mark/argument.js +2 -4
- package/lib/instrument/plugin-mark/arrow.js +1 -3
- package/lib/instrument/plugin-mark/index.js +4 -11
- package/package.json +5 -6
package/ChangeLog
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
2023.07.31, v3.5.0
|
|
2
|
+
|
|
3
|
+
fix:
|
|
4
|
+
- 2411d57 escover
|
|
5
|
+
- 830082d escover: exit
|
|
6
|
+
|
|
7
|
+
feature:
|
|
8
|
+
- b6b1301 package: @putout/test v7.0.1
|
|
9
|
+
- e9502cc package: c8 v8.0.1
|
|
10
|
+
- 882431a package: eslint-plugin-putout v18.2.0
|
|
11
|
+
- eb15154 package: putout v30.7.0
|
|
12
|
+
|
|
13
|
+
2023.06.08, v3.4.0
|
|
14
|
+
|
|
15
|
+
feature:
|
|
16
|
+
- 2a602d2 escover: expression
|
|
17
|
+
|
|
1
18
|
2023.06.08, v3.3.2
|
|
2
19
|
|
|
3
20
|
fix:
|
package/lib/cli/cli.js
CHANGED
|
@@ -11,12 +11,8 @@ export const ESCOVER_NODE_OPTIONS = '--no-warnings --loader zenload';
|
|
|
11
11
|
|
|
12
12
|
export const cli = ({argv, exit, readCoverage}) => {
|
|
13
13
|
const args = yargsParser(argv.slice(2), {
|
|
14
|
-
string: [
|
|
15
|
-
|
|
16
|
-
],
|
|
17
|
-
boolean: [
|
|
18
|
-
'version',
|
|
19
|
-
],
|
|
14
|
+
string: ['format'],
|
|
15
|
+
boolean: ['version'],
|
|
20
16
|
alias: {
|
|
21
17
|
v: 'version',
|
|
22
18
|
f: 'format',
|
package/lib/cli/version.js
CHANGED
package/lib/config.js
CHANGED
package/lib/escover.js
CHANGED
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
isExclude,
|
|
9
9
|
} from './config.js';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
process.once('exit', exit);
|
|
12
12
|
|
|
13
13
|
global.__createC4 = createFileEntry;
|
|
14
14
|
|
|
15
|
+
const port = {};
|
|
15
16
|
const CWD = process.cwd();
|
|
16
|
-
|
|
17
17
|
const {exclude} = readConfig();
|
|
18
18
|
|
|
19
19
|
const EXCLUDE = [
|
|
@@ -38,6 +38,9 @@ export function globalPreload({port}) {
|
|
|
38
38
|
if (loader !== 'escover')
|
|
39
39
|
return;
|
|
40
40
|
|
|
41
|
+
if (type === 'exit')
|
|
42
|
+
return exit();
|
|
43
|
+
|
|
41
44
|
const c4 = createFileEntry(url);
|
|
42
45
|
|
|
43
46
|
if (type === 'set')
|
|
@@ -53,6 +56,13 @@ export function globalPreload({port}) {
|
|
|
53
56
|
function escover() {
|
|
54
57
|
const loader = 'escover';
|
|
55
58
|
|
|
59
|
+
process.on('exit', () => {
|
|
60
|
+
port.postMessage({
|
|
61
|
+
type: 'exit',
|
|
62
|
+
loader: 'escover',
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
56
66
|
global.__createC4 = (url) => ({
|
|
57
67
|
'🧨': (line, column) => {
|
|
58
68
|
port.postMessage({
|
|
@@ -76,10 +86,7 @@ function escover() {
|
|
|
76
86
|
}
|
|
77
87
|
|
|
78
88
|
export async function load(url, context, defaultLoad) {
|
|
79
|
-
const {
|
|
80
|
-
format,
|
|
81
|
-
source: rawSource,
|
|
82
|
-
} = await defaultLoad(url, context, defaultLoad);
|
|
89
|
+
const {format, source: rawSource} = await defaultLoad(url, context, defaultLoad);
|
|
83
90
|
|
|
84
91
|
if (/commonjs|builtin/.test(format))
|
|
85
92
|
return {
|
package/lib/exclude.js
CHANGED
package/lib/exit.js
CHANGED
package/lib/formatters/files.js
CHANGED
package/lib/instrument/index.js
CHANGED
|
@@ -4,16 +4,14 @@ const {SequenceExpression} = types;
|
|
|
4
4
|
|
|
5
5
|
export const addMarkToArgument = (path, lineNode) => {
|
|
6
6
|
const {node} = path;
|
|
7
|
-
const {expression} = lineNode;
|
|
8
7
|
|
|
9
8
|
if (!node.argument) {
|
|
10
|
-
node.argument =
|
|
9
|
+
node.argument = lineNode;
|
|
11
10
|
return;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
node.argument = SequenceExpression([
|
|
15
|
-
|
|
14
|
+
lineNode,
|
|
16
15
|
node.argument,
|
|
17
16
|
]);
|
|
18
17
|
};
|
|
19
|
-
|
|
@@ -78,23 +78,20 @@ export const fix = (path, {options}) => {
|
|
|
78
78
|
if (path.isCallExpression() || path.isNewExpression()) {
|
|
79
79
|
const {node} = path;
|
|
80
80
|
|
|
81
|
-
replaceWith(path, SequenceExpression([
|
|
82
|
-
lineNode.expression,
|
|
83
|
-
node,
|
|
84
|
-
]));
|
|
81
|
+
replaceWith(path, SequenceExpression([lineNode, node]));
|
|
85
82
|
|
|
86
83
|
return;
|
|
87
84
|
}
|
|
88
85
|
|
|
89
86
|
if (path.parentPath.isLogicalExpression())
|
|
90
87
|
return replaceWith(path, SequenceExpression([
|
|
91
|
-
lineNode
|
|
88
|
+
lineNode,
|
|
92
89
|
path.node,
|
|
93
90
|
]));
|
|
94
91
|
|
|
95
92
|
if (path.isAssignmentPattern() || path.isAssignmentExpression()) {
|
|
96
93
|
replaceWith(path.get('right'), SequenceExpression([
|
|
97
|
-
lineNode
|
|
94
|
+
lineNode,
|
|
98
95
|
node.right,
|
|
99
96
|
]));
|
|
100
97
|
return;
|
|
@@ -116,10 +113,7 @@ export const fix = (path, {options}) => {
|
|
|
116
113
|
if (path.isExpression()) {
|
|
117
114
|
const {node} = path;
|
|
118
115
|
|
|
119
|
-
replaceWith(path, SequenceExpression([
|
|
120
|
-
lineNode.expression,
|
|
121
|
-
node,
|
|
122
|
-
]));
|
|
116
|
+
replaceWith(path, SequenceExpression([lineNode, node]));
|
|
123
117
|
|
|
124
118
|
return;
|
|
125
119
|
}
|
|
@@ -237,4 +231,3 @@ export const traverse = ({push}) => ({
|
|
|
237
231
|
}
|
|
238
232
|
},
|
|
239
233
|
});
|
|
240
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "escover",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
5
5
|
"description": "Coverage for EcmaScript Modules",
|
|
6
6
|
"main": "lib/escover.js",
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@putout/plugin-convert-optional-to-logical": "^1.0.0",
|
|
43
|
-
"@putout/printer": "^1.80.3",
|
|
44
43
|
"chalk": "^5.0.0",
|
|
45
44
|
"find-cache-dir": "^4.0.0",
|
|
46
45
|
"find-up": "^6.2.0",
|
|
@@ -48,7 +47,7 @@
|
|
|
48
47
|
"montag": "^1.2.1",
|
|
49
48
|
"once": "^1.4.0",
|
|
50
49
|
"picomatch": "^2.3.1",
|
|
51
|
-
"putout": "^
|
|
50
|
+
"putout": "^30.7.0",
|
|
52
51
|
"strip-ansi": "^7.0.1",
|
|
53
52
|
"table": "^6.8.0",
|
|
54
53
|
"try-catch": "^3.0.0",
|
|
@@ -60,12 +59,12 @@
|
|
|
60
59
|
},
|
|
61
60
|
"license": "MIT",
|
|
62
61
|
"devDependencies": {
|
|
63
|
-
"@putout/test": "^
|
|
64
|
-
"c8": "^
|
|
62
|
+
"@putout/test": "^7.0.1",
|
|
63
|
+
"c8": "^8.0.1",
|
|
65
64
|
"escover": "^3.2.0",
|
|
66
65
|
"eslint": "^8.3.0",
|
|
67
66
|
"eslint-plugin-n": "^16.0.0",
|
|
68
|
-
"eslint-plugin-putout": "^
|
|
67
|
+
"eslint-plugin-putout": "^18.2.0",
|
|
69
68
|
"madrun": "^9.0.0",
|
|
70
69
|
"supertape": "^8.0.1"
|
|
71
70
|
}
|