@donotdev/core 0.3.1 → 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 (279) hide show
  1. package/functions/index.d.ts +99 -10
  2. package/functions/index.js +20 -18
  3. package/i18n/flags/af.svg +1 -0
  4. package/i18n/flags/al.svg +1 -0
  5. package/i18n/flags/am.svg +1 -0
  6. package/i18n/flags/ar.svg +1 -0
  7. package/i18n/flags/at.svg +1 -0
  8. package/i18n/flags/au.svg +1 -0
  9. package/i18n/flags/az.svg +1 -0
  10. package/i18n/flags/ba.svg +1 -0
  11. package/i18n/flags/bd.svg +1 -0
  12. package/i18n/flags/be.svg +1 -0
  13. package/i18n/flags/bg.svg +1 -0
  14. package/i18n/flags/bn.svg +1 -0
  15. package/i18n/flags/br.svg +1 -0
  16. package/i18n/flags/bs.svg +1 -0
  17. package/i18n/flags/by.svg +1 -0
  18. package/i18n/flags/bzh.svg +1 -0
  19. package/i18n/flags/ca.svg +1 -0
  20. package/i18n/flags/ch.svg +1 -0
  21. package/i18n/flags/co.svg +1 -0
  22. package/i18n/flags/cs.svg +1 -0
  23. package/i18n/flags/cy.svg +1 -0
  24. package/i18n/flags/da.svg +1 -0
  25. package/i18n/flags/de.svg +1 -0
  26. package/i18n/flags/dz.svg +1 -0
  27. package/i18n/flags/ee.svg +1 -0
  28. package/i18n/flags/el.svg +1 -0
  29. package/i18n/flags/en.svg +1 -0
  30. package/i18n/flags/es.svg +1 -0
  31. package/i18n/flags/et.svg +1 -0
  32. package/i18n/flags/eu.svg +1 -0
  33. package/i18n/flags/fa.svg +1 -0
  34. package/i18n/flags/fi.svg +1 -0
  35. package/i18n/flags/fr-cor.svg +1 -0
  36. package/i18n/flags/fr.svg +1 -0
  37. package/i18n/flags/ga.svg +1 -0
  38. package/i18n/flags/gb-sct.svg +1 -0
  39. package/i18n/flags/gb.svg +1 -0
  40. package/i18n/flags/gd.svg +1 -0
  41. package/i18n/flags/ge.svg +1 -0
  42. package/i18n/flags/gl.svg +1 -0
  43. package/i18n/flags/gu.svg +1 -0
  44. package/i18n/flags/he.svg +1 -0
  45. package/i18n/flags/hi.svg +1 -0
  46. package/i18n/flags/hr.svg +1 -0
  47. package/i18n/flags/hu.svg +1 -0
  48. package/i18n/flags/hy.svg +1 -0
  49. package/i18n/flags/id.svg +1 -0
  50. package/i18n/flags/ie.svg +1 -0
  51. package/i18n/flags/in.svg +1 -0
  52. package/i18n/flags/ir.svg +1 -0
  53. package/i18n/flags/is.svg +1 -0
  54. package/i18n/flags/it.svg +1 -0
  55. package/i18n/flags/ja.svg +1 -0
  56. package/i18n/flags/ke.svg +1 -0
  57. package/i18n/flags/kg.svg +1 -0
  58. package/i18n/flags/kh.svg +1 -0
  59. package/i18n/flags/kk.svg +1 -0
  60. package/i18n/flags/km.svg +1 -0
  61. package/i18n/flags/kn.svg +1 -0
  62. package/i18n/flags/ko.svg +1 -0
  63. package/i18n/flags/kz.svg +1 -0
  64. package/i18n/flags/la.svg +1 -0
  65. package/i18n/flags/lb.svg +1 -0
  66. package/i18n/flags/lk.svg +1 -0
  67. package/i18n/flags/lt.svg +1 -0
  68. package/i18n/flags/lv.svg +1 -0
  69. package/i18n/flags/ly.svg +1 -0
  70. package/i18n/flags/ma.svg +1 -0
  71. package/i18n/flags/md.svg +1 -0
  72. package/i18n/flags/mk.svg +1 -0
  73. package/i18n/flags/ml.svg +1 -0
  74. package/i18n/flags/mm.svg +1 -0
  75. package/i18n/flags/mn.svg +1 -0
  76. package/i18n/flags/mr.svg +1 -0
  77. package/i18n/flags/ms.svg +1 -0
  78. package/i18n/flags/mt.svg +1 -0
  79. package/i18n/flags/mx.svg +1 -0
  80. package/i18n/flags/my.svg +1 -0
  81. package/i18n/flags/ne.svg +1 -0
  82. package/i18n/flags/nl.svg +1 -0
  83. package/i18n/flags/no.svg +1 -0
  84. package/i18n/flags/np.svg +1 -0
  85. package/i18n/flags/oc.svg +1 -0
  86. package/i18n/flags/pa.svg +1 -0
  87. package/i18n/flags/pk.svg +1 -0
  88. package/i18n/flags/pl.svg +1 -0
  89. package/i18n/flags/ps.svg +1 -0
  90. package/i18n/flags/pt.svg +1 -0
  91. package/i18n/flags/rm.svg +1 -0
  92. package/i18n/flags/ro.svg +1 -0
  93. package/i18n/flags/ru.svg +1 -0
  94. package/i18n/flags/sa.svg +1 -0
  95. package/i18n/flags/si.svg +1 -0
  96. package/i18n/flags/sk.svg +1 -0
  97. package/i18n/flags/sl.svg +1 -0
  98. package/i18n/flags/sr.svg +1 -0
  99. package/i18n/flags/sv.svg +1 -0
  100. package/i18n/flags/sw.svg +1 -0
  101. package/i18n/flags/ta.svg +1 -0
  102. package/i18n/flags/te.svg +1 -0
  103. package/i18n/flags/th.svg +1 -0
  104. package/i18n/flags/tj.svg +1 -0
  105. package/i18n/flags/tl.svg +1 -0
  106. package/i18n/flags/tn.svg +1 -0
  107. package/i18n/flags/tr.svg +1 -0
  108. package/i18n/flags/ua.svg +1 -0
  109. package/i18n/flags/ur.svg +1 -0
  110. package/i18n/flags/us.svg +1 -0
  111. package/i18n/flags/uz.svg +1 -0
  112. package/i18n/flags/vi.svg +1 -0
  113. package/i18n/flags/za.svg +1 -0
  114. package/i18n/flags/zh.svg +1 -0
  115. package/i18n/locales/eager/dndev_ar.json +2 -1
  116. package/i18n/locales/eager/dndev_da.json +2 -1
  117. package/i18n/locales/eager/dndev_de.json +2 -1
  118. package/i18n/locales/eager/dndev_en.json +2 -1
  119. package/i18n/locales/eager/dndev_es.json +2 -1
  120. package/i18n/locales/eager/dndev_fr.json +2 -1
  121. package/i18n/locales/eager/dndev_it.json +2 -1
  122. package/i18n/locales/eager/dndev_ja.json +2 -1
  123. package/i18n/locales/eager/dndev_ko.json +2 -1
  124. package/i18n/locales/eager/dndev_nl.json +2 -1
  125. package/i18n/locales/eager/dndev_pl.json +2 -1
  126. package/i18n/locales/eager/dndev_pt.json +2 -1
  127. package/i18n/locales/eager/dndev_zh.json +2 -1
  128. package/i18n/locales/lazy/auth_ar.json +19 -2
  129. package/i18n/locales/lazy/auth_da.json +22 -2
  130. package/i18n/locales/lazy/auth_de.json +19 -2
  131. package/i18n/locales/lazy/auth_en.json +19 -2
  132. package/i18n/locales/lazy/auth_es.json +19 -2
  133. package/i18n/locales/lazy/auth_fr.json +19 -2
  134. package/i18n/locales/lazy/auth_it.json +19 -2
  135. package/i18n/locales/lazy/auth_ja.json +19 -2
  136. package/i18n/locales/lazy/auth_ko.json +19 -2
  137. package/i18n/locales/lazy/auth_nl.json +22 -2
  138. package/i18n/locales/lazy/auth_pl.json +19 -2
  139. package/i18n/locales/lazy/auth_pt.json +19 -2
  140. package/i18n/locales/lazy/auth_zh.json +19 -2
  141. package/i18n/locales/lazy/crud_ar.json +3 -1
  142. package/i18n/locales/lazy/crud_da.json +3 -1
  143. package/i18n/locales/lazy/crud_de.json +3 -1
  144. package/i18n/locales/lazy/crud_en.json +3 -1
  145. package/i18n/locales/lazy/crud_es.json +3 -1
  146. package/i18n/locales/lazy/crud_fr.json +3 -1
  147. package/i18n/locales/lazy/crud_it.json +3 -1
  148. package/i18n/locales/lazy/crud_ja.json +3 -1
  149. package/i18n/locales/lazy/crud_ko.json +3 -1
  150. package/i18n/locales/lazy/crud_nl.json +3 -1
  151. package/i18n/locales/lazy/crud_pl.json +3 -1
  152. package/i18n/locales/lazy/crud_pt.json +3 -1
  153. package/i18n/locales/lazy/crud_zh.json +3 -1
  154. package/index.d.ts +6927 -6153
  155. package/index.js +3 -3
  156. package/next/index.d.ts +250 -23
  157. package/next/index.js +556 -594
  158. package/next/runtime.js +3 -3
  159. package/package.json +4 -3
  160. package/server.d.ts +6950 -6153
  161. package/shared.js +2 -1
  162. package/symbol-index.json +1 -1
  163. package/vite/index.d.ts +85 -10
  164. package/vite/index.js +152 -152
  165. package/chunks/FlagBase-IQILJTOA.js +0 -1
  166. package/chunks/chunk-I6HT4XNS.js +0 -1
  167. package/chunks/chunk-PX544BGJ.js +0 -1
  168. package/chunks/flagAF-JHV34XMS.js +0 -1
  169. package/chunks/flagAL-UH6NKHXO.js +0 -1
  170. package/chunks/flagAM-7XYXA6G6.js +0 -1
  171. package/chunks/flagAR-LO3YLUZF.js +0 -1
  172. package/chunks/flagAT-6SWWBNVY.js +0 -1
  173. package/chunks/flagAU-FIJG7J4T.js +0 -1
  174. package/chunks/flagAZ-6AIO4DNL.js +0 -1
  175. package/chunks/flagBA-PIQRWY42.js +0 -1
  176. package/chunks/flagBD-7PXOE6GM.js +0 -1
  177. package/chunks/flagBE-2ZP6HCIM.js +0 -1
  178. package/chunks/flagBG-4XSHCVYH.js +0 -1
  179. package/chunks/flagBN-OF5XRA5N.js +0 -1
  180. package/chunks/flagBR-Y2266PSZ.js +0 -1
  181. package/chunks/flagBS-UV5PVKWJ.js +0 -1
  182. package/chunks/flagBY-MNAFXBA6.js +0 -1
  183. package/chunks/flagBZH-AOCZVEVI.js +0 -1
  184. package/chunks/flagCA-VR6MSBTS.js +0 -1
  185. package/chunks/flagCH-Q7MV5SPV.js +0 -1
  186. package/chunks/flagCO-C2YBOMO2.js +0 -1
  187. package/chunks/flagCS-5BC7NJX6.js +0 -1
  188. package/chunks/flagCY-PPAUTJGB.js +0 -1
  189. package/chunks/flagDA-LPI2JRTO.js +0 -1
  190. package/chunks/flagDE-MQDJAEWL.js +0 -1
  191. package/chunks/flagDZ-M6NVCF3D.js +0 -1
  192. package/chunks/flagEE-LY2JJ44X.js +0 -1
  193. package/chunks/flagEL-PP2HZIV7.js +0 -1
  194. package/chunks/flagEN-TGFHJYK7.js +0 -1
  195. package/chunks/flagES-C3H6SSSI.js +0 -1
  196. package/chunks/flagET-GEZLWRTF.js +0 -1
  197. package/chunks/flagEU-YJF5577W.js +0 -1
  198. package/chunks/flagFA-QCQKNEUZ.js +0 -1
  199. package/chunks/flagFI-LN5ICHNF.js +0 -1
  200. package/chunks/flagFR-5JPZSUVS.js +0 -1
  201. package/chunks/flagFR-COR-KPRNU2U6.js +0 -1
  202. package/chunks/flagGA-PUAQ7VY3.js +0 -1
  203. package/chunks/flagGB-SCT-RJGHRDJP.js +0 -1
  204. package/chunks/flagGB-XD2JB7EC.js +0 -1
  205. package/chunks/flagGD-ABOZBNKE.js +0 -1
  206. package/chunks/flagGE-N7C2KHVA.js +0 -1
  207. package/chunks/flagGL-AO2LC4XU.js +0 -1
  208. package/chunks/flagGU-RNGQ3TIY.js +0 -1
  209. package/chunks/flagHE-QUAWLF43.js +0 -1
  210. package/chunks/flagHI-JOOJFNKB.js +0 -1
  211. package/chunks/flagHR-2U7YEA7P.js +0 -1
  212. package/chunks/flagHU-6SPEV3OO.js +0 -1
  213. package/chunks/flagHY-L62LW6BP.js +0 -1
  214. package/chunks/flagID-LV75M4R3.js +0 -1
  215. package/chunks/flagIE-LBTC7LCK.js +0 -1
  216. package/chunks/flagIN-3UWOJ2S3.js +0 -1
  217. package/chunks/flagIR-44N33GFX.js +0 -1
  218. package/chunks/flagIS-VCPTXPLZ.js +0 -1
  219. package/chunks/flagIT-KB4NWTBO.js +0 -1
  220. package/chunks/flagJA-KLHM6VYH.js +0 -1
  221. package/chunks/flagKE-MZONPGAJ.js +0 -1
  222. package/chunks/flagKG-VF3T4E3E.js +0 -1
  223. package/chunks/flagKH-K5ZXX3DS.js +0 -1
  224. package/chunks/flagKK-ZZTJKPMR.js +0 -1
  225. package/chunks/flagKM-Y3XA6HXW.js +0 -1
  226. package/chunks/flagKN-OMVHGIUS.js +0 -1
  227. package/chunks/flagKO-UBLOXGRF.js +0 -1
  228. package/chunks/flagKZ-PYOALOB6.js +0 -1
  229. package/chunks/flagLA-4ONTEYIB.js +0 -1
  230. package/chunks/flagLB-FGOBUCL4.js +0 -1
  231. package/chunks/flagLK-BEVYO56P.js +0 -1
  232. package/chunks/flagLT-TYWQGIIQ.js +0 -1
  233. package/chunks/flagLV-S34SVWJJ.js +0 -1
  234. package/chunks/flagLY-AVR5B6N3.js +0 -1
  235. package/chunks/flagMA-KHTPMDTL.js +0 -1
  236. package/chunks/flagMD-TQMYMRQI.js +0 -1
  237. package/chunks/flagMK-C4CIIAUH.js +0 -1
  238. package/chunks/flagML-JEE5UGDD.js +0 -1
  239. package/chunks/flagMM-M72A7CHZ.js +0 -1
  240. package/chunks/flagMN-34CH7Q43.js +0 -1
  241. package/chunks/flagMR-KIJ2BPCC.js +0 -1
  242. package/chunks/flagMS-6COZCDLY.js +0 -1
  243. package/chunks/flagMT-HDBP7BED.js +0 -1
  244. package/chunks/flagMX-3XBPZTP5.js +0 -1
  245. package/chunks/flagMY-Y7C3QGRG.js +0 -1
  246. package/chunks/flagNE-LCWCYEQW.js +0 -1
  247. package/chunks/flagNL-3RFQSLLH.js +0 -1
  248. package/chunks/flagNO-RNDXHKBT.js +0 -1
  249. package/chunks/flagNP-IKVTRWFR.js +0 -1
  250. package/chunks/flagOC-JWCST6MI.js +0 -1
  251. package/chunks/flagPA-5SGZJRNZ.js +0 -1
  252. package/chunks/flagPK-KQ674PEZ.js +0 -1
  253. package/chunks/flagPL-V2ITOKFK.js +0 -1
  254. package/chunks/flagPS-WBOKI4MV.js +0 -1
  255. package/chunks/flagPT-PFIUVBWR.js +0 -1
  256. package/chunks/flagRM-MEV6U4AJ.js +0 -1
  257. package/chunks/flagRO-JPMXEGLK.js +0 -1
  258. package/chunks/flagRU-3BBKEK34.js +0 -1
  259. package/chunks/flagSA-N7OI2M6Y.js +0 -1
  260. package/chunks/flagSI-UTODFLQZ.js +0 -1
  261. package/chunks/flagSK-EV5JZ2DI.js +0 -1
  262. package/chunks/flagSL-Y4LHIV2J.js +0 -1
  263. package/chunks/flagSR-MTRWQPJ5.js +0 -1
  264. package/chunks/flagSV-LYVDSSJ4.js +0 -1
  265. package/chunks/flagSW-GJO5P4HE.js +0 -1
  266. package/chunks/flagTA-CDT3KYEB.js +0 -1
  267. package/chunks/flagTE-5EXMXH6E.js +0 -1
  268. package/chunks/flagTH-ODJA4CWB.js +0 -1
  269. package/chunks/flagTJ-CE5SV6V4.js +0 -1
  270. package/chunks/flagTL-TRVUF3XO.js +0 -1
  271. package/chunks/flagTN-G6ERYSZ3.js +0 -1
  272. package/chunks/flagTR-33VFGL2S.js +0 -1
  273. package/chunks/flagUA-HESNDKQJ.js +0 -1
  274. package/chunks/flagUR-ECIZZCDG.js +0 -1
  275. package/chunks/flagUS-M7R4WRRU.js +0 -1
  276. package/chunks/flagUZ-YW54WCES.js +0 -1
  277. package/chunks/flagVI-K3DF2THA.js +0 -1
  278. package/chunks/flagZA-5UIOKDJH.js +0 -1
  279. package/chunks/flagZH-5IE3RZVQ.js +0 -1
