Comparing version 2.0.0-beta.20 to 2.0.0-beta.22
@@ -15,2 +15,3 @@ #!/usr/bin/env node | ||
" updated Check which packages have changed since the last release", | ||
" import Import a package with git history from an external repository", | ||
" clean Remove the node_modules directory from all packages", | ||
@@ -17,0 +18,0 @@ " diff Diff all packages or a single package since the last release", |
@@ -18,6 +18,2 @@ "use strict"; | ||
var _syncExec = require("sync-exec"); | ||
var _syncExec2 = _interopRequireDefault(_syncExec); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -54,11 +50,5 @@ | ||
value: function execSync(command) { | ||
if (_child_process2.default.execSync) { | ||
return _child_process2.default.execSync(command, { | ||
encoding: "utf8" | ||
}).trim(); | ||
} else { | ||
return (0, _syncExec2.default)(command, { | ||
encoding: "utf8" | ||
}).stdout.trim(); | ||
} | ||
return _child_process2.default.execSync(command, { | ||
encoding: "utf8" | ||
}).trim(); | ||
} | ||
@@ -65,0 +55,0 @@ }, { |
@@ -59,6 +59,7 @@ "use strict"; | ||
if (!inputPath) { | ||
callback(new Error("Missing argument: Path to external repository")); | ||
return callback(new Error("Missing argument: Path to external repository")); | ||
} | ||
var externalRepoPath = _path2.default.resolve(inputPath); | ||
var externalRepoBase = _path2.default.basename(externalRepoPath); | ||
@@ -75,7 +76,17 @@ try { | ||
} | ||
this.targetDir = "packages/" + packageName; | ||
} catch (e) { | ||
callback(e); | ||
if (e.code === "ENOENT") { | ||
return callback(new Error("No repository found at \"" + inputPath + "\"")); | ||
} | ||
return callback(e); | ||
} | ||
this.targetDir = "packages/" + externalRepoBase; | ||
try { | ||
if (_fs2.default.statSync(this.targetDir)) { | ||
return callback(new Error("Target directory already exists \"" + this.targetDir + "\"")); | ||
} | ||
} catch (e) {/* Pass */} | ||
this.externalExecOpts = { | ||
@@ -142,2 +153,3 @@ encoding: "utf8", | ||
exports.default = ImportCommand; | ||
exports.default = ImportCommand; | ||
module.exports = exports["default"]; |
@@ -20,2 +20,6 @@ "use strict"; | ||
var _ImportCommand = require("./commands/ImportCommand"); | ||
var _ImportCommand2 = _interopRequireDefault(_ImportCommand); | ||
var _CleanCommand = require("./commands/CleanCommand"); | ||
@@ -55,2 +59,3 @@ | ||
updated: _UpdatedCommand2.default, | ||
import: _ImportCommand2.default, | ||
clean: _CleanCommand2.default, | ||
@@ -57,0 +62,0 @@ diff: _DiffCommand2.default, |
{ | ||
"name": "lerna", | ||
"version": "2.0.0-beta.20", | ||
"version": "2.0.0-beta.22", | ||
"description": "Tool for managing JavaScript projects with multiple packages", | ||
@@ -40,4 +40,3 @@ "main": "lib/index.js", | ||
"semver": "^5.1.0", | ||
"signal-exit": "^2.1.2", | ||
"sync-exec": "^0.6.2" | ||
"signal-exit": "^2.1.2" | ||
}, | ||
@@ -44,0 +43,0 @@ "bin": { |
@@ -23,3 +23,3 @@ <p align="center"> | ||
To solve these (and many other) problems, some projects will organize their | ||
codebases into multi-package repostories (sometimes called [monorepos](https://github.com/babel/babel/blob/master/doc/design/monorepo.md)). Projects like [Babel](https://github.com/babel/babel/tree/master/packages), [React](https://github.com/facebook/react/tree/master/packages), [Angular](https://github.com/angular/angular/tree/master/modules), | ||
codebases into multi-package repositories (sometimes called [monorepos](https://github.com/babel/babel/blob/master/doc/design/monorepo.md)). Projects like [Babel](https://github.com/babel/babel/tree/master/packages), [React](https://github.com/facebook/react/tree/master/packages), [Angular](https://github.com/angular/angular/tree/master/modules), | ||
[Ember](https://github.com/emberjs/ember.js/tree/master/packages), [Meteor](https://github.com/meteor/meteor/tree/devel/packages), [Jest](https://github.com/facebook/jest/tree/master/packages), and many others develop all of their packages within a | ||
@@ -388,2 +388,17 @@ single repository. | ||
### import | ||
```sh | ||
$ lerna import <path-to-external-repository> | ||
``` | ||
Import the package at `<path-to-external-repository>`, with commit history, | ||
into `packages/<directory-name>`. Original commit authors, dates and messages | ||
are preserved. Commits are applied to the current branch. | ||
This is useful for gathering pre-existing standalone packages into a Lerna | ||
repo. Each commit is modified to make changes relative to the package | ||
directory. So, for example, the commit that added `package.json` will | ||
instead add `packages/<directory-name>/package.json`. | ||
## Misc | ||
@@ -390,0 +405,0 @@ |
Sorry, the diff of this file is not supported yet
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
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
147687
16
2716
479
- Removedsync-exec@^0.6.2
- Removedsync-exec@0.6.2(transitive)