@jjlmoya/utils-travel 1.27.0 → 1.28.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjlmoya/utils-travel",
3
- "version": "1.27.0",
3
+ "version": "1.28.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -36,7 +36,7 @@
36
36
  "postinstall": "node scripts/postinstall.mjs",
37
37
  "predev": "node scripts/postinstall.mjs",
38
38
  "prestart": "node scripts/postinstall.mjs",
39
- "prebuild": "node scripts/postinstall.mjs",
39
+ "prebuild": "node scripts/postinstall.mjs && node scripts/validate-icons.mjs",
40
40
  "qa": "npm run lint && npm run test && npm run build",
41
41
  "cf:dry-run": "npm run build && wrangler deploy --dry-run",
42
42
  "cf:preview": "npm run build && wrangler deploy --config wrangler.staging.jsonc",
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { createRequire } from 'node:module';
4
+ import { readFileSync, readdirSync } from 'node:fs';
5
+ import { dirname, join, relative, resolve } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+
8
+ const require = createRequire(import.meta.url);
9
+ const packageJsonPath = require.resolve('@iconify-json/mdi/package.json');
10
+ const packageRoot = dirname(packageJsonPath);
11
+ const iconSet = JSON.parse(readFileSync(join(packageRoot, 'icons.json'), 'utf8'));
12
+ const availableIcons = new Set([
13
+ ...Object.keys(iconSet.icons ?? {}),
14
+ ...Object.keys(iconSet.aliases ?? {}),
15
+ ]);
16
+
17
+ const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
18
+ const sourceRoot = resolve(repoRoot, 'src');
19
+ const extensions = new Set(['.astro', '.js', '.mjs', '.ts', '.tsx']);
20
+ const iconPattern = /\bmdi:([a-z0-9-]+)\b/g;
21
+ const failures = [];
22
+ let references = 0;
23
+
24
+ function walk(directory) {
25
+ const entries = readdirSync(directory, { withFileTypes: true });
26
+ for (const entry of entries) {
27
+ const path = join(directory, entry.name);
28
+ if (entry.isDirectory()) {
29
+ if (entry.name !== 'node_modules' && entry.name !== 'dist' && entry.name !== 'tests') {
30
+ walk(path);
31
+ }
32
+ continue;
33
+ }
34
+ if (!extensions.has(path.slice(path.lastIndexOf('.')))) continue;
35
+
36
+ const source = readFileSync(path, 'utf8');
37
+ for (const match of source.matchAll(iconPattern)) {
38
+ references += 1;
39
+ const iconName = match[1];
40
+ if (availableIcons.has(iconName)) continue;
41
+
42
+ const line = source.slice(0, match.index).split('\n').length;
43
+ failures.push(`${relative(repoRoot, path)}:${line} — mdi:${iconName}`);
44
+ }
45
+ }
46
+ }
47
+
48
+ walk(sourceRoot);
49
+
50
+ if (failures.length > 0) {
51
+ console.error('Invalid MDI icons found:');
52
+ for (const failure of failures) console.error(`- ${failure}`);
53
+ console.error(`Checked ${references} MDI icon references against @iconify-json/mdi.`);
54
+ process.exitCode = 1;
55
+ } else {
56
+ console.log(`MDI icon validation passed: ${references} references checked.`);
57
+ }
@@ -104,7 +104,7 @@ const { ui } = Astro.props;
104
104
  let currentAdventure = null;
105
105
 
