Skip to content

Commit 7218fe1

Browse files
committed
refactor(themes): rename themes to creative names
Rename product-specific themes to creative, generic names while preserving exact RGB color values: - coana → sunset (azure blue [100, 200, 255]) - socket-firewall → brick (ember orange [255, 100, 50]) - socket-cli-python → jungle (steel blue [70, 130, 180])
1 parent 061b00d commit 7218fe1

4 files changed

Lines changed: 50 additions & 45 deletions

File tree

src/themes/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* import { setTheme, THEMES } from '@socketsecurity/lib/themes'
88
*
99
* // Set global theme
10-
* setTheme('socket-firewall')
10+
* setTheme('brick')
1111
* ```
1212
*
1313
* @example
@@ -55,10 +55,10 @@ export type {
5555

5656
// Curated themes
5757
export {
58-
COANA_THEME,
59-
FIREWALL_THEME,
60-
PYTHON_THEME,
58+
BRICK_THEME,
59+
JUNGLE_THEME,
6160
SOCKET_THEME,
61+
SUNSET_THEME,
6262
THEMES,
6363
ULTRA_THEME,
6464
type ThemeName,

src/themes/themes.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ export const SOCKET_THEME: Theme = {
4747
}
4848

4949
/**
50-
* CoanaAnalytical intelligence.
51-
* Crisp azure tones for precision and clarity in code analysis.
50+
* SunsetCrisp azure.
51+
* Clean analytical theme with precise blue tones.
5252
*/
53-
export const COANA_THEME: Theme = {
54-
name: 'coana',
55-
displayName: 'Coana',
53+
export const SUNSET_THEME: Theme = {
54+
name: 'sunset',
55+
displayName: 'Sunset',
5656
colors: {
5757
primary: [100, 200, 255],
5858
secondary: [50, 150, 200],
@@ -73,18 +73,18 @@ export const COANA_THEME: Theme = {
7373
},
7474
},
7575
meta: {
76-
description: 'Analytical theme with crisp azure for precision',
76+
description: 'Crisp azure theme for precision and clarity',
7777
version: '1.0.0',
7878
},
7979
}
8080

8181
/**
82-
* Socket Firewall — Vigilant protection.
83-
* Warm ember tones balanced with cool accents for security with confidence.
82+
* Brick — Solid warmth.
83+
* Rich terracotta and ember tones for grounded confidence.
8484
*/
85-
export const FIREWALL_THEME: Theme = {
86-
name: 'socket-firewall',
87-
displayName: 'Socket Firewall',
85+
export const BRICK_THEME: Theme = {
86+
name: 'brick',
87+
displayName: 'Brick',
8888
colors: {
8989
primary: [255, 100, 50],
9090
secondary: [255, 150, 100],
@@ -111,18 +111,18 @@ export const FIREWALL_THEME: Theme = {
111111
},
112112
},
113113
meta: {
114-
description: 'Protective theme with warm ember and balanced contrast',
114+
description: 'Solid theme with rich terracotta and ember warmth',
115115
version: '1.0.0',
116116
},
117117
}
118118

119119
/**
120-
* Socket Python — Elegant simplicity.
121-
* Steel blue with golden accents, embodying Python's philosophy of clarity.
120+
* Jungle — Steel elegance.
121+
* Python-inspired steel blue with golden accents.
122122
*/
123-
export const PYTHON_THEME: Theme = {
124-
name: 'socket-cli-python',
125-
displayName: 'Socket Python',
123+
export const JUNGLE_THEME: Theme = {
124+
name: 'jungle',
125+
displayName: 'Jungle',
126126
colors: {
127127
primary: [70, 130, 180],
128128
secondary: [255, 215, 0],
@@ -143,7 +143,7 @@ export const PYTHON_THEME: Theme = {
143143
},
144144
},
145145
meta: {
146-
description: 'Python-inspired theme with steel blue and golden harmony',
146+
description: 'Elegant theme with steel blue and golden harmony',
147147
version: '1.0.0',
148148
},
149149
}
@@ -191,9 +191,9 @@ export const ULTRA_THEME: Theme = {
191191
export const THEMES = {
192192
__proto__: null,
193193
socket: SOCKET_THEME,
194-
coana: COANA_THEME,
195-
'socket-firewall': FIREWALL_THEME,
196-
'socket-cli-python': PYTHON_THEME,
194+
sunset: SUNSET_THEME,
195+
brick: BRICK_THEME,
196+
jungle: JUNGLE_THEME,
197197
ultra: ULTRA_THEME,
198198
} as const
199199

test/logger.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('LOG_SYMBOLS', () => {
3737
expect(initialSuccess).toBeTruthy()
3838

3939
// Change theme
40-
setTheme(THEMES.coana)
40+
setTheme(THEMES.sunset)
4141

4242
// Symbols should update
4343
const updatedSuccess = LOG_SYMBOLS.success

test/themes.test.ts

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,20 @@ import {
1313
withTheme,
1414
withThemeSync,
1515
} from '@socketsecurity/lib/themes'
16-
import { describe, expect, it } from 'vitest'
16+
import { afterEach, describe, expect, it } from 'vitest'
1717

1818
describe('themes', () => {
19+
// Reset theme to default after each test to ensure isolation
20+
afterEach(() => {
21+
setTheme('socket')
22+
})
23+
1924
describe('THEMES', () => {
2025
it('should have all default themes', () => {
2126
expect(THEMES).toHaveProperty('socket')
22-
expect(THEMES).toHaveProperty('coana')
23-
expect(THEMES).toHaveProperty('socket-firewall')
24-
expect(THEMES).toHaveProperty('socket-cli-python')
27+
expect(THEMES).toHaveProperty('sunset')
28+
expect(THEMES).toHaveProperty('brick')
29+
expect(THEMES).toHaveProperty('jungle')
2530
expect(THEMES).toHaveProperty('ultra')
2631
})
2732

@@ -39,13 +44,13 @@ describe('themes', () => {
3944

4045
describe('setTheme / getTheme', () => {
4146
it('should set and get theme', () => {
42-
setTheme('coana')
43-
expect(getTheme().name).toBe('coana')
47+
setTheme('sunset')
48+
expect(getTheme().name).toBe('sunset')
4449
})
4550

4651
it('should set theme by object', () => {
47-
setTheme(THEMES['socket-firewall'])
48-
expect(getTheme().name).toBe('socket-firewall')
52+
setTheme(THEMES['brick'])
53+
expect(getTheme().name).toBe('brick')
4954
})
5055

5156
it('should default to socket theme', () => {
@@ -55,8 +60,8 @@ describe('themes', () => {
5560

5661
describe('withTheme', () => {
5762
it('should apply theme for async operation', async () => {
58-
const result = await withTheme('coana', async () => {
59-
expect(getTheme().name).toBe('coana')
63+
const result = await withTheme('sunset', async () => {
64+
expect(getTheme().name).toBe('sunset')
6065
return 42
6166
})
6267

@@ -67,7 +72,7 @@ describe('themes', () => {
6772

6873
it('should restore theme even if operation throws', async () => {
6974
await expect(
70-
withTheme('coana', async () => {
75+
withTheme('sunset', async () => {
7176
throw new Error('test error')
7277
}),
7378
).rejects.toThrow('test error')
@@ -76,23 +81,23 @@ describe('themes', () => {
7681
})
7782

7883
it('should isolate themes in nested async contexts', async () => {
79-
await withTheme('coana', async () => {
80-
expect(getTheme().name).toBe('coana')
84+
await withTheme('sunset', async () => {
85+
expect(getTheme().name).toBe('sunset')
8186

8287
await withTheme('ultra', async () => {
8388
expect(getTheme().name).toBe('ultra')
8489
})
8590

8691
// Theme automatically restored by AsyncLocalStorage
87-
expect(getTheme().name).toBe('coana')
92+
expect(getTheme().name).toBe('sunset')
8893
})
8994
})
9095
})
9196

9297
describe('withThemeSync', () => {
9398
it('should apply theme for sync operation', () => {
94-
const result = withThemeSync('coana', () => {
95-
expect(getTheme().name).toBe('coana')
99+
const result = withThemeSync('sunset', () => {
100+
expect(getTheme().name).toBe('sunset')
96101
return 42
97102
})
98103

@@ -103,7 +108,7 @@ describe('themes', () => {
103108

104109
it('should restore theme even if operation throws', () => {
105110
expect(() => {
106-
withThemeSync('coana', () => {
111+
withThemeSync('sunset', () => {
107112
throw new Error('test error')
108113
})
109114
}).toThrow('test error')
@@ -119,7 +124,7 @@ describe('themes', () => {
119124
})
120125

121126
it('should resolve secondary color reference', () => {
122-
const resolved = resolveColor('secondary', THEMES.coana.colors)
127+
const resolved = resolveColor('secondary', THEMES.sunset.colors)
123128
expect(resolved).toEqual([50, 150, 200])
124129
})
125130

@@ -154,7 +159,7 @@ describe('themes', () => {
154159
})
155160

156161
expect(extended.colors.primary).toEqual([255, 100, 200])
157-
expect(extended.colors.success).toBe('green') // Preserved
162+
expect(extended.colors.success).toBe('greenBright') // Preserved
158163
})
159164

160165
it('should extend theme with new name', () => {

0 commit comments

Comments
 (0)