material-icon-theme 4.25.0 → 4.27.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 (169) hide show
  1. package/README.md +5 -4
  2. package/dist/material-icons.json +5704 -0
  3. package/icons/c.svg +4 -1
  4. package/icons/cpp.svg +4 -1
  5. package/icons/csharp.svg +4 -1
  6. package/icons/deno.svg +1 -0
  7. package/icons/deno_light.svg +1 -0
  8. package/icons/file.svg +1 -1
  9. package/icons/folder-godot-open.svg +2 -0
  10. package/icons/folder-godot.svg +8 -0
  11. package/icons/folder-mercurial-open.svg +5 -0
  12. package/icons/folder-mercurial.svg +2 -0
  13. package/icons/folder-netlify-open.svg +5 -1
  14. package/icons/folder-netlify.svg +2 -1
  15. package/icons/folder-open.svg +1 -0
  16. package/icons/folder-plastic-open.svg +8 -0
  17. package/icons/folder-plastic.svg +2 -0
  18. package/icons/folder-root-open.svg +1 -0
  19. package/icons/folder-root.svg +1 -0
  20. package/icons/folder.svg +1 -0
  21. package/icons/godot-assets.svg +7 -1
  22. package/icons/godot.svg +7 -1
  23. package/icons/ifanr-cloud.svg +10 -0
  24. package/icons/mercurial.svg +6 -0
  25. package/icons/mermaid.svg +4 -0
  26. package/icons/netlify.svg +7 -1
  27. package/icons/netlify_light.svg +7 -0
  28. package/icons/objective-c.svg +4 -1
  29. package/icons/plastic.svg +7 -0
  30. package/icons/qwik.svg +2 -0
  31. package/icons/rc.svg +2 -0
  32. package/icons/typst.svg +2 -0
  33. package/package.json +18 -1
  34. package/.eslintignore +0 -1
  35. package/.eslintrc.json +0 -51
  36. package/.github/FUNDING.yml +0 -3
  37. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -34
  38. package/.github/ISSUE_TEMPLATE/icon_request.md +0 -27
  39. package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -7
  40. package/.github/workflows/build.yml +0 -45
  41. package/.github/workflows/color-check.yml +0 -22
  42. package/.github/workflows/release.yml +0 -73
  43. package/.prettierrc +0 -7
  44. package/.vscode/extensions.json +0 -3
  45. package/.vscode/launch.json +0 -43
  46. package/.vscode/settings.json +0 -14
  47. package/.vscode/tasks.json +0 -32
  48. package/.vscodeignore +0 -22
  49. package/CHANGELOG.md +0 -1325
  50. package/CONTRIBUTING.md +0 -232
  51. package/build/web-extension.webpack.config.js +0 -62
  52. package/build/webpack.config.js +0 -39
  53. package/changelog.config.json +0 -4
  54. package/images/commandPalette.png +0 -0
  55. package/images/contributors.png +0 -0
  56. package/images/fileIcons.png +0 -0
  57. package/images/folderIcons.png +0 -0
  58. package/images/how-tos/folder-icon-parts.png +0 -0
  59. package/images/how-tos/pick-folder-colors.png +0 -0
  60. package/images/how-tos/pick-folder-colors.svg +0 -301
  61. package/images/how-tos/svg-folder-icon-with-correct-colors.png +0 -0
  62. package/images/how-tos/svg-folder-icon-with-wrong-colors.png +0 -0
  63. package/images/how-tos/svg-with-light-color.png +0 -0
  64. package/images/how-tos/svg-with-spacing.png +0 -0
  65. package/images/how-tos/svg-with-too-dark-color.png +0 -0
  66. package/images/how-tos/svg-with-wrong-color.png +0 -0
  67. package/images/how-tos/svg-without-spacing.png +0 -0
  68. package/images/set-folder-color.gif +0 -0
  69. package/images/set-folder-theme.gif +0 -0
  70. package/images/stepsize.png +0 -0
  71. package/logo.png +0 -0
  72. package/logo.svg +0 -21
  73. package/material-colors.yml +0 -257
  74. package/package.nls.de.json +0 -32
  75. package/package.nls.es.json +0 -29
  76. package/package.nls.fr.json +0 -29
  77. package/package.nls.ja.json +0 -32
  78. package/package.nls.json +0 -32
  79. package/package.nls.nl.json +0 -32
  80. package/package.nls.pl.json +0 -32
  81. package/package.nls.pt-BR.json +0 -29
  82. package/package.nls.pt-PT.json +0 -29
  83. package/package.nls.ru.json +0 -29
  84. package/package.nls.zh-CN.json +0 -29
  85. package/package.nls.zh-TW.json +0 -29
  86. package/src/commands/activate.ts +0 -28
  87. package/src/commands/explorerArrows.ts +0 -55
  88. package/src/commands/folderColor.ts +0 -96
  89. package/src/commands/folders.ts +0 -55
  90. package/src/commands/grayscale.ts +0 -55
  91. package/src/commands/iconPacks.ts +0 -64
  92. package/src/commands/index.ts +0 -30
  93. package/src/commands/opacity.ts +0 -46
  94. package/src/commands/restoreConfig.ts +0 -14
  95. package/src/commands/saturation.ts +0 -46
  96. package/src/extension.ts +0 -37
  97. package/src/helpers/changeDetection.ts +0 -109
  98. package/src/helpers/customIcons.ts +0 -8
  99. package/src/helpers/fileConfig.ts +0 -37
  100. package/src/helpers/index.ts +0 -88
  101. package/src/helpers/objects.ts +0 -58
  102. package/src/helpers/types.ts +0 -7
  103. package/src/i18n/index.ts +0 -78
  104. package/src/i18n/lang-de.ts +0 -43
  105. package/src/i18n/lang-en.ts +0 -43
  106. package/src/i18n/lang-es.ts +0 -43
  107. package/src/i18n/lang-fr.ts +0 -43
  108. package/src/i18n/lang-ja.ts +0 -43
  109. package/src/i18n/lang-nl.ts +0 -43
  110. package/src/i18n/lang-pl.ts +0 -43
  111. package/src/i18n/lang-pt-br.ts +0 -43
  112. package/src/i18n/lang-pt-pt.ts +0 -43
  113. package/src/i18n/lang-ru.ts +0 -43
  114. package/src/i18n/lang-uk.ts +0 -43
  115. package/src/i18n/lang-zh-cn.ts +0 -43
  116. package/src/i18n/lang-zh-tw.ts +0 -43
  117. package/src/icons/fileIcons.ts +0 -2240
  118. package/src/icons/folderIcons.ts +0 -823
  119. package/src/icons/generator/constants.ts +0 -29
  120. package/src/icons/generator/fileGenerator.ts +0 -216
  121. package/src/icons/generator/folderGenerator.ts +0 -340
  122. package/src/icons/generator/iconOpacity.ts +0 -111
  123. package/src/icons/generator/iconSaturation.ts +0 -140
  124. package/src/icons/generator/index.ts +0 -7
  125. package/src/icons/generator/jsonGenerator.ts +0 -191
  126. package/src/icons/generator/languageGenerator.ts +0 -127
  127. package/src/icons/index.ts +0 -4
  128. package/src/icons/languageIcons.ts +0 -144
  129. package/src/models/i18n/index.ts +0 -1
  130. package/src/models/i18n/translation.ts +0 -41
  131. package/src/models/iconConfiguration.ts +0 -37
  132. package/src/models/icons/defaultIcon.ts +0 -16
  133. package/src/models/icons/files/fileIcon.ts +0 -49
  134. package/src/models/icons/files/fileTypes.ts +0 -14
  135. package/src/models/icons/files/index.ts +0 -2
  136. package/src/models/icons/folders/folderIcon.ts +0 -34
  137. package/src/models/icons/folders/folderTheme.ts +0 -23
  138. package/src/models/icons/folders/index.ts +0 -2
  139. package/src/models/icons/iconJsonOptions.ts +0 -21
  140. package/src/models/icons/iconPack.ts +0 -12
  141. package/src/models/icons/index.ts +0 -6
  142. package/src/models/icons/languages/index.ts +0 -1
  143. package/src/models/icons/languages/languageIdentifier.ts +0 -26
  144. package/src/models/index.ts +0 -3
  145. package/src/models/scripts/contributors/contributor.ts +0 -22
  146. package/src/models/scripts/contributors/contributorsConfig.ts +0 -10
  147. package/src/scripts/contributors/contributors.css +0 -24
  148. package/src/scripts/contributors/index.ts +0 -138
  149. package/src/scripts/helpers/painter.ts +0 -5
  150. package/src/scripts/helpers/screenshots.ts +0 -32
  151. package/src/scripts/helpers/similarity.ts +0 -47
  152. package/src/scripts/helpers/titleCase.ts +0 -7
  153. package/src/scripts/icons/checks/checkIconAvailability.ts +0 -215
  154. package/src/scripts/icons/checks/checkIconConflicts.ts +0 -152
  155. package/src/scripts/icons/checks/checkIconUsage.ts +0 -137
  156. package/src/scripts/icons/checks/index.ts +0 -7
  157. package/src/scripts/icons/generateJson.ts +0 -11
  158. package/src/scripts/preview/index.ts +0 -40
  159. package/src/scripts/preview/preview.ts +0 -163
  160. package/src/scripts/preview/style.css +0 -48
  161. package/src/test/runTest.ts +0 -26
  162. package/src/test/spec/i18n/i18n.spec.ts +0 -54
  163. package/src/test/spec/icons/fileIcons.spec.ts +0 -250
  164. package/src/test/spec/icons/folderIcons.spec.ts +0 -418
  165. package/src/test/spec/icons/languageIcons.spec.ts +0 -184
  166. package/src/test/spec/index.ts +0 -36
  167. package/src/web/extension.ts +0 -10
  168. package/svgo.config.js +0 -12
  169. package/tsconfig.json +0 -23