package/next/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { ICrudAdapter, AnyEntity, EntitySeoRecord, EntitySeoOptions, EntitySeo, LanguageRouting, languageUrls } from '@donotdev/core/server';
2
+ import { Metadata } from 'next';
3
+ import { LanguageRouting, EntitySeoOptions, AnyEntity, EntitySeoRecord, EntitySeo, languageUrl, buildBreadcrumbJsonLd, dndevSchema, formatTrailingSlash, ICrudAdapter, languageUrls, OperationSchemas } from '@donotdev/core/server';
3
4
 
4
5
  /**
5
6
  * Footer mode constants - DRY single source of truth
@@ -411,7 +412,11 @@ interface SEOConfig {
411
412
  generateSitemap?: boolean;
412
413
  /** Default namespace for i18n translations (default: 'home') */
413
414
  defaultNamespace?: string;
414
- /** Default image for social sharing */
415
+ /**
416
+ * Default image for social sharing (`og:image`, Twitter card) of pages that set none
417
+ * (default: {@link DEFAULT_OG_IMAGE}, `/og-image.png`, generated from `public/logo.svg`).
418
+ * PNG or JPG: link-preview crawlers do not render SVG.
419
+ */
415
420
  defaultImage?: string;
416
421
  /** Twitter handle (without @) */
