Skip to content

CLI #770

@vicb

Description

@vicb

I think we should do some cleanup on how parse CLI command/flags.

Opening this issue to list some ideas.

See for example #762

Some thoughts:

  1. We should document all the commands (build, preview, ...) and what arguments they take

  2. getArgs()

As of today we call getArgs() first which compute the args for all the commands.

Maybe what we should do instead is to get the command first by looking at the first argument and let each command parse their arguments.

For ex. we pass the same parseArgs config for all commands when most of the config does only apply to build.

  1. compileOpenNextConfig

compileOpenNextConfig is called whatever the command is at the beginning of runCommand.
I think we could just call it for the build command and retrieve the built version for other commands.

(same goes for createOpenNextConfigIfNotExistent)

We should also create a commands/build.ts as we have for all other commands.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions