Skip to content

Commit c58428f

Browse files
committed
feat(package): add lerna 3.0.0 support
affects: lerna-semantic-release-io, lerna-semantic-release-utils ISSUES CLOSED: atlassian#93
1 parent c984ed0 commit c58428f

File tree

6 files changed

+3713
-138
lines changed

6 files changed

+3713
-138
lines changed

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ cache:
55
- node_modules
66
notifications:
77
email: false
8-
node_js:
9-
- "5"
108
before_install: .travis/before_install.sh
119
after_success: .travis/after_success.sh
1210
script: npm run lint && npm test

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
"license": "MIT",
3333
"devDependencies": {
3434
"commitizen": "^2.9.5",
35-
"cz-lerna-changelog": "1.2.1",
35+
"cz-lerna-changelog": "2.0.2",
3636
"eslint": "^3.14.1",
3737
"husky": "^0.13.1",
38-
"lerna": "2.0.0-beta.34",
38+
"lerna": "3.13.1",
3939
"lerna-semantic-release": "^9.0.1",
4040
"validate-commit-msg": "^2.11.1"
4141
},
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
var Repository = require('lerna/lib/Repository');
2-
var PackageUtilities = require('lerna/lib/PackageUtilities');
1+
const { getPackages } = require("@lerna/project");
32

43
module.exports = {
54
getAllPackages: function () {
6-
var repository = new Repository();
7-
return PackageUtilities.getPackages(repository);
5+
return getPackages()
86
}
97
};

packages/lerna-semantic-release-utils/for-each-package.js

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,30 @@ module.exports = function forEachPackage (tasks, options, done) {
88
var asyncType = (options && options.asyncType) || async.series;
99
var packages = options.allPackages;
1010

11-
var packageLocations = packages.map(function (pkg) {
12-
return pkg.location;
13-
});
14-
15-
var tasksToRunInEachPackage = packageLocations.map(function (packagePath) {
16-
return function (next) {
17-
var contextBoundTasks = bindTasks(tasks, Object.assign({}, extraContext, {packagePath: packagePath}), packagePath);
18-
19-
asyncType(contextBoundTasks, function (err) {
20-
err && log.error(err);
21-
next();
22-
});
23-
}
24-
});
25-
26-
async.series(tasksToRunInEachPackage, function (err) {
27-
err && log.error(err);
28-
done && done();
29-
});
11+
packages.then(pkgs => {
12+
13+
var packageLocations = pkgs.map(function (pkg) {
14+
return pkg.location;
15+
});
16+
17+
var tasksToRunInEachPackage = packageLocations.map(function (packagePath) {
18+
return function (next) {
19+
var contextBoundTasks = bindTasks(tasks, Object.assign({}, extraContext, {packagePath: packagePath}), packagePath);
20+
21+
asyncType(contextBoundTasks, function (err) {
22+
err && log.error(err);
23+
next();
24+
});
25+
}
26+
});
27+
28+
async.series(tasksToRunInEachPackage, function (err) {
29+
err && log.error(err);
30+
done && done();
31+
});
32+
33+
})
34+
35+
36+
3037
};

0 commit comments

Comments
 (0)