nuxt-og-image 3.0.0-rc.6 → 3.0.0-rc.61
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/README.md +6 -19
- package/dist/client/200.html +265 -15
- package/dist/client/404.html +265 -15
- package/dist/client/_nuxt/-7WWnkdy.js +517 -0
- package/dist/client/_nuxt/0ooBkv16.js +1 -0
- package/dist/client/_nuxt/1Je9_Reo.js +136 -0
- package/dist/client/_nuxt/1rqFXsGc.js +666 -0
- package/dist/client/_nuxt/37ic6j3l.js +1 -0
- package/dist/client/_nuxt/3ghuYFLd.js +1 -0
- package/dist/client/_nuxt/6Kuza3Wr.js +1 -0
- package/dist/client/_nuxt/6XBPEST2.js +1 -0
- package/dist/client/_nuxt/8t4jSAMm.js +1 -0
- package/dist/client/_nuxt/9B1nZgL-.js +1 -0
- package/dist/client/_nuxt/9ZOzOPqN.js +1 -0
- package/dist/client/_nuxt/AgnqFTPX.js +13 -0
- package/dist/client/_nuxt/B1nm99XP.js +2 -0
- package/dist/client/_nuxt/B2DkETJQ.js +1 -0
- package/dist/client/_nuxt/B3g-KkBK.js +1 -0
- package/dist/client/_nuxt/B4yE-MfL.js +38 -0
- package/dist/client/_nuxt/B6E6ObS_.js +8 -0
- package/dist/client/_nuxt/B6bHXiXE.js +25 -0
- package/dist/client/_nuxt/B7rNE5kf.js +1 -0
- package/dist/client/_nuxt/B9CT-1u6.js +7 -0
- package/dist/client/_nuxt/B9S9BZZh.js +1 -0
- package/dist/client/_nuxt/BB42E8aY.js +186 -0
- package/dist/client/_nuxt/BBBqETUW.js +1 -0
- package/dist/client/_nuxt/BBDuFDsq.js +1 -0
- package/dist/client/_nuxt/BBJYjQ0k.js +1 -0
- package/dist/client/_nuxt/BEjL32p1.js +5754 -0
- package/dist/client/_nuxt/BF6G6X0H.js +1 -0
- package/dist/client/_nuxt/BH1M7C1g.js +1 -0
- package/dist/client/_nuxt/BH_RS3WO.js +1 -0
- package/dist/client/_nuxt/BICIrM8O.js +1 -0
- package/dist/client/_nuxt/BITGhEdf.js +1 -0
- package/dist/client/_nuxt/BIl_88gt.js +1 -0
- package/dist/client/_nuxt/BIxS-Weu.js +1 -0
- package/dist/client/_nuxt/BLluXI4E.js +1 -0
- package/dist/client/_nuxt/BMHPAh1U.js +2 -0
- package/dist/client/_nuxt/BN4LRXf6.js +4 -0
- package/dist/client/_nuxt/BOpLLL-w.js +1 -0
- package/dist/client/_nuxt/BPiaQZfK.js +1 -0
- package/dist/client/_nuxt/BR6CMsBL.js +1 -0
- package/dist/client/_nuxt/BSB_bK09.js +1 -0
- package/dist/client/_nuxt/BT9ZzGyQ.js +69 -0
- package/dist/client/_nuxt/BTtaZsq5.js +1 -0
- package/dist/client/_nuxt/BUpeXbsf.js +25 -0
- package/dist/client/_nuxt/BVGdgKAv.js +1 -0
- package/dist/client/_nuxt/BVLuctcA.js +1 -0
- package/dist/client/_nuxt/BVkeqZ59.js +1 -0
- package/dist/client/_nuxt/BWKJ1FCf.js +239 -0
- package/dist/client/_nuxt/BXF7Vm5l.js +1 -0
- package/dist/client/_nuxt/BXR915QZ.js +32 -0
- package/dist/client/_nuxt/BXTKWaEE.js +1 -0
- package/dist/client/_nuxt/BXfENWL6.js +1 -0
- package/dist/client/_nuxt/BYdKNJ10.js +1 -0
- package/dist/client/_nuxt/BZfs-ost.js +1 -0
- package/dist/client/_nuxt/BZz1Hhek.js +1 -0
- package/dist/client/_nuxt/B_SUYfiV.js +1 -0
- package/dist/client/_nuxt/BaNxgKSR.js +17 -0
- package/dist/client/_nuxt/BaWyeHV_.js +1 -0
- package/dist/client/_nuxt/BacI6-DX.js +40 -0
- package/dist/client/_nuxt/BaedD2tq.js +1 -0
- package/dist/client/_nuxt/BbJj1K1w.js +1 -0
- package/dist/client/_nuxt/Bbv8ARUV.js +13 -0
- package/dist/client/_nuxt/Bdt_eLrj.js +756 -0
- package/dist/client/_nuxt/BeJnKnI_.js +544 -0
- package/dist/client/_nuxt/BeX7Iu5M.js +90 -0
- package/dist/client/_nuxt/BeocmOPF.js +1 -0
- package/dist/client/_nuxt/Bg0wAK5a.js +100 -0
- package/dist/client/_nuxt/Bgpqy2XC.js +1 -0
- package/dist/client/_nuxt/Bh8mriwU.js +17 -0
- package/dist/client/_nuxt/Bi43K_FX.js +6 -0
- package/dist/client/_nuxt/BiDE021q.js +1 -0
- package/dist/client/_nuxt/BigF1UXR.js +1 -0
- package/dist/client/_nuxt/Bj0fF4lQ.js +1 -0
- package/dist/client/_nuxt/Bj5xdiaE.js +1 -0
- package/dist/client/_nuxt/BlxWTfDV.js +699 -0
- package/dist/client/_nuxt/BmCW-tYz.js +86 -0
- package/dist/client/_nuxt/Bn5gmY5k.js +1 -0
- package/dist/client/_nuxt/BnyYJeap.js +129 -0
- package/dist/client/_nuxt/Br6ll-O0.js +1 -0
- package/dist/client/_nuxt/BscxmKrE.js +8 -0
- package/dist/client/_nuxt/BsvsQ1iS.js +1 -0
- package/dist/client/_nuxt/Btshr8M_.js +70 -0
- package/dist/client/_nuxt/BvCdDh2R.js +1 -0
- package/dist/client/_nuxt/BwXNTs7T.js +1 -0
- package/dist/client/_nuxt/Bxkoe-BC.js +1 -0
- package/dist/client/_nuxt/BxwAa5i0.js +1 -0
- package/dist/client/_nuxt/ByMv4Xf1.js +1 -0
- package/dist/client/_nuxt/C15OxdQ5.js +1 -0
- package/dist/client/_nuxt/C1DVX8_8.js +831 -0
- package/dist/client/_nuxt/C1yTBzia.js +1 -0
- package/dist/client/_nuxt/C2TBxDwV.js +1 -0
- package/dist/client/_nuxt/C3qJFuQy.js +3 -0
- package/dist/client/_nuxt/C3qUB5O8.js +301 -0
- package/dist/client/_nuxt/C6Aznpr-.js +1 -0
- package/dist/client/_nuxt/C6XIsc4F.js +1 -0
- package/dist/client/_nuxt/C7oZ9nno.js +1 -0
- package/dist/client/_nuxt/C86elO-m.js +1 -0
- package/dist/client/_nuxt/C9d3aiqh.js +1 -0
- package/dist/client/_nuxt/CA9nliXM.js +1 -0
- package/dist/client/_nuxt/CApMHEaB.js +1 -0
- package/dist/client/_nuxt/CBPJd_fO.js +1 -0
- package/dist/client/_nuxt/CBWrHyXe.js +580 -0
- package/dist/client/_nuxt/CCqFro8U.js +3 -0
- package/dist/client/_nuxt/CEfge3mM.js +1 -0
- package/dist/client/_nuxt/CFF2d1j6.js +1 -0
- package/dist/client/_nuxt/CG4fK2Nq.js +21 -0
- package/dist/client/_nuxt/CGmujMTu.js +1 -0
- package/dist/client/_nuxt/CJGKC1_q.js +40 -0
- package/dist/client/_nuxt/CJIaz0BQ.js +76 -0
- package/dist/client/_nuxt/CJQrLysU.js +1 -0
- package/dist/client/_nuxt/CMDmr8et.js +2 -0
- package/dist/client/_nuxt/CO5hpdkB.js +1 -0
- package/dist/client/_nuxt/CO7HdiM_.js +1 -0
- package/dist/client/_nuxt/CQUCfALx.js +13 -0
- package/dist/client/_nuxt/CRDKj6ck.js +1 -0
- package/dist/client/_nuxt/CRlnGVMD.js +1 -0
- package/dist/client/_nuxt/CSPeAESR.js +1 -0
- package/dist/client/_nuxt/CThH5sBG.js +1 -0
- package/dist/client/_nuxt/CX_FIdg1.js +1 -0
- package/dist/client/_nuxt/CZZ6oYdA.js +1 -0
- package/dist/client/_nuxt/C_8Fx7bH.js +1 -0
- package/dist/client/_nuxt/C_ZPRiAj.js +26 -0
- package/dist/client/_nuxt/CarfVElc.js +80 -0
- package/dist/client/_nuxt/Cb-F_BZP.js +1 -0
- package/dist/client/_nuxt/CbViG2Xw.js +74 -0
- package/dist/client/_nuxt/CbYhyuC0.js +505 -0
- package/dist/client/_nuxt/Cda-MJFk.js +1 -0
- package/dist/client/_nuxt/CdedUr_-.js +1 -0
- package/dist/client/_nuxt/CfPQhs6g.js +7 -0
- package/dist/client/_nuxt/Cgl53LJQ.js +1 -0
- package/dist/client/_nuxt/CgwOUXSn.js +1 -0
- package/dist/client/_nuxt/ChH25C4w.js +1 -0
- package/dist/client/_nuxt/ChMCFiS0.js +1 -0
- package/dist/client/_nuxt/CiRxTSAc.js +1 -0
- package/dist/client/_nuxt/Cicx_DS6.js +1 -0
- package/dist/client/_nuxt/ClXEvkw9.js +68 -0
- package/dist/client/_nuxt/CowR2XfX.js +1 -0
- package/dist/client/_nuxt/Cp2HGa90.js +353 -0
- package/dist/client/_nuxt/CpAANOdC.js +1 -0
- package/dist/client/_nuxt/CqYeW6XZ.js +1 -0
- package/dist/client/_nuxt/CrgTADc5.js +1 -0
- package/dist/client/_nuxt/CrhH3_Og.js +1 -0
- package/dist/client/_nuxt/CsTmP73Z.js +1 -0
- package/dist/client/_nuxt/CsYA0RN7.js +1 -0
- package/dist/client/_nuxt/CsyjKwr8.js +1 -0
- package/dist/client/_nuxt/CsyrCbsw.js +699 -0
- package/dist/client/_nuxt/Cthz8VOO.js +771 -0
- package/dist/client/_nuxt/CuJfdYLG.js +1 -0
- package/dist/client/_nuxt/CupVZNk8.js +25 -0
- package/dist/client/_nuxt/CxrokwfH.js +1 -0
- package/dist/client/_nuxt/CzPA46E-.js +1 -0
- package/dist/client/_nuxt/D33OKbkv.js +1 -0
- package/dist/client/_nuxt/D384ylkT.js +1 -0
- package/dist/client/_nuxt/D3VXSfF0.js +1 -0
- package/dist/client/_nuxt/D4LaosRr.js +1 -0
- package/dist/client/_nuxt/D6pmzCqS.js +1 -0
- package/dist/client/_nuxt/D71BffLY.js +1 -0
- package/dist/client/_nuxt/D7WeZTai.js +1 -0
- package/dist/client/_nuxt/DAGYewaG.js +559 -0
- package/dist/client/_nuxt/DAP_O-zg.js +1 -0
- package/dist/client/_nuxt/DAVo6uMX.js +1 -0
- package/dist/client/_nuxt/DAfrLhwG.js +1 -0
- package/dist/client/_nuxt/DBeuZS66.js +1 -0
- package/dist/client/_nuxt/DBxHOdLe.js +1 -0
- package/dist/client/_nuxt/DC4hdoM9.js +87 -0
- package/dist/client/_nuxt/DC8MraHL.js +666 -0
- package/dist/client/_nuxt/DGDuLtS6.js +8 -0
- package/dist/client/_nuxt/DGEpfOTx.js +1 -0
- package/dist/client/_nuxt/DGO8GyiP.js +1 -0
- package/dist/client/_nuxt/DGxQkqYo.js +1 -0
- package/dist/client/_nuxt/DHmGyzbM.js +109 -0
- package/dist/client/_nuxt/DJZWsvj0.js +1 -0
- package/dist/client/_nuxt/DJubGRtk.js +1 -0
- package/dist/client/_nuxt/DK4oFTHQ.js +200 -0
- package/dist/client/_nuxt/DKb4lQY2.js +1 -0
- package/dist/client/_nuxt/DLP9ZvWb.js +3 -0
- package/dist/client/_nuxt/DM4HHECw.js +1 -0
- package/dist/client/_nuxt/DNR26wTC.js +1 -0
- package/dist/client/_nuxt/DOHBU7tp.js +1 -0
- package/dist/client/_nuxt/DOqtC9FP.js +1 -0
- package/dist/client/_nuxt/DOtRmeXT.js +1 -0
- package/dist/client/_nuxt/DR5YgmI2.js +1 -0
- package/dist/client/_nuxt/DS9ZWoKD.js +1 -0
- package/dist/client/_nuxt/DSrLtGYv.js +15 -0
- package/dist/client/_nuxt/DSsji4Hu.js +1 -0
- package/dist/client/_nuxt/DV9JwLIa.js +1 -0
- package/dist/client/_nuxt/DVC_qXWv.js +1 -0
- package/dist/client/_nuxt/DVLwECkk.js +1 -0
- package/dist/client/_nuxt/DVfdqzEq.js +1 -0
- package/dist/client/_nuxt/DXFkqnOI.js +816 -0
- package/dist/client/_nuxt/DXT9h7v2.js +1 -0
- package/dist/client/_nuxt/DXZpi2gR.js +1 -0
- package/dist/client/_nuxt/DY7_9Ga-.js +1 -0
- package/dist/client/_nuxt/DYI1rfmx.js +25 -0
- package/dist/client/_nuxt/DZLoTQm4.js +1 -0
- package/dist/client/_nuxt/DZqG9GXz.js +50 -0
- package/dist/client/_nuxt/DbK06e1c.js +21 -0
- package/dist/client/_nuxt/Dble9ECP.js +1 -0
- package/dist/client/_nuxt/Dch3xQiY.js +699 -0
- package/dist/client/_nuxt/Dd6f7Z5P.js +1 -0
- package/dist/client/_nuxt/DdacRhvC.js +1 -0
- package/dist/client/_nuxt/DeVv6D4_.js +1 -0
- package/dist/client/_nuxt/DfeQjIbs.js +5 -0
- package/dist/client/_nuxt/Dg0DGYq4.js +14 -0
- package/dist/client/_nuxt/DhFF74a2.js +1 -0
- package/dist/client/_nuxt/Dit6kIrv.js +11 -0
- package/dist/client/_nuxt/DjTlIhuc.js +1 -0
- package/dist/client/_nuxt/DmDrTTlz.js +1 -0
- package/dist/client/_nuxt/DnLUQrgA.js +1 -0
- package/dist/client/_nuxt/DouzTJIq.js +1 -0
- package/dist/client/_nuxt/DrnZp123.js +40 -0
- package/dist/client/_nuxt/DsfXcHUZ.js +29 -0
- package/dist/client/_nuxt/Du6_OKDb.js +159 -0
- package/dist/client/_nuxt/DvyTQcux.js +1 -0
- package/dist/client/_nuxt/Dwo2i-71.js +1 -0
- package/dist/client/_nuxt/DwuVtWc2.js +518 -0
- package/dist/client/_nuxt/DzwdaLuO.js +223 -0
- package/dist/client/_nuxt/ECt0lbkd.js +16 -0
- package/dist/client/_nuxt/Eh5U-gDp.js +52 -0
- package/dist/client/_nuxt/FJDVp-XM.js +1 -0
- package/dist/client/_nuxt/HrnDn_2Q.js +1 -0
- package/dist/client/_nuxt/I4qd5QHW.js +10 -0
- package/dist/client/_nuxt/JgH_6NEN.js +1 -0
- package/dist/client/_nuxt/KEYLhlmT.js +1 -0
- package/dist/client/_nuxt/KPqz0Sb3.js +1 -0
- package/dist/client/_nuxt/Ksn5IXup.js +1 -0
- package/dist/client/_nuxt/MS3qTAOR.js +1 -0
- package/dist/client/_nuxt/PWN5J14X.js +1 -0
- package/dist/client/_nuxt/PifQWv0n.js +1 -0
- package/dist/client/_nuxt/QZ3jNtnE.js +515 -0
- package/dist/client/_nuxt/RCJZWN-0.js +81 -0
- package/dist/client/_nuxt/RE3ujT-k.js +1 -0
- package/dist/client/_nuxt/RqY_Nz63.js +1 -0
- package/dist/client/_nuxt/Sfo2eW0G.js +274 -0
- package/dist/client/_nuxt/T9ysyp6P.js +62 -0
- package/dist/client/_nuxt/UREJT2Bw.js +1 -0
- package/dist/client/_nuxt/Urb1RsFe.js +1 -0
- package/dist/client/_nuxt/VQMr7AbF.js +1 -0
- package/dist/client/_nuxt/YxQm0tCS.js +1 -0
- package/dist/client/_nuxt/alpzPJ78.js +1 -0
- package/dist/client/_nuxt/beD-FUib.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/3674f358-df54-4f45-ae67-3d676c88ba31.json +1 -0
- package/dist/client/_nuxt/cW9vKj3g.js +1 -0
- package/dist/client/_nuxt/cw46T5ID.js +61 -0
- package/dist/client/_nuxt/dIHJ9UdL.js +1 -0
- package/dist/client/_nuxt/eJfcURhx.js +1 -0
- package/dist/client/_nuxt/entry.BCfFhbeW.css +1 -0
- package/dist/client/_nuxt/error-404.B3wjZPBT.css +1 -0
- package/dist/client/_nuxt/error-500.Dxoa4Ooo.css +1 -0
- package/dist/client/_nuxt/hXH8Gyq8.js +1 -0
- package/dist/client/_nuxt/i0IPvypD.js +1 -0
- package/dist/client/_nuxt/iSbrOpM4.js +1 -0
- package/dist/client/_nuxt/jaXbsbtS.js +1 -0
- package/dist/client/_nuxt/kuh6G-Sk.js +9 -0
- package/dist/client/_nuxt/nclm9rTJ.js +266 -0
- package/dist/client/_nuxt/qxoleWdb.js +1 -0
- package/dist/client/_nuxt/rS0jd3Ly.js +1 -0
- package/dist/client/_nuxt/rltxq8r8.js +131 -0
- package/dist/client/_nuxt/sMI-pExk.js +1 -0
- package/dist/client/_nuxt/sQpxpyUs.js +1 -0
- package/dist/client/_nuxt/vMsNTMhM.js +5 -0
- package/dist/client/_nuxt/wChcbJ1V.js +37 -0
- package/dist/client/_nuxt/xPNGhBYe.js +1 -0
- package/dist/client/_nuxt/yX2IItqj.js +1 -0
- package/dist/client/index.html +265 -15
- package/dist/module.d.mts +9 -106
- package/dist/module.d.ts +9 -106
- package/dist/module.json +6 -2
- package/dist/module.mjs +225 -136
- package/dist/runtime/assets/Inter-400.ttf.base64 +1 -0
- package/dist/runtime/assets/Inter-700.ttf.base64 +1 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/chrome-launcher.js +9 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/on-demand.d.ts +2 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/on-demand.js +35 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/playwright.d.ts +2 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/playwright.js +6 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.d.ts +7 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.js +7 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm-fs.d.ts +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm-fs.js +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm.d.ts +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm.js +7 -0
- package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm-fs.d.ts +1 -1
- package/dist/runtime/{core/bindings/resvg/wasm-fs.mjs → nitro/og-image/bindings/resvg/wasm-fs.js} +1 -1
- package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm.d.ts +1 -1
- package/dist/runtime/nitro/og-image/bindings/resvg/wasm.js +5 -0
- package/dist/runtime/{core/bindings/satori/wasm-fs.mjs → nitro/og-image/bindings/satori/wasm-fs.js} +1 -1
- package/dist/runtime/{core/bindings/satori/wasm.mjs → nitro/og-image/bindings/satori/wasm.js} +1 -2
- package/dist/runtime/nitro/og-image/cache.d.ts +7 -0
- package/dist/runtime/{core/cache/htmlPayload.mjs → nitro/og-image/cache.js} +4 -1
- package/dist/runtime/{core/renderers/chromium/index.d.ts → nitro/og-image/chromium/renderer.d.ts} +1 -1
- package/dist/runtime/{core/renderers/chromium/index.mjs → nitro/og-image/chromium/renderer.js} +1 -1
- package/dist/runtime/{core/renderers → nitro/og-image}/chromium/screenshot.d.ts +1 -2
- package/dist/runtime/{core/renderers/chromium/screenshot.mjs → nitro/og-image/chromium/screenshot.js} +1 -1
- package/dist/runtime/nitro/og-image/context.d.ts +5 -0
- package/dist/runtime/nitro/og-image/context.js +181 -0
- package/dist/runtime/nitro/og-image/instances.d.ts +2 -0
- package/dist/runtime/nitro/og-image/instances.js +10 -0
- package/dist/runtime/nitro/og-image/satori/font.d.ts +2 -0
- package/dist/runtime/nitro/og-image/satori/font.js +39 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/instances.d.ts +5 -5
- package/dist/runtime/{core/renderers/satori/instances.mjs → nitro/og-image/satori/instances.js} +2 -11
- package/dist/runtime/nitro/og-image/satori/plugins/classes.js +17 -0
- package/dist/runtime/{core/renderers/satori/plugins/emojis.mjs → nitro/og-image/satori/plugins/emojis.js} +2 -2
- package/dist/runtime/nitro/og-image/satori/plugins/encoding.js +17 -0
- package/dist/runtime/{core/renderers/satori/plugins/flex.mjs → nitro/og-image/satori/plugins/flex.js} +2 -2
- package/dist/runtime/nitro/og-image/satori/plugins/imageSrc.js +85 -0
- package/dist/runtime/{core/renderers/satori/plugins/unocss.mjs → nitro/og-image/satori/plugins/unocss.js} +1 -1
- package/dist/runtime/{core/renderers/satori/index.d.ts → nitro/og-image/satori/renderer.d.ts} +1 -1
- package/dist/runtime/{core/renderers/satori/index.mjs → nitro/og-image/satori/renderer.js} +30 -17
- package/dist/runtime/nitro/og-image/satori/transforms/emojis.d.ts +5 -0
- package/dist/runtime/nitro/og-image/satori/transforms/emojis.js +3597 -0
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.d.ts +3 -0
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.js +42 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/utils.d.ts +2 -2
- package/dist/runtime/{core/renderers/satori/utils.mjs → nitro/og-image/satori/utils.js} +9 -5
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/vnodes.d.ts +1 -1
- package/dist/runtime/nitro/og-image/satori/vnodes.js +38 -0
- package/dist/runtime/nitro/og-image/templates/html.d.ts +2 -0
- package/dist/runtime/{core/html/devIframeTemplate.mjs → nitro/og-image/templates/html.js} +17 -9
- package/dist/runtime/nitro/plugins/nuxt-content.d.ts +1 -1
- package/dist/runtime/nitro/plugins/{nuxt-content.mjs → nuxt-content.js} +7 -4
- package/dist/runtime/nitro/plugins/prerender.js +28 -0
- package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/debug.json.d.ts +1 -1
- package/dist/runtime/{server/routes/__og-image__/debug.json.mjs → nitro/routes/debug.json.js} +1 -1
- package/dist/runtime/{server/routes/__og-image__/font-[name]-[weight].[extension].mjs → nitro/routes/font.js} +22 -5
- package/dist/runtime/{server/routes/__og-image__/image.mjs → nitro/routes/image.js} +9 -10
- package/dist/runtime/nitro/tsconfig.json +3 -0
- package/dist/runtime/{cache.d.ts → nitro/util/cache.d.ts} +2 -2
- package/dist/runtime/{cache.mjs → nitro/util/cache.js} +2 -1
- package/dist/runtime/nitro/util/encoding.d.ts +3 -0
- package/dist/runtime/nitro/util/encoding.js +15 -0
- package/dist/runtime/nitro/util/kit.d.ts +6 -0
- package/dist/runtime/nitro/util/kit.js +32 -0
- package/dist/runtime/{core/utils → nitro/util}/wasm.d.ts +0 -1
- package/dist/runtime/nuxt/components/OgImage/OgImage.d.ts +5 -0
- package/dist/runtime/nuxt/components/OgImage/OgImageScreenshot.d.ts +5 -0
- package/dist/runtime/nuxt/components/Templates/Community/Frame.vue +64 -0
- package/dist/runtime/{components → nuxt/components}/Templates/Community/Nuxt.vue +6 -5
- package/dist/runtime/{components → nuxt/components}/Templates/Community/NuxtSeo.vue +5 -5
- package/dist/runtime/{components → nuxt/components}/Templates/Community/Pergel.vue +1 -2
- package/dist/runtime/{components → nuxt/components}/Templates/Community/UnJs.vue +2 -2
- package/dist/runtime/{composables → nuxt/composables}/defineOgImage.d.ts +1 -1
- package/dist/runtime/{composables/defineOgImage.mjs → nuxt/composables/defineOgImage.js} +7 -12
- package/dist/runtime/{composables → nuxt/composables}/defineOgImageComponent.d.ts +1 -1
- package/dist/runtime/{composables/defineOgImageComponent.mjs → nuxt/composables/defineOgImageComponent.js} +1 -1
- package/dist/runtime/nuxt/composables/defineOgImageScreenshot.d.ts +2 -0
- package/dist/runtime/nuxt/composables/mock.d.ts +5 -0
- package/dist/runtime/nuxt/composables/mock.js +6 -0
- package/dist/runtime/nuxt/plugins/og-image-canonical-urls.server.d.ts +1 -1
- package/dist/runtime/nuxt/plugins/{og-image-canonical-urls.server.mjs → og-image-canonical-urls.server.js} +16 -6
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.d.ts +1 -1
- package/dist/runtime/nuxt/plugins/{route-rule-og-image.server.mjs → route-rule-og-image.server.js} +3 -3
- package/dist/runtime/nuxt/utils.d.ts +3 -2
- package/dist/runtime/nuxt/{utils.mjs → utils.js} +4 -3
- package/dist/runtime/{utils.pure.d.ts → pure.d.ts} +2 -1
- package/dist/runtime/{utils.pure.mjs → pure.js} +22 -3
- package/dist/runtime/{utils.d.ts → shared.d.ts} +2 -2
- package/dist/runtime/{utils.mjs → shared.js} +3 -2
- package/dist/runtime/types.d.ts +14 -6
- package/dist/types.d.mts +2 -9
- package/dist/types.d.ts +2 -9
- package/package.json +83 -58
- package/dist/client/_nuxt/IconCSS.220290da.js +0 -1
- package/dist/client/_nuxt/IconCSS.f0b56d3e.css +0 -1
- package/dist/client/_nuxt/builds/meta/e73d18b8-bd07-4a22-971c-e8ba17519e8f.json +0 -1
- package/dist/client/_nuxt/entry.5d0abb3d.js +0 -108
- package/dist/client/_nuxt/entry.a30f63d0.css +0 -1
- package/dist/client/_nuxt/error-404.b751fa02.css +0 -1
- package/dist/client/_nuxt/error-404.e6048d23.js +0 -1
- package/dist/client/_nuxt/error-500.3bcefba1.js +0 -1
- package/dist/client/_nuxt/error-500.69009e70.css +0 -1
- package/dist/client/_nuxt/vanilla-picker-NKbIFE8h.23409a58.js +0 -8
- package/dist/runtime/components/OgImage/OgImage.d.ts +0 -5
- package/dist/runtime/components/OgImage/OgImageScreenshot.d.ts +0 -5
- package/dist/runtime/composables/defineOgImageScreenshot.d.ts +0 -2
- package/dist/runtime/core/bindings/chromium/node.mjs +0 -33
- package/dist/runtime/core/bindings/css-inline/node.d.ts +0 -2
- package/dist/runtime/core/bindings/css-inline/node.mjs +0 -2
- package/dist/runtime/core/bindings/resvg/wasm.mjs +0 -6
- package/dist/runtime/core/cache/emojis.d.ts +0 -1
- package/dist/runtime/core/cache/emojis.mjs +0 -5
- package/dist/runtime/core/cache/fonts.d.ts +0 -3
- package/dist/runtime/core/cache/fonts.mjs +0 -6
- package/dist/runtime/core/cache/htmlPayload.d.ts +0 -5
- package/dist/runtime/core/cache/prerender.d.ts +0 -2
- package/dist/runtime/core/cache/prerender.mjs +0 -5
- package/dist/runtime/core/env/assets.d.ts +0 -1
- package/dist/runtime/core/env/assets.mjs +0 -11
- package/dist/runtime/core/font/fetch.d.ts +0 -2
- package/dist/runtime/core/font/fetch.mjs +0 -36
- package/dist/runtime/core/html/applyEmojis.d.ts +0 -3
- package/dist/runtime/core/html/applyEmojis.mjs +0 -37
- package/dist/runtime/core/html/applyInlineCss.d.ts +0 -3
- package/dist/runtime/core/html/applyInlineCss.mjs +0 -32
- package/dist/runtime/core/html/devIframeTemplate.d.ts +0 -2
- package/dist/runtime/core/html/fetchIsland.d.ts +0 -3
- package/dist/runtime/core/html/fetchIsland.mjs +0 -17
- package/dist/runtime/core/options/extract.d.ts +0 -3
- package/dist/runtime/core/options/extract.mjs +0 -49
- package/dist/runtime/core/options/fetch.d.ts +0 -3
- package/dist/runtime/core/options/fetch.mjs +0 -32
- package/dist/runtime/core/renderers/satori/plugins/encoding.mjs +0 -8
- package/dist/runtime/core/renderers/satori/plugins/imageSrc.mjs +0 -75
- package/dist/runtime/core/renderers/satori/plugins/twClasses.mjs +0 -8
- package/dist/runtime/core/renderers/satori/vnodes.mjs +0 -31
- package/dist/runtime/core/utils/resolveRendererContext.d.ts +0 -3
- package/dist/runtime/core/utils/resolveRendererContext.mjs +0 -97
- package/dist/runtime/nitro/plugins/prerender.mjs +0 -36
- package/dist/runtime/nitro/utils.d.ts +0 -2
- package/dist/runtime/nitro/utils.mjs +0 -16
- package/dist/runtime/server/assets/inter-latin-ext-400-normal.woff +0 -0
- package/dist/runtime/server/assets/inter-latin-ext-700-normal.woff +0 -0
- /package/dist/runtime/{core/bindings/chromium/node.d.ts → nitro/og-image/bindings/chromium/chrome-launcher.d.ts} +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/resvg/node.d.ts +0 -0
- /package/dist/runtime/{core/bindings/resvg/node.mjs → nitro/og-image/bindings/resvg/node.js} +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/node.d.ts +0 -0
- /package/dist/runtime/{core/bindings/satori/node.mjs → nitro/og-image/bindings/satori/node.js} +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm-fs.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/sharp/node.d.ts +0 -0
- /package/dist/runtime/{core/bindings/sharp/node.mjs → nitro/og-image/bindings/sharp/node.js} +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/emojis.d.ts → nitro/og-image/satori/plugins/classes.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/encoding.d.ts → nitro/og-image/satori/plugins/emojis.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/flex.d.ts → nitro/og-image/satori/plugins/encoding.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/imageSrc.d.ts → nitro/og-image/satori/plugins/flex.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/twClasses.d.ts → nitro/og-image/satori/plugins/imageSrc.d.ts} +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/unocss.d.ts +0 -0
- /package/dist/runtime/{server/routes/__og-image__/font-[name]-[weight].[extension].d.ts → nitro/routes/font.d.ts} +0 -0
- /package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/image.d.ts +0 -0
- /package/dist/runtime/{core/utils/wasm.mjs → nitro/util/wasm.js} +0 -0
- /package/dist/runtime/{components/OgImage/OgImage.mjs → nuxt/components/OgImage/OgImage.js} +0 -0
- /package/dist/runtime/{components/OgImage/OgImageScreenshot.mjs → nuxt/components/OgImage/OgImageScreenshot.js} +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/BrandedLogo.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/SimpleBlog.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/Wave.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/WithEmoji.vue +0 -0
- /package/dist/runtime/{composables/defineOgImageScreenshot.mjs → nuxt/composables/defineOgImageScreenshot.js} +0 -0
- /package/dist/runtime/{types.mjs → types.js} +0 -0
package/dist/module.mjs
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
|
-
import {
|
|
3
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
4
|
+
import { useNuxt, addTemplate, loadNuxtModuleInstance, createResolver, resolvePath, tryResolveModule, defineNuxtModule, useLogger, addImports, hasNuxtModule, addServerPlugin, addServerHandler, addComponentsDir, addComponent, addPlugin } from '@nuxt/kit';
|
|
4
5
|
import { assertSiteConfig, installNuxtSiteConfig } from 'nuxt-site-config-kit';
|
|
5
|
-
import { provider, env,
|
|
6
|
+
import { provider, env, isCI, isDevelopment } from 'std-env';
|
|
6
7
|
import { hash } from 'ohash';
|
|
7
|
-
import { relative, dirname } from 'pathe';
|
|
8
|
+
import { relative, dirname, isAbsolute, basename } from 'pathe';
|
|
8
9
|
import { defu } from 'defu';
|
|
9
|
-
import {
|
|
10
|
+
import { readPackageJSON } from 'pkg-types';
|
|
11
|
+
import { createStorage } from 'unstorage';
|
|
12
|
+
import fsDriver from 'unstorage/drivers/fs';
|
|
13
|
+
import { withoutLeadingSlash } from 'ufo';
|
|
10
14
|
import { ensureDependencyInstalled } from 'nypm';
|
|
15
|
+
import { relative as relative$1 } from 'node:path';
|
|
11
16
|
import { onDevToolsInitialized, extendServerRpc } from '@nuxt/devtools-kit';
|
|
12
|
-
import { readFile, writeFile } from 'node:fs/promises';
|
|
13
17
|
import { createHash } from 'node:crypto';
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
const version = "3.0.0-rc.6";
|
|
18
|
+
import { Launcher } from 'chrome-launcher';
|
|
19
|
+
import { $fetch } from 'ofetch';
|
|
18
20
|
|
|
19
21
|
const autodetectableProviders = {
|
|
20
22
|
azure_static: "azure",
|
|
@@ -31,8 +33,9 @@ const autodetectableStaticProviders = {
|
|
|
31
33
|
};
|
|
32
34
|
const NodeRuntime = {
|
|
33
35
|
// node-server runtime
|
|
34
|
-
"chromium": "
|
|
35
|
-
|
|
36
|
+
"chromium": "on-demand",
|
|
37
|
+
// this gets changed build start
|
|
38
|
+
"css-inline": "wasm",
|
|
36
39
|
"resvg": "node",
|
|
37
40
|
"satori": "node",
|
|
38
41
|
"sharp": "node"
|
|
@@ -45,33 +48,36 @@ const cloudflare = {
|
|
|
45
48
|
"satori": "node",
|
|
46
49
|
"sharp": false,
|
|
47
50
|
"wasm": {
|
|
48
|
-
esmImport: true
|
|
51
|
+
esmImport: true,
|
|
52
|
+
lazy: true
|
|
49
53
|
}
|
|
50
54
|
};
|
|
51
55
|
const awsLambda = {
|
|
52
56
|
"chromium": false,
|
|
53
|
-
"css-inline": "
|
|
57
|
+
"css-inline": "wasm",
|
|
54
58
|
"resvg": "node",
|
|
55
59
|
"satori": "node",
|
|
56
60
|
"sharp": false
|
|
57
61
|
// 0.33.x has issues
|
|
58
62
|
};
|
|
63
|
+
const WebContainer = {
|
|
64
|
+
"chromium": false,
|
|
65
|
+
"css-inline": "wasm-fs",
|
|
66
|
+
"resvg": "wasm-fs",
|
|
67
|
+
"satori": "wasm-fs",
|
|
68
|
+
"sharp": false
|
|
69
|
+
};
|
|
59
70
|
const RuntimeCompatibility = {
|
|
60
71
|
"nitro-dev": NodeRuntime,
|
|
61
72
|
"nitro-prerender": NodeRuntime,
|
|
62
73
|
"node-server": NodeRuntime,
|
|
63
|
-
"stackblitz":
|
|
64
|
-
|
|
65
|
-
"css-inline": false,
|
|
66
|
-
"resvg": "wasm-fs",
|
|
67
|
-
"satori": "wasm-fs",
|
|
68
|
-
"sharp": false
|
|
69
|
-
},
|
|
74
|
+
"stackblitz": WebContainer,
|
|
75
|
+
"codesandbox": WebContainer,
|
|
70
76
|
"aws-lambda": awsLambda,
|
|
71
77
|
"netlify": awsLambda,
|
|
72
78
|
"netlify-edge": {
|
|
73
79
|
"chromium": false,
|
|
74
|
-
"css-inline":
|
|
80
|
+
"css-inline": "wasm",
|
|
75
81
|
"resvg": "wasm",
|
|
76
82
|
"satori": "node",
|
|
77
83
|
"sharp": false,
|
|
@@ -87,23 +93,31 @@ const RuntimeCompatibility = {
|
|
|
87
93
|
"vercel-edge": {
|
|
88
94
|
"chromium": false,
|
|
89
95
|
"css-inline": false,
|
|
96
|
+
// size constraint (2mb is max)
|
|
90
97
|
"resvg": "wasm",
|
|
91
98
|
"satori": "node",
|
|
92
99
|
"sharp": false,
|
|
93
100
|
"wasm": {
|
|
94
101
|
// lowers workers kb size
|
|
95
|
-
esmImport: true
|
|
102
|
+
esmImport: true,
|
|
103
|
+
lazy: true
|
|
96
104
|
}
|
|
97
105
|
},
|
|
98
106
|
"cloudflare-pages": cloudflare,
|
|
99
|
-
"cloudflare": cloudflare
|
|
107
|
+
"cloudflare": cloudflare,
|
|
108
|
+
"cloudflare-module": cloudflare
|
|
100
109
|
};
|
|
101
110
|
function detectTarget(options = {}) {
|
|
102
111
|
return options?.static ? autodetectableStaticProviders[provider] : autodetectableProviders[provider];
|
|
103
112
|
}
|
|
104
113
|
function resolveNitroPreset(nitroConfig) {
|
|
105
|
-
if (provider === "stackblitz")
|
|
106
|
-
return
|
|
114
|
+
if (provider === "stackblitz" || provider === "codesandbox")
|
|
115
|
+
return provider;
|
|
116
|
+
const nuxt = useNuxt();
|
|
117
|
+
if (nuxt.options.dev)
|
|
118
|
+
return "nitro-dev";
|
|
119
|
+
if (nuxt.options._generate)
|
|
120
|
+
return "nitro-prerender";
|
|
107
121
|
let preset;
|
|
108
122
|
if (nitroConfig && nitroConfig?.preset)
|
|
109
123
|
preset = nitroConfig.preset;
|
|
@@ -123,16 +137,18 @@ function applyNitroPresetCompatibility(nitroConfig, options) {
|
|
|
123
137
|
const { resolve } = options;
|
|
124
138
|
const satoriEnabled = typeof options.compatibility?.satori !== "undefined" ? !!options.compatibility.satori : !!compatibility.satori;
|
|
125
139
|
const chromiumEnabled = typeof options.compatibility?.chromium !== "undefined" ? !!options.compatibility.chromium : !!compatibility.chromium;
|
|
126
|
-
nitroConfig.alias["#nuxt-og-image/renderers/satori"] = satoriEnabled ? resolve("./runtime/
|
|
127
|
-
nitroConfig.alias["#nuxt-og-image/renderers/chromium"] = chromiumEnabled ? resolve("./runtime/
|
|
140
|
+
nitroConfig.alias["#nuxt-og-image/renderers/satori"] = satoriEnabled ? resolve("./runtime/nitro/og-image/satori/renderer") : "unenv/runtime/mock/empty";
|
|
141
|
+
nitroConfig.alias["#nuxt-og-image/renderers/chromium"] = chromiumEnabled ? resolve("./runtime/nitro/og-image/chromium/renderer") : "unenv/runtime/mock/empty";
|
|
128
142
|
const resolvedCompatibility = {};
|
|
129
143
|
function applyBinding(key) {
|
|
130
144
|
let binding = options.compatibility?.[key];
|
|
131
145
|
if (typeof binding === "undefined")
|
|
132
146
|
binding = compatibility[key];
|
|
147
|
+
if (key === "chromium" && binding === "node")
|
|
148
|
+
binding = "playwright";
|
|
133
149
|
resolvedCompatibility[key] = binding;
|
|
134
150
|
return {
|
|
135
|
-
[`#nuxt-og-image/bindings/${key}`]: binding === false ? "unenv/runtime/mock/empty" : resolve(`./runtime/
|
|
151
|
+
[`#nuxt-og-image/bindings/${key}`]: binding === false ? "unenv/runtime/mock/empty" : resolve(`./runtime/nitro/og-image/bindings/${key}/${binding}`)
|
|
136
152
|
};
|
|
137
153
|
}
|
|
138
154
|
nitroConfig.alias = defu(
|
|
@@ -204,6 +220,12 @@ export {}
|
|
|
204
220
|
nuxt.hooks.hook("prepare:types", ({ references }) => {
|
|
205
221
|
references.push({ path: resolve(nuxt.options.buildDir, `module/${module}.d.ts`) });
|
|
206
222
|
});
|
|
223
|
+
nuxt.hooks.hook("nitro:config", (config) => {
|
|
224
|
+
config.typescript = config.typescript || {};
|
|
225
|
+
config.typescript.tsConfig = config.typescript.tsConfig || {};
|
|
226
|
+
config.typescript.tsConfig.include = config.typescript.tsConfig.include || [];
|
|
227
|
+
config.typescript.tsConfig.include.push(`./module/${module}.d.ts`);
|
|
228
|
+
});
|
|
207
229
|
}
|
|
208
230
|
function isNuxtGenerate(nuxt = useNuxt()) {
|
|
209
231
|
return nuxt.options._generate || nuxt.options.nitro.static || nuxt.options.nitro.preset === "static";
|
|
@@ -237,6 +259,7 @@ function setupDevToolsUI(options, resolve, nuxt = useNuxt()) {
|
|
|
237
259
|
onDevToolsInitialized(async () => {
|
|
238
260
|
const rpc = extendServerRpc("nuxt-og-image", {});
|
|
239
261
|
nuxt.hook("builder:watch", (e, path) => {
|
|
262
|
+
path = relative$1(nuxt.options.srcDir, resolve(nuxt.options.srcDir, path));
|
|
240
263
|
if ((e === "change" || e.includes("link")) && path.startsWith("pages")) {
|
|
241
264
|
rpc.broadcast.refreshRouteData(path).catch(() => {
|
|
242
265
|
});
|
|
@@ -298,15 +321,17 @@ function setupGenerateHandler(options, resolve, nuxt = useNuxt()) {
|
|
|
298
321
|
function setupPrerenderHandler(options, resolve, nuxt = useNuxt()) {
|
|
299
322
|
nuxt.hooks.hook("nitro:init", async (nitro) => {
|
|
300
323
|
nitro.hooks.hook("prerender:config", async (nitroConfig) => {
|
|
301
|
-
applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility
|
|
324
|
+
applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility?.prerender, resolve });
|
|
302
325
|
nitroConfig.wasm = nitroConfig.wasm || {};
|
|
303
326
|
nitroConfig.wasm.esmImport = false;
|
|
304
327
|
const prerenderingPages = (nuxt.options.nitro.prerender?.routes || []).some((r) => r && (!r.includes(".") || r.includes("*")));
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
328
|
+
if (prerenderingPages) {
|
|
329
|
+
assertSiteConfig("nuxt-og-image", {
|
|
330
|
+
url: "OG Image tags are required to be absolute URLs."
|
|
331
|
+
}, {
|
|
332
|
+
throwError: false
|
|
333
|
+
});
|
|
334
|
+
}
|
|
310
335
|
});
|
|
311
336
|
});
|
|
312
337
|
}
|
|
@@ -330,14 +355,20 @@ async function setupBuildHandler(config, resolve, nuxt = useNuxt()) {
|
|
|
330
355
|
return;
|
|
331
356
|
const configuredEntry = nitro.options.rollupConfig?.output.entryFileNames;
|
|
332
357
|
let serverEntry = resolve(_nitro.options.output.serverDir, typeof configuredEntry === "string" ? configuredEntry : "index.mjs");
|
|
333
|
-
|
|
334
|
-
|
|
358
|
+
const isCloudflarePagesOrModule = target === "cloudflare-pages" || target === "cloudflare-module";
|
|
359
|
+
if (isCloudflarePagesOrModule) {
|
|
360
|
+
serverEntry = [
|
|
361
|
+
resolve(dirname(serverEntry), "./chunks/wasm.mjs"),
|
|
362
|
+
resolve(dirname(serverEntry), "./chunks/_/wasm.mjs")
|
|
363
|
+
].filter(existsSync)[0] || serverEntry;
|
|
364
|
+
}
|
|
335
365
|
const contents = await readFile(serverEntry, "utf-8");
|
|
336
366
|
const resvgHash = sha1(await readFile(await resolvePath("@resvg/resvg-wasm/index_bg.wasm")));
|
|
337
367
|
const yogaHash = sha1(await readFile(await resolvePath("yoga-wasm-web/dist/yoga.wasm")));
|
|
368
|
+
const cssInlineHash = sha1(await readFile(await resolvePath("@css-inline/css-inline-wasm/index_bg.wasm")));
|
|
338
369
|
const postfix = target === "vercel-edge" ? "?module" : "";
|
|
339
|
-
const path =
|
|
340
|
-
await writeFile(serverEntry, contents.replaceAll('"@resvg/resvg-wasm/index_bg.wasm"', `"${path}index_bg-${resvgHash}.wasm${postfix}"`).replaceAll('"yoga-wasm-web/dist/yoga.wasm"', `"${path}yoga-${yogaHash}.wasm${postfix}"`), { encoding: "utf-8" });
|
|
370
|
+
const path = isCloudflarePagesOrModule ? `../wasm/` : `./wasm/`;
|
|
371
|
+
await writeFile(serverEntry, contents.replaceAll('"@resvg/resvg-wasm/index_bg.wasm?module"', `"${path}index_bg-${resvgHash}.wasm${postfix}"`).replaceAll('"@css-inline/css-inline-wasm/index_bg.wasm?module"', `"${path}index_bg-${cssInlineHash}.wasm${postfix}"`).replaceAll('"yoga-wasm-web/dist/yoga.wasm?module"', `"${path}yoga-${yogaHash}.wasm${postfix}"`), { encoding: "utf-8" });
|
|
341
372
|
});
|
|
342
373
|
});
|
|
343
374
|
}
|
|
@@ -345,20 +376,46 @@ function sha1(source) {
|
|
|
345
376
|
return createHash("sha1").update(source).digest("hex").slice(0, 16);
|
|
346
377
|
}
|
|
347
378
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
379
|
+
const isUndefinedOrTruthy = (v) => typeof v === "undefined" || v !== false;
|
|
380
|
+
function checkLocalChrome() {
|
|
381
|
+
if (isCI)
|
|
382
|
+
return false;
|
|
383
|
+
let hasChromeLocally = false;
|
|
384
|
+
try {
|
|
385
|
+
hasChromeLocally = !!Launcher.getFirstInstallation();
|
|
386
|
+
} catch {
|
|
387
|
+
}
|
|
388
|
+
return hasChromeLocally;
|
|
389
|
+
}
|
|
390
|
+
async function checkPlaywrightDependency() {
|
|
391
|
+
return !!await tryResolveModule("playwright");
|
|
392
|
+
}
|
|
393
|
+
async function downloadFont(font, storage, mirror) {
|
|
394
|
+
const { name, weight } = font;
|
|
395
|
+
const key = `${name}-${weight}.ttf.base64`;
|
|
396
|
+
if (await storage.hasItem(key))
|
|
397
|
+
return true;
|
|
398
|
+
const host = typeof mirror === "undefined" ? "fonts.googleapis.com" : mirror === true ? "fonts.font.im" : mirror;
|
|
399
|
+
const css = await $fetch(`https://${host}/css2?family=${name}:wght@${weight}`, {
|
|
400
|
+
timeout: 10 * 1e3,
|
|
401
|
+
// 10 second timeout
|
|
402
|
+
headers: {
|
|
403
|
+
// Make sure it returns TTF.
|
|
404
|
+
"User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1"
|
|
405
|
+
}
|
|
406
|
+
}).catch(() => {
|
|
407
|
+
return false;
|
|
360
408
|
});
|
|
361
|
-
|
|
409
|
+
if (!css)
|
|
410
|
+
return false;
|
|
411
|
+
const ttfResource = css.match(/src: url\((.+)\) format\('(opentype|truetype)'\)/);
|
|
412
|
+
if (ttfResource?.[1]) {
|
|
413
|
+
const buf = await $fetch(ttfResource[1], { baseURL: host, responseType: "arrayBuffer" });
|
|
414
|
+
const base64Font = Buffer.from(buf).toString("base64");
|
|
415
|
+
await storage.setItem(key, base64Font);
|
|
416
|
+
return true;
|
|
417
|
+
}
|
|
418
|
+
return false;
|
|
362
419
|
}
|
|
363
420
|
|
|
364
421
|
function normaliseFontInput(fonts) {
|
|
@@ -368,7 +425,7 @@ function normaliseFontInput(fonts) {
|
|
|
368
425
|
return {
|
|
369
426
|
cacheKey: f,
|
|
370
427
|
name,
|
|
371
|
-
weight: weight ||
|
|
428
|
+
weight: weight || 400,
|
|
372
429
|
style: "normal",
|
|
373
430
|
path: void 0
|
|
374
431
|
};
|
|
@@ -386,7 +443,7 @@ const module = defineNuxtModule({
|
|
|
386
443
|
meta: {
|
|
387
444
|
name: "nuxt-og-image",
|
|
388
445
|
compatibility: {
|
|
389
|
-
nuxt: "
|
|
446
|
+
nuxt: ">=3.10.3",
|
|
390
447
|
bridge: false
|
|
391
448
|
},
|
|
392
449
|
configKey: "ogImage"
|
|
@@ -398,6 +455,7 @@ const module = defineNuxtModule({
|
|
|
398
455
|
emojis: "noto",
|
|
399
456
|
renderer: "satori",
|
|
400
457
|
component: "NuxtSeo",
|
|
458
|
+
extension: "png",
|
|
401
459
|
width: 1200,
|
|
402
460
|
height: 600,
|
|
403
461
|
// default is to cache the image for 3 day (72 hours)
|
|
@@ -410,24 +468,30 @@ const module = defineNuxtModule({
|
|
|
410
468
|
};
|
|
411
469
|
},
|
|
412
470
|
async setup(config, nuxt) {
|
|
413
|
-
const
|
|
471
|
+
const { resolve } = createResolver(import.meta.url);
|
|
472
|
+
const { name, version } = await readPackageJSON(resolve("../package.json"));
|
|
473
|
+
const logger = useLogger(name);
|
|
414
474
|
logger.level = config.debug || nuxt.options.debug ? 4 : 3;
|
|
415
475
|
if (config.enabled === false) {
|
|
416
476
|
logger.debug("The module is disabled, skipping setup.");
|
|
477
|
+
["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((name2) => {
|
|
478
|
+
addImports({ name: name2, from: resolve(`./runtime/nuxt/composables/mock`) });
|
|
479
|
+
});
|
|
417
480
|
return;
|
|
418
481
|
}
|
|
419
482
|
if (config.enabled && !nuxt.options.ssr) {
|
|
420
483
|
logger.warn("Nuxt OG Image is enabled but SSR is disabled.\n\nYou should enable SSR (`ssr: true`) or disable the module (`ogImage: { enabled: false }`).");
|
|
421
484
|
return;
|
|
422
485
|
}
|
|
423
|
-
|
|
486
|
+
nuxt.options.build.transpile.push(resolve("./runtime"));
|
|
424
487
|
const preset = resolveNitroPreset(nuxt.options.nitro);
|
|
425
488
|
const targetCompatibility = getPresetNitroPresetCompatibility(preset);
|
|
426
|
-
|
|
489
|
+
let isUsingSharp = false;
|
|
427
490
|
const userConfiguredExtension = config.defaults.extension;
|
|
428
491
|
const hasConfiguredJpegs = userConfiguredExtension && ["jpeg", "jpg"].includes(userConfiguredExtension);
|
|
429
|
-
config.
|
|
430
|
-
|
|
492
|
+
if (!!config.sharpOptions || hasConfiguredJpegs && config.defaults.renderer !== "chromium") {
|
|
493
|
+
isUsingSharp = true;
|
|
494
|
+
const hasSharpDependency = !!await tryResolveModule("sharp");
|
|
431
495
|
if (hasSharpDependency && !targetCompatibility.sharp) {
|
|
432
496
|
logger.warn(`Rendering JPEGs requires sharp which does not work with ${preset}. Images will be rendered as PNG at runtime.`);
|
|
433
497
|
config.compatibility = defu(config.compatibility, {
|
|
@@ -438,39 +502,40 @@ const module = defineNuxtModule({
|
|
|
438
502
|
await ensureDependencies(["sharp"]);
|
|
439
503
|
logger.warn("Support for `sharp` is limited so check the compatibility guide.");
|
|
440
504
|
}
|
|
441
|
-
}
|
|
505
|
+
}
|
|
506
|
+
if (!isUsingSharp) {
|
|
442
507
|
config.compatibility = defu(config.compatibility, {
|
|
443
508
|
runtime: { sharp: false },
|
|
444
509
|
dev: { sharp: false },
|
|
445
510
|
prerender: { sharp: false }
|
|
446
511
|
});
|
|
447
512
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
prerender: { chromium: "node" }
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
} else if (!hasChromeLocally && nuxt.options.dev && config.compatibility?.dev?.chromium === "node") {
|
|
472
|
-
await ensureChromium(logger);
|
|
513
|
+
const hasChromeLocally = checkLocalChrome();
|
|
514
|
+
const hasPlaywrightDependency = await checkPlaywrightDependency();
|
|
515
|
+
const chromeCompatibilityFlags = {
|
|
516
|
+
prerender: config.compatibility?.prerender?.chromium,
|
|
517
|
+
dev: config.compatibility?.dev?.chromium,
|
|
518
|
+
runtime: config.compatibility?.runtime?.chromium
|
|
519
|
+
};
|
|
520
|
+
const chromiumBinding = {
|
|
521
|
+
dev: null,
|
|
522
|
+
prerender: null,
|
|
523
|
+
runtime: null
|
|
524
|
+
};
|
|
525
|
+
if (nuxt.options.dev) {
|
|
526
|
+
if (isUndefinedOrTruthy(chromeCompatibilityFlags.dev))
|
|
527
|
+
chromiumBinding.dev = hasChromeLocally ? "chrome-launcher" : hasPlaywrightDependency ? "playwright" : "on-demand";
|
|
528
|
+
} else {
|
|
529
|
+
if (isUndefinedOrTruthy(chromeCompatibilityFlags.prerender))
|
|
530
|
+
chromiumBinding.prerender = hasChromeLocally ? "chrome-launcher" : hasPlaywrightDependency ? "playwright" : "on-demand";
|
|
531
|
+
if (isUndefinedOrTruthy(chromeCompatibilityFlags.runtime))
|
|
532
|
+
chromiumBinding.runtime = hasPlaywrightDependency ? "playwright" : null;
|
|
473
533
|
}
|
|
534
|
+
config.compatibility = defu(config.compatibility, {
|
|
535
|
+
runtime: { chromium: chromiumBinding.runtime },
|
|
536
|
+
dev: { chromium: chromiumBinding.dev },
|
|
537
|
+
prerender: { chromium: chromiumBinding.prerender }
|
|
538
|
+
});
|
|
474
539
|
await import('@resvg/resvg-js').catch(() => {
|
|
475
540
|
logger.warn("ReSVG is missing dependencies for environment. Falling back to WASM version, this may slow down PNG rendering.");
|
|
476
541
|
config.compatibility = defu(config.compatibility, {
|
|
@@ -486,67 +551,84 @@ const module = defineNuxtModule({
|
|
|
486
551
|
await installNuxtSiteConfig();
|
|
487
552
|
if (hasNuxtModule("@nuxt/content"))
|
|
488
553
|
addServerPlugin(resolve("./runtime/nitro/plugins/nuxt-content"));
|
|
489
|
-
if (!config.fonts.length)
|
|
490
|
-
config.fonts = [
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
554
|
+
if (!config.fonts.length) {
|
|
555
|
+
config.fonts = [
|
|
556
|
+
{ name: "Inter", weight: 400, path: resolve("./runtime/assets/Inter-400.ttf.base64"), absolutePath: true },
|
|
557
|
+
{ name: "Inter", weight: 700, path: resolve("./runtime/assets/Inter-700.ttf.base64"), absolutePath: true }
|
|
558
|
+
];
|
|
559
|
+
}
|
|
560
|
+
let publicDirAbs = nuxt.options.dir.public;
|
|
561
|
+
if (!isAbsolute(publicDirAbs)) {
|
|
562
|
+
publicDirAbs = publicDirAbs in nuxt.options.alias ? nuxt.options.alias[publicDirAbs] : resolve(nuxt.options.rootDir, publicDirAbs);
|
|
563
|
+
}
|
|
564
|
+
const serverFontsDir = resolve(nuxt.options.buildDir, "cache", `nuxt-og-image@${version}`, "_fonts");
|
|
565
|
+
const fontStorage = createStorage({
|
|
566
|
+
driver: fsDriver({
|
|
567
|
+
base: serverFontsDir
|
|
568
|
+
})
|
|
569
|
+
});
|
|
570
|
+
config.fonts = (await Promise.all(normaliseFontInput(config.fonts).map(async (f) => {
|
|
571
|
+
if (!f.key && !f.path) {
|
|
572
|
+
if (preset === "stackblitz") {
|
|
573
|
+
logger.warn(`The ${f.name}:${f.weight} font was skipped because remote fonts are not available in StackBlitz, please use a local font.`);
|
|
495
574
|
return false;
|
|
496
575
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
if (typeof f === "string" && f.startsWith("Inter:")) {
|
|
503
|
-
const [_, weight] = f.split(":");
|
|
504
|
-
return {
|
|
505
|
-
name: "Inter",
|
|
506
|
-
weight,
|
|
507
|
-
// nuxt server assets
|
|
508
|
-
key: `nuxt-og-image:fonts:inter-latin-ext-${weight}-normal.woff`
|
|
509
|
-
};
|
|
576
|
+
if (await downloadFont(f, fontStorage, config.googleFontMirror)) {
|
|
577
|
+
f.key = `nuxt-og-image:fonts:${f.name}-${f.weight}.ttf.base64`;
|
|
578
|
+
} else {
|
|
579
|
+
logger.warn(`Failed to download font ${f.name}:${f.weight}. You may be offline or behind a firewall blocking Google. Consider setting \`googleFontMirror: true\`.`);
|
|
580
|
+
return false;
|
|
510
581
|
}
|
|
511
|
-
|
|
512
|
-
|
|
582
|
+
} else if (f.path) {
|
|
583
|
+
const extension = basename(f.path.replace(".base64", "")).split(".").pop();
|
|
584
|
+
if (!["woff", "ttf", "otf"].includes(extension)) {
|
|
585
|
+
logger.warn(`The ${f.name}:${f.weight} font was skipped because the file extension ${extension} is not supported. Only woff, ttf and otf are supported.`);
|
|
513
586
|
return false;
|
|
514
587
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
588
|
+
if (!f.absolutePath)
|
|
589
|
+
f.path = resolve(publicDirAbs, withoutLeadingSlash(f.path));
|
|
590
|
+
if (!existsSync(f.path)) {
|
|
591
|
+
logger.warn(`The ${f.name}:${f.weight} font was skipped because the file does not exist at path ${f.path}.`);
|
|
592
|
+
return false;
|
|
593
|
+
}
|
|
594
|
+
const fontData = await readFile(f.path, f.path.endsWith(".base64") ? "utf-8" : "base64");
|
|
595
|
+
f.key = `nuxt-og-image:fonts:${f.name}-${f.weight}.${extension}.base64`;
|
|
596
|
+
await fontStorage.setItem(`${f.name}-${f.weight}.${extension}.base64`, fontData);
|
|
597
|
+
delete f.path;
|
|
598
|
+
delete f.absolutePath;
|
|
599
|
+
}
|
|
600
|
+
return f;
|
|
601
|
+
}))).filter(Boolean);
|
|
602
|
+
nuxt.options.nitro.serverAssets = nuxt.options.nitro.serverAssets || [];
|
|
603
|
+
nuxt.options.nitro.serverAssets.push({ baseName: "nuxt-og-image:fonts", dir: serverFontsDir });
|
|
522
604
|
nuxt.options.experimental.componentIslands = true;
|
|
523
605
|
addServerHandler({
|
|
524
606
|
lazy: true,
|
|
525
607
|
route: "/__og-image__/font/**",
|
|
526
|
-
handler: resolve("./runtime/
|
|
608
|
+
handler: resolve("./runtime/nitro/routes/font")
|
|
527
609
|
});
|
|
528
610
|
if (config.debug || nuxt.options.dev) {
|
|
529
611
|
addServerHandler({
|
|
530
612
|
lazy: true,
|
|
531
613
|
route: "/__og-image__/debug.json",
|
|
532
|
-
handler: resolve("./runtime/
|
|
614
|
+
handler: resolve("./runtime/nitro/routes/debug.json")
|
|
533
615
|
});
|
|
534
616
|
}
|
|
535
617
|
addServerHandler({
|
|
536
618
|
lazy: true,
|
|
537
619
|
route: "/__og-image__/image/**",
|
|
538
|
-
handler: resolve("./runtime/
|
|
620
|
+
handler: resolve("./runtime/nitro/routes/image")
|
|
539
621
|
});
|
|
540
622
|
nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"] = [];
|
|
541
|
-
["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((
|
|
623
|
+
["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((name2) => {
|
|
542
624
|
addImports({
|
|
543
|
-
name,
|
|
544
|
-
from: resolve(`./runtime/composables/${
|
|
625
|
+
name: name2,
|
|
626
|
+
from: resolve(`./runtime/nuxt/composables/${name2}`)
|
|
545
627
|
});
|
|
546
|
-
nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"].push(
|
|
628
|
+
nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"].push(name2);
|
|
547
629
|
});
|
|
548
630
|
await addComponentsDir({
|
|
549
|
-
path: resolve("./runtime/components/Templates/Community"),
|
|
631
|
+
path: resolve("./runtime/nuxt/components/Templates/Community"),
|
|
550
632
|
island: true,
|
|
551
633
|
watch: true
|
|
552
634
|
});
|
|
@@ -554,10 +636,10 @@ const module = defineNuxtModule({
|
|
|
554
636
|
// new
|
|
555
637
|
"OgImage",
|
|
556
638
|
"OgImageScreenshot"
|
|
557
|
-
].forEach((
|
|
639
|
+
].forEach((name2) => {
|
|
558
640
|
addComponent({
|
|
559
|
-
name,
|
|
560
|
-
filePath: resolve(`./runtime/components/OgImage/${
|
|
641
|
+
name: name2,
|
|
642
|
+
filePath: resolve(`./runtime/nuxt/components/OgImage/${name2}`),
|
|
561
643
|
...config.componentOptions
|
|
562
644
|
});
|
|
563
645
|
});
|
|
@@ -569,16 +651,17 @@ const module = defineNuxtModule({
|
|
|
569
651
|
components.forEach((component) => {
|
|
570
652
|
let valid = false;
|
|
571
653
|
config.componentDirs.forEach((dir) => {
|
|
572
|
-
if (component.pascalName.startsWith(dir) || component.kebabName.startsWith(dir) || component.shortPath.includes(`/${dir}/`))
|
|
654
|
+
if (component.pascalName.startsWith(dir) || component.kebabName.startsWith(dir) || component.shortPath.includes(`/${dir}/`)) {
|
|
573
655
|
valid = true;
|
|
656
|
+
}
|
|
574
657
|
});
|
|
575
|
-
if (component.filePath.includes(resolve("./runtime/components/Templates")))
|
|
658
|
+
if (component.filePath.includes(resolve("./runtime/nuxt/components/Templates")))
|
|
576
659
|
valid = true;
|
|
577
660
|
if (valid && fs.existsSync(component.filePath)) {
|
|
578
661
|
component.island = true;
|
|
579
662
|
component.mode = "server";
|
|
580
663
|
let category = "app";
|
|
581
|
-
if (component.filePath.includes(resolve("./runtime/components/Templates/Community")))
|
|
664
|
+
if (component.filePath.includes(resolve("./runtime/nuxt/components/Templates/Community")))
|
|
582
665
|
category = "community";
|
|
583
666
|
const componentFile = fs.readFileSync(component.filePath, "utf-8");
|
|
584
667
|
const credits = componentFile.split("\n").find((line) => line.startsWith(" * @credits"))?.replace("* @credits", "").trim();
|
|
@@ -606,9 +689,9 @@ const module = defineNuxtModule({
|
|
|
606
689
|
nuxt.options.nitro.virtual["#nuxt-og-image/component-names.mjs"] = () => {
|
|
607
690
|
return `export const componentNames = ${JSON.stringify(ogImageComponentCtx.components)}`;
|
|
608
691
|
};
|
|
609
|
-
let unoCssConfig = {
|
|
692
|
+
let unoCssConfig = {};
|
|
610
693
|
nuxt.hook("tailwindcss:config", (tailwindConfig) => {
|
|
611
|
-
unoCssConfig = defu(tailwindConfig.theme
|
|
694
|
+
unoCssConfig = defu(tailwindConfig.theme?.extend, { ...tailwindConfig.theme, extend: void 0 });
|
|
612
695
|
});
|
|
613
696
|
nuxt.hook("unocss:config", (_unoCssConfig) => {
|
|
614
697
|
unoCssConfig = { ..._unoCssConfig.theme };
|
|
@@ -619,7 +702,10 @@ const module = defineNuxtModule({
|
|
|
619
702
|
extendTypes("nuxt-og-image", ({ typesPath }) => {
|
|
620
703
|
const componentImports = ogImageComponentCtx.components.map((component) => {
|
|
621
704
|
const relativeComponentPath = relative(resolve(nuxt.options.rootDir, nuxt.options.buildDir, "module"), component.path);
|
|
622
|
-
|
|
705
|
+
const name2 = config.componentDirs.sort((a, b) => b.length - a.length).reduce((name3, dir) => {
|
|
706
|
+
return name3.replace(new RegExp(`^${dir}`), "");
|
|
707
|
+
}, component.pascalName);
|
|
708
|
+
return ` '${name2}': typeof import('${relativeComponentPath}')['default']`;
|
|
623
709
|
}).join("\n");
|
|
624
710
|
return `
|
|
625
711
|
declare module 'nitropack' {
|
|
@@ -640,11 +726,14 @@ declare module '#nuxt-og-image/components' {
|
|
|
640
726
|
${componentImports}
|
|
641
727
|
}
|
|
642
728
|
}
|
|
729
|
+
declare module '#nuxt-og-image/unocss-config' {
|
|
730
|
+
export type theme = any
|
|
731
|
+
}
|
|
643
732
|
`;
|
|
644
733
|
});
|
|
645
734
|
const cacheEnabled = typeof config.runtimeCacheStorage !== "undefined" && config.runtimeCacheStorage !== false;
|
|
646
735
|
const runtimeCacheStorage = typeof config.runtimeCacheStorage === "boolean" ? "default" : config.runtimeCacheStorage.driver;
|
|
647
|
-
let baseCacheKey = runtimeCacheStorage === "default" ? `/cache/nuxt-og-image
|
|
736
|
+
let baseCacheKey = runtimeCacheStorage === "default" ? `/cache/nuxt-og-image/${version}` : `/nuxt-og-image/${version}`;
|
|
648
737
|
if (!cacheEnabled)
|
|
649
738
|
baseCacheKey = false;
|
|
650
739
|
if (!nuxt.options.dev && config.runtimeCacheStorage && typeof config.runtimeCacheStorage === "object") {
|
|
@@ -657,9 +746,6 @@ ${componentImports}
|
|
|
657
746
|
nuxt.options.nitro = nuxt.options.nitro || {};
|
|
658
747
|
nuxt.options.nitro.prerender = nuxt.options.nitro.prerender || {};
|
|
659
748
|
nuxt.options.nitro.prerender.routes = nuxt.options.nitro.prerender.routes || [];
|
|
660
|
-
normalisedFonts.filter((f) => !f.path && !f.key).forEach(({ name, weight }) => {
|
|
661
|
-
nuxt.options.nitro.prerender.routes.push(`/__og-image__/font/${name}/${weight}.ttf`);
|
|
662
|
-
});
|
|
663
749
|
}
|
|
664
750
|
const hasColorModeModule = hasNuxtModule("@nuxtjs/color-mode");
|
|
665
751
|
const colorModeOptions = hasColorModeModule ? await getNuxtModuleOptions("@nuxtjs/color-mode") : {};
|
|
@@ -673,15 +759,18 @@ ${componentImports}
|
|
|
673
759
|
// binding options
|
|
674
760
|
satoriOptions: config.satoriOptions || {},
|
|
675
761
|
resvgOptions: config.resvgOptions || {},
|
|
676
|
-
sharpOptions: config.sharpOptions || {},
|
|
762
|
+
sharpOptions: config.sharpOptions === true ? {} : config.sharpOptions || {},
|
|
763
|
+
publicStoragePath: `root${publicDirAbs.replace(nuxt.options.rootDir, "").replaceAll("/", ":")}`,
|
|
677
764
|
defaults: config.defaults,
|
|
678
765
|
debug: config.debug,
|
|
679
766
|
// avoid adding credentials
|
|
680
767
|
baseCacheKey,
|
|
681
768
|
// convert the fonts to uniform type to fix ts issue
|
|
682
769
|
fonts: normalisedFonts,
|
|
683
|
-
hasNuxtIcon: hasNuxtModule("nuxt-icon"),
|
|
684
|
-
colorPreference
|
|
770
|
+
hasNuxtIcon: hasNuxtModule("nuxt-icon") || hasNuxtModule("@nuxt/icon"),
|
|
771
|
+
colorPreference,
|
|
772
|
+
// @ts-expect-error runtime type
|
|
773
|
+
isNuxtContentDocumentDriven: !!nuxt.options.content?.documentDriven
|
|
685
774
|
};
|
|
686
775
|
nuxt.hooks.callHook("nuxt-og-image:runtime-config", runtimeConfig);
|
|
687
776
|
nuxt.options.runtimeConfig["nuxt-og-image"] = runtimeConfig;
|