106
106
  const ICON_PATHS = {
107
- "mdi:footprint": "M11,2C10.5,2 10.1,2.4 10.1,2.9V11.1H8.9C8.4,11.1 8,11.5 8,12V21.1C8,21.6 8.4,22 8.9,22H15.1C15.6,22 16,21.6 16,21.1V12C16,11.5 15.6,11.1 15.1,11.1H13.9V2.9C13.9,2.4 13.5,2 13,2H11Z",
107
+ "mdi:footprints": "M11,2C10.5,2 10.1,2.4 10.1,2.9V11.1H8.9C8.4,11.1 8,11.5 8,12V21.1C8,21.6 8.4,22 8.9,22H15.1C15.6,22 16,21.6 16,21.1V12C16,11.5 15.6,11.1 15.1,11.1H13.9V2.9C13.9,2.4 13.5,2 13,2H11Z",
108
108
  "mdi:sparkles": "M10,21V19H12V21H10M14,14L10,18L7,15L8.4,13.6L10,15.2L12.6,12.6L14,14M21,11A2,2 0 0,0 19,9H12V3H10V9H3A2,2 0 0,0 1,11V19A2,2 0 0,0 3,21H5V23H7V21H17V23H19V21H21A2,2 0 0,0 23,19V11A2,2 0 0,0 21,11Z",
109
109
  "mdi:calendar-star": "M19,19V8H5V19H19M16,1H18V3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3H6V1H8V3H16V1M11,10.5L12,9L13,10.5L14.7,10.7L13.5,11.9L13.8,13.6L12.3,12.8L10.8,13.6L11.1,11.9L9.9,10.7L11,10.5Z",
110
110
  "mdi:trophy-variant": "M18,2H6V5H18V2M18,7H6V9H18V7M12,13L8,9V11C8,13.21 9.79,15 12,15C14.21,15 16,13.21 16,11V9L12,13M12,17C9.24,17 7,14.76 7,12H5V19H19V12H17C17,14.76 14.76,17 12,17M9,21V23H15V21H9Z",
@@ -225,4 +225,3 @@ const { ui } = Astro.props;
225
225
 
226
226
  loadStats();
227
227
  </script>
228
-
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "Bedanken Sie sich bei einem Freund für etwas, das schon lange zurückliegt.", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "Das Erwachen", categoryId: "global", icon: "mdi:footprint", description: "Dein erstes Mini-Abenteuer abgeschlossen." },
50
+ { id: "g1", milestone: 1, label: "Das Erwachen", categoryId: "global", icon: "mdi:footprints", description: "Dein erstes Mini-Abenteuer abgeschlossen." },
51
51
  { id: "g10", milestone: 10, label: "Wunder-Gewohnheit", categoryId: "global", icon: "mdi:sparkles", description: "Du hast den Trott 10 Mal durchbrochen." },
52
52
  { id: "g50", milestone: 50, label: "Tagessammler", categoryId: "global", icon: "mdi:calendar-star", description: "50 Tage, an denen das Gewöhnliche außergewöhnlich wurde." },
53
53
  { id: "g150", milestone: 150, label: "Meister des Zufalls", categoryId: "global", icon: "mdi:trophy-variant", description: "Du hast die Hälfte des Abenteuerkatalogs abgeschlossen." },
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "Thank a friend for something that happened a long time ago.", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "The Awakening", categoryId: "global", icon: "mdi:footprint", description: "Your first mini adventure completed." },
50
+ { id: "g1", milestone: 1, label: "The Awakening", categoryId: "global", icon: "mdi:footprints", description: "Your first mini adventure completed." },
51
51
  { id: "g10", milestone: 10, label: "Wonder Habit", categoryId: "global", icon: "mdi:sparkles", description: "You've broken the rut 10 times." },
52
52
  { id: "g50", milestone: 50, label: "Day Collector", categoryId: "global", icon: "mdi:calendar-star", description: "50 days making the ordinary extraordinary." },
53
53
  { id: "g150", milestone: 150, label: "Master of Chance", categoryId: "global", icon: "mdi:trophy-variant", description: "You've completed half of the adventure catalog." },
@@ -171,7 +171,7 @@ const ui: MiniAdventuresUI = {
171
171
  { id: 303, text: "Agradece a un amigo algo que ocurrió hace tiempo.", categoryId: "social" }
172
172
  ],
