Support sort option in lerna.json#596
Conversation
Can be configured at the top level or per-command.
Example:
```js
{
...
"commands": {
"run": {
"sort": false
}
}
}
```
| const {sort} = this.getOptions(); | ||
|
|
||
| // If the option isn't present then the default is to sort. | ||
| this.toposort = sort == null || sort; |
There was a problem hiding this comment.
Since this.toposort is never referenced until the initialize method of subclasses, it seems like we could wait to determine this in runPreparations() or something. My concern (perhaps unfounded?) is that calling getOptions() in the constructor might "miss" the otherCommandConfigs override? Do I just suck at class inheritance?
There was a problem hiding this comment.
@evocateur Good thought! The constructor name is actually pulled from the object bound to this rather than the class where the method is defined, so it should work as intended in this case.
Here's a small script to demonstrate:
class Foo {
constructor() {
console.log(this.constructor.name);
}
}
class Bar extends Foo {}
new Bar;This prints Bar rather than Foo, since that's what is instantiated.
Thanks for thinking through this so carefully!
|
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Can be configured at the top level or per-command.
Example: