Skip to content

Commit

Permalink
feat(pack-directory): Remove figgy-pudding
Browse files Browse the repository at this point in the history
  • Loading branch information
evocateur committed Nov 24, 2020
1 parent bdc162d commit 640faa5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
2 changes: 0 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions utils/pack-directory/__tests__/pack-directory.test.js
Expand Up @@ -158,8 +158,8 @@ describe("pack-directory", () => {
next,
next.location,
Object.assign({}, conf, {
"ignore-prepublish": true,
"lerna-command": "publish",
ignorePrepublish: true,
lernaCommand: "publish",
})
);

Expand Down
27 changes: 17 additions & 10 deletions utils/pack-directory/lib/pack-directory.js
@@ -1,7 +1,6 @@
"use strict";

const path = require("path");
const figgyPudding = require("figgy-pudding");
const packlist = require("npm-packlist");
const log = require("npmlog");
const tar = require("tar");
Expand All @@ -12,17 +11,25 @@ const runLifecycle = require("@lerna/run-lifecycle");

module.exports = 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,
};

opts.log.verbose("pack-directory", path.relative(".", pkg.contents));

Expand Down
1 change: 0 additions & 1 deletion utils/pack-directory/package.json
Expand Up @@ -30,7 +30,6 @@
"@lerna/get-packed": "file:../get-packed",
"@lerna/package": "file:../../core/package",
"@lerna/run-lifecycle": "file:../run-lifecycle",
"figgy-pudding": "^3.5.1",
"npm-packlist": "^2.1.4",
"npmlog": "^4.1.2",
"tar": "^6.0.5",
Expand Down

0 comments on commit 640faa5

Please sign in to comment.