Comparing version 1.0.5 to 1.1.0
@@ -8,3 +8,2 @@ var progressBar = require("../progress-bar"); | ||
var path = require("path"); | ||
var pad = require("pad"); | ||
var fs = require("fs"); | ||
@@ -70,3 +69,3 @@ | ||
fs.writeFile(path.join(linkDest, "index.js"), 'module.exports = require(' + JSON.stringify(linkSrc) + ');', done); | ||
fs.writeFile(path.join(linkDest, "index.js"), "module.exports = require(" + JSON.stringify(linkSrc) + ");", done); | ||
}); | ||
@@ -106,3 +105,3 @@ }); | ||
} else { | ||
console.log(chalk.green("Successfully bootstraped " + packages.length + " packages.")); | ||
console.log(chalk.green("Successfully bootstrapped " + packages.length + " packages.")); | ||
console.log(); | ||
@@ -109,0 +108,0 @@ process.exit(); |
exports.bootstrap = require("./bootstrap"); | ||
exports.publish = require("./publish"); | ||
exports.updated = require("./updated"); |
var progressBar = require("../progress-bar"); | ||
var updated = require("./updated"); | ||
var readline = require("readline-sync"); | ||
@@ -9,2 +10,4 @@ var semver = require("semver"); | ||
var checkUpdatedPackages = updated.checkUpdatedPackages; | ||
exports.description = "Publish updated packages to npm"; | ||
@@ -25,3 +28,7 @@ | ||
try { | ||
checkUpdatedPackages(); | ||
changedPackages = checkUpdatedPackages(config); | ||
console.log("Packages to be updated"); | ||
console.log(changedPackages.map(function(pkg) { | ||
return "- " + pkg; | ||
}).join("\n")); | ||
updateChangedPackages(); | ||
@@ -78,6 +85,2 @@ updateTag(); | ||
function getPackageConfig(name) { | ||
return require(getPackageLocation(name) + "/package.json"); | ||
} | ||
function updateDepsObject(deps) { | ||
@@ -94,34 +97,2 @@ for (var depName in deps) { | ||
function checkUpdatedPackages() { | ||
console.log("Checking packages..."); | ||
var packageNames = fs.readdirSync(config.packagesLoc).filter(function (name) { | ||
return name[0] !== "." && fs.statSync(config.packagesLoc + "/" + name).isDirectory(); | ||
}); | ||
var tick = progressBar(packageNames.length); | ||
var lastTagCommit = execSync("git rev-list --tags --max-count=1"); | ||
var lastTag = execSync("git describe " + lastTagCommit); | ||
packageNames.forEach(function (name) { | ||
var config = getPackageConfig(name); | ||
tick(name); | ||
if (config.private) return; | ||
// check if package has changed since last release | ||
var diff = FORCE_VERSION.indexOf("*") >= 0 || FORCE_VERSION.indexOf(name) >= 0 || | ||
execSync("git diff " + lastTag + " -- " + getPackageLocation(name)); | ||
if (diff) { | ||
changedPackages.push(name); | ||
} | ||
}); | ||
if (!changedPackages.length && !FORCE_VERSION.length) { | ||
console.error(chalk.red("No updated packages to publish.")); | ||
process.exit(1); | ||
} | ||
} | ||
function updateChangedPackages() { | ||
@@ -215,3 +186,2 @@ changedPackages.forEach(function (name) { | ||
return function (done) { | ||
var loc = getPackageLocation(name); | ||
while (true) { | ||
@@ -236,4 +206,2 @@ try { | ||
console.log(chalk.green("Successfully published " + NEW_VERSION + ".")); | ||
console.log("Updated Packages"); | ||
console.log(changedPackages); | ||
process.exit(); | ||
@@ -240,0 +208,0 @@ }); |
@@ -12,3 +12,3 @@ var ProgressBar = require("progress"); | ||
// terminal columns - package name length - additional characters length | ||
width: process.stdout.columns - 50 - 3 | ||
width: (process.stdout.columns || 100) - 50 - 3 | ||
}); | ||
@@ -15,0 +15,0 @@ |
{ | ||
"name": "lerna", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "Tool for managing JavaScript projects with multiple packages", | ||
"main": "index.js", | ||
"scripts": { | ||
"lint": "./node_modules/.bin/eslint lib", | ||
"ci": "npm run lint" | ||
}, | ||
"repository": { | ||
@@ -28,3 +32,6 @@ "type": "git", | ||
"lerna": "./bin/lerna.js" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^1.10.3" | ||
} | ||
} |
@@ -40,2 +40,10 @@ <p align="center"> | ||
### Updated | ||
```sh | ||
$ lerna updated | ||
``` | ||
1. Checks which `packages` have changed since the last release" and logs it. | ||
### Publishing | ||
@@ -42,0 +50,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
18505
13
398
63
1
12
4