@iconify/tools 4.0.0-beta.9 → 4.0.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 (221) hide show
  1. package/lib/colors/attribs.d.cts +27 -0
  2. package/lib/colors/attribs.d.mts +27 -0
  3. package/lib/colors/attribs.d.ts +1 -1
  4. package/lib/colors/detect.d.cts +16 -0
  5. package/lib/colors/detect.d.mts +16 -0
  6. package/lib/colors/parse.d.cts +60 -0
  7. package/lib/colors/parse.d.mts +60 -0
  8. package/lib/colors/parse.d.ts +1 -1
  9. package/lib/colors/validate.d.cts +20 -0
  10. package/lib/colors/validate.d.mts +20 -0
  11. package/lib/css/parse.d.cts +6 -0
  12. package/lib/css/parse.d.mts +6 -0
  13. package/lib/css/parser/error.d.cts +13 -0
  14. package/lib/css/parser/error.d.mts +13 -0
  15. package/lib/css/parser/error.d.ts +1 -1
  16. package/lib/css/parser/export.d.cts +8 -0
  17. package/lib/css/parser/export.d.mts +8 -0
  18. package/lib/css/parser/strings.d.cts +16 -0
  19. package/lib/css/parser/strings.d.mts +16 -0
  20. package/lib/css/parser/text.d.cts +20 -0
  21. package/lib/css/parser/text.d.mts +20 -0
  22. package/lib/css/parser/tokens.d.cts +9 -0
  23. package/lib/css/parser/tokens.d.mts +9 -0
  24. package/lib/css/parser/tree.d.cts +8 -0
  25. package/lib/css/parser/tree.d.mts +8 -0
  26. package/lib/css/parser/types.d.cts +52 -0
  27. package/lib/css/parser/types.d.mts +52 -0
  28. package/lib/css/parser/types.d.ts +1 -1
  29. package/lib/download/api/cache.d.cts +20 -0
  30. package/lib/download/api/cache.d.mts +20 -0
  31. package/lib/download/api/config.d.cts +18 -0
  32. package/lib/download/api/config.d.mts +18 -0
  33. package/lib/download/api/download.d.cts +8 -0
  34. package/lib/download/api/download.d.mts +8 -0
  35. package/lib/download/api/index.d.cts +8 -0
  36. package/lib/download/api/index.d.mts +8 -0
  37. package/lib/download/api/queue.d.cts +32 -0
  38. package/lib/download/api/queue.d.mts +32 -0
  39. package/lib/download/api/queue.d.ts +1 -1
  40. package/lib/download/api/types.d.cts +17 -0
  41. package/lib/download/api/types.d.mts +17 -0
  42. package/lib/download/api/types.d.ts +1 -1
  43. package/lib/download/git/branch.d.cts +8 -0
  44. package/lib/download/git/branch.d.mts +8 -0
  45. package/lib/download/git/hash.d.cts +8 -0
  46. package/lib/download/git/hash.d.mts +8 -0
  47. package/lib/download/git/index.d.cts +29 -0
  48. package/lib/download/git/index.d.mts +29 -0
  49. package/lib/download/git/index.d.ts +1 -1
  50. package/lib/download/git/reset.d.cts +6 -0
  51. package/lib/download/git/reset.d.mts +6 -0
  52. package/lib/download/github/hash.d.cts +8 -0
  53. package/lib/download/github/hash.d.mts +8 -0
  54. package/lib/download/github/index.d.cts +31 -0
  55. package/lib/download/github/index.d.mts +31 -0
  56. package/lib/download/github/index.d.ts +1 -1
  57. package/lib/download/github/types.d.cts +11 -0
  58. package/lib/download/github/types.d.mts +11 -0
  59. package/lib/download/github/types.d.ts +1 -1
  60. package/lib/download/gitlab/hash.d.cts +8 -0
  61. package/lib/download/gitlab/hash.d.mts +8 -0
  62. package/lib/download/gitlab/index.d.cts +31 -0
  63. package/lib/download/gitlab/index.d.mts +31 -0
  64. package/lib/download/gitlab/index.d.ts +1 -1
  65. package/lib/download/gitlab/types.d.cts +15 -0
  66. package/lib/download/gitlab/types.d.mts +15 -0
  67. package/lib/download/gitlab/types.d.ts +1 -1
  68. package/lib/download/helpers/untar.d.cts +6 -0
  69. package/lib/download/helpers/untar.d.mts +6 -0
  70. package/lib/download/helpers/unzip.d.cts +6 -0
  71. package/lib/download/helpers/unzip.d.mts +6 -0
  72. package/lib/download/index.d.cts +48 -0
  73. package/lib/download/index.d.mts +48 -0
  74. package/lib/download/index.d.ts +1 -1
  75. package/lib/download/npm/index.d.cts +30 -0
  76. package/lib/download/npm/index.d.mts +30 -0
  77. package/lib/download/npm/index.d.ts +1 -1
  78. package/lib/download/npm/types.d.cts +9 -0
  79. package/lib/download/npm/types.d.mts +9 -0
  80. package/lib/download/npm/types.d.ts +1 -1
  81. package/lib/download/npm/version.d.cts +16 -0
  82. package/lib/download/npm/version.d.mts +16 -0
  83. package/lib/download/npm/version.d.ts +1 -1
  84. package/lib/download/types/modified.d.cts +6 -0
  85. package/lib/download/types/modified.d.mts +6 -0
  86. package/lib/download/types/modified.d.ts +1 -1
  87. package/lib/download/types/sources.d.cts +12 -0
  88. package/lib/download/types/sources.d.mts +12 -0
  89. package/lib/download/types/sources.d.ts +1 -1
  90. package/lib/export/directory.d.cts +26 -0
  91. package/lib/export/directory.d.mts +26 -0
  92. package/lib/export/directory.d.ts +1 -1
  93. package/lib/export/helpers/custom-files.d.cts +12 -0
  94. package/lib/export/helpers/custom-files.d.mts +12 -0
  95. package/lib/export/helpers/custom-files.d.ts +1 -1
  96. package/lib/export/helpers/prepare.d.cts +19 -0
  97. package/lib/export/helpers/prepare.d.mts +19 -0
  98. package/lib/export/helpers/prepare.d.ts +1 -1
  99. package/lib/export/helpers/types-version.d.cts +6 -0
  100. package/lib/export/helpers/types-version.d.mts +6 -0
  101. package/lib/export/icon-package.d.cts +26 -0
  102. package/lib/export/icon-package.d.mts +26 -0
  103. package/lib/export/icon-package.d.ts +1 -3
  104. package/lib/export/json-package.d.cts +25 -0
  105. package/lib/export/json-package.d.mts +25 -0
  106. package/lib/export/json-package.d.ts +1 -1
  107. package/lib/icon-set/index.cjs +22 -0
  108. package/lib/icon-set/index.d.cts +162 -0
  109. package/lib/icon-set/index.d.mts +162 -0
  110. package/lib/icon-set/index.mjs +22 -0
  111. package/lib/icon-set/match.d.cts +15 -0
  112. package/lib/icon-set/match.d.mts +15 -0
  113. package/lib/icon-set/merge.d.cts +14 -0
  114. package/lib/icon-set/merge.d.mts +14 -0
  115. package/lib/icon-set/modified.d.cts +16 -0
  116. package/lib/icon-set/modified.d.mts +16 -0
  117. package/lib/icon-set/props.d.cts +13 -0
  118. package/lib/icon-set/props.d.mts +13 -0
  119. package/lib/icon-set/tags.d.cts +23 -0
  120. package/lib/icon-set/tags.d.mts +23 -0
  121. package/lib/icon-set/types.d.cts +75 -0
  122. package/lib/icon-set/types.d.mts +75 -0
  123. package/lib/icon-set/types.d.ts +1 -1
  124. package/lib/import/directory.d.cts +52 -0
  125. package/lib/import/directory.d.mts +52 -0
  126. package/lib/import/directory.d.ts +1 -1
  127. package/lib/import/figma/index.d.cts +20 -0
  128. package/lib/import/figma/index.d.mts +20 -0
  129. package/lib/import/figma/nodes.d.cts +18 -0
  130. package/lib/import/figma/nodes.d.mts +18 -0
  131. package/lib/import/figma/query.d.cts +42 -0
  132. package/lib/import/figma/query.d.mts +42 -0
  133. package/lib/import/figma/query.d.ts +1 -1
  134. package/lib/import/figma/types/api.d.cts +53 -0
  135. package/lib/import/figma/types/api.d.mts +53 -0
  136. package/lib/import/figma/types/api.d.ts +1 -1
  137. package/lib/import/figma/types/nodes.d.cts +44 -0
  138. package/lib/import/figma/types/nodes.d.mts +44 -0
  139. package/lib/import/figma/types/nodes.d.ts +1 -1
  140. package/lib/import/figma/types/options.d.cts +59 -0
  141. package/lib/import/figma/types/options.d.mts +59 -0
  142. package/lib/import/figma/types/options.d.ts +1 -1
  143. package/lib/import/figma/types/result.d.cts +44 -0
  144. package/lib/import/figma/types/result.d.mts +44 -0
  145. package/lib/import/figma/types/result.d.ts +1 -1
  146. package/lib/index.cjs +7 -5
  147. package/lib/index.d.cts +78 -0
  148. package/lib/index.d.mts +78 -0
  149. package/lib/index.d.ts +1 -0
  150. package/lib/index.mjs +6 -5
  151. package/lib/misc/bump-version.d.cts +6 -0
  152. package/lib/misc/bump-version.d.mts +6 -0
  153. package/lib/misc/cheerio.d.cts +9 -0
  154. package/lib/misc/cheerio.d.mts +9 -0
  155. package/lib/misc/cheerio.d.ts +1 -1
  156. package/lib/misc/compare-dirs.d.cts +11 -0
  157. package/lib/misc/compare-dirs.d.mts +11 -0
  158. package/lib/misc/compare-dirs.d.ts +1 -1
  159. package/lib/misc/exec.d.cts +12 -0
  160. package/lib/misc/exec.d.mts +12 -0
  161. package/lib/misc/exec.d.ts +1 -1
  162. package/lib/misc/keyword.d.cts +6 -0
  163. package/lib/misc/keyword.d.mts +6 -0
  164. package/lib/misc/scan.d.cts +33 -0
  165. package/lib/misc/scan.d.mts +33 -0
  166. package/lib/misc/scan.d.ts +1 -1
  167. package/lib/misc/write-json.d.cts +6 -0
  168. package/lib/misc/write-json.d.mts +6 -0
  169. package/lib/optimise/figma.d.cts +11 -0
  170. package/lib/optimise/figma.d.mts +11 -0
  171. package/lib/optimise/flags.d.cts +11 -0
  172. package/lib/optimise/flags.d.mts +11 -0
  173. package/lib/optimise/global-style.d.cts +11 -0
  174. package/lib/optimise/global-style.d.mts +11 -0
  175. package/lib/optimise/mask.d.cts +24 -0
  176. package/lib/optimise/mask.d.mts +24 -0
  177. package/lib/optimise/origin.d.cts +11 -0
  178. package/lib/optimise/origin.d.mts +11 -0
  179. package/lib/optimise/scale.d.cts +11 -0
  180. package/lib/optimise/scale.d.mts +11 -0
  181. package/lib/optimise/svgo.d.cts +37 -0
  182. package/lib/optimise/svgo.d.mts +37 -0
  183. package/lib/svg/analyse/error.d.cts +10 -0
  184. package/lib/svg/analyse/error.d.mts +10 -0
  185. package/lib/svg/analyse/types.d.cts +92 -0
  186. package/lib/svg/analyse/types.d.mts +92 -0
  187. package/lib/svg/analyse/types.d.ts +1 -1
  188. package/lib/svg/analyse.d.cts +15 -0
  189. package/lib/svg/analyse.d.mts +15 -0
  190. package/lib/svg/cleanup/attribs.d.cts +11 -0
  191. package/lib/svg/cleanup/attribs.d.mts +11 -0
  192. package/lib/svg/cleanup/bad-tags.d.cts +17 -0
  193. package/lib/svg/cleanup/bad-tags.d.mts +17 -0
  194. package/lib/svg/cleanup/bad-tags.d.ts +1 -1
  195. package/lib/svg/cleanup/inline-style.d.cts +11 -0
  196. package/lib/svg/cleanup/inline-style.d.mts +11 -0
  197. package/lib/svg/cleanup/root-style.d.cts +17 -0
  198. package/lib/svg/cleanup/root-style.d.mts +17 -0
  199. package/lib/svg/cleanup/root-svg.d.cts +11 -0
  200. package/lib/svg/cleanup/root-svg.d.mts +11 -0
  201. package/lib/svg/cleanup/svgo-style.d.cts +11 -0
  202. package/lib/svg/cleanup/svgo-style.d.mts +11 -0
  203. package/lib/svg/cleanup.d.cts +16 -0
  204. package/lib/svg/cleanup.d.mts +16 -0
  205. package/lib/svg/cleanup.d.ts +1 -1
  206. package/lib/svg/data/attributes.d.cts +77 -0
  207. package/lib/svg/data/attributes.d.mts +77 -0
  208. package/lib/svg/data/tags.d.cts +95 -0
  209. package/lib/svg/data/tags.d.mts +95 -0
  210. package/lib/svg/index.cjs +17 -0
  211. package/lib/svg/index.d.cts +52 -0
  212. package/lib/svg/index.d.mts +52 -0
  213. package/lib/svg/index.d.ts +5 -1
  214. package/lib/svg/index.mjs +18 -1
  215. package/lib/svg/parse-style.d.cts +58 -0
  216. package/lib/svg/parse-style.d.mts +58 -0
  217. package/lib/svg/parse-style.d.ts +1 -1
  218. package/lib/svg/parse.d.cts +30 -0
  219. package/lib/svg/parse.d.mts +30 -0
  220. package/lib/svg/parse.d.ts +1 -1
  221. package/package.json +14 -17
@@ -0,0 +1,44 @@
1
+ import { IconSet } from '../../../icon-set/index.cjs';
2
+ import '@iconify/types';
3
+ import '@iconify/utils/lib/customisations/defaults';
4
+ import '../../../icon-set/types.cjs';
5
+ import '../../../svg/index.cjs';
6
+ import 'cheerio';
7
+ import '@iconify/utils/lib/icon-set/tree';
8
+
9
+ /**
10
+ * Result for found icons
11
+ */
12
+ interface FigmaIconNode {
13
+ id: string;
14
+ name: string;
15
+ keyword: string;
16
+ url?: string;
17
+ content?: string;
18
+ }
19
+ /**
20
+ * Nodes count
21
+ */
22
+ interface FigmaNodesCount {
23
+ nodesCount: number;
24
+ generatedIconsCount: number;
25
+ downloadedIconsCount: number;
26
+ }
27
+ /**
28
+ * Import result for icons
29
+ */
30
+ interface FigmaNodesImportResult extends Partial<FigmaNodesCount> {
31
+ icons: Record<string, FigmaIconNode>;
32
+ }
33
+ /**
34
+ * Import result
35
+ */
36
+ interface FigmaImportResult extends FigmaNodesCount {
37
+ name: string;
38
+ version: string;
39
+ lastModified: string;
40
+ iconSet: IconSet;
41
+ missing: FigmaIconNode[];
42
+ }
43
+
44
+ export type { FigmaIconNode, FigmaImportResult, FigmaNodesCount, FigmaNodesImportResult };
@@ -0,0 +1,44 @@
1
+ import { IconSet } from '../../../icon-set/index.mjs';
2
+ import '@iconify/types';
3
+ import '@iconify/utils/lib/customisations/defaults';
4
+ import '../../../icon-set/types.mjs';
5
+ import '../../../svg/index.mjs';
6
+ import 'cheerio';
7
+ import '@iconify/utils/lib/icon-set/tree';
8
+
9
+ /**
10
+ * Result for found icons
11
+ */
12
+ interface FigmaIconNode {
13
+ id: string;
14
+ name: string;
15
+ keyword: string;
16
+ url?: string;
17
+ content?: string;
18
+ }
19
+ /**
20
+ * Nodes count
21
+ */
22
+ interface FigmaNodesCount {
23
+ nodesCount: number;
24
+ generatedIconsCount: number;
25
+ downloadedIconsCount: number;
26
+ }
27
+ /**
28
+ * Import result for icons
29
+ */
30
+ interface FigmaNodesImportResult extends Partial<FigmaNodesCount> {
31
+ icons: Record<string, FigmaIconNode>;
32
+ }
33
+ /**
34
+ * Import result
35
+ */
36
+ interface FigmaImportResult extends FigmaNodesCount {
37
+ name: string;
38
+ version: string;
39
+ lastModified: string;
40
+ iconSet: IconSet;
41
+ missing: FigmaIconNode[];
42
+ }
43
+
44
+ export type { FigmaIconNode, FigmaImportResult, FigmaNodesCount, FigmaNodesImportResult };
@@ -41,4 +41,4 @@ interface FigmaImportResult extends FigmaNodesCount {
41
41
  missing: FigmaIconNode[];
42
42
  }
