nuxt-og-image 3.0.0-rc.66 → 3.0.0-rc.68
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 +3 -6
- package/dist/client/200.html +179 -179
- package/dist/client/404.html +179 -179
- package/dist/client/_nuxt/{BfBkfEDj.js → 0OCEc-sb.js} +1 -1
- package/dist/client/_nuxt/16nqZaIT.js +1 -0
- package/dist/client/_nuxt/3Ts0ZrM4.js +4 -0
- package/dist/client/_nuxt/44JOqR_V.js +1 -0
- package/dist/client/_nuxt/4FkZXfg1.js +3 -0
- package/dist/client/_nuxt/{DoY4Dbtn.js → 4WleZr1P.js} +1 -1
- package/dist/client/_nuxt/5HixFuyr.js +1 -0
- package/dist/client/_nuxt/{C31OBGbl.js → 5bRVBCrv.js} +1 -1
- package/dist/client/_nuxt/{DanM9F4-.js → 7LPQ6a13.js} +2 -2
- package/dist/client/_nuxt/8WiSp-0_.js +1 -0
- package/dist/client/_nuxt/9CfBjzQa.js +1 -0
- package/dist/client/_nuxt/B-9EjyZr.js +1 -0
- package/dist/client/_nuxt/B-a2BbyY.js +1 -0
- package/dist/client/_nuxt/B0LoMq2b.js +1 -0
- package/dist/client/_nuxt/{BSSAUge4.js → B1ejXUAS.js} +1 -1
- package/dist/client/_nuxt/{DhldU3XI.js → B3LRAdDP.js} +1 -1
- package/dist/client/_nuxt/B7-FEXAT.js +1 -0
- package/dist/client/_nuxt/B9HI_aQy.js +1 -0
- package/dist/client/_nuxt/{D85lwgPO.js → B9vFkdfw.js} +1 -1
- package/dist/client/_nuxt/BAGvEKUB.js +1 -0
- package/dist/client/_nuxt/BAp2aEeE.js +1 -0
- package/dist/client/_nuxt/{C3NvtN4M.js → BB9S_66N.js} +1 -1
- package/dist/client/_nuxt/{AoxqhCl0.js → BCOu96sC.js} +1 -1
- package/dist/client/_nuxt/BGk6HrHT.js +1 -0
- package/dist/client/_nuxt/BHSTd-7M.js +1 -0
- package/dist/client/_nuxt/BKFBoKT4.js +1 -0
- package/dist/client/_nuxt/BKNiEhql.js +1 -0
- package/dist/client/_nuxt/BNgG76gt.js +1 -0
- package/dist/client/_nuxt/{BbPU79SD.js → BNofkYSZ.js} +14 -14
- package/dist/client/_nuxt/BOp3HRET.js +1 -0
- package/dist/client/_nuxt/{DaDGU6kf.js → BQnHL-cn.js} +1 -1
- package/dist/client/_nuxt/BS9sT-GQ.js +1 -0
- package/dist/client/_nuxt/BU83OF-G.js +1 -0
- package/dist/client/_nuxt/BUeIC4cT.js +1 -0
- package/dist/client/_nuxt/BXUVD3TH.js +1 -0
- package/dist/client/_nuxt/BXWtGw2n.js +6 -0
- package/dist/client/_nuxt/{VVtMly4c.js → BYLuaE_S.js} +1 -1
- package/dist/client/_nuxt/{C46DigdT.js → Ba_2pva2.js} +1 -1
- package/dist/client/_nuxt/BeX7BQ1y.js +1 -0
- package/dist/client/_nuxt/{ChVe37jp.js → BfVRrWqI.js} +1 -1
- package/dist/client/_nuxt/BgEvnnZj.js +1 -0
- package/dist/client/_nuxt/{BEPTDMGr.js → Bgrlo6mM.js} +1 -1
- package/dist/client/_nuxt/{CBoehFVA.js → Bl6w8nq6.js} +2 -2
- package/dist/client/_nuxt/BmUjtHPt.js +1 -0
- package/dist/client/_nuxt/BnYPtiAB.js +1 -0
- package/dist/client/_nuxt/{B9S9BZZh.js → BotTw_1M.js} +1 -1
- package/dist/client/_nuxt/BpqPLH6b.js +1 -0
- package/dist/client/_nuxt/{DT2db06B.js → Br4herk8.js} +1 -1
- package/dist/client/_nuxt/Brmco9EZ.js +2 -0
- package/dist/client/_nuxt/{BiU8-mv6.js → Bs9WCFOo.js} +1 -1
- package/dist/client/_nuxt/BtPWTO6-.js +1 -0
- package/dist/client/_nuxt/BwUg_Rem.js +1 -0
- package/dist/client/_nuxt/Bxuka25Y.js +1 -0
- package/dist/client/_nuxt/{Bcn1f5Rp.js → BxwkrKyP.js} +1 -1
- package/dist/client/_nuxt/{D9s3Eyz8.js → ByN1NmdT.js} +2 -2
- package/dist/client/_nuxt/C2Z2wNnw.js +1 -0
- package/dist/client/_nuxt/{DGTPbQyx.js → C3wf4cjV.js} +1 -1
- package/dist/client/_nuxt/{16u1w-DC.js → C5J_9lw5.js} +1 -1
- package/dist/client/_nuxt/C6doOGgB.js +1 -0
- package/dist/client/_nuxt/{BY8_eel9.js → C7xspq5a.js} +1 -1
- package/dist/client/_nuxt/C9CNr0dZ.js +1 -0
- package/dist/client/_nuxt/CA2blNRc.js +1 -0
- package/dist/client/_nuxt/{DFQMbhFG.js → CCW61mLD.js} +1 -1
- package/dist/client/_nuxt/{DOt8O2FJ.js → CDP-pALJ.js} +1 -1
- package/dist/client/_nuxt/{LrshOcZ2.js → CFy8Z7mU.js} +1 -1
- package/dist/client/_nuxt/CHDuk4cg.js +1 -0
- package/dist/client/_nuxt/{B5v32tNS.js → CKK8qrH7.js} +2 -2
- package/dist/client/_nuxt/CKqhLkpw.js +1 -0
- package/dist/client/_nuxt/{MJ0gDQnJ.js → CLTURUqp.js} +3 -3
- package/dist/client/_nuxt/CPQn-Lhb.js +1 -0
- package/dist/client/_nuxt/CRUEGcu5.js +1 -0
- package/dist/client/_nuxt/{CT9A9Qiu.js → CS6sTstm.js} +1 -1
- package/dist/client/_nuxt/{DWE3vCE5.js → CSPPpfsQ.js} +1 -1
- package/dist/client/_nuxt/CTeQKLZv.js +1 -0
- package/dist/client/_nuxt/CTsPJjdJ.js +1 -0
- package/dist/client/_nuxt/{A4Fa72hX.js → CUNQUWO_.js} +1 -1
- package/dist/client/_nuxt/CV5B5C80.js +1 -0
- package/dist/client/_nuxt/CZkFsSlX.js +1 -0
- package/dist/client/_nuxt/{8R90CSQj.js → C_h5G2He.js} +1 -1
- package/dist/client/_nuxt/{B5--Xptx.js → CaR_I2C-.js} +1 -1
- package/dist/client/_nuxt/Cb48SAmt.js +1 -0
- package/dist/client/_nuxt/{nc-bU77P.js → CeIpHJfZ.js} +3 -3
- package/dist/client/_nuxt/{coyhVBVA.js → ClPxYbPx.js} +1 -1
- package/dist/client/_nuxt/Clj_IpB8.js +1 -0
- package/dist/client/_nuxt/CmN1UzhW.js +1 -0
- package/dist/client/_nuxt/CvHWZNAB.js +1 -0
- package/dist/client/_nuxt/CyUS7F7b.js +17 -0
- package/dist/client/_nuxt/{D4LJwL2b.js → Cz-n9WvF.js} +1 -1
- package/dist/client/_nuxt/{CDzo4tzE.js → Cz3ygVR-.js} +1 -1
- package/dist/client/_nuxt/{CEuqc8ZQ.js → CzK8D06Z.js} +1 -1
- package/dist/client/_nuxt/{CXYaz1c9.js → D0N_qbs7.js} +1 -1
- package/dist/client/_nuxt/D0pnavP-.js +1 -0
- package/dist/client/_nuxt/D25Gr2Wc.js +1 -0
- package/dist/client/_nuxt/D4miJ1xw.js +1 -0
- package/dist/client/_nuxt/D6oCKXcX.js +1 -0
- package/dist/client/_nuxt/DBLgxP_1.js +2 -0
- package/dist/client/_nuxt/{ByMv4Xf1.js → DCmDdbvy.js} +1 -1
- package/dist/client/_nuxt/{zt9m_cFA.js → DDG_rSGg.js} +1 -1
- package/dist/client/_nuxt/DFHN_7lU.js +3 -0
- package/dist/client/_nuxt/DFsxFixh.js +1 -0
- package/dist/client/_nuxt/DGhhRy1e.js +1 -0
- package/dist/client/_nuxt/{DdacRhvC.js → DIw1DfnK.js} +1 -1
- package/dist/client/_nuxt/DJNHLfzP.js +1 -0
- package/dist/client/_nuxt/{XP2_9bVu.js → DJOPMAPO.js} +1 -1
- package/dist/client/_nuxt/DO04iIl4.js +1 -0
- package/dist/client/_nuxt/DOOuMSMh.js +1 -0
- package/dist/client/_nuxt/DRuVOcqL.js +1 -0
- package/dist/client/_nuxt/{B2Zkg-Ae.js → DSv7Jr7N.js} +2 -2
- package/dist/client/_nuxt/DTMFIK7w.js +1 -0
- package/dist/client/_nuxt/{6XBPEST2.js → DXdsTRaC.js} +1 -1
- package/dist/client/_nuxt/{DgraCSOE.js → DXtfa3TF.js} +1 -1
- package/dist/client/_nuxt/{iYrPSY0y.js → DYgwfmdY.js} +1 -1
- package/dist/client/_nuxt/DYikCEmq.js +1 -0
- package/dist/client/_nuxt/{D6SwP_ef.js → DYrknm32.js} +1 -1
- package/dist/client/_nuxt/D_lsq3cR.js +1 -0
- package/dist/client/_nuxt/{4JG6XROL.js → Dc3u8CCo.js} +1 -1
- package/dist/client/_nuxt/Df4vQnuo.js +1 -0
- package/dist/client/_nuxt/Di1G_BEd.js +1 -0
- package/dist/client/_nuxt/Dk2kDqHs.js +1 -0
- package/dist/client/_nuxt/DkIL16gc.js +2 -0
- package/dist/client/_nuxt/DmixpzPA.js +1 -0
- package/dist/client/_nuxt/{CkoJTUbt.js → Dnd6U92I.js} +1 -1
- package/dist/client/_nuxt/DofIr7ih.js +1 -0
- package/dist/client/_nuxt/DqFtmHIk.js +1 -0
- package/dist/client/_nuxt/{DLpTrZod.js → DrUHIbQf.js} +1 -1
- package/dist/client/_nuxt/{CJ21IjBY.js → DrhOmAGa.js} +1 -1
- package/dist/client/_nuxt/{DmAvib0Y.js → DsO5WfEU.js} +1 -1
- package/dist/client/_nuxt/{CIlkkgNU.js → DsclqnHy.js} +1 -1
- package/dist/client/_nuxt/Dwk9V841.js +1 -0
- package/dist/client/_nuxt/DyLIn2qo.js +1 -0
- package/dist/client/_nuxt/{C9d3aiqh.js → DzhYcJWo.js} +1 -1
- package/dist/client/_nuxt/{DxX6t7GH.js → Dziqk49f.js} +1 -1
- package/dist/client/_nuxt/{DqvgqZmm.js → E5r7Moxb.js} +1 -1
- package/dist/client/_nuxt/{B_SUYfiV.js → FMRyFT8D.js} +1 -1
- package/dist/client/_nuxt/{TDVTyJvX.js → GACPk8cj.js} +1 -1
- package/dist/client/_nuxt/H94RPpLS.js +1 -0
- package/dist/client/_nuxt/{DBxHOdLe.js → HxmVvryO.js} +1 -1
- package/dist/client/_nuxt/JYC31MTV.js +1 -0
- package/dist/client/_nuxt/Jl0QvYgb.js +1 -0
- package/dist/client/_nuxt/{C17JnZbq.js → KA8c-whL.js} +1 -1
- package/dist/client/_nuxt/Ka_J5llu.js +1 -0
- package/dist/client/_nuxt/KuNYkU7X.js +1 -0
- package/dist/client/_nuxt/MkuNFWFs.js +204 -0
- package/dist/client/_nuxt/{BaedD2tq.js → N3zwmhmW.js} +1 -1
- package/dist/client/_nuxt/O4cDyHwR.js +1 -0
- package/dist/client/_nuxt/OPd3ySAa.js +1 -0
- package/dist/client/_nuxt/{BqpV9M7Y.js → Opso89zU.js} +1 -1
- package/dist/client/_nuxt/{CV8JdvfZ.js → PauOf_jS.js} +1 -1
- package/dist/client/_nuxt/Qj0mFepl.js +14 -0
- package/dist/client/_nuxt/R9SNgiQ9.js +1 -0
- package/dist/client/_nuxt/{C6XIsc4F.js → Rc0-bMtX.js} +1 -1
- package/dist/client/_nuxt/{CKpfY2P2.js → TYaudu4O.js} +1 -1
- package/dist/client/_nuxt/VRCUJX8G.js +1 -0
- package/dist/client/_nuxt/{CMiaevpY.js → Ys9ZunwU.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/353519f1-2e76-4016-9b50-2f26f3cb8794.json +1 -0
- package/dist/client/_nuxt/{CD1ynQRS.js → eJKZXzCK.js} +1 -1
- package/dist/client/_nuxt/{PSVKygaU.js → eQYbbmqd.js} +1 -1
- package/dist/client/_nuxt/{entry.cOhDjBNG.css → entry.DtsycVcr.css} +1 -1
- package/dist/client/_nuxt/error-404.CUF_CFKB.css +1 -0
- package/dist/client/_nuxt/error-500.BR60owpQ.css +1 -0
- package/dist/client/_nuxt/i0hkWYmE.js +1 -0
- package/dist/client/_nuxt/{ByGMIDPY.js → ithPx4uF.js} +1 -1
- package/dist/client/_nuxt/{I-_ljZ1M.js → jDrCW69G.js} +1 -1
- package/dist/client/_nuxt/kveMaAK5.js +1 -0
- package/dist/client/_nuxt/lBoe4CZw.js +1 -0
- package/dist/client/_nuxt/{DoQu802G.js → lPxKsdjn.js} +1 -1
- package/dist/client/_nuxt/lRZxrFTT.js +1 -0
- package/dist/client/_nuxt/mvTh5Gok.js +1 -0
- package/dist/client/_nuxt/pCnzZaOt.js +1 -0
- package/dist/client/_nuxt/qpF8edk8.js +1 -0
- package/dist/client/_nuxt/qvnQm5y7.js +1 -0
- package/dist/client/_nuxt/qwoaayiL.js +1 -0
- package/dist/client/_nuxt/t1S7pxBA.js +1 -0
- package/dist/client/_nuxt/t6MJYFCU.js +5 -0
- package/dist/client/_nuxt/tEd5xQ4M.js +1 -0
- package/dist/client/_nuxt/{DZwJH60W.js → xGgVA17b.js} +1 -1
- package/dist/client/_nuxt/yvfKceIB.js +1 -0
- package/dist/client/_nuxt/{E1IWMS2c.js → z5DqfkHR.js} +1 -1
- package/dist/client/index.html +179 -179
- package/dist/module.d.mts +5 -1
- package/dist/module.d.ts +5 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +246 -131
- package/dist/runtime/nitro/og-image/bindings/chromium/chrome-launcher.js +1 -1
- package/dist/runtime/nitro/og-image/bindings/chromium/on-demand.js +1 -1
- package/dist/runtime/nitro/og-image/bindings/satori/wasm.js +1 -1
- package/dist/runtime/nitro/og-image/{cache.d.ts → cache/lru.d.ts} +3 -1
- package/dist/runtime/nitro/og-image/{cache.js → cache/lru.js} +6 -0
- package/dist/runtime/nitro/og-image/cache/mock.d.ts +9 -0
- package/dist/runtime/nitro/og-image/cache/mock.js +9 -0
- package/dist/runtime/nitro/og-image/chromium/renderer.js +1 -1
- package/dist/runtime/nitro/og-image/chromium/screenshot.js +1 -1
- package/dist/runtime/nitro/og-image/context.js +8 -8
- package/dist/runtime/nitro/og-image/satori/font.d.ts +1 -0
- package/dist/runtime/nitro/og-image/satori/font.js +2 -2
- package/dist/runtime/nitro/og-image/satori/instances.d.ts +1 -1
- package/dist/runtime/nitro/og-image/satori/plugins/encoding.js +1 -1
- package/dist/runtime/nitro/og-image/satori/plugins/flex.js +27 -2
- package/dist/runtime/nitro/og-image/satori/plugins/imageSrc.js +3 -3
- package/dist/runtime/nitro/og-image/satori/plugins/unocss.js +1 -1
- package/dist/runtime/nitro/og-image/satori/renderer.js +3 -7
- package/dist/runtime/nitro/og-image/satori/transforms/emojis.d.ts +0 -2
- package/dist/runtime/nitro/og-image/satori/transforms/emojis.js +1 -5
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.js +1 -1
- package/dist/runtime/nitro/og-image/satori/vnodes.js +8 -8
- package/dist/runtime/nitro/og-image/templates/html.js +16 -21
- package/dist/runtime/nitro/plugins/__zero-runtime/nuxt-content.d.ts +2 -0
- package/dist/runtime/nitro/plugins/__zero-runtime/nuxt-content.js +9 -0
- package/dist/runtime/nitro/plugins/nuxt-content.js +2 -52
- package/dist/runtime/nitro/plugins/prerender.js +9 -4
- package/dist/runtime/nitro/routes/__zero-runtime/font.d.ts +2 -0
- package/dist/runtime/nitro/routes/__zero-runtime/font.js +8 -0
- package/dist/runtime/nitro/routes/__zero-runtime/image.d.ts +2 -0
- package/dist/runtime/nitro/routes/__zero-runtime/image.js +8 -0
- package/dist/runtime/nitro/routes/debug.json.js +2 -2
- package/dist/runtime/nitro/routes/font.js +3 -49
- package/dist/runtime/nitro/routes/image.js +3 -87
- package/dist/runtime/nitro/util/cache.js +3 -3
- package/dist/runtime/nitro/util/eventHandlers.d.ts +3 -0
- package/dist/runtime/nitro/util/eventHandlers.js +155 -0
- package/dist/runtime/nitro/util/kit.d.ts +1 -1
- package/dist/runtime/nitro/util/kit.js +3 -3
- package/dist/runtime/nitro/util/plugins.d.ts +2 -0
- package/dist/runtime/nitro/util/plugins.js +54 -0
- package/dist/runtime/nuxt/components/OgImage/OgImage.d.ts +1 -3
- package/dist/runtime/nuxt/components/OgImage/OgImage.js +1 -1
- package/dist/runtime/nuxt/components/OgImage/OgImageScreenshot.d.ts +1 -3
- package/dist/runtime/nuxt/components/OgImage/OgImageScreenshot.js +1 -1
- package/dist/runtime/nuxt/components/Templates/Community/NuxtSeo.vue +2 -2
- package/dist/runtime/nuxt/components/Templates/Community/SimpleBlog.vue +1 -1
- package/dist/runtime/nuxt/composables/defineOgImage.js +7 -5
- package/dist/runtime/nuxt/composables/defineOgImageComponent.d.ts +1 -1
- package/dist/runtime/nuxt/composables/mock.d.ts +1 -1
- package/dist/runtime/nuxt/plugins/__zero-runtime/og-image-canonical-urls.server.d.ts +2 -0
- package/dist/runtime/nuxt/plugins/__zero-runtime/og-image-canonical-urls.server.js +9 -0
- package/dist/runtime/nuxt/plugins/__zero-runtime/route-rule-og-image.server.d.ts +2 -0
- package/dist/runtime/nuxt/plugins/__zero-runtime/route-rule-og-image.server.js +9 -0
- package/dist/runtime/nuxt/plugins/og-image-canonical-urls.server.js +3 -51
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.js +4 -36
- package/dist/runtime/nuxt/utils/plugins.d.ts +3 -0
- package/dist/runtime/nuxt/utils/plugins.js +87 -0
- package/dist/runtime/nuxt/utils.js +6 -4
- package/dist/runtime/shared.js +3 -3
- package/dist/runtime/types.d.ts +6 -5
- package/dist/types.d.mts +0 -4
- package/dist/types.d.ts +0 -4
- package/package.json +31 -23
- package/dist/client/_nuxt/6bkCFmAg.js +0 -1
- package/dist/client/_nuxt/B3yJX9Qu.js +0 -1
- package/dist/client/_nuxt/B5USdwzW.js +0 -1
- package/dist/client/_nuxt/B7zm8LFH.js +0 -2
- package/dist/client/_nuxt/B8yeR86s.js +0 -1
- package/dist/client/_nuxt/B9MAV_WH.js +0 -1
- package/dist/client/_nuxt/B9afuS00.js +0 -1
- package/dist/client/_nuxt/BDUkJJFZ.js +0 -1
- package/dist/client/_nuxt/BEIEqD7s.js +0 -1
- package/dist/client/_nuxt/BESheOyt.js +0 -1
- package/dist/client/_nuxt/BFO9THtE.js +0 -1
- package/dist/client/_nuxt/BICcMyTi.js +0 -1
- package/dist/client/_nuxt/BIboXAcp.js +0 -1
- package/dist/client/_nuxt/BNuYtHxo.js +0 -1
- package/dist/client/_nuxt/BOCDpWc1.js +0 -17
- package/dist/client/_nuxt/BOtZLFcM.js +0 -3
- package/dist/client/_nuxt/BPiaQZfK.js +0 -1
- package/dist/client/_nuxt/BQgbS7Yt.js +0 -1
- package/dist/client/_nuxt/BSrQBeSJ.js +0 -131
- package/dist/client/_nuxt/BTO_K1fm.js +0 -1
- package/dist/client/_nuxt/BUQ2FcJX.js +0 -1
- package/dist/client/_nuxt/BVsCzzYp.js +0 -1
- package/dist/client/_nuxt/BccEf5hb.js +0 -1
- package/dist/client/_nuxt/BeqgMazi.js +0 -1
- package/dist/client/_nuxt/BltGI4TE.js +0 -1
- package/dist/client/_nuxt/BrHEiNXv.js +0 -1
- package/dist/client/_nuxt/BspO9hSn.js +0 -1
- package/dist/client/_nuxt/Bszlo9K_.js +0 -1
- package/dist/client/_nuxt/Bt3jdO27.js +0 -1
- package/dist/client/_nuxt/BzeF2RWN.js +0 -1
- package/dist/client/_nuxt/C5QX-GgJ.js +0 -1
- package/dist/client/_nuxt/C6F4YvHi.js +0 -1
- package/dist/client/_nuxt/C6pBAdyX.js +0 -1
- package/dist/client/_nuxt/C7O_L2NY.js +0 -1
- package/dist/client/_nuxt/C8KGJGmD.js +0 -1
- package/dist/client/_nuxt/C9X_x5J1.js +0 -1
- package/dist/client/_nuxt/CAkjjYd_.js +0 -1
- package/dist/client/_nuxt/CDLXdqou.js +0 -6
- package/dist/client/_nuxt/CTjLfFPV.js +0 -1
- package/dist/client/_nuxt/CY-WakqA.js +0 -1
- package/dist/client/_nuxt/C_D4IvTY.js +0 -1
- package/dist/client/_nuxt/CbFpZgCV.js +0 -1
- package/dist/client/_nuxt/CbjS_D4a.js +0 -1
- package/dist/client/_nuxt/CeUooOMz.js +0 -1
- package/dist/client/_nuxt/Clnf9f06.js +0 -1
- package/dist/client/_nuxt/CmHkUvIV.js +0 -1
- package/dist/client/_nuxt/CmonagEV.js +0 -1
- package/dist/client/_nuxt/CowR2XfX.js +0 -1
- package/dist/client/_nuxt/CuJfdYLG.js +0 -1
- package/dist/client/_nuxt/CwZIVF5c.js +0 -1
- package/dist/client/_nuxt/Cwv93qcC.js +0 -4
- package/dist/client/_nuxt/CzrtbdtR.js +0 -1
- package/dist/client/_nuxt/D1i8Vxii.js +0 -1
- package/dist/client/_nuxt/D384ylkT.js +0 -1
- package/dist/client/_nuxt/D7Nx8OLD.js +0 -1
- package/dist/client/_nuxt/D8YTaFMU.js +0 -1
- package/dist/client/_nuxt/D8ecWW_g.js +0 -1
- package/dist/client/_nuxt/DA288kE2.js +0 -3
- package/dist/client/_nuxt/DAVo6uMX.js +0 -1
- package/dist/client/_nuxt/DFRYOy8B.js +0 -1
- package/dist/client/_nuxt/DHCC4-m4.js +0 -1
- package/dist/client/_nuxt/DIC-ECB_.js +0 -1
- package/dist/client/_nuxt/DKluMpTE.js +0 -1
- package/dist/client/_nuxt/DKrjeWrU.js +0 -1
- package/dist/client/_nuxt/DOwv4Xrr.js +0 -1
- package/dist/client/_nuxt/DQdnirlo.js +0 -1
- package/dist/client/_nuxt/DRgydeCt.js +0 -1
- package/dist/client/_nuxt/DS9ZWoKD.js +0 -1
- package/dist/client/_nuxt/DSPtUMMI.js +0 -1
- package/dist/client/_nuxt/DYQagCV4.js +0 -1
- package/dist/client/_nuxt/DfqM7apN.js +0 -1
- package/dist/client/_nuxt/Dm9yFT8Y.js +0 -2
- package/dist/client/_nuxt/DoDCNZ2x.js +0 -1
- package/dist/client/_nuxt/Dtv2yyrc.js +0 -1
- package/dist/client/_nuxt/DvreHBtf.js +0 -1
- package/dist/client/_nuxt/DvyTQcux.js +0 -1
- package/dist/client/_nuxt/H2A8RXvM.js +0 -1
- package/dist/client/_nuxt/KCgU82S2.js +0 -1
- package/dist/client/_nuxt/NboNzovp.js +0 -1
- package/dist/client/_nuxt/PYrcYqZ1.js +0 -1
- package/dist/client/_nuxt/SXuYmi6B.js +0 -1
- package/dist/client/_nuxt/Sm_sVxcW.js +0 -14
- package/dist/client/_nuxt/Wkyh6-uf.js +0 -1
- package/dist/client/_nuxt/XrZDCB4K.js +0 -1
- package/dist/client/_nuxt/_fwBhpzY.js +0 -1
- package/dist/client/_nuxt/a0z0KVy-.js +0 -5
- package/dist/client/_nuxt/bPMpiWut.js +0 -1
- package/dist/client/_nuxt/builds/meta/517cb958-776a-47e2-bd34-69240f18e412.json +0 -1
- package/dist/client/_nuxt/d2PdAb0u.js +0 -2
- package/dist/client/_nuxt/error-404.F6YJ8FEX.css +0 -1
- package/dist/client/_nuxt/error-500.TGideFTg.css +0 -1
- package/dist/client/_nuxt/g4vhSHS2.js +0 -1
- package/dist/client/_nuxt/kZiYIjIU.js +0 -1
- package/dist/client/_nuxt/lOwNZ7_V.js +0 -1
- package/dist/client/_nuxt/nfCtBF4F.js +0 -1
- package/dist/client/_nuxt/pit2X7C0.js +0 -1
- package/dist/client/_nuxt/r5D-aIjp.js +0 -1
- package/dist/client/_nuxt/rh45RTDP.js +0 -1
- package/dist/client/_nuxt/tgs8ujlj.js +0 -1
- package/dist/client/_nuxt/v_4dTNAb.js +0 -1
- package/dist/client/_nuxt/vvK2q8Zt.js +0 -1
- package/dist/client/_nuxt/yOCz8xPT.js +0 -1
package/dist/module.mjs
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
4
|
-
import { useNuxt, tryResolveModule, addTemplate,
|
|
4
|
+
import { useNuxt, tryResolveModule, addTemplate, useLogger, resolvePath, loadNuxtModuleInstance, createResolver, defineNuxtModule, addImports, addBuildPlugin, hasNuxtModule, addServerPlugin, addServerHandler, addComponentsDir, addComponent, addPlugin } from '@nuxt/kit';
|
|
5
|
+
import { defu } from 'defu';
|
|
5
6
|
import { assertSiteConfig, installNuxtSiteConfig } from 'nuxt-site-config-kit';
|
|
6
|
-
import { provider, env, isCI, isDevelopment } from 'std-env';
|
|
7
7
|
import { hash } from 'ohash';
|
|
8
|
-
import {
|
|
9
|
-
import { defu } from 'defu';
|
|
8
|
+
import { dirname, relative as relative$1, isAbsolute, basename } from 'pathe';
|
|
10
9
|
import { readPackageJSON } from 'pkg-types';
|
|
10
|
+
import { provider, env, isCI, isDevelopment } from 'std-env';
|
|
11
|
+
import { parseURL, parseQuery, withoutLeadingSlash } from 'ufo';
|
|
11
12
|
import { createStorage } from 'unstorage';
|
|
12
13
|
import fsDriver from 'unstorage/drivers/fs';
|
|
13
|
-
import {
|
|
14
|
+
import { createHash } from 'node:crypto';
|
|
14
15
|
import { ensureDependencyInstalled } from 'nypm';
|
|
15
|
-
import {
|
|
16
|
+
import { colorize } from 'consola/utils';
|
|
17
|
+
import { relative } from 'node:path';
|
|
16
18
|
import { onDevToolsInitialized, extendServerRpc } from '@nuxt/devtools-kit';
|
|
17
|
-
import {
|
|
19
|
+
import { pathToFileURL } from 'node:url';
|
|
20
|
+
import MagicString from 'magic-string';
|
|
21
|
+
import { stripLiteral } from 'strip-literal';
|
|
22
|
+
import { createUnplugin } from 'unplugin';
|
|
18
23
|
import { Launcher } from 'chrome-launcher';
|
|
19
24
|
import { $fetch } from 'ofetch';
|
|
20
25
|
|
|
@@ -148,8 +153,8 @@ async function applyNitroPresetCompatibility(nitroConfig, options) {
|
|
|
148
153
|
binding = compatibility[key];
|
|
149
154
|
if (key === "chromium" && binding === "node")
|
|
150
155
|
binding = "playwright";
|
|
151
|
-
if (key === "css-inline") {
|
|
152
|
-
if (binding === "node" && !hasCssInlineNode ||
|
|
156
|
+
if (key === "css-inline" && typeof binding === "string") {
|
|
157
|
+
if (binding === "node" && !hasCssInlineNode || ["wasm", "wasm-fs"].includes(binding) && !hasCssInlineWasm) {
|
|
153
158
|
binding = false;
|
|
154
159
|
}
|
|
155
160
|
}
|
|
@@ -191,51 +196,66 @@ function ensureDependencies(dep, nuxt = useNuxt()) {
|
|
|
191
196
|
}));
|
|
192
197
|
}
|
|
193
198
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (moduleEntry)
|
|
208
|
-
inlineOptions = moduleEntry[1];
|
|
209
|
-
if (nuxtModule.getOptions)
|
|
210
|
-
return nuxtModule.getOptions(inlineOptions, nuxt);
|
|
211
|
-
return inlineOptions;
|
|
212
|
-
}
|
|
213
|
-
function extendTypes(module, template) {
|
|
214
|
-
const nuxt = useNuxt();
|
|
215
|
-
const { resolve } = createResolver(import.meta.url);
|
|
216
|
-
addTemplate({
|
|
217
|
-
filename: `module/${module}.d.ts`,
|
|
218
|
-
getContents: async () => {
|
|
219
|
-
const typesPath = relative(resolve(nuxt.options.rootDir, nuxt.options.buildDir, "module"), resolve("runtime/types"));
|
|
220
|
-
const s = await template({ typesPath });
|
|
221
|
-
return `// Generated by ${module}
|
|
222
|
-
${s}
|
|
223
|
-
export {}
|
|
224
|
-
`;
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
nuxt.hooks.hook("prepare:types", ({ references }) => {
|
|
228
|
-
references.push({ path: resolve(nuxt.options.buildDir, `module/${module}.d.ts`) });
|
|
199
|
+
const logger = useLogger("@nuxtjs/og-image");
|
|
200
|
+
const gray = (s) => colorize("gray", s);
|
|
201
|
+
|
|
202
|
+
async function setupBuildHandler(config, resolve, nuxt = useNuxt()) {
|
|
203
|
+
nuxt.options.nitro.storage = nuxt.options.nitro.storage || {};
|
|
204
|
+
if (typeof config.runtimeCacheStorage === "object")
|
|
205
|
+
nuxt.options.nitro.storage["og-image"] = config.runtimeCacheStorage;
|
|
206
|
+
nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
|
|
207
|
+
await applyNitroPresetCompatibility(nitroConfig, { compatibility: config.compatibility?.runtime, resolve });
|
|
208
|
+
nitroConfig.alias.electron = "unenv/runtime/mock/proxy-cjs";
|
|
209
|
+
nitroConfig.alias.bufferutil = "unenv/runtime/mock/proxy-cjs";
|
|
210
|
+
nitroConfig.alias["utf-8-validate"] = "unenv/runtime/mock/proxy-cjs";
|
|
211
|
+
nitroConfig.alias.queue = "unenv/runtime/mock/proxy-cjs";
|
|
229
212
|
});
|
|
230
|
-
nuxt.hooks.hook("nitro:
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
213
|
+
nuxt.hooks.hook("nitro:init", async (nitro) => {
|
|
214
|
+
nitro.hooks.hook("compiled", async (_nitro) => {
|
|
215
|
+
const target = resolveNitroPreset(_nitro.options);
|
|
216
|
+
const compatibility = getPresetNitroPresetCompatibility(target);
|
|
217
|
+
if (compatibility.wasm?.esmImport !== true)
|
|
218
|
+
return;
|
|
219
|
+
const configuredEntry = nitro.options.rollupConfig?.output.entryFileNames;
|
|
220
|
+
let serverEntry = resolve(_nitro.options.output.serverDir, typeof configuredEntry === "string" ? configuredEntry : "index.mjs");
|
|
221
|
+
const isCloudflarePagesOrModule = target === "cloudflare-pages" || target === "cloudflare-module";
|
|
222
|
+
if (isCloudflarePagesOrModule) {
|
|
223
|
+
serverEntry = [
|
|
224
|
+
resolve(dirname(serverEntry), "./chunks/wasm.mjs"),
|
|
225
|
+
resolve(dirname(serverEntry), "./chunks/_/wasm.mjs")
|
|
226
|
+
].filter(existsSync)[0] || serverEntry;
|
|
227
|
+
const routesPath = resolve(nitro.options.output.publicDir, "_routes.json");
|
|
228
|
+
const routes = await readFile(routesPath).then((buffer) => JSON.parse(buffer.toString()));
|
|
229
|
+
const preSize = routes.exclude.length;
|
|
230
|
+
routes.exclude = routes.exclude.filter((path2) => !path2.startsWith("/__og-image__/static"));
|
|
231
|
+
routes.exclude.push("/__og-image__/static/*");
|
|
232
|
+
if (preSize !== routes.exclude.length) {
|
|
233
|
+
logger.info(`Optimizing CloudFlare \`_routes.json\` for prerendered OG Images ${gray(`(${100 - Math.round(routes.exclude.length / preSize * 100)}% smaller)`)}`);
|
|
234
|
+
}
|
|
235
|
+
await writeFile(routesPath, JSON.stringify(routes, void 0, 2));
|
|
236
|
+
}
|
|
237
|
+
const contents = await readFile(serverEntry, "utf-8");
|
|
238
|
+
const resvgHash = await resolveFilePathSha1("@resvg/resvg-wasm/index_bg.wasm");
|
|
239
|
+
const yogaHash = await resolveFilePathSha1("yoga-wasm-web/dist/yoga.wasm");
|
|
240
|
+
const cssInlineHash = await resolveFilePathSha1("@css-inline/css-inline-wasm/index_bg.wasm");
|
|
241
|
+
const postfix = target === "vercel-edge" ? "?module" : "";
|
|
242
|
+
const path = isCloudflarePagesOrModule ? `../wasm/` : `./wasm/`;
|
|
243
|
+
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" });
|
|
244
|
+
});
|
|
235
245
|
});
|
|
236
246
|
}
|
|
237
|
-
function
|
|
238
|
-
|
|
247
|
+
async function resolveFilePathSha1(path) {
|
|
248
|
+
const _path = await resolvePath(path);
|
|
249
|
+
return sha1(existsSync(_path) ? await readFile(_path) : path);
|
|
250
|
+
}
|
|
251
|
+
function sha1(source) {
|
|
252
|
+
return createHash("sha1").update(source).digest("hex").slice(0, 16);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function setupDevHandler(options, resolve, nuxt = useNuxt()) {
|
|
256
|
+
nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
|
|
257
|
+
await applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility?.dev, resolve });
|
|
258
|
+
});
|
|
239
259
|
}
|
|
240
260
|
|
|
241
261
|
const DEVTOOLS_UI_ROUTE = "/__nuxt-og-image";
|
|
@@ -266,7 +286,7 @@ function setupDevToolsUI(options, resolve, nuxt = useNuxt()) {
|
|
|
266
286
|
onDevToolsInitialized(async () => {
|
|
267
287
|
const rpc = extendServerRpc("nuxt-og-image", {});
|
|
268
288
|
nuxt.hook("builder:watch", (e, path) => {
|
|
269
|
-
path = relative
|
|
289
|
+
path = relative(nuxt.options.srcDir, resolve(nuxt.options.srcDir, path));
|
|
270
290
|
if ((e === "change" || e.includes("link")) && path.startsWith("pages")) {
|
|
271
291
|
rpc.broadcast.refreshRouteData(path).catch(() => {
|
|
272
292
|
});
|
|
@@ -299,12 +319,6 @@ function setupDevToolsUI(options, resolve, nuxt = useNuxt()) {
|
|
|
299
319
|
});
|
|
300
320
|
}
|
|
301
321
|
|
|
302
|
-
function setupDevHandler(options, resolve, nuxt = useNuxt()) {
|
|
303
|
-
nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
|
|
304
|
-
await applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility?.dev, resolve });
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
|
|
308
322
|
function setupGenerateHandler(options, resolve, nuxt = useNuxt()) {
|
|
309
323
|
nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
|
|
310
324
|
await applyNitroPresetCompatibility(nitroConfig, {
|
|
@@ -343,48 +357,138 @@ function setupPrerenderHandler(options, resolve, nuxt = useNuxt()) {
|
|
|
343
357
|
});
|
|
344
358
|
}
|
|
345
359
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
if (
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
360
|
+
function isVue(id, opts = {}) {
|
|
361
|
+
const { search } = parseURL(decodeURIComponent(pathToFileURL(id).href));
|
|
362
|
+
if (id.endsWith(".vue") && !search) {
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
if (!search) {
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
const query = parseQuery(search);
|
|
369
|
+
if (query.nuxt_component) {
|
|
370
|
+
return false;
|
|
371
|
+
}
|
|
372
|
+
if (query.macro && (search === "?macro=true" || !opts.type || opts.type.includes("script"))) {
|
|
373
|
+
return true;
|
|
374
|
+
}
|
|
375
|
+
const type = "setup" in query ? "script" : query.type;
|
|
376
|
+
if (!("vue" in query) || opts.type && !opts.type.includes(type)) {
|
|
377
|
+
return false;
|
|
378
|
+
}
|
|
379
|
+
return true;
|
|
380
|
+
}
|
|
381
|
+
const JS_RE = /\.(?:[cm]?j|t)sx?$/;
|
|
382
|
+
function isJS(id) {
|
|
383
|
+
const { pathname } = parseURL(decodeURIComponent(pathToFileURL(id).href));
|
|
384
|
+
return JS_RE.test(pathname);
|
|
385
|
+
}
|
|
386
|
+
const TreeShakeComposablesPlugin = createUnplugin(() => {
|
|
387
|
+
const composableNames = [
|
|
388
|
+
"defineOgImage",
|
|
389
|
+
"defineOgImageComponent",
|
|
390
|
+
"defineOgImageScreenshot"
|
|
391
|
+
];
|
|
392
|
+
const regexp = `(^\\s*)(${composableNames.join("|")})(?=\\((?!\\) \\{))`;
|
|
393
|
+
const COMPOSABLE_RE = new RegExp(regexp, "m");
|
|
394
|
+
const COMPOSABLE_RE_GLOBAL = new RegExp(regexp, "gm");
|
|
395
|
+
return {
|
|
396
|
+
name: "nuxt-og-image:zero-runtime:transform",
|
|
397
|
+
enforce: "pre",
|
|
398
|
+
transformInclude(id) {
|
|
399
|
+
return isVue(id, { type: ["script"] }) || isJS(id);
|
|
400
|
+
},
|
|
401
|
+
transform(code, id) {
|
|
402
|
+
const s = new MagicString(code);
|
|
403
|
+
if (id.endsWith("components.islands.mjs")) {
|
|
404
|
+
for (const match of code.matchAll(/"OgImage.*": defineAsyncComponent\(.*\),?/g)) {
|
|
405
|
+
s.overwrite(match.index, match.index + match[0].length, "");
|
|
406
|
+
}
|
|
407
|
+
} else {
|
|
408
|
+
const strippedCode = stripLiteral(code);
|
|
409
|
+
if (!COMPOSABLE_RE.test(code)) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
for (const match of strippedCode.matchAll(COMPOSABLE_RE_GLOBAL)) {
|
|
413
|
+
s.overwrite(match.index, match.index + match[0].length, `${match[1]} import.meta.prerender && ${match[2]}`);
|
|
414
|
+
}
|
|
371
415
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
416
|
+
if (s.hasChanged()) {
|
|
417
|
+
return {
|
|
418
|
+
code: s.toString(),
|
|
419
|
+
map: s.generateMap({ hires: true })
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
async function getNuxtModuleOptions(module, nuxt = useNuxt()) {
|
|
427
|
+
const moduleMeta = (typeof module === "string" ? { name: module } : await module.getMeta?.()) || {};
|
|
428
|
+
const { nuxtModule } = await loadNuxtModuleInstance(module, nuxt);
|
|
429
|
+
let moduleEntry;
|
|
430
|
+
for (const m of nuxt.options.modules) {
|
|
431
|
+
if (Array.isArray(m) && m.length >= 2) {
|
|
432
|
+
const _module = m[0];
|
|
433
|
+
const _moduleEntryName = typeof _module === "string" ? _module : (await _module.getMeta?.())?.name || "";
|
|
434
|
+
if (_moduleEntryName === moduleMeta.name)
|
|
435
|
+
moduleEntry = m;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
let inlineOptions = {};
|
|
439
|
+
if (moduleEntry)
|
|
440
|
+
inlineOptions = moduleEntry[1];
|
|
441
|
+
if (nuxtModule.getOptions)
|
|
442
|
+
return nuxtModule.getOptions(inlineOptions, nuxt);
|
|
443
|
+
return inlineOptions;
|
|
444
|
+
}
|
|
445
|
+
function extendTypes(module, template) {
|
|
446
|
+
const nuxt = useNuxt();
|
|
447
|
+
const { resolve } = createResolver(import.meta.url);
|
|
448
|
+
addTemplate({
|
|
449
|
+
filename: `module/${module}.d.ts`,
|
|
450
|
+
getContents: async () => {
|
|
451
|
+
const typesPath = relative$1(resolve(nuxt.options.rootDir, nuxt.options.buildDir, "module"), resolve("runtime/types"));
|
|
452
|
+
const s = await template({ typesPath });
|
|
453
|
+
return `// Generated by ${module}
|
|
454
|
+
${s}
|
|
455
|
+
export {}
|
|
456
|
+
`;
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
nuxt.hooks.hook("prepare:types", ({ references }) => {
|
|
460
|
+
references.push({ path: resolve(nuxt.options.buildDir, `module/${module}.d.ts`) });
|
|
461
|
+
});
|
|
462
|
+
nuxt.hooks.hook("nitro:config", (config) => {
|
|
463
|
+
config.typescript = config.typescript || {};
|
|
464
|
+
config.typescript.tsConfig = config.typescript.tsConfig || {};
|
|
465
|
+
config.typescript.tsConfig.include = config.typescript.tsConfig.include || [];
|
|
466
|
+
config.typescript.tsConfig.include.push(`./module/${module}.d.ts`);
|
|
380
467
|
});
|
|
381
468
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
return sha1(existsSync(_path) ? await readFile(_path) : path);
|
|
469
|
+
function isNuxtGenerate(nuxt = useNuxt()) {
|
|
470
|
+
return nuxt.options._generate || nuxt.options.nitro.static || nuxt.options.nitro.preset === "static";
|
|
385
471
|
}
|
|
386
|
-
|
|
387
|
-
|
|
472
|
+
|
|
473
|
+
function normaliseFontInput(fonts) {
|
|
474
|
+
return fonts.map((f) => {
|
|
475
|
+
if (typeof f === "string") {
|
|
476
|
+
const [name, weight] = f.split(":");
|
|
477
|
+
return {
|
|
478
|
+
cacheKey: f,
|
|
479
|
+
name,
|
|
480
|
+
weight: weight || 400,
|
|
481
|
+
style: "normal",
|
|
482
|
+
path: void 0
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
return {
|
|
486
|
+
cacheKey: f.key || `${f.name}:${f.weight}`,
|
|
487
|
+
style: "normal",
|
|
488
|
+
weight: 400,
|
|
489
|
+
...f
|
|
490
|
+
};
|
|
491
|
+
});
|
|
388
492
|
}
|
|
389
493
|
|
|
390
494
|
const isUndefinedOrTruthy = (v) => typeof v === "undefined" || v !== false;
|
|
@@ -429,27 +533,6 @@ async function downloadFont(font, storage, mirror) {
|
|
|
429
533
|
return false;
|
|
430
534
|
}
|
|
431
535
|
|
|
432
|
-
function normaliseFontInput(fonts) {
|
|
433
|
-
return fonts.map((f) => {
|
|
434
|
-
if (typeof f === "string") {
|
|
435
|
-
const [name, weight] = f.split(":");
|
|
436
|
-
return {
|
|
437
|
-
cacheKey: f,
|
|
438
|
-
name,
|
|
439
|
-
weight: weight || 400,
|
|
440
|
-
style: "normal",
|
|
441
|
-
path: void 0
|
|
442
|
-
};
|
|
443
|
-
}
|
|
444
|
-
return {
|
|
445
|
-
cacheKey: f.key || `${f.name}:${f.weight}`,
|
|
446
|
-
style: "normal",
|
|
447
|
-
weight: 400,
|
|
448
|
-
...f
|
|
449
|
-
};
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
|
|
453
536
|
const module = defineNuxtModule({
|
|
454
537
|
meta: {
|
|
455
538
|
name: "nuxt-og-image",
|
|
@@ -494,9 +577,23 @@ const module = defineNuxtModule({
|
|
|
494
577
|
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 }`).");
|
|
495
578
|
return;
|
|
496
579
|
}
|
|
497
|
-
nuxt.options.
|
|
580
|
+
nuxt.options.alias["#nuxt-og-image-utils"] = resolve("./runtime/shared");
|
|
581
|
+
nuxt.options.alias["#nuxt-og-image-cache"] = resolve("./runtime/nitro/og-image/cache/lru");
|
|
498
582
|
const preset = resolveNitroPreset(nuxt.options.nitro);
|
|
499
583
|
const targetCompatibility = getPresetNitroPresetCompatibility(preset);
|
|
584
|
+
if (config.zeroRuntime) {
|
|
585
|
+
config.compatibility = defu(config.compatibility, {
|
|
586
|
+
runtime: {
|
|
587
|
+
chromium: false,
|
|
588
|
+
// should already be false
|
|
589
|
+
satori: false
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
if (!nuxt.options.dev) {
|
|
593
|
+
addBuildPlugin(TreeShakeComposablesPlugin, { server: true, client: true, build: true });
|
|
594
|
+
nuxt.options.alias["#nuxt-og-image-cache"] = resolve("./runtime/nitro/og-image/cache/mock");
|
|
595
|
+
}
|
|
596
|
+
}
|
|
500
597
|
let isUsingSharp = false;
|
|
501
598
|
const userConfiguredExtension = config.defaults.extension;
|
|
502
599
|
const hasConfiguredJpegs = userConfiguredExtension && ["jpeg", "jpg"].includes(userConfiguredExtension);
|
|
@@ -560,8 +657,9 @@ const module = defineNuxtModule({
|
|
|
560
657
|
}
|
|
561
658
|
});
|
|
562
659
|
await installNuxtSiteConfig();
|
|
563
|
-
if (hasNuxtModule("@nuxt/content"))
|
|
660
|
+
if (hasNuxtModule("@nuxt/content")) {
|
|
564
661
|
addServerPlugin(resolve("./runtime/nitro/plugins/nuxt-content"));
|
|
662
|
+
}
|
|
565
663
|
if (!config.fonts.length) {
|
|
566
664
|
config.fonts = [
|
|
567
665
|
{ name: "Inter", weight: 400, path: resolve("./runtime/assets/Inter-400.ttf.base64"), absolutePath: true },
|
|
@@ -610,13 +708,22 @@ const module = defineNuxtModule({
|
|
|
610
708
|
}
|
|
611
709
|
return f;
|
|
612
710
|
}))).filter(Boolean);
|
|
613
|
-
|
|
614
|
-
|
|
711
|
+
const fontKeys = config.fonts.map((f) => f.key?.split(":").pop());
|
|
712
|
+
const fontStorageKeys = await fontStorage.getKeys();
|
|
713
|
+
await Promise.all(fontStorageKeys.filter((key) => !fontKeys.includes(key)).map(async (key) => {
|
|
714
|
+
logger.info(`Nuxt OG Image removing outdated cached font file \`${key}\``);
|
|
715
|
+
await fontStorage.removeItem(key);
|
|
716
|
+
}));
|
|
717
|
+
if (!config.zeroRuntime) {
|
|
718
|
+
nuxt.options.nitro.serverAssets = nuxt.options.nitro.serverAssets || [];
|
|
719
|
+
nuxt.options.nitro.serverAssets.push({ baseName: "nuxt-og-image:fonts", dir: serverFontsDir });
|
|
720
|
+
}
|
|
615
721
|
nuxt.options.experimental.componentIslands = true;
|
|
722
|
+
const basePath = config.zeroRuntime ? "./runtime/nitro/routes/__zero-runtime" : "./runtime/nitro/routes";
|
|
616
723
|
addServerHandler({
|
|
617
724
|
lazy: true,
|
|
618
725
|
route: "/__og-image__/font/**",
|
|
619
|
-
handler: resolve(
|
|
726
|
+
handler: resolve(`${basePath}/font`)
|
|
620
727
|
});
|
|
621
728
|
if (config.debug || nuxt.options.dev) {
|
|
622
729
|
addServerHandler({
|
|
@@ -628,7 +735,12 @@ const module = defineNuxtModule({
|
|
|
628
735
|
addServerHandler({
|
|
629
736
|
lazy: true,
|
|
630
737
|
route: "/__og-image__/image/**",
|
|
631
|
-
handler: resolve(
|
|
738
|
+
handler: resolve(`${basePath}/image`)
|
|
739
|
+
});
|
|
740
|
+
addServerHandler({
|
|
741
|
+
lazy: true,
|
|
742
|
+
route: "/__og-image__/static/**",
|
|
743
|
+
handler: resolve(`${basePath}/image`)
|
|
632
744
|
});
|
|
633
745
|
nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"] = [];
|
|
634
746
|
["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((name2) => {
|
|
@@ -638,11 +750,13 @@ const module = defineNuxtModule({
|
|
|
638
750
|
});
|
|
639
751
|
nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"].push(name2);
|
|
640
752
|
});
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
753
|
+
if (!config.zeroRuntime || nuxt.options.dev) {
|
|
754
|
+
await addComponentsDir({
|
|
755
|
+
path: resolve("./runtime/nuxt/components/Templates/Community"),
|
|
756
|
+
island: true
|
|
757
|
+
// watch: true,
|
|
758
|
+
});
|
|
759
|
+
}
|
|
646
760
|
[
|
|
647
761
|
// new
|
|
648
762
|
"OgImage",
|
|
@@ -654,8 +768,9 @@ const module = defineNuxtModule({
|
|
|
654
768
|
...config.componentOptions
|
|
655
769
|
});
|
|
656
770
|
});
|
|
657
|
-
|
|
658
|
-
addPlugin({ mode: "server", src: resolve(
|
|
771
|
+
const basePluginPath = `./runtime/nuxt/plugins${config.zeroRuntime ? "/__zero-runtime" : ""}`;
|
|
772
|
+
addPlugin({ mode: "server", src: resolve(`${basePluginPath}/route-rule-og-image.server`) });
|
|
773
|
+
addPlugin({ mode: "server", src: resolve(`${basePluginPath}/og-image-canonical-urls.server`) });
|
|
659
774
|
const ogImageComponentCtx = { components: [] };
|
|
660
775
|
nuxt.hook("components:extend", (components) => {
|
|
661
776
|
ogImageComponentCtx.components = [];
|
|
@@ -712,7 +827,7 @@ const module = defineNuxtModule({
|
|
|
712
827
|
};
|
|
713
828
|
extendTypes("nuxt-og-image", ({ typesPath }) => {
|
|
714
829
|
const componentImports = ogImageComponentCtx.components.map((component) => {
|
|
715
|
-
const relativeComponentPath = relative(resolve(nuxt.options.rootDir, nuxt.options.buildDir, "module"), component.path);
|
|
830
|
+
const relativeComponentPath = relative$1(resolve(nuxt.options.rootDir, nuxt.options.buildDir, "module"), component.path);
|
|
716
831
|
const name2 = config.componentDirs.sort((a, b) => b.length - a.length).reduce((name3, dir) => {
|
|
717
832
|
return name3.replace(new RegExp(`^${dir}`), "");
|
|
718
833
|
}, component.pascalName);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import playwrightCore from "playwright-core";
|
|
2
1
|
import { Launcher } from "chrome-launcher";
|
|
2
|
+
import playwrightCore from "playwright-core";
|
|
3
3
|
const chromePath = Launcher.getFirstInstallation();
|
|
4
4
|
export async function createBrowser() {
|
|
5
5
|
return playwrightCore.chromium.launch({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { init } from "satori";
|
|
1
2
|
import _satori from "satori/wasm";
|
|
2
3
|
import initYoga from "yoga-wasm-web";
|
|
3
|
-
import { init } from "satori";
|
|
4
4
|
const wasm = import("yoga-wasm-web/dist/yoga.wasm?module").then(async (yoga) => await initYoga(yoga.default || yoga));
|
|
5
5
|
export default {
|
|
6
6
|
initWasmPromise: new Promise((resolve) => {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Storage } from 'unstorage';
|
|
2
|
-
import type { OgImageOptions } from '
|
|
2
|
+
import type { OgImageOptions } from '../../../types.js';
|
|
3
3
|
export declare const htmlPayloadCache: Storage<{
|
|
4
4
|
expiresAt: number;
|
|
5
5
|
value: OgImageOptions;
|
|
6
6
|
}>;
|
|
7
7
|
export declare const prerenderOptionsCache: Storage<OgImageOptions> | undefined;
|
|
8
|
+
export declare const fontCache: Storage<BufferSource>;
|
|
9
|
+
export declare const emojiCache: Storage<string>;
|
|
@@ -7,3 +7,9 @@ export const htmlPayloadCache = createStorage({
|
|
|
7
7
|
export const prerenderOptionsCache = import.meta.prerender ? createStorage({
|
|
8
8
|
driver: lruCacheDriver({ max: 1e4 })
|
|
9
9
|
}) : void 0;
|
|
10
|
+
export const fontCache = createStorage({
|
|
11
|
+
driver: lruCacheDriver({ max: 10 })
|
|
12
|
+
});
|
|
13
|
+
export const emojiCache = createStorage({
|
|
14
|
+
driver: lruCacheDriver({ max: 1e3 })
|
|
15
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Storage } from 'unstorage';
|
|
2
|
+
import type { OgImageOptions } from '../../../types.js';
|
|
3
|
+
export declare const htmlPayloadCache: Storage<{
|
|
4
|
+
expiresAt: number;
|
|
5
|
+
value: OgImageOptions;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const prerenderOptionsCache: Storage<OgImageOptions> | undefined;
|
|
8
|
+
export declare const fontCache: Storage<OgImageOptions<"NuxtSeo">>;
|
|
9
|
+
export declare const emojiCache: Storage<string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createStorage } from "unstorage";
|
|
2
|
+
import memoryDriver from "unstorage/drivers/memory";
|
|
3
|
+
const storage = createStorage({
|
|
4
|
+
driver: memoryDriver()
|
|
5
|
+
});
|
|
6
|
+
export const htmlPayloadCache = storage;
|
|
7
|
+
export const prerenderOptionsCache = storage;
|
|
8
|
+
export const fontCache = storage;
|
|
9
|
+
export const emojiCache = storage;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { createBrowser } from "#nuxt-og-image/bindings/chromium";
|
|
1
2
|
import { createError } from "h3";
|
|
2
3
|
import { createScreenshot } from "./screenshot.js";
|
|
3
|
-
import { createBrowser } from "#nuxt-og-image/bindings/chromium";
|
|
4
4
|
const ChromiumRenderer = {
|
|
5
5
|
name: "chromium",
|
|
6
6
|
supportedFormats: ["png", "jpeg", "jpg"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { useNitroOrigin } from "#imports";
|
|
1
2
|
import { joinURL, withQuery } from "ufo";
|
|
2
3
|
import { useOgImageRuntimeConfig } from "../../../shared.js";
|
|
3
|
-
import { useNitroOrigin } from "#imports";
|
|
4
4
|
export async function createScreenshot({ basePath, e, options, extension }, browser) {
|
|
5
5
|
const { colorPreference } = useOgImageRuntimeConfig();
|
|
6
6
|
const path = options.component === "PageScreenshot" ? basePath : joinURL("/__og-image__/image", basePath, `og.html`);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createError, getQuery } from "h3";
|
|
1
|
+
import { htmlPayloadCache, prerenderOptionsCache } from "#nuxt-og-image-cache";
|
|
3
2
|
import { defu } from "defu";
|
|
4
|
-
import { normalizeKey } from "unstorage";
|
|
5
|
-
import { hash } from "ohash";
|
|
6
|
-
import { useNitroApp } from "nitropack/runtime";
|
|
7
3
|
import { parse } from "devalue";
|
|
4
|
+
import { createError, getQuery } from "h3";
|
|
5
|
+
import { useNitroApp } from "nitropack/runtime";
|
|
6
|
+
import { hash } from "ohash";
|
|
7
|
+
import { parseURL, withoutLeadingSlash, withoutTrailingSlash, withQuery } from "ufo";
|
|
8
|
+
import { normalizeKey } from "unstorage";
|
|
8
9
|
import { separateProps, useOgImageRuntimeConfig } from "../../shared.js";
|
|
9
|
-
import { createNitroRouteRuleMatcher } from "../util/kit.js";
|
|
10
10
|
import { decodeObjectHtmlEntities } from "../util/encoding.js";
|
|
11
|
-
import {
|
|
11
|
+
import { createNitroRouteRuleMatcher } from "../util/kit.js";
|
|
12
12
|
import { useChromiumRenderer, useSatoriRenderer } from "./instances.js";
|
|
13
13
|
export function resolvePathCacheKey(e, path) {
|
|
14
14
|
const siteConfig = e.context.siteConfig.get();
|
|
@@ -42,7 +42,7 @@ export async function resolveContext(e) {
|
|
|
42
42
|
queryParams.props = JSON.parse(queryParams.props || "{}");
|
|
43
43
|
queryParams = separateProps(queryParams);
|
|
44
44
|
let basePath = withoutTrailingSlash(
|
|
45
|
-
path.replace(`/__og-image__/image`, "").replace(`/og.${extension}`, "")
|
|
45
|
+
path.replace(`/__og-image__/image`, "").replace(`/__og-image__/static`, "").replace(`/og.${extension}`, "")
|
|
46
46
|
);
|
|
47
47
|
if (queryParams._query)
|
|
48
48
|
basePath = withQuery(basePath, JSON.parse(queryParams._query));
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { OgImageRenderEventContext, ResolvedFontConfig } from '../../../types.js';
|
|
2
|
+
export declare const assets: import("unstorage").Storage<import("unstorage").StorageValue>;
|
|
2
3
|
export declare function loadFont({ e, publicStoragePath }: OgImageRenderEventContext, font: ResolvedFontConfig): Promise<ResolvedFontConfig>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { prefixStorage } from "unstorage";
|
|
2
1
|
import { useNitroOrigin, useStorage } from "#imports";
|
|
3
|
-
|
|
2
|
+
import { prefixStorage } from "unstorage";
|
|
3
|
+
export const assets = prefixStorage(useStorage(), "/assets");
|
|
4
4
|
export async function loadFont({ e, publicStoragePath }, font) {
|
|
5
5
|
const { name, weight } = font;
|
|
6
6
|
if (font.data)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type _sharp from 'sharp';
|
|
2
1
|
import type _satori from 'satori';
|
|
2
|
+
import type _sharp from 'sharp';
|
|
3
3
|
export declare function useResvg(): Promise<new (svg: Uint8Array | string, options?: import("@resvg/resvg-wasm").ResvgRenderOptions) => {
|
|
4
4
|
free(): void;
|
|
5
5
|
render(): {
|