@bereasoftware/time-guard 1.0.4 → 2.0.3

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 (54) hide show
  1. package/README.en.md +40 -12
  2. package/README.md +159 -135
  3. package/dist/calendars.cjs +1 -0
  4. package/dist/calendars.es.js +319 -0
  5. package/dist/full.cjs +1 -0
  6. package/dist/full.es.js +4341 -0
  7. package/dist/locales.cjs +1 -0
  8. package/dist/locales.es.js +2797 -0
  9. package/dist/plugin-advanced-format.cjs +1 -0
  10. package/dist/plugin-advanced-format.es.js +132 -0
  11. package/dist/plugin-duration.cjs +1 -0
  12. package/dist/plugin-duration.es.js +145 -0
  13. package/dist/plugin-relative-time.cjs +1 -0
  14. package/dist/plugin-relative-time.es.js +122 -0
  15. package/dist/time-guard.cjs +1 -1
  16. package/dist/time-guard.es.js +76 -3569
  17. package/dist/time-guard.iife.js +1 -1
  18. package/dist/time-guard.umd.js +1 -1
  19. package/dist/types/calendars.d.ts +1 -0
  20. package/dist/types/locales.d.ts +1 -0
  21. package/dist/types/plugin-advanced-format.d.ts +1 -0
  22. package/dist/types/plugin-duration.d.ts +1 -0
  23. package/dist/types/plugin-relative-time.d.ts +1 -0
  24. package/dist/types/src/adapters/temporal.adapter.d.ts +60 -0
  25. package/dist/types/src/calendars/calendar.manager.d.ts +52 -0
  26. package/dist/types/src/calendars/index.d.ts +81 -0
  27. package/dist/types/src/formatters/date.formatter.d.ts +21 -0
  28. package/dist/types/src/full.d.ts +8 -0
  29. package/dist/types/src/index.d.ts +23 -0
  30. package/dist/types/src/locales/additional.locale.d.ts +5 -0
  31. package/dist/types/src/locales/asian.locale.d.ts +9 -0
  32. package/dist/types/src/locales/english.locale.d.ts +6 -0
  33. package/dist/types/src/locales/european.locale.d.ts +9 -0
  34. package/dist/types/src/locales/index.d.ts +17 -0
  35. package/dist/types/src/locales/locale.manager.d.ts +42 -0
  36. package/dist/types/src/locales/locales-data.d.ts +17 -0
  37. package/dist/types/src/locales/middle-eastern.locale.d.ts +5 -0
  38. package/dist/types/src/locales/nordic.locale.d.ts +6 -0
  39. package/dist/types/src/locales/romance.locale.d.ts +7 -0
  40. package/dist/types/src/locales/slavic.locale.d.ts +6 -0
  41. package/dist/types/src/locales/spanish.locale.d.ts +5 -0
  42. package/dist/types/src/plugins/advanced-format/index.d.ts +47 -0
  43. package/dist/types/src/plugins/duration/index.d.ts +107 -0
  44. package/dist/types/src/plugins/duration/types.d.ts +85 -0
  45. package/dist/types/src/plugins/index.d.ts +10 -0
  46. package/dist/types/src/plugins/manager.d.ts +58 -0
  47. package/dist/types/src/plugins/relative-time/index.d.ts +39 -0
  48. package/dist/types/src/plugins/relative-time/types.d.ts +27 -0
  49. package/dist/types/src/polyfill-loader.d.ts +5 -0
  50. package/dist/types/src/time-guard.d.ts +154 -0
  51. package/dist/types/src/types/index.d.ts +301 -0
  52. package/dist/types/time-guard.d.ts +1 -0
  53. package/package.json +37 -6
  54. package/dist/types/index.d.ts +0 -1112
package/README.en.md CHANGED
@@ -100,8 +100,31 @@ pnpm add @bereasoftware/time-guard
100
100
 
101
101
  ### Requirements
102
102
 
103
- - **Node.js** 16+ (Temporal API support)
103
+ - **Node.js** 20.18.0+ (Temporal API support)
104
104
  - **TypeScript** 5.0+ (optional but recommended)
105
+ - **@js-temporal/polyfill** >=0.5.0 (peer dependency)
106
+
107
+ ### Modular Bundle
108
+
109
+ TimeGuard uses a modular architecture inspired by dayjs. The **core** weighs ~5KB gzip and includes only the essentials (TimeGuard, formatter, EN/ES, Gregorian). Locales, plugins, and calendars are loaded on demand:
110
+
111
+ ```typescript
112
+ // Lightweight core (~5KB gzip) - EN/ES only
113
+ import { TimeGuard } from '@bereasoftware/time-guard';
114
+
115
+ // Full bundle (core + polyfill + all locales/plugins/calendars)
116
+ import { TimeGuard } from '@bereasoftware/time-guard/full';
117
+
118
+ // On-demand modules
119
+ import { ALL_LOCALES } from '@bereasoftware/time-guard/locales';
120
+ import { IslamicCalendar } from '@bereasoftware/time-guard/calendars';
121
+ import relativeTimePlugin from '@bereasoftware/time-guard/plugins/relative-time';
122
+ import { Duration } from '@bereasoftware/time-guard/plugins/duration';
123
+ import advancedFormatPlugin from '@bereasoftware/time-guard/plugins/advanced-format';
124
+
125
+ // UMD for CDN / <script>
126
+ // <script src="unpkg.com/@bereasoftware/time-guard/dist/time-guard.umd.js"></script>
127
+ ```
105
128
 
106
129
  ---
107
130
 
@@ -658,7 +681,10 @@ ISO 8601 duration support with advanced calculations.
658
681
 
659
682
  ```typescript
660
683
  import { TimeGuard } from "@bereasoftware/time-guard";
661
- import { Duration, durationPlugin } from "@bereasoftware/time-guard/plugins/duration";
684
+ import {
685
+ Duration,
686
+ durationPlugin,
687
+ } from "@bereasoftware/time-guard/plugins/duration";
662
688
  import { PluginManager } from "@bereasoftware/time-guard";
663
689
 
664
690
  // Install plugin
@@ -1179,24 +1205,26 @@ npm run dev
1179
1205
  ```
1180
1206
  time-guard/
1181
1207
  ├── src/
1182
- │ ├── index.ts # Public API exports
1183
- │ ├── types.ts # Type definitions
1208
+ │ ├── index.ts # Lightweight core (~5KB gzip, EN/ES)
1209
+ │ ├── full.ts # Full bundle (all inclusive)
1210
+ │ ├── polyfill-loader.ts # Temporal polyfill loader
1184
1211
  │ ├── time-guard.ts # Main class
1185
1212
  │ ├── adapters/
1186
1213
  │ │ └── temporal.adapter.ts # Temporal API wrapper
1214
+ │ ├── calendars/ # 6 calendar systems
1187
1215
  │ ├── formatters/
1188
1216
  │ │ └── date.formatter.ts # Format strategies
1189
- └── locales/
1190
- ├── index.ts # Locale registry
1191
- └── ... # 9+ locale files
1217
+ ├── locales/ # 40+ locale files
1218
+ ├── plugins/ # 3 plugins (relative-time, duration, advanced-format)
1219
+ └── types/ # Type definitions
1192
1220
  ├── test/
1193
1221
  │ ├── time-guard.test.ts # Core tests
1194
1222
  │ ├── advanced.test.ts # Advanced tests
1195
- └── locales.test.ts # Locale tests
1196
- └── docs/
1197
- ├── ARCHITECTURE.md # Architecture guide
1198
- ├── EXAMPLES.md # Usage examples
1199
- └── LOCALES.md # Locale documentation
1223
+ ├── comprehensive.test.ts # Integration tests
1224
+ │ ├── locales.test.ts # Locale tests
1225
+ ├── plugins.test.ts # Plugin tests
1226
+ │ └── bundle-size.test.ts # Bundle size validation
1227
+ └── vite.config.ts # Unified config (3 build modes)
1200
1228
  ```
1201
1229
 
1202
1230
  ---
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # TimeGuard 🕐
2
2
 
3
3
  > 📚 **Documentación disponible en otros idiomas:**
4
+ >
4
5
  > - 🇪🇸 **Español** (este archivo - README.md)
5
6
  > - 🇬🇧 [English](README.en.md)
6
7
 
@@ -104,8 +105,31 @@ pnpm add @bereasoftware/time-guard
104
105
 
105
106
  ### Requisitos
106
107
 
107
- - **Node.js** 16+ (soporte de Temporal API)
108
+ - **Node.js** 20.18.0+ (soporte de Temporal API)
108
109
  - **TypeScript** 5.0+ (opcional pero recomendado)
110
+ - **@js-temporal/polyfill** >=0.5.0 (peer dependency)
111
+
112
+ ### Bundle Modular
113
+
114
+ TimeGuard usa una arquitectura modular inspirada en dayjs. El **core** pesa ~5KB gzip e incluye solo lo esencial (TimeGuard, formatter, EN/ES, Gregoriano). Locales, plugins y calendarios se cargan bajo demanda:
115
+
116
+ ```typescript
117
+ // Core ligero (~5KB gzip) - solo EN/ES
118
+ import { TimeGuard } from '@bereasoftware/time-guard';
119
+
120
+ // Bundle completo (core + polyfill + todos los locales/plugins/calendarios)
121
+ import { TimeGuard } from '@bereasoftware/time-guard/full';
122
+
123
+ // Módulos bajo demanda
124
+ import { ALL_LOCALES } from '@bereasoftware/time-guard/locales';
125
+ import { IslamicCalendar } from '@bereasoftware/time-guard/calendars';
126
+ import relativeTimePlugin from '@bereasoftware/time-guard/plugins/relative-time';
127
+ import { Duration } from '@bereasoftware/time-guard/plugins/duration';
128
+ import advancedFormatPlugin from '@bereasoftware/time-guard/plugins/advanced-format';
129
+
130
+ // UMD para CDN / <script>
131
+ // <script src="unpkg.com/@bereasoftware/time-guard/dist/time-guard.umd.js"></script>
132
+ ```
109
133
 
110
134
  ---
111
135
 
@@ -253,7 +277,7 @@ date.round({
253
277
 
254
278
  TimeGuard incluye soporte para múltiples sistemas de calendario, extensible a través del gestor de calendarios:
255
279
 
256
- ### Supported Calendars
280
+ ### Calendarios Soportados
257
281
 
258
282
  ```typescript
259
283
  import { TimeGuard, CalendarManager } from "@bereasoftware/time-guard";
@@ -284,9 +308,9 @@ console.log(gregorian.getWeekdayName(1)); // "Sunday"
284
308
  console.log(gregorian.isLeapYear(2024)); // true
285
309
  ```
286
310
 
287
- ### Calendar Objects
311
+ ### Objetos de Calendario
288
312
 
289
- #### Gregorian Calendar
313
+ #### Calendario Gregoriano
290
314
 
291
315
  ```typescript
292
316
  import { GregorianCalendar } from "@bereasoftware/time-guard/calendars";
@@ -296,7 +320,7 @@ console.log(calendar.daysInMonth(2024, 2)); // 29 (leap year)
296
320
  console.log(calendar.daysInYear(2024)); // 366
297
321
  ```
298
322
 
299
- #### Islamic Calendar (Hijri)
323
+ #### Calendario Islámico (Hijri)
300
324
 
301
325
  ```typescript
302
326
  import { IslamicCalendar } from "@bereasoftware/time-guard/calendars";
@@ -306,7 +330,7 @@ console.log(calendar.getMonthName(9)); // "Ramadan"
306
330
  console.log(calendar.isLeapYear(1445)); // true
307
331
  ```
308
332
 
309
- #### Hebrew Calendar
333
+ #### Calendario Hebreo
310
334
 
311
335
  ```typescript
312
336
  import { HebrewCalendar } from "@bereasoftware/time-guard/calendars";
@@ -316,7 +340,7 @@ console.log(calendar.getMonthName(1)); // "Tishrei"
316
340
  console.log(calendar.isLeapYear(5784)); // true
317
341
  ```
318
342
 
319
- #### Chinese Calendar
343
+ #### Calendario Chino
320
344
 
321
345
  ```typescript
322
346
  import { ChineseCalendar } from "@bereasoftware/time-guard/calendars";
@@ -325,7 +349,7 @@ const calendar = new ChineseCalendar();
325
349
  const zodiac = calendar.getZodiacSign(2024); // "龙" (Dragon)
326
350
  ```
327
351
 
328
- #### Japanese Calendar
352
+ #### Calendario Japonés
329
353
 
330
354
  ```typescript
331
355
  import { JapaneseCalendar } from "@bereasoftware/time-guard/calendars";
@@ -334,7 +358,7 @@ const calendar = new JapaneseCalendar();
334
358
  console.log(calendar.getMonthName(3)); // "3月"
335
359
  ```
336
360
 
337
- #### Buddhist Calendar
361
+ #### Calendario Budista
338
362
 
339
363
  ```typescript
340
364
  import { BuddhistCalendar } from "@bereasoftware/time-guard/calendars";
@@ -348,11 +372,11 @@ console.log(calendar.isLeapYear(2567)); // true
348
372
 
349
373
  ## � Plugins
350
374
 
351
- TimeGuard includes an optional plugin system for extended functionality:
375
+ TimeGuard incluye un sistema de plugins opcional para funcionalidad extendida:
352
376
 
353
- ### Available Plugins
377
+ ### Plugins Disponibles
354
378
 
355
- 1. **Relative Time Plugin** - Human-readable time differences
379
+ 1. **Plugin de Tiempo Relativo** - Diferencias de tiempo legibles para humanos
356
380
 
357
381
  ```typescript
358
382
  import { TimeGuard, PluginManager } from "@bereasoftware/time-guard";
@@ -364,7 +388,7 @@ TimeGuard includes an optional plugin system for extended functionality:
364
388
  TimeGuard.from("2024-04-01").toNow(); // "in 19 days"
365
389
  ```