43
43
 
44
- export { FigmaIconNode, FigmaImportResult, FigmaNodesCount, FigmaNodesImportResult };
44
+ export type { FigmaIconNode, FigmaImportResult, FigmaNodesCount, FigmaNodesImportResult };
package/lib/index.cjs CHANGED
@@ -40,6 +40,7 @@ const optimise_scale = require('./optimise/scale.cjs');
40
40
  const optimise_globalStyle = require('./optimise/global-style.cjs');
41
41
  const export_directory = require('./export/directory.cjs');
42
42
  const export_jsonPackage = require('./export/json-package.cjs');
43
+ const export_iconPackage = require('./export/icon-package.cjs');
43
44
  const misc_writeJson = require('./misc/write-json.cjs');
44
45
  const export_helpers_prepare = require('./export/helpers/prepare.cjs');
45
46
  const misc_scan = require('./misc/scan.cjs');
@@ -64,8 +65,6 @@ require('./css/parser/tree.cjs');
64
65
  require('./svg/data/attributes.cjs');
65
66
  require('./svg/data/tags.cjs');
66
67
  require('./svg/analyse/error.cjs');
67
- require('svgo');
68
- require('@iconify/utils/lib/svg/id');
69
68
  require('@iconify/utils/lib/icon/defaults');