417
422
  twitterHandle?: string;
@@ -515,6 +520,45 @@ interface HeadersConfig {
515
520
  cache?: readonly CacheOverride[];
516
521
  }
517
522
 
523
+ /**
524
+ * One woff2 file of an app-owned font family ({@link LocalFontConfig}).
525
+ *
526
+ * @since 0.3.3
527
+ */
528
+ interface LocalFontFace {
529
+ /** woff2 path relative to the app root, e.g. `'src/assets/fonts/brand.woff2'` */
530
+ file: string;
531
+ /** A weight (`400`) or a variable font's range (`'300 600'`) */
532
+ weight: number | `${number} ${number}`;
533
+ /** Default `'normal'` */
534
+ style?: 'normal' | 'italic';
535
+ /**
536
+ * The face's `unicode-range` (`'U+AC00-D7A3'`): the browser downloads the file only for
537
+ * characters in it. Omitted: the family's core file, preloaded for the first paint.
538
+ */
539
+ unicodeRange?: string;
540
+ /**
541
+ * Subset the face covers, matched against the page language
542
+ * (`LOCALE_TO_FONT_SUBSETS`, e.g. `'latin-ext'` for `pl`): a face with a `unicodeRange`
543
+ * is preloaded on the pages whose language needs this subset.
544
+ */
545
+ subset?: string;
546
+ }
547
+
548
+ /**
549
+ * An app-owned font family: its woff2 files, for a family no fontsource package
550
+ * provides (a custom subset, a licensed brand font). The family is named in the theme
551
+ * tokens like any other (`--font-sans: Pretendard, 'Pretendard Fallback', sans-serif;`).
552
+ *
553
+ * @since 0.3.3
554
+ */
555
+ interface LocalFontConfig {
556
+ /** Picks the system font of the size-matched fallback face: Arial, or Times New Roman for `serif` */
557
+ category: 'sans-serif' | 'serif';
558
+ /** The family's files */
559
+ faces: readonly LocalFontFace[];
560
+ }
561
+
518
562
  /**
519
563
  * Favicon and PWA configuration
520
564
  *
@@ -534,7 +578,7 @@ interface HeadersConfig {
534
578
  * @author AMBROISE PARK Consulting
535
579
  */
