@repokit/core 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cargo.lock CHANGED
@@ -239,7 +239,7 @@ checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c"
239
239
 
240
240
  [[package]]
241
241
  name = "repokit"
242
- version = "3.0.1"
242
+ version = "3.0.2"
243
243
  dependencies = [
244
244
  "alphanumeric-sort",
245
245
  "colored",
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "repokit"
3
- version = "3.0.1"
3
+ version = "3.0.2"
4
4
  edition = "2024"
5
5
 
6
6
  [[bin]]
@@ -1,4 +1,4 @@
1
- CURRENT_VERSION="3.0.1"
1
+ CURRENT_VERSION="3.0.2"
2
2
  CWD=$(pwd)
3
3
 
4
4
  REPLACEMENT="/node_modules"
@@ -46,6 +46,9 @@ impl ThemeRegistry {
46
46
  }
47
47
 
48
48
  pub fn register_user_theme(&mut self, theme: &RepoKitTheme) {
49
+ if self.themes.contains_key(&theme.name) {
50
+ self.on_naming_conflict(&theme.name);
51
+ }
49
52
  self.themes
50
53
  .insert(theme.name.clone(), Theme::from_configuration(theme));
51
54
  }
@@ -99,4 +102,24 @@ impl ThemeRegistry {
99
102
  highlightColor: None,
100
103
  })
101
104
  }
105
+
106
+ fn on_naming_conflict(&self, name: &str) {
107
+ if ThemeRegistry::built_in_color_schemes()
108
+ .1
109
+ .map(|t| t.0)
110
+ .contains(&name)
111
+ {
112
+ println!(
113
+ "{}: I've discovered a theme that conflicts with one of my iternals. Please rename your {} theme",
114
+ self.current_theme().error_prefix("RepoKit"),
115
+ self.current_theme().highlight(name)
116
+ )
117
+ } else {
118
+ println!(
119
+ "{}: I've discovered two themes with the name {}. Please rename one of them",
120
+ self.current_theme().error_prefix("RepoKit"),
121
+ self.current_theme().highlight(name)
122
+ )
123
+ }
124
+ }
102
125
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@repokit/core",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "A knowledgebase for your repository - wrapped in a CLI",
5
5
  "keywords": [
6
6
  "cli",