@gjsify/adwaita-icons 0.4.28 → 0.4.29
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.
- package/package.json +1 -1
- package/scripts/generate.ts +8 -18
package/package.json
CHANGED
package/scripts/generate.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Run: yarn generate (or npx tsx scripts/generate.ts)
|
|
4
4
|
|
|
5
5
|
import { readdirSync, readFileSync, writeFileSync, existsSync } from 'node:fs';
|
|
6
|
-
import { join, resolve
|
|
6
|
+
import { join, resolve } from 'node:path';
|
|
7
7
|
|
|
8
8
|
const ROOT = resolve(import.meta.dirname, '..', '..', '..', '..');
|
|
9
9
|
const SYMBOLIC_DIR = join(ROOT, 'refs', 'adwaita-icon-theme', 'Adwaita', 'symbolic');
|
|
@@ -13,17 +13,7 @@ const OUT_DIR = resolve(import.meta.dirname, '..');
|
|
|
13
13
|
// Accent colors (#33d17a, #ff7800, #e01b24, #ed333b) are intentionally preserved.
|
|
14
14
|
const GRAY_FILLS = /fill="(#2e3436|#2e3434|#474747|#222222|#2d3336)"/gi;
|
|
15
15
|
|
|
16
|
-
const CATEGORIES = [
|
|
17
|
-
'actions',
|
|
18
|
-
'categories',
|
|
19
|
-
'devices',
|
|
20
|
-
'emotes',
|
|
21
|
-
'legacy',
|
|
22
|
-
'mimetypes',
|
|
23
|
-
'places',
|
|
24
|
-
'status',
|
|
25
|
-
'ui',
|
|
26
|
-
];
|
|
16
|
+
const CATEGORIES = ['actions', 'categories', 'devices', 'emotes', 'legacy', 'mimetypes', 'places', 'status', 'ui'];
|
|
27
17
|
|
|
28
18
|
/** Convert `edit-copy-symbolic.svg` → `editCopySymbolic` */
|
|
29
19
|
function toCamelCase(filename: string): string {
|
|
@@ -51,7 +41,7 @@ function generateCategory(category: string, seen: Set<string>): { code: string;
|
|
|
51
41
|
}
|
|
52
42
|
|
|
53
43
|
const files = readdirSync(dir)
|
|
54
|
-
.filter(f => f.endsWith('.svg'))
|
|
44
|
+
.filter((f) => f.endsWith('.svg'))
|
|
55
45
|
.sort();
|
|
56
46
|
|
|
57
47
|
const exports: string[] = [];
|
|
@@ -107,21 +97,21 @@ const indexLines = [
|
|
|
107
97
|
'// Generated from refs/adwaita-icon-theme/Adwaita/symbolic/',
|
|
108
98
|
'// DO NOT EDIT — regenerate with: yarn generate',
|
|
109
99
|
'',
|
|
110
|
-
...Array.from(allExports.keys()).map(c => `export * from './${c}.js';`),
|
|
100
|
+
...Array.from(allExports.keys()).map((c) => `export * from './${c}.js';`),
|
|
111
101
|
'',
|
|
112
102
|
];
|
|
113
103
|
writeFileSync(join(OUT_DIR, 'index.ts'), indexLines.join('\n'));
|
|
114
104
|
|
|
115
105
|
// Check for duplicate export names across categories
|
|
116
|
-
const
|
|
106
|
+
const seenNames = new Map<string, string>();
|
|
117
107
|
let dupes = 0;
|
|
118
108
|
for (const [category, exports] of allExports) {
|
|
119
109
|
for (const name of exports) {
|
|
120
|
-
if (
|
|
121
|
-
console.warn(` ⚠ Duplicate export "${name}" in ${category} (first in ${
|
|
110
|
+
if (seenNames.has(name)) {
|
|
111
|
+
console.warn(` ⚠ Duplicate export "${name}" in ${category} (first in ${seenNames.get(name)})`);
|
|
122
112
|
dupes++;
|
|
123
113
|
} else {
|
|
124
|
-
|
|
114
|
+
seenNames.set(name, category);
|
|
125
115
|
}
|
|
126
116
|
}
|
|
127
117
|
}
|