Socket
Socket
Sign inDemoInstall

@lerna/run-topologically

Package Overview
Dependencies
41
Maintainers
2
Versions
53
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.18.5 to 4.0.0

33

CHANGELOG.md

@@ -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 @@

11

package.json
{
"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())

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc