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 serve command to the CLI #14

Merged
merged 3 commits into from
Sep 16, 2021
Merged

Feat: Add serve command to the CLI #14

merged 3 commits into from
Sep 16, 2021

Conversation

christoph-fricke
Copy link
Contributor

This PR adds a new serve command and improves the overall UX of the CLI. All improvements/changes are listed below.
The serve command starts the web server without requiring a file path and opening the view. This command is especially useful for diagram views embedded in local documentation, since it has no other side-effects apart from starting the web server, and can be used in scripts.

  • Added serve command.
  • Moved previous behavior to an open command.
    • => Default command that will be used if no command is provided.
  • The CLI version is no parsed from the package.json version when it is packaged. No need to update it manually...
  • Added a global --port / -p option to overwrite the port used for the web server.
  • Commands and options are now sorted in the help output.
  • Altered descriptions for commands and options to be shorter and better align with the text of the auto generated help.
  • The script name (used in the help) is now parsed dynamically (process.title) to reflect the name of the executable.
    • When a relative path is used to call the executable, the relative path is reflected in the script name.
    • Should avoid confusion in the help text if the executable is named differently. Especially since they are packaged with their OS target appended.
  • Updated Commander to the latest major version

Copy link
Member

@NiklasRentzCAU NiklasRentzCAU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@christoph-fricke christoph-fricke merged commit 0f08fc2 into main Sep 16, 2021
@christoph-fricke christoph-fricke deleted the cfr/cli-serve branch September 16, 2021 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants