Skip to content

Commit 1ebb150

Browse files
Esemesekfacebook-github-bot
authored andcommitted
imp: Rename dependencies command and add docs (#339)
Summary: <!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. --> **Summary** Renamed the `dependencies` command to `get-dependencies` and added documentation. cc cpojer **Test plan** Running metro in command line and compiled documentation markdown. Pull Request resolved: #339 Differential Revision: D13669358 Pulled By: cpojer fbshipit-source-id: 2e60464eb656df963516a0fefab02b15091d3a24
1 parent a0b6ba0 commit 1ebb150

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

docs/CLI.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,19 @@ Generates a JavaScript bundle containing the specified entrypoint and its descen
2020
## `serve`
2121

2222
Starts a Metro server on the given port, building bundles on the fly.
23+
24+
## `get-dependencies`
25+
26+
Lists dependencies.
27+
28+
### Options
29+
30+
| Option | Description |
31+
|---|---|
32+
| `entry-file` | Absolute path to the root JS file |
33+
| `output` | File name where to store the output, ex. /tmp/dependencies.txt |
34+
| `platform` | The platform extension used for selecting modules |
35+
| `transformer` | Specify a custom transformer to be used |
36+
| `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. |
37+
| `dev` | If false, skip all dev-only code path |
38+
| `verbose` | Enables logging |

packages/metro/src/commands/dependencies.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async function dependencies(args: any, config: any) {
6767
}
6868

6969
module.exports = () => ({
70-
command: 'dependencies',
70+
command: 'get-dependencies',
7171
description: 'List dependencies',
7272
builder: (yargs: Yargs) => {
7373
yargs.option('entry-file', {
@@ -86,7 +86,7 @@ module.exports = () => ({
8686
});
8787
yargs.option('transformer', {
8888
type: 'string',
89-
describe: 'The platform extension used for selecting modules',
89+
describe: 'Specify a custom transformer to be used',
9090
});
9191
yargs.option('max-workers', {
9292
type: 'number',
@@ -103,6 +103,7 @@ module.exports = () => ({
103103
yargs.option('verbose', {
104104
type: 'boolean',
105105
default: false,
106+
description: 'Enables logging',
106107
});
107108
},
108109
handler: makeAsyncCommand(async (argv: any) => {

0 commit comments

Comments
 (0)