@@ -14,8 +14,7 @@ const rimrafDir = require("@lerna/rimraf-dir");
1414const hasNpmVersion = require ( "@lerna/has-npm-version" ) ;
1515const npmInstall = require ( "@lerna/npm-install" ) ;
1616const { createRunner } = require ( "@lerna/run-lifecycle" ) ;
17- const batchPackages = require ( "@lerna/batch-packages" ) ;
18- const runParallelBatches = require ( "@lerna/run-parallel-batches" ) ;
17+ const runTopologically = require ( "@lerna/run-topologically" ) ;
1918const symlinkBinary = require ( "@lerna/symlink-binary" ) ;
2019const symlinkDependencies = require ( "@lerna/symlink-dependencies" ) ;
2120const ValidationError = require ( "@lerna/validation-error" ) ;
@@ -178,10 +177,6 @@ class BootstrapCommand extends Command {
178177 } ) ;
179178
180179 chain = chain . then ( ( ) => {
181- this . batchedPackages = this . toposort
182- ? batchPackages ( this . filteredPackages , this . options . rejectCycles )
183- : [ this . filteredPackages ] ;
184-
185180 if ( npmClient === "yarn" && ! mutex ) {
186181 return getPort ( { port : 42424 , host : "0.0.0.0" } ) . then ( port => {
187182 this . npmConfig . mutex = `network:${ port } ` ;
@@ -281,9 +276,14 @@ class BootstrapCommand extends Command {
281276
282277 tracker . addWork ( this . filteredPackages . length ) ;
283278
284- return pFinally ( runParallelBatches ( this . batchedPackages , this . concurrency , mapPackageWithScript ) , ( ) =>
285- tracker . finish ( )
286- ) ;
279+ const runner = this . toposort
280+ ? runTopologically ( this . filteredPackages , mapPackageWithScript , {
281+ concurrency : this . concurrency ,
282+ rejectCycles : this . options . rejectCycles ,
283+ } )
284+ : pMap ( this . filteredPackages , mapPackageWithScript , { concurrency : this . concurrency } ) ;
285+
286+ return pFinally ( runner , ( ) => tracker . finish ( ) ) ;
287287 }
288288
289289 hoistedDirectory ( dependency ) {
0 commit comments