70
69
  require('@iconify/utils/lib/svg/build');
71
70
  require('@iconify/utils/lib/icon-set/minify');
@@ -74,21 +73,23 @@ require('./icon-set/props.cjs');
74
73
  require('@iconify/utils/lib/misc/objects');
75
74
  require('./icon-set/match.cjs');
76
75
  require('./icon-set/modified.cjs');
77
- require('@iconify/utils/lib/colors');
78
- require('./colors/attribs.cjs');
79
76
  require('./import/figma/nodes.cjs');
80
77
  require('./import/figma/query.cjs');
81
78
  require('./download/api/cache.cjs');
82
79
  require('fs');
83
80
  require('crypto');
81
+ require('svgo');
82
+ require('@iconify/utils/lib/svg/id');
83
+ require('@iconify/utils/lib/colors');
84
84
  require('axios');
85
85
  require('pathe');
86
- require('child_process');
87
86
  require('fs/promises');
88
87
  require('extract-zip');
89
88
  require('tar');
90
89
  require('./download/gitlab/types.cjs');
90
+ require('./colors/attribs.cjs');
91
91
  require('./export/helpers/custom-files.cjs');
92
+ require('child_process');
92
93
 
93
94
 
94
95
 
@@ -136,6 +137,7 @@ exports.scaleSVG = optimise_scale.scaleSVG;
136
137
  exports.cleanupGlobalStyle = optimise_globalStyle.cleanupGlobalStyle;
137
138
  exports.exportToDirectory = export_directory.exportToDirectory;
138
139
  exports.exportJSONPackage = export_jsonPackage.exportJSONPackage;
140
+ exports.exportIconPackage = export_iconPackage.exportIconPackage;
139
141
  exports.writeJSONFile = misc_writeJson.writeJSONFile;
140
142
  exports.prepareDirectoryForExport = export_helpers_prepare.prepareDirectoryForExport;
141
143
  exports.scanDirectory = misc_scan.scanDirectory;
