Skip to content

Commit 42fe127

Browse files
committed
chore: more pr improvements
1 parent 1b8628a commit 42fe127

File tree

3 files changed

+19
-23
lines changed

3 files changed

+19
-23
lines changed

src/pr/pr-generator.ts

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class PullRequestGenerator {
9292
if (githubActionsCount > 0)
9393
body += `| 🚀 GitHub Actions | ${githubActionsCount} |\n`
9494
if (composerCount > 0)
95-
body += `| 🎼 Composer Packages | ${composerCount} |\n`
95+
body += `| 🐘 Composer Packages | ${composerCount} |\n`
9696
body += `| **Total** | **${group.updates.length}** |\n\n`
9797

9898
// Separate updates by type
@@ -143,6 +143,7 @@ export class PullRequestGenerator {
143143
// Package.json updates table (with full badges)
144144
if (packageJsonUpdates.length > 0) {
145145
body += `## 📦 npm Dependencies\n\n`
146+
body += `![npm](https://img.shields.io/badge/npm-CB3837?style=flat&logo=npm&logoColor=white)\n\n`
146147
if (packageJsonUpdates.length === 1) {
147148
body += `*${packageJsonUpdates.length} package will be updated*\n\n`
148149
}
@@ -226,6 +227,7 @@ export class PullRequestGenerator {
226227
}
227228

228229
body += `## 🐘 PHP/Composer Dependencies\n\n`
230+
body += `![composer](https://img.shields.io/badge/composer-885630?style=flat&logo=composer&logoColor=white)\n\n`
229231
if (uniqueComposerUpdates.length === 1) {
230232
body += `*${uniqueComposerUpdates.length} package will be updated*\n\n`
231233
}
@@ -278,6 +280,7 @@ export class PullRequestGenerator {
278280
// Dependency files table (enhanced with more information)
279281
if (dependencyFileUpdates.length > 0) {
280282
body += `## 🔧 System Dependencies\n\n`
283+
body += `![system](https://img.shields.io/badge/system-4CAF50?style=flat&logo=linux&logoColor=white)\n\n`
281284

282285
const uniqueFiles = [...new Set(dependencyFileUpdates.map(u => u.file))]
283286
if (dependencyFileUpdates.length === 1) {
@@ -287,8 +290,8 @@ export class PullRequestGenerator {
287290
body += `*${dependencyFileUpdates.length} packages will be updated across ${uniqueFiles.length} file(s): ${uniqueFiles.map(f => `\`${f.split('/').pop()}\``).join(', ')}*\n\n`
288291
}
289292

290-
body += `| Package | Change | Type | File | Links |\n`
291-
body += `|---|---|---|---|---|\n`
293+
body += `| Package | Change | Type | File |\n`
294+
body += `|---|---|---|---|\n`
292295

293296
for (const update of dependencyFileUpdates) {
294297
// Handle special case: bun.sh -> bun.com
@@ -311,14 +314,7 @@ export class PullRequestGenerator {
311314
? `[\`${fileName}\`](https://github.com/${this.config.repository.owner}/${this.config.repository.name}/blob/main/${update.file})`
312315
: `\`${fileName}\``
313316

314-
// Enhanced links column
315-
let linksCell = `📦 [pkgx](${packageUrl})`
316-
if (update.name.includes('.org') || update.name.includes('.net') || update.name.includes('.com')) {
317-
const domain = update.name.split('/')[0] || update.name
318-
linksCell += ` | 🌐 [${domain}](https://${domain})`
319-
}
320-
321-
body += `| ${packageCell} | ${change} | ${typeEmoji} ${updateType} | ${fileCell} | ${linksCell} |\n`
317+
body += `| ${packageCell} | ${change} | ${typeEmoji} ${updateType} | ${fileCell} |\n`
322318
}
323319

324320
body += `\n`
@@ -327,6 +323,7 @@ export class PullRequestGenerator {
327323
// GitHub Actions table (enhanced with more information)
328324
if (uniqueGithubActionsUpdates.length > 0) {
329325
body += `## 🚀 GitHub Actions\n\n`
326+
body += `![github-actions](https://img.shields.io/badge/GitHub%20Actions-2088FF?style=flat&logo=github-actions&logoColor=white)\n\n`
330327

331328
if (uniqueGithubActionsUpdates.length === 1) {
332329
body += `*${uniqueGithubActionsUpdates.length} action will be updated*\n\n`
@@ -335,8 +332,8 @@ export class PullRequestGenerator {
335332
body += `*${uniqueGithubActionsUpdates.length} actions will be updated*\n\n`
336333
}
337334

338-
body += `| Action | Change | Type | Files | Links |\n`
339-
body += `|---|---|---|---|---|\n`
335+
body += `| Action | Change | Type | Files |\n`
336+
body += `|---|---|---|---|\n`
340337

341338
for (const update of uniqueGithubActionsUpdates) {
342339
// Generate action link
@@ -363,12 +360,7 @@ export class PullRequestGenerator {
363360
: `\`${fileName}\``
364361
})()
365362

366-
// Enhanced links column
367-
const releasesUrl = `https://github.com/${update.name}/releases`
368-
const compareUrl = `https://github.com/${update.name}/compare/${update.currentVersion}...${update.newVersion}`
369-
const linksCell = `📋 [releases](${releasesUrl}) | 📊 [compare](${compareUrl})`
370-
371-
body += `| ${actionCell} | ${change} | ${typeEmoji} ${updateType} | ${fileLinks} | ${linksCell} |\n`
363+
body += `| ${actionCell} | ${change} | ${typeEmoji} ${updateType} | ${fileLinks} |\n`
372364
}
373365

374366
body += `\n`

test/pr-body-major-updates.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe('PR Body Generation for Major Updates', () => {
124124

125125
const composerBody = await generator.generateBody(majorComposerUpdate)
126126

127-
expect(composerBody).toContain('| 🎼 Composer Packages | 1 |')
127+
expect(composerBody).toContain('| 🐘 Composer Packages | 1 |')
128128
expect(composerBody).toContain('## 🐘 PHP/Composer Dependencies')
129129
expect(composerBody).toContain('*1 package will be updated*')
130130
expect(composerBody).toContain('laravel/framework')

test/pr-generator.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ describe('PullRequestGenerator', () => {
121121

122122
// Should include detailed NPM dependencies section
123123
expect(body).toContain('## 📦 npm Dependencies')
124+
expect(body).toContain('![npm](https://img.shields.io/badge/npm-CB3837?style=flat&logo=npm&logoColor=white)')
124125
expect(body).toContain('*1 package will be updated*')
125126
expect(body).toContain('| Package | Change | Age | Adoption | Passing | Confidence |')
126127
expect(body).toContain('stripe')
@@ -205,10 +206,11 @@ describe('PullRequestGenerator', () => {
205206

206207
// Should include package summary table
207208
expect(body).toContain('## Package Updates Summary')
208-
expect(body).toContain('| 🎼 Composer Packages | 1 |')
209+
expect(body).toContain('| 🐘 Composer Packages | 1 |')
209210

210211
// Should include detailed Composer dependencies section
211212
expect(body).toContain('## 🐘 PHP/Composer Dependencies')
213+
expect(body).toContain('![composer](https://img.shields.io/badge/composer-885630?style=flat&logo=composer&logoColor=white)')
212214
expect(body).toContain('*1 package will be updated*')
213215
expect(body).toContain('| Package | Change | Age | Adoption | Passing | Confidence | Type | Update |')
214216
expect(body).toContain('laravel/framework')
@@ -241,8 +243,9 @@ describe('PullRequestGenerator', () => {
241243

242244
// Should include detailed system dependencies section
243245
expect(body).toContain('## 🔧 System Dependencies')
246+
expect(body).toContain('![system](https://img.shields.io/badge/system-4CAF50?style=flat&logo=linux&logoColor=white)')
244247
expect(body).toContain('*1 package will be updated in `deps.yaml`*')
245-
expect(body).toContain('| Package | Change | Type | File | Links |')
248+
expect(body).toContain('| Package | Change | Type | File |')
246249
})
247250
})
248251

@@ -272,8 +275,9 @@ describe('PullRequestGenerator', () => {
272275

273276
// Should include detailed GitHub Actions section
274277
expect(body).toContain('## 🚀 GitHub Actions')
278+
expect(body).toContain('![github-actions](https://img.shields.io/badge/GitHub%20Actions-2088FF?style=flat&logo=github-actions&logoColor=white)')
275279
expect(body).toContain('*1 action will be updated*')
276-
expect(body).toContain('| Action | Change | Type | Files | Links |')
280+
expect(body).toContain('| Action | Change | Type | Files |')
277281
expect(body).toContain('actions/checkout')
278282
})
279283
})

0 commit comments

Comments
 (0)