Skip to content

Commit

Permalink
feat: Split lerna version from of lerna publish (lerna#1522)
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
* `--preid` now defaults to "alpha" during prereleases:

  The previous default for this option was undefined, which led to an awkward "1.0.1-0" result when passed to `semver.inc()`.

  The new default "alpha" yields a much more useful "1.0.1-alpha.0" result. Any previous prerelease ID will be preserved, just as it was before.

* `--no-verify` is no longer passed to `git commit` by default, but controlled by the new `--commit-hooks` option:

  The previous behavior was too overzealous, and the new option operates exactly like the corresponding [npm version](https://docs.npmjs.com/cli/version#commit-hooks) option of the same name.

  As long as your pre-commit hooks are properly scoped to ignore changes in package.json files, this change should not affect you. If that is not the case, you may pass `--no-commit-hooks` to restore the previous behavior.

Fixes lerna#277
Fixes lerna#936
Fixes lerna#956
Fixes lerna#961
Fixes lerna#1056
Fixes lerna#1118
Fixes lerna#1385
Fixes lerna#1483
Fixes lerna#1494
  • Loading branch information
evocateur committed Jul 27, 2018
1 parent 11005fd commit 79dd10f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions collect-updates.js
Expand Up @@ -2,7 +2,6 @@

const log = require("npmlog");
const childProcess = require("@lerna/child-process");
const semver = require("semver");

const hasTags = require("./lib/has-tags");
const collectDependents = require("./lib/collect-dependents");
Expand Down Expand Up @@ -43,10 +42,10 @@ function collectUpdates(filteredPackages, packageGraph, execOpts, commandOptions
candidates = new Set();

const hasDiff = makeDiffPredicate(committish, execOpts, commandOptions.ignoreChanges);
const needsBump = (commandOptions.cdVersion || "").startsWith("pre")
const needsBump = (commandOptions.bump || "").startsWith("pre")
? () => false
: /* skip packages that have not been previously prereleased */
node => semver.prerelease(node.version);
node => node.prereleaseId;

packages.forEach((node, name) => {
if (forced.has(name) || needsBump(node) || hasDiff(node)) {
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -34,7 +34,6 @@
"@lerna/child-process": "file:../../core/child-process",
"minimatch": "^3.0.4",
"npmlog": "^4.1.2",
"semver": "^5.5.0",
"slash": "^1.0.0"
}
}

0 comments on commit 79dd10f

Please sign in to comment.