@@ -8,6 +8,7 @@ import { getFilesToProcess } from 'resolve-tspaths/dist/steps/getFilesToProcess'
8
8
import type { Alias , Change , ProgramPaths } from 'resolve-tspaths/dist/types'
9
9
import { TSConfigPropertyError } from 'resolve-tspaths/dist/utils/errors'
10
10
import { TsConfig } from 'tsc-prog'
11
+ import { inspect } from 'util'
11
12
import logger from './logger'
12
13
13
14
/**
@@ -46,6 +47,11 @@ export type TsRemapOptions = {
46
47
* @default 'src'
47
48
*/
48
49
src ?: string
50
+
51
+ /**
52
+ * Print verbose logs to the console.
53
+ */
54
+ verbose ?: boolean
49
55
}
50
56
51
57
export type TsRemapResult = {
@@ -68,7 +74,8 @@ const tsRemap = (options: TsRemapOptions): TsRemapResult | null => {
68
74
dryRun,
69
75
cwd = process . cwd ( ) ,
70
76
ext = 'js,d.ts' ,
71
- src = 'src'
77
+ src = 'src' ,
78
+ verbose
72
79
} = options
73
80
74
81
// Handle missing properties
@@ -94,6 +101,14 @@ const tsRemap = (options: TsRemapOptions): TsRemapResult | null => {
94
101
const $changes = `${ changes . length } file${ changes . length === 1 ? '' : 's' } `
95
102
logger ( { } , `found ${ $changes } using compilerOptions.paths` , [ ] , LogLevel . INFO )
96
103
104
+ // Log changes
105
+ if ( verbose ) {
106
+ for ( const change of changes ) {
107
+ const changes = [ inspect ( change . changes , false , null ) ]
108
+ logger ( { } , ` ${ change . file } ` , changes , LogLevel . DEBUG )
109
+ }
110
+ }
111
+
97
112
// Apply path transformations
98
113
if ( ! dryRun ) {
99
114
applyChanges ( changes )
@@ -104,7 +119,7 @@ const tsRemap = (options: TsRemapOptions): TsRemapResult | null => {
104
119
to : ''
105
120
} )
106
121
107
- if ( changes . length > 0 ) logger ( { } , 'resolve paths' )
122
+ if ( changes . length > 0 ) logger ( { } , 'resolve compilerOptions. paths' )
108
123
}
109
124
110
125
return {
0 commit comments