@@ -0,0 +1,78 @@
1
+ export { SVG } from './svg/index.cjs';
2
+ export { parseSVG } from './svg/parse.cjs';
3
+ export { parseSVGStyle } from './svg/parse-style.cjs';
4
+ export { analyseSVGStructure } from './svg/analyse.cjs';
5
+ export { cleanupSVG } from './svg/cleanup.cjs';
6
+ export { removeBadAttributes } from './svg/cleanup/attribs.cjs';
7
+ export { checkBadTags } from './svg/cleanup/bad-tags.cjs';
8
+ export { cleanupRootStyle } from './svg/cleanup/root-style.cjs';
9
+ export { cleanupInlineStyle } from './svg/cleanup/inline-style.cjs';
10
+ export { cleanupSVGRoot } from './svg/cleanup/root-svg.cjs';
11
+ export { convertStyleToAttrs } from './svg/cleanup/svgo-style.cjs';
12
+ export { IconSet, blankIconSet } from './icon-set/index.cjs';
13
+ export { mergeIconSets } from './icon-set/merge.cjs';
14
+ export { addTagsToIconSet } from './icon-set/tags.cjs';
15
+ export { importFromFigma } from './import/figma/index.cjs';
16
+ export { importDirectory, importDirectorySync } from './import/directory.cjs';
17
+ export { downloadGitRepo } from './download/git/index.cjs';
18
+ export { getGitRepoHash } from './download/git/hash.cjs';
19
+ export { getGitRepoBranch } from './download/git/branch.cjs';
20
+ export { resetGitRepoContents } from './download/git/reset.cjs';
21
+ export { downloadGitHubRepo } from './download/github/index.cjs';
22
+ export { getGitHubRepoHash } from './download/github/hash.cjs';
23
+ export { downloadGitLabRepo } from './download/gitlab/index.cjs';
24
+ export { getGitLabRepoHash } from './download/gitlab/hash.cjs';
25
+ export { downloadNPMPackage } from './download/npm/index.cjs';
26
+ export { getNPMVersion, getPackageVersion } from './download/npm/version.cjs';
27
+ export { downloadPackage } from './download/index.cjs';
28
+ export { downloadFile } from './download/api/download.cjs';
29
+ export { isEmptyColor, parseColors } from './colors/parse.cjs';
30
+ export { validateColors } from './colors/validate.cjs';
31
+ export { detectIconSetPalette } from './colors/detect.cjs';
32
+ export { runSVGO } from './optimise/svgo.cjs';
33
+ export { removeFigmaClipPathFromSVG } from './optimise/figma.cjs';
34
+ export { deOptimisePaths } from './optimise/flags.cjs';
35
+ export { resetSVGOrigin } from './optimise/origin.cjs';
36
+ export { convertSVGToMask } from './optimise/mask.cjs';
37
+ export { scaleSVG } from './optimise/scale.cjs';
38
+ export { cleanupGlobalStyle } from './optimise/global-style.cjs';
39
+ export { exportToDirectory } from './export/directory.cjs';
40
+ export { exportJSONPackage } from './export/json-package.cjs';
41
+ export { exportIconPackage } from './export/icon-package.cjs';
42
+ export { writeJSONFile } from './misc/write-json.cjs';
43
+ export { prepareDirectoryForExport } from './export/helpers/prepare.cjs';
44
+ export { scanDirectory, scanDirectorySync } from './misc/scan.cjs';
45
+ export { compareDirectories } from './misc/compare-dirs.cjs';
46
+ export { unzip } from './download/helpers/unzip.cjs';
47
+ export { untar } from './download/helpers/untar.cjs';
48
+ export { execAsync } from './misc/exec.cjs';
49
+ export { cleanupIconKeyword } from './misc/keyword.cjs';
50
+ export { bumpVersion } from './misc/bump-version.cjs';
51
+ export { axiosConfig, fetchCallbacks } from './download/api/config.cjs';
52
+ export { sendAPIQuery } from './download/api/index.cjs';
53
+ export { defaultQueueParams, runConcurrentQueries } from './download/api/queue.cjs';
54
+ import 'cheerio';
55
+ import '@iconify/types';
56
+ import '@iconify/utils/lib/customisations/defaults';
57
+ import './misc/cheerio.cjs';
58
+ import './css/parser/types.cjs';
59
+ import './svg/analyse/types.cjs';
60
+ import './icon-set/types.cjs';
61
+ import '@iconify/utils/lib/icon-set/tree';
62
+ import './download/types/modified.cjs';
63
+ import './import/figma/types/options.cjs';
64
+ import './import/figma/types/nodes.cjs';
65
+ import './import/figma/types/api.cjs';
66
+ import './import/figma/types/result.cjs';
67
+ import './download/types/sources.cjs';
68
+ import './download/github/types.cjs';
69
+ import './download/gitlab/types.cjs';
70
+ import './download/npm/types.cjs';
71
+ import './download/api/types.cjs';
72
+ import '@iconify/utils/lib/colors/types';
73
+ import './colors/attribs.cjs';
74
+ import 'svgo';
75
+ import './export/helpers/custom-files.cjs';
76
+ import 'fs';
77
+ import 'child_process';
78
+ import 'axios';
@@ -0,0 +1,78 @@
1
+ export { SVG } from './svg/index.mjs';
2
+ export { parseSVG } from './svg/parse.mjs';
3
+ export { parseSVGStyle } from './svg/parse-style.mjs';
4
+ export { analyseSVGStructure } from './svg/analyse.mjs';
5
+ export { cleanupSVG } from './svg/cleanup.mjs';
6
+ export { removeBadAttributes } from './svg/cleanup/attribs.mjs';
7
+ export { checkBadTags } from './svg/cleanup/bad-tags.mjs';
8
+ export { cleanupRootStyle } from './svg/cleanup/root-style.mjs';
9
+ export { cleanupInlineStyle } from './svg/cleanup/inline-style.mjs';
10
+ export { cleanupSVGRoot } from './svg/cleanup/root-svg.mjs';
11
+ export { convertStyleToAttrs } from './svg/cleanup/svgo-style.mjs';
12
+ export { IconSet, blankIconSet } from './icon-set/index.mjs';
13
+ export { mergeIconSets } from './icon-set/merge.mjs';
14
+ export { addTagsToIconSet } from './icon-set/tags.mjs';
15
+ export { importFromFigma } from './import/figma/index.mjs';
16
+ export { importDirectory, importDirectorySync } from './import/directory.mjs';
17
+ export { downloadGitRepo } from './download/git/index.mjs';
18
+ export { getGitRepoHash } from './download/git/hash.mjs';
19
+ export { getGitRepoBranch } from './download/git/branch.mjs';
20
+ export { resetGitRepoContents } from './download/git/reset.mjs';
21
+ export { downloadGitHubRepo } from './download/github/index.mjs';
22
+ export { getGitHubRepoHash } from './download/github/hash.mjs';
23
+ export { downloadGitLabRepo } from './download/gitlab/index.mjs';
24
+ export { getGitLabRepoHash } from './download/gitlab/hash.mjs';
25
+ export { downloadNPMPackage } from './download/npm/index.mjs';
26
+ export { getNPMVersion, getPackageVersion } from './download/npm/version.mjs';
27
+ export { downloadPackage } from './download/index.mjs';
28
+ export { downloadFile } from './download/api/download.mjs';
29
+ export { isEmptyColor, parseColors } from './colors/parse.mjs';
30
+ export { validateColors } from './colors/validate.mjs';
31
+ export { detectIconSetPalette } from './colors/detect.mjs';
32
+ export { runSVGO } from './optimise/svgo.mjs';
33
+ export { removeFigmaClipPathFromSVG } from './optimise/figma.mjs';
34
+ export { deOptimisePaths } from './optimise/flags.mjs';
35
+ export { resetSVGOrigin } from './optimise/origin.mjs';
36
+ export { convertSVGToMask } from './optimise/mask.mjs';
37
+ export { scaleSVG } from './optimise/scale.mjs';
38
+ export { cleanupGlobalStyle } from './optimise/global-style.mjs';
39
+ export { exportToDirectory } from './export/directory.mjs';
40
+ export { exportJSONPackage } from './export/json-package.mjs';
41
+ export { exportIconPackage } from './export/icon-package.mjs';
42
+ export { writeJSONFile } from './misc/write-json.mjs';
43
+ export { prepareDirectoryForExport } from './export/helpers/prepare.mjs';
44
+ export { scanDirectory, scanDirectorySync } from './misc/scan.mjs';
45
+ export { compareDirectories } from './misc/compare-dirs.mjs';
46
+ export { unzip } from './download/helpers/unzip.mjs';
47
+ export { untar } from './download/helpers/untar.mjs';
48
+ export { execAsync } from './misc/exec.mjs';
49
+ export { cleanupIconKeyword } from './misc/keyword.mjs';
50
+ export { bumpVersion } from './misc/bump-version.mjs';
51
+ export { axiosConfig, fetchCallbacks } from './download/api/config.mjs';
52
+ export { sendAPIQuery } from './download/api/index.mjs';
53
+ export { defaultQueueParams, runConcurrentQueries } from './download/api/queue.mjs';
54
+ import 'cheerio';
55
+ import '@iconify/types';
56
+ import '@iconify/utils/lib/customisations/defaults';
57
+ import './misc/cheerio.mjs';
58
+ import './css/parser/types.mjs';
59
+ import './svg/analyse/types.mjs';
60
+ import './icon-set/types.mjs';
61
+ import '@iconify/utils/lib/icon-set/tree';
62
+ import './download/types/modified.mjs';
63
+ import './import/figma/types/options.mjs';
64
+ import './import/figma/types/nodes.mjs';
65
+ import './import/figma/types/api.mjs';
66
+ import './import/figma/types/result.mjs';
67
+ import './download/types/sources.mjs';
68
+ import './download/github/types.mjs';
69
+ import './download/gitlab/types.mjs';
70
+ import './download/npm/types.mjs';
71
+ import './download/api/types.mjs';
72
+ import '@iconify/utils/lib/colors/types';
73
+ import './colors/attribs.mjs';
74
+ import 'svgo';
75
+ import './export/helpers/custom-files.mjs';
76
+ import 'fs';
77
+ import 'child_process';
78
+ import 'axios';
package/lib/index.d.ts CHANGED
@@ -38,6 +38,7 @@ export { scaleSVG } from './optimise/scale.js';
38
38
  export { cleanupGlobalStyle } from './optimise/global-style.js';
