Created
July 30, 2019 17:10
-
-
Save ewnd9/dfcdbf67e7099da12a3973f89d48ed81 to your computer and use it in GitHub Desktop.
Getting update manifest for lerna programmatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import VersionCommand from '@lerna/version'; | |
(async () => { | |
const info = await getUpdated(); | |
console.log(info); | |
})() | |
async function getUpdated() { | |
const Package = require('@lerna/package'); | |
const restore = (() => { | |
const orig = Package.prototype.serialize; | |
Package.prototype.serialize = () => Promise.resolve(); | |
return () => { | |
Package.prototype.serialize = orig; | |
}; | |
})(); | |
const ret = await new Promise(onResolved => { | |
new VersionCommand({ | |
gitTagVersion: false, | |
push: false, | |
changelog: false, | |
yes: true, | |
conventionalCommits: true, | |
json: true, | |
onResolved, | |
}); | |
}); | |
restore(); | |
return ret; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment