You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My packages have to go through a QA process before published versions are deployed to production, so I create prerelease versions which are used during the QA process (for example, 1.1.0-rc.0, 1.1.0-rc.1. 1.1.0-rc.2, etc.). When I am satisfied that version is bug-free, I want to publish it with a non-prerelease version before deployment to production. When lerna publishes the packages, I want each prereleased package to be updated to the same non-prerelease version. Unfortunately, lerna only looks at the changes between tags, so lerna thinks there is nothing to update and doesn't update the package versions.
It'd be nice if there was a --force-publish-prereleased flag so that I could force all prerelease versions to be bumped to non-prereleased versions.
For example, assuming I had this setup and there were no changes since the last release:
Right now I can workaround by using --force-publish but that republishes lots of packages unnecessarily, so it's not ideal.
I should also note that I'm publishing from a CI server (jenkins) so my TTY is not interactive; I can't selectively choose versions for each package. I'm publishing using lerna publish --repo-version $VERSION --yes
I'm willing to work on a pull request if you can give me some assurance that a feature like this would be accepted. Also, I'm not married to --force-publish-prereleased so feel free to bikeshed all you want.
I too will soon enter the brave new world of auto-publishing from Jenkins, so I am sympathetic to this request. #607 is close to ready, but it doesn't completely cover your case here (since you don't want to increment all versions by a given semver keyword).
It sounds like we need a flag similar to --scope (although ugh the name) that is also complementary to --cd-version....
Some of these scope groups would have to be pre-defined (like updated and prereleased). The default value would be 'updated' (current behavior). Maybe users could also define custom groups using globs in their lerna.json file:
We'd probably also have to add a corresponding --force-publish-groups option or, better yet, change --force-publish to respect --scope and --scope-groups).
Either of the following would solve my use case:
// if we add --force-publish-groups
lerna publish --repo-version $VERSION --yes --force-publish-groups=prereleased
// if we update --force-publish to respect --scope and --scope-groups
lerna publish --repo-version $VERSION --yes --force-publish --scope-groups=prereleased
If I understand what you are trying for, then makes more sense to open a separate PR for "forcing package (unchanged, but QA/ready) to publish based on versions of scope type". That functionality would belong in UpdatedPackagesCollector.js.
IMO beyond scope of my intentions with #607. Curious as to opinion of other contributors though, I have a bit of bandwidth this sprint but not as much as last two weeks.
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Activity
evocateur commentedon Feb 28, 2017
I too will soon enter the brave new world of auto-publishing from Jenkins, so I am sympathetic to this request. #607 is close to ready, but it doesn't completely cover your case here (since you don't want to increment all versions by a given semver keyword).
It sounds like we need a flag similar to
--scope(although ugh the name) that is also complementary to--cd-version....cif commentedon Mar 1, 2017
I'd suggest simply supporting more --cd-version semver values a la https://github.com/sindresorhus/np#usage
e.g.
lerna publish --yes --cd-version=prereleasehttps://github.com/npm/node-semver#prerelease-identifiers
Ahh, I see what you mean with
--scope (rc | beta | alpha)now looking atsemver.incsignaturespudly commentedon Mar 1, 2017
Perhaps named scope groups?
For example,
Some of these scope groups would have to be pre-defined (like updated and prereleased). The default value would be 'updated' (current behavior). Maybe users could also define custom groups using globs in their lerna.json file:
{ "scope-groups": { "react-components": "@my-scope/react-component-*" } }We'd probably also have to add a corresponding
--force-publish-groupsoption or, better yet, change--force-publishto respect--scopeand--scope-groups).Either of the following would solve my use case:
cif commentedon Mar 2, 2017
If I understand what you are trying for, then makes more sense to open a separate PR for "forcing package (unchanged, but QA/ready) to publish based on versions of scope type". That functionality would belong in UpdatedPackagesCollector.js.
IMO beyond scope of my intentions with #607. Curious as to opinion of other contributors though, I have a bit of bandwidth this sprint but not as much as last two weeks.
spudly commentedon Mar 2, 2017
@cif, I agree. Your PR is more about what the resulting version numbers are, whereas mine would be more about which packages are updated.
lock commentedon Dec 28, 2018
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.