Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(list): add Lerna
list
as optional command
- Loading branch information
1 parent
7d4116b
commit 65f810c
Showing
74 changed files
with
1,718 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { filterOptions } from '../filter-options'; | ||
|
||
/** @ts-ignore */ | ||
const group = 'Command Options:'; | ||
|
||
/** | ||
* @see https://github.com/yargs/yargs/blob/master/docs/advanced.md#providing-a-command-module | ||
*/ | ||
exports.command = 'list'; | ||
exports.describe = 'List local packages'; | ||
exports.aliases = ['ls', 'la', 'll']; | ||
|
||
exports.builder = (yargs) => { | ||
yargs.options({ | ||
json: { | ||
group, | ||
describe: 'Show information as a JSON array', | ||
type: 'boolean', | ||
}, | ||
ndjson: { | ||
group, | ||
describe: 'Show information as newline-delimited JSON', | ||
type: 'boolean', | ||
}, | ||
a: { | ||
group, | ||
describe: 'Show private packages that are normally hidden', | ||
type: 'boolean', | ||
alias: 'all', | ||
}, | ||
l: { | ||
group, | ||
describe: 'Show extended information', | ||
type: 'boolean', | ||
alias: 'long', | ||
}, | ||
p: { | ||
group, | ||
describe: 'Show parseable output instead of columnified view', | ||
type: 'boolean', | ||
alias: 'parseable', | ||
}, | ||
toposort: { | ||
group, | ||
describe: 'Sort packages in topological order instead of lexical by directory', | ||
type: 'boolean', | ||
}, | ||
graph: { | ||
group, | ||
describe: 'Show dependency graph as a JSON-formatted adjacency list', | ||
type: 'boolean', | ||
}, | ||
}); | ||
|
||
return filterOptions(yargs); | ||
}; | ||
|
||
exports.handler = async function handler(argv) { | ||
try { | ||
const { ListCommand } = await import('@lerna-lite/list'); | ||
new ListCommand(argv); | ||
} catch (e) { | ||
console.error( | ||
'"@lerna-lite/list" is optional and was not found. Please install it with `npm install @lerna-lite/list -D -W`' | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.