(original, updated, updatedVersions, logger)
| 39 | } |
| 40 | |
| 41 | function getChangelogDepsNotes(original, updated, updatedVersions, logger) { |
| 42 | let dependencyNotes = '' |
| 43 | const updates = new Map() |
| 44 | |
| 45 | for (const depType of DEPENDENCY_NOTE_FIELDS) { |
| 46 | const depUpdates = [] |
| 47 | for (const [depName, currentDepVersion] of Object.entries( |
| 48 | packageDeps(updated, depType) |
| 49 | )) { |
| 50 | const newVersion = updatedVersions.get(depName) |
| 51 | if (!newVersion) { |
| 52 | logger.debug(`${depName} was not bumped, ignoring`) |
| 53 | continue |
| 54 | } |
| 55 | |
| 56 | const originalDepVersion = packageDeps(original, depType)[depName] |
| 57 | const newVersionString = newVersionWithRange( |
| 58 | originalDepVersion, |
| 59 | newVersion |
| 60 | ) |
| 61 | if (currentDepVersion.startsWith('workspace:')) { |
| 62 | depUpdates.push(`\n * ${depName} bumped to ${newVersionString}`) |
| 63 | } else if (newVersionString !== originalDepVersion) { |
| 64 | depUpdates.push( |
| 65 | `\n * ${depName} bumped from ${originalDepVersion} to ${newVersionString}` |
| 66 | ) |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | if (depUpdates.length > 0) { |
| 71 | updates.set(depType, depUpdates) |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | for (const [depType, notes] of updates) { |
| 76 | dependencyNotes += `\n * ${depType}` |
| 77 | for (const note of notes) { |
| 78 | dependencyNotes += note |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | return dependencyNotes |
| 83 | ? `* The following workspace dependencies were updated${dependencyNotes}` |
| 84 | : '' |
| 85 | } |
| 86 | |
| 87 | function appendChangelogNotes(updater, notes: string, logger) { |
| 88 | if (updater instanceof Changelog) { |
no test coverage detected