@lerna/listable
Advanced tools
Comparing version 3.0.0 to 3.6.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [3.6.0](https://github.com/lerna/lerna/compare/v3.5.1...v3.6.0) (2018-12-07) | ||
### Features | ||
* **listable:** Add --toposort option ([b387881](https://github.com/lerna/lerna/commit/b387881)), closes [#1652](https://github.com/lerna/lerna/issues/1652) | ||
<a name="3.0.0"></a> | ||
@@ -8,0 +19,0 @@ # [3.0.0](https://github.com/lerna/lerna/compare/v3.0.0-rc.0...v3.0.0) (2018-08-10) |
@@ -6,2 +6,3 @@ "use strict"; | ||
const path = require("path"); | ||
const batchPackages = require("@lerna/batch-packages"); | ||
@@ -36,7 +37,20 @@ module.exports = listableFormat; | ||
showParseable: options.parseable, | ||
isTopological: options.toposort, | ||
}; | ||
} | ||
function flatBatched(pkgList) { | ||
const batches = batchPackages(pkgList); | ||
return batches.reduce((acc, batch) => acc.concat(batch), []); | ||
} | ||
function filterResultList(pkgList, viewOptions) { | ||
return viewOptions.showAll ? pkgList.slice() : pkgList.filter(pkg => !pkg.private); | ||
let result = viewOptions.showAll ? pkgList.slice() : pkgList.filter(pkg => !pkg.private); | ||
if (viewOptions.isTopological) { | ||
result = flatBatched(result); | ||
} | ||
return result; | ||
} | ||
@@ -43,0 +57,0 @@ |
@@ -30,3 +30,8 @@ "use strict"; | ||
}, | ||
toposort: { | ||
group: "Command Options:", | ||
describe: "Sort packages in topological order instead of lexical by directory", | ||
type: "boolean", | ||
}, | ||
}); | ||
} |
{ | ||
"name": "@lerna/listable", | ||
"version": "3.0.0", | ||
"version": "3.6.0", | ||
"description": "Shared logic for listing package information", | ||
@@ -31,6 +31,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@lerna/batch-packages": "^3.6.0", | ||
"chalk": "^2.3.1", | ||
"columnify": "^1.5.4" | ||
}, | ||
"gitHead": "0c40a17a7cd4e9acd8e7ec33ffacd1c1acef5dc6" | ||
"gitHead": "8cc3196014f6fe8c9b41477b975c527d017a3daf" | ||
} |
Sorry, the diff of this file is not supported yet
7322
148
3
+ Added@lerna/batch-packages@^3.6.0
+ Added@lerna/batch-packages@3.16.0(transitive)
+ Added@lerna/package-graph@3.16.0(transitive)
+ Added@lerna/prerelease-id-from-version@3.16.0(transitive)
+ Added@lerna/validation-error@3.13.0(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedaproba@1.2.0(transitive)
+ Addedare-we-there-yet@1.1.7(transitive)
+ Addedbuiltins@1.0.3(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addedgauge@2.7.4(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-fullwidth-code-point@1.0.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addednpm-package-arg@6.1.1(transitive)
+ Addednpmlog@4.1.2(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedos-homedir@1.0.2(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedosenv@0.1.5(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsemver@5.7.26.3.1(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstring-width@1.0.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedvalidate-npm-package-name@3.0.0(transitive)
+ Addedwide-align@1.1.5(transitive)