fix(nodejs): Change symbol to nerd-font (#1649)
The unicode hexagon symbol does not actually fit into a single column with a fixed-width font. does. As starship requires a nerd font as a prerequisite, it's safe to assume that this symbol is available. Symbol link: https://www.nerdfonts.com/cheat-sheet?set=nf-mdi-nodejs In the documentation, I've left the '⬢' symbols in '#### Text Group' as they are, as they will continue displaying correctly in a browser without a nerd font available. I feel like readability is more important than consistency with the new nodejs symbol, especially as this documentation section does not actually refer to nodejs, rather it's just a symbol. As `⬢` has been replaced, use `⌘` instead in documentation to avoid any possible confusion
This commit is contained in:
parent
28170f62b0
commit
4d3a4f230d
|
@ -85,7 +85,7 @@ In the second part, which is enclosed in a `()`, is a [style string](#style-stri
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
- `[on](red bold)` will print a string `on` with bold text colored red.
|
- `[on](red bold)` will print a string `on` with bold text colored red.
|
||||||
- `[⬢ $version](bold green)` will print a symbol `⬢ ` followed by the content of variable `version`, with bold text colored green.
|
- `[⌘ $version](bold green)` will print a symbol `⌘ ` followed by the content of variable `version`, with bold text colored green.
|
||||||
- `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green.
|
- `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green.
|
||||||
|
|
||||||
#### Style Strings
|
#### Style Strings
|
||||||
|
@ -1814,7 +1814,7 @@ By default the module will be shown if any of the following conditions are met:
|
||||||
| Option | Default | Description |
|
| Option | Default | Description |
|
||||||
| ------------------- | ------------------------------------ | -------------------------------------------------- |
|
| ------------------- | ------------------------------------ | -------------------------------------------------- |
|
||||||
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
|
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
|
||||||
| `symbol` | `"⬢ "` | A format string representing the symbol of NodeJS. |
|
| `symbol` | `" "` | A format string representing the symbol of NodeJS. |
|
||||||
| `detect_extensions` | `["js", "mjs", "cjs", "ts"]` | Which extensions should trigger this moudle. |
|
| `detect_extensions` | `["js", "mjs", "cjs", "ts"]` | Which extensions should trigger this moudle. |
|
||||||
| `detect_files` | `["package.json", ".node-version"]` | Which filenames 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. |
|
| `detect_folders` | `["node_modules"]` | Which folders should trigger this module. |
|
||||||
|
|
|
@ -18,7 +18,7 @@ impl<'a> RootModuleConfig<'a> for NodejsConfig<'a> {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
NodejsConfig {
|
NodejsConfig {
|
||||||
format: "via [$symbol($version )]($style)",
|
format: "via [$symbol($version )]($style)",
|
||||||
symbol: "⬢ ",
|
symbol: " ",
|
||||||
style: "bold green",
|
style: "bold green",
|
||||||
disabled: false,
|
disabled: false,
|
||||||
not_capable_style: "bold red",
|
not_capable_style: "bold red",
|
||||||
|
|
|
@ -130,7 +130,7 @@ mod tests {
|
||||||
File::create(dir.path().join("package.json"))?.sync_all()?;
|
File::create(dir.path().join("package.json"))?.sync_all()?;
|
||||||
|
|
||||||
let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect();
|
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);
|
assert_eq!(expected, actual);
|
||||||
dir.close()
|
dir.close()
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ mod tests {
|
||||||
File::create(dir.path().join(".node-version"))?.sync_all()?;
|
File::create(dir.path().join(".node-version"))?.sync_all()?;
|
||||||
|
|
||||||
let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect();
|
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);
|
assert_eq!(expected, actual);
|
||||||
dir.close()
|
dir.close()
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ mod tests {
|
||||||
File::create(dir.path().join("index.js"))?.sync_all()?;
|
File::create(dir.path().join("index.js"))?.sync_all()?;
|
||||||
|
|
||||||
let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect();
|
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);
|
assert_eq!(expected, actual);
|
||||||
dir.close()
|
dir.close()
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ mod tests {
|
||||||
File::create(dir.path().join("index.mjs"))?.sync_all()?;
|
File::create(dir.path().join("index.mjs"))?.sync_all()?;
|
||||||
|
|
||||||
let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect();
|
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);
|
assert_eq!(expected, actual);
|
||||||
dir.close()
|
dir.close()
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ mod tests {
|
||||||
File::create(dir.path().join("index.cjs"))?.sync_all()?;
|
File::create(dir.path().join("index.cjs"))?.sync_all()?;
|
||||||
|
|
||||||
let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect();
|
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);
|
assert_eq!(expected, actual);
|
||||||
dir.close()
|
dir.close()
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ mod tests {
|
||||||
File::create(dir.path().join("index.ts"))?.sync_all()?;
|
File::create(dir.path().join("index.ts"))?.sync_all()?;
|
||||||
|
|
||||||
let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect();
|
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);
|
assert_eq!(expected, actual);
|
||||||
dir.close()
|
dir.close()
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ mod tests {
|
||||||
fs::create_dir_all(&node_modules)?;
|
fs::create_dir_all(&node_modules)?;
|
||||||
|
|
||||||
let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect();
|
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);
|
assert_eq!(expected, actual);
|
||||||
dir.close()
|
dir.close()
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ mod tests {
|
||||||
file.sync_all()?;
|
file.sync_all()?;
|
||||||
|
|
||||||
let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect();
|
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);
|
assert_eq!(expected, actual);
|
||||||
dir.close()
|
dir.close()
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@ mod tests {
|
||||||
file.sync_all()?;
|
file.sync_all()?;
|
||||||
|
|
||||||
let actual = ModuleRenderer::new("nodejs").path(dir.path()).collect();
|
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);
|
assert_eq!(expected, actual);
|
||||||
dir.close()
|
dir.close()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue