Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add "routes" visualization command to cli #326

Merged
merged 5 commits into from
Oct 21, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
added docs and simplified args
jacob-ebey committed Oct 19, 2021
commit 260e063384c4a6bb5be1ac0dff7577f617e44d9a
9 changes: 6 additions & 3 deletions packages/remix-dev/cli.ts
Original file line number Diff line number Diff line change
@@ -8,10 +8,12 @@ Usage
$ remix build [remixRoot]
$ remix dev [remixRoot]
$ remix setup [remixPlatform]
$ remix routes [remixRoot]
Options
--help Print this help message and exit
--version, -v Print the CLI version and exit
--json Print the routes as JSON
Values
[remixPlatform] "node" is currently the only platform
@@ -20,15 +22,16 @@ Examples
$ remix build my-website
$ remix dev my-website
$ remix setup node
$ remix routes my-website
`;

const flags: AnyFlags = {
version: {
type: "boolean",
alias: "v"
},
format: {
type: "string"
json: {
type: "boolean"
}
};

@@ -45,7 +48,7 @@ if (cli.flags.version) {

switch (cli.input[0]) {
case "routes":
commands.routes(cli.input[1], cli.flags.format as string);
commands.routes(cli.input[1], cli.flags.json ? "json" : "jsx");
break;
case "build":
commands.build(cli.input[1], process.env.NODE_ENV);