From 695baabfad7c02150d8620e45d10cd7a713fabbf Mon Sep 17 00:00:00 2001 From: Kacper Wiszczuk Date: Sat, 22 Dec 2018 10:38:56 +0100 Subject: [PATCH] imp: Renamve dependencies command and add docs --- docs/CLI.md | 16 ++++++++++++++++ packages/metro/src/commands/dependencies.js | 5 +++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/CLI.md b/docs/CLI.md index 9e9401ee0a..e184ae7944 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -20,3 +20,19 @@ Generates a JavaScript bundle containing the specified entrypoint and its descen ## `serve` Starts a Metro server on the given port, building bundles on the fly. + +## `get-dependencies` + +Lists dependencies. + +### Options + +| Option | Description | +|---|---| +| `entry-file` | Absolute path to the root JS file | +| `output` | File name where to store the output, ex. /tmp/dependencies.txt | +| `platform` | The platform extension used for selecting modules | +| `transformer` | Specify a custom transformer to be used | +| `max-workers` | Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine. | +| `dev` | If false, skip all dev-only code path | +| `verbose` | Enables logging | diff --git a/packages/metro/src/commands/dependencies.js b/packages/metro/src/commands/dependencies.js index a9843d01c1..64420f4c47 100644 --- a/packages/metro/src/commands/dependencies.js +++ b/packages/metro/src/commands/dependencies.js @@ -67,7 +67,7 @@ async function dependencies(args: any, config: any) { } module.exports = () => ({ - command: 'dependencies', + command: 'get-dependencies', description: 'List dependencies', builder: (yargs: Yargs) => { yargs.option('entry-file', { @@ -86,7 +86,7 @@ module.exports = () => ({ }); yargs.option('transformer', { type: 'string', - describe: 'The platform extension used for selecting modules', + describe: 'Specify a custom transformer to be used', }); yargs.option('max-workers', { type: 'number', @@ -103,6 +103,7 @@ module.exports = () => ({ yargs.option('verbose', { type: 'boolean', default: false, + description: 'Enables logging', }); }, handler: makeAsyncCommand(async (argv: any) => {