173
173
  achievements: [
174
- { id: "g1", milestone: 1, label: "El Despertar", categoryId: "global", icon: "mdi:footprint", description: "Tu primera mini aventura completada." },
174
+ { id: "g1", milestone: 1, label: "El Despertar", categoryId: "global", icon: "mdi:footprints", description: "Tu primera mini aventura completada." },
175
175
  { id: "g10", milestone: 10, label: "Hábito de Asombro", categoryId: "global", icon: "mdi:sparkles", description: "Has roto la rutina 10 veces." },
176
176
  { id: "g50", milestone: 50, label: "Coleccionista de Días", categoryId: "global", icon: "mdi:calendar-star", description: "50 days haciendo que lo ordinario sea extraordinario." },
177
177
  { id: "g150", milestone: 150, label: "Maestro del Azar", categoryId: "global", icon: "mdi:trophy-variant", description: "Has completado la mitad del catálogo de aventuras." },
@@ -37,7 +37,7 @@ const ui: MiniAdventuresUI = {
37
37
  { id: 303, text: "Remerciez un ami pour quelque chose qui est arrivé il y a longtemps.", categoryId: "social" }
38
38
  ],
39
39
  achievements: [
40
- { id: "g1", milestone: 1, label: "L'Éveil", categoryId: "global", icon: "mdi:footprint", description: "Votre première mini aventure réussie." },
40
+ { id: "g1", milestone: 1, label: "L'Éveil", categoryId: "global", icon: "mdi:footprints", description: "Votre première mini aventure réussie." },
41
41
  { id: "g10", milestone: 10, label: "Habitude d'Émerveillement", categoryId: "global", icon: "mdi:sparkles", description: "Vous avez brisé la routine 10 fois." },
42
42
  { id: "g50", milestone: 50, label: "Collectionneur de Jours", categoryId: "global", icon: "mdi:calendar-star", description: "50 jours à rendre l'ordinaire extraordinaire." },
43
43
  { id: "g150", milestone: 150, label: "Maître du Hasard", categoryId: "global", icon: "mdi:trophy-variant", description: "Vous avez complété la moitié du catalogue d'aventures." },
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "Berterima kasih kepada seorang teman untuk sesuatu yang terjadi sudah lama sekali.", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "Kebangkitan", categoryId: "global", icon: "mdi:footprint", description: "Petualangan mini pertama Anda selesai." },
50
+ { id: "g1", milestone: 1, label: "Kebangkitan", categoryId: "global", icon: "mdi:footprints", description: "Petualangan mini pertama Anda selesai." },
51
51
  { id: "g10", milestone: 10, label: "Kebiasaan Menakjubkan", categoryId: "global", icon: "mdi:sparkles", description: "Anda telah memecah rutinitas sebanyak 10 kali." },
52
52
  { id: "g50", milestone: 50, label: "Kolektor Hari", categoryId: "global", icon: "mdi:calendar-star", description: "50 hari membuat yang biasa menjadi luar biasa." },
53
53
  { id: "g150", milestone: 150, label: "Master Peluang", categoryId: "global", icon: "mdi:trophy-variant", description: "Anda telah menyelesaikan setengah dari katalog petualangan." },
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "Ringrazia un amico per qualcosa che è successo molto tempo fa.", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "Il Risveglio", categoryId: "global", icon: "mdi:footprint", description: "La tua prima mini avventura completata." },
50
+ { id: "g1", milestone: 1, label: "Il Risveglio", categoryId: "global", icon: "mdi:footprints", description: "La tua prima mini avventura completata." },
51
51
  { id: "g10", milestone: 10, label: "Abitudine allo Stupore", categoryId: "global", icon: "mdi:sparkles", description: "Hai rotto la routine 10 volte." },
52
52
  { id: "g50", milestone: 50, label: "Collezionista di Giorni", categoryId: "global", icon: "mdi:calendar-star", description: "50 giorni passati a rendere lo straordinario ordinario." },
53
53
  { id: "g150", milestone: 150, label: "Maestro del Caso", categoryId: "global", icon: "mdi:trophy-variant", description: "Hai completato metà del catalogo delle avventure." },
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "ずっと前の出来事について、友人に感謝を伝えてみる。", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "目覚め", categoryId: "global", icon: "mdi:footprint", description: "最初のミニアドベンチャーを完了。" },
50
+ { id: "g1", milestone: 1, label: "目覚め", categoryId: "global", icon: "mdi:footprints", description: "最初のミニアドベンチャーを完了。" },
51
51
  { id: "g10", milestone: 10, label: "驚きの習慣", categoryId: "global", icon: "mdi:sparkles", description: "マンネリを10回打破しました。" },
52
52
  { id: "g50", milestone: 50, label: "日々のコレクター", categoryId: "global", icon: "mdi:calendar-star", description: "普通を特別に変えて50日が経過。" },
53
53
  { id: "g150", milestone: 150, label: "偶然のマスター", categoryId: "global", icon: "mdi:trophy-variant", description: "アドベンチャー・カタログの半分を達成。" },
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "오래전에 있었던 일에 대해 친구에게 고마움을 전해보세요.", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "각성", categoryId: "global", icon: "mdi:footprint", description: "첫 번째 미니 어드벤처를 완료했습니다." },
50
+ { id: "g1", milestone: 1, label: "각성", categoryId: "global", icon: "mdi:footprints", description: "첫 번째 미니 어드벤처를 완료했습니다." },
51
51
  { id: "g10", milestone: 10, label: "경이로운 습관", categoryId: "global", icon: "mdi:sparkles", description: "일상의 틀을 10번 깨뜨렸습니다." },
52
52
  { id: "g50", milestone: 50, label: "하루 수집가", categoryId: "global", icon: "mdi:calendar-star", description: "평범함을 특별함으로 바꾼 지 50일째." },
53
53
  { id: "g150", milestone: 150, label: "우연의 마스터", categoryId: "global", icon: "mdi:trophy-variant", description: "어드벤처 카탈로그의 절반을 완료했습니다." },
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "Bedank een vriend voor iets wat lang geleden is gebeurd.", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "Het Ontwaken", categoryId: "global", icon: "mdi:footprint", description: "Je eerste mini avontuur voltooid." },
50
+ { id: "g1", milestone: 1, label: "Het Ontwaken", categoryId: "global", icon: "mdi:footprints", description: "Je eerste mini avontuur voltooid." },
51
51
  { id: "g10", milestone: 10, label: "Gewoonte van Verwondering", categoryId: "global", icon: "mdi:sparkles", description: "Je hebt de sleur 10 keer doorbroken." },
52
52
  { id: "g50", milestone: 50, label: "Dagenverzamelaar", categoryId: "global", icon: "mdi:calendar-star", description: "50 dagen waarin het gewone buitengewoon werd." },
53
53
  { id: "g150", milestone: 150, label: "Meester van het Toeval", categoryId: "global", icon: "mdi:trophy-variant", description: "Je hebt de helft van de avonturencatalogus voltooid." },
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "Podziękuj przyjacielowi za coś, co wydarzyło się dawno temu.", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "Przebudzenie", categoryId: "global", icon: "mdi:footprint", description: "Twoja pierwsza mini przygoda ukończona." },
50
+ { id: "g1", milestone: 1, label: "Przebudzenie", categoryId: "global", icon: "mdi:footprints", description: "Twoja pierwsza mini przygoda ukończona." },
51
51
  { id: "g10", milestone: 10, label: "Nawyk Zachwytu", categoryId: "global", icon: "mdi:sparkles", description: "Przełamałeś rutynę 10 razy." },
52
52
  { id: "g50", milestone: 50, label: "Kolekcjoner Dni", categoryId: "global", icon: "mdi:calendar-star", description: "50 dni sprawiania, że to, co zwyczajne, staje się niezwykłe." },
53
53
  { id: "g150", milestone: 150, label: "Mistrz Przypadku", categoryId: "global", icon: "mdi:trophy-variant", description: "Ukończyłeś połowę katalogu przygód." },
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "Agradeça a um amigo por algo que aconteceu há muito tempo.", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "O Despertar", categoryId: "global", icon: "mdi:footprint", description: "A sua primeira mini aventura concluída." },
50
+ { id: "g1", milestone: 1, label: "O Despertar", categoryId: "global", icon: "mdi:footprints", description: "A sua primeira mini aventura concluída." },
51
51
  { id: "g10", milestone: 10, label: "Hábito do Espanto", categoryId: "global", icon: "mdi:sparkles", description: "Quebrou a rotina 10 vezes." },
52
52
  { id: "g50", milestone: 50, label: "Colecionador de Dias", categoryId: "global", icon: "mdi:calendar-star", description: "50 dias a tornar o ordinário extraordinário." },
53
53
  { id: "g150", milestone: 150, label: "Mestre do Acaso", categoryId: "global", icon: "mdi:trophy-variant", description: "Concluiu metade do catálogo de aventuras." },
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "Поблагодари друга за то, что произошло давным-давно.", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "Пробуждение", categoryId: "global", icon: "mdi:footprint", description: "Твое первое выполненное мини-приключение." },
50
+ { id: "g1", milestone: 1, label: "Пробуждение", categoryId: "global", icon: "mdi:footprints", description: "Твое первое выполненное мини-приключение." },
51
51
  { id: "g10", milestone: 10, label: "Привычка удивляться", categoryId: "global", icon: "mdi:sparkles", description: "Ты разорвал рутину 10 раз." },
52
52
  { id: "g50", milestone: 50, label: "Коллекционер дней", categoryId: "global", icon: "mdi:calendar-star", description: "50 дней превращения обыденного в необычайное." },
53
53
  { id: "g150", milestone: 150, label: "Мастер случая", categoryId: "global", icon: "mdi:trophy-variant", description: "Ты выполнил половину каталога приключений." },
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "Tacka en vän för något som hände för länge sedan.", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "Uppvaknandet", categoryId: "global", icon: "mdi:footprint", description: "Ditt första mini-äventyr slutfört." },
50
+ { id: "g1", milestone: 1, label: "Uppvaknandet", categoryId: "global", icon: "mdi:footprints", description: "Ditt första mini-äventyr slutfört." },
51
51
  { id: "g10", milestone: 10, label: "Förundransvana", categoryId: "global", icon: "mdi:sparkles", description: "Du har brutit rutinen 10 gånger." },
52
52
  { id: "g50", milestone: 50, label: "Dagsamlare", categoryId: "global", icon: "mdi:calendar-star", description: "50 dagar av att göra det vardagliga extraordinärt." },
53
53
  { id: "g150", milestone: 150, label: "Slumpens mästare", categoryId: "global", icon: "mdi:trophy-variant", description: "Du har slutfört hälften av äventyrskatalogen." },
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "Çok uzun zaman önce olan bir şey için bir arkadaşınıza teşekkür edin.", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "Uyanış", categoryId: "global", icon: "mdi:footprint", description: "İlk mini maceranız tamamlandı." },
50
+ { id: "g1", milestone: 1, label: "Uyanış", categoryId: "global", icon: "mdi:footprints", description: "İlk mini maceranız tamamlandı." },
51
51
  { id: "g10", milestone: 10, label: "Merak Alışkanlığı", categoryId: "global", icon: "mdi:sparkles", description: "Rutini 10 kez kırdınız." },
52
52
  { id: "g50", milestone: 50, label: "Gün Koleksiyoncusu", categoryId: "global", icon: "mdi:calendar-star", description: "Sıradanı sıra dışı kıldığınız 50 gün." },
53
53
  { id: "g150", milestone: 150, label: "Şansın Efendisi", categoryId: "global", icon: "mdi:trophy-variant", description: "Macera kataloğunun yarısını tamamladınız." },
@@ -47,7 +47,7 @@ const ui: MiniAdventuresUI = {
47
47
  { id: 303, text: "为很久以前发生的一件事感谢一位朋友。", categoryId: "social" }
48
48
  ],
49
49
  achievements: [
50
- { id: "g1", milestone: 1, label: "觉醒", categoryId: "global", icon: "mdi:footprint", description: "完成您的第一次微冒险。" },
50
+ { id: "g1", milestone: 1, label: "觉醒", categoryId: "global", icon: "mdi:footprints", description: "完成您的第一次微冒险。" },
51
51
  { id: "g10", milestone: 10, label: "奇迹习惯", categoryId: "global", icon: "mdi:sparkles", description: "您已经打破常规10次了。" },
52
52
  { id: "g50", milestone: 50, label: "日子收集者", categoryId: "global", icon: "mdi:calendar-star", description: "50天让平凡变得非凡。" },
53
53
  { id: "g150", milestone: 150, label: "机缘大师", categoryId: "global", icon: "mdi:trophy-variant", description: "您已经完成了冒险目录的一半。" },