@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.
- package/functions/index.d.ts +99 -10
- package/functions/index.js +20 -18
- package/i18n/flags/af.svg +1 -0
- package/i18n/flags/al.svg +1 -0
- package/i18n/flags/am.svg +1 -0
- package/i18n/flags/ar.svg +1 -0
- package/i18n/flags/at.svg +1 -0
- package/i18n/flags/au.svg +1 -0
- package/i18n/flags/az.svg +1 -0
- package/i18n/flags/ba.svg +1 -0
- package/i18n/flags/bd.svg +1 -0
- package/i18n/flags/be.svg +1 -0
- package/i18n/flags/bg.svg +1 -0
- package/i18n/flags/bn.svg +1 -0
- package/i18n/flags/br.svg +1 -0
- package/i18n/flags/bs.svg +1 -0
- package/i18n/flags/by.svg +1 -0
- package/i18n/flags/bzh.svg +1 -0
- package/i18n/flags/ca.svg +1 -0
- package/i18n/flags/ch.svg +1 -0
- package/i18n/flags/co.svg +1 -0
- package/i18n/flags/cs.svg +1 -0
- package/i18n/flags/cy.svg +1 -0
- package/i18n/flags/da.svg +1 -0
- package/i18n/flags/de.svg +1 -0
- package/i18n/flags/dz.svg +1 -0
- package/i18n/flags/ee.svg +1 -0
- package/i18n/flags/el.svg +1 -0
- package/i18n/flags/en.svg +1 -0
- package/i18n/flags/es.svg +1 -0
- package/i18n/flags/et.svg +1 -0
- package/i18n/flags/eu.svg +1 -0
- package/i18n/flags/fa.svg +1 -0
- package/i18n/flags/fi.svg +1 -0
- package/i18n/flags/fr-cor.svg +1 -0
- package/i18n/flags/fr.svg +1 -0
- package/i18n/flags/ga.svg +1 -0
- package/i18n/flags/gb-sct.svg +1 -0
- package/i18n/flags/gb.svg +1 -0
- package/i18n/flags/gd.svg +1 -0
- package/i18n/flags/ge.svg +1 -0
- package/i18n/flags/gl.svg +1 -0
- package/i18n/flags/gu.svg +1 -0
- package/i18n/flags/he.svg +1 -0
- package/i18n/flags/hi.svg +1 -0
- package/i18n/flags/hr.svg +1 -0
- package/i18n/flags/hu.svg +1 -0
- package/i18n/flags/hy.svg +1 -0
- package/i18n/flags/id.svg +1 -0
- package/i18n/flags/ie.svg +1 -0
- package/i18n/flags/in.svg +1 -0
- package/i18n/flags/ir.svg +1 -0
- package/i18n/flags/is.svg +1 -0
- package/i18n/flags/it.svg +1 -0
- package/i18n/flags/ja.svg +1 -0
- package/i18n/flags/ke.svg +1 -0
- package/i18n/flags/kg.svg +1 -0
- package/i18n/flags/kh.svg +1 -0
- package/i18n/flags/kk.svg +1 -0
- package/i18n/flags/km.svg +1 -0
- package/i18n/flags/kn.svg +1 -0
- package/i18n/flags/ko.svg +1 -0
- package/i18n/flags/kz.svg +1 -0
- package/i18n/flags/la.svg +1 -0
- package/i18n/flags/lb.svg +1 -0
- package/i18n/flags/lk.svg +1 -0
- package/i18n/flags/lt.svg +1 -0
- package/i18n/flags/lv.svg +1 -0
- package/i18n/flags/ly.svg +1 -0
- package/i18n/flags/ma.svg +1 -0
- package/i18n/flags/md.svg +1 -0
- package/i18n/flags/mk.svg +1 -0
- package/i18n/flags/ml.svg +1 -0
- package/i18n/flags/mm.svg +1 -0
- package/i18n/flags/mn.svg +1 -0
- package/i18n/flags/mr.svg +1 -0
- package/i18n/flags/ms.svg +1 -0
- package/i18n/flags/mt.svg +1 -0
- package/i18n/flags/mx.svg +1 -0
- package/i18n/flags/my.svg +1 -0
- package/i18n/flags/ne.svg +1 -0
- package/i18n/flags/nl.svg +1 -0
- package/i18n/flags/no.svg +1 -0
- package/i18n/flags/np.svg +1 -0
- package/i18n/flags/oc.svg +1 -0
- package/i18n/flags/pa.svg +1 -0
- package/i18n/flags/pk.svg +1 -0
- package/i18n/flags/pl.svg +1 -0
- package/i18n/flags/ps.svg +1 -0
- package/i18n/flags/pt.svg +1 -0
- package/i18n/flags/rm.svg +1 -0
- package/i18n/flags/ro.svg +1 -0
- package/i18n/flags/ru.svg +1 -0
- package/i18n/flags/sa.svg +1 -0
- package/i18n/flags/si.svg +1 -0
- package/i18n/flags/sk.svg +1 -0
- package/i18n/flags/sl.svg +1 -0
- package/i18n/flags/sr.svg +1 -0
- package/i18n/flags/sv.svg +1 -0
- package/i18n/flags/sw.svg +1 -0
- package/i18n/flags/ta.svg +1 -0
- package/i18n/flags/te.svg +1 -0
- package/i18n/flags/th.svg +1 -0
- package/i18n/flags/tj.svg +1 -0
- package/i18n/flags/tl.svg +1 -0
- package/i18n/flags/tn.svg +1 -0
- package/i18n/flags/tr.svg +1 -0
- package/i18n/flags/ua.svg +1 -0
- package/i18n/flags/ur.svg +1 -0
- package/i18n/flags/us.svg +1 -0
- package/i18n/flags/uz.svg +1 -0
- package/i18n/flags/vi.svg +1 -0
- package/i18n/flags/za.svg +1 -0
- package/i18n/flags/zh.svg +1 -0
- package/i18n/locales/eager/dndev_ar.json +2 -1
- package/i18n/locales/eager/dndev_da.json +2 -1
- package/i18n/locales/eager/dndev_de.json +2 -1
- package/i18n/locales/eager/dndev_en.json +2 -1
- package/i18n/locales/eager/dndev_es.json +2 -1
- package/i18n/locales/eager/dndev_fr.json +2 -1
- package/i18n/locales/eager/dndev_it.json +2 -1
- package/i18n/locales/eager/dndev_ja.json +2 -1
- package/i18n/locales/eager/dndev_ko.json +2 -1
- package/i18n/locales/eager/dndev_nl.json +2 -1
- package/i18n/locales/eager/dndev_pl.json +2 -1
- package/i18n/locales/eager/dndev_pt.json +2 -1
- package/i18n/locales/eager/dndev_zh.json +2 -1
- package/i18n/locales/lazy/auth_ar.json +19 -2
- package/i18n/locales/lazy/auth_da.json +22 -2
- package/i18n/locales/lazy/auth_de.json +19 -2
- package/i18n/locales/lazy/auth_en.json +19 -2
- package/i18n/locales/lazy/auth_es.json +19 -2
- package/i18n/locales/lazy/auth_fr.json +19 -2
- package/i18n/locales/lazy/auth_it.json +19 -2
- package/i18n/locales/lazy/auth_ja.json +19 -2
- package/i18n/locales/lazy/auth_ko.json +19 -2
- package/i18n/locales/lazy/auth_nl.json +22 -2
- package/i18n/locales/lazy/auth_pl.json +19 -2
- package/i18n/locales/lazy/auth_pt.json +19 -2
- package/i18n/locales/lazy/auth_zh.json +19 -2
- package/i18n/locales/lazy/crud_ar.json +3 -1
- package/i18n/locales/lazy/crud_da.json +3 -1
- package/i18n/locales/lazy/crud_de.json +3 -1
- package/i18n/locales/lazy/crud_en.json +3 -1
- package/i18n/locales/lazy/crud_es.json +3 -1
- package/i18n/locales/lazy/crud_fr.json +3 -1
- package/i18n/locales/lazy/crud_it.json +3 -1
- package/i18n/locales/lazy/crud_ja.json +3 -1
- package/i18n/locales/lazy/crud_ko.json +3 -1
- package/i18n/locales/lazy/crud_nl.json +3 -1
- package/i18n/locales/lazy/crud_pl.json +3 -1
- package/i18n/locales/lazy/crud_pt.json +3 -1
- package/i18n/locales/lazy/crud_zh.json +3 -1
- package/index.d.ts +6927 -6153
- package/index.js +3 -3
- package/next/index.d.ts +250 -23
- package/next/index.js +556 -594
- package/next/runtime.js +3 -3
- package/package.json +4 -3
- package/server.d.ts +6950 -6153
- package/shared.js +2 -1
- package/symbol-index.json +1 -1
- package/vite/index.d.ts +85 -10
- package/vite/index.js +152 -152
- package/chunks/FlagBase-IQILJTOA.js +0 -1
- package/chunks/chunk-I6HT4XNS.js +0 -1
- package/chunks/chunk-PX544BGJ.js +0 -1
- package/chunks/flagAF-JHV34XMS.js +0 -1
- package/chunks/flagAL-UH6NKHXO.js +0 -1
- package/chunks/flagAM-7XYXA6G6.js +0 -1
- package/chunks/flagAR-LO3YLUZF.js +0 -1
- package/chunks/flagAT-6SWWBNVY.js +0 -1
- package/chunks/flagAU-FIJG7J4T.js +0 -1
- package/chunks/flagAZ-6AIO4DNL.js +0 -1
- package/chunks/flagBA-PIQRWY42.js +0 -1
- package/chunks/flagBD-7PXOE6GM.js +0 -1
- package/chunks/flagBE-2ZP6HCIM.js +0 -1
- package/chunks/flagBG-4XSHCVYH.js +0 -1
- package/chunks/flagBN-OF5XRA5N.js +0 -1
- package/chunks/flagBR-Y2266PSZ.js +0 -1
- package/chunks/flagBS-UV5PVKWJ.js +0 -1
- package/chunks/flagBY-MNAFXBA6.js +0 -1
- package/chunks/flagBZH-AOCZVEVI.js +0 -1
- package/chunks/flagCA-VR6MSBTS.js +0 -1
- package/chunks/flagCH-Q7MV5SPV.js +0 -1
- package/chunks/flagCO-C2YBOMO2.js +0 -1
- package/chunks/flagCS-5BC7NJX6.js +0 -1
- package/chunks/flagCY-PPAUTJGB.js +0 -1
- package/chunks/flagDA-LPI2JRTO.js +0 -1
- package/chunks/flagDE-MQDJAEWL.js +0 -1
- package/chunks/flagDZ-M6NVCF3D.js +0 -1
- package/chunks/flagEE-LY2JJ44X.js +0 -1
- package/chunks/flagEL-PP2HZIV7.js +0 -1
- package/chunks/flagEN-TGFHJYK7.js +0 -1
- package/chunks/flagES-C3H6SSSI.js +0 -1
- package/chunks/flagET-GEZLWRTF.js +0 -1
- package/chunks/flagEU-YJF5577W.js +0 -1
- package/chunks/flagFA-QCQKNEUZ.js +0 -1
- package/chunks/flagFI-LN5ICHNF.js +0 -1
- package/chunks/flagFR-5JPZSUVS.js +0 -1
- package/chunks/flagFR-COR-KPRNU2U6.js +0 -1
- package/chunks/flagGA-PUAQ7VY3.js +0 -1
- package/chunks/flagGB-SCT-RJGHRDJP.js +0 -1
- package/chunks/flagGB-XD2JB7EC.js +0 -1
- package/chunks/flagGD-ABOZBNKE.js +0 -1
- package/chunks/flagGE-N7C2KHVA.js +0 -1
- package/chunks/flagGL-AO2LC4XU.js +0 -1
- package/chunks/flagGU-RNGQ3TIY.js +0 -1
- package/chunks/flagHE-QUAWLF43.js +0 -1
- package/chunks/flagHI-JOOJFNKB.js +0 -1
- package/chunks/flagHR-2U7YEA7P.js +0 -1
- package/chunks/flagHU-6SPEV3OO.js +0 -1
- package/chunks/flagHY-L62LW6BP.js +0 -1
- package/chunks/flagID-LV75M4R3.js +0 -1
- package/chunks/flagIE-LBTC7LCK.js +0 -1
- package/chunks/flagIN-3UWOJ2S3.js +0 -1
- package/chunks/flagIR-44N33GFX.js +0 -1
- package/chunks/flagIS-VCPTXPLZ.js +0 -1
- package/chunks/flagIT-KB4NWTBO.js +0 -1
- package/chunks/flagJA-KLHM6VYH.js +0 -1
- package/chunks/flagKE-MZONPGAJ.js +0 -1
- package/chunks/flagKG-VF3T4E3E.js +0 -1
- package/chunks/flagKH-K5ZXX3DS.js +0 -1
- package/chunks/flagKK-ZZTJKPMR.js +0 -1
- package/chunks/flagKM-Y3XA6HXW.js +0 -1
- package/chunks/flagKN-OMVHGIUS.js +0 -1
- package/chunks/flagKO-UBLOXGRF.js +0 -1
- package/chunks/flagKZ-PYOALOB6.js +0 -1
- package/chunks/flagLA-4ONTEYIB.js +0 -1
- package/chunks/flagLB-FGOBUCL4.js +0 -1
- package/chunks/flagLK-BEVYO56P.js +0 -1
- package/chunks/flagLT-TYWQGIIQ.js +0 -1
- package/chunks/flagLV-S34SVWJJ.js +0 -1
- package/chunks/flagLY-AVR5B6N3.js +0 -1
- package/chunks/flagMA-KHTPMDTL.js +0 -1
- package/chunks/flagMD-TQMYMRQI.js +0 -1
- package/chunks/flagMK-C4CIIAUH.js +0 -1
- package/chunks/flagML-JEE5UGDD.js +0 -1
- package/chunks/flagMM-M72A7CHZ.js +0 -1
- package/chunks/flagMN-34CH7Q43.js +0 -1
- package/chunks/flagMR-KIJ2BPCC.js +0 -1
- package/chunks/flagMS-6COZCDLY.js +0 -1
- package/chunks/flagMT-HDBP7BED.js +0 -1
- package/chunks/flagMX-3XBPZTP5.js +0 -1
- package/chunks/flagMY-Y7C3QGRG.js +0 -1
- package/chunks/flagNE-LCWCYEQW.js +0 -1
- package/chunks/flagNL-3RFQSLLH.js +0 -1
- package/chunks/flagNO-RNDXHKBT.js +0 -1
- package/chunks/flagNP-IKVTRWFR.js +0 -1
- package/chunks/flagOC-JWCST6MI.js +0 -1
- package/chunks/flagPA-5SGZJRNZ.js +0 -1
- package/chunks/flagPK-KQ674PEZ.js +0 -1
- package/chunks/flagPL-V2ITOKFK.js +0 -1
- package/chunks/flagPS-WBOKI4MV.js +0 -1
- package/chunks/flagPT-PFIUVBWR.js +0 -1
- package/chunks/flagRM-MEV6U4AJ.js +0 -1
- package/chunks/flagRO-JPMXEGLK.js +0 -1
- package/chunks/flagRU-3BBKEK34.js +0 -1
- package/chunks/flagSA-N7OI2M6Y.js +0 -1
- package/chunks/flagSI-UTODFLQZ.js +0 -1
- package/chunks/flagSK-EV5JZ2DI.js +0 -1
- package/chunks/flagSL-Y4LHIV2J.js +0 -1
- package/chunks/flagSR-MTRWQPJ5.js +0 -1
- package/chunks/flagSV-LYVDSSJ4.js +0 -1
- package/chunks/flagSW-GJO5P4HE.js +0 -1
- package/chunks/flagTA-CDT3KYEB.js +0 -1
- package/chunks/flagTE-5EXMXH6E.js +0 -1
- package/chunks/flagTH-ODJA4CWB.js +0 -1
- package/chunks/flagTJ-CE5SV6V4.js +0 -1
- package/chunks/flagTL-TRVUF3XO.js +0 -1
- package/chunks/flagTN-G6ERYSZ3.js +0 -1
- package/chunks/flagTR-33VFGL2S.js +0 -1
- package/chunks/flagUA-HESNDKQJ.js +0 -1
- package/chunks/flagUR-ECIZZCDG.js +0 -1
- package/chunks/flagUS-M7R4WRRU.js +0 -1
- package/chunks/flagUZ-YW54WCES.js +0 -1
- package/chunks/flagVI-K3DF2THA.js +0 -1
- package/chunks/flagZA-5UIOKDJH.js +0 -1
- 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 {
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
737
|
-
* single-param page whose records the sitemap lists (`/produits/:slug`,
|
|
738
|
-
* its `
|
|
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)
|
|
741
|
-
*
|
|
742
|
-
*
|
|
743
|
-
*
|
|
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
|
-
/**
|
|
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
|
-
* `
|
|
1006
|
-
* `headers` rules come after the framework header policy (last
|
|
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
|
-
*
|
|
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
|
|
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
|
|
1218
|
-
*
|
|
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,
|
|
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 };
|