Skip to content

Commit 45c66b4

Browse files
committed
Clean up debug logging after successful fixes
1 parent c6955f4 commit 45c66b4

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

src/buddy.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,6 @@ export class Buddy {
8484
? this.groupUpdatesByConfig(updates)
8585
: groupUpdates(updates)
8686

87-
// Debug logging for group composition
88-
console.log(`🐛 DEBUG: Created ${groups.length} update groups:`)
89-
groups.forEach(group => {
90-
console.log(`🐛 Group: "${group.name}" (${group.updateType}) - ${group.updates.length} updates`)
91-
group.updates.forEach(update => {
92-
console.log(`🐛 - ${update.name}: ${update.currentVersion} -> ${update.newVersion} (${update.file})`)
93-
})
94-
})
95-
9687
const scanDuration = Date.now() - startTime
9788

9889
const result: UpdateScanResult = {
@@ -502,14 +493,8 @@ export class Buddy {
502493
if (composerUpdates.length > 0) {
503494
try {
504495
const { generateComposerUpdates } = await import('./utils/composer-parser')
505-
// Debug logging to see what composer updates are being passed
506-
console.log(`🐛 DEBUG: Passing ${composerUpdates.length} composer updates to parser:`)
507-
composerUpdates.forEach(update => {
508-
console.log(`🐛 - ${update.name}: ${update.currentVersion} -> ${update.newVersion}`)
509-
})
510496
// Pass only the composer updates for this specific group to prevent cross-contamination
511497
const compUpdates = await generateComposerUpdates(composerUpdates)
512-
console.log(`🐛 DEBUG: Composer parser returned ${compUpdates.length} file updates`)
513498
fileUpdates.push(...compUpdates)
514499
}
515500
catch (error) {

src/utils/composer-parser.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,6 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
183183
const fileUpdates: Array<{ path: string, content: string, type: 'update' }> = []
184184
const composerUpdates = updates.filter(update => update.file.endsWith('composer.json'))
185185

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-
191186
if (composerUpdates.length === 0) {
192187
return fileUpdates
193188
}
@@ -205,31 +200,23 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
205200
})
206201
}
207202

208-
console.log(`🐛 COMPOSER PARSER DEBUG: Processing ${updatesByFile.size} file(s)`)
209-
210203
// Process each composer.json file
211204
for (const [filePath, fileUpdates_] of updatesByFile) {
212205
try {
213-
console.log(`🐛 COMPOSER PARSER DEBUG: Processing file ${filePath} with ${fileUpdates_.length} updates`)
214-
215206
// Read current composer.json content
216207
const fs = await import('node:fs')
217208
let composerContent = fs.readFileSync(filePath, 'utf-8')
218209

219-
console.log(`🐛 COMPOSER PARSER DEBUG: Original composer.json content length: ${composerContent.length}`)
220-
221210
// Parse to understand structure
222211
const composerData: ComposerPackage = JSON.parse(composerContent)
223212

224213
// Apply updates using string replacement to preserve formatting
225214
for (const update of fileUpdates_) {
226-
console.log(`🐛 COMPOSER PARSER DEBUG: Applying update for ${update.name} -> ${update.newVersion}`)
227215
let packageFound = false
228216

229217
// Check in require section
230218
if (composerData.require && composerData.require[update.name]) {
231219
const currentVersionInFile = composerData.require[update.name]
232-
console.log(`🐛 Found ${update.name} in require: ${currentVersionInFile}`)
233220

234221
// For complex constraints like ">=6.0,<7.0", preserve the constraint format
235222
// and just update the version numbers
@@ -248,8 +235,6 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
248235
newVersion = `${originalPrefix}${update.newVersion}`
249236
}
250237

251-
console.log(`🐛 Updating ${update.name}: ${currentVersionInFile} -> ${newVersion}`)
252-
253238
// Create regex to find the exact line with this package and version
254239
const packageRegex = new RegExp(
255240
`("${update.name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}"\\s*:\\s*")([^"]+)(")`,
@@ -263,7 +248,6 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
263248
// Check in require-dev section
264249
if (!packageFound && composerData['require-dev'] && composerData['require-dev'][update.name]) {
265250
const currentVersionInFile = composerData['require-dev'][update.name]
266-
console.log(`🐛 Found ${update.name} in require-dev: ${currentVersionInFile}`)
267251

268252
// For complex constraints like ">=6.0,<7.0", preserve the constraint format
269253
// and just update the version numbers
@@ -282,8 +266,6 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
282266
newVersion = `${originalPrefix}${update.newVersion}`
283267
}
284268

285-
console.log(`🐛 Updating ${update.name}: ${currentVersionInFile} -> ${newVersion}`)
286-
287269
const packageRegex = new RegExp(
288270
`("${update.name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}"\\s*:\\s*")([^"]+)(")`,
289271
'g',
@@ -298,8 +280,6 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
298280
}
299281
}
300282

301-
console.log(`🐛 COMPOSER PARSER DEBUG: Final composer.json content length: ${composerContent.length}`)
302-
303283
fileUpdates.push({
304284
path: filePath,
305285
content: composerContent,
@@ -311,6 +291,5 @@ export async function generateComposerUpdates(updates: Array<{ name: string, new
311291
}
312292
}
313293

314-
console.log(`🐛 COMPOSER PARSER DEBUG: Returning ${fileUpdates.length} file updates`)
315294
return fileUpdates
316295
}

0 commit comments

Comments
 (0)