nestrs-cli-rs 0.1.0

Rust port of the Nest CLI for the nestrs organization.
Documentation
//! Upstream source: `../nest-cli/lib/ui/messages.ts`.

use super::emojis;

pub const PROJECT_NAME_QUESTION: &str = "What name would you like to use for the new project?";
pub const PROJECT_SELECTION_QUESTION: &str = "Which project would you like to generate to?";
pub const LIBRARY_PROJECT_SELECTION_QUESTION: &str =
    "Which project would you like to add the library to?";
pub const DRY_RUN_MODE: &str = "Command has been executed in dry run mode, nothing changed!";
pub const GIT_INITIALIZATION_ERROR: &str = "Git repository has not been initialized";
pub const LIBRARY_INSTALLATION_FAILED_NO_LIBRARY: &str = "No library found.";
pub const LIBRARY_INSTALLATION_STARTS: &str = "Starting library setup...";

pub fn project_information_start() -> String {
    format!(
        "{}  We will scaffold your app in a few seconds..",
        emojis::SPARKLES
    )
}

pub fn runner_execution_error(command: &str) -> String {
    format!("\nFailed to execute command: {command}")
}

pub fn package_manager_question() -> String {
    format!("Which package manager would you {}  to use?", emojis::HEART)
}

pub fn package_manager_installation_in_progress() -> String {
    format!("Installation in progress... {}", emojis::COFFEE)
}

pub fn package_manager_update_in_progress() -> String {
    package_manager_installation_in_progress()
}

pub fn package_manager_upgrade_in_progress() -> String {
    package_manager_installation_in_progress()
}

pub fn package_manager_production_installation_in_progress() -> String {
    format!("Package installation in progress... {}", emojis::COFFEE)
}

pub fn package_manager_installation_succeed(name: &str) -> String {
    if name != "." {
        format!("{}  Successfully created project {name}", emojis::ROCKET)
    } else {
        format!("{}  Successfully created a new project", emojis::ROCKET)
    }
}

pub fn get_started_information() -> String {
    format!(
        "{}  Get started with the following commands:",
        emojis::POINT_RIGHT
    )
}

pub fn change_dir_command(name: &str) -> String {
    format!("$ cd {name}")
}

pub fn start_command(package_manager: &str) -> String {
    format!("$ {package_manager} run start")
}

pub fn package_manager_installation_failed(command_to_run_manually: &str) -> String {
    format!(
        "{}  Packages installation failed!\nIn case you don't see any errors above, consider manually running the failed command {command_to_run_manually} to see more details on why it errored out.",
        emojis::SCREAM
    )
}

pub fn nest_information_package_manager_failed() -> String {
    format!(
        "{}  cannot read your project package.json file, are you inside your project directory?",
        emojis::SMIRK
    )
}

pub fn nest_information_package_warning_failed(nest_dependencies: &[String]) -> String {
    format!(
        "{}  failed to compare dependencies versions, please check that following packages are in the same minor version : \n {}",
        emojis::SMIRK,
        nest_dependencies.join("\n")
    )
}

pub fn library_installation_failed_bad_package(name: &str) -> String {
    format!(
        "Unable to install library {name} because package did not install. Please check package name."
    )
}