536
580
  interface FaviconConfig {
537
- /** Enable automatic favicon system (default: true) */
581
+ /** Favicon tags in the HTML (default: true); `false` writes none, like `favicon: false` */
538
582
  enabled?: boolean;
539
583
  /** App name for PWA manifest */
540
584
  appName?: string;
@@ -544,7 +588,7 @@ interface FaviconConfig {
544
588
  backgroundColor?: string;
545
589
  /** Include PWA manifest icons */
546
590
  includeManifestIcons?: boolean;
547
- /** Include Microsoft tile icons */
591
+ /** Microsoft tile metas: `msapplication-TileImage` (needs `/favicon-32x32.png`) and `msapplication-TileColor` (`themeColor`) */
548
592
  includeMSIcons?: boolean;
549
593
  }
550
594
 
@@ -733,14 +777,21 @@ interface AppConfig {
733
777
  */
734
778
  revalidate?: number | false;
735
779
  /**
736
- * Prerender entity pages at build (Next adapter). **Defaults to `true`**: each
737
- * single-param page whose records the sitemap lists (`/produits/:slug`, entity from
738
- * its `src/pages/<entity>/` folder, not `auth`, not `seo.noindex`) is built once per
780
+ * Prerender entity pages at build. **Defaults to `true`**: each
781
+ * single-param page whose records the sitemap lists (`/produits/:slug`, page declaring
782
+ * its entity in PageMeta `entity: productEntity`, not `auth`, not `seo.noindex`) is built once per
739
783
  * published record (public reader, `status` not in `HIDDEN_STATUSES`, same records as
740
- * the sitemap), so a first visit is served from the cache. Records published later
741
- * render on their first request; all refresh per {@link revalidate}. The build reads
742
- * the database: missing env or a failed read fails it. `false` = every URL renders
743
- * on its first request. Ignored by Vite.
784
+ * the sitemap). The build reads the database: missing env or a failed read fails it.
785
+ *
786
+ * - Next: a first visit is served from the cache. Records published later render on
787
+ * their first request; all refresh per {@link revalidate}. `false` = every URL renders
788
+ * on its first request.
789
+ * - Vite (`prerender: 'auto'`, the default): one static HTML per record and language
790
+ * (`dist/produits/serum.html`) with the record's title, description, canonical, Open
791
+ * Graph / Twitter tags, hreflang, Product and BreadcrumbList JSON-LD. Records
792
+ * published later get the SPA shell until the next build. `false` = every record URL
793
+ * gets the SPA shell (sitemap.xml and llms.txt still list the records: the build
794
+ * still reads them).
744
795
  *
745
796
  * @since 0.3.1
746
797
  */
@@ -753,6 +804,31 @@ interface AppConfig {
753
804
  * @since 0.3.1
754
805
  */
755
806
  headers?: HeadersConfig;
807
+ /**
808
+ * The app's own font files, per family as the theme tokens name it (`src/themes.css`),
809
+ * for families no package provides. Every other family is resolved by name:
810
+ * `@fontsource-variable/<slug>`, then `@fontsource/<slug>` in the app's dependencies,
811
+ * then the families `@donotdev/ui` bundles (Inter, Playfair Display, Space Grotesk,
812
+ * Roboto, Press Start 2P). The framework ships every family the theme renders text in
813
+ * (Next and Vite alike): font preloads and inline `@font-face` in the server HTML,
814
+ * `font-display: optional`, size-matched `'<Family> Fallback'` face, content-hashed
815
+ * files under `/fonts/` cached immutable. Read at build; the app writes no
816
+ * `@font-face`, imports no `@fontsource` CSS and uses no `next/font` (each fails the
817
+ * build).
818
+ *
819
+ * @example
820
+ * ```typescript
821
+ * fonts: {
822
+ * Pretendard: {
823
+ * category: 'sans-serif',
824
+ * faces: [{ file: 'src/assets/fonts/pretendard.woff2', weight: '300 700' }],
825
+ * },
826
+ * }
827
+ * ```
828
+ *
829
+ * @since 0.3.3
830
+ */
831
+ fonts?: Readonly<Record<string, LocalFontConfig>>;
756
832
  }
757
833
 
758
834
  /**
@@ -998,12 +1074,18 @@ interface NextConfigOptions {
998
1074
  generateManifest?: boolean;
999
1075
  /** PWA configuration */
1000
1076
  pwa?: PWAOptions;
1001
- /** Server shim options */
1077
+ /**
1078
+ * Ignored on Next (Vite's server shim, `createServerShimPlugin`): Next keeps server-only
1079
+ * modules out of client bundles itself
1080
+ */
1002
1081
  serverShim?: ServerShimOptions;
1003
1082
  /**
1004
1083
  * Standard Next.js config options, passed through to Next (which validates them).
1005
- * `webpack`, `rewrites`, `redirects` and `headers` are composed with the framework's:
1006
- * `headers` rules come after the framework header policy (last wins). Prefer
1084
+ * `rewrites`, `redirects`, `headers` and `compiler.runAfterProductionCompile` are composed
1085
+ * with the framework's: `headers` rules come after the framework header policy (last
1086
+ * wins), the app's `runAfterProductionCompile` runs after the framework's (Safari < 14.1
1087
+ * destructuring fix). The framework sets no `webpack` config (Next 16 builds with
1088
+ * Turbopack): an app's own passes through. Prefer
1007
1089
  * `appConfig.headers` for CSP sources and cache overrides (same option on Vite).
1008
1090
  */
1009
1091
  [key: string]: any;
@@ -1024,7 +1106,7 @@ declare function defineNextConfig(options?: NextConfigOptions): any;
1024
1106
 
1025
1107
  /**
1026
1108
  * Create PostCSS configuration for Next.js consumer apps.
1027
- * Handles @fontsource CSS alias and workspace-aware package resolution.
1109
+ * Workspace-aware package resolution (no font goes through CSS: the font plan ships fonts as head tags).
1028
1110
  *
1029
1111
  * @example
1030
1112
  * ```js
@@ -1078,6 +1160,10 @@ interface NextMetadata {
1078
1160
  * @param path - Route path (e.g., '/', '/about')
1079
1161
  * @param locale - Current locale (defaults to manifest's defaultLocale)
1080
1162
  * @param options - Additional options
1163
+ * @returns The page metadata, with the AutoMetaTags defaults: image
1164
+ * `appConfig.seo.defaultImage` (else `/og-image.png`); `robots` `{ index: false }` on
1165
+ * auth-only pages (opt back in with `seo: { noindex: false }`), `{ index: false, follow: false }`
1166
+ * with `seo: { noindex: true }`
1081
1167
  */
1082
1168
  declare function getMetadataForPath(
1083
1169
  path: string,
@@ -1132,8 +1218,12 @@ interface SitemapContext {
1132
1218
  baseUrl: string;
1133
1219
  /** App languages (one language: one URL per page, no alternates) */
1134
1220
  routing: LanguageRouting;
1221
+ /** The app's next.config `trailingSlash`: page URLs end with `/` when true */
1222
+ trailingSlash: boolean;
1135
1223
  /** Public (anonymous) CRUD reader; required when a route lists records (`collection`) */
1136
1224
  crud?: ICrudAdapter;
1225
+ /** {@link entityReadSchemas} of the app's entities; required when a route lists records */
1226
+ readSchemas?: EntityReadSchemas;
1137
1227
  /** `languageUrls` from @donotdev/core/server */
1138
1228
  languageUrls: typeof languageUrls;
1139
1229
  /** `HIDDEN_STATUSES` from @donotdev/core/server: records with these statuses are not listed */
@@ -1166,7 +1256,7 @@ declare function formatSitemapXml(entries: readonly SitemapEntry[]): string;
1166
1256
 
1167
1257
  /** One public route of llms.txt, as written by the build. */
1168
1258
  interface LlmsTxtRoute extends PublicRoute {
1169
- /** Page label in the app's language (static routes; a dynamic route uses each record's title) */
1259
+ /** Page title in the app's language, its `<title>` (`routeSeo`; static routes; a dynamic route uses each record's title) */
1170
1260
  title?: string;
1171
1261
  /** Page description in the app's language (static routes) */
1172
1262
  description?: string;
@@ -1196,10 +1286,16 @@ interface LlmsTxtSource {
1196
1286
 
1197
1287
  /** What the generated llms.txt route passes besides the build-written source. */
1198
1288
  interface LlmsTxtContext {
1289
+ /** The app's next.config `trailingSlash`: page URLs end with `/` when true */
1290
+ trailingSlash: boolean;
1291
+ /** `formatTrailingSlash` from @donotdev/core/server */
1292
+ formatTrailingSlash: typeof formatTrailingSlash;
1199
1293
  /** The app's entity definitions (`import * as entities from 'entities'`) */
1200
1294
  entities: Readonly<Record<string, unknown>>;
1201
1295
  /** Public (anonymous) CRUD reader; required when a route lists records (`collection`) */
1202
1296
  crud?: ICrudAdapter;
1297
+ /** {@link entityReadSchemas} of the app's entities; required when a route lists records */
1298
+ readSchemas?: EntityReadSchemas;
1203
1299
  /** `deriveEntitySeo` from @donotdev/core/server */
1204
1300
  deriveEntitySeo: (
1205
1301
  entity: AnyEntity,
@@ -1212,10 +1308,11 @@ interface LlmsTxtContext {
1212
1308
 
1213
1309
  /**
1214
1310
  * Build the app's llms.txt: the sitemap's pages, static ones under the pages heading,
1215
- * entity records under their entity's plural name with their `deriveEntitySeo` title.
1311
+ * entity records under their entity's plural name with their `deriveEntitySeo` title
1312
+ * (the site name for a record without one, as its page).
1216
1313
  *
1217
- * @throws When a static route has no label, a collection has no entity definition or
1218
- * heading, a published record has no title, or the read fails
1314
+ * @throws When a collection has no entity definition or heading, a static route of the
1315
+ * source has no title (a source not from `getLlmsTxtSource`), or the read fails
1219
1316
  */
1220
1317
  declare function buildLlmsTxt(
1221
1318
  source: LlmsTxtSource & LlmsTxtContext
@@ -1226,15 +1323,145 @@ declare function buildLlmsTxt(
1226
1323
  * per public record of the route's collection (`status` not in `hiddenStatuses`), the same
1227
1324
  * records as the route's sitemap and llms.txt URLs. Values are raw (Next encodes them).
1228
1325
  *
1229
- * @throws When the route has no collection or several params, or the read fails
1326
+ * @throws When the route has no collection or several params, no read schema is given for
1327
+ * its collection, or the read fails
1230
1328
  * @since 0.3.1
1231
1329
  */
1232
1330
  declare function listStaticParams(
1233
1331
  route: PublicRoute,
1234
1332
  crud: ICrudAdapter,
1235
- hiddenStatuses: readonly string[]
1333
+ hiddenStatuses: readonly string[],
1334
+ readSchemas: EntityReadSchemas
1236
1335
  ): Promise<Array<Record<string, string>>>;
1237
1336
 
1337
+ /** Collection → read schema (`createSchemas(entity).get`), from {@link entityReadSchemas}. */
1338
+ type EntityReadSchemas = Readonly<Record<string, dndevSchema<unknown>>>;
1339
+
1340
+ /**
1341
+ * Read schema of each record route's collection: `createSchemas(entity).get` of its entity
1342
+ * definition, the schema the client lists pass to `crud.query`. The record readers
1343
+ * (sitemap, llms.txt, `listStaticParams`, `readEntityPageRecord`) query with it, so rows
1344
+ * come back keyed by the entity's field names, with everything the database returns to a
1345
+ * signed-out visitor (the public readers filter nothing: RLS / Security Rules decide).
1346
+ *
1347
+ * @param entities - The app's entity definitions (`import * as entities from 'entities'`)
1348
+ * @param routes - Routes; each one with a collection gets its schema
1349
+ * @param createSchemas - `createSchemas` from @donotdev/core/server
1350
+ * @throws When a route's collection has no entity definition
1351
+ * @since 0.3.2
1352
+ */
1353
+ declare function entityReadSchemas(
1354
+ entities: Readonly<Record<string, unknown>>,
1355
+ routes: readonly PublicRoute[],
1356
+ createSchemas: (entity: AnyEntity) => OperationSchemas
1357
+ ): EntityReadSchemas;
1358
+
1359
+ // ---------------------------------------------------------------------------
1360
+ // Entity pages (server runtime of the generated entity page.tsx)
1361
+ // ---------------------------------------------------------------------------
1362
+
1363
+ /**
1364
+ * The public record an entity page URL names: `<param> == value` and `status` not in
1365
+ * `hiddenStatuses`, read with the public (anonymous) reader and the collection's read
1366
+ * schema (same filter and schema as {@link listStaticParams} and the sitemap). The
1367
+ * generated page wraps it in React `cache`: its `generateMetadata` and component read it
1368
+ * once per request.
1369
+ *
1370
+ * @returns The record, null when no public record has that value (the page 404s)
1371
+ * @throws When the route has no collection or several params, no read schema is given for
1372
+ * its collection, or the read fails
1373
+ * @since 0.3.2
1374
+ */
1375
+ declare function readEntityPageRecord(
1376
+ route: PublicRoute,
1377
+ value: string,
1378
+ crud: ICrudAdapter,
1379
+ hiddenStatuses: readonly string[],
1380
+ readSchemas: EntityReadSchemas
1381
+ ): Promise<Record<string, unknown> | null>;
1382
+
1383
+ /** What the generated entity page passes to {@link entityPageSeo}. */
1384
+ interface EntityPageContext {
1385
+ /** The page's route (`/produits/:slug`) and the collection filling its param */
1386
+ route: PublicRoute & { collection: string };
1387
+ /** The URL's param value */
1388
+ value: string;
1389
+ /** The page's language (the URL's `[lang]`, or the app language) */
1390
+ language: string;
1391
+ /** App languages */
1392
+ routing: LanguageRouting;
1393
+ /** Absolute app URL, no trailing slash (`appBaseUrl`) */
1394
+ baseUrl: string;
1395
+ /** The app's next.config `trailingSlash` */
1396
+ trailingSlash: boolean;
1397
+ /** Site name (`appConfig.seo.siteName`, else `appConfig.app.name`): title suffix */
1398
+ siteName: string;
1399
+ /**
1400
+ * Link-preview image of a record without one (`appConfig.seo.defaultImage`, else
1401
+ * `DEFAULT_OG_IMAGE`, `/og-image.png`): the default of every other page
1402
+ */
1403
+ defaultImage: string;
1404
+ /** The page's PageMeta `seo.type` (default `website`); `product` adds Product JSON-LD */
1405
+ type: 'website' | 'article' | 'product';
1406
+ /** The app's entity definitions (`import * as entities from 'entities'`) */
1407
+ entities: Readonly<Record<string, unknown>>;
1408
+ /** Translation function for namespaces in `language` (`useTranslation` from @donotdev/core/rsc) */
1409
+ translate: (namespaces: string[]) => EntitySeoOptions['t'];
1410
+ /** `deriveEntitySeo` from @donotdev/core/server */
1411
+ deriveEntitySeo: (
1412
+ entity: AnyEntity,
1413
+ data: EntitySeoRecord,
1414
+ options: EntitySeoOptions
1415
+ ) => EntitySeo;
1416
+ /** `buildProductJsonLd` from @donotdev/core/server */
1417
+ buildProductJsonLd: (seo: EntitySeo, url: string) => Record<string, unknown> | null;
1418
+ /** `languageUrl` from @donotdev/core/server */
1419
+ languageUrl: typeof languageUrl;
1420
+ /** `buildBreadcrumbJsonLd` from @donotdev/core/server (BreadcrumbList ending with the record title) */
1421
+ buildBreadcrumbJsonLd: typeof buildBreadcrumbJsonLd;
1422
+ }
1423
+
1424
+ /** Server identity of one entity page. */
1425
+ interface EntityPageSeo {
1426
+ /**
1427
+ * Return value of the page's `generateMetadata`: `title` / `openGraph.title` /
1428
+ * `twitter.title` absolute, description, Open Graph (`type` when `website` or `article`,
1429
+ * absolute image), Twitter card (`summary_large_image` with an image)
1430
+ */
1431
+ metadata: Metadata;
1432
+ /** og:type the metadata API cannot render (`product`): the page renders `<meta property="og:type">` */
1433
+ ogType: string | null;
1434
+ /** Product JSON-LD (`type: 'product'`), null otherwise */
1435
+ jsonLd: Record<string, unknown> | null;
1436
+ /**
1437
+ * BreadcrumbList JSON-LD: site home, the URL's segments as the visible breadcrumb names
1438
+ * them, the record title last (null without a record title). AutoMetaTags emits no
1439
+ * breadcrumb on these routes (`routes.manifest.recordBreadcrumbPaths`).
1440
+ */
1441
+ breadcrumb: Record<string, unknown> | null;
1442
+ }
1443
+
1444
+ /**
1445
+ * Next `Metadata` and JSON-LD of an entity page from its record: title `<record title> |
1446
+ * <site name>` (absolute), description, Open Graph, Twitter card, og:type, Product JSON-LD,
1447
+ * text in the page language (`deriveEntitySeo` with the entity's `seo` option and
1448
+ * translations). No canonical / hreflang / og:url: AutoMetaTags emits them on every route.
1449
+ *
1450
+ * @throws When the route's collection has no entity definition
1451
+ * @since 0.3.2
1452
+ */
1453
+ declare function entityPageSeo(
1454
+ record: Record<string, unknown>,
1455
+ context: EntityPageContext
1456
+ ): EntityPageSeo;
1457
+
1458
+ /**
1459
+ * JSON-LD as `<script type="application/ld+json">` text, `<` escaped.
1460
+ *
1461
+ * @since 0.3.2
1462
+ */
1463
+ declare function jsonLdScript(jsonLd: Record<string, unknown>): string;
1464
+
1238
1465
  // ---------------------------------------------------------------------------
1239
1466
  // On-demand revalidation (server runtime of the generated revalidate route handler)
1240
1467
  // ---------------------------------------------------------------------------
@@ -1305,5 +1532,5 @@ declare function handleRevalidationWebhook(
1305
1532
  context: RevalidationContext
1306
1533
  ): Promise<Response>;
1307
1534
 
1308
- export { REVALIDATE_ROUTE_PATH, REVALIDATE_SECRET_ENV, appBaseUrl, buildLlmsTxt, buildSitemap, clearMetadataCache, defineNextConfig, definePostCSSConfig, formatSitemapXml, getMetadataForPath, handleRevalidationWebhook, listStaticParams, revalidationPaths };
1309
- export type { LlmsTxtContext, LlmsTxtRoute, LlmsTxtSource, NextConfigOptions, PublicRoute, RecordChange, RevalidationContext, SitemapContext, SitemapEntry, SitemapRoute };
1535
+ export { REVALIDATE_ROUTE_PATH, REVALIDATE_SECRET_ENV, appBaseUrl, buildLlmsTxt, buildSitemap, clearMetadataCache, defineNextConfig, definePostCSSConfig, entityPageSeo, entityReadSchemas, formatSitemapXml, getMetadataForPath, handleRevalidationWebhook, jsonLdScript, listStaticParams, readEntityPageRecord, revalidationPaths };
1536
+ export type { EntityPageContext, EntityPageSeo, EntityReadSchemas, LlmsTxtContext, LlmsTxtRoute, LlmsTxtSource, NextConfigOptions, PublicRoute, RecordChange, RevalidationContext, SitemapContext, SitemapEntry, SitemapRoute };