-
Notifications
You must be signed in to change notification settings - Fork 189
Expand file tree
/
Copy pathgitmoji.ts
More file actions
43 lines (37 loc) Β· 1.85 KB
/
Copy pathgitmoji.ts
File metadata and controls
43 lines (37 loc) Β· 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Canonical gitmoji prefix convention. Must stay in sync with docs/DEVELOPMENT.md.
// The order within each category is the priority used by the changelog generator.
export type GitmojiCategory = 'public' | 'internal'
export interface Gitmoji {
emoji: string
label: string
category: GitmojiCategory
}
export const GITMOJI: readonly Gitmoji[] = [
// User-facing changes
{ emoji: 'π₯', label: 'Breaking change', category: 'public' },
{ emoji: 'β¨', label: 'New feature', category: 'public' },
{ emoji: 'π', label: 'Bug fix', category: 'public' },
{ emoji: 'β‘οΈ', label: 'Performance', category: 'public' },
{ emoji: 'π', label: 'Documentation', category: 'public' },
{ emoji: 'βοΈ', label: 'Experimental', category: 'public' },
// Internal changes
{ emoji: 'π·', label: 'Build/CI', category: 'internal' },
{ emoji: 'β»οΈ', label: 'Refactor', category: 'internal' },
{ emoji: 'π¨', label: 'Code structure', category: 'internal' },
{ emoji: 'β
', label: 'Tests', category: 'internal' },
{ emoji: 'π§', label: 'Configuration', category: 'internal' },
{ emoji: 'π₯', label: 'Removal', category: 'internal' },
{ emoji: 'π', label: 'Code review', category: 'internal' },
{ emoji: 'π¨', label: 'Linting', category: 'internal' },
{ emoji: 'π§Ή', label: 'Cleanup', category: 'internal' },
{ emoji: 'π', label: 'Logging', category: 'internal' },
]
// Strip the Unicode variation selector (U+FE0F) so 'β‘' and 'β‘οΈ' compare equal.
const VARIATION_SELECTOR = /οΈ/g
export const normalizeGitmoji = (value: string): string => value.replace(VARIATION_SELECTOR, '')
export const PUBLIC_EMOJI_PRIORITY: readonly string[] = GITMOJI.filter((g) => g.category === 'public').map(
(g) => g.emoji
)
export const INTERNAL_EMOJI_PRIORITY: readonly string[] = GITMOJI.filter((g) => g.category === 'internal').map(
(g) => g.emoji
)