Skip to content

Commit 6fdce04

Browse files
huntiefacebook-github-bot
authored andcommitted
Update get-dependencies command to accept entryFile as positional arg
Summary: Small usability win when running `metro get-dependencies`. `entryFile` can now be received as an optional positional argument, as well as the existing named `--entry-file` arg. Changelog: **[Feature]** `metro get-dependencies --entryFile <entryFile>` can now be called as `metro get-dependencies <entryFile>` Reviewed By: motiz88 Differential Revision: D44028219 fbshipit-source-id: 2bed4e99e354f2e5c4a33cadd887c53f12665c65
1 parent 32b9291 commit 6fdce04

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/CLI.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ Generates a JavaScript bundle containing the specified entrypoint and its descen
3232

3333
Starts Metro on the given port, building bundles on the fly.
3434

35-
## `get-dependencies`
35+
## `get-dependencies <entryFile>`
3636

37-
Lists dependencies.
37+
List all dependencies that will be bundled for a given entry point.
3838

3939
### Options
4040

4141
| Option | Description |
4242
|---|---|
43-
| `entry-file` | Absolute path to the root JS file |
43+
| `entry-file` | Absolute path to the root JS file. This can also be given as the first positional arg. |
4444
| `output` | File name where to store the output, ex. /tmp/dependencies.txt |
4545
| `platform` | The platform extension used for selecting modules |
4646
| `transformer` | Specify a custom transformer to be used |

packages/metro/src/commands/dependencies.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ async function dependencies(args: Args, config: ConfigT) {
8282
}
8383

8484
module.exports = (): {...ModuleObject, handler: Function} => ({
85-
command: 'get-dependencies',
86-
desc: 'List dependencies',
85+
command: 'get-dependencies [entryFile]',
86+
desc: 'List all dependencies that will be bundled for a given entry point',
8787
builder: (yargs: Yargs) => {
8888
yargs.option('entry-file', {
8989
type: 'string',

0 commit comments

Comments
 (0)