@donotdev/core 0.3.2 → 0.3.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 (50) hide show
  1. package/functions/index.js +19 -19
  2. package/i18n/locales/eager/dndev_ar.json +2 -1
  3. package/i18n/locales/eager/dndev_da.json +2 -1
  4. package/i18n/locales/eager/dndev_de.json +2 -1
  5. package/i18n/locales/eager/dndev_en.json +2 -1
  6. package/i18n/locales/eager/dndev_es.json +2 -1
  7. package/i18n/locales/eager/dndev_fr.json +2 -1
  8. package/i18n/locales/eager/dndev_it.json +2 -1
  9. package/i18n/locales/eager/dndev_ja.json +2 -1
  10. package/i18n/locales/eager/dndev_ko.json +2 -1
  11. package/i18n/locales/eager/dndev_nl.json +2 -1
  12. package/i18n/locales/eager/dndev_pl.json +2 -1
  13. package/i18n/locales/eager/dndev_pt.json +2 -1
  14. package/i18n/locales/eager/dndev_zh.json +2 -1
  15. package/i18n/locales/lazy/auth_ar.json +19 -2
  16. package/i18n/locales/lazy/auth_da.json +22 -2
  17. package/i18n/locales/lazy/auth_de.json +19 -2
  18. package/i18n/locales/lazy/auth_en.json +19 -2
  19. package/i18n/locales/lazy/auth_es.json +19 -2
  20. package/i18n/locales/lazy/auth_fr.json +19 -2
  21. package/i18n/locales/lazy/auth_it.json +19 -2
  22. package/i18n/locales/lazy/auth_ja.json +19 -2
  23. package/i18n/locales/lazy/auth_ko.json +19 -2
  24. package/i18n/locales/lazy/auth_nl.json +22 -2
  25. package/i18n/locales/lazy/auth_pl.json +19 -2
  26. package/i18n/locales/lazy/auth_pt.json +19 -2
  27. package/i18n/locales/lazy/auth_zh.json +19 -2
  28. package/i18n/locales/lazy/crud_ar.json +3 -1
  29. package/i18n/locales/lazy/crud_da.json +3 -1
  30. package/i18n/locales/lazy/crud_de.json +3 -1
  31. package/i18n/locales/lazy/crud_en.json +3 -1
  32. package/i18n/locales/lazy/crud_es.json +3 -1
  33. package/i18n/locales/lazy/crud_fr.json +3 -1
  34. package/i18n/locales/lazy/crud_it.json +3 -1
  35. package/i18n/locales/lazy/crud_ja.json +3 -1
  36. package/i18n/locales/lazy/crud_ko.json +3 -1
  37. package/i18n/locales/lazy/crud_nl.json +3 -1
  38. package/i18n/locales/lazy/crud_pl.json +3 -1
  39. package/i18n/locales/lazy/crud_pt.json +3 -1
  40. package/i18n/locales/lazy/crud_zh.json +3 -1
  41. package/index.d.ts +158 -6
  42. package/index.js +3 -3
  43. package/next/index.d.ts +65 -1
  44. package/next/index.js +222 -184
  45. package/package.json +2 -2
  46. package/server.d.ts +158 -4
  47. package/shared.js +1 -1
  48. package/symbol-index.json +1 -1
  49. package/vite/index.d.ts +64 -0
  50. package/vite/index.js +180 -174
package/vite/index.d.ts CHANGED
@@ -518,6 +518,45 @@ interface HeadersConfig {
518
518
  cache?: readonly CacheOverride[];
519
519
  }
520
520
 
521
+ /**
522
+ * One woff2 file of an app-owned font family ({@link LocalFontConfig}).
523
+ *
524
+ * @since 0.3.3
525
+ */
526
+ interface LocalFontFace {
527
+ /** woff2 path relative to the app root, e.g. `'src/assets/fonts/brand.woff2'` */
528
+ file: string;
529
+ /** A weight (`400`) or a variable font's range (`'300 600'`) */
530
+ weight: number | `${number} ${number}`;
531
+ /** Default `'normal'` */
532
+ style?: 'normal' | 'italic';
533
+ /**
534
+ * The face's `unicode-range` (`'U+AC00-D7A3'`): the browser downloads the file only for
535
+ * characters in it. Omitted: the family's core file, preloaded for the first paint.
536
+ */
537
+ unicodeRange?: string;
538
+ /**
539
+ * Subset the face covers, matched against the page language
540
+ * (`LOCALE_TO_FONT_SUBSETS`, e.g. `'latin-ext'` for `pl`): a face with a `unicodeRange`
541
+ * is preloaded on the pages whose language needs this subset.
542
+ */
543
+ subset?: string;
544
+ }
545
+
546
+ /**
547
+ * An app-owned font family: its woff2 files, for a family no fontsource package
548
+ * provides (a custom subset, a licensed brand font). The family is named in the theme
549
+ * tokens like any other (`--font-sans: Pretendard, 'Pretendard Fallback', sans-serif;`).
550
+ *
551
+ * @since 0.3.3
552
+ */
553
+ interface LocalFontConfig {
554
+ /** Picks the system font of the size-matched fallback face: Arial, or Times New Roman for `serif` */
555
+ category: 'sans-serif' | 'serif';
556
+ /** The family's files */
557
+ faces: readonly LocalFontFace[];
558
+ }
559
+
521
560
  /**
522
561
  * Favicon and PWA configuration
523
562
  *
@@ -763,6 +802,31 @@ interface AppConfig {
763
802
  * @since 0.3.1
764
803
  */
765
804
  headers?: HeadersConfig;
805
+ /**
806
+ * The app's own font files, per family as the theme tokens name it (`src/themes.css`),
807
+ * for families no package provides. Every other family is resolved by name:
808
+ * `@fontsource-variable/<slug>`, then `@fontsource/<slug>` in the app's dependencies,
809
+ * then the families `@donotdev/ui` bundles (Inter, Playfair Display, Space Grotesk,
810
+ * Roboto, Press Start 2P). The framework ships every family the theme renders text in
811
+ * (Next and Vite alike): font preloads and inline `@font-face` in the server HTML,
812
+ * `font-display: optional`, size-matched `'<Family> Fallback'` face, content-hashed
813
+ * files under `/fonts/` cached immutable. Read at build; the app writes no
814
+ * `@font-face`, imports no `@fontsource` CSS and uses no `next/font` (each fails the
815
+ * build).
816
+ *
817
+ * @example
818
+ * ```typescript
819
+ * fonts: {
820
+ * Pretendard: {
821
+ * category: 'sans-serif',
822
+ * faces: [{ file: 'src/assets/fonts/pretendard.woff2', weight: '300 700' }],
823
+ * },
824
+ * }
825
+ * ```
826
+ *
827
+ * @since 0.3.3
828
+ */
829
+ fonts?: Readonly<Record<string, LocalFontConfig>>;
766
830
  }
767
831
 
768
832
  // packages/core/config/index.d.ts