1
+ import path from 'path' ;
1
2
import { TEXT_NODE_TYPES , UN_KNOWN } from './const.js' ;
2
3
import {
3
4
FileInfoTree ,
@@ -21,9 +22,10 @@ function getImpacts (treeData: FileInfoTree, funcInfo: ImpactReason) {
21
22
// function entrance
22
23
const main = {
23
24
name : funcInfo . name ,
24
- file : funcInfo . filePath ,
25
+ file : path . relative ( process . cwd ( ) , funcInfo . filePath ) ,
25
26
position : mainFuncPosition ,
26
27
} ;
28
+ funcInfo . paths [ 0 ] [ 1 ] = path . relative ( process . cwd ( ) , funcInfo . paths [ 0 ] [ 1 ] ) ;
27
29
funcInfo . paths [ 0 ] . push ( mainFuncPosition ) ;
28
30
29
31
let callList = [ funcInfo ] as ImpactReason [ ] ;
@@ -96,7 +98,7 @@ function findWhoCallMe (treeData: FileInfoTree, funcInfo: ImpactReason, reportIn
96
98
97
99
// collect call paths
98
100
const paths = [ ...curPaths ] ;
99
- paths . push ( [ func . name , func . filePath , func . position ] ) ;
101
+ paths . push ( [ func . name , path . relative ( process . cwd ( ) , func . filePath ) , func . position ] ) ;
100
102
101
103
theyCallYou . push ( {
102
104
filePath : func . filePath ,
@@ -130,7 +132,7 @@ function findWhoCallMe (treeData: FileInfoTree, funcInfo: ImpactReason, reportIn
130
132
templateFragmentCache . push ( cache ) ;
131
133
132
134
reportInfo . push ( {
133
- filePath : treeData [ fileInfo ] . file ,
135
+ filePath : path . relative ( process . cwd ( ) , treeData [ fileInfo ] . file ) ,
134
136
domInfo
135
137
} ) ;
136
138
}
0 commit comments