diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d34f0111..52512893 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,9 +8,9 @@ If you have any questions that aren't addressed in this document, please don't h ## Glossary -- **Module**: A component in the prompt giving information based on contextual information from your OS. For example, the `nodejs` module shows the version of NodeJS that is currently installed on your computer, if your current directory is a NodeJS project. +- **Module**: A component in the prompt giving information based on contextual information from your OS. For example, the `rust` module shows the version of Rust that is currently installed on your computer, if your current directory is a Rust project. -- **Segment**: Smaller sub-components that compose a module. For example, the `symbol` segment in the `nodejs` module contains the character that is shown before the version number (`⬢` by default). +- **Segment**: Smaller sub-components that compose a module. For example, the `symbol` segment in the `rust` module contains the character that is shown before the version number (`🦀` by default). ## Philosophy diff --git a/docs/config/README.md b/docs/config/README.md index 3bf0ec9c..ee542c5c 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -2169,7 +2169,7 @@ By default the module will be shown if any of the following conditions are met: | ------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------- | | `format` | `"via [$symbol($version )]($style)"` | The format for the module. | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `" "` | A format string representing the symbol of Node.js. | +| `symbol` | `" "` | A format string representing the symbol of Node.js. | | `detect_extensions` | `["js", "mjs", "cjs", "ts"]` | Which extensions should trigger this module. | | `detect_files` | `["package.json", ".node-version"]` | Which filenames should trigger this module. | | `detect_folders` | `["node_modules"]` | Which folders should trigger this module. | diff --git a/docs/presets/README.md b/docs/presets/README.md index 0262fd81..ff968ca7 100644 --- a/docs/presets/README.md +++ b/docs/presets/README.md @@ -62,6 +62,9 @@ symbol = " " [nix_shell] symbol = " " +[nodejs] +symbol = " " + [package] symbol = " " diff --git a/src/configs/nodejs.rs b/src/configs/nodejs.rs index fbafc7f5..6d4a5911 100644 --- a/src/configs/nodejs.rs +++ b/src/configs/nodejs.rs @@ -21,7 +21,7 @@ impl<'a> Default for NodejsConfig<'a> { NodejsConfig { format: "via [$symbol($version )]($style)", version_format: "v${raw}", - symbol: " ", + symbol: " ", style: "bold green", disabled: false, not_capable_style: "bold red", diff --git a/src/modules/nodejs.rs b/src/modules/nodejs.rs index 85d5dcc9..cf77a8fd 100644 --- a/src/modules/nodejs.rs +++ b/src/modules/nodejs.rs @@ -139,7 +139,7 @@ mod tests { File::create(dir.path().join("package.json"))?.sync_all()?; let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect(); - let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); + let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); assert_eq!(expected, actual); dir.close() } @@ -163,7 +163,7 @@ mod tests { File::create(dir.path().join(".node-version"))?.sync_all()?; let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect(); - let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); + let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); assert_eq!(expected, actual); dir.close() } @@ -174,7 +174,7 @@ mod tests { File::create(dir.path().join(".nvmrc"))?.sync_all()?; let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect(); - let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); + let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); assert_eq!(expected, actual); dir.close() } @@ -185,7 +185,7 @@ mod tests { File::create(dir.path().join("index.js"))?.sync_all()?; let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect(); - let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); + let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); assert_eq!(expected, actual); dir.close() } @@ -196,7 +196,7 @@ mod tests { File::create(dir.path().join("index.mjs"))?.sync_all()?; let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect(); - let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); + let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); assert_eq!(expected, actual); dir.close() } @@ -207,7 +207,7 @@ mod tests { File::create(dir.path().join("index.cjs"))?.sync_all()?; let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect(); - let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); + let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); assert_eq!(expected, actual); dir.close() } @@ -218,7 +218,7 @@ mod tests { File::create(dir.path().join("index.ts"))?.sync_all()?; let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect(); - let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); + let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); assert_eq!(expected, actual); dir.close() } @@ -230,7 +230,7 @@ mod tests { fs::create_dir_all(&node_modules)?; let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect(); - let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); + let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); assert_eq!(expected, actual); dir.close() } @@ -249,7 +249,7 @@ mod tests { file.sync_all()?; let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect(); - let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); + let expected = Some(format!("via {}", Color::Green.bold().paint(" v12.0.0 "))); assert_eq!(expected, actual); dir.close() } @@ -268,7 +268,7 @@ mod tests { file.sync_all()?; let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect(); - let expected = Some(format!("via {}", Color::Red.bold().paint(" v12.0.0 "))); + let expected = Some(format!("via {}", Color::Red.bold().paint(" v12.0.0 "))); assert_eq!(expected, actual); dir.close() }