-
Notifications
You must be signed in to change notification settings - Fork 763
Description
Affected Packages
pkg:cli
Problem
I would like to use changesets to trigger deployments of some packages, rather than publishing to NPM. My immediate use case is a Pulumi program, I would like to run pulumi up instead of NPM publish.
Proposed solution
Adding changesets configuration into package.json.
changesets: {
"publish-required": "pulumi preview --expect-no-changes",
"publish": "pulumi up"
}
getUnpublishedPackages could then check for the existence of publish-required and use it's return code as a signal you are up to date. Otherwise "publish-state": "./scripts/get-publish-state.js", could return publishedState and published version. (must be a node script, which can be required by changesets).
Then in publishAPackage, if a publish step is defined, it is run instead of npm publish. In addition, if the old / new version are passed as command line arguments to the commands defined in these hooks a package.json file could be used to wrap anything, docker, rust packages etc without the core of changesets having to change.
It could also open up the possibility of third party packages to enable the various ecosystems. maybe something like this:
changesets: {
"publish": "changesets-pulumi"
}
or
changesets: {
"publish": "changesets-docker"
}
changesets: {
"publish": "./publish.js"
}
Then that file could export getCurrentVersionInfo and publish.