@@ -52,11 +52,20 @@ const updateLernaMonorepo = (dir: string, name: string, version: string) =>
52
52
) ;
53
53
54
54
/** Update a dependency in a JS project */
55
- const updateJsProject = ( dir : string , name : string , version : string ) => {
55
+ const updateJsProject = (
56
+ auto : Auto ,
57
+ dir : string ,
58
+ name : string ,
59
+ version : string
60
+ ) => {
56
61
if ( isLernaMonorepo ( ) ) {
62
+ auto . logger . verbose . info (
63
+ "Creating an update for necessary packages in target monorepo."
64
+ ) ;
57
65
updateLernaMonorepo ( dir , name , version ) ;
58
66
} else {
59
67
const hasLock = fs . existsSync ( "yarn.lock" ) ;
68
+ auto . logger . verbose . info ( "Creating an update for target npm package." ) ;
60
69
updateNpmPackage ( dir , name , version , hasLock ) ;
61
70
}
62
71
} ;
@@ -77,6 +86,10 @@ async function getUpdater(
77
86
// We are in a lerna monorepo so we should try to make updates for all of the
78
87
// packages in it. We assume that the thing we are updating is also a JS project
79
88
if ( isLernaMonorepo ( ) ) {
89
+ auto . logger . verbose . info (
90
+ "Detected monorepo of package to create PR updates for."
91
+ ) ;
92
+
80
93
const { name } = readPackageJson ( ) ;
81
94
// Since we have already tagged the release we need to calculate from the previous tag
82
95
const lastRelease = await auto . git ! . getPreviousTagInBranch ( ) ;
@@ -92,16 +105,17 @@ async function getUpdater(
92
105
return ;
93
106
}
94
107
95
- updateJsProject ( dir , p . name , p . version ) ;
108
+ updateJsProject ( auto , dir , p . name , p . version ) ;
96
109
} ) ;
97
110
} ,
98
111
] ;
99
112
}
100
113
101
114
// We are in NPM package. We assume that the thing we are updating is also a JS project.
102
115
if ( isNpmPackage ( ) ) {
116
+ auto . logger . verbose . info ( "Detected NPM package to create PR updates for." ) ;
103
117
const { name, version } = readPackageJson ( ) ;
104
- return [ name , ( dir ) => updateJsProject ( dir , name , version ) ] ;
118
+ return [ name , ( dir ) => updateJsProject ( auto , dir , name , version ) ] ;
105
119
}
106
120
}
107
121
@@ -150,12 +164,14 @@ export default class UpdateRepoPlugin implements IPlugin {
150
164
this . name ,
151
165
async ( { newVersion, releaseNotes, response } ) => {
152
166
if ( ! newVersion || ! response ) {
167
+ auto . logger . verbose . warn ( "No new versions to open PRs for." ) ;
153
168
return ;
154
169
}
155
170
156
171
const releases = Array . isArray ( response ) ? response : [ response ] ;
157
172
158
173
if ( releases . some ( ( release ) => release . data . prerelease ) ) {
174
+ auto . logger . verbose . warn ( "In prerelease, no PRs generated." ) ;
159
175
return ;
160
176
}
161
177
@@ -203,5 +219,7 @@ export default class UpdateRepoPlugin implements IPlugin {
203
219
body : releaseNotes ,
204
220
update,
205
221
} ) ;
222
+
223
+ auto . logger . log . success ( `Opened PR on ${ repo . repo } : ${ message } ` ) ;
206
224
}
207
225
}
0 commit comments