diff --git a/utils/batch-packages/CHANGELOG.md b/utils/batch-packages/CHANGELOG.md deleted file mode 100644 index 134ad16dbd..0000000000 --- a/utils/batch-packages/CHANGELOG.md +++ /dev/null @@ -1,142 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -# [3.16.0](https://github.com/lerna/lerna/compare/v3.15.0...v3.16.0) (2019-07-18) - -**Note:** Version bump only for package @lerna/batch-packages - - - - - -# [3.14.0](https://github.com/lerna/lerna/compare/v3.13.4...v3.14.0) (2019-05-14) - - -### Features - -* **run:** Add just-in-time queue management ([#2045](https://github.com/lerna/lerna/issues/2045)) ([6eca172](https://github.com/lerna/lerna/commit/6eca172)) - - - - - -# [3.13.0](https://github.com/lerna/lerna/compare/v3.12.1...v3.13.0) (2019-02-15) - - -### Features - -* **meta:** Add `repository.directory` field to package.json ([aec5023](https://github.com/lerna/lerna/commit/aec5023)) -* **meta:** Normalize package.json `homepage` field ([abeb4dc](https://github.com/lerna/lerna/commit/abeb4dc)) - - - - - -# [3.11.0](https://github.com/lerna/lerna/compare/v3.10.8...v3.11.0) (2019-02-08) - - -### Bug Fixes - -* **deps:** Explicit npmlog ^4.1.2 ([571c2e2](https://github.com/lerna/lerna/commit/571c2e2)) -* **deps:** Remove unused libnpm (replaced by direct sub-packages) ([1caeb28](https://github.com/lerna/lerna/commit/1caeb28)) - - - - - -## [3.10.6](https://github.com/lerna/lerna/compare/v3.10.5...v3.10.6) (2019-01-19) - -**Note:** Version bump only for package @lerna/batch-packages - - - - - -# [3.10.0](https://github.com/lerna/lerna/compare/v3.9.1...v3.10.0) (2019-01-08) - -**Note:** Version bump only for package @lerna/batch-packages - - - - - -# [3.6.0](https://github.com/lerna/lerna/compare/v3.5.1...v3.6.0) (2018-12-07) - - -### Features - -* Migrate existing usage to libnpm ([0d3a786](https://github.com/lerna/lerna/commit/0d3a786)), closes [#1767](https://github.com/lerna/lerna/issues/1767) - - - - - - -## [3.1.2](https://github.com/lerna/lerna/compare/v3.1.1...v3.1.2) (2018-08-20) - -**Note:** Version bump only for package @lerna/batch-packages - - - - - - -# [3.0.0](https://github.com/lerna/lerna/compare/v3.0.0-rc.0...v3.0.0) (2018-08-10) - -**Note:** Version bump only for package @lerna/batch-packages - - - - - - -# [3.0.0-rc.0](https://github.com/lerna/lerna/compare/v3.0.0-beta.21...v3.0.0-rc.0) (2018-07-27) - -**Note:** Version bump only for package @lerna/batch-packages - - - - - - -# [3.0.0-beta.18](https://github.com/lerna/lerna/compare/v3.0.0-beta.17...v3.0.0-beta.18) (2018-04-24) - -**Note:** Version bump only for package @lerna/batch-packages - - - - - - -# [3.0.0-beta.14](https://github.com/lerna/lerna/compare/v3.0.0-beta.13...v3.0.0-beta.14) (2018-04-03) - -**Note:** Version bump only for package @lerna/batch-packages - - - - - - -# [3.0.0-beta.11](https://github.com/lerna/lerna/compare/v3.0.0-beta.10...v3.0.0-beta.11) (2018-03-29) - -**Note:** Version bump only for package @lerna/batch-packages - - - - - - -# [3.0.0-beta.10](https://github.com/lerna/lerna/compare/v3.0.0-beta.9...v3.0.0-beta.10) (2018-03-27) - -**Note:** Version bump only for package @lerna/batch-packages - - - - - - -# [3.0.0-beta.1](https://github.com/lerna/lerna/compare/v3.0.0-beta.0...v3.0.0-beta.1) (2018-03-09) - -**Note:** Version bump only for package @lerna/batch-packages diff --git a/utils/batch-packages/README.md b/utils/batch-packages/README.md deleted file mode 100644 index 0523cafe15..0000000000 --- a/utils/batch-packages/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# `@lerna/batch-packages` - -> An internal Lerna tool - -## Usage - -You probably shouldn't, at least directly. - -Install [lerna](https://www.npmjs.com/package/lerna) for access to the `lerna` CLI. diff --git a/utils/batch-packages/batch-packages.js b/utils/batch-packages/batch-packages.js deleted file mode 100644 index c7b6ff174a..0000000000 --- a/utils/batch-packages/batch-packages.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; - -const log = require("npmlog"); -const PackageGraph = require("@lerna/package-graph"); - -module.exports = batchPackages; - -function batchPackages(packagesToBatch, rejectCycles, graphType) { - // create a new graph because we will be mutating it - const graph = new PackageGraph(packagesToBatch, graphType); - const [cyclePaths, cycleNodes] = graph.partitionCycles(rejectCycles); - const batches = []; - - if (cyclePaths.size) { - graph.pruneCycleNodes(cycleNodes); - } - - while (graph.size) { - // pick the current set of nodes _without_ localDependencies (aka it is a "source" node) - const batch = Array.from(graph.values()).filter(node => node.localDependencies.size === 0); - - log.silly("batched", batch); - // batches are composed of Package instances, not PackageGraphNodes - batches.push(batch.map(node => node.pkg)); - - // pruning the graph changes the node.localDependencies.size test - graph.prune(...batch); - } - - if (cycleNodes.size) { - // isolate cycles behind a single-package batch of the cyclical package with the most dependents - const [king, ...rats] = Array.from(cycleNodes) - .sort((a, b) => b.localDependents.size - a.localDependents.size) - .map(node => node.pkg); - - batches.push([king]); - batches.push(rats); - } - - return batches; -} diff --git a/utils/batch-packages/package.json b/utils/batch-packages/package.json deleted file mode 100644 index 5be7e1bca8..0000000000 --- a/utils/batch-packages/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@lerna/batch-packages", - "version": "3.16.0", - "description": "An internal Lerna tool", - "keywords": [ - "lerna", - "utils" - ], - "homepage": "https://github.com/lerna/lerna/tree/master/utils/batch-packages#readme", - "license": "MIT", - "author": { - "name": "Daniel Stockman", - "url": "https://github.com/evocateur" - }, - "files": [ - "batch-packages.js" - ], - "main": "batch-packages.js", - "engines": { - "node": ">= 6.9.0" - }, - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/lerna/lerna.git", - "directory": "utils/batch-packages" - }, - "scripts": { - "test": "echo \"Run tests from root\" && exit 1" - }, - "dependencies": { - "@lerna/package-graph": "file:../../core/package-graph", - "npmlog": "^4.1.2" - } -}