39
39
  export { exportToDirectory } from './export/directory.js';
40
40
  export { exportJSONPackage } from './export/json-package.js';
41
+ export { exportIconPackage } from './export/icon-package.js';
41
42
  export { writeJSONFile } from './misc/write-json.js';
42
43
  export { prepareDirectoryForExport } from './export/helpers/prepare.js';
43
44
  export { scanDirectory, scanDirectorySync } from './misc/scan.js';
package/lib/index.mjs CHANGED
@@ -38,6 +38,7 @@ export { scaleSVG } from './optimise/scale.mjs';
38
38
  export { cleanupGlobalStyle } from './optimise/global-style.mjs';
39
39
  export { exportToDirectory } from './export/directory.mjs';
40
40
  export { exportJSONPackage } from './export/json-package.mjs';
41
+ export { exportIconPackage } from './export/icon-package.mjs';
41
42
  export { writeJSONFile } from './misc/write-json.mjs';
42
43
  export { prepareDirectoryForExport } from './export/helpers/prepare.mjs';
43
44
  export { scanDirectory, scanDirectorySync } from './misc/scan.mjs';
@@ -62,8 +63,6 @@ import './css/parser/tree.mjs';
62
63
  import './svg/data/attributes.mjs';
63
64
  import './svg/data/tags.mjs';
64
65
  import './svg/analyse/error.mjs';
65
- import 'svgo';
66
- import '@iconify/utils/lib/svg/id';
67
66
  import '@iconify/utils/lib/icon/defaults';
68
67
  import '@iconify/utils/lib/svg/build';
69
68
  import '@iconify/utils/lib/icon-set/minify';
@@ -72,18 +71,20 @@ import './icon-set/props.mjs';
72
71
  import '@iconify/utils/lib/misc/objects';
73
72
  import './icon-set/match.mjs';
74
73
  import './icon-set/modified.mjs';
75
- import '@iconify/utils/lib/colors';
76
- import './colors/attribs.mjs';
77
74
  import './import/figma/nodes.mjs';
78
75
  import './import/figma/query.mjs';
79
76
  import './download/api/cache.mjs';
80
77
  import 'fs';
81
78
  import 'crypto';
79
+ import 'svgo';
80
+ import '@iconify/utils/lib/svg/id';
81
+ import '@iconify/utils/lib/colors';
82
82
  import 'axios';
83
83
  import 'pathe';
84
- import 'child_process';
85
84
  import 'fs/promises';
86
85
  import 'extract-zip';
87
86
  import 'tar';
88
87
  import './download/gitlab/types.mjs';
88
+ import './colors/attribs.mjs';
89
89
  import './export/helpers/custom-files.mjs';
