@lerna/pack-directory
Advanced tools
Comparing version 3.16.4 to 4.0.0
@@ -6,2 +6,33 @@ # Change Log | ||
# [4.0.0](https://github.com/lerna/lerna/compare/v3.22.1...v4.0.0) (2021-02-10) | ||
### Features | ||
* **deps:** Bump dependencies ([affed1c](https://github.com/lerna/lerna/commit/affed1ce0fce91f01b0a9eafe357db2d985b974f)) | ||
* Consume named exports of sibling modules ([63499e3](https://github.com/lerna/lerna/commit/63499e33652bc78fe23751875d74017e2f16a689)) | ||
* Expose named export ([c1303f1](https://github.com/lerna/lerna/commit/c1303f13adc4cf15f96ff25889b52149f8224c0e)) | ||
* Remove default export ([e2f1ec3](https://github.com/lerna/lerna/commit/e2f1ec3dd049d2a89880029908a2aa7c66f15082)) | ||
* **deps:** npm-packlist@^2.1.4 ([c63fabd](https://github.com/lerna/lerna/commit/c63fabdc09bae34d8f8d907e5d21a996ac01daef)) | ||
* **deps:** tar@^6.0.5 ([fce3e77](https://github.com/lerna/lerna/commit/fce3e778276cbab99301b6caba414efd3b4a78ea)) | ||
* **deps:** temp-write@^4.0.0 ([7bbfb70](https://github.com/lerna/lerna/commit/7bbfb7020fbbf1fd7f2ebea38ac2718bea5a0646)) | ||
* **pack-directory:** Remove figgy-pudding ([640faa5](https://github.com/lerna/lerna/commit/640faa54cbbc5faeb6b13322c8d4f48bf035a1f7)) | ||
* Drop support for Node v6.x & v8.x ([ff4bb4d](https://github.com/lerna/lerna/commit/ff4bb4da215555e3bb136f5af09b5cbc631e57bb)) | ||
### BREAKING CHANGES | ||
* The default export has been removed, please use a named export instead. | ||
* Node v6.x & v8.x are no longer supported. Please upgrade to the latest LTS release. | ||
Here's the gnarly one-liner I used to make these changes: | ||
``` | ||
npx lerna exec --concurrency 1 --stream -- 'json -I -f package.json -e '"'"'this.engines=this.engines||{};this.engines.node=">= 10.18.0"'"'" | ||
``` | ||
(requires `npm i -g json` beforehand) | ||
## [3.16.4](https://github.com/lerna/lerna/compare/v3.16.3...v3.16.4) (2019-07-24) | ||
@@ -8,0 +39,0 @@ |
"use strict"; | ||
const path = require("path"); | ||
const figgyPudding = require("figgy-pudding"); | ||
const packlist = require("npm-packlist"); | ||
@@ -9,19 +8,27 @@ const log = require("npmlog"); | ||
const tempWrite = require("temp-write"); | ||
const getPacked = require("@lerna/get-packed"); | ||
const Package = require("@lerna/package"); | ||
const runLifecycle = require("@lerna/run-lifecycle"); | ||
const { getPacked } = require("@lerna/get-packed"); | ||
const { Package } = require("@lerna/package"); | ||
const { runLifecycle } = require("@lerna/run-lifecycle"); | ||
module.exports = packDirectory; | ||
module.exports.packDirectory = packDirectory; | ||
const PackConfig = figgyPudding({ | ||
log: { default: log }, | ||
"lerna-command": { default: "pack" }, | ||
lernaCommand: "lerna-command", | ||
"ignore-prepublish": {}, | ||
ignorePrepublish: "ignore-prepublish", | ||
}); | ||
/** | ||
* @typedef {object} PackConfig | ||
* @property {typeof log} [log] | ||
* @property {string} [lernaCommand] If "publish", run "prepublishOnly" lifecycle | ||
* @property {boolean} [ignorePrepublish] | ||
*/ | ||
function packDirectory(_pkg, dir, _opts) { | ||
/** | ||
* Pack a directory suitable for publishing, writing tarball to a tempfile. | ||
* @param {Package|string} _pkg Package instance or path to manifest | ||
* @param {string} dir to pack | ||
* @param {PackConfig} options | ||
*/ | ||
function packDirectory(_pkg, dir, options) { | ||
const pkg = Package.lazy(_pkg, dir); | ||
const opts = PackConfig(_opts); | ||
const opts = { | ||
log, | ||
...options, | ||
}; | ||
@@ -47,3 +54,3 @@ opts.log.verbose("pack-directory", path.relative(".", pkg.contents)); | ||
chain = chain.then(() => packlist({ path: pkg.contents })); | ||
chain = chain.then(files => | ||
chain = chain.then((files) => | ||
tar.create( | ||
@@ -62,8 +69,8 @@ { | ||
// and any such future "features" by prepending `./` | ||
files.map(f => `./${f}`) | ||
files.map((f) => `./${f}`) | ||
) | ||
); | ||
chain = chain.then(stream => tempWrite(stream, getTarballName(pkg))); | ||
chain = chain.then(tarFilePath => | ||
getPacked(pkg, tarFilePath).then(packed => | ||
chain = chain.then((stream) => tempWrite(stream, getTarballName(pkg))); | ||
chain = chain.then((tarFilePath) => | ||
getPacked(pkg, tarFilePath).then((packed) => | ||
Promise.resolve() | ||
@@ -70,0 +77,0 @@ .then(() => runLifecycle(pkg, "postpack", opts)) |
{ | ||
"name": "@lerna/pack-directory", | ||
"version": "3.16.4", | ||
"version": "4.0.0", | ||
"description": "Pack a directory into an npm package tarball", | ||
@@ -30,12 +30,14 @@ "keywords": [ | ||
"dependencies": { | ||
"@lerna/get-packed": "3.16.0", | ||
"@lerna/package": "3.16.0", | ||
"@lerna/run-lifecycle": "3.16.2", | ||
"figgy-pudding": "^3.5.1", | ||
"npm-packlist": "^1.4.4", | ||
"@lerna/get-packed": "4.0.0", | ||
"@lerna/package": "4.0.0", | ||
"@lerna/run-lifecycle": "4.0.0", | ||
"npm-packlist": "^2.1.4", | ||
"npmlog": "^4.1.2", | ||
"tar": "^4.4.10", | ||
"temp-write": "^3.4.0" | ||
"tar": "^6.1.0", | ||
"temp-write": "^4.0.0" | ||
}, | ||
"gitHead": "bb048cb306b5cfcb039aa98f667cf3751cf0ad20" | ||
"engines": { | ||
"node": ">= 10.18.0" | ||
}, | ||
"gitHead": "4582c476e07dddddd6b2e3ab6e7f52c1f9eed59a" | ||
} |
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
10373
7
77
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@lerna/get-packed@4.0.0(transitive)
+ Added@lerna/npm-conf@4.0.0(transitive)
+ Added@lerna/package@4.0.0(transitive)
+ Added@lerna/run-lifecycle@4.0.0(transitive)
+ Addedat-least-node@1.0.0(transitive)
+ Addedchownr@2.0.0(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedfs-minipass@2.1.0(transitive)
+ Addedhosted-git-info@4.1.0(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedload-json-file@6.2.0(transitive)
+ Addedlru-cache@6.0.0(transitive)
+ Addedmake-dir@2.1.03.1.0(transitive)
+ Addedminipass@3.3.65.0.0(transitive)
+ Addedminizlib@2.1.2(transitive)
+ Addedmkdirp@1.0.4(transitive)
+ Addednpm-package-arg@8.1.5(transitive)
+ Addednpm-packlist@2.2.2(transitive)
+ Addedparse-json@5.2.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpify@5.0.0(transitive)
+ Addedsemver@6.3.17.6.3(transitive)
+ Addedssri@8.0.1(transitive)
+ Addedstrip-bom@4.0.0(transitive)
+ Addedtar@6.2.1(transitive)
+ Addedtemp-write@4.0.0(transitive)
+ Addedtype-fest@0.4.10.6.0(transitive)
+ Addeduniversalify@2.0.1(transitive)
+ Addedwrite-json-file@3.2.0(transitive)
+ Addedwrite-pkg@4.0.0(transitive)
+ Addedyallist@4.0.0(transitive)
- Removedfiggy-pudding@^3.5.1
- Removed@lerna/get-packed@3.16.0(transitive)
- Removed@lerna/npm-conf@3.16.0(transitive)
- Removed@lerna/package@3.16.0(transitive)
- Removed@lerna/run-lifecycle@3.16.2(transitive)
- Removedfiggy-pudding@3.5.2(transitive)
- Removedfs-extra@8.1.0(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedjson-parse-better-errors@1.0.2(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removedload-json-file@5.3.0(transitive)
- Removedmake-dir@1.3.0(transitive)
- Removednpm-package-arg@6.1.1(transitive)
- Removednpm-packlist@1.4.8(transitive)
- Removedparse-json@4.0.0(transitive)
- Removedpify@3.0.0(transitive)
- Removedssri@6.0.2(transitive)
- Removedstrip-bom@3.0.0(transitive)
- Removedtemp-write@3.4.0(transitive)
- Removedtype-fest@0.3.1(transitive)
- Removeduniversalify@0.1.2(transitive)
- Removedwrite-json-file@2.3.0(transitive)
- Removedwrite-pkg@3.2.0(transitive)
Updated@lerna/get-packed@4.0.0
Updated@lerna/package@4.0.0
Updated@lerna/run-lifecycle@4.0.0
Updatednpm-packlist@^2.1.4
Updatedtar@^6.1.0
Updatedtemp-write@^4.0.0