Skip to content

Commit

Permalink
feat(filter-options): Remove figgy-pudding
Browse files Browse the repository at this point in the history
  • Loading branch information
evocateur committed Nov 20, 2020
1 parent f5aa618 commit 7d90289
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
41 changes: 23 additions & 18 deletions core/filter-options/lib/get-filtered-packages.js
@@ -1,29 +1,34 @@
"use strict";

const npmlog = require("npmlog");
const figgyPudding = require("figgy-pudding");
const log = require("npmlog");
const collectUpdates = require("@lerna/collect-updates");
const filterPackages = require("@lerna/filter-packages");

module.exports = getFilteredPackages;

const FilterConfig = figgyPudding({
scope: {},
ignore: {},
private: {},
since: {},
continueIfNoMatch: {},
excludeDependents: {},
includeDependents: {},
includeDependencies: {},
includeFilteredDependents: "includeDependents",
includeFilteredDependencies: "includeDependencies",
includeMergedTags: {},
log: { default: npmlog },
});

/**
* @typedef {object} FilterOptions
* @property {string} scope
* @property {string} ignore
* @property {boolean} private
* @property {string} since
* @property {boolean} continueIfNoMatch
* @property {boolean} excludeDependents
* @property {boolean} includeDependents
* @property {boolean} includeDependencies
* @property {boolean} includeMergedTags
* @property {typeof log} log
*/

/**
* Retrieve a list of Package instances filtered by various options.
* @param {PackageGraph} packageGraph
* @param {CommandExecOpts} execOpts
* @param {Partial<FilterOptions>} opts
* @returns {Promise<Package>}
*/
function getFilteredPackages(packageGraph, execOpts, opts) {
const options = FilterConfig(opts);
const options = { log, ...opts };

if (options.scope) {
options.log.notice("filter", "including %j", options.scope);
Expand Down
1 change: 0 additions & 1 deletion core/filter-options/package.json
Expand Up @@ -35,7 +35,6 @@
"@lerna/collect-updates": "file:../../utils/collect-updates",
"@lerna/filter-packages": "file:../../utils/filter-packages",
"dedent": "^0.7.0",
"figgy-pudding": "^3.5.1",
"npmlog": "^4.1.2"
}
}
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.

0 comments on commit 7d90289

Please sign in to comment.