@@ -1,215 +0,0 @@
1
- import { readdir } from 'fs';
2
- import { join, parse } from 'path';
3
- import {
4
- DefaultIcon,
5
- FileIcon,
6
- FolderIcon,
7
- FolderTheme,
8
- } from '../../../models/index';
9
- import { green, red } from '../../helpers/painter';
10
- import { similarity } from '../../helpers/similarity';
11
- import {
12
- fileIcons,
13
- folderIcons,
14
- highContrastColorFileEnding,
15
- languageIcons,
16
- lightColorFileEnding,
17
- openedFolder,
18
- } from './../../../icons';
19
-
20
- /**
21
- * Defines the folder where all icon files are located.
22
- */
23
- const folderPath = join('icons');
24
-
25
- /**
26
- * Defines an array with all icons that can be found in the file system.
27
- */
28
- const availableIcons: Record<string, string> = {};
29
-
30
- /**
31
- * Save the misconfigured icons.
32
- */
33
- const wrongIconNames: Record<string, string[]> = {
34
- fileIcons: [],
35
- folderIcons: [],
36
- languageIcons: [],
37
- };
38
-
39
- /**
40
- * Get all icon file names from the file system.
41
- */
42
- const fsReadAllIconFiles = (
43
- err: NodeJS.ErrnoException | null,
44
- files: string[]
45
- ) => {
46
- if (err) {
47
- throw Error(err.message);
48
- }
49
-
50
- files.forEach((file) => {
51
- const fileName = file;
52
- const iconName = parse(file).name;
53
- availableIcons[iconName] = fileName;
54
- });
55
-
56
- // check icon configurations
57
- checkFileIcons();
58
- checkFolderIcons();
59
- checkLanguageIcons();
60
-
61
- // show error messages
62
- handleErrors();
63
- };
64
-
65
- // read from the file system
66
- export const check = () => readdir(folderPath, fsReadAllIconFiles);
67
-
68
- /**
69
- * Check if the file icons from the configuration are available on the file system.
70
- */
71
- const checkFileIcons = () => {
72
- [...fileIcons.icons, fileIcons.defaultIcon].forEach((icon) => {
73
- isIconAvailable(icon, IconType.fileIcons, IconColor.default);
74
- isIconAvailable(icon, IconType.fileIcons, IconColor.light);
75
- isIconAvailable(icon, IconType.fileIcons, IconColor.highContrast);
76
- });
77
- };
78
-
79
- const isIconAvailable = (
80
- icon: FileIcon | FolderIcon | DefaultIcon,
81
- iconType: IconType,
82
- iconColor: IconColor,
83
- hasOpenedFolder?: boolean
84
- ) => {
85
- let iconName = `${icon.name}${hasOpenedFolder ? openedFolder : ''}`;
86
- if (icon.light && iconColor === IconColor.light) {
87
- iconName += lightColorFileEnding;
88
- }
89
- if (icon.highContrast && iconColor === IconColor.highContrast) {
90
- iconName += highContrastColorFileEnding;
91
- }
92
-
93
- if (
94
- !availableIcons[iconName] &&
95
- wrongIconNames[iconType].indexOf(iconName) === -1
96
- ) {
97
- wrongIconNames[iconType].push(iconName);
98
- }
99
- };
100
-
101
- /**
102
- * Check if the folder icons from the configuration are available on the file system.
103
- */
104
- const checkFolderIcons = () => {
105
- folderIcons
106
- .map((theme) => (theme.name === 'none' ? [] : getAllFolderIcons(theme)))
107
- .reduce((a, b) => a.concat(b))
108
- .forEach((icon) => {
109
- if (icon) {
110
- isIconAvailable(icon, IconType.folderIcons, IconColor.default);
111
- isIconAvailable(icon, IconType.folderIcons, IconColor.default, true);
112
- isIconAvailable(icon, IconType.folderIcons, IconColor.light);
113
- isIconAvailable(icon, IconType.folderIcons, IconColor.light, true);
114
- isIconAvailable(icon, IconType.folderIcons, IconColor.highContrast);
115
- isIconAvailable(
116
- icon,
117
- IconType.folderIcons,
118
- IconColor.highContrast,
119
- true
120
- );
121
- }
122
- });
123
- };
124
-
125
- const getAllFolderIcons = (theme: FolderTheme) => {
126
- const icons = theme.icons ? theme.icons : [];
127
- return [theme.defaultIcon, theme.rootFolder, ...icons].filter(
128
- (icon) => icon !== undefined
129
- ); // filter undefined root folder icons
130
- };
131
-
132
- /**
133
- * Check if the language icons from the configuration are available on the file system.
134
- */
135
- const checkLanguageIcons = () => {
136
- languageIcons.forEach((lang) => {
137
- const icon = lang.icon;
138
- isIconAvailable(icon, IconType.languageIcons, IconColor.default);
139
- isIconAvailable(icon, IconType.languageIcons, IconColor.light);
140
- isIconAvailable(icon, IconType.languageIcons, IconColor.highContrast);
141
- });
142
- };
143
-
144
- /**
145
- * Show error messages in the terminal.
146
- */
147
- const handleErrors = () => {
148
- const amountOfErrors =
149
- wrongIconNames.fileIcons.length +
150
- wrongIconNames.folderIcons.length +
151
- wrongIconNames.languageIcons.length;
152
- if (amountOfErrors > 0) {
153
- console.log(
154
- '> Material Icon Theme:',
155
- red(`Found ${amountOfErrors} error(s) in the icon configuration!`)
156
- );
157
- } else {
158
- console.log(
159
- '> Material Icon Theme:',
160
- green('Passed icon availability checks!')
161
- );
162
- }
163
- logIconInformation(wrongIconNames.fileIcons, 'File icons');
164
- logIconInformation(wrongIconNames.folderIcons, 'Folder icons');
165
- logIconInformation(wrongIconNames.languageIcons, 'Language icons');
166
-
167
- if (amountOfErrors > 0) {
168
- throw new Error(
169
- 'Found some wrong file definitions in the icon configuration.'
170
- );
171
- }
172
- };
173
-
174
- const logIconInformation = (wrongIcons: string[], title: string) => {
175
- if (wrongIcons.length === 0) return;
176
- console.log(`\n${title}:\n--------------------------------`);
177
- wrongIcons.forEach((icon) => {
178
- const suggestion = Object.keys(availableIcons).find((i) => {
179
- return similarity(icon, i) > 0.75;
180
- });
181
- const suggestionString = suggestion
182
- ? ` (Did you mean ${green(suggestion)}?)`
183
- : '';
184
- const isWrongLightVersion = icon.endsWith(lightColorFileEnding);
185
- const isWrongLightVersionString = isWrongLightVersion
186
- ? ` (There is no light icon for ${green(
187
- icon.slice(0, -6)
188
- )}! Set the light option to false!)`
189
- : '';
190
- const isWrongHighContrastVersion = icon.endsWith(
191
- highContrastColorFileEnding
192
- );
193
- const isWrongHighContrastVersionString = isWrongHighContrastVersion
194
- ? ` (There is no high contrast icon for ${green(
195
- icon.slice(0, -13)
196
- )}! Set the highContrast option to false!)`
197
- : '';
198
- console.log(
199
- red(`Icon not found: ${icon}.svg`) +
200
- `${suggestionString}${isWrongLightVersionString}${isWrongHighContrastVersionString}`
201
- );
202
- });
203
- };
204
-
205
- enum IconType {
206
- fileIcons = 'fileIcons',
207
- folderIcons = 'folderIcons',
208
- languageIcons = 'languageIcons',
209
- }
210
-
211
- enum IconColor {
212
- default = 'default',
213
- light = 'light',
214
- highContrast = 'highContrast',
215
- }
@@ -1,152 +0,0 @@
1
- import { green, red } from '../../helpers/painter';
2
- import { fileIcons, folderIcons, languageIcons } from './../../../icons';
3
-
4
- /**
5
- * Store all icons that are wrong configured
6
- */
7
- const allConflicts: {
8
- fileIcons: {
9
- fileExtensions: Record<string, string[]>;
10
- fileNames: Record<string, string[]>;
11
- };
12
- folderIcons: Record<string, string[]>;
13
- languageIcons: Record<string, string[]>;
14
- } = {
15
- fileIcons: {
16
- fileExtensions: {},
17
- fileNames: {},
18
- },
19
- folderIcons: {},
20
- languageIcons: {},
21
- };
22
-
23
- export const check = () => {
24
- checkFolderIcons();
25
- checkFileIcons();
26
- checkLanguageIcons();
27
-
28
- handleErrors();
29
- };
30
-
31
- const checkFileIcons = () => {
32
- checkForConflictsInFileIcons('fileExtensions');
33
- checkForConflictsInFileIcons('fileNames');
34
- };
35
-
36
- const checkForConflictsInFileIcons = (
37
- fileIconDefinitionType: 'fileExtensions' | 'fileNames'
38
- ) => {
39
- const icons: Record<string, string> = {};
40
- fileIcons.icons.forEach((icon) => {
41
- if (!icon[fileIconDefinitionType]) return;
42
- (icon[fileIconDefinitionType] ?? [])
43
- .map((d) => d.toLowerCase())
44
- .forEach((definition) => {
45
- if (
46
- !icons[definition] ||
47
- (icon.enabledFor && icon.enabledFor.length > 0)
48
- ) {
49
- icons[definition] = icon.name;
50
- } else {
51
- if (!allConflicts.fileIcons[fileIconDefinitionType][definition]) {
52
- allConflicts.fileIcons[fileIconDefinitionType][definition] = [
53
- icons[definition],
54
- icon.name,
55
- ];
56
- } else {
57
- allConflicts.fileIcons[fileIconDefinitionType][definition].push(
58
- icon.name
59
- );
60
- }
61
- }
62
- });
63
- });
64
- };
65
-
66
- const checkFolderIcons = () => {
67
- folderIcons.forEach((theme) => {
68
- if (!theme.icons) return;
69
- const icons: Record<string, string> = {};
70
- theme.icons.forEach((icon) => {
71
- icon.folderNames
72
- .map((f) => f.toLowerCase())
73
- .forEach((folderName) => {
74
- if (
75
- !icons[folderName] ||
76
- (icon.enabledFor && icon.enabledFor.length > 0)
77
- ) {
78
- icons[folderName] = icon.name;
79
- } else {
80
- if (!allConflicts.folderIcons[folderName]) {
81
- allConflicts.folderIcons[folderName] = [
82
- icons[folderName],
83
- icon.name,
84
- ];
85
- } else {
86
- allConflicts.folderIcons[folderName].push(icon.name);
87
- }
88
- }
89
- });
90
- });
91
- });
92
- };
93
-
94
- const checkLanguageIcons = () => {
95
- const icons: Record<string, string> = {};
96
- languageIcons.forEach((langIcon) => {
97
- langIcon.ids
98
- .map((id) => id.toLowerCase())
99
- .forEach((id) => {
100
- if (!icons[id]) {
101
- icons[id] = langIcon.icon.name;
102
- } else {
103
- if (!allConflicts.languageIcons[id]) {
104
- allConflicts.languageIcons[id] = [icons[id], langIcon.icon.name];
105
- } else {
106
- allConflicts.languageIcons[id].push(langIcon.icon.name);
107
- }
108
- }
109
- });
110
- });
111
- };
112
-
113
- const handleErrors = () => {
114
- if (
115
- [
116
- ...Object.keys(allConflicts.fileIcons.fileExtensions),
117
- ...Object.keys(allConflicts.fileIcons.fileNames),
118
- ...Object.keys(allConflicts.folderIcons),
119
- ...Object.keys(allConflicts.languageIcons),
120
- ].length > 0
121
- ) {
122
- console.log('> Material Icon Theme:', red('Icon conflicts:'));
123
- console.log(red('--------------------------------------'));
124
-
125
- printErrorMessage(allConflicts.fileIcons.fileExtensions, 'fileExtension');
126
- printErrorMessage(allConflicts.fileIcons.fileNames, 'fileName');
127
- printErrorMessage(allConflicts.folderIcons, 'folderName');
128
- printErrorMessage(allConflicts.languageIcons, 'languageId');
129
-
130
- console.log('\n' + red('Please check the wrong icon configurations!\n'));
131
- process.exit(1);
132
- } else {
133
- console.log(
134
- '> Material Icon Theme:',
135
- green('Passed icon conflict checks!')
136
- );
137
- }
138
- };
139
-
140
- const printErrorMessage = (icons: any, definitionType: string) => {
141
- const keys = Object.keys(icons);
142
- keys.forEach((key) => {
143
- const conflictIcons = icons[key];
144
- console.log(
145
- red(
146
- `For ${definitionType} "${key}" are ${
147
- conflictIcons.length
148
- } icons defined: [${conflictIcons.join(', ')}]`
149
- )
150
- );
151
- });
152
- };
@@ -1,137 +0,0 @@
1
- import { readdir } from 'fs';
2
- import { join, parse } from 'path';
3
- import { DefaultIcon, FolderIcon, FolderTheme } from '../../../models/index';
4
- import { green, red } from '../../helpers/painter';
5
- import {
6
- fileIcons,
7
- folderIcons,
8
- highContrastColorFileEnding,
9
- languageIcons,
10
- lightColorFileEnding,
11
- openedFolder,
12
- } from './../../../icons';
13
-
14
- /**
15
- * Defines the folder where all icon files are located.
16
- */
17
- const folderPath = join('icons');
18
-
19
- /**
20
- * Defines an array with all icons that can be found in the file system.
21
- */
22
- const availableIcons: { [s: string]: string } = {};
23
-
24
- /**
25
- * Get all icon file names from the file system.
26
- */
27
- const fsReadAllIconFiles = (
28
- error: NodeJS.ErrnoException | null,
29
- files: string[]
30
- ) => {
31
- if (error) {
32
- throw Error(error.message);
33
- }
34
-
35
- files.forEach((file) => {
36
- const fileName = file;
37
- const iconName = parse(file).name;
38
- availableIcons[iconName] = fileName;
39
- });
40
-
41
- checkUsageOfAllIcons();
42
- handleErrors();
43
- };
44
-
45
- const checkUsageOfAllIcons = () => {
46
- const usedFileIcons: string[] = getAllUsedFileIcons();
47
- const usedFolderIcons: string[] = getAllUsedFolderIcons();
48
- const usedLanguageIcons: string[] = getAllUsedLanguageIcons();
49
-
50
- [...usedFileIcons, ...usedFolderIcons, ...usedLanguageIcons].forEach(
51
- (icon) => {
52
- delete availableIcons[icon];
53
- }
54
- );
55
- };
56
-
57
- const handleErrors = () => {
58
- const amountOfUnusedIcons = Object.keys(availableIcons).length;
59
- if (amountOfUnusedIcons === 0) {
60
- console.log('> Material Icon Theme:', green('Passed icon usage checks!'));
61
- } else {
62
- console.log(
63
- '> Material Icon Theme: ' + red(`${amountOfUnusedIcons} unused icon(s):`)
64
- );
65
- Object.keys(availableIcons).forEach((icon) => {
66
- console.log(red(`- ${availableIcons[icon]}`));
67
- });
68
- throw new Error('Found unused icon files!');
69
- }
70
- };
71
-
72
- // read from the file system
73
- export const check = () => readdir(folderPath, fsReadAllIconFiles);
74
-
75
- const getAllUsedFileIcons = (): string[] => {
76
- return [
77
- fileIcons.defaultIcon.name,
78
- fileIcons.defaultIcon.light
79
- ? fileIcons.defaultIcon.name + lightColorFileEnding
80
- : '',
81
- fileIcons.defaultIcon.highContrast
82
- ? fileIcons.defaultIcon.name + highContrastColorFileEnding
83
- : '',
84
- ...fileIcons.icons.map((icon) => icon.name),
85
- ...fileIcons.icons
86
- .filter((icon) => icon.light)
87
- .map((icon) => icon.name + lightColorFileEnding),
88
- ...fileIcons.icons
89
- .filter((icon) => icon.highContrast)
90
- .map((icon) => icon.name + highContrastColorFileEnding),
91
- ].filter((f) => f !== '');
92
- };
93
-
94
- const getAllUsedFolderIcons = (): string[] => {
95
- const icons = folderIcons
96
- .map((theme) => (theme.name === 'none' ? [] : getAllFolderIcons(theme)))
97
- .reduce((a, b) => a.concat(b));
98
- return icons
99
- .map((icon) => {
100
- return [
101
- icon.name,
102
- icon.name + openedFolder,
103
- icon.light ? icon.name + lightColorFileEnding : '',
104
- icon.light ? icon.name + openedFolder + lightColorFileEnding : '',
105
- icon.highContrast ? icon.name + highContrastColorFileEnding : '',
106
- icon.highContrast
107
- ? icon.name + openedFolder + highContrastColorFileEnding
108
- : '',
109
- ];
110
- })
111
- .filter((icon) => icon !== undefined)
112
- .reduce((a, b) => a.concat(b));
113
- };
114
-
115
- const getAllFolderIcons = (
116
- theme: FolderTheme
117
- ): (FolderIcon | DefaultIcon)[] => {
118
- const icons = theme.icons || [];
119
- const allFolderIcons = [theme.defaultIcon, ...icons];
120
- if (theme.rootFolder) {
121
- allFolderIcons.push(theme.rootFolder);
122
- }
123
- return allFolderIcons;
124
- };
125
-
126
- const getAllUsedLanguageIcons = (): string[] => {
127
- const icons = [
128
- ...languageIcons.map((lang) => lang.icon.name),
129
- ...languageIcons
130
- .filter((lang) => lang.icon.light)
131
- .map((lang) => lang.icon.name + lightColorFileEnding),
132
- ...languageIcons
133
- .filter((lang) => lang.icon.highContrast)
134
- .map((lang) => lang.icon.name + highContrastColorFileEnding),
135
- ];
136
- return icons;
137
- };
@@ -1,7 +0,0 @@
1
- import { check as checkAvailability } from './checkIconAvailability';
2
- import { check as checkIconConflicts } from './checkIconConflicts';
3
- import { check as checkIconUsage } from './checkIconUsage';
4
-
5
- checkAvailability();
6
- checkIconUsage();
7
- checkIconConflicts();
@@ -1,11 +0,0 @@
1
- /**
2
- * This file is meant to be executed exclusively by npm scripts.
3
- */
4
- import { createIconFile } from './../../icons/index';
5
-
6
- try {
7
- createIconFile();
8
- } catch (error) {
9
- console.error(error);
10
- throw Error('Could not create icon file!');
11
- }
@@ -1,40 +0,0 @@
1
- import { fileIcons } from './../../icons/fileIcons';
2
- import { folderIcons } from './../../icons/folderIcons';
3
- import { languageIcons } from './../../icons/languageIcons';
4
- import { generatePreview } from './preview';
5
-
6
- const filterDuplicates = (icons: string[]) => {
7
- return [...new Set(icons)];
8
- };
9
-
10
- const basicFileIcons = filterDuplicates(
11
- fileIcons.icons
12
- .map((i) => i.name)
13
- // merge language icons
14
- .concat(languageIcons.map((i) => i.icon.name))
15
- ).map((i) => ({ iconName: i, label: i }));
16
-
17
- const folderThemes = filterDuplicates(
18
- folderIcons
19
- .map((theme) => {
20
- const folders = [];
21
- if (theme.icons && theme.icons.length > 0) {
22
- folders.push(...theme.icons.map((i) => i.name));
23
- }
24
- return [...folders];
25
- })
26
- .reduce((a, b) => a.concat(b))
27
- ).map((i) => ({ iconName: i, label: i.replace('folder-', '') }));
28
-
29
- generatePreview('fileIcons', basicFileIcons, 5, [
30
- 'virtual',
31
- 'powerpoint',
32
- 'word',
33
- 'credits',
34
- ]);
35
- generatePreview('folderIcons', folderThemes, 5, [
36
- 'folder-aurelia',
37
- 'folder-phpmailer',
38
- 'folder-syntax',
39
- 'folder-ansible',
40
- ]);