366
390
 
367
- 2. **Duration Plugin** - ISO 8601 duration support
391
+ 2. **Plugin de Duración** - Soporte de duración ISO 8601
368
392
 
369
393
  ```typescript
370
394
  import { Duration } from "@bereasoftware/time-guard/plugins/duration";
@@ -374,7 +398,7 @@ TimeGuard includes an optional plugin system for extended functionality:
374
398
  duration.asDays(); // 1159
375
399
  ```
376
400
 
377
- 3. **Advanced Format Plugin** - Extended format tokens
401
+ 3. **Plugin de Formato Avanzado** - Tokens de formato extendidos
378
402
 
379
403
  ```typescript
380
404
  import advancedFormatPlugin from "@bereasoftware/time-guard/plugins/advanced-format";
@@ -391,104 +415,104 @@ TimeGuard includes an optional plugin system for extended functionality:
391
415
 
392
416
  ## �📚 Documentation
393
417
 
394
- ### Main Documentation Files
418
+ ### Archivos de Documentación Principal
395
419
 
396
- | Document | Purpose |
397
- | ------------------------------------- | ------------------------------------------------------------------------- |
398
- | [📖 ARCHITECTURE.md](ARCHITECTURE.md) | Deep dive into design patterns, SOLID principles, and system architecture |
420
+ | Documento | Propósito |
421
+ | ------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
422
+ | [📖 ARCHITECTURE.md](ARCHITECTURE.md) | Deep dive into design patterns, SOLID principles, and system architecture | Inmersión profunda en patrones de diseño, principios SOLID y arquitectura |
399
423
  | [💡 EXAMPLES.md](EXAMPLES.md) | Real-world usage examples and common scenarios |
400
424
  | [🌍 LOCALES.md](LOCALES.md) | Complete guide to localization and supported languages |
401
425
  | [� PLUGINS.md](PLUGINS.md) | Plugin system documentation and usage guide |
402
426
  | [�📖 API Reference](#api-overview) | Quick API reference (below) |
403
427
 
404
- ### Quick Navigation
428
+ ### Navegación Rápida
405
429
 
406
- - **Getting Started** → Start with [Quick Start](#quick-start) above
407
- - **Advanced Usage** → See [EXAMPLES.md](EXAMPLES.md)
408
- - **Localization** → See [LOCALES.md](LOCALES.md)
409
- - **Architecture** → See [ARCHITECTURE.md](ARCHITECTURE.md)
430
+ - **Inicio** → Comienza con [Inicio Rápido](#inicio-r%C3%A1pido) arriba
431
+ - **Uso Avanzado** → Ver [EXAMPLES.md](EXAMPLES.md)
432
+ - **Localización** → Ver [LOCALES.md](LOCALES.md)
433
+ - **Arquitectura** → Ver [ARCHITECTURE.md](ARCHITECTURE.md)
410
434
 
411
- ## 🌍 Supported Locales - Complete Guide
435
+ ## 🌍 Locales Soportadas
412
436
 
413
- TimeGuard provides **40+ languages and regional variants** with full internationalization support. Locales are organized by language family for easy discovery.
437
+ TimeGuard proporciona **más de 40 idiomas y variantes regionales** con soporte completo de internacionalización. Los locales se organizan por familia de idiomas para facilitar el descubrimiento.
414
438
 
415
- ### Locale Code Format
439
+ ### Formato de Código de Locale
416
440
 
417
- Locale codes follow the standard `[language]-[region]` pattern:
441
+ Los códigos de locale siguen el patrón estándar `[language]-[region]`:
418
442
 
419
- - `en` - Default form (used if region variant not specified)
420
- - `en-gb` - Specific region variant (Great Britain)
421
- - `es-mx` - Spanish variant for Mexico
422
- - `zh-cn` - Simplified Chinese
443
+ - `en` - Forma predeterminada (se usa si no se especifica variante de región)
444
+ - `en-gb` - Variante de región específica (Gran Bretaña)
445
+ - `es-mx` - Variante española para México
446
+ - `zh-cn` - Chino simplificado
423
447
 
424
- ### Available Locales by Family
448
+ ### Locales Disponibles por Familia
425
449
 
426
- #### 🇬🇧 English (4 variants)
450
+ ####-🇬🇧 Inglés (4 variantes)
427
451
 
428
- - `en` - English (US)
429
- - `en-au` - English (Australia)
430
- - `en-gb` - English (Great Britain)
431
- - `en-ca` - English (Canada)
452
+ - `en` - Inglés (US)
453
+ - `en-au` - Inglés (Australia)
454
+ - `en-gb` - Inglés (Gran Bretaña)
455
+ - `en-ca` - Inglés (Canadá)
432
456
 
433
- ### Spanish (3 variants)
457
+ ### Español (3 variantes)
434
458
 
435
- - `es` - Spanish (Spain)
436
- - `es-mx` - Spanish (Mexico)
437
- - `es-us` - Spanish (US)
459
+ - `es` - Español (España)
460
+ - `es-mx` - Español (México)
461
+ - `es-us` - Español (US)
438
462
 
439
- ### Romance Languages (5)
463
+ ### Idiomas Románicos (5)
440
464
 
441
- - `fr` - French
442
- - `it` - Italian
443
- - `pt` - Portuguese (Portugal)
444
- - `pt-br` - Portuguese (Brazil)
445
- - `ro` - Romanian
465
+ - `fr` - Francés
466
+ - `it` - Italiano
467
+ - `pt` - Portugués (Portugal)
468
+ - `pt-br` - Portugués (Brasil)
469
+ - `ro` - Rumano
446
470
 
447
- ### Slavic Languages (4)
471
+ ### Idiomas Eslavos (4)
448
472
 
449
- - `ru` - Russian
450
- - `pl` - Polish
451
- - `cs` - Czech
452
- - `sk` - Slovak
473
+ - `ru` - Ruso
474
+ - `pl` - Polaco
475
+ - `cs` - Checo
476
+ - `sk` - Eslovaco
453
477
 
454
- ### Nordic Languages (4)
478
+ ### Idiomas Nórdicos (4)
455
479
 
456
- - `sv` - Swedish
457
- - `nb` - Norwegian (Bokmål)
458
- - `da` - Danish
459
- - `fi` - Finnish
480
+ - `sv` - Sueco
481
+ - `nb` - Noruego (Bokmål)
482
+ - `da` - Danés
483
+ - `fi` - Finlandés
460
484
 
461
- ### Asian Languages (7)
485
+ ### Idiomas Asiáticos (7)
462
486
 
463
- - `ja` - Japanese
464
- - `zh-cn` - Chinese (Simplified)
465
- - `zh-tw` - Chinese (Traditional)
466
- - `ko` - Korean
487
+ - `ja` - Japonés
488
+ - `zh-cn` - Chino (Simplificado)
489
+ - `zh-tw` - Chino (Tradicional)
490
+ - `ko` - Coreano
467
491
  - `th` - Thai
468
- - `vi` - Vietnamese
469
- - `id` - Indonesian
492
+ - `vi` - Vietnamita
493
+ - `id` - Indonesio
470
494
 
471
- ### European Languages (7)
495
+ ### Idiomas Europeos (7)
472
496
 
473
- - `de` - German
474
- - `nl` - Dutch
475
- - `el` - Greek
476
- - `hu` - Hungarian
477
- - `eu` - Basque
478
- - `ca` - Catalan
479
- - `tr` - Turkish
497
+ - `de` - Alemán
498
+ - `nl` - Holandés
499
+ - `el` - Griego
500
+ - `hu` - Húngaro
501
+ - `eu` - Euskera
502
+ - `ca` - Catalán
503
+ - `tr` - Turco
480
504
 
481
- ### Middle Eastern & South Asian (3)
505
+ ### Oriente Medio y Asia del Sur (3)
482
506
 
483
- - `ar` - Arabic
484
- - `he` - Hebrew
507
+ - `ar` - Árabe
508
+ - `he` - Hebreo
485
509
  - `hi` - Hindi
486
510
 
487
511
  ---
488
512
 
489
- ### Locale Usage Guide
513
+ ### Guía de Uso de Locales
490
514
 
491
- #### Setting Locales
515
+ #### Configuración de Locales
492
516
 
493
517
  ```typescript
