iconora 1.0.0 → 1.0.1

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 (2) hide show
  1. package/README.md +580 -1475
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,1475 +1,580 @@
1
- # Iconora
2
-
3
- A lightweight, customizable React icon package built with TypeScript and SVG, with built-in CLI tooling for importing, deriving, generating, validating, inspecting, and managing icons.
4
-
5
- Iconora provides clean, reusable icons designed for modern React applications with a simple and consistent API. It also provides a source-to-package workflow that can derive icons from external icon repositories such as Lucide and convert them into the Iconora architecture.
6
-
7
- ## Features
8
-
9
- - ⚛️ Built for React
10
-
11
- - 🔷 Written in TypeScript
12
-
13
- - 🎨 Customizable icon color
14
-
15
- - 📏 Customizable icon size
16
-
17
- - ✏️ Customizable stroke width
18
-
19
- - 🧩 Supports standard SVG props
20
-
21
- - 🌳 Tree-shakeable
22
-
23
- - 📦 Available as an npm package
24
-
25
- - 🪶 Lightweight and dependency-friendly
26
-
27
- - 🔄 Automated SVG → TSX icon generation
28
-
29
- - 🧪 Automated icon validation and testing
30
-
31
- - 🗂️ Automatic icon metadata generation
32
-
33
- - 🛠️ Built-in CLI tools for icon management and source import
34
-
35
- 📥 Lucide repository icon import and derivation
36
-
37
- 🔄 Source SVG → Iconora architecture conversion
38
-
39
- - 🔍 Metadata inspection for individual or multiple icons
40
-
41
- - ✅ Production project verification
42
-
43
- ---
44
-
45
- ## Installation
46
-
47
- Install Iconora using npm:
48
-
49
- ```bash
50
-
51
- npm install iconora
52
-
53
- ```
54
-
55
- Or using other package managers:
56
-
57
- ```bash
58
-
59
- yarn add iconora
60
-
61
- ```
62
-
63
- ```bash
64
-
65
- pnpm add iconora
66
-
67
- ```
68
-
69
- ---
70
-
71
- ## Usage
72
-
73
- Import an icon from Iconora:
74
-
75
- ```tsx
76
-
77
- import { Search } from "iconora";
78
-
79
- ```
80
-
81
- Then use it inside your React component:
82
-
83
- ```tsx
84
-
85
- <Search />
86
-
87
- ```
88
-
89
- ---
90
-
91
- ## Customization
92
-
93
- Iconora icons can be customized using props.
94
-
95
- ### Size
96
-
97
- ```tsx
98
-
99
- <Search size={24} />
100
-
101
- ```
102
-
103
- ```tsx
104
-
105
- <Search size={48} />
106
-
107
- ```
108
-
109
- ### Color
110
-
111
- ```tsx
112
-
113
- <Search color="red" />
114
-
115
- ```
116
-
117
- ```tsx
118
-
119
- <Search color="#0f95" />
120
-
121
- ```
122
-
123
- You can also use CSS-based coloring:
124
-
125
- ```tsx
126
-
127
- <Search className="text-red-500" />
128
-
129
- ```
130
-
131
- ### Stroke Width
132
-
133
- ```tsx
134
-
135
- <Search strokeWidth={3} />
136
-
137
- ```
138
-
139
- ### Combining Props
140
-
141
- ```tsx
142
-
143
- <Search
144
-
145
-   size={48}
146
-
147
-   color="#0f95"
148
-
149
-   strokeWidth={3}
150
-
151
- />
152
-
153
- ```
154
-
155
- ---
156
-
157
- ## SVG Props
158
-
159
- Iconora icons support standard React SVG properties.
160
-
161
- For example:
162
-
163
- ```tsx
164
-
165
- <Search
166
-
167
-   size={32}
168
-
169
-   className="my-icon"
170
-
171
-   aria-label="Search"
172
-
173
- />
174
-
175
- ```
176
-
177
- You can also use standard SVG-related props such as:
178
-
179
- ```text
180
-
181
- id
182
-
183
- style
184
-
185
- role
186
-
187
- aria-label
188
-
189
- onClick
190
-
191
- ```
192
-
193
- Because Iconora icons are React SVG components, standard React SVG attributes and event handlers can be used where supported by React.
194
-
195
- ---
196
-
197
- ## TypeScript
198
-
199
- Iconora includes TypeScript type declarations, so you get type safety and editor autocomplete when using the package.
200
-
201
- ```tsx
202
-
203
- import {
204
-
205
-   Search,
206
-
207
-   type IconProps,
208
-
209
- } from "iconora";
210
-
211
- ```
212
-
213
- ---
214
-
215
- # Importing Icons from Lucide
216
-
217
- Iconora can import and derive the SVG icon collection from the official Lucide GitHub repository using a built-in CLI.
218
-
219
- The import command is:
220
-
221
- npm run import:lucide
222
-
223
- This command is designed for source acquisition and derivation. It extracts the Lucide SVG icon sources and places them into Iconora's icons/ source directory.
224
-
225
- It does not directly create the final React components. The imported SVG files become Iconora source files and then pass through the normal Iconora generation pipeline.
226
-
227
- ## Lucide Import Workflow
228
-
229
- The complete flow is:
230
-
231
- Lucide GitHub Repository
232
-
233
-
234
- npm run import:lucide
235
-
236
-
237
- icons/*.svg
238
-
239
-
240
- npm run validate
241
-
242
-
243
- npm run generate
244
-
245
- ├───────────────┬───────────────┐
246
- ▼ ▼ ▼
247
- TSX icons index.ts metadata
248
- │ │ │
249
- └───────────────┼───────────────┘
250
-
251
- npm run check
252
-
253
- ┌───────┼───────┐
254
- ▼ ▼ ▼
255
- typecheck tests build
256
- │ │ │
257
- └───────┼───────┘
258
-
259
- 📦 Iconora
260
-
261
- ## What npm run import:lucide Does
262
-
263
- The command is responsible for:
264
-
265
- Obtaining the Lucide SVG icon sources from the Lucide GitHub repository.
266
-
267
- Extracting the SVG icon files.
268
-
269
- Deriving the source collection into Iconora's icons/ directory.
270
-
271
- Preparing the icons for Iconora's validation and generation pipeline.
272
-
273
- Keeping external icon acquisition separate from React component generation.
274
-
275
- The important architectural distinction is:
276
-
277
- import:lucide
278
-
279
- External source → Iconora SVG source
280
-
281
- generate
282
-
283
- Iconora SVG source → Iconora React architecture
284
-
285
- ## Example
286
-
287
- Run:
288
-
289
- npm run import:lucide
290
-
291
- The imported source collection is placed under:
292
-
293
- icons/
294
- ├── activity.svg
295
- ├── airplay.svg
296
- ├── alarm-clock.svg
297
- ├── search.svg
298
- ├── x.svg
299
- └── ...
300
-
301
- After importing, validate the collection:
302
-
303
- npm run validate
304
-
305
- Then generate the Iconora components:
306
-
307
- npm run generate
308
-
309
- Finally verify the complete project:
310
-
311
- npm run check
312
-
313
- ## Important
314
-
315
- npm run import:lucide is an import/derivation command, not the final Iconora generation command.
316
-
317
- The commands have separate responsibilities:
318
-
319
- Command
320
-
321
- Responsibility
322
-
323
- npm run import:lucide
324
-
325
- Derive/import Lucide SVG sources into Iconora
326
-
327
- npm run validate
328
-
329
- Validate Iconora SVG sources
330
-
331
- npm run generate
332
-
333
- Convert SVG sources into Iconora React/TypeScript architecture
334
-
335
- npm run check
336
-
337
- Verify TypeScript, tests, and production build
338
-
339
- This separation allows Iconora to remain a standalone icon package instead of being tightly coupled to Lucide's runtime package.
340
-
341
- ## Recommended Lucide Import Workflow
342
-
343
- When refreshing the Lucide-derived icon collection:
344
-
345
- npm run import:lucide
346
- npm run validate
347
- npm run generate
348
- npm run check
349
-
350
- After the import, icons/ remains the source layer used by the rest of the Iconora pipeline.
351
-
352
- ---
353
-
354
- # Adding New Icons
355
-
356
- Iconora uses SVG files as the **source of truth**.
357
-
358
- You do not manually create the corresponding `.tsx` icon component, update `index.ts`, or update the metadata file.
359
-
360
- Instead, add the SVG to:
361
-
362
- ```text
363
-
364
- icons/
365
-
366
- ```
367
-
368
- and let Iconora generate everything automatically.
369
-
370
- ---
371
-
372
- ## 1. Add the SVG
373
-
374
- Place your SVG file inside:
375
-
376
- ```text
377
-
378
- icons/
379
-
380
- ```
381
-
382
- For example:
383
-
384
- ```text
385
-
386
- icons/
387
-
388
- ├── search.svg
389
-
390
- ├── x.svg
391
-
392
- └── home.svg
393
-
394
- ```
395
-
396
- The filename determines the generated component name.
397
-
398
- For example:
399
-
400
- ```text
401
-
402
- search.svg → Search
403
-
404
- x.svg      → X
405
-
406
- home.svg   → Home
407
-
408
- ```
409
-
410
- For names containing hyphens:
411
-
412
- ```text
413
-
414
- arrow-left.svg → ArrowLeft
415
-
416
- chevron-down.svg → ChevronDown
417
-
418
- ```
419
-
420
- ---
421
-
422
- ## 2. Validate the SVG
423
-
424
- After adding the SVG, run:
425
-
426
- ```bash
427
-
428
- npm run validate
429
-
430
- ```
431
-
432
- This checks the source SVG collection before generating the React components.
433
-
434
- Example:
435
-
436
- ```text
437
-
438
- Iconora SVG validation
439
-
440
- ✓ Iconora SVG validation passed
441
-
442
- 3 SVG icons checked
443
-
444
- 0 failed
445
-
446
- ```
447
-
448
- If validation fails, fix the SVG before continuing.
449
-
450
- ---
451
-
452
- ## 3. Generate the Icon
453
-
454
- Once validation passes, run:
455
-
456
- ```bash
457
-
458
- npm run generate
459
-
460
- ```
461
-
462
- Iconora automatically generates the React/TypeScript component.
463
-
464
- For example:
465
-
466
- ```text
467
-
468
- icons/home.svg
469
-
470
- ```
471
-
472
- becomes:
473
-
474
- ```text
475
-
476
- src/icons/Home.tsx
477
-
478
- ```
479
-
480
- The generator also updates:
481
-
482
- ```text
483
-
484
- src/index.ts
485
-
486
- ```
487
-
488
- and:
489
-
490
- ```text
491
-
492
- src/metadata/icons.json
493
-
494
- ```
495
-
496
- The generated structure looks like:
497
-
498
- ```text
499
-
500
- src/
501
-
502
- ├── icons/
503
-
504
- │   ├── Search.tsx
505
-
506
- │   ├── X.tsx
507
-
508
- │   └── Home.tsx
509
-
510
-
511
-
512
- ├── metadata/
513
-
514
- │   └── icons.json
515
-
516
-
517
-
518
- └── index.ts
519
-
520
- ```
521
-
522
- ### Important
523
-
524
- Do not manually edit generated files:
525
-
526
- ```text
527
-
528
- src/icons/
529
-
530
- src/index.ts
531
-
532
- src/metadata/icons.json
533
-
534
- ```
535
-
536
- If you need to change an icon, modify the original SVG inside:
537
-
538
- ```text
539
-
540
- icons/
541
-
542
- ```
543
-
544
- and run:
545
-
546
- ```bash
547
-
548
- npm run generate
549
-
550
- ```
551
-
552
- again.
553
-
554
- ---
555
-
556
- ## 4. Verify the Project
557
-
558
- After generating the icon, run:
559
-
560
- ```bash
561
-
562
- npm run check
563
-
564
- ```
565
-
566
- This is the recommended verification command.
567
-
568
- It automatically runs:
569
-
570
- ```text
571
-
572
- npm run validate
573
-
574
-       ↓
575
-
576
- npm run typecheck
577
-
578
-       ↓
579
-
580
- npm run test:run
581
-
582
-       ↓
583
-
584
- npm run build
585
-
586
- ```
587
-
588
- A successful check means the generated icon passes:
589
-
590
- - SVG validation
591
-
592
- - TypeScript type checking
593
-
594
- - Icon tests
595
-
596
- - Production build
597
-
598
- ---
599
-
600
- ## Complete New Icon Workflow
601
-
602
- Whenever you add a new icon, the recommended workflow is:
603
-
604
- ```bash
605
-
606
- npm run validate
607
-
608
- npm run generate
609
-
610
- npm run check
611
-
612
- ```
613
-
614
- The complete process is:
615
-
616
- ```text
617
-
618
- icons/home.svg
619
-
620
-       │
621
-
622
-       ▼
623
-
624
- npm run validate
625
-
626
-       │
627
-
628
-       ▼
629
-
630
- npm run generate
631
-
632
-       │
633
-
634
-       ├───────────────┐
635
-
636
-       ▼               ▼
637
-
638
- Home.tsx          metadata
639
-
640
-       │
641
-
642
-       └───────┬───────┘
643
-
644
-               ▼
645
-
646
-            index.ts
647
-
648
-               │
649
-
650
-               ▼
651
-
652
-         npm run check
653
-
654
-               │
655
-
656
-        ┌──────┼──────┐
657
-
658
-        ▼      ▼      ▼
659
-
660
-    Typecheck Tests  Build
661
-
662
-        │      │      │
663
-
664
-        └──────┼──────┘
665
-
666
-               ▼
667
-
668
-           📦 Iconora
669
-
670
- ```
671
-
672
- ---
673
-
674
- # Inspecting Icon Metadata
675
-
676
- Iconora provides a metadata inspection command.
677
-
678
- ## Single Icon
679
-
680
- ```bash
681
-
682
- npm run getMetadata -- Search
683
-
684
- ```
685
-
686
- Icon names are case-insensitive:
687
-
688
- ```bash
689
-
690
- npm run getMetadata -- Search
691
-
692
- ```
693
-
694
- ```bash
695
-
696
- npm run getMetadata -- search
697
-
698
- ```
699
-
700
- ```bash
701
-
702
- npm run getMetadata -- SEARCH
703
-
704
- ```
705
-
706
- These all refer to the same icon.
707
-
708
- ---
709
-
710
- ## Multiple Icons
711
-
712
- You can inspect multiple icons at once:
713
-
714
- ```bash
715
-
716
- npm run getMetadata -- Search X Home
717
-
718
- ```
719
-
720
- You can also use:
721
-
722
- ```bash
723
-
724
- npm run getMetadata -- --Search --X --Home
725
-
726
- ```
727
-
728
- ---
729
-
730
- ## All Icons
731
-
732
- To display metadata for every icon:
733
-
734
- ```bash
735
-
736
- npm run getMetadata -- --all
737
-
738
- ```
739
-
740
- > **Note:** This can produce a large amount of terminal output for large icon collections.
741
-
742
- ---
743
-
744
- ## Missing Icons
745
-
746
- Missing icons are reported without stopping successful lookups.
747
-
748
- For example:
749
-
750
- ```bash
751
-
752
- npm run getMetadata -- Search X DoesNotExist
753
-
754
- ```
755
-
756
- The command will display the metadata for `Search` and `X` while reporting:
757
-
758
- ```text
759
-
760
- ✗ DoesNotExist
761
-
762
-   Metadata not found
763
-
764
- ```
765
-
766
- ---
767
-
768
- ## Metadata Source
769
-
770
- Metadata is read from:
771
-
772
- ```text
773
-
774
- src/metadata/icons.json
775
-
776
- ```
777
-
778
- `getMetadata` is completely **read-only**.
779
-
780
- It does not modify:
781
-
782
- ```text
783
-
784
- icons/
785
-
786
- src/icons/
787
-
788
- src/index.ts
789
-
790
- src/metadata/icons.json
791
-
792
- ```
793
-
794
- If the metadata file is missing or outdated, run:
795
-
796
- ```bash
797
-
798
- npm run generate
799
-
800
- ```
801
-
802
- before using `getMetadata`.
803
-
804
- ---
805
-
806
- # Removing Icons
807
-
808
- Iconora provides a CLI command for removing icons.
809
-
810
- ## Full Icon Deletion
811
-
812
- To completely remove an icon:
813
-
814
- ```bash
815
-
816
- npm run delete -- Search
817
-
818
- ```
819
-
820
- This removes:
821
-
822
- ```text
823
-
824
- icons/search.svg
825
-
826
- src/icons/Search.tsx
827
-
828
- Search from src/index.ts
829
-
830
- Search from src/metadata/icons.json
831
-
832
- ```
833
-
834
- Icon names are case-insensitive:
835
-
836
- ```bash
837
-
838
- npm run delete -- Search
839
-
840
- npm run delete -- search
841
-
842
- npm run delete -- SEARCH
843
-
844
- ```
845
-
846
- Iconora asks for confirmation before performing the deletion.
847
-
848
- ---
849
-
850
- ## Selective Deletion
851
-
852
- You can also delete individual parts of an icon.
853
-
854
- ### Delete only the SVG
855
-
856
- ```bash
857
-
858
- npm run delete -- --Search svg
859
-
860
- ```
861
-
862
- ### Delete only the generated TSX
863
-
864
- ```bash
865
-
866
- npm run delete -- --Search tsx
867
-
868
- ```
869
-
870
- ### Delete only metadata
871
-
872
- ```bash
873
-
874
- npm run delete -- --Search metadata
875
-
876
- ```
877
-
878
- ### Delete multiple parts
879
-
880
- ```bash
881
-
882
- npm run delete -- --Search svg tsx
883
-
884
- ```
885
-
886
- Deletion targets are case-insensitive:
887
-
888
- ```bash
889
-
890
- npm run delete -- --SEARCH SVG TSX
891
-
892
- ```
893
-
894
- ### Important
895
-
896
- Selective deletion can intentionally leave generated files out of sync.
897
-
898
- For normal icon removal, use:
899
-
900
- ```bash
901
-
902
- npm run delete -- Search
903
-
904
- ```
905
-
906
- If you intentionally perform a partial deletion and need to regenerate the project state from the remaining SVG sources, run:
907
-
908
- ```bash
909
-
910
- npm run generate
911
-
912
- ```
913
-
914
- ---
915
-
916
- # Iconora CLI Architecture
917
-
918
- Iconora's built-in CLIs are organized as a pipeline rather than as unrelated utilities.
919
-
920
- ┌───────────────────────────────┐
921
- │ External Icon Source │
922
- │ Lucide GitHub Repository │
923
- └───────────────┬───────────────┘
924
-
925
-
926
- npm run import:lucide
927
-
928
-
929
- ┌───────────────────────────────┐
930
- │ Iconora Source Layer │
931
- │ icons/*.svg │
932
- └───────────────┬───────────────┘
933
-
934
-
935
- npm run validate
936
-
937
-
938
- npm run generate
939
-
940
- ┌────────┼────────┐
941
- ▼ ▼ ▼
942
- TSX index metadata
943
- │ │ │
944
- └────────┼────────┘
945
-
946
- npm run check
947
-
948
- ┌────────┼────────┐
949
- ▼ ▼ ▼
950
- typecheck tests build
951
-
952
-
953
- 📦 Iconora
954
-
955
- This architecture gives Iconora a clear separation of concerns:
956
-
957
- Import/derivation acquires external icon sources.
958
-
959
- Source SVGs are the Iconora collection's source layer.
960
-
961
- Validation checks source correctness.
962
-
963
- Generation converts SVGs into the Iconora React/TypeScript architecture.
964
-
965
- Metadata tooling provides icon information.
966
-
967
- Deletion tooling manages the source and generated collection.
968
-
969
- Verification ensures the package is production-ready.
970
-
971
- The package is therefore not simply a wrapper around Lucide. Lucide can be one source used to derive the Iconora collection, while Iconora maintains its own source, generation, metadata, and package architecture.
972
-
973
- ---
974
-
975
- # Development
976
-
977
- Clone the repository:
978
-
979
- ```bash
980
-
981
- git clone <repository-url>
982
-
983
- ```
984
-
985
- Enter the project:
986
-
987
- ```bash
988
-
989
- cd iconora
990
-
991
- ```
992
-
993
- Install dependencies:
994
-
995
- ```bash
996
-
997
- npm install
998
-
999
- ```
1000
-
1001
- ---
1002
-
1003
- ## Development Commands
1004
-
1005
- ### Validate SVG icons
1006
-
1007
- ```bash
1008
-
1009
- npm run validate
1010
-
1011
- ```
1012
-
1013
- ### Generate icon components
1014
-
1015
- ```bash
1016
-
1017
- npm run generate
1018
-
1019
- ```
1020
-
1021
- ### Delete an icon
1022
-
1023
- ```bash
1024
-
1025
- npm run delete -- IconName
1026
-
1027
- ```
1028
-
1029
- ### Get icon metadata
1030
-
1031
- ```bash
1032
-
1033
- npm run getMetadata -- IconName
1034
-
1035
- ```
1036
-
1037
- ### Check the complete project
1038
-
1039
- ```bash
1040
-
1041
- npm run check
1042
-
1043
- ```
1044
-
1045
- ### Typecheck
1046
-
1047
- ```bash
1048
-
1049
- npm run typecheck
1050
-
1051
- ```
1052
-
1053
- ### Run tests once
1054
-
1055
- ```bash
1056
-
1057
- npm run test:run
1058
-
1059
- ```
1060
-
1061
- ### Run tests in development mode
1062
-
1063
- ```bash
1064
-
1065
- npm run test
1066
-
1067
- ```
1068
-
1069
- ### Run tests in watch mode
1070
-
1071
- ```bash
1072
-
1073
- npm run test:watch
1074
-
1075
- ```
1076
-
1077
- ### Build the package
1078
-
1079
- ```bash
1080
-
1081
- npm run build
1082
-
1083
- ```
1084
-
1085
- For a detailed explanation of every command, see:
1086
-
1087
- ```text
1088
-
1089
- docs/commands.md
1090
-
1091
- ```
1092
-
1093
- ---
1094
-
1095
- # Project Structure
1096
-
1097
- ```text
1098
-
1099
- iconora/
1100
-
1101
-
1102
-
1103
- ├── icons/
1104
-
1105
- │   ├── search.svg
1106
-
1107
- │   └── x.svg
1108
-
1109
-
1110
-
1111
- ├── src/
1112
-
1113
- │   ├── components/
1114
-
1115
- │   │   └── IconBase.tsx
1116
-
1117
- │   │
1118
-
1119
- │   ├── icons/
1120
-
1121
- │   │   ├── Search.tsx
1122
-
1123
- │   │   └── X.tsx
1124
-
1125
- │   │
1126
-
1127
- │   ├── metadata/
1128
-
1129
- │   │   ├── icons.json
1130
-
1131
- │   │   └── types.ts
1132
-
1133
- │   │
1134
-
1135
- │   ├── types.ts
1136
-
1137
- │   └── index.ts
1138
-
1139
-
1140
-
1141
- ├── scripts/
1142
-
1143
- │   ├── check.ts
1144
-
1145
- │   ├── delete-icons.ts
1146
-
1147
- │   ├── generate-icons.ts
1148
-
1149
- │   ├── get-metadata.ts
1150
-
1151
- │   └── validate-icons.ts
1152
-
1153
-
1154
-
1155
- ├── tests/
1156
-
1157
- │   ├── icons.test.tsx
1158
-
1159
- │   └── setup.ts
1160
-
1161
-
1162
-
1163
- ├── docs/
1164
-
1165
- │   └── commands.md
1166
-
1167
-
1168
-
1169
- ├── .gitignore
1170
-
1171
- ├── LICENSE
1172
-
1173
- ├── README.md
1174
-
1175
- ├── package.json
1176
-
1177
- ├── package-lock.json
1178
-
1179
- ├── tsconfig.json
1180
-
1181
- └── tsup.config.ts
1182
-
1183
- ```
1184
-
1185
- ---
1186
-
1187
- # Source of Truth
1188
-
1189
- The most important rule in Iconora is:
1190
-
1191
- ```text
1192
-
1193
- icons/
1194
-
1195
- ```
1196
-
1197
- is the **source of truth**.
1198
-
1199
- The SVG files inside `icons/` are the original icon sources.
1200
-
1201
- Generated files include:
1202
-
1203
- ```text
1204
-
1205
- src/icons/
1206
-
1207
- src/index.ts
1208
-
1209
- src/metadata/icons.json
1210
-
1211
- ```
1212
-
1213
- These files should normally **not be edited manually**.
1214
-
1215
- The intended architecture is:
1216
-
1217
- ```text
1218
-
1219
-               SVG SOURCE
1220
-
1221
-                   │
1222
-
1223
-                   ▼
1224
-
1225
-               icons/*.svg
1226
-
1227
-                   │
1228
-
1229
-                   ▼
1230
-
1231
-           npm run validate
1232
-
1233
-                   │
1234
-
1235
-                   ▼
1236
-
1237
-            npm run generate
1238
-
1239
-                   │
1240
-
1241
-           ┌───────┼────────┐
1242
-
1243
-           ▼       ▼        ▼
1244
-
1245
-         TSX     index   metadata
1246
-
1247
-           │       │        │
1248
-
1249
-           └───────┼────────┘
1250
-
1251
-                   ▼
1252
-
1253
-              npm run check
1254
-
1255
-                   │
1256
-
1257
-           ┌───────┼────────┐
1258
-
1259
-           ▼       ▼        ▼
1260
-
1261
-      typecheck   tests    build
1262
-
1263
-           │       │        │
1264
-
1265
-           └───────┼────────┘
1266
-
1267
-                   ▼
1268
-
1269
-               📦 Iconora
1270
-
1271
- ```
1272
-
1273
- ---
1274
-
1275
- # Production Verification
1276
-
1277
- Before publishing a version of Iconora, run:
1278
-
1279
- ```bash
1280
-
1281
- npm run validate
1282
-
1283
- npm run generate
1284
-
1285
- npm run check
1286
-
1287
- ```
1288
-
1289
- The `check` command automatically runs:
1290
-
1291
- ```bash
1292
-
1293
- npm run typecheck
1294
-
1295
- npm run test:run
1296
-
1297
- npm run build
1298
-
1299
- ```
1300
-
1301
- Therefore, the complete production workflow is:
1302
-
1303
- ```text
1304
-
1305
- npm run validate
1306
-
1307
-         ↓
1308
-
1309
- npm run generate
1310
-
1311
-         ↓
1312
-
1313
- npm run check
1314
-
1315
-         ↓
1316
-
1317
- ┌───────────────────┐
1318
-
1319
- │ TypeScript        │
1320
-
1321
- │ Tests             │
1322
-
1323
- │ Production Build  │
1324
-
1325
- └───────────────────┘
1326
-
1327
-         ↓
1328
-
1329
-    ✓ Ready to publish
1330
-
1331
- ```
1332
-
1333
- All commands should complete successfully.
1334
-
1335
- If any command fails, **do not publish the package** until the issue has been resolved.
1336
-
1337
- ---
1338
-
1339
- # Roadmap
1340
-
1341
- - [x] Initial npm package setup
1342
-
1343
- - [x] TypeScript support
1344
-
1345
- - [x] React support
1346
-
1347
- - [x] SVG icon architecture
1348
-
1349
- - [x] Initial icons
1350
-
1351
- - [x] Local package testing
1352
-
1353
- - [x] Automated SVG validation
1354
-
1355
- - [x] Automated SVG → TSX generation
1356
-
1357
- - [x] Automatic icon exports
1358
-
1359
- - [x] Automatic icon metadata generation
1360
-
1361
- - [x] Aggregated icon tests
1362
-
1363
- - [x] Type checking
1364
-
1365
- - [x] ESM build
1366
-
1367
- - [x] CommonJS build
1368
-
1369
- - [x] Type declaration generation
1370
-
1371
- - [x] Icon deletion CLI
1372
-
1373
- - [x] Metadata inspection CLI
1374
-
1375
- - [x] Project verification CLI
1376
-
1377
- - [x] Command documentation
1378
-
1379
- - [ ] Expand icon collection
1380
-
1381
- - [ ] Add continuous integration
1382
-
1383
- - [ ] Improve package tooling
1384
-
1385
- - [ ] Publish stable release to npm
1386
-
1387
- - [ ] Expand documentation
1388
-
1389
- - [ ] Build Iconora documentation website
1390
-
1391
- ---
1392
-
1393
- # License
1394
-
1395
- Iconora is released under the MIT License.
1396
-
1397
- You are free to use, modify, and redistribute Iconora in personal, commercial, educational, and other projects, subject to the terms of the MIT License.
1398
-
1399
- The license grants permission to use and modify the software; it does not transfer ownership or intellectual property rights in the original Iconora project or its original assets.
1400
-
1401
- See the [LICENSE](LICENSE) file for the complete license text.
1402
-
1403
- ---
1404
-
1405
- # Contributing
1406
-
1407
- Contributions, suggestions, bug reports, and new icon ideas are welcome.
1408
-
1409
- If you want to contribute a new icon:
1410
-
1411
- 1. Add the SVG to `icons/`.
1412
-
1413
- 2. Run `npm run validate`.
1414
-
1415
- 3. Run `npm run generate`.
1416
-
1417
- 4. Run `npm run check`.
1418
-
1419
- 5. Submit your changes.
1420
-
1421
- The `check` command automatically runs:
1422
-
1423
- ```text
1424
-
1425
- TypeScript typecheck
1426
-
1427
- Tests
1428
-
1429
- Production build
1430
-
1431
- ```
1432
-
1433
- Please do not manually edit generated icon files unless you are specifically working on the generation system itself.
1434
-
1435
- ---
1436
-
1437
- # Documentation
1438
-
1439
- Detailed command documentation is available at:
1440
-
1441
- ```text
1442
-
1443
- docs/commands.md
1444
-
1445
- ```
1446
-
1447
- The command documentation covers:
1448
-
1449
- - SVG validation
1450
-
1451
- - Icon generation
1452
-
1453
- - Icon deletion
1454
-
1455
- - Metadata generation
1456
-
1457
- - Metadata inspection
1458
-
1459
- - Project verification
1460
-
1461
- - Type checking
1462
-
1463
- - Testing
1464
-
1465
- - Test watch mode
1466
-
1467
- - Production builds
1468
-
1469
- - Recommended development workflows
1470
-
1471
- ---
1472
-
1473
- Made with ❤️ for React developers.
1474
-
1475
- **Iconora — Simple icons. Your way.**
1
+ # Iconora
2
+
3
+ A lightweight, customizable React icon package built with TypeScript and SVG. Iconora provides reusable icons with a consistent API and built-in CLI tooling for importing, validating, generating, inspecting, and managing icons.
4
+
5
+ Iconora can derive icons from external icon repositories such as Lucide and convert them into the Iconora architecture.
6
+
7
+ ## Features
8
+
9
+ - ⚛️ Built for React
10
+ - 🔷 Written in TypeScript
11
+ - 🎨 Customizable color
12
+ - 📏 Customizable size
13
+ - ✏️ Customizable stroke width
14
+ - 🧩 Standard React SVG props
15
+ - 🌳 Tree-shakeable
16
+ - 📦 Available as an npm package
17
+ - 🪶 Lightweight and dependency-friendly
18
+ - 🔄 Automated SVG → TSX generation
19
+ - 🧪 SVG validation and project testing
20
+ - 🗂️ Automatic icon metadata generation
21
+ - 🛠️ CLI tools for icon import, generation, deletion, validation, and metadata inspection
22
+
23
+ ## Installation
24
+
25
+ Install Iconora using npm:
26
+
27
+ ```bash
28
+ npm install iconora
29
+ ```
30
+
31
+ Or using Yarn:
32
+
33
+ ```bash
34
+ yarn add iconora
35
+ ```
36
+
37
+ Or using pnpm:
38
+
39
+ ```bash
40
+ pnpm add iconora
41
+ ```
42
+
43
+ ## Usage
44
+
45
+ Import an icon from Iconora:
46
+
47
+ ```tsx
48
+ import { Search } from "iconora";
49
+ ```
50
+
51
+ Use it in a React component:
52
+
53
+ ```tsx
54
+ <Search />
55
+ ```
56
+
57
+ ## Customization
58
+
59
+ ### Size
60
+
61
+ ```tsx
62
+ <Search size={24} />
63
+ <Search size={48} />
64
+ ```
65
+
66
+ ### Color
67
+
68
+ ```tsx
69
+ <Search color="red" />
70
+ <Search color="#0f95" />
71
+ ```
72
+
73
+ You can also use CSS classes:
74
+
75
+ ```tsx
76
+ <Search className="text-red-500" />
77
+ ```
78
+
79
+ ### Stroke Width
80
+
81
+ ```tsx
82
+ <Search strokeWidth={3} />
83
+ ```
84
+
85
+ ### Combining Props
86
+
87
+ ```tsx
88
+ <Search
89
+ size={48}
90
+ color="#0f95"
91
+ strokeWidth={3}
92
+ />
93
+ ```
94
+
95
+ ## SVG Props
96
+
97
+ Iconora icons support standard React SVG properties and event handlers where supported by React.
98
+
99
+ ```tsx
100
+ <Search
101
+ size={32}
102
+ className="my-icon"
103
+ aria-label="Search"
104
+ role="img"
105
+ onClick={handleClick}
106
+ />
107
+ ```
108
+
109
+ Common supported props include:
110
+
111
+ - `id`
112
+ - `style`
113
+ - `className`
114
+ - `role`
115
+ - `aria-label`
116
+ - `onClick`
117
+ - Standard React SVG attributes
118
+
119
+ ## TypeScript
120
+
121
+ Iconora includes TypeScript declarations for type safety and editor autocomplete.
122
+
123
+ ```tsx
124
+ import {
125
+ Search,
126
+ type IconProps,
127
+ } from "iconora";
128
+ ```
129
+
130
+ # Icon Source and Generation
131
+
132
+ Iconora uses SVG files as the source of truth.
133
+
134
+ ```text
135
+ icons/*.svg
136
+
137
+
138
+ npm run validate
139
+
140
+
141
+ npm run generate
142
+
143
+ ├── TSX icons
144
+ ├── index.ts
145
+ └── metadata
146
+
147
+
148
+ npm run check
149
+
150
+ ├── typecheck
151
+ ├── tests
152
+ └── build
153
+
154
+
155
+ Iconora
156
+ ```
157
+
158
+ Generated files should normally not be edited manually. Changes should be made to the SVG source files and then regenerated.
159
+
160
+ ## Importing Icons from Lucide
161
+
162
+ Iconora includes a CLI command for importing and deriving SVG icons from the Lucide GitHub repository:
163
+
164
+ ```bash
165
+ npm run import:lucide
166
+ ```
167
+
168
+ The command imports the Lucide SVG sources into:
169
+
170
+ ```text
171
+ icons/
172
+ ```
173
+
174
+ It does not directly create the final React components.
175
+
176
+ ### Lucide Import Workflow
177
+
178
+ ```bash
179
+ npm run import:lucide
180
+ npm run validate
181
+ npm run generate
182
+ npm run check
183
+ ```
184
+
185
+ The responsibilities are:
186
+
187
+ | Command | Responsibility |
188
+ |---|---|
189
+ | `npm run import:lucide` | Import and derive Lucide SVG sources into Iconora |
190
+ | `npm run validate` | Validate Iconora SVG sources |
191
+ | `npm run generate` | Convert SVG sources into React/TypeScript components |
192
+ | `npm run check` | Run type checking, tests, and production build |
193
+
194
+ This keeps external icon acquisition separate from Iconora's React component generation.
195
+
196
+ # Adding Icons
197
+
198
+ Add an SVG to:
199
+
200
+ ```text
201
+ icons/
202
+ ```
203
+
204
+ For example:
205
+
206
+ ```text
207
+ icons/
208
+ ├── search.svg
209
+ ├── x.svg
210
+ └── home.svg
211
+ ```
212
+
213
+ The filename determines the generated component name:
214
+
215
+ ```text
216
+ search.svg → Search
217
+ x.svg → X
218
+ home.svg → Home
219
+ arrow-left.svg → ArrowLeft
220
+ chevron-down.svg → ChevronDown
221
+ ```
222
+
223
+ ### 1. Validate
224
+
225
+ ```bash
226
+ npm run validate
227
+ ```
228
+
229
+ ### 2. Generate
230
+
231
+ ```bash
232
+ npm run generate
233
+ ```
234
+
235
+ This generates the corresponding React/TypeScript component and updates:
236
+
237
+ ```text
238
+ src/icons/
239
+ src/index.ts
240
+ src/metadata/icons.json
241
+ ```
242
+
243
+ For example:
244
+
245
+ ```text
246
+ icons/home.svg
247
+
248
+ src/icons/Home.tsx
249
+ ```
250
+
251
+ ### 3. Verify
252
+
253
+ ```bash
254
+ npm run check
255
+ ```
256
+
257
+ The `check` command runs:
258
+
259
+ ```text
260
+ npm run typecheck
261
+ npm run test:run
262
+ npm run build
263
+ ```
264
+
265
+ Do not manually edit generated files:
266
+
267
+ ```text
268
+ src/icons/
269
+ src/index.ts
270
+ src/metadata/icons.json
271
+ ```
272
+
273
+ If an icon needs to change, update its SVG source and run `npm run generate` again.
274
+
275
+ # Icon Metadata
276
+
277
+ Iconora provides metadata inspection through the `getMetadata` CLI.
278
+
279
+ ### Single Icon
280
+
281
+ ```bash
282
+ npm run getMetadata -- Search
283
+ ```
284
+
285
+ Icon names are case-insensitive:
286
+
287
+ ```bash
288
+ npm run getMetadata -- Search
289
+ npm run getMetadata -- search
290
+ npm run getMetadata -- SEARCH
291
+ ```
292
+
293
+ ### Multiple Icons
294
+
295
+ ```bash
296
+ npm run getMetadata -- Search X Home
297
+ ```
298
+
299
+ You can also use:
300
+
301
+ ```bash
302
+ npm run getMetadata -- --Search --X --Home
303
+ ```
304
+
305
+ ### All Icons
306
+
307
+ ```bash
308
+ npm run getMetadata -- --all
309
+ ```
310
+
311
+ Metadata is read from:
312
+
313
+ ```text
314
+ src/metadata/icons.json
315
+ ```
316
+
317
+ The command is read-only and does not modify the icon collection.
318
+
319
+ # Removing Icons
320
+
321
+ ### Remove an Icon Completely
322
+
323
+ ```bash
324
+ npm run delete -- Search
325
+ ```
326
+
327
+ This removes the SVG source, generated component, export, and metadata entry for the icon.
328
+
329
+ Icon names are case-insensitive.
330
+
331
+ ### Selective Deletion
332
+
333
+ Delete only the SVG:
334
+
335
+ ```bash
336
+ npm run delete -- --Search svg
337
+ ```
338
+
339
+ Delete only the generated TSX:
340
+
341
+ ```bash
342
+ npm run delete -- --Search tsx
343
+ ```
344
+
345
+ Delete only metadata:
346
+
347
+ ```bash
348
+ npm run delete -- --Search metadata
349
+ ```
350
+
351
+ Delete multiple parts:
352
+
353
+ ```bash
354
+ npm run delete -- --Search svg tsx
355
+ ```
356
+
357
+ Selective deletion can leave generated files out of sync. For normal icon removal, use the full deletion command.
358
+
359
+ # Development
360
+
361
+ Clone the repository:
362
+
363
+ ```bash
364
+ git clone <repository-url>
365
+ cd iconora
366
+ ```
367
+
368
+ Install dependencies:
369
+
370
+ ```bash
371
+ npm install
372
+ ```
373
+
374
+ ## Development Commands
375
+
376
+ ### Import Lucide Icons
377
+
378
+ ```bash
379
+ npm run import:lucide
380
+ ```
381
+
382
+ ### Validate Icons
383
+
384
+ ```bash
385
+ npm run validate
386
+ ```
387
+
388
+ ### Generate Icons
389
+
390
+ ```bash
391
+ npm run generate
392
+ ```
393
+
394
+ ### Delete an Icon
395
+
396
+ ```bash
397
+ npm run delete -- IconName
398
+ ```
399
+
400
+ ### Get Icon Metadata
401
+
402
+ ```bash
403
+ npm run getMetadata -- IconName
404
+ ```
405
+
406
+ ### Run Full Project Check
407
+
408
+ ```bash
409
+ npm run check
410
+ ```
411
+
412
+ ### Typecheck
413
+
414
+ ```bash
415
+ npm run typecheck
416
+ ```
417
+
418
+ ### Run Tests Once
419
+
420
+ ```bash
421
+ npm run test:run
422
+ ```
423
+
424
+ ### Run Tests in Development Mode
425
+
426
+ ```bash
427
+ npm run test
428
+ ```
429
+
430
+ ### Run Tests in Watch Mode
431
+
432
+ ```bash
433
+ npm run test:watch
434
+ ```
435
+
436
+ ### Build the Package
437
+
438
+ ```bash
439
+ npm run build
440
+ ```
441
+
442
+ For detailed command documentation, see:
443
+
444
+ ```text
445
+ docs/commands.md
446
+ ```
447
+
448
+ # Project Structure
449
+
450
+ ```text
451
+ iconora/
452
+ ├── icons/
453
+ │ ├── search.svg
454
+ │ └── x.svg
455
+
456
+ ├── src/
457
+ │ ├── components/
458
+ │ │ └── IconBase.tsx
459
+ │ ├── icons/
460
+ │ │ ├── Search.tsx
461
+ │ │ └── X.tsx
462
+ │ ├── metadata/
463
+ │ │ ├── icons.json
464
+ │ │ └── types.ts
465
+ │ ├── types.ts
466
+ │ └── index.ts
467
+
468
+ ├── scripts/
469
+ │ ├── check.ts
470
+ │ ├── delete-icons.ts
471
+ │ ├── generate-icons.ts
472
+ │ ├── get-metadata.ts
473
+ │ └── validate-icons.ts
474
+
475
+ ├── tests/
476
+ │ ├── icons.test.tsx
477
+ │ └── setup.ts
478
+
479
+ ├── docs/
480
+ │ └── commands.md
481
+
482
+ ├── .gitignore
483
+ ├── LICENSE
484
+ ├── README.md
485
+ ├── package.json
486
+ ├── package-lock.json
487
+ ├── tsconfig.json
488
+ └── tsup.config.ts
489
+ ```
490
+
491
+ # Production Verification
492
+
493
+ Before publishing a new version:
494
+
495
+ ```bash
496
+ npm run validate
497
+ npm run generate
498
+ npm run check
499
+ ```
500
+
501
+ All commands should complete successfully before publishing.
502
+
503
+ # Roadmap
504
+
505
+ - [x] Initial npm package setup
506
+ - [x] TypeScript support
507
+ - [x] React support
508
+ - [x] SVG icon architecture
509
+ - [x] Initial icons
510
+ - [x] Local package testing
511
+ - [x] Automated SVG validation
512
+ - [x] Automated SVG → TSX generation
513
+ - [x] Automatic icon exports
514
+ - [x] Automatic icon metadata generation
515
+ - [x] Aggregated icon tests
516
+ - [x] Type checking
517
+ - [x] ESM build
518
+ - [x] CommonJS build
519
+ - [x] Type declaration generation
520
+ - [x] Icon deletion CLI
521
+ - [x] Metadata inspection CLI
522
+ - [x] Project verification CLI
523
+ - [x] Command documentation
524
+ - [ ] Expand icon collection
525
+ - [ ] Add continuous integration
526
+ - [ ] Improve package tooling
527
+ - [ ] Expand documentation
528
+ - [ ] Build Iconora documentation website
529
+
530
+ # Contributing
531
+
532
+ Contributions, suggestions, bug reports, and new icon ideas are welcome.
533
+
534
+ To contribute a new icon:
535
+
536
+ 1. Add the SVG to `icons/`.
537
+ 2. Run `npm run validate`.
538
+ 3. Run `npm run generate`.
539
+ 4. Run `npm run check`.
540
+ 5. Submit your changes.
541
+
542
+ Please do not manually edit generated icon files unless you are working on the generation system itself.
543
+
544
+ # Documentation
545
+
546
+ Detailed CLI documentation is available in:
547
+
548
+ ```text
549
+ docs/commands.md
550
+ ```
551
+
552
+ It covers:
553
+
554
+ - SVG validation
555
+ - Icon generation
556
+ - Icon deletion
557
+ - Metadata generation
558
+ - Metadata inspection
559
+ - Project verification
560
+ - Type checking
561
+ - Testing
562
+ - Test watch mode
563
+ - Production builds
564
+ - Development workflows
565
+
566
+ # License
567
+
568
+ Iconora is released under the MIT License.
569
+
570
+ See the [LICENSE](LICENSE) file for the complete license text.
571
+
572
+ # External Sources
573
+
574
+ Iconora can derive icon sources from external open-source icon repositories such as Lucide. The licensing and attribution requirements of each upstream source apply to its respective assets.
575
+
576
+ ---
577
+
578
+ Made with ❤️ for React developers.
579
+
580
+ **Iconora Simple icons. Your way.**