diff --git a/package-lock.json b/package-lock.json index 47bc4f0849..b280f513ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14085,7 +14085,6 @@ "license": "MIT", "dependencies": { "@lerna/query-graph": "file:../query-graph", - "figgy-pudding": "^3.5.1", "p-queue": "^6.6.2" }, "engines": { @@ -15593,7 +15592,6 @@ "version": "file:utils/run-topologically", "requires": { "@lerna/query-graph": "file:../query-graph", - "figgy-pudding": "^3.5.1", "p-queue": "^6.6.2" } }, diff --git a/utils/run-topologically/package.json b/utils/run-topologically/package.json index 9c9786cf6f..94eb712f9b 100644 --- a/utils/run-topologically/package.json +++ b/utils/run-topologically/package.json @@ -32,7 +32,6 @@ }, "dependencies": { "@lerna/query-graph": "file:../query-graph", - "figgy-pudding": "^3.5.1", "p-queue": "^6.6.2" } } diff --git a/utils/run-topologically/run-topologically.js b/utils/run-topologically/run-topologically.js index 9c6e01f933..14aee5173f 100644 --- a/utils/run-topologically/run-topologically.js +++ b/utils/run-topologically/run-topologically.js @@ -1,34 +1,23 @@ "use strict"; const PQueue = require("p-queue").default; -const figgyPudding = require("figgy-pudding"); const QueryGraph = require("@lerna/query-graph"); module.exports = runTopologically; -const TopologicalConfig = figgyPudding({ - // p-queue options - concurrency: {}, - // query-graph options - "graph-type": {}, - graphType: "graph-type", - "reject-cycles": {}, - rejectCycles: "reject-cycles", -}); +/** + * @typedef {import("@lerna/query-graph").QueryGraphConfig & { concurrency: number }} TopologicalConfig + */ /** * Run callback in maximally-saturated topological order. * - * @param {Array} packages List of `Package` instances - * @param {Function} runner Callback to map each `Package` with - * @param {Number} [opts.concurrency] Concurrency of execution - * @param {String} [opts.graphType] "allDependencies" or "dependencies" - * @param {Boolean} [opts.rejectCycles] Whether or not to reject cycles - * @returns {Promise>} when all executions complete + * @param {import("@lerna/package")[]} packages List of `Package` instances + * @param {(pkg: import("@lerna/package")) => Promise} runner Callback to map each `Package` with + * @param {TopologicalConfig} [options] + * @returns {Promise} when all executions complete */ -function runTopologically(packages, runner, opts) { - const { concurrency, graphType, rejectCycles } = TopologicalConfig(opts); - +function runTopologically(packages, runner, { concurrency, graphType, rejectCycles } = {}) { const queue = new PQueue({ concurrency }); const graph = new QueryGraph(packages, { graphType, rejectCycles });