@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.
Files changed (38) hide show
  1. package/dist/constants.d.ts +40 -0
  2. package/dist/constants.d.ts.map +1 -0
  3. package/dist/constants.js +117 -0
  4. package/dist/constants.js.map +1 -0
  5. package/dist/data/hugeicons-map.json +41786 -0
  6. package/dist/data/mappings.d.ts +69 -0
  7. package/dist/data/mappings.d.ts.map +1 -0
  8. package/dist/data/mappings.js +402 -0
  9. package/dist/data/mappings.js.map +1 -0
  10. package/dist/engine/analyzer.d.ts +21 -0
  11. package/dist/engine/analyzer.d.ts.map +1 -0
  12. package/dist/engine/analyzer.js +374 -0
  13. package/dist/engine/analyzer.js.map +1 -0
  14. package/dist/engine/detector.d.ts +20 -0
  15. package/dist/engine/detector.d.ts.map +1 -0
  16. package/dist/engine/detector.js +124 -0
  17. package/dist/engine/detector.js.map +1 -0
  18. package/dist/engine/mapper.d.ts +31 -0
  19. package/dist/engine/mapper.d.ts.map +1 -0
  20. package/dist/engine/mapper.js +234 -0
  21. package/dist/engine/mapper.js.map +1 -0
  22. package/dist/engine/reporter.d.ts +11 -0
  23. package/dist/engine/reporter.d.ts.map +1 -0
  24. package/dist/engine/reporter.js +339 -0
  25. package/dist/engine/reporter.js.map +1 -0
  26. package/dist/engine/transformer.d.ts +26 -0
  27. package/dist/engine/transformer.d.ts.map +1 -0
  28. package/dist/engine/transformer.js +874 -0
  29. package/dist/engine/transformer.js.map +1 -0
  30. package/dist/index.d.ts +22 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +56 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/types/index.d.ts +292 -0
  35. package/dist/types/index.d.ts.map +1 -0
  36. package/dist/types/index.js +14 -0
  37. package/dist/types/index.js.map +1 -0
  38. package/package.json +63 -0
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Constants and default configurations for Hugeicons Migration Tool
3
+ */
4
+ import type { MigrateConfig, SupportedLibrary } from './types/index.js';
5
+ /** Tool version */
6
+ export declare const VERSION = "0.1.0";
7
+ /** Tool name */
8
+ export declare const TOOL_NAME = "Hugeicons Migration Tool";
9
+ /** Default config file name */
10
+ export declare const DEFAULT_CONFIG_FILE = "hugeicons.migrate.json";
11
+ /** Hugeicons wrapper package */
12
+ export declare const HUGEICONS_REACT_PACKAGE = "@hugeicons/react";
13
+ /** Hugeicons free icons package */
14
+ export declare const HUGEICONS_FREE_PACKAGE = "@hugeicons/core-free-icons";
15
+ /** Hugeicons pro icons package prefix */
16
+ export declare const HUGEICONS_PRO_PACKAGE_PREFIX = "@hugeicons-pro/core-";
17
+ /** Get the icon package name for a style */
18
+ export declare function getIconPackage(style: string): string;
19
+ /** Check if a style is free */
20
+ export declare function isFreestyle(style: string): boolean;
21
+ /** Legacy - kept for compatibility */
22
+ export declare const HUGEICONS_PACKAGE = "@hugeicons/react";
23
+ /** Default configuration */
24
+ export declare const DEFAULT_CONFIG: MigrateConfig;
25
+ /** Supported icon libraries with detection patterns */
26
+ export declare const SUPPORTED_LIBRARIES: SupportedLibrary[];
27
+ /** File extensions to scan */
28
+ export declare const SCAN_EXTENSIONS: string[];
29
+ /** Default fuzzy match confidence threshold */
30
+ export declare const DEFAULT_CONFIDENCE_THRESHOLD = 0.9;
31
+ /** Maximum number of top icons to show in reports */
32
+ export declare const MAX_TOP_ICONS = 10;
33
+ /** Common props that can be directly transferred */
34
+ export declare const TRANSFERABLE_PROPS: string[];
35
+ /** FontAwesome props that need conversion */
36
+ export declare const FA_PROP_CONVERSIONS: Record<string, {
37
+ type: 'class' | 'remove' | 'warn';
38
+ value?: string;
39
+ }>;
40
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAExE,mBAAmB;AACnB,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,gBAAgB;AAChB,eAAO,MAAM,SAAS,6BAA6B,CAAC;AAEpD,+BAA+B;AAC/B,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D,gCAAgC;AAChC,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D,mCAAmC;AACnC,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AAEnE,yCAAyC;AACzC,eAAO,MAAM,4BAA4B,yBAAyB,CAAC;AAEnE,4CAA4C;AAC5C,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOpD;AAED,+BAA+B;AAC/B,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,sCAAsC;AACtC,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AAEpD,4BAA4B;AAC5B,eAAO,MAAM,cAAc,EAAE,aAoB5B,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,EAuBjD,CAAC;AAEF,8BAA8B;AAC9B,eAAO,MAAM,eAAe,UAAiC,CAAC;AAE9D,+CAA+C;AAC/C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,qDAAqD;AACrD,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC,oDAAoD;AACpD,eAAO,MAAM,kBAAkB,UAc9B,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAerG,CAAC"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Constants and default configurations for Hugeicons Migration Tool
3
+ */
4
+ /** Tool version */
5
+ export const VERSION = '0.1.0';
6
+ /** Tool name */
7
+ export const TOOL_NAME = 'Hugeicons Migration Tool';
8
+ /** Default config file name */
9
+ export const DEFAULT_CONFIG_FILE = 'hugeicons.migrate.json';
10
+ /** Hugeicons wrapper package */
11
+ export const HUGEICONS_REACT_PACKAGE = '@hugeicons/react';
12
+ /** Hugeicons free icons package */
13
+ export const HUGEICONS_FREE_PACKAGE = '@hugeicons/core-free-icons';
14
+ /** Hugeicons pro icons package prefix */
15
+ export const HUGEICONS_PRO_PACKAGE_PREFIX = '@hugeicons-pro/core-';
16
+ /** Get the icon package name for a style */
17
+ export function getIconPackage(style) {
18
+ if (style === 'stroke' || style === 'stroke-rounded' || style === 'free') {
19
+ return HUGEICONS_FREE_PACKAGE;
20
+ }
21
+ // Pro styles: solid-rounded, duotone-rounded, twotone-rounded, bulk-rounded,
22
+ // stroke-standard, solid-standard, duotone-standard, stroke-sharp, solid-sharp
23
+ return `${HUGEICONS_PRO_PACKAGE_PREFIX}${style}`;
24
+ }
25
+ /** Check if a style is free */
26
+ export function isFreestyle(style) {
27
+ return style === 'stroke' || style === 'stroke-rounded' || style === 'free';
28
+ }
29
+ /** Legacy - kept for compatibility */
30
+ export const HUGEICONS_PACKAGE = '@hugeicons/react';
31
+ /** Default configuration */
32
+ export const DEFAULT_CONFIG = {
33
+ style: 'stroke',
34
+ libraries: [],
35
+ include: ['src/**/*.{ts,tsx,js,jsx}'],
36
+ exclude: [
37
+ '**/node_modules/**',
38
+ '**/dist/**',
39
+ '**/.next/**',
40
+ '**/build/**',
41
+ '**/*.d.ts',
42
+ '**/*.test.*',
43
+ '**/*.spec.*',
44
+ ],
45
+ mapping: {},
46
+ rules: {
47
+ onUnmapped: 'warn',
48
+ onAmbiguous: 'warn',
49
+ propStrategy: 'best-effort',
50
+ renameConflicts: 'auto',
51
+ },
52
+ };
53
+ /** Supported icon libraries with detection patterns */
54
+ export const SUPPORTED_LIBRARIES = [
55
+ {
56
+ name: 'lucide-react',
57
+ aliases: ['lucide'],
58
+ importPatterns: [/from\s+['"]lucide-react['"]/],
59
+ namingConvention: 'PascalCase',
60
+ usesWrapper: false,
61
+ },
62
+ {
63
+ name: '@fortawesome/react-fontawesome',
64
+ aliases: [
65
+ '@fortawesome/free-solid-svg-icons',
66
+ '@fortawesome/free-regular-svg-icons',
67
+ '@fortawesome/free-brands-svg-icons',
68
+ ],
69
+ importPatterns: [
70
+ /from\s+['"]@fortawesome\/react-fontawesome['"]/,
71
+ /from\s+['"]@fortawesome\/free-.*-svg-icons['"]/,
72
+ ],
73
+ namingConvention: 'camelCase',
74
+ usesWrapper: true,
75
+ wrapperComponent: 'FontAwesomeIcon',
76
+ },
77
+ ];
78
+ /** File extensions to scan */
79
+ export const SCAN_EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx'];
80
+ /** Default fuzzy match confidence threshold */
81
+ export const DEFAULT_CONFIDENCE_THRESHOLD = 0.9;
82
+ /** Maximum number of top icons to show in reports */
83
+ export const MAX_TOP_ICONS = 10;
84
+ /** Common props that can be directly transferred */
85
+ export const TRANSFERABLE_PROPS = [
86
+ 'size',
87
+ 'color',
88
+ 'strokeWidth',
89
+ 'className',
90
+ 'style',
91
+ 'onClick',
92
+ 'onMouseEnter',
93
+ 'onMouseLeave',
94
+ 'id',
95
+ 'data-testid',
96
+ 'aria-label',
97
+ 'aria-hidden',
98
+ 'role',
99
+ ];
100
+ /** FontAwesome props that need conversion */
101
+ export const FA_PROP_CONVERSIONS = {
102
+ spin: { type: 'class', value: 'animate-spin' },
103
+ pulse: { type: 'class', value: 'animate-pulse' },
104
+ beat: { type: 'class', value: 'animate-bounce' },
105
+ fade: { type: 'class', value: 'animate-pulse' },
106
+ flip: { type: 'warn' },
107
+ rotation: { type: 'warn' },
108
+ transform: { type: 'remove' },
109
+ mask: { type: 'remove' },
110
+ fixedWidth: { type: 'remove' },
111
+ inverse: { type: 'warn' },
112
+ listItem: { type: 'remove' },
113
+ swapOpacity: { type: 'remove' },
114
+ border: { type: 'warn' },
115
+ pull: { type: 'warn' },
116
+ };
117
+ //# sourceMappingURL=constants.js.map
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