494
518
  import { TimeGuard } from "@bereasoftware/time-guard";
@@ -512,7 +536,7 @@ TimeGuard.from("2024-03-13", { locale: "de" });
512
536
  TimeGuard.now({ locale: "ja" });
513
537
  ```
514
538
 
515
- #### Formatting in Different Locales
539
+ #### Formateo en Diferentes Locales
516
540
 
517
541
  ```typescript
518
542
  const date = TimeGuard.from("2024-03-13");
@@ -571,7 +595,7 @@ date.locale("he").format("DD.MM.YYYY"); // 13.03.2024
571
595
  date.locale("hi").format("DD MMMM YYYY"); // 13 मार्च 2024
572
596
  ```
573
597
 
574
- #### Day and Month Names
598
+ #### Nombres de Día y Mes
575
599
 
576
600
  ```typescript
577
601
  // Get localized day names
@@ -589,7 +613,7 @@ date.locale("de").format("MMMM"); // März
589
613
  date.locale("ru").format("MMMM"); // марта
590
614
  ```
591
615
 
592
- #### Multi-Locale Applications
616
+ #### Aplicaciones Multilocale
593
617
 
594
618
  ```typescript
595
619
  // Switch language at runtime (user preference)
@@ -618,7 +642,7 @@ console.log(formatUserDate(date, "fr")); // mercredi, 13 mars 2024 à 14:30
618
642
  console.log(formatUserDate(date, "ja")); // 水曜日、2024年3月13日 14:30
