@lerna/run-topologically
Advanced tools
Comparing version 3.18.5 to 4.0.0
@@ -6,2 +6,35 @@ # Change Log | ||
# [4.0.0](https://github.com/lerna/lerna/compare/v3.22.1...v4.0.0) (2021-02-10) | ||
### Bug Fixes | ||
* Improve accuracy of JSDoc type annotations ([1ec69f0](https://github.com/lerna/lerna/commit/1ec69f0e0f7a3f1e0c74dbacb17fab2d7b7a8a44)) | ||
### Features | ||
* Consume named exports of sibling modules ([63499e3](https://github.com/lerna/lerna/commit/63499e33652bc78fe23751875d74017e2f16a689)) | ||
* Drop support for Node v6.x & v8.x ([ff4bb4d](https://github.com/lerna/lerna/commit/ff4bb4da215555e3bb136f5af09b5cbc631e57bb)) | ||
* Expose named export ([c1303f1](https://github.com/lerna/lerna/commit/c1303f13adc4cf15f96ff25889b52149f8224c0e)) | ||
* Remove default export ([e2f1ec3](https://github.com/lerna/lerna/commit/e2f1ec3dd049d2a89880029908a2aa7c66f15082)) | ||
* **deps:** p-queue@^6.6.2 ([ed76cdd](https://github.com/lerna/lerna/commit/ed76cdddf57963e7aa3dfbff1f37fe361c9e2769)) | ||
* **run-topologically:** Remove figgy-pudding ([f3a73db](https://github.com/lerna/lerna/commit/f3a73db0f083a77fc14bdff2e4da4b2decfa8c8a)) | ||
### 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.18.5](https://github.com/lerna/lerna/compare/v3.18.4...v3.18.5) (2019-11-20) | ||
@@ -8,0 +41,0 @@ |
{ | ||
"name": "@lerna/run-topologically", | ||
"version": "3.18.5", | ||
"version": "4.0.0", | ||
"description": "An internal Lerna tool", | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
"engines": { | ||
"node": ">= 6.9.0" | ||
"node": ">= 10.18.0" | ||
}, | ||
@@ -35,7 +35,6 @@ "publishConfig": { | ||
"dependencies": { | ||
"@lerna/query-graph": "3.18.5", | ||
"figgy-pudding": "^3.5.1", | ||
"p-queue": "^4.0.0" | ||
"@lerna/query-graph": "4.0.0", | ||
"p-queue": "^6.6.2" | ||
}, | ||
"gitHead": "2612f51e7eecec58eacf0571724e6989e4b8e42d" | ||
"gitHead": "4582c476e07dddddd6b2e3ab6e7f52c1f9eed59a" | ||
} |
"use strict"; | ||
const PQueue = require("p-queue"); | ||
const figgyPudding = require("figgy-pudding"); | ||
const QueryGraph = require("@lerna/query-graph"); | ||
const PQueue = require("p-queue").default; | ||
const { QueryGraph } = require("@lerna/query-graph"); | ||
module.exports = runTopologically; | ||
module.exports.runTopologically = 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 | ||
*/ | ||
@@ -22,12 +15,9 @@ /** | ||
* | ||
* @param {Array<Package>} 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<Array<*>>} when all executions complete | ||
* @template T | ||
* @param {import("@lerna/package").Package[]} packages List of `Package` instances | ||
* @param {(pkg: import("@lerna/package").Package) => Promise<T>} runner Callback to map each `Package` with | ||
* @param {TopologicalConfig} [options] | ||
* @returns {Promise<T[]>} 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 }); | ||
@@ -46,3 +36,3 @@ const graph = new QueryGraph(packages, { graphType, rejectCycles }); | ||
runner(pkg) | ||
.then(value => returnValues.push(value)) | ||
.then((value) => returnValues.push(value)) | ||
.then(() => graph.markAsDone(pkg)) | ||
@@ -49,0 +39,0 @@ .then(() => queueNextAvailablePackages()) |
5875
2
37
+ Added@lerna/package-graph@4.0.0(transitive)
+ Added@lerna/prerelease-id-from-version@4.0.0(transitive)
+ Added@lerna/query-graph@4.0.0(transitive)
+ Added@lerna/validation-error@4.0.0(transitive)
+ Addedeventemitter3@4.0.7(transitive)
+ Addedhosted-git-info@4.1.0(transitive)
+ Addedlru-cache@6.0.0(transitive)
+ Addednpm-package-arg@8.1.5(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-queue@6.6.2(transitive)
+ Addedp-timeout@3.2.0(transitive)
+ Addedsemver@7.6.2(transitive)
+ Addedyallist@4.0.0(transitive)
- Removedfiggy-pudding@^3.5.1
- Removed@lerna/package-graph@3.18.5(transitive)
- Removed@lerna/prerelease-id-from-version@3.16.0(transitive)
- Removed@lerna/query-graph@3.18.5(transitive)
- Removed@lerna/validation-error@3.13.0(transitive)
- Removedeventemitter3@3.1.2(transitive)
- Removedfiggy-pudding@3.5.2(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removednpm-package-arg@6.1.1(transitive)
- Removedos-homedir@1.0.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedosenv@0.1.5(transitive)
- Removedp-queue@4.0.0(transitive)
- Removedsemver@5.7.26.3.1(transitive)
Updated@lerna/query-graph@4.0.0
Updatedp-queue@^6.6.2