escover 2.5.3 → 3.0.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 CHANGED
@@ -1,3 +1,9 @@
1
+ 2023.05.03, v3.0.0
2
+
3
+ feature:
4
+ - 49fca58 escover: use @putout/printer
5
+ - 1dfbea6 escover: use @putout/printer
6
+
1
7
  2023.05.02, v2.5.3
2
8
 
3
9
  feature:
package/lib/cli/cli.js CHANGED
@@ -35,7 +35,7 @@ export const cli = ({argv, exit, readCoverage}) => {
35
35
  const cmd = argv.slice(2);
36
36
 
37
37
  if (cmd.length) {
38
- execute('"' + cmd.join(`" "`) + '"', exit);
38
+ execute(`"${cmd.join('" "')}"`, exit);
39
39
  }
40
40
 
41
41
  const coverage = readCoverage();
@@ -1,8 +1,6 @@
1
- import {
2
- parse,
3
- generate,
4
- transform,
5
- } from 'putout';
1
+ import {transform} from 'putout';
2
+ import {parse} from '@babel/parser';
3
+ import {print} from '@putout/printer';
6
4
  import * as mark from './plugin-mark/index.js';
7
5
 
8
6
  export const instrument = (url, source) => {
@@ -23,8 +21,7 @@ export const instrument = (url, source) => {
23
21
  const ast = parse(source);
24
22
 
25
23
  transform(ast, source, options);
26
- const {code} = generate(ast);
27
24
 
28
- return code;
25
+ return print(ast);
29
26
  };
30
27
 
@@ -28,6 +28,7 @@ const buildLineNode = template(LINE, {
28
28
  });
29
29
 
30
30
  function getLineNode(c4, {line, column}) {
31
+ debugger;
31
32
  c4.init(line, column);
32
33
 
33
34
  return buildLineNode({
@@ -40,7 +41,7 @@ export const report = () => 'Mark line';
40
41
 
41
42
  export const fix = (path, {options}) => {
42
43
  const {node} = path;
43
- const {start} = path.node.loc || path.parentPath.node.loc;
44
+ const {start} = path.node.loc;
44
45
 
45
46
  const {
46
47
  c4 = {
package/lib/transform.js CHANGED
@@ -2,6 +2,7 @@ const sort = (a) => {
2
2
  const sorted = Array
3
3
  .from(a.entries())
4
4
  .sort();
5
+
5
6
  return new Map(sorted);
6
7
  };
7
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "escover",
3
- "version": "2.5.3",
3
+ "version": "3.0.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",
@@ -39,6 +39,8 @@
39
39
  "prewisdom": "madrun prewisdom"
40
40
  },
41
41
  "dependencies": {
42
+ "@babel/parser": "^7.21.8",
43
+ "@putout/printer": "^1.80.3",
42
44
  "chalk": "^5.0.0",
43
45
  "find-cache-dir": "^4.0.0",
44
46
  "find-up": "^6.2.0",