619
643
  ```
620
644
 
621
- #### Getting Available Locales Programmatically
645
+ #### Obtener Locales Disponibles Programáticamente
622
646
 
623
647
  ```typescript
624
648
  // Get all available locales
@@ -665,9 +689,9 @@ PluginManager.isInstalled(pluginName);
665
689
  PluginManager.listInstalled();
666
690
  ```
667
691
 
668
- ### 1️⃣ Relative Time Plugin
692
+ ### 1️⃣ Plugin de Tiempo Relativo
669
693
 
670
- Adds human-readable time differences like "2 hours ago" or "in 3 days".
694
+ Añade diferencias de tiempo legibles como "hace 2 horas" o "en 3 días".
671
695
 
672
696
  ```typescript
673
697
  import { TimeGuard, PluginManager } from "@bereasoftware/time-guard";
@@ -716,13 +740,16 @@ date.humanize(other, true); // "a month" (exact mode)
716
740
 
717
741
  ---
718
742
 
719
- ### 2️⃣ Duration Plugin
743
+ ### 2️⃣ Plugin de Duración
720
744
 
721
- ISO 8601 duration support with advanced calculations.
745
+ Soporte de duración ISO 8601 con cálculos avanzados.
722
746
 
723
747
  ```typescript
724
748
  import { TimeGuard } from "@bereasoftware/time-guard";
725
- import { Duration, durationPlugin } from "@bereasoftware/time-guard/plugins/duration";
749
+ import {
750
+ Duration,
751
+ durationPlugin,
752
+ } from "@bereasoftware/time-guard/plugins/duration";
726
753
  import { PluginManager } from "@bereasoftware/time-guard";
727
754
 
728
755
  // Install plugin
@@ -807,9 +834,9 @@ Duration.fromISO("-P1D"); // Negative: -1 day
807
834
 
808
835
  ---
809
836
 
810
- ### 3️⃣ Advanced Format Plugin
837
+ ### 3️⃣ Plugin de Formato Avanzado
811
838
 
812
- Extended format tokens for specialized formatting needs.
839
+ Tokens de formato extendidos para necesidades de formateo especializadas.
813
840
 
814
841
  ```typescript
815
842
  import { TimeGuard, PluginManager } from "@bereasoftware/time-guard";
@@ -857,7 +884,7 @@ zzz // Timezone abbreviation (UTC, EST, etc.)
857
884
 
858
885
  ---
859
886
 
860
- ### Plugin Architecture
887
+ ### Arquitectura de Plugins
861
888
 
862
889
  All plugins implement `ITimeGuardPlugin`:
863
890
 
@@ -900,7 +927,7 @@ date.myMethod(); // "Hello from my plugin!"
900
927
 
901
928
  ---
902
929
 
903
- ## 🎯 Complete API Reference
930
+ ## 🎯 Referencia API
904
931
 
905
932
  ### Factory Methods
906
933
 
@@ -1201,7 +1228,7 @@ Edge cases: 65+ tests
1201
1228
 
1202
1229
  ---
1203
1230
 
1204
- ## 🏛️ Architecture
1231
+ ## 🏛️ Arquitectura
1205
1232
 
1206
1233
  TimeGuard is built on **SOLID principles** ensuring clean, maintainable, and extensible code:
1207
1234
 
@@ -1238,78 +1265,75 @@ npm run build
1238
1265
  npm run dev
1239
1266
  ```
1240
1267
 
1241
- ### Project Structure
1268
+ ### Estructura del Proyecto
1242
1269
 
1243
1270
  ```
1244
1271
  time-guard/
1245
1272
  ├── src/
1246
- │ ├── index.ts # Public API exports
1247
- │ ├── types.ts # Type definitions
1248
- │ ├── time-guard.ts # Main class
1273
+ │ ├── index.ts # Core ligero (~5KB gzip, EN/ES)
1274
+ │ ├── full.ts # Bundle completo (todo incluido)
1275
+ │ ├── polyfill-loader.ts # Cargador del polyfill Temporal
1276
+ │ ├── time-guard.ts # Clase principal
1249
1277
  │ ├── adapters/
1250
- │ │ └── temporal.adapter.ts # Temporal API wrapper
1278
+ │ │ └── temporal.adapter.ts # Wrapper del API Temporal
1279
+ │ ├── calendars/ # 6 sistemas de calendario
1251
1280
  │ ├── formatters/
