@lerna/pack-directory
Advanced tools
Comparing version 3.7.1 to 3.7.2
@@ -6,2 +6,13 @@ # Change Log | ||
## [3.7.2](https://github.com/lerna/lerna/compare/v3.7.1...v3.7.2) (2018-12-21) | ||
### Bug Fixes | ||
* **pack-directory:** Accept lazy Package, passing directory as second parameter ([c6819c0](https://github.com/lerna/lerna/commit/c6819c0)) | ||
## [3.7.1](https://github.com/lerna/lerna/compare/v3.7.0...v3.7.1) (2018-12-20) | ||
@@ -8,0 +19,0 @@ |
"use strict"; | ||
const path = require("path"); | ||
const figgyPudding = require("figgy-pudding"); | ||
@@ -9,2 +10,3 @@ const packlist = require("npm-packlist"); | ||
const getPacked = require("@lerna/get-packed"); | ||
const Package = require("@lerna/package"); | ||
const runLifecycle = require("@lerna/run-lifecycle"); | ||
@@ -22,17 +24,11 @@ | ||
function packDirectory(pkg, _opts) { | ||
function packDirectory(_pkg, dir, _opts) { | ||
const pkg = Package.lazy(_pkg, dir); | ||
const opts = PackConfig(_opts); | ||
const dir = pkg.location; | ||
const name = | ||
pkg.name[0] === "@" | ||
? // scoped packages get special treatment | ||
pkg.name.substr(1).replace(/\//g, "-") | ||
: pkg.name; | ||
const outputFileName = `${name}-${pkg.version}.tgz`; | ||
opts.log.verbose("packDirectory", dir); | ||
opts.log.verbose("pack-directory", path.relative(".", dir)); | ||
let chain = Promise.resolve(); | ||
if (opts.ignorePrepublish !== false) { | ||
if (opts.ignorePrepublish !== true) { | ||
chain = chain.then(() => runLifecycle(pkg, "prepublish", opts)); | ||
@@ -69,3 +65,3 @@ } | ||
); | ||
chain = chain.then(stream => tempWrite(stream, outputFileName)); | ||
chain = chain.then(stream => tempWrite(stream, getTarballName(pkg))); | ||
chain = chain.then(tarFilePath => | ||
@@ -81,1 +77,11 @@ getPacked(pkg, tarFilePath).then(packed => | ||
} | ||
function getTarballName(pkg) { | ||
const name = | ||
pkg.name[0] === "@" | ||
? // scoped packages get special treatment | ||
pkg.name.substr(1).replace(/\//g, "-") | ||
: pkg.name; | ||
return `${name}-${pkg.version}.tgz`; | ||
} |
{ | ||
"name": "@lerna/pack-directory", | ||
"version": "3.7.1", | ||
"version": "3.7.2", | ||
"description": "Pack a directory into an npm package tarball", | ||
@@ -30,2 +30,3 @@ "keywords": [ | ||
"@lerna/get-packed": "^3.7.0", | ||
"@lerna/package": "^3.7.2", | ||
"@lerna/run-lifecycle": "^3.7.1", | ||
@@ -38,3 +39,3 @@ "figgy-pudding": "^3.5.1", | ||
}, | ||
"gitHead": "284aa4747dad26977790d6730ab2f640eb099cb4" | ||
"gitHead": "52796f674ad3f2642270e942e96443437c54ff72" | ||
} |
5767
70
8
+ Added@lerna/package@^3.7.2
+ Added@lerna/package@3.16.0(transitive)
+ Addeddetect-indent@5.0.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-plain-obj@1.1.0(transitive)
+ Addedload-json-file@5.3.0(transitive)
+ Addedparse-json@4.0.0(transitive)
+ Addedsort-keys@2.0.0(transitive)
+ Addedstrip-bom@3.0.0(transitive)
+ Addedtype-fest@0.3.1(transitive)
+ Addedwrite-json-file@2.3.0(transitive)
+ Addedwrite-pkg@3.2.0(transitive)