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

refactor: deploy command ui text #261

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ $ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/apps-cli/1.2.0 darwin-arm64 node-v18.20.2
@contentstack/apps-cli/1.2.0 darwin-arm64 node-v18.20.2
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down Expand Up @@ -130,16 +129,16 @@ Deploy an app

```
USAGE
$ csdx app:deploy [--app-uid <value>] [--hosting-type <value>] [--app-url <value>] [-y] [--launch-project
existing|new] [-c <value>]
$ csdx app:deploy [--app-uid <value>] [--hosting-type Hosting with Launch|Custom Hosting] [--app-url <value>]
[--launch-project existing|new] [-c <value>]

FLAGS
-c, --config=<value> [optional] path of config file
-y, --yes Force disconnect launch project by skipping the confirmation
-c, --config=<value> [optional] Please enter the path of the config file.
--app-uid=<value> Provide the app UID of an existing app.
--app-url=<value> App URL
--hosting-type=<value> Hosting Type
--launch-project=<option> Launch Project
--app-url=<value> Please enter the URL of the app you want to deploy.
--hosting-type=<option> Please provide a valid Hosting Type.
<options: Hosting with Launch|Custom Hosting>
--launch-project=<option> Choose a new or an existing Launch project.
<options: existing|new>

DESCRIPTION
Expand Down
6 changes: 4 additions & 2 deletions src/commands/app/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export default class Deploy extends AppCLIBaseCommand {
description: commonMsg.APP_UID,
}),
"hosting-type": Flags.string({
multiple: false,
options: ["Hosting with Launch", "Custom Hosting"],
description: deployAppMsg.HOSTING_TYPE,
}),
"app-url": Flags.string({
Expand Down Expand Up @@ -90,7 +92,7 @@ export default class Deploy extends AppCLIBaseCommand {
await this.handleHostingWithLaunch(config, updateHostingPayload, projects);
break;
default:
this.log("Invalid hosting type", "error");
this.log("Please provide a valid Hosting Type.", "error");
return;
}

Expand Down Expand Up @@ -197,7 +199,7 @@ export default class Deploy extends AppCLIBaseCommand {
);
url = await this.handleNewProject(config, updateHostingPayload);
} else {
this.log("Invalid project type", "error");
this.log("Please provide a valid launch project.", "error");
return;
}

Expand Down
18 changes: 9 additions & 9 deletions src/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ const reinstallAppMsg = {
}

const deployAppMsg = {
APP_DEPLOYED: "{app} deployed successfully.",
APP_DEPLOYED: "{app} has been deployed successfully.",
FORCE_DISCONNECT: "Force disconnect launch project by skipping the confirmation",
LAUNCH_PROJECT: "Launch Project",
APP_URL: "App URL",
HOSTING_TYPE: "Hosting Type",
CONFIG_FILE: "[optional] path of config file",
APP_UPDATE_TERMINATION_MSG: "Launch Project connected! Skipping app hosting updates process...",
DISCONNECT_PROJECT: "Are you sure you want to disconnect launch Project ?",
PROJECT_NOT_FOUND: "Project not found!",
PROJECT_NAME_CONFLICT_FAILED: "Project name conflict resolution failed!"
LAUNCH_PROJECT: "Choose a new or an existing Launch project.",
APP_URL: "Please enter the URL of the app you want to deploy.",
HOSTING_TYPE: "Please provide a valid Hosting Type.",
CONFIG_FILE: "[optional] Please enter the path of the config file.",
APP_UPDATE_TERMINATION_MSG: "The app is already connected to the Launch project. Skipping the app hosting updates process.",
DISCONNECT_PROJECT: "Are you sure you wan to disconnect the Launch project?",
PROJECT_NOT_FOUND: "We couldn't find the project. Please enter a valid project name.",
PROJECT_NAME_CONFLICT_FAILED: "Unable to resolve the project name conflict."
}

const messages: typeof errors &
Expand Down
2 changes: 1 addition & 1 deletion src/util/inquirer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ const askProjectName = async (
type: "input",
name: "name",
validate: inquireRequireValidation,
message: `${projectName} project already exist. Enter a new name to create a project.?`,
message: `The project name ${projectName} is already in use. Please enter a different name for your project`,
});
};

Expand Down
Loading