@atls-ui-generators/icons 1.2.2 → 1.2.4

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 (85) hide show
  1. package/CHANGELOG.md +34 -102
  2. package/dist/commands/base-icons.command.d.ts +1 -1
  3. package/dist/commands/base-icons.command.js +1 -0
  4. package/dist/commands/generate-icons.command.js +2 -1
  5. package/dist/commands/generate-replacements.command.js +1 -0
  6. package/dist/commands/index.js +2 -2
  7. package/dist/index.js +2 -2
  8. package/dist/replacement-utils/build-replacements/build-replacements.d.ts +3 -0
  9. package/dist/replacement-utils/build-replacements/index.d.ts +1 -1
  10. package/dist/replacement-utils/build-replacements/index.js +1 -1
  11. package/dist/replacement-utils/create-replacement-icon-colors/create-replacement-icon-colors.d.ts +3 -0
  12. package/dist/replacement-utils/create-replacement-icon-colors/{create-replacement-icon-colors.util.js → create-replacement-icon-colors.js} +1 -1
  13. package/dist/replacement-utils/create-replacement-icon-colors/index.d.ts +1 -1
  14. package/dist/replacement-utils/create-replacement-icon-colors/index.js +1 -1
  15. package/dist/replacement-utils/create-replacements/create-replacements.d.ts +3 -0
  16. package/dist/replacement-utils/create-replacements/index.cjs +1 -1
  17. package/dist/replacement-utils/create-replacements/index.d.cts +1 -1
  18. package/dist/replacement-utils/create-replacements/index.d.ts +1 -1
  19. package/dist/replacement-utils/create-replacements/index.js +1 -1
  20. package/dist/replacement-utils/create-replacements/tests/create-replacements.test.interfaces.d.ts +1 -1
  21. package/dist/replacement-utils/get-color-replacement/get-color-replacement.d.ts +2 -0
  22. package/dist/replacement-utils/get-color-replacement/index.cjs +1 -1
  23. package/dist/replacement-utils/get-color-replacement/index.d.cts +1 -1
  24. package/dist/replacement-utils/get-color-replacement/index.d.ts +1 -1
  25. package/dist/replacement-utils/get-color-replacement/index.js +1 -1
  26. package/dist/replacement-utils/index.js +4 -4
  27. package/dist/replacement-utils/write-replacements-file/index.d.ts +1 -1
  28. package/dist/replacement-utils/write-replacements-file/index.js +1 -1
  29. package/dist/replacement-utils/write-replacements-file/{write-replacements-file.util.d.ts → write-replacements-file.d.ts} +1 -1
  30. package/dist/svgr-utils/{build-svgr.util.d.ts → build-svgr.d.ts} +1 -1
  31. package/dist/svgr-utils/{build-svgr.util.js → build-svgr.js} +2 -2
  32. package/dist/svgr-utils/compile-icons/{compile-icons.constants.js → constants.js} +8 -2
  33. package/dist/svgr-utils/compile-icons/{compile-icon-jsx.util.d.ts → icon-jsx.d.ts} +1 -1
  34. package/dist/svgr-utils/compile-icons/{compile-icon-jsx.util.js → icon-jsx.js} +2 -2
  35. package/dist/svgr-utils/compile-icons/icons.d.ts +4 -0
  36. package/dist/svgr-utils/compile-icons/{compile-icons.util.js → icons.js} +6 -6
  37. package/dist/svgr-utils/compile-icons/index.d.ts +3 -3
  38. package/dist/svgr-utils/compile-icons/index.js +3 -3
  39. package/dist/svgr-utils/compile-icons/interfaces.d.ts +2 -0
  40. package/dist/svgr-utils/{discover-icons.util.d.ts → discover-icons.d.ts} +1 -1
  41. package/dist/svgr-utils/get-svg-colors/constants.d.ts +1 -0
  42. package/dist/svgr-utils/get-svg-colors/constants.js +1 -0
  43. package/dist/svgr-utils/get-svg-colors/{extract-color-from-element.helper.d.ts → extract-color-from-element.d.ts} +2 -2
  44. package/dist/svgr-utils/get-svg-colors/{extract-color-from-element.helper.js → extract-color-from-element.js} +2 -2
  45. package/dist/svgr-utils/get-svg-colors/{get-svg-colors.util.d.ts → get-svg-colors.d.ts} +1 -1
  46. package/dist/svgr-utils/get-svg-colors/{get-svg-colors.util.js → get-svg-colors.js} +3 -3
  47. package/dist/svgr-utils/get-svg-colors/{validate-color.helper.d.ts → helpers/validate-color.d.ts} +1 -1
  48. package/dist/svgr-utils/get-svg-colors/index.d.ts +2 -2
  49. package/dist/svgr-utils/get-svg-colors/index.js +1 -1
  50. package/dist/svgr-utils/get-svg-colors/interfaces.js +1 -0
  51. package/dist/svgr-utils/index.d.ts +2 -2
  52. package/dist/svgr-utils/index.js +4 -4
  53. package/dist/svgr-utils/{write-compiled-icons.util.d.ts → write-compiled-icons.d.ts} +1 -1
  54. package/dist/svgr-utils/{write-compiled-icons.util.js → write-compiled-icons.js} +1 -1
  55. package/package.json +9 -7
  56. package/dist/replacement-utils/build-replacements/build-replacements.util.d.ts +0 -3
  57. package/dist/replacement-utils/create-replacement-icon-colors/create-replacement-icon-colors.util.d.ts +0 -3
  58. package/dist/replacement-utils/create-replacements/create-replacements.util.d.ts +0 -3
  59. package/dist/replacement-utils/get-color-replacement/get-color-replacement.util.d.ts +0 -2
  60. package/dist/svgr-utils/compile-icons/compile-icons.util.d.ts +0 -4
  61. package/dist/svgr-utils/get-svg-colors/get-svg-colors.constants.d.ts +0 -1
  62. package/dist/svgr-utils/get-svg-colors/get-svg-colors.constants.js +0 -1
  63. /package/dist/{icons.generator.d.ts → generator.d.ts} +0 -0
  64. /package/dist/{icons.generator.js → generator.js} +0 -0
  65. /package/dist/{icons.interfaces.d.ts → interfaces.d.ts} +0 -0
  66. /package/dist/{icons.interfaces.js → interfaces.js} +0 -0
  67. /package/dist/replacement-utils/build-replacements/{build-replacements.util.js → build-replacements.js} +0 -0
  68. /package/dist/replacement-utils/create-replacement-icon-colors/{create-replacement-icon-colors.constants.d.ts → constants.d.ts} +0 -0
  69. /package/dist/replacement-utils/create-replacement-icon-colors/{create-replacement-icon-colors.constants.js → constants.js} +0 -0
  70. /package/dist/replacement-utils/create-replacements/{create-replacements.util.cjs → create-replacements.cjs} +0 -0
  71. /package/dist/replacement-utils/create-replacements/{create-replacements.util.d.cts → create-replacements.d.cts} +0 -0
  72. /package/dist/replacement-utils/create-replacements/{create-replacements.util.js → create-replacements.js} +0 -0
  73. /package/dist/replacement-utils/get-color-replacement/{get-color-replacement.util.cjs → get-color-replacement.cjs} +0 -0
  74. /package/dist/replacement-utils/get-color-replacement/{get-color-replacement.util.d.cts → get-color-replacement.d.cts} +0 -0
  75. /package/dist/replacement-utils/get-color-replacement/{get-color-replacement.util.js → get-color-replacement.js} +0 -0
  76. /package/dist/replacement-utils/get-color-replacement/{get-color-replacement.interfaces.d.ts → interfaces.d.ts} +0 -0
  77. /package/dist/replacement-utils/get-color-replacement/{get-color-replacement.interfaces.js → interfaces.js} +0 -0
  78. /package/dist/replacement-utils/write-replacements-file/{write-replacements-file.util.js → write-replacements-file.js} +0 -0
  79. /package/dist/svgr-utils/compile-icons/{compile-icons.constants.d.ts → constants.d.ts} +0 -0
  80. /package/dist/svgr-utils/{get-svg-colors/get-svg-colors.interfaces.js → compile-icons/interfaces.js} +0 -0
  81. /package/dist/svgr-utils/compile-icons/{compile-icons.template.d.ts → template.d.ts} +0 -0
  82. /package/dist/svgr-utils/compile-icons/{compile-icons.template.js → template.js} +0 -0
  83. /package/dist/svgr-utils/{discover-icons.util.js → discover-icons.js} +0 -0
  84. /package/dist/svgr-utils/get-svg-colors/{validate-color.helper.js → helpers/validate-color.js} +0 -0
  85. /package/dist/svgr-utils/get-svg-colors/{get-svg-colors.interfaces.d.ts → interfaces.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,166 +1,98 @@
1
+ ## [1.2.3](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.2.2...@atls-ui-generators/icons@1.2.3) (2026-09-09)
1
2
 
3
+ ### Bug Fixes
2
4
 
3
- ## [1.2.2](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.2.1...@atls-ui-generators/icons@1.2.2) (2025-10-09)
4
-
5
-
6
-
7
-
5
+ - **atls-ui-generators:** return cheerio generator instead of regex ([5d548f7](https://github.com/atls/hyperion/commit/5d548f71935d6170d805a4ca8e16a99d89b0104a))
6
+ - **atls-ui-generators:** stabilize icon generation ([b3e16c6](https://github.com/atls/hyperion/commit/b3e16c6d3b8c5ae522cd6359201c67066ca03d58))
7
+ - **icons:** declare svgr plugin dependencies ([afb9201](https://github.com/atls/hyperion/commit/afb9201d900e5f55e2db802816f26d986bd5242b))
8
8
 
9
+ ## [1.2.2](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.2.2...@atls-ui-generators/icons@1.2.2) (2026-06-12)
9
10
 
11
+ ## [1.2.2](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.2.2...@atls-ui-generators/icons@1.2.2) (2025-10-25)
10
12
 
13
+ ## [1.2.2](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.2.1...@atls-ui-generators/icons@1.2.2) (2025-10-09)
11
14
 
12
15
  ## [1.2.2] (2025-10-10)
13
16
 
14
-
15
17
  ### BREAKING CHANGES
16
18
 
17
-
18
- * Requires React version 18 or higher for proper component functionality
19
-
19
+ - Requires React version 18 or higher for proper component functionality
20
20
 
21
21
  ## [1.2.1](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.8...@atls-ui-generators/icons@1.2.1) (2025-09-23)
22
22
 
23
-
24
23
  ### Features
25
24
 
26
-
27
- * **generator:** add check what output directory exists ([01c40fb](https://github.com/atls/hyperion/commit/01c40fb7d3e8c601569b8c6b9be23b30bcfc2027))
28
- * **generator:** add clipanion generate icons command ([e7fa72b](https://github.com/atls/hyperion/commit/e7fa72beb296402c7b14340b62543994e24b8d3e))
29
- * **generator:** add generate replacements command to icons generator ([70529f3](https://github.com/atls/hyperion/commit/70529f3a4fc1c179349ea76bcd4ff145da11e353))
30
-
31
-
32
-
33
-
25
+ - **generator:** add check what output directory exists ([01c40fb](https://github.com/atls/hyperion/commit/01c40fb7d3e8c601569b8c6b9be23b30bcfc2027))
26
+ - **generator:** add clipanion generate icons command ([e7fa72b](https://github.com/atls/hyperion/commit/e7fa72beb296402c7b14340b62543994e24b8d3e))
27
+ - **generator:** add generate replacements command to icons generator ([70529f3](https://github.com/atls/hyperion/commit/70529f3a4fc1c179349ea76bcd4ff145da11e353))
34
28
 
35
29
  ## [1.1.8](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.6...@atls-ui-generators/icons@1.1.8) (2025-06-30)
36
30
 
37
-
38
31
  ### Bug Fixes
39
32
 
40
-
41
- * **icons:** generator template ([78c04b6](https://github.com/atls/hyperion/commit/78c04b6951a51f0bbcded17dd2da85082da9a49f))
42
-
43
-
44
-
45
-
33
+ - **icons:** generator template ([78c04b6](https://github.com/atls/hyperion/commit/78c04b6951a51f0bbcded17dd2da85082da9a49f))
46
34
 
47
35
  ## [1.1.6](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.6...@atls-ui-generators/icons@1.1.6) (2025-06-30)
48
36
 
49
-
50
37
  ### Bug Fixes
51
38
 
52
-
53
- * **icons:** generator template ([78c04b6](https://github.com/atls/hyperion/commit/78c04b6951a51f0bbcded17dd2da85082da9a49f))
54
-
55
-
56
-
57
-
39
+ - **icons:** generator template ([78c04b6](https://github.com/atls/hyperion/commit/78c04b6951a51f0bbcded17dd2da85082da9a49f))
58
40
 
59
41
  ## [1.1.6](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.5...@atls-ui-generators/icons@1.1.6) (2025-06-24)
60
42
 
61
-
62
43
  ### Features
63
44
 
64
-
65
- * **icons:** add added color extraction from theme via icon sprinkles ([2f37178](https://github.com/atls/hyperion/commit/2f37178dabc502d922db0172a75ae2c5da6e2a5c))
66
-
67
-
68
-
69
-
45
+ - **icons:** add added color extraction from theme via icon sprinkles ([2f37178](https://github.com/atls/hyperion/commit/2f37178dabc502d922db0172a75ae2c5da6e2a5c))
70
46
 
71
47
  ## [1.1.5](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.3...@atls-ui-generators/icons@1.1.5) (2025-04-29)
72
48
 
73
-
74
-
75
-
76
-
77
-
78
49
  ## [1.1.3](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.3...@atls-ui-generators/icons@1.1.3) (2025-04-28)
79
50
 
80
-
81
-
82
-
83
-
84
-
85
51
  ## [1.1.3](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.2...@atls-ui-generators/icons@1.1.3) (2025-04-10)
86
52
 
87
-
88
-
89
-
90
-
91
-
92
53
  ## [1.1.2](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.0...@atls-ui-generators/icons@1.1.2) (2025-03-14)
93
54
 
94
-
95
55
  ### Bug Fixes
96
56
 
97
-
98
- * **generators:** errors ([#602](https://github.com/atls/hyperion/issues/602)) ([ecbce14](https://github.com/atls/hyperion/commit/ecbce14ed6be459b40c17e089547bf921e1bf7ed))
99
-
100
-
101
-
102
-
57
+ - **generators:** errors ([#602](https://github.com/atls/hyperion/issues/602)) ([ecbce14](https://github.com/atls/hyperion/commit/ecbce14ed6be459b40c17e089547bf921e1bf7ed))
103
58
 
104
59
  # [1.1.0](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.0...@atls-ui-generators/icons@1.1.0) (2025-03-14)
105
60
 
106
-
107
61
  ### Bug Fixes
108
62
 
109
-
110
- * **generators:** errors ([#602](https://github.com/atls/hyperion/issues/602)) ([ecbce14](https://github.com/atls/hyperion/commit/ecbce14ed6be459b40c17e089547bf921e1bf7ed))
111
-
112
-
113
-
114
-
63
+ - **generators:** errors ([#602](https://github.com/atls/hyperion/issues/602)) ([ecbce14](https://github.com/atls/hyperion/commit/ecbce14ed6be459b40c17e089547bf921e1bf7ed))
115
64
 
116
65
  # [1.1.0](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.0.5...@atls-ui-generators/icons@1.1.0) (2025-03-13)
117
66
 
118
-
119
67
  ### Features
120
68
 
121
-
122
- * **generators:** icons generator ([#600](https://github.com/atls/hyperion/issues/600)) ([931f921](https://github.com/atls/hyperion/commit/931f921489d382f9a4e0a37c39d6082ed131f3f9))
123
-
124
-
125
-
126
-
69
+ - **generators:** icons generator ([#600](https://github.com/atls/hyperion/issues/600)) ([931f921](https://github.com/atls/hyperion/commit/931f921489d382f9a4e0a37c39d6082ed131f3f9))
127
70
 
128
71
  ## [1.0.5](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.0.4...@atls-ui-generators/icons@1.0.5) (2025-02-19)
129
72
 
130
-
131
73
  ### Bug Fixes
132
74
 
133
-
134
- * **hyperion:** lintter and tests ([#593](https://github.com/atls/hyperion/issues/593)) ([a01c488](https://github.com/atls/hyperion/commit/a01c488064d6386f754aafd2eecb28a19396635e))
135
-
136
-
137
-
138
-
75
+ - **hyperion:** lintter and tests ([#593](https://github.com/atls/hyperion/issues/593)) ([a01c488](https://github.com/atls/hyperion/commit/a01c488064d6386f754aafd2eecb28a19396635e))
139
76
 
140
77
  ## 1.0.4 (2025-01-09)
141
78
 
142
-
143
79
  ### Bug Fixes
144
80
 
145
-
146
- * changed import when generating icons ([c14fd17](https://github.com/atls/hyperion/commit/c14fd172ff72e35b3a32286961762999accde772))
147
- * formatter ([1c9d8d0](https://github.com/atls/hyperion/commit/1c9d8d0b86f101059f77da921ee24199764872b8))
148
- * **icons-generator:** replacements condition ([dbb255d](https://github.com/atls/hyperion/commit/dbb255db964698fb41c43226bd5ddd8688e966b3))
149
- * linter and typecheck ([e379724](https://github.com/atls/hyperion/commit/e379724b7dbf3c8cba2b0b94647239b0b37c5fb8))
150
- * **ui:** typecheck ([1a2a36b](https://github.com/atls/hyperion/commit/1a2a36b8baeececd0b929dcdb94da3d38ae8ad1e))
151
- * up version input and icons packages ([a01bfcd](https://github.com/atls/hyperion/commit/a01bfcd0002f94b210aa49b430ba567c83b9c396))
152
- * versions ([ff7bdbb](https://github.com/atls/hyperion/commit/ff7bdbb281c9f6e732b06461a0c633c8cc010e46))
153
- * versions ([96526ce](https://github.com/atls/hyperion/commit/96526cec1a282886dee66adcf35429abac2cb6d6))
154
- * versions and error handlers for generators ([8b868f2](https://github.com/atls/hyperion/commit/8b868f2f1ec28f2f4ca71ab8c5f1e958fef0533f))
81
+ - changed import when generating icons ([c14fd17](https://github.com/atls/hyperion/commit/c14fd172ff72e35b3a32286961762999accde772))
82
+ - formatter ([1c9d8d0](https://github.com/atls/hyperion/commit/1c9d8d0b86f101059f77da921ee24199764872b8))
83
+ - **icons-generator:** replacements condition ([dbb255d](https://github.com/atls/hyperion/commit/dbb255db964698fb41c43226bd5ddd8688e966b3))
84
+ - linter and typecheck ([e379724](https://github.com/atls/hyperion/commit/e379724b7dbf3c8cba2b0b94647239b0b37c5fb8))
85
+ - **ui:** typecheck ([1a2a36b](https://github.com/atls/hyperion/commit/1a2a36b8baeececd0b929dcdb94da3d38ae8ad1e))
86
+ - up version input and icons packages ([a01bfcd](https://github.com/atls/hyperion/commit/a01bfcd0002f94b210aa49b430ba567c83b9c396))
87
+ - versions ([ff7bdbb](https://github.com/atls/hyperion/commit/ff7bdbb281c9f6e732b06461a0c633c8cc010e46))
88
+ - versions ([96526ce](https://github.com/atls/hyperion/commit/96526cec1a282886dee66adcf35429abac2cb6d6))
89
+ - versions and error handlers for generators ([8b868f2](https://github.com/atls/hyperion/commit/8b868f2f1ec28f2f4ca71ab8c5f1e958fef0533f))
155
90
 
156
91
  ### Features
157
92
 
158
-
159
- * add readme ([4ab2312](https://github.com/atls/hyperion/commit/4ab2312d6d395e2a8309b264c26174671f68a047))
160
- * **icons-generator:** init ([77e013e](https://github.com/atls/hyperion/commit/77e013e926b05e042c905514d17d481fe5df98c6))
161
- * memo for icons, glob as dependency ([70ad226](https://github.com/atls/hyperion/commit/70ad226932df31366baaad3477fa89fef99f8cc9))
162
- * README.md badges. Yarn, code services and prettier plugin bump, ([e53ab99](https://github.com/atls/hyperion/commit/e53ab99652123c14ac8ae844078a5fc9c4e98be2))
163
- * **ui-parts:** add create-container-styles util to theme ([#590](https://github.com/atls/hyperion/issues/590)) ([34064a3](https://github.com/atls/hyperion/commit/34064a384192b781fd6d667857f568d4f42228a4))
164
- * updated @atls-ui-generators/icons ([3a4930c](https://github.com/atls/hyperion/commit/3a4930cc50a014053929b1a7053d79f708469fa6))
165
-
166
-
93
+ - add readme ([4ab2312](https://github.com/atls/hyperion/commit/4ab2312d6d395e2a8309b264c26174671f68a047))
94
+ - **icons-generator:** init ([77e013e](https://github.com/atls/hyperion/commit/77e013e926b05e042c905514d17d481fe5df98c6))
95
+ - memo for icons, glob as dependency ([70ad226](https://github.com/atls/hyperion/commit/70ad226932df31366baaad3477fa89fef99f8cc9))
96
+ - README.md badges. Yarn, code services and prettier plugin bump, ([e53ab99](https://github.com/atls/hyperion/commit/e53ab99652123c14ac8ae844078a5fc9c4e98be2))
97
+ - **ui-parts:** add create-container-styles util to theme ([#590](https://github.com/atls/hyperion/issues/590)) ([34064a3](https://github.com/atls/hyperion/commit/34064a384192b781fd6d667857f568d4f42228a4))
98
+ - updated @atls-ui-generators/icons ([3a4930c](https://github.com/atls/hyperion/commit/3a4930cc50a014053929b1a7053d79f708469fa6))
@@ -1,4 +1,4 @@
1
- import type { ResolvedIconsPath } from '../icons.interfaces.js';
1
+ import type { ResolvedIconsPath } from '../interfaces.js';
2
2
  import { Command } from 'clipanion';
3
3
  export declare class BaseIconsCommand extends Command {
4
4
  static readonly usage: import("clipanion").Usage;
@@ -27,6 +27,7 @@ export class BaseIconsCommand extends Command {
27
27
  }
28
28
  catch (error) {
29
29
  this.logger.error(error);
30
+ process.exitCode = 1;
30
31
  }
31
32
  }
32
33
  }
@@ -30,7 +30,7 @@ export class GenerateIconsCommand extends BaseIconsCommand {
30
30
  assert.ok(lstatSync(replacementsPath).isFile(), 'Replacements path should point to a file');
31
31
  this.logger.info(`Extract replacements from ${replacementsPath}`);
32
32
  const exports = processFile(replacementsPath);
33
- replacements = Object.values(exports)?.[0];
33
+ replacements = Object.values(exports)[0];
34
34
  }
35
35
  this.logger.info(`Icon generation started into ${outputPath}`);
36
36
  await buildSvgr(iconsPath, outputPath, replacements);
@@ -38,6 +38,7 @@ export class GenerateIconsCommand extends BaseIconsCommand {
38
38
  }
39
39
  catch (error) {
40
40
  this.logger.error(error);
41
+ process.exitCode = 1;
41
42
  }
42
43
  }
43
44
  }
@@ -26,6 +26,7 @@ export class GenerateReplacementsCommand extends BaseIconsCommand {
26
26
  }
27
27
  catch (error) {
28
28
  this.logger.error(error);
29
+ process.exitCode = 1;
29
30
  }
30
31
  }
31
32
  }
@@ -1,2 +1,2 @@
1
- export * from "./generate-icons.command.js";
2
- export * from "./generate-replacements.command.js";
1
+ export * from './generate-icons.command.js';
2
+ export * from './generate-replacements.command.js';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./replacement-utils/index.js";
2
- export * from "./svgr-utils/index.js";
1
+ export * from './replacement-utils/index.js';
2
+ export * from './svgr-utils/index.js';
@@ -0,0 +1,3 @@
1
+ import type { Icon } from '../../interfaces.js';
2
+ import type { Replacements } from '../../interfaces.js';
3
+ export declare const buildReplacements: (icons: Array<Icon>) => Promise<Replacements>;
@@ -1 +1 @@
1
- export * from './build-replacements.util.js';
1
+ export * from './build-replacements.js';
@@ -1 +1 @@
1
- export * from "./build-replacements.util.js";
1
+ export * from './build-replacements.js';
@@ -0,0 +1,3 @@
1
+ import type { Icon } from '../../interfaces.js';
2
+ import type { ReplacementIconColors } from '../../interfaces.js';
3
+ export declare const createReplacementIconColors: (icons: Array<Icon>) => Promise<ReplacementIconColors>;
@@ -1,6 +1,6 @@
1
1
  import { compileIconJsx } from '../../svgr-utils/index.js';
2
2
  import { getSvgColors } from '../../svgr-utils/index.js';
3
- import { getSvgColorsOptions } from './create-replacement-icon-colors.constants.js';
3
+ import { getSvgColorsOptions } from './constants.js';
4
4
  export const createReplacementIconColors = async (icons) => {
5
5
  const promises = icons.map(async (icon) => {
6
6
  const source = await compileIconJsx(icon);
@@ -1 +1 @@
1
- export * from './create-replacement-icon-colors.util.js';
1
+ export * from './create-replacement-icon-colors.js';
@@ -1 +1 @@
1
- export * from "./create-replacement-icon-colors.util.js";
1
+ export * from './create-replacement-icon-colors.js';
@@ -0,0 +1,3 @@
1
+ import type { Replacements } from '../../interfaces.js';
2
+ import type { ReplacementIconColors } from '../../interfaces.js';
3
+ export declare const createReplacements: (replacementIconColors: ReplacementIconColors) => Replacements;
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./create-replacements.util.cjs"), exports);
17
+ __exportStar(require("./create-replacements.cjs"), exports);
@@ -1 +1 @@
1
- export * from './create-replacements.util.cjs';
1
+ export * from './create-replacements.cjs';
@@ -1 +1 @@
1
- export * from './create-replacements.util.js';
1
+ export * from './create-replacements.js';
@@ -1 +1 @@
1
- export * from "./create-replacements.util.js";
1
+ export * from './create-replacements.js';
@@ -1,4 +1,4 @@
1
- import type { Replacements } from '../../../icons.interfaces.js';
1
+ import type { Replacements } from '../../../interfaces.js';
2
2
  export interface TestCase {
3
3
  replacementIcons: Record<string, Array<string> | string>;
4
4
  expectedResult?: Replacements;
@@ -0,0 +1,2 @@
1
+ import type { GetColorReplacement } from './interfaces.js';
2
+ export declare const getColorReplacement: GetColorReplacement;
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./get-color-replacement.util.cjs"), exports);
17
+ __exportStar(require("./get-color-replacement.cjs"), exports);
@@ -1 +1 @@
1
- export * from './get-color-replacement.util.cjs';
1
+ export * from './get-color-replacement.cjs';
@@ -1 +1 @@
1
- export * from './get-color-replacement.util.js';
1
+ export * from './get-color-replacement.js';
@@ -1 +1 @@
1
- export * from "./get-color-replacement.util.js";
1
+ export * from './get-color-replacement.js';
@@ -1,4 +1,4 @@
1
- export * from "./build-replacements/index.js";
2
- export * from "./create-replacements/index.js";
3
- export * from "./get-color-replacement/index.js";
4
- export * from "./write-replacements-file/index.js";
1
+ export * from './build-replacements/index.js';
2
+ export * from './create-replacements/index.js';
3
+ export * from './get-color-replacement/index.js';
4
+ export * from './write-replacements-file/index.js';
@@ -1 +1 @@
1
- export * from './write-replacements-file.util.js';
1
+ export * from './write-replacements-file.js';
@@ -1 +1 @@
1
- export * from "./write-replacements-file.util.js";
1
+ export * from './write-replacements-file.js';
@@ -1,2 +1,2 @@
1
- import type { Replacements } from '../../icons.interfaces.js';
1
+ import type { Replacements } from '../../interfaces.js';
2
2
  export declare const writeReplacementsFile: (targetFile: string, replacements: Replacements) => void;
@@ -1,2 +1,2 @@
1
- import type { Replacements } from '../icons.interfaces.js';
1
+ import type { Replacements } from '../interfaces.js';
2
2
  export declare const buildSvgr: (iconsPath: string, targetDir: string, replacements: Replacements) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { compileIcons } from './compile-icons/index.js';
2
- import { discoverIcons } from './discover-icons.util.js';
3
- import { writeCompiledIcons } from './write-compiled-icons.util.js';
2
+ import { discoverIcons } from './discover-icons.js';
3
+ import { writeCompiledIcons } from './write-compiled-icons.js';
4
4
  export const buildSvgr = async (iconsPath, targetDir, replacements) => {
5
5
  const icons = await discoverIcons(iconsPath);
6
6
  const sources = await compileIcons(icons, replacements);
@@ -1,4 +1,10 @@
1
- import { svgrTemplate } from './compile-icons.template.js';
1
+ import { createRequire } from 'node:module';
2
+ import { svgrTemplate } from './template.js';
3
+ const require = createRequire(import.meta.url);
4
+ const svgoPlugin = require('@svgr/plugin-svgo');
5
+ const jsxPlugin = require('@svgr/plugin-jsx');
6
+ const prettierPlugin = require('@svgr/plugin-prettier');
7
+ const svgrTransformPlugins = [svgoPlugin, jsxPlugin, prettierPlugin];
2
8
  export const MASK_ID_PATTERN = /mask0/g;
3
9
  export const PROPS_SPREAD_FROM = '...props';
4
10
  export const PROPS_SPREAD_TO = '...otherProps';
@@ -8,7 +14,7 @@ export const svgrTransformConfig = {
8
14
  icon: true,
9
15
  typescript: true,
10
16
  template: svgrTemplate,
11
- plugins: ['@svgr/plugin-svgo', '@svgr/plugin-jsx', '@svgr/plugin-prettier'],
17
+ plugins: svgrTransformPlugins,
12
18
  svgProps: {
13
19
  className: `{clsx(className, String(otherProps.className || ''))}`,
14
20
  style: '{iconStyle}',
@@ -1,2 +1,2 @@
1
- import type { Icon } from '../../icons.interfaces.js';
1
+ import type { Icon } from '../../interfaces.js';
2
2
  export declare const compileIconJsx: (icon: Icon) => Promise<string>;
@@ -1,6 +1,6 @@
1
1
  import { transform } from '@svgr/core';
2
- import { MASK_ID_PATTERN } from './compile-icons.constants.js';
3
- import { svgrTransformConfig } from './compile-icons.constants.js';
2
+ import { MASK_ID_PATTERN } from './constants.js';
3
+ import { svgrTransformConfig } from './constants.js';
4
4
  export const compileIconJsx = async (icon) => transform(icon.source.replace(MASK_ID_PATTERN, icon.name), {
5
5
  ...svgrTransformConfig,
6
6
  template: ({ jsx }, { tpl }) => tpl `${jsx}`,
@@ -0,0 +1,4 @@
1
+ import type { Icon } from '../../interfaces.js';
2
+ import type { Replacements } from '../../interfaces.js';
3
+ import type { Source } from '../../interfaces.js';
4
+ export declare const compileIcons: (icons: Array<Icon>, replacements: Replacements) => Promise<Array<Source>>;
@@ -1,10 +1,10 @@
1
1
  import { transform } from '@svgr/core';
2
- import { MASK_ID_PATTERN } from './compile-icons.constants.js';
3
- import { PROPS_SPREAD_FROM } from './compile-icons.constants.js';
4
- import { PROPS_SPREAD_TO } from './compile-icons.constants.js';
5
- import { FIFTY_PLUS_PATTERN } from './compile-icons.constants.js';
6
- import { FIFTY_PLUS_REPLACEMENT } from './compile-icons.constants.js';
7
- import { svgrTransformConfig } from './compile-icons.constants.js';
2
+ import { MASK_ID_PATTERN } from './constants.js';
3
+ import { PROPS_SPREAD_FROM } from './constants.js';
4
+ import { PROPS_SPREAD_TO } from './constants.js';
5
+ import { FIFTY_PLUS_PATTERN } from './constants.js';
6
+ import { FIFTY_PLUS_REPLACEMENT } from './constants.js';
7
+ import { svgrTransformConfig } from './constants.js';
8
8
  export const compileIcons = async (icons, replacements) => {
9
9
  const promises = icons.map(async (icon) => {
10
10
  const transformed = await transform(icon.source, {
@@ -1,3 +1,3 @@
1
- export * from './compile-icon-jsx.util.js';
2
- export * from './compile-icons.template.js';
3
- export * from './compile-icons.util.js';
1
+ export * from './icon-jsx.js';
2
+ export * from './icons.js';
3
+ export * from './template.js';
@@ -1,3 +1,3 @@
1
- export * from "./compile-icon-jsx.util.js";
2
- export * from "./compile-icons.template.js";
3
- export * from "./compile-icons.util.js";
1
+ export * from './icon-jsx.js';
2
+ export * from './icons.js';
3
+ export * from './template.js';
@@ -0,0 +1,2 @@
1
+ import type { Config } from '@svgr/core';
2
+ export type SvgrPlugin = NonNullable<Config['plugins']>[number];
@@ -1,2 +1,2 @@
1
- import type { Icon } from '../icons.interfaces.js';
1
+ import type { Icon } from '../interfaces.js';
2
2
  export declare const discoverIcons: (svgDirectory: string) => Promise<Array<Icon>>;
@@ -0,0 +1 @@
1
+ export declare const styleColorAttributeKey = "style";
@@ -0,0 +1 @@
1
+ export const styleColorAttributeKey = 'style';
@@ -1,4 +1,4 @@
1
- import type { CheerioAPI } from 'cheerio';
1
+ import type { CheerioAPI } from 'cheerio/slim';
2
2
  import type { AnyNode } from 'domhandler';
3
- import type { GetSvgColorsOptions } from './get-svg-colors.interfaces.js';
3
+ import type { GetSvgColorsOptions } from './interfaces.js';
4
4
  export declare const extractColorFromElement: (cheerio: CheerioAPI, element: AnyNode, options: GetSvgColorsOptions) => Set<string>;
@@ -1,4 +1,4 @@
1
- import { STYLE_COLOR_ATTRIBUTE_KEY } from './get-svg-colors.constants.js';
1
+ import { styleColorAttributeKey } from './constants.js';
2
2
  export const extractColorFromElement = (cheerio, element, options) => {
3
3
  const colors = new Set();
4
4
  const attributes = cheerio(element).attr() ?? {};
@@ -6,7 +6,7 @@ export const extractColorFromElement = (cheerio, element, options) => {
6
6
  if (options.colorAttributes?.has(name)) {
7
7
  colors.add(value);
8
8
  }
9
- if (name === STYLE_COLOR_ATTRIBUTE_KEY) {
9
+ if (name === styleColorAttributeKey) {
10
10
  options.colorAttributes?.forEach((colorAttribute) => {
11
11
  colors.add(cheerio(element).css(colorAttribute) || '');
12
12
  });
@@ -1,2 +1,2 @@
1
- import type { GetSvgColorsOptions } from './get-svg-colors.interfaces.js';
1
+ import type { GetSvgColorsOptions } from './interfaces.js';
2
2
  export declare const getSvgColors: (source: string, options?: GetSvgColorsOptions) => Array<string>;
@@ -1,6 +1,6 @@
1
- import { load } from 'cheerio';
2
- import { extractColorFromElement } from './extract-color-from-element.helper.js';
3
- import { validateColor } from './validate-color.helper.js';
1
+ import { load } from 'cheerio/slim';
2
+ import { extractColorFromElement } from './extract-color-from-element.js';
3
+ import { validateColor } from './helpers/validate-color.js';
4
4
  export const getSvgColors = (source, options = {}) => {
5
5
  const colors = new Set();
6
6
  const cheerio = load(source, { xml: true });
@@ -1,2 +1,2 @@
1
- import type { GetSvgColorsOptions } from './get-svg-colors.interfaces.js';
1
+ import type { GetSvgColorsOptions } from '../interfaces.js';
2
2
  export declare const validateColor: (color: string, options: GetSvgColorsOptions) => boolean;
@@ -1,2 +1,2 @@
1
- export * from './get-svg-colors.util.js';
2
- export type * from './get-svg-colors.interfaces.js';
1
+ export * from './get-svg-colors.js';
2
+ export type * from './interfaces.js';
@@ -1 +1 @@
1
- export * from "./get-svg-colors.util.js";
1
+ export * from './get-svg-colors.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- export * from './build-svgr.util.js';
1
+ export * from './build-svgr.js';
2
2
  export * from './compile-icons/index.js';
3
- export * from './discover-icons.util.js';
3
+ export * from './discover-icons.js';
4
4
  export * from './get-svg-colors/index.js';
@@ -1,4 +1,4 @@
1
- export * from "./build-svgr.util.js";
2
- export * from "./compile-icons/index.js";
3
- export * from "./discover-icons.util.js";
4
- export * from "./get-svg-colors/index.js";
1
+ export * from './build-svgr.js';
2
+ export * from './compile-icons/index.js';
3
+ export * from './discover-icons.js';
4
+ export * from './get-svg-colors/index.js';
@@ -1,2 +1,2 @@
1
- import type { Source } from '../icons.interfaces.js';
1
+ import type { Source } from '../interfaces.js';
2
2
  export declare const writeCompiledIcons: (sources: Array<Source>, targetDir: string) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import fs from 'node:fs';
2
- import path from 'path';
2
+ import path from 'node:path';
3
3
  import { pretty } from '@atls-ui-generators/utils';
4
4
  const writeSourceFile = async (source, targetDir) => {
5
5
  const filename = path.join(targetDir, `${source.name}.tsx`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atls-ui-generators/icons",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "license": "BSD-3-Clause",
5
5
  "type": "module",
6
6
  "exports": {
@@ -19,32 +19,35 @@
19
19
  },
20
20
  "main": "dist/index.js",
21
21
  "bin": {
22
- "generate-icons": "dist/icons.generator.js"
22
+ "generate-icons": "dist/generator.js"
23
23
  },
24
24
  "files": [
25
25
  "dist"
26
26
  ],
27
27
  "scripts": {
28
28
  "build": "yarn library build",
29
- "generate-icons": "tsx src/icons.generator.ts",
29
+ "generate-icons": "tsx src/generator.ts",
30
30
  "prepack": "yarn run build",
31
31
  "postpack": "rm -rf dist"
32
32
  },
33
33
  "dependencies": {
34
- "@atls-ui-generators/utils": "1.0.5",
34
+ "@atls-ui-generators/utils": "1.0.6",
35
35
  "@svgr/core": "8.1.0",
36
+ "@svgr/plugin-jsx": "8.1.0",
37
+ "@svgr/plugin-prettier": "8.1.0",
38
+ "@svgr/plugin-svgo": "8.1.0",
36
39
  "@swc-node/register": "1.9.0",
37
40
  "@swc/core": "1.6.1",
38
41
  "cheerio": "1.1.2",
39
42
  "clipanion": "4.0.0-rc.4",
43
+ "domhandler": "5.0.3",
40
44
  "glob": "11.0.2",
41
45
  "is-svg": "6.1.0"
42
46
  },
43
47
  "devDependencies": {
44
48
  "@types/node": "22.15.3",
45
- "domhandler": "5.0.3",
46
49
  "tsx": "4.20.5",
47
- "typescript": "5.5.4"
50
+ "typescript": "5.9.3"
48
51
  },
49
52
  "publishConfig": {
50
53
  "access": "public",
@@ -65,6 +68,5 @@
65
68
  "main": "dist/index.js",
66
69
  "typings": "dist/index.d.ts"
67
70
  },
68
- "typecheckSkipLibCheck": true,
69
71
  "typings": "dist/index.d.ts"
70
72
  }
@@ -1,3 +0,0 @@
1
- import type { Icon } from '../../icons.interfaces.js';
2
- import type { Replacements } from '../../icons.interfaces.js';
3
- export declare const buildReplacements: (icons: Array<Icon>) => Promise<Replacements>;
@@ -1,3 +0,0 @@
1
- import type { Icon } from '../../icons.interfaces.js';
2
- import type { ReplacementIconColors } from '../../icons.interfaces.js';
3
- export declare const createReplacementIconColors: (icons: Array<Icon>) => Promise<ReplacementIconColors>;
@@ -1,3 +0,0 @@
1
- import type { Replacements } from '../../icons.interfaces.js';
2
- import type { ReplacementIconColors } from '../../icons.interfaces.js';
3
- export declare const createReplacements: (replacementIconColors: ReplacementIconColors) => Replacements;
@@ -1,2 +0,0 @@
1
- import type { GetColorReplacement } from './get-color-replacement.interfaces.js';
2
- export declare const getColorReplacement: GetColorReplacement;
@@ -1,4 +0,0 @@
1
- import type { Icon } from '../../icons.interfaces.js';
2
- import type { Replacements } from '../../icons.interfaces.js';
3
- import type { Source } from '../../icons.interfaces.js';
4
- export declare const compileIcons: (icons: Array<Icon>, replacements: Replacements) => Promise<Array<Source>>;
@@ -1 +0,0 @@
1
- export declare const STYLE_COLOR_ATTRIBUTE_KEY = "style";
@@ -1 +0,0 @@
1
- export const STYLE_COLOR_ATTRIBUTE_KEY = 'style';
File without changes
File without changes
File without changes
File without changes