Skip to content

Commit

Permalink
fix: set package.json version from release please
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Sep 13, 2022
1 parent c0f6c06 commit d2d7c88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions bin/release-please.js
Expand Up @@ -20,6 +20,13 @@ const setOutput = (key, val) => {
console.log(update.updater.changelogEntry)
console.log('-'.repeat(40))
}
for (const update of val.updates.filter(u => u.updater.rawContent)) {
console.log('package:', update.path)
console.log('-'.repeat(40))
console.log(JSON.parse(update.updater.rawContent).name)
console.log(JSON.parse(update.updater.rawContent).version)
console.log('-'.repeat(40))
}
}
} else {
core.setOutput(key, JSON.stringify(val))
Expand Down
4 changes: 3 additions & 1 deletion lib/release-please/node-workspace.js
Expand Up @@ -105,9 +105,11 @@ module.exports = class extends NodeWorkspace {
// except it only updates the package.json instead of appending
// anything to changelogs since we've already done that in preconfigure.
updateCandidate (candidate, pkg, updatedVersions) {
const newVersion = updatedVersions.get(pkg.name)
const graphPackage = this.packageGraph.get(pkg.name)
const updatedPackage = pkg.clone()

const updatedPackage = pkg.clone()
updatedPackage.version = newVersion.toString()
for (const [depName, resolved] of graphPackage.localDependencies) {
const depVersion = updatedVersions.get(depName)
if (depVersion && resolved.type !== 'directory') {
Expand Down

0 comments on commit d2d7c88

Please sign in to comment.