From b7f69c811a0c3ad3ba3b4ef66e54532c4f9dfba4 Mon Sep 17 00:00:00 2001 From: Victorien Elvinger Date: Sun, 14 Apr 2024 14:13:34 +0200 Subject: [PATCH] docs: suggest biome migrate commands after biome init (#2437) --- crates/biome_cli/src/commands/init.rs | 39 +++++++++++-------- .../creates_config_file.snap | 28 +++++++------ ...n_biome_installed_via_package_manager.snap | 28 +++++++------ .../creates_config_jsonc_file.snap | 28 +++++++------ 4 files changed, 74 insertions(+), 49 deletions(-) diff --git a/crates/biome_cli/src/commands/init.rs b/crates/biome_cli/src/commands/init.rs index ce3f7ec40bd1..e0f1e66904c1 100644 --- a/crates/biome_cli/src/commands/init.rs +++ b/crates/biome_cli/src/commands/init.rs @@ -1,6 +1,6 @@ use crate::{CliDiagnostic, CliSession}; use biome_configuration::PartialConfiguration; -use biome_console::{markup, ConsoleExt, HorizontalLine}; +use biome_console::{markup, ConsoleExt}; use biome_fs::ConfigName; use biome_service::configuration::create_config; @@ -8,33 +8,40 @@ pub(crate) fn init(mut session: CliSession, emit_jsonc: bool) -> Result<(), CliD let fs = &mut session.app.fs; create_config(fs, PartialConfiguration::init(), emit_jsonc)?; let file_created = if emit_jsonc { - format!("{}: ", ConfigName::biome_jsonc()) + ConfigName::biome_jsonc() } else { - format!("{}: ", ConfigName::biome_json()) + ConfigName::biome_json() }; - session.app.console.log(markup! { -"\n""Welcome to Biome! Let's get you started..."" +" +Welcome to Biome! Let's get you started... -""Files created "{HorizontalLine::new(106)}" +""Files created "" - ""- "{file_created}"Your project configuration. Documentation: ""https://biomejs.dev/reference/configuration"" + ""- "{file_created}" + Your project configuration. See ""https://biomejs.dev/reference/configuration"" -""Next Steps "{HorizontalLine::new(109)}" +""Next Steps "" ""1."" ""Setup an editor extension"" - Get live errors as you type and format when you save. Learn more: ""https://biomejs.dev/guides/getting-started#editor-setup"" + Get live errors as you type and format when you save. + Learn more at ""https://biomejs.dev/guides/integrate-in-editor/"" ""2."" ""Try a command"" - ""biome ci"" checks for lint errors and verifies formatting. Run " "biome --help"" for a full list of commands and options. + ""biome check"" checks formatting, import sorting, and lint rules. + ""biome --help"" displays the available commands. - ""3."" ""Read the documentation"" - Our website serves as a comprehensive source of guides and documentation: ""https://biomejs.dev"" + ""3."" ""Migrate from ESLint and Prettier"" + ""biome migrate eslint"" migrates your ESLint configuration to Biome. + ""biome migrate prettier"" migrates your Prettier configuration to Biome. - ""4."" ""Get involved in the community"" - Ask questions, get support, or contribute by participating on GitHub (""https://github.com/biomejs/biome""), - or join our community Discord (""https://discord.gg/BypW39g6Yc"")" - }); + ""4."" ""Read the documentation"" + Find guides and documentation at ""https://biomejs.dev/guides/getting-started/"" + ""5."" ""Get involved with the community"" + Ask questions and contribute on GitHub: ""https://github.com/biomejs/biome"" + Seek for help on Discord: ""https://discord.gg/BypW39g6Yc"" +" + }); Ok(()) } diff --git a/crates/biome_cli/tests/snapshots/main_commands_init/creates_config_file.snap b/crates/biome_cli/tests/snapshots/main_commands_init/creates_config_file.snap index 7811261240e7..5ea6a8122fce 100644 --- a/crates/biome_cli/tests/snapshots/main_commands_init/creates_config_file.snap +++ b/crates/biome_cli/tests/snapshots/main_commands_init/creates_config_file.snap @@ -24,24 +24,30 @@ expression: content Welcome to Biome! Let's get you started... -Files created ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +Files created - - biome.json: Your project configuration. Documentation: https://biomejs.dev/reference/configuration + - biome.json + Your project configuration. See https://biomejs.dev/reference/configuration -Next Steps ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +Next Steps 1. Setup an editor extension - Get live errors as you type and format when you save. Learn more: https://biomejs.dev/guides/getting-started#editor-setup + Get live errors as you type and format when you save. + Learn more at https://biomejs.dev/guides/integrate-in-editor/ 2. Try a command - biome ci checks for lint errors and verifies formatting. Run biome --help for a full list of commands and options. + biome check checks formatting, import sorting, and lint rules. + biome --help displays the available commands. - 3. Read the documentation - Our website serves as a comprehensive source of guides and documentation: https://biomejs.dev + 3. Migrate from ESLint and Prettier + biome migrate eslint migrates your ESLint configuration to Biome. + biome migrate prettier migrates your Prettier configuration to Biome. - 4. Get involved in the community - Ask questions, get support, or contribute by participating on GitHub (https://github.com/biomejs/biome), - or join our community Discord (https://discord.gg/BypW39g6Yc) -``` + 4. Read the documentation + Find guides and documentation at https://biomejs.dev/guides/getting-started/ + 5. Get involved with the community + Ask questions and contribute on GitHub: https://github.com/biomejs/biome + Seek for help on Discord: https://discord.gg/BypW39g6Yc +``` diff --git a/crates/biome_cli/tests/snapshots/main_commands_init/creates_config_file_when_biome_installed_via_package_manager.snap b/crates/biome_cli/tests/snapshots/main_commands_init/creates_config_file_when_biome_installed_via_package_manager.snap index 24b003d0fe5f..7b874b5df1b6 100644 --- a/crates/biome_cli/tests/snapshots/main_commands_init/creates_config_file_when_biome_installed_via_package_manager.snap +++ b/crates/biome_cli/tests/snapshots/main_commands_init/creates_config_file_when_biome_installed_via_package_manager.snap @@ -31,24 +31,30 @@ expression: content Welcome to Biome! Let's get you started... -Files created ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +Files created - - biome.json: Your project configuration. Documentation: https://biomejs.dev/reference/configuration + - biome.json + Your project configuration. See https://biomejs.dev/reference/configuration -Next Steps ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +Next Steps 1. Setup an editor extension - Get live errors as you type and format when you save. Learn more: https://biomejs.dev/guides/getting-started#editor-setup + Get live errors as you type and format when you save. + Learn more at https://biomejs.dev/guides/integrate-in-editor/ 2. Try a command - biome ci checks for lint errors and verifies formatting. Run biome --help for a full list of commands and options. + biome check checks formatting, import sorting, and lint rules. + biome --help displays the available commands. - 3. Read the documentation - Our website serves as a comprehensive source of guides and documentation: https://biomejs.dev + 3. Migrate from ESLint and Prettier + biome migrate eslint migrates your ESLint configuration to Biome. + biome migrate prettier migrates your Prettier configuration to Biome. - 4. Get involved in the community - Ask questions, get support, or contribute by participating on GitHub (https://github.com/biomejs/biome), - or join our community Discord (https://discord.gg/BypW39g6Yc) -``` + 4. Read the documentation + Find guides and documentation at https://biomejs.dev/guides/getting-started/ + 5. Get involved with the community + Ask questions and contribute on GitHub: https://github.com/biomejs/biome + Seek for help on Discord: https://discord.gg/BypW39g6Yc +``` diff --git a/crates/biome_cli/tests/snapshots/main_commands_init/creates_config_jsonc_file.snap b/crates/biome_cli/tests/snapshots/main_commands_init/creates_config_jsonc_file.snap index 2fd4ae001307..0e613d0497e8 100644 --- a/crates/biome_cli/tests/snapshots/main_commands_init/creates_config_jsonc_file.snap +++ b/crates/biome_cli/tests/snapshots/main_commands_init/creates_config_jsonc_file.snap @@ -24,24 +24,30 @@ expression: content Welcome to Biome! Let's get you started... -Files created ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +Files created - - biome.jsonc: Your project configuration. Documentation: https://biomejs.dev/reference/configuration + - biome.jsonc + Your project configuration. See https://biomejs.dev/reference/configuration -Next Steps ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +Next Steps 1. Setup an editor extension - Get live errors as you type and format when you save. Learn more: https://biomejs.dev/guides/getting-started#editor-setup + Get live errors as you type and format when you save. + Learn more at https://biomejs.dev/guides/integrate-in-editor/ 2. Try a command - biome ci checks for lint errors and verifies formatting. Run biome --help for a full list of commands and options. + biome check checks formatting, import sorting, and lint rules. + biome --help displays the available commands. - 3. Read the documentation - Our website serves as a comprehensive source of guides and documentation: https://biomejs.dev + 3. Migrate from ESLint and Prettier + biome migrate eslint migrates your ESLint configuration to Biome. + biome migrate prettier migrates your Prettier configuration to Biome. - 4. Get involved in the community - Ask questions, get support, or contribute by participating on GitHub (https://github.com/biomejs/biome), - or join our community Discord (https://discord.gg/BypW39g6Yc) -``` + 4. Read the documentation + Find guides and documentation at https://biomejs.dev/guides/getting-started/ + 5. Get involved with the community + Ask questions and contribute on GitHub: https://github.com/biomejs/biome + Seek for help on Discord: https://discord.gg/BypW39g6Yc +```