90
+ import 'child_process';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Bump version number
3
+ */
4
+ declare function bumpVersion(version: string): string;
5
+
6
+ export { bumpVersion };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Bump version number
3
+ */
4
+ declare function bumpVersion(version: string): string;
5
+
6
+ export { bumpVersion };
@@ -0,0 +1,9 @@
1
+ import * as cheerio from 'cheerio';
2
+
3
+ /**
4
+ * Shortcuts for Cheerio elements
5
+ */
6
+ type CheerioElement = cheerio.Element;
7
+ type WrappedCheerioElement = cheerio.Cheerio<cheerio.Element>;
8
+
9
+ export type { CheerioElement, WrappedCheerioElement };
@@ -0,0 +1,9 @@
1
+ import * as cheerio from 'cheerio';
2
+
3
+ /**
4
+ * Shortcuts for Cheerio elements
5
+ */
6
+ type CheerioElement = cheerio.Element;
7
+ type WrappedCheerioElement = cheerio.Cheerio<cheerio.Element>;
8
+
9
+ export type { CheerioElement, WrappedCheerioElement };
@@ -6,4 +6,4 @@ import * as cheerio from 'cheerio';
6
6
  type CheerioElement = cheerio.Element;
7
7
  type WrappedCheerioElement = cheerio.Cheerio<cheerio.Element>;
8
8
 
