Skip to content

Commit d2d7c88

Browse files
committed
fix: set package.json version from release please
1 parent c0f6c06 commit d2d7c88

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

bin/release-please.js

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ const setOutput = (key, val) => {
2020
console.log(update.updater.changelogEntry)
2121
console.log('-'.repeat(40))
2222
}
23+
for (const update of val.updates.filter(u => u.updater.rawContent)) {
24+
console.log('package:', update.path)
25+
console.log('-'.repeat(40))
26+
console.log(JSON.parse(update.updater.rawContent).name)
27+
console.log(JSON.parse(update.updater.rawContent).version)
28+
console.log('-'.repeat(40))
29+
}
2330
}
2431
} else {
2532
core.setOutput(key, JSON.stringify(val))

lib/release-please/node-workspace.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ module.exports = class extends NodeWorkspace {
105105
// except it only updates the package.json instead of appending
106106
// anything to changelogs since we've already done that in preconfigure.
107107
updateCandidate (candidate, pkg, updatedVersions) {
108+
const newVersion = updatedVersions.get(pkg.name)
108109
const graphPackage = this.packageGraph.get(pkg.name)
109-
const updatedPackage = pkg.clone()
110110

111+
const updatedPackage = pkg.clone()
112+
updatedPackage.version = newVersion.toString()
111113
for (const [depName, resolved] of graphPackage.localDependencies) {
112114
const depVersion = updatedVersions.get(depName)
113115
if (depVersion && resolved.type !== 'directory') {

0 commit comments

Comments
 (0)