@@ -183,11 +183,6 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
183
183
const fileUpdates : Array < { path : string , content : string , type : 'update' } > = [ ]
184
184
const composerUpdates = updates . filter ( update => update . file . endsWith ( 'composer.json' ) )
185
185
186
- console . log ( `🐛 COMPOSER PARSER DEBUG: Received ${ updates . length } total updates, ${ composerUpdates . length } composer updates` )
187
- composerUpdates . forEach ( update => {
188
- console . log ( `🐛 - Processing: ${ update . name } -> ${ update . newVersion } ` )
189
- } )
190
-
191
186
if ( composerUpdates . length === 0 ) {
192
187
return fileUpdates
193
188
}
@@ -205,31 +200,23 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
205
200
} )
206
201
}
207
202
208
- console . log ( `🐛 COMPOSER PARSER DEBUG: Processing ${ updatesByFile . size } file(s)` )
209
-
210
203
// Process each composer.json file
211
204
for ( const [ filePath , fileUpdates_ ] of updatesByFile ) {
212
205
try {
213
- console . log ( `🐛 COMPOSER PARSER DEBUG: Processing file ${ filePath } with ${ fileUpdates_ . length } updates` )
214
-
215
206
// Read current composer.json content
216
207
const fs = await import ( 'node:fs' )
217
208
let composerContent = fs . readFileSync ( filePath , 'utf-8' )
218
209
219
- console . log ( `🐛 COMPOSER PARSER DEBUG: Original composer.json content length: ${ composerContent . length } ` )
220
-
221
210
// Parse to understand structure
222
211
const composerData : ComposerPackage = JSON . parse ( composerContent )
223
212
224
213
// Apply updates using string replacement to preserve formatting
225
214
for ( const update of fileUpdates_ ) {
226
- console . log ( `🐛 COMPOSER PARSER DEBUG: Applying update for ${ update . name } -> ${ update . newVersion } ` )
227
215
let packageFound = false
228
216
229
217
// Check in require section
230
218
if ( composerData . require && composerData . require [ update . name ] ) {
231
219
const currentVersionInFile = composerData . require [ update . name ]
232
- console . log ( `🐛 Found ${ update . name } in require: ${ currentVersionInFile } ` )
233
220
234
221
// For complex constraints like ">=6.0,<7.0", preserve the constraint format
235
222
// and just update the version numbers
@@ -248,8 +235,6 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
248
235
newVersion = `${ originalPrefix } ${ update . newVersion } `
249
236
}
250
237
251
- console . log ( `🐛 Updating ${ update . name } : ${ currentVersionInFile } -> ${ newVersion } ` )
252
-
253
238
// Create regex to find the exact line with this package and version
254
239
const packageRegex = new RegExp (
255
240
`("${ update . name . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, '\\$&' ) } "\\s*:\\s*")([^"]+)(")` ,
@@ -263,7 +248,6 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
263
248
// Check in require-dev section
264
249
if ( ! packageFound && composerData [ 'require-dev' ] && composerData [ 'require-dev' ] [ update . name ] ) {
265
250
const currentVersionInFile = composerData [ 'require-dev' ] [ update . name ]
266
- console . log ( `🐛 Found ${ update . name } in require-dev: ${ currentVersionInFile } ` )
267
251
268
252
// For complex constraints like ">=6.0,<7.0", preserve the constraint format
269
253
// and just update the version numbers
@@ -282,8 +266,6 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
282
266
newVersion = `${ originalPrefix } ${ update . newVersion } `
283
267
}
284
268
285
- console . log ( `🐛 Updating ${ update . name } : ${ currentVersionInFile } -> ${ newVersion } ` )
286
-
287
269
const packageRegex = new RegExp (
288
270
`("${ update . name . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, '\\$&' ) } "\\s*:\\s*")([^"]+)(")` ,
289
271
'g' ,
@@ -298,8 +280,6 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
298
280
}
299
281
}
300
282
301
- console . log ( `🐛 COMPOSER PARSER DEBUG: Final composer.json content length: ${ composerContent . length } ` )
302
-
303
283
fileUpdates . push ( {
304
284
path : filePath ,
305
285
content : composerContent ,
@@ -311,6 +291,5 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
311
291
}
312
292
}
313
293
314
- console . log ( `🐛 COMPOSER PARSER DEBUG: Returning ${ fileUpdates . length } file updates` )
315
294
return fileUpdates
316
295
}
0 commit comments