9
- export { CheerioElement, WrappedCheerioElement };
9
+ export type { CheerioElement, WrappedCheerioElement };
@@ -0,0 +1,11 @@
1
+ interface CompareDirectoriesOptions {
2
+ ignoreNewLine?: boolean;
3
+ ignoreVersions?: boolean;
4
+ textExtensions?: string[];
5
+ }
6
+ /**
7
+ * Compare directories. Returns true if files are identical, false if different
8
+ */
9
+ declare function compareDirectories(dir1: string, dir2: string, options?: CompareDirectoriesOptions): Promise<boolean>;
10
+
11
+ export { type CompareDirectoriesOptions, compareDirectories };
@@ -0,0 +1,11 @@
1
+ interface CompareDirectoriesOptions {
2
+ ignoreNewLine?: boolean;
3
+ ignoreVersions?: boolean;
4
+ textExtensions?: string[];
5
+ }
6
+ /**
7
+ * Compare directories. Returns true if files are identical, false if different
8
+ */
9
+ declare function compareDirectories(dir1: string, dir2: string, options?: CompareDirectoriesOptions): Promise<boolean>;
10
+
11
+ export { type CompareDirectoriesOptions, compareDirectories };
@@ -8,4 +8,4 @@ interface CompareDirectoriesOptions {
8
8
  */
9
9
  declare function compareDirectories(dir1: string, dir2: string, options?: CompareDirectoriesOptions): Promise<boolean>;
10
10
 
11
- export { CompareDirectoriesOptions, compareDirectories };
11
+ export { type CompareDirectoriesOptions, compareDirectories };
@@ -0,0 +1,12 @@
1
+ import { ExecOptions } from 'child_process';
2
+
3
+ interface ExecResult {
4
+ stdout: string;
5
+ stderr: string;
6
+ }
7
+ /**
8
+ * Exec as Promise
9
+ */
10
+ declare function execAsync(cmd: string, options?: ExecOptions): Promise<ExecResult>;
11
+
12
+ export { type ExecResult, execAsync };
@@ -0,0 +1,12 @@
1
+ import { ExecOptions } from 'child_process';
2
+
3
+ interface ExecResult {
4
+ stdout: string;
5
+ stderr: string;
6
+ }
7
+ /**
8
+ * Exec as Promise
9
+ */
10
+ declare function execAsync(cmd: string, options?: ExecOptions): Promise<ExecResult>;
11
+
12
+ export { type ExecResult, execAsync };
@@ -9,4 +9,4 @@ interface ExecResult {
9
9
  */
10
10
  declare function execAsync(cmd: string, options?: ExecOptions): Promise<ExecResult>;
11
11
 
12
- export { ExecResult, execAsync };
12
+ export { type ExecResult, execAsync };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Clean up keyword
3
+ */
4
+ declare function cleanupIconKeyword(keyword: string, convertCamelCase?: boolean): string;
5
+
6
+ export { cleanupIconKeyword };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Clean up keyword
3
+ */
4
+ declare function cleanupIconKeyword(keyword: string, convertCamelCase?: boolean): string;
5
+
6
+ export { cleanupIconKeyword };
@@ -0,0 +1,33 @@
1
+ import { Stats } from 'fs';
2
+
3
+ /**
4
+ * Callback
5
+ *
6
+ * Extension starts with '.' (can be empty)
7
+ * File does not include extension
8
+ * Subdir ends with '/' (can be empty)
9
+ *
10
+ * Should return:
11
+ * - false, null or undefined to skip file
12
+ * - true to include file (subdir + file + extension)
13
+ * - string to include custom string (such as file without extension)
14
+ * - custom object to return custom object
15
+ */
16
+ type ScanDirectoryCallbackFalseResult = boolean | null | undefined;
17
+ type ScanDirectoryCallbackStringResult = ScanDirectoryCallbackFalseResult | string;
18
+ type Callback<T> = (ext: string, file: string, subdir: string, path: string, stat: Stats) => T;
19
+ type AsyncCallback<T> = Callback<T | Promise<T>>;
20
+ type ScanDirectoryCallback = AsyncCallback<ScanDirectoryCallbackStringResult | unknown>;
21
+ type ScanDirectorySyncCallback = Callback<ScanDirectoryCallbackStringResult | unknown>;
22
+ /**
23
+ * Find all files in directory
24
+ */
25
+ declare function scanDirectory(path: string, callback?: AsyncCallback<ScanDirectoryCallbackStringResult>, subdirs?: boolean): Promise<string[]>;
26
+ declare function scanDirectory<T>(path: string, callback: AsyncCallback<T | ScanDirectoryCallbackFalseResult>, subdirs?: boolean): Promise<T[]>;
27
+ /**
28
+ * Find all files in directory, synchronously
29
+ */
30
+ declare function scanDirectorySync(path: string, callback?: Callback<ScanDirectoryCallbackStringResult>, subdirs?: boolean): string[];
31
+ declare function scanDirectorySync<T>(path: string, callback: Callback<T | ScanDirectoryCallbackFalseResult>, subdirs?: boolean): T[];
32
+
33
+ export { type ScanDirectoryCallback, type ScanDirectorySyncCallback, scanDirectory, scanDirectorySync };
@@ -0,0 +1,33 @@
1
+ import { Stats } from 'fs';
2
+
3
+ /**
4
+ * Callback
5
+ *
6
+ * Extension starts with '.' (can be empty)
7
+ * File does not include extension
8
+ * Subdir ends with '/' (can be empty)
9
+ *
10
+ * Should return:
11
+ * - false, null or undefined to skip file
12
+ * - true to include file (subdir + file + extension)
13
+ * - string to include custom string (such as file without extension)
14
+ * - custom object to return custom object
15
+ */
16
+ type ScanDirectoryCallbackFalseResult = boolean | null | undefined;
17
+ type ScanDirectoryCallbackStringResult = ScanDirectoryCallbackFalseResult | string;
18
+ type Callback<T> = (ext: string, file: string, subdir: string, path: string, stat: Stats) => T;
19
+ type AsyncCallback<T> = Callback<T | Promise<T>>;
20
+ type ScanDirectoryCallback = AsyncCallback<ScanDirectoryCallbackStringResult | unknown>;
21
+ type ScanDirectorySyncCallback = Callback<ScanDirectoryCallbackStringResult | unknown>;
22
+ /**
23
+ * Find all files in directory
24
+ */
25
+ declare function scanDirectory(path: string, callback?: AsyncCallback<ScanDirectoryCallbackStringResult>, subdirs?: boolean): Promise<string[]>;
26
+ declare function scanDirectory<T>(path: string, callback: AsyncCallback<T | ScanDirectoryCallbackFalseResult>, subdirs?: boolean): Promise<T[]>;
27
+ /**
28
+ * Find all files in directory, synchronously
29
+ */
30
+ declare function scanDirectorySync(path: string, callback?: Callback<ScanDirectoryCallbackStringResult>, subdirs?: boolean): string[];
31
+ declare function scanDirectorySync<T>(path: string, callback: Callback<T | ScanDirectoryCallbackFalseResult>, subdirs?: boolean): T[];
32
+
33
+ export { type ScanDirectoryCallback, type ScanDirectorySyncCallback, scanDirectory, scanDirectorySync };
@@ -30,4 +30,4 @@ declare function scanDirectory<T>(path: string, callback: AsyncCallback<T | Scan
30
30
  declare function scanDirectorySync(path: string, callback?: Callback<ScanDirectoryCallbackStringResult>, subdirs?: boolean): string[];
31
31
  declare function scanDirectorySync<T>(path: string, callback: Callback<T | ScanDirectoryCallbackFalseResult>, subdirs?: boolean): T[];
32
32
 
33
- export { ScanDirectoryCallback, ScanDirectorySyncCallback, scanDirectory, scanDirectorySync };
33
+ export { type ScanDirectoryCallback, type ScanDirectorySyncCallback, scanDirectory, scanDirectorySync };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Write JSON file
3
+ */
4
+ declare function writeJSONFile(filename: string, data: unknown): Promise<void>;
5
+
6
+ export { writeJSONFile };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Write JSON file
3
+ */
4
+ declare function writeJSONFile(filename: string, data: unknown): Promise<void>;
5
+
6
+ export { writeJSONFile };
@@ -0,0 +1,11 @@
1
+ import { SVG } from '../svg/index.cjs';
2
+ import 'cheerio';
3
+ import '@iconify/types';
4
+ import '@iconify/utils/lib/customisations/defaults';
5
+
6
+ /**
7
+ * Removes clip path from SVG, which Figma adds to icons that might have overflowing elements
8
+ */
9
+ declare function removeFigmaClipPathFromSVG(svg: SVG): boolean;
10
+
11
+ export { removeFigmaClipPathFromSVG };
@@ -0,0 +1,11 @@
1
+ import { SVG } from '../svg/index.mjs';
2
+ import 'cheerio';
3
+ import '@iconify/types';
4
+ import '@iconify/utils/lib/customisations/defaults';
5
+
6
+ /**
7
+ * Removes clip path from SVG, which Figma adds to icons that might have overflowing elements
8
+ */
9
+ declare function removeFigmaClipPathFromSVG(svg: SVG): boolean;
10
+
11
+ export { removeFigmaClipPathFromSVG };
@@ -0,0 +1,11 @@
1
+ import { SVG } from '../svg/index.cjs';
2
+ import 'cheerio';
3
+ import '@iconify/types';
4
+ import '@iconify/utils/lib/customisations/defaults';
5
+
6
+ /**
7
+ * De-optimise paths. Compressed paths are still not supported by some software.
8
+ */
9
+ declare function deOptimisePaths(svg: SVG): void;
10
+
11
+ export { deOptimisePaths };
@@ -0,0 +1,11 @@
1
+ import { SVG } from '../svg/index.mjs';
2
+ import 'cheerio';
3
+ import '@iconify/types';
4
+ import '@iconify/utils/lib/customisations/defaults';
5
+
6
+ /**
7
+ * De-optimise paths. Compressed paths are still not supported by some software.
8
+ */
9
+ declare function deOptimisePaths(svg: SVG): void;
10
+
11
+ export { deOptimisePaths };
@@ -0,0 +1,11 @@
1
+ import { SVG } from '../svg/index.cjs';
2
+ import 'cheerio';
3
+ import '@iconify/types';
4
+ import '@iconify/utils/lib/customisations/defaults';
5
+
6
+ /**
7
+ * Expand global style
8
+ */
9
+ declare function cleanupGlobalStyle(svg: SVG): void;
10
+
11
+ export { cleanupGlobalStyle };