Skip to content

Commit

Permalink
Update get-dependencies command to accept entryFile as positional arg
Browse files Browse the repository at this point in the history
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
  • Loading branch information
huntie authored and facebook-github-bot committed Mar 16, 2023
1 parent 32b9291 commit 6fdce04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/CLI.md
Expand Up @@ -32,15 +32,15 @@ Generates a JavaScript bundle containing the specified entrypoint and its descen

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

## `get-dependencies`
## `get-dependencies <entryFile>`

Lists dependencies.
List all dependencies that will be bundled for a given entry point.

### Options

| Option | Description |
|---|---|
| `entry-file` | Absolute path to the root JS file |
| `entry-file` | Absolute path to the root JS file. This can also be given as the first positional arg. |
| `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 |
Expand Down
4 changes: 2 additions & 2 deletions packages/metro/src/commands/dependencies.js
Expand Up @@ -82,8 +82,8 @@ async function dependencies(args: Args, config: ConfigT) {
}

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

0 comments on commit 6fdce04

Please sign in to comment.