1252
- │ │ └── date.formatter.ts # Format strategies
1253
- └── locales/
1254
- ├── index.ts # Locale registry
1255
- ├── locale.manager.ts # Singleton manager
1256
- │ ├── english.locale.ts # English variants
1257
- │ ├── spanish.locale.ts # Spanish variants
1258
- │ └── ... # 6+ more locale files
1281
+ │ │ └── date.formatter.ts # Estrategias de formateo
1282
+ ├── locales/ # 40+ archivos de locale
1283
+ ├── plugins/ # 3 plugins (relative-time, duration, advanced-format)
1284
+ └── types/ # Definiciones de tipos
1259
1285
  ├── test/
1260
- │ ├── time-guard.test.ts # Core tests
1261
- │ ├── advanced.test.ts # Advanced tests
1262
- └── locales.test.ts # Locale tests
1263
- └── docs/
1264
- ├── ARCHITECTURE.md # Architecture guide
1265
- ├── EXAMPLES.md # Usage examples
1266
- └── LOCALES.md # Locale documentation
1286
+ │ ├── time-guard.test.ts # Pruebas core
1287
+ │ ├── advanced.test.ts # Pruebas avanzadas
1288
+ ├── comprehensive.test.ts # Pruebas de integración
1289
+ │ ├── locales.test.ts # Pruebas de locales
1290
+ ├── plugins.test.ts # Pruebas de plugins
1291
+ │ └── bundle-size.test.ts # Validación de tamaño de bundle
1292
+ └── vite.config.ts # Config unificada (3 modos de build)
1267
1293
  ```
1268
1294
 
1269
1295
  ---
1270
1296
 
1271
- ## 🤝 Contributing
1297
+ ## 🤝 Contribuir
1272
1298
 
1273
- We welcome contributions! Please:
1299
+ ¡Bienvenidas las contribuciones! Por favor:
1274
1300
 
1275
- 1. Follow SOLID principles and existing code patterns
1276
- 2. Write tests for new features
1277
- 3. Update documentation
1278
- 4. Ensure all tests pass (`npm test`)
1279
- 5. Check types pass (`npx tsc --noEmit`)
1301
+ 1. Sigue los principios SOLID y patrones de código existentes
1302
+ 2. Escribe pruebas para nuevas funcionalidades
1303
+ 3. Actualiza la documentación
1304
+ 4. Asegúrate de que todas las pruebas pasen (`npm test`)
1305
+ 5. Verifica que los tipos pasen (`npx tsc --noEmit`)
1280
1306
 
1281
1307
  ---
1282
1308
 
1283
- ## 📄 License
1309
+ ## 📄 Licencia
1284
1310
 
1285
- MIT License © 2024 Berea-Soft
1311
+ Licencia MIT © 2024 Berea-Soft
1286
1312
 
1287
- See [LICENSE](LICENSE) file for details.
1313
+ Ver archivo [LICENSE](LICENSE) para detalles.
1288
1314
 
1289
1315
  ---
1290
1316
 
1291
- ## 🔗 Quick Links
1317
+ ## 🔗 Enlaces Rápidos
1292
1318
 
1293
- - 📖 [Full API Reference](EXAMPLES.md)
1294
- - 🏛️ [Architecture Guide](ARCHITECTURE.md)
1295
- - 🌍 [Localization Guide](LOCALES.md)
1296
- - 🐛 [Issue Tracker](https://github.com/bereasoftware/time-guard/issues)
1297
- - 💬 [Discussions](https://github.com/bereasoftware/time-guard/discussions)
1319
+ - 📖 [Referencia API Completa](EXAMPLES.md)
1320
+ - 🏛️ [Guía de Arquitectura](ARCHITECTURE.md)
1321
+ - 🌍 [Guía de Localización](LOCALES.md)
1322
+ - 🐛 [Rastreador de Problemas](https://github.com/bereasoftware/time-guard/issues)
1323
+ - 💬 [Discusiones](https://github.com/bereasoftware/time-guard/discussions)
1298
1324
 
1299
1325
  ---
1300
1326
 
1301
- ## 📞 Support
1327
+ ## 📞 Soporte
1302
1328
 
1303
- For questions, issues, or feature requests:
1329
+ Para preguntas, problemas o solicitudes de funciones:
1304
1330
 
1305
- - Open an issue on GitHub
1306
- - Start a discussion
1307
- - Check existing documentation
1308
-
1309
- ---
1331
+ - Abre un problema en GitHub
1332
+ - Inicia una discusión
1333
+ - Consulta la documentación existente
1310
1334
 
1311
1335
  ---
1312
1336
 
1313
- ## Built with ❤️ by Berea-Soft
1337
+ Construído con ❤️ por Berea-Soft
1314
1338
 
1315
- A modern date/time library with SOLID principles and TypeScript
1339
+ Una librería moderna de fecha/hora con principios SOLID y TypeScript
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=class{id=`islamic`;name=`Islamic Calendar (Hijri)`;locale=`ar`;monthNames=[`Muharram`,`Safar`,`Rabi al-awwal`,`Rabi al-thani`,`Jumada al-awwal`,`Jumada al-thani`,`Rajab`,`Sha'ban`,`Ramadan`,`Shawwal`,`Dhu al-Qi'dah`,`Dhu al-Hijjah`];getMonthName(e){return this.monthNames[Math.max(0,Math.min(11,e-1))]}getWeekdayName(e,t=!1){return(t?[`Ahd`,`Ith`,`Sel`,`Rab`,`Kha`,`Jum`,`Sab`]:[`Ahad`,`Ithnayn`,`Salasa`,`Rabi`,`Khamis`,`Jumah`,`Sabt`])[Math.max(0,Math.min(6,e-1))]}isLeapYear(e){return[2,5,7,10,13,16,18,21,24,26,29].includes(e%30)}daysInMonth(e,t){return t%2==1||t===12&&this.isLeapYear(e)?30:29}daysInYear(e){return this.isLeapYear(e)?355:354}},t=class{id=`hebrew`;name=`Hebrew Calendar`;locale=`he`;monthNames=[`Tishrei`,`Cheshvan`,`Kislev`,`Tevet`,`Shevat`,`Adar`,`Nisan`,`Iyar`,`Sivan`,`Tammuz`,`Av`,`Elul`];getMonthName(e){return this.monthNames[Math.max(0,Math.min(11,e-1))]}getWeekdayName(e,t=!1){return(t?[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`]:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`])[Math.max(0,Math.min(6,e-1))]}isLeapYear(e){return[3,6,8,11,14,17,19].includes(e%19)}daysInMonth(e,t){return[30,29,30,29,30,29,30,29,30,29,30,29][Math.max(0,Math.min(11,t-1))]}daysInYear(e){return this.isLeapYear(e)?384:354}},n=class{id=`chinese`;name=`Chinese Calendar`;locale=`zh`;monthNames=[`正月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`冬月`,`腊月`];terrestrialBranches=[`子`,`丑`,`寅`,`卯`,`辰`,`巳`,`午`,`未`,`申`,`酉`,`戌`,`亥`];getMonthName(e){return this.monthNames[Math.max(0,Math.min(11,e-1))]}getWeekdayName(e,t=!1){return(t?[`日`,`一`,`二`,`三`,`四`,`五`,`六`]:[`星期日`,`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`])[Math.max(0,Math.min(6,e-1))]}isLeapYear(e){return e%3==0}daysInMonth(e,t){return t%2==0?30:29}daysInYear(e){return this.isLeapYear(e)?384:354}getZodiacSign(e){return this.terrestrialBranches[e%12]}},r=class{id=`japanese`;name=`Japanese Calendar`;locale=`ja`;monthNames=[`1月`,`2月`,`3月`,`4月`,`5月`,`6月`,`7月`,`8月`,`9月`,`10月`,`11月`,`12月`];getMonthName(e){return this.monthNames[Math.max(0,Math.min(11,e-1))]}getWeekdayName(e,t=!1){return(t?[`日`,`月`,`火`,`水`,`木`,`金`,`土`]:[`日曜日`,`月曜日`,`火曜日`,`水曜日`,`木曜日`,`金曜日`,`土曜日`])[Math.max(0,Math.min(6,e-1))]}isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}daysInMonth(e,t){return t===2&&this.isLeapYear(e)?29:[31,28,31,30,31,30,31,31,30,31,30,31][Math.max(0,Math.min(11,t-1))]}daysInYear(e){return this.isLeapYear(e)?366:365}},i=class{id=`buddhist`;name=`Buddhist Calendar`;locale=`th`;monthNames=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];getMonthName(e){return this.monthNames[Math.max(0,Math.min(11,e-1))]}getWeekdayName(e){return[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`][Math.max(0,Math.min(6,e-1))]}isLeapYear(e){let t=e-543;return t%4==0&&t%100!=0||t%400==0}daysInMonth(e,t){return t===2&&this.isLeapYear(e)?29:[31,28,31,30,31,30,31,31,30,31,30,31][Math.max(0,Math.min(11,t-1))]}daysInYear(e){return this.isLeapYear(e)?366:365}};exports.BuddhistCalendar=i,exports.ChineseCalendar=n,exports.HebrewCalendar=t,exports.IslamicCalendar=e,exports.JapaneseCalendar=r;