Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(package): add lerna 3.0.0 support #95

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
sudo: false
language: node_js
node_js:
- 9
cache:
directories:
- node_modules
notifications:
email: false
node_js:
- "5"
before_install: .travis/before_install.sh
after_success: .travis/after_success.sh
script: npm run lint && npm test
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"license": "MIT",
"devDependencies": {
"commitizen": "^2.9.5",
"cz-lerna-changelog": "1.2.1",
"cz-lerna-changelog": "2.0.2",
"eslint": "^3.14.1",
"husky": "^0.13.1",
"lerna": "2.0.0-beta.34",
"lerna": "3.13.1",
"lerna-semantic-release": "^9.0.1",
"validate-commit-msg": "^2.11.1"
},
Expand Down
6 changes: 2 additions & 4 deletions packages/lerna-semantic-release-io/io/lerna.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
var Repository = require('lerna/lib/Repository');
var PackageUtilities = require('lerna/lib/PackageUtilities');
const { getPackages } = require("@lerna/project");

module.exports = {
getAllPackages: function () {
var repository = new Repository();
return PackageUtilities.getPackages(repository);
return getPackages()
}
};
2 changes: 1 addition & 1 deletion packages/lerna-semantic-release-io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"shelljs": "~0.7.0",
"simple-git": "~1.48.0",
"mockery": "~1.7.0",
"mock-fs": "~3.11.0",
"mock-fs": "4.8.0",
"sinon": "~1.17.0"
},
"peerDependencies": {
Expand Down
45 changes: 26 additions & 19 deletions packages/lerna-semantic-release-utils/for-each-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,30 @@ module.exports = function forEachPackage (tasks, options, done) {
var asyncType = (options && options.asyncType) || async.series;
var packages = options.allPackages;

var packageLocations = packages.map(function (pkg) {
return pkg.location;
});

var tasksToRunInEachPackage = packageLocations.map(function (packagePath) {
return function (next) {
var contextBoundTasks = bindTasks(tasks, Object.assign({}, extraContext, {packagePath: packagePath}), packagePath);

asyncType(contextBoundTasks, function (err) {
err && log.error(err);
next();
});
}
});

async.series(tasksToRunInEachPackage, function (err) {
err && log.error(err);
done && done();
});
packages.then(pkgs => {

var packageLocations = pkgs.map(function (pkg) {
return pkg.location;
});

var tasksToRunInEachPackage = packageLocations.map(function (packagePath) {
return function (next) {
var contextBoundTasks = bindTasks(tasks, Object.assign({}, extraContext, {packagePath: packagePath}), packagePath);

asyncType(contextBoundTasks, function (err) {
err && log.error(err);
next();
});
}
});

async.series(tasksToRunInEachPackage, function (err) {
err && log.error(err);
done && done();
});

})



};
Loading