@hugeicons/migrate-core 0.1.0
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/dist/constants.d.ts +40 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +117 -0
- package/dist/constants.js.map +1 -0
- package/dist/data/hugeicons-map.json +41786 -0
- package/dist/data/mappings.d.ts +69 -0
- package/dist/data/mappings.d.ts.map +1 -0
- package/dist/data/mappings.js +402 -0
- package/dist/data/mappings.js.map +1 -0
- package/dist/engine/analyzer.d.ts +21 -0
- package/dist/engine/analyzer.d.ts.map +1 -0
- package/dist/engine/analyzer.js +374 -0
- package/dist/engine/analyzer.js.map +1 -0
- package/dist/engine/detector.d.ts +20 -0
- package/dist/engine/detector.d.ts.map +1 -0
- package/dist/engine/detector.js +124 -0
- package/dist/engine/detector.js.map +1 -0
- package/dist/engine/mapper.d.ts +31 -0
- package/dist/engine/mapper.d.ts.map +1 -0
- package/dist/engine/mapper.js +234 -0
- package/dist/engine/mapper.js.map +1 -0
- package/dist/engine/reporter.d.ts +11 -0
- package/dist/engine/reporter.d.ts.map +1 -0
- package/dist/engine/reporter.js +339 -0
- package/dist/engine/reporter.js.map +1 -0
- package/dist/engine/transformer.d.ts +26 -0
- package/dist/engine/transformer.d.ts.map +1 -0
- package/dist/engine/transformer.js +874 -0
- package/dist/engine/transformer.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +292 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +14 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon Mappings Data
|
|
3
|
+
* Contains exact and alias mappings from source libraries to Hugeicons
|
|
4
|
+
*
|
|
5
|
+
* Uses auto-generated hugeicons-map.json for accurate mappings
|
|
6
|
+
*/
|
|
7
|
+
interface IconEntry {
|
|
8
|
+
name: string;
|
|
9
|
+
source: string;
|
|
10
|
+
aliases: string[];
|
|
11
|
+
lucideAliases: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Check if a Lucide icon name exists as an alias in Hugeicons
|
|
15
|
+
* Returns the alias name if it exists, otherwise undefined
|
|
16
|
+
*/
|
|
17
|
+
export declare function getLucideAliasIfExists(iconName: string): string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Get exact mapping for a library and icon
|
|
20
|
+
* For Lucide icons, prefers keeping the original name if it exists as an alias
|
|
21
|
+
*/
|
|
22
|
+
export declare function getExactMapping(library: string, iconName: string): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Get alias mapping for a library and icon
|
|
25
|
+
*/
|
|
26
|
+
export declare function getAliasMapping(library: string, iconName: string): string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Get all Hugeicon names for fuzzy matching
|
|
29
|
+
*/
|
|
30
|
+
export declare function getAllHugeIconNames(): string[];
|
|
31
|
+
/**
|
|
32
|
+
* Check if an icon exists in Hugeicons
|
|
33
|
+
*/
|
|
34
|
+
export declare function hugeIconExists(iconName: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Get the canonical (primary) name for a Hugeicon
|
|
37
|
+
* This resolves aliases to their primary icon name
|
|
38
|
+
*/
|
|
39
|
+
export declare function getCanonicalIconName(iconName: string): string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Get all mappings for a library
|
|
42
|
+
*/
|
|
43
|
+
export declare function getLibraryMappings(library: string): {
|
|
44
|
+
exact: Record<string, string>;
|
|
45
|
+
aliases: Record<string, string>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Get the Lucide mapping dictionary
|
|
49
|
+
*/
|
|
50
|
+
export declare function getLucideMap(): Record<string, string>;
|
|
51
|
+
/**
|
|
52
|
+
* Get icon details including aliases
|
|
53
|
+
*/
|
|
54
|
+
export declare function getIconDetails(iconName: string): IconEntry | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Search for icons by partial name (for fuzzy matching fallback)
|
|
57
|
+
*/
|
|
58
|
+
export declare function searchIconsByKeyword(keyword: string): string[];
|
|
59
|
+
/**
|
|
60
|
+
* Get statistics about the icon map
|
|
61
|
+
*/
|
|
62
|
+
export declare function getMapStats(): {
|
|
63
|
+
totalIcons: number;
|
|
64
|
+
totalAliases: number;
|
|
65
|
+
lucideMappings: number;
|
|
66
|
+
generated: string;
|
|
67
|
+
};
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=mappings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mappings.d.ts","sourceRoot":"","sources":["../../src/data/mappings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AA8PD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA4B3E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA4BrF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAcrF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAE9C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOzE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM;WAhJF,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;aAAW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;EAkJtG;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAErD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAatE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAuB9D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAOrH"}
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon Mappings Data
|
|
3
|
+
* Contains exact and alias mappings from source libraries to Hugeicons
|
|
4
|
+
*
|
|
5
|
+
* Uses auto-generated hugeicons-map.json for accurate mappings
|
|
6
|
+
*/
|
|
7
|
+
import { readFileSync } from 'node:fs';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { dirname, join } from 'node:path';
|
|
10
|
+
// Load the JSON file
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = dirname(__filename);
|
|
13
|
+
const mapPath = join(__dirname, 'hugeicons-map.json');
|
|
14
|
+
let ICON_MAP;
|
|
15
|
+
try {
|
|
16
|
+
const content = readFileSync(mapPath, 'utf-8');
|
|
17
|
+
ICON_MAP = JSON.parse(content);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// Fallback if JSON not found (during build or development)
|
|
21
|
+
ICON_MAP = {
|
|
22
|
+
generated: new Date().toISOString(),
|
|
23
|
+
totalIcons: 0,
|
|
24
|
+
totalAliases: 0,
|
|
25
|
+
icons: {},
|
|
26
|
+
aliasMap: {},
|
|
27
|
+
lucideMap: {},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
// ============================================================================
|
|
31
|
+
// FontAwesome Mappings (manual - these icons have different naming conventions)
|
|
32
|
+
// ============================================================================
|
|
33
|
+
const FONTAWESOME_MAPPINGS = {
|
|
34
|
+
// Solid icons (fa- prefix style)
|
|
35
|
+
'faArrowDown': 'ArrowDown01Icon',
|
|
36
|
+
'faArrowLeft': 'ArrowLeft01Icon',
|
|
37
|
+
'faArrowRight': 'ArrowRight01Icon',
|
|
38
|
+
'faArrowUp': 'ArrowUp01Icon',
|
|
39
|
+
'faBell': 'Notification01Icon',
|
|
40
|
+
'faBolt': 'FlashOnIcon',
|
|
41
|
+
'faBookmark': 'Bookmark01Icon',
|
|
42
|
+
'faCalendar': 'Calendar01Icon',
|
|
43
|
+
'faCalendarAlt': 'Calendar01Icon',
|
|
44
|
+
'faCamera': 'Camera01Icon',
|
|
45
|
+
'faCheck': 'Tick01Icon',
|
|
46
|
+
'faCheckCircle': 'CheckmarkCircle01Icon',
|
|
47
|
+
'faChevronDown': 'ArrowDown01Icon',
|
|
48
|
+
'faChevronLeft': 'ArrowLeft01Icon',
|
|
49
|
+
'faChevronRight': 'ArrowRight01Icon',
|
|
50
|
+
'faChevronUp': 'ArrowUp01Icon',
|
|
51
|
+
'faCircle': 'CircleIcon',
|
|
52
|
+
'faClock': 'Clock01Icon',
|
|
53
|
+
'faCloud': 'Cloud01Icon',
|
|
54
|
+
'faCog': 'Settings01Icon',
|
|
55
|
+
'faCogs': 'Settings01Icon',
|
|
56
|
+
'faComment': 'Comment01Icon',
|
|
57
|
+
'faComments': 'Comment01Icon',
|
|
58
|
+
'faCopy': 'Copy01Icon',
|
|
59
|
+
'faCreditCard': 'CreditCardIcon',
|
|
60
|
+
'faDownload': 'Download01Icon',
|
|
61
|
+
'faEdit': 'Edit01Icon',
|
|
62
|
+
'faEnvelope': 'Mail01Icon',
|
|
63
|
+
'faExclamation': 'AlertCircleIcon',
|
|
64
|
+
'faExclamationCircle': 'AlertCircleIcon',
|
|
65
|
+
'faExclamationTriangle': 'AlertTriangleIcon',
|
|
66
|
+
'faExternalLink': 'LinkSquare01Icon',
|
|
67
|
+
'faExternalLinkAlt': 'LinkSquare01Icon',
|
|
68
|
+
'faEye': 'View01Icon',
|
|
69
|
+
'faEyeSlash': 'ViewOffIcon',
|
|
70
|
+
'faFile': 'File01Icon',
|
|
71
|
+
'faFileAlt': 'FileAttachmentIcon',
|
|
72
|
+
'faFilter': 'Filter01Icon',
|
|
73
|
+
'faFolder': 'Folder01Icon',
|
|
74
|
+
'faFolderOpen': 'FolderOpenIcon',
|
|
75
|
+
'faGlobe': 'GlobeIcon',
|
|
76
|
+
'faHeart': 'Favourite01Icon',
|
|
77
|
+
'faHome': 'Home01Icon',
|
|
78
|
+
'faImage': 'Image01Icon',
|
|
79
|
+
'faInfo': 'InformationCircleIcon',
|
|
80
|
+
'faInfoCircle': 'InformationCircleIcon',
|
|
81
|
+
'faLink': 'Link01Icon',
|
|
82
|
+
'faList': 'ListIcon',
|
|
83
|
+
'faLock': 'SquareLock01Icon',
|
|
84
|
+
'faMapMarker': 'Location01Icon',
|
|
85
|
+
'faMapMarkerAlt': 'Location01Icon',
|
|
86
|
+
'faMinus': 'MinusSign01Icon',
|
|
87
|
+
'faMoon': 'Moon01Icon',
|
|
88
|
+
'faPause': 'PauseIcon',
|
|
89
|
+
'faPen': 'Edit01Icon',
|
|
90
|
+
'faPhone': 'Call01Icon',
|
|
91
|
+
'faPlay': 'Play01Icon',
|
|
92
|
+
'faPlus': 'Add01Icon',
|
|
93
|
+
'faPrint': 'Printer01Icon',
|
|
94
|
+
'faQuestion': 'HelpCircleIcon',
|
|
95
|
+
'faQuestionCircle': 'HelpCircleIcon',
|
|
96
|
+
'faRefresh': 'Refresh01Icon',
|
|
97
|
+
'faSearch': 'Search01Icon',
|
|
98
|
+
'faShare': 'Share01Icon',
|
|
99
|
+
'faShield': 'ShieldIcon',
|
|
100
|
+
'faShoppingBag': 'ShoppingBag01Icon',
|
|
101
|
+
'faShoppingCart': 'ShoppingCart01Icon',
|
|
102
|
+
'faSignIn': 'Login01Icon',
|
|
103
|
+
'faSignInAlt': 'Login01Icon',
|
|
104
|
+
'faSignOut': 'Logout01Icon',
|
|
105
|
+
'faSignOutAlt': 'Logout01Icon',
|
|
106
|
+
'faStar': 'Star01Icon',
|
|
107
|
+
'faStop': 'Stop01Icon',
|
|
108
|
+
'faSun': 'Sun01Icon',
|
|
109
|
+
'faTag': 'Tag01Icon',
|
|
110
|
+
'faTags': 'Tag01Icon',
|
|
111
|
+
'faTimes': 'Cancel01Icon',
|
|
112
|
+
'faTimesCircle': 'CancelCircleIcon',
|
|
113
|
+
'faTrash': 'Delete01Icon',
|
|
114
|
+
'faTrashAlt': 'Delete02Icon',
|
|
115
|
+
'faUnlock': 'SquareUnlock01Icon',
|
|
116
|
+
'faUpload': 'Upload01Icon',
|
|
117
|
+
'faUser': 'User01Icon',
|
|
118
|
+
'faUserPlus': 'UserAdd01Icon',
|
|
119
|
+
'faUsers': 'UserGroup01Icon',
|
|
120
|
+
'faVideo': 'Video01Icon',
|
|
121
|
+
'faVolumeUp': 'Volume01Icon',
|
|
122
|
+
'faVolumeMute': 'VolumeMute01Icon',
|
|
123
|
+
'faWifi': 'Wifi01Icon',
|
|
124
|
+
'faXmark': 'Cancel01Icon',
|
|
125
|
+
'faGear': 'Settings01Icon',
|
|
126
|
+
'faGears': 'Settings01Icon',
|
|
127
|
+
'faBars': 'Menu01Icon',
|
|
128
|
+
'faNavicon': 'Menu01Icon',
|
|
129
|
+
'faRemove': 'Cancel01Icon',
|
|
130
|
+
'faCircleInfo': 'InformationCircleIcon',
|
|
131
|
+
'faCircleQuestion': 'HelpCircleIcon',
|
|
132
|
+
'faCircleCheck': 'CheckmarkCircle01Icon',
|
|
133
|
+
'faCircleXmark': 'CancelCircleIcon',
|
|
134
|
+
'faCirclePlus': 'AddCircleIcon',
|
|
135
|
+
'faCircleMinus': 'MinusSignCircleIcon',
|
|
136
|
+
'faRightFromBracket': 'Logout01Icon',
|
|
137
|
+
'faRightToBracket': 'Login01Icon',
|
|
138
|
+
'faArrowRightFromBracket': 'Logout01Icon',
|
|
139
|
+
'faArrowRightToBracket': 'Login01Icon',
|
|
140
|
+
'faMagnifyingGlass': 'Search01Icon',
|
|
141
|
+
'faHouse': 'Home01Icon',
|
|
142
|
+
'faFloppyDisk': 'Save01Icon',
|
|
143
|
+
'faPenToSquare': 'Edit01Icon',
|
|
144
|
+
'faTrashCan': 'Delete01Icon',
|
|
145
|
+
'faRotate': 'Refresh01Icon',
|
|
146
|
+
'faRotateRight': 'Refresh01Icon',
|
|
147
|
+
'faRotateLeft': 'Undo01Icon',
|
|
148
|
+
};
|
|
149
|
+
// ============================================================================
|
|
150
|
+
// Heroicons Mappings
|
|
151
|
+
// ============================================================================
|
|
152
|
+
const HEROICONS_MAPPINGS = {
|
|
153
|
+
'AcademicCapIcon': 'GraduationCapIcon',
|
|
154
|
+
'ArrowDownIcon': 'ArrowDown01Icon',
|
|
155
|
+
'ArrowLeftIcon': 'ArrowLeft01Icon',
|
|
156
|
+
'ArrowRightIcon': 'ArrowRight01Icon',
|
|
157
|
+
'ArrowUpIcon': 'ArrowUp01Icon',
|
|
158
|
+
'BellIcon': 'Notification01Icon',
|
|
159
|
+
'BookmarkIcon': 'Bookmark01Icon',
|
|
160
|
+
'CalendarIcon': 'Calendar01Icon',
|
|
161
|
+
'CameraIcon': 'Camera01Icon',
|
|
162
|
+
'ChartBarIcon': 'BarChart01Icon',
|
|
163
|
+
'ChatBubbleLeftIcon': 'Message01Icon',
|
|
164
|
+
'CheckIcon': 'Tick01Icon',
|
|
165
|
+
'CheckCircleIcon': 'CheckmarkCircle01Icon',
|
|
166
|
+
'ChevronDownIcon': 'ArrowDown01Icon',
|
|
167
|
+
'ChevronLeftIcon': 'ArrowLeft01Icon',
|
|
168
|
+
'ChevronRightIcon': 'ArrowRight01Icon',
|
|
169
|
+
'ChevronUpIcon': 'ArrowUp01Icon',
|
|
170
|
+
'ClipboardIcon': 'ClipboardIcon',
|
|
171
|
+
'ClockIcon': 'Clock01Icon',
|
|
172
|
+
'CloudIcon': 'Cloud01Icon',
|
|
173
|
+
'Cog6ToothIcon': 'Settings01Icon',
|
|
174
|
+
'CogIcon': 'Settings01Icon',
|
|
175
|
+
'CreditCardIcon': 'CreditCardIcon',
|
|
176
|
+
'DocumentIcon': 'File01Icon',
|
|
177
|
+
'EnvelopeIcon': 'Mail01Icon',
|
|
178
|
+
'ExclamationCircleIcon': 'AlertCircleIcon',
|
|
179
|
+
'ExclamationTriangleIcon': 'AlertTriangleIcon',
|
|
180
|
+
'EyeIcon': 'View01Icon',
|
|
181
|
+
'EyeSlashIcon': 'ViewOffIcon',
|
|
182
|
+
'FolderIcon': 'Folder01Icon',
|
|
183
|
+
'GlobeAltIcon': 'GlobeIcon',
|
|
184
|
+
'HeartIcon': 'Favourite01Icon',
|
|
185
|
+
'HomeIcon': 'Home01Icon',
|
|
186
|
+
'InformationCircleIcon': 'InformationCircleIcon',
|
|
187
|
+
'LinkIcon': 'Link01Icon',
|
|
188
|
+
'LockClosedIcon': 'SquareLock01Icon',
|
|
189
|
+
'LockOpenIcon': 'SquareUnlock01Icon',
|
|
190
|
+
'MagnifyingGlassIcon': 'Search01Icon',
|
|
191
|
+
'MapPinIcon': 'Location01Icon',
|
|
192
|
+
'MinusIcon': 'MinusSign01Icon',
|
|
193
|
+
'MoonIcon': 'Moon01Icon',
|
|
194
|
+
'PencilIcon': 'Pencil01Icon',
|
|
195
|
+
'PhoneIcon': 'Call01Icon',
|
|
196
|
+
'PhotoIcon': 'Image01Icon',
|
|
197
|
+
'PlayIcon': 'Play01Icon',
|
|
198
|
+
'PlusIcon': 'Add01Icon',
|
|
199
|
+
'QuestionMarkCircleIcon': 'HelpCircleIcon',
|
|
200
|
+
'ShoppingBagIcon': 'ShoppingBag01Icon',
|
|
201
|
+
'ShoppingCartIcon': 'ShoppingCart01Icon',
|
|
202
|
+
'StarIcon': 'Star01Icon',
|
|
203
|
+
'SunIcon': 'Sun01Icon',
|
|
204
|
+
'TrashIcon': 'Delete01Icon',
|
|
205
|
+
'UserIcon': 'User01Icon',
|
|
206
|
+
'UserGroupIcon': 'UserGroup01Icon',
|
|
207
|
+
'UserPlusIcon': 'UserAdd01Icon',
|
|
208
|
+
'XMarkIcon': 'Cancel01Icon',
|
|
209
|
+
'XCircleIcon': 'CancelCircleIcon',
|
|
210
|
+
'Bars3Icon': 'Menu01Icon',
|
|
211
|
+
'Bars4Icon': 'Menu01Icon',
|
|
212
|
+
};
|
|
213
|
+
// ============================================================================
|
|
214
|
+
// Combined Mappings Interface
|
|
215
|
+
// ============================================================================
|
|
216
|
+
/**
|
|
217
|
+
* Library-specific mappings that override or supplement the JSON map
|
|
218
|
+
*/
|
|
219
|
+
const LIBRARY_MAPPINGS = {
|
|
220
|
+
'@fortawesome/fontawesome-svg-core': {
|
|
221
|
+
exact: FONTAWESOME_MAPPINGS,
|
|
222
|
+
aliases: {},
|
|
223
|
+
},
|
|
224
|
+
'@fortawesome/free-solid-svg-icons': {
|
|
225
|
+
exact: FONTAWESOME_MAPPINGS,
|
|
226
|
+
aliases: {},
|
|
227
|
+
},
|
|
228
|
+
'@fortawesome/react-fontawesome': {
|
|
229
|
+
exact: FONTAWESOME_MAPPINGS,
|
|
230
|
+
aliases: {},
|
|
231
|
+
},
|
|
232
|
+
'@heroicons/react': {
|
|
233
|
+
exact: HEROICONS_MAPPINGS,
|
|
234
|
+
aliases: {},
|
|
235
|
+
},
|
|
236
|
+
'heroicons': {
|
|
237
|
+
exact: HEROICONS_MAPPINGS,
|
|
238
|
+
aliases: {},
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
// ============================================================================
|
|
242
|
+
// Public API
|
|
243
|
+
// ============================================================================
|
|
244
|
+
/**
|
|
245
|
+
* Check if a Lucide icon name exists as an alias in Hugeicons
|
|
246
|
+
* Returns the alias name if it exists, otherwise undefined
|
|
247
|
+
*/
|
|
248
|
+
export function getLucideAliasIfExists(iconName) {
|
|
249
|
+
// Check if the icon name exists as a DIRECT alias in Hugeicons
|
|
250
|
+
// A "direct alias" means the Hugeicons name is essentially the same
|
|
251
|
+
// e.g., "Home" -> "HomeIcon", "Sun" -> "SunIcon"
|
|
252
|
+
// NOT "CircleQuestionMark" -> "HelpCircleIcon" (different name)
|
|
253
|
+
const withoutIcon = iconName.replace(/Icon$/, '');
|
|
254
|
+
// Check what the name maps to
|
|
255
|
+
const mappedName = ICON_MAP.aliasMap[withoutIcon] || ICON_MAP.aliasMap[iconName];
|
|
256
|
+
if (!mappedName) {
|
|
257
|
+
return undefined;
|
|
258
|
+
}
|
|
259
|
+
// Check if this is a DIRECT alias (mapped name matches input pattern)
|
|
260
|
+
// e.g., "Home" -> "HomeIcon" or "Home01Icon" (same base name)
|
|
261
|
+
const mappedBase = mappedName.replace(/Icon$/, '').replace(/\d+$/, '');
|
|
262
|
+
const inputBase = withoutIcon.replace(/\d+$/, '');
|
|
263
|
+
if (mappedBase.toLowerCase() === inputBase.toLowerCase()) {
|
|
264
|
+
// It's a direct alias, return the icon name that exists in Hugeicons
|
|
265
|
+
// We need to use the MAPPED name (e.g., "HomeIcon" or "Home01Icon"), not the input
|
|
266
|
+
return mappedName;
|
|
267
|
+
}
|
|
268
|
+
// Not a direct alias - different icon names
|
|
269
|
+
return undefined;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Get exact mapping for a library and icon
|
|
273
|
+
* For Lucide icons, prefers keeping the original name if it exists as an alias
|
|
274
|
+
*/
|
|
275
|
+
export function getExactMapping(library, iconName) {
|
|
276
|
+
// Check library-specific mappings first
|
|
277
|
+
const libraryMappings = LIBRARY_MAPPINGS[library];
|
|
278
|
+
if (libraryMappings?.exact[iconName]) {
|
|
279
|
+
return libraryMappings.exact[iconName];
|
|
280
|
+
}
|
|
281
|
+
// For lucide-react and similar
|
|
282
|
+
if (library === 'lucide-react' || library === 'lucide') {
|
|
283
|
+
// Check if this Lucide name is a direct alias (e.g., "Home" -> "HomeIcon")
|
|
284
|
+
const directAlias = getLucideAliasIfExists(iconName);
|
|
285
|
+
if (directAlias) {
|
|
286
|
+
return directAlias;
|
|
287
|
+
}
|
|
288
|
+
// Otherwise use lucideMap for renamed icons
|
|
289
|
+
const mapped = ICON_MAP.lucideMap[iconName];
|
|
290
|
+
if (mapped)
|
|
291
|
+
return mapped;
|
|
292
|
+
// Try with/without Icon suffix
|
|
293
|
+
const withoutIcon = iconName.replace(/Icon$/, '');
|
|
294
|
+
const withIcon = iconName.endsWith('Icon') ? iconName : `${iconName}Icon`;
|
|
295
|
+
return ICON_MAP.lucideMap[withoutIcon] || ICON_MAP.lucideMap[withIcon];
|
|
296
|
+
}
|
|
297
|
+
// Fallback: try aliasMap for any library
|
|
298
|
+
return ICON_MAP.aliasMap[iconName];
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Get alias mapping for a library and icon
|
|
302
|
+
*/
|
|
303
|
+
export function getAliasMapping(library, iconName) {
|
|
304
|
+
// Check library-specific aliases
|
|
305
|
+
const libraryMappings = LIBRARY_MAPPINGS[library];
|
|
306
|
+
if (libraryMappings?.aliases[iconName]) {
|
|
307
|
+
return libraryMappings.aliases[iconName];
|
|
308
|
+
}
|
|
309
|
+
// Try the generated aliasMap
|
|
310
|
+
const mapped = ICON_MAP.aliasMap[iconName];
|
|
311
|
+
if (mapped)
|
|
312
|
+
return mapped;
|
|
313
|
+
// Try without Icon suffix for lucide-style names
|
|
314
|
+
const withoutIcon = iconName.replace(/Icon$/, '');
|
|
315
|
+
return ICON_MAP.aliasMap[withoutIcon];
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Get all Hugeicon names for fuzzy matching
|
|
319
|
+
*/
|
|
320
|
+
export function getAllHugeIconNames() {
|
|
321
|
+
return Object.keys(ICON_MAP.icons);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Check if an icon exists in Hugeicons
|
|
325
|
+
*/
|
|
326
|
+
export function hugeIconExists(iconName) {
|
|
327
|
+
return iconName in ICON_MAP.icons || iconName in ICON_MAP.aliasMap;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Get the canonical (primary) name for a Hugeicon
|
|
331
|
+
* This resolves aliases to their primary icon name
|
|
332
|
+
*/
|
|
333
|
+
export function getCanonicalIconName(iconName) {
|
|
334
|
+
// If it's a primary icon, return as-is
|
|
335
|
+
if (ICON_MAP.icons[iconName]) {
|
|
336
|
+
return iconName;
|
|
337
|
+
}
|
|
338
|
+
// Otherwise look up in aliasMap
|
|
339
|
+
return ICON_MAP.aliasMap[iconName];
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Get all mappings for a library
|
|
343
|
+
*/
|
|
344
|
+
export function getLibraryMappings(library) {
|
|
345
|
+
return LIBRARY_MAPPINGS[library];
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Get the Lucide mapping dictionary
|
|
349
|
+
*/
|
|
350
|
+
export function getLucideMap() {
|
|
351
|
+
return ICON_MAP.lucideMap;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Get icon details including aliases
|
|
355
|
+
*/
|
|
356
|
+
export function getIconDetails(iconName) {
|
|
357
|
+
// Try direct lookup
|
|
358
|
+
if (ICON_MAP.icons[iconName]) {
|
|
359
|
+
return ICON_MAP.icons[iconName];
|
|
360
|
+
}
|
|
361
|
+
// Try via aliasMap
|
|
362
|
+
const canonical = ICON_MAP.aliasMap[iconName];
|
|
363
|
+
if (canonical && ICON_MAP.icons[canonical]) {
|
|
364
|
+
return ICON_MAP.icons[canonical];
|
|
365
|
+
}
|
|
366
|
+
return undefined;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Search for icons by partial name (for fuzzy matching fallback)
|
|
370
|
+
*/
|
|
371
|
+
export function searchIconsByKeyword(keyword) {
|
|
372
|
+
const normalizedKeyword = keyword.toLowerCase().replace(/icon$/i, '');
|
|
373
|
+
const results = [];
|
|
374
|
+
for (const [name, entry] of Object.entries(ICON_MAP.icons)) {
|
|
375
|
+
const normalizedName = name.toLowerCase().replace(/icon$/i, '');
|
|
376
|
+
// Check main name
|
|
377
|
+
if (normalizedName.includes(normalizedKeyword)) {
|
|
378
|
+
results.push(name);
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
// Check aliases
|
|
382
|
+
for (const alias of entry.aliases) {
|
|
383
|
+
if (alias.toLowerCase().includes(normalizedKeyword)) {
|
|
384
|
+
results.push(name);
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return results;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Get statistics about the icon map
|
|
393
|
+
*/
|
|
394
|
+
export function getMapStats() {
|
|
395
|
+
return {
|
|
396
|
+
totalIcons: ICON_MAP.totalIcons,
|
|
397
|
+
totalAliases: ICON_MAP.totalAliases,
|
|
398
|
+
lucideMappings: Object.keys(ICON_MAP.lucideMap).length,
|
|
399
|
+
generated: ICON_MAP.generated,
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
//# sourceMappingURL=mappings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mappings.js","sourceRoot":"","sources":["../../src/data/mappings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAsB1C,qBAAqB;AACrB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,C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,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClC,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;gBACpD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACnB,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM;QACtD,SAAS,EAAE,QAAQ,CAAC,SAAS;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Analyzer
|
|
3
|
+
* AST-based analysis of icon imports and usages
|
|
4
|
+
*/
|
|
5
|
+
import { SourceFile } from 'ts-morph';
|
|
6
|
+
import type { FileAnalysis, ScanResult, DetectedLibrary } from '../types/index.js';
|
|
7
|
+
interface AnalyzerOptions {
|
|
8
|
+
root: string;
|
|
9
|
+
include: string[];
|
|
10
|
+
exclude: string[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Scan project for icon usages
|
|
14
|
+
*/
|
|
15
|
+
export declare function scanProject(options: AnalyzerOptions): Promise<ScanResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Analyze a single source file for icon imports and usages
|
|
18
|
+
*/
|
|
19
|
+
declare function analyzeFile(sourceFile: SourceFile, relativeFilePath: string, detectedLibraries: DetectedLibrary[]): FileAnalysis;
|
|
20
|
+
export { analyzeFile };
|
|
21
|
+
//# sourceMappingURL=analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../src/engine/analyzer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAGL,UAAU,EAIX,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,YAAY,EAIZ,UAAU,EAEV,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAI3B,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAqD/E;AAED;;GAEG;AACH,iBAAS,WAAW,CAClB,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,MAAM,EACxB,iBAAiB,EAAE,eAAe,EAAE,GACnC,YAAY,CAiFd;AA0RD,OAAO,EAAE,WAAW,EAAE,CAAC"}
|