nuxt-og-image 3.0.0-rc.4 → 3.0.0-rc.41
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 +4 -4
- package/dist/client/200.html +233 -15
- package/dist/client/404.html +233 -15
- package/dist/client/_nuxt/IconCSS.GPrqfOQd.js +1 -0
- package/dist/client/_nuxt/IconCSS.NC-oxnpY.css +1 -0
- package/dist/client/_nuxt/abap.bJqzlTLD.js +816 -0
- package/dist/client/_nuxt/actionscript-3.NUzLYz6e.js +1 -0
- package/dist/client/_nuxt/ada.HSb8VHJ5.js +1 -0
- package/dist/client/_nuxt/andromeeda.TE0Toi4a.js +1 -0
- package/dist/client/_nuxt/angular-html.2kK3Ey_6.js +16 -0
- package/dist/client/_nuxt/angular-ts.oipk5Mpx.js +666 -0
- package/dist/client/_nuxt/apache.TpqIaH_y.js +1 -0
- package/dist/client/_nuxt/apex.rLr5RF8N.js +274 -0
- package/dist/client/_nuxt/apl.XB4V8Q_3.js +87 -0
- package/dist/client/_nuxt/applescript.uEUaUzem.js +38 -0
- package/dist/client/_nuxt/ara.yxVemEif.js +21 -0
- package/dist/client/_nuxt/asm.N3zWSyW8.js +1 -0
- package/dist/client/_nuxt/astro.5Up4Y-tq.js +1 -0
- package/dist/client/_nuxt/aurora-x.23vffHpO.js +1 -0
- package/dist/client/_nuxt/awk.tQAliBPt.js +1 -0
- package/dist/client/_nuxt/ayu-dark.09-XTo9D.js +1 -0
- package/dist/client/_nuxt/ballerina.j08zL6tL.js +62 -0
- package/dist/client/_nuxt/bat.4hprCtpO.js +1 -0
- package/dist/client/_nuxt/beancount.B4bgLeBI.js +1 -0
- package/dist/client/_nuxt/berry.99Qqo7Pl.js +1 -0
- package/dist/client/_nuxt/bibtex.PUS4KD1G.js +1 -0
- package/dist/client/_nuxt/bicep.U1vZFTkg.js +1 -0
- package/dist/client/_nuxt/blade.dLd1FX1V.js +831 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/de9836c3-cc00-4f39-8841-9ac345b4681d.json +1 -0
- package/dist/client/_nuxt/c.1HqcaTLZ.js +81 -0
- package/dist/client/_nuxt/cadence.wPBjDAPG.js +1 -0
- package/dist/client/_nuxt/catppuccin-frappe.RsX2ypHK.js +1 -0
- package/dist/client/_nuxt/catppuccin-latte.VMh3L8Ce.js +1 -0
- package/dist/client/_nuxt/catppuccin-macchiato.ub_rvpAX.js +1 -0
- package/dist/client/_nuxt/catppuccin-mocha.GVeD5rZX.js +1 -0
- package/dist/client/_nuxt/clarity.9V3ikNUm.js +1 -0
- package/dist/client/_nuxt/clojure.m464_LIc.js +1 -0
- package/dist/client/_nuxt/cmake.YiKLaZ9A.js +1 -0
- package/dist/client/_nuxt/cobol.yHzQax91.js +1 -0
- package/dist/client/_nuxt/codeql.i7fhVOvX.js +1 -0
- package/dist/client/_nuxt/coffee.UjKhX0iS.js +100 -0
- package/dist/client/_nuxt/cpp.UIU91NPT.js +186 -0
- package/dist/client/_nuxt/crystal.p1-x8UtH.js +25 -0
- package/dist/client/_nuxt/csharp.xHVQI8QI.js +756 -0
- package/dist/client/_nuxt/css.tuEqSfZX.js +505 -0
- package/dist/client/_nuxt/csv.89HA7eVC.js +1 -0
- package/dist/client/_nuxt/cue.ts9p4IYJ.js +1 -0
- package/dist/client/_nuxt/cypher.y2dXjvht.js +1 -0
- package/dist/client/_nuxt/d.91KOtcJM.js +1 -0
- package/dist/client/_nuxt/dark-plus.kgh98KCl.js +1 -0
- package/dist/client/_nuxt/dart.ATU8nP6d.js +1 -0
- package/dist/client/_nuxt/dax.M4oDHFBw.js +29 -0
- package/dist/client/_nuxt/diff.-l9-nN5b.js +1 -0
- package/dist/client/_nuxt/docker.FKXxym4E.js +1 -0
- package/dist/client/_nuxt/dracula-soft.E92bUq8i.js +1 -0
- package/dist/client/_nuxt/dracula.mNVTF5-9.js +1 -0
- package/dist/client/_nuxt/dream-maker.5lPMrnJr.js +52 -0
- package/dist/client/_nuxt/elixir.dYoE9A9d.js +17 -0
- package/dist/client/_nuxt/elm.AR6G1sGv.js +1 -0
- package/dist/client/_nuxt/entry.lMqvQVuw.js +134 -0
- package/dist/client/_nuxt/entry.x0oA1XnQ.css +1 -0
- package/dist/client/_nuxt/erb.P8EuRJSc.js +1 -0
- package/dist/client/_nuxt/erlang._Br9gip-.js +1 -0
- package/dist/client/_nuxt/{error-404.3430ff98.js → error-404.9goSsGeb.js} +1 -1
- package/dist/client/_nuxt/error-404.DkXpI38i.css +1 -0
- package/dist/client/_nuxt/{error-500.17781b5f.js → error-500.ALNiIBK7.js} +1 -1
- package/dist/client/_nuxt/fish.k6NZEVUm.js +5 -0
- package/dist/client/_nuxt/fortran-fixed-form.3PunHBsT.js +1 -0
- package/dist/client/_nuxt/fortran-free-form.uz_LTDoO.js +1 -0
- package/dist/client/_nuxt/fsharp.R678YdIV.js +1 -0
- package/dist/client/_nuxt/gdresource.Fwi0K6XA.js +1 -0
- package/dist/client/_nuxt/gdscript.OhUZTpfD.js +44 -0
- package/dist/client/_nuxt/gdshader.6pjKCTQy.js +1 -0
- package/dist/client/_nuxt/gherkin.hgsyILVZ.js +1 -0
- package/dist/client/_nuxt/git-commit.RtAxFnK2.js +1 -0
- package/dist/client/_nuxt/git-rebase.0KF-V_b8.js +1 -0
- package/dist/client/_nuxt/github-dark-dimmed.yDYFqRVv.js +1 -0
- package/dist/client/_nuxt/github-dark.WrpzPehD.js +1 -0
- package/dist/client/_nuxt/github-light.QjB713Ax.js +1 -0
- package/dist/client/_nuxt/glimmer-js.-fTe8v8P.js +13 -0
- package/dist/client/_nuxt/glimmer-ts.iMdjtd1u.js +13 -0
- package/dist/client/_nuxt/glsl.yLv_V-GM.js +1 -0
- package/dist/client/_nuxt/gnuplot.fIlAWhXw.js +266 -0
- package/dist/client/_nuxt/go.uwBNuH-c.js +1 -0
- package/dist/client/_nuxt/graphql.aYTh5yPU.js +4 -0
- package/dist/client/_nuxt/groovy.Z1Lrhk2B.js +37 -0
- package/dist/client/_nuxt/hack.9pFjhnG2.js +86 -0
- package/dist/client/_nuxt/haml.20r8Wj9i.js +1 -0
- package/dist/client/_nuxt/handlebars.Z9TIkDUw.js +1 -0
- package/dist/client/_nuxt/haskell.HW0BBkRd.js +559 -0
- package/dist/client/_nuxt/hcl.M9siRbiv.js +1 -0
- package/dist/client/_nuxt/hjson.fLk7JbZa.js +50 -0
- package/dist/client/_nuxt/hlsl.Do_j-o-7.js +1 -0
- package/dist/client/_nuxt/html-derivative.3Qc0V0lp.js +1 -0
- package/dist/client/_nuxt/html.ZVb9jHrO.js +74 -0
- package/dist/client/_nuxt/http.67dI9VDY.js +1 -0
- package/dist/client/_nuxt/imba.guICF3zN.js +223 -0
- package/dist/client/_nuxt/ini.T6bxBy5-.js +1 -0
- package/dist/client/_nuxt/java.tY-NU26U.js +68 -0
- package/dist/client/_nuxt/javascript.JMZ6uy5M.js +699 -0
- package/dist/client/_nuxt/jinja.H2a5aKFq.js +1 -0
- package/dist/client/_nuxt/jison.hEN1Pilr.js +1 -0
- package/dist/client/_nuxt/json.xL80yL3n.js +25 -0
- package/dist/client/_nuxt/json5.NRuQoh_0.js +17 -0
- package/dist/client/_nuxt/jsonc.Bb1R3obU.js +25 -0
- package/dist/client/_nuxt/jsonl.Yjg0VwMG.js +25 -0
- package/dist/client/_nuxt/jsonnet.WK26vH-O.js +1 -0
- package/dist/client/_nuxt/jssm.eioTUq4-.js +1 -0
- package/dist/client/_nuxt/jsx.3LZ_BoLB.js +699 -0
- package/dist/client/_nuxt/julia.zN5MNt1V.js +9 -0
- package/dist/client/_nuxt/kotlin.1iwCeGA4.js +1 -0
- package/dist/client/_nuxt/kusto.UpRCclYC.js +1 -0
- package/dist/client/_nuxt/latex.hBr1lDpC.js +3 -0
- package/dist/client/_nuxt/less.Mq8TrjER.js +159 -0
- package/dist/client/_nuxt/light-plus.TzXGjDsL.js +1 -0
- package/dist/client/_nuxt/liquid.UuwAmqmc.js +14 -0
- package/dist/client/_nuxt/lisp.iIZdsWzX.js +1 -0
- package/dist/client/_nuxt/logo.WuHqTpFy.js +1 -0
- package/dist/client/_nuxt/lua.OGbZEs3U.js +1 -0
- package/dist/client/_nuxt/make.8zIAVqFD.js +1 -0
- package/dist/client/_nuxt/markdown.BZyvP-q3.js +129 -0
- package/dist/client/_nuxt/marko.gbQhFTQa.js +8 -0
- package/dist/client/_nuxt/material-theme-darker.e1lAwchJ.js +1 -0
- package/dist/client/_nuxt/material-theme-lighter.y77yPuAI.js +1 -0
- package/dist/client/_nuxt/material-theme-ocean.oIMAIpse.js +1 -0
- package/dist/client/_nuxt/material-theme-palenight.Z44VU5rQ.js +1 -0
- package/dist/client/_nuxt/material-theme.49YjOoAR.js +1 -0
- package/dist/client/_nuxt/matlab.LaB98_jd.js +70 -0
- package/dist/client/_nuxt/mdc.YjnAaITK.js +76 -0
- package/dist/client/_nuxt/mdx.VhCSg2DJ.js +1 -0
- package/dist/client/_nuxt/mermaid.WuNnVULj.js +1 -0
- package/dist/client/_nuxt/min-dark._Ja8ZF5C.js +1 -0
- package/dist/client/_nuxt/min-light.N1m_6E3S.js +1 -0
- package/dist/client/_nuxt/mojo.zLNDSfD9.js +519 -0
- package/dist/client/_nuxt/monokai.WLw4Glvg.js +1 -0
- package/dist/client/_nuxt/move.WSL1-Uy6.js +1 -0
- package/dist/client/_nuxt/narrat.KYi2rZr0.js +7 -0
- package/dist/client/_nuxt/nextflow.lYJjOZ_l.js +1 -0
- package/dist/client/_nuxt/nginx.CrBM8z2W.js +1 -0
- package/dist/client/_nuxt/night-owl.GWZK5Ce7.js +1 -0
- package/dist/client/_nuxt/nim.XEbgpvRN.js +1 -0
- package/dist/client/_nuxt/nix.z3u_V08Q.js +1 -0
- package/dist/client/_nuxt/nord.1NrVtx79.js +1 -0
- package/dist/client/_nuxt/nushell.Pupc41gF.js +1 -0
- package/dist/client/_nuxt/objective-c.Eci2Q5FN.js +109 -0
- package/dist/client/_nuxt/objective-cpp.nGsV46Zk.js +239 -0
- package/dist/client/_nuxt/ocaml.oQRvlYTD.js +1 -0
- package/dist/client/_nuxt/one-dark-pro.qlkgvdEn.js +1 -0
- package/dist/client/_nuxt/onig.mBJmD8D5.js +1 -0
- package/dist/client/_nuxt/pascal.aIRIFbih.js +1 -0
- package/dist/client/_nuxt/perl._x09KDDb.js +1 -0
- package/dist/client/_nuxt/php.2PDLwZAX.js +771 -0
- package/dist/client/_nuxt/plsql.vhhXsReo.js +1 -0
- package/dist/client/_nuxt/poimandres.oZrO-I17.js +1 -0
- package/dist/client/_nuxt/postcss.57yKeRpx.js +1 -0
- package/dist/client/_nuxt/powerquery.wBQvr9E-.js +1 -0
- package/dist/client/_nuxt/powershell.6Y_bsqLY.js +1 -0
- package/dist/client/_nuxt/prisma.fG9Ut-9i.js +1 -0
- package/dist/client/_nuxt/prolog.vggnm0Hd.js +1 -0
- package/dist/client/_nuxt/proto.yigfBmiL.js +1 -0
- package/dist/client/_nuxt/pug.ieZS468c.js +1 -0
- package/dist/client/_nuxt/puppet.NqXa_cO1.js +1 -0
- package/dist/client/_nuxt/purescript.NA5qsvV2.js +7 -0
- package/dist/client/_nuxt/python.V9Nu427R.js +518 -0
- package/dist/client/_nuxt/r.xMXDrvl2.js +1 -0
- package/dist/client/_nuxt/raku.NSWyGF40.js +1 -0
- package/dist/client/_nuxt/razor.i0YTcUHW.js +40 -0
- package/dist/client/_nuxt/red.sV5NnIRC.js +1 -0
- package/dist/client/_nuxt/reg.Dr-lXfN9.js +1 -0
- package/dist/client/_nuxt/rel.vATIbX_E.js +1 -0
- package/dist/client/_nuxt/riscv.L73dAZEB.js +13 -0
- package/dist/client/_nuxt/rose-pine-dawn.qPi4euik.js +1 -0
- package/dist/client/_nuxt/rose-pine-moon.Im6VgKOx.js +1 -0
- package/dist/client/_nuxt/rose-pine._tQyNI4L.js +1 -0
- package/dist/client/_nuxt/rst.3hexci4q.js +1 -0
- package/dist/client/_nuxt/ruby.HRYdKFAp.js +80 -0
- package/dist/client/_nuxt/rust.yNm59Dur.js +1 -0
- package/dist/client/_nuxt/sas.fTu4QUYF.js +1 -0
- package/dist/client/_nuxt/sass.URKSWxt9.js +2 -0
- package/dist/client/_nuxt/scala.JNsk4MRP.js +5 -0
- package/dist/client/_nuxt/scheme.S0VUhbaV.js +136 -0
- package/dist/client/_nuxt/scss.9u5wOjnF.js +90 -0
- package/dist/client/_nuxt/shaderlab.MYTNW71C.js +1 -0
- package/dist/client/_nuxt/shellscript.QP4ZqdYB.js +1 -0
- package/dist/client/_nuxt/shellsession.zflFzomD.js +1 -0
- package/dist/client/_nuxt/slack-dark.1ZggNzwg.js +1 -0
- package/dist/client/_nuxt/slack-ochin.IcMt0x71.js +1 -0
- package/dist/client/_nuxt/smalltalk.ymyryZ3T.js +1 -0
- package/dist/client/_nuxt/solarized-dark.3DcwRX9o.js +1 -0
- package/dist/client/_nuxt/solarized-light.iUVMuJ2F.js +1 -0
- package/dist/client/_nuxt/solidity.rGqtk2dD.js +1 -0
- package/dist/client/_nuxt/sparql.b6B4dWwT.js +1 -0
- package/dist/client/_nuxt/splunk.OYnOZZCZ.js +1 -0
- package/dist/client/_nuxt/sql.KWFjTZGI.js +21 -0
- package/dist/client/_nuxt/ssh-config.jdYjUr9x.js +1 -0
- package/dist/client/_nuxt/stata.cF_ucIcM.js +3 -0
- package/dist/client/_nuxt/stylus.sPHLw37c.js +15 -0
- package/dist/client/_nuxt/svelte.pLFP2FPE.js +1 -0
- package/dist/client/_nuxt/swift.YwiPyWKn.js +544 -0
- package/dist/client/_nuxt/synthwave-84.QD7ZGwpp.js +1 -0
- package/dist/client/_nuxt/system-verilog.gwJe9XJI.js +9 -0
- package/dist/client/_nuxt/tasl.IM3fg-4x.js +1 -0
- package/dist/client/_nuxt/tcl.h_zrCUh3.js +1 -0
- package/dist/client/_nuxt/terraform.Fe8Ioisv.js +1 -0
- package/dist/client/_nuxt/tex.uNByjuDB.js +1 -0
- package/dist/client/_nuxt/tokyo-night.3j08uV2M.js +1 -0
- package/dist/client/_nuxt/toml.p_xIKQcU.js +69 -0
- package/dist/client/_nuxt/tsx.7LxggtAE.js +699 -0
- package/dist/client/_nuxt/turtle.qvOLXpiq.js +1 -0
- package/dist/client/_nuxt/twig.tyrBq40F.js +40 -0
- package/dist/client/_nuxt/typescript.HpdcmTOD.js +666 -0
- package/dist/client/_nuxt/typst.t_XmezDA.js +10 -0
- package/dist/client/_nuxt/v.BcVLQyAr.js +1 -0
- package/dist/client/_nuxt/vanilla-picker.P0dws0ou.js +8 -0
- package/dist/client/_nuxt/vb.nfm3ZogP.js +1 -0
- package/dist/client/_nuxt/verilog.32GaFvLA.js +1 -0
- package/dist/client/_nuxt/vesper.aMfKacnm.js +1 -0
- package/dist/client/_nuxt/vhdl.BgfvI7C9.js +515 -0
- package/dist/client/_nuxt/viml.Ob-szSvk.js +1 -0
- package/dist/client/_nuxt/vitesse-black.uLlG6AUB.js +1 -0
- package/dist/client/_nuxt/vitesse-dark.5VceXvs6.js +1 -0
- package/dist/client/_nuxt/vitesse-light.HOMMxGxw.js +1 -0
- package/dist/client/_nuxt/vue-html.EeiA1ksk.js +1 -0
- package/dist/client/_nuxt/vue.HERpo4_W.js +6 -0
- package/dist/client/_nuxt/vyper.0ItMHLZu.js +575 -0
- package/dist/client/_nuxt/wasm.5qeU6UJI.js +1 -0
- package/dist/client/_nuxt/wenyan.gl1zQYA8.js +1 -0
- package/dist/client/_nuxt/wgsl.KpVp-DWl.js +1 -0
- package/dist/client/_nuxt/wolfram.K_QzNdW-.js +1 -0
- package/dist/client/_nuxt/xml.GygmfNh9.js +1 -0
- package/dist/client/_nuxt/xsl.TptR0G-3.js +1 -0
- package/dist/client/_nuxt/yaml.zytfnWoA.js +200 -0
- package/dist/client/_nuxt/zenscript.htRIWiQY.js +2 -0
- package/dist/client/_nuxt/zig.AVPlmtxo.js +1 -0
- package/dist/client/index.html +233 -15
- package/dist/module.d.mts +11 -3
- package/dist/module.d.ts +11 -3
- package/dist/module.json +2 -2
- package/dist/module.mjs +195 -122
- 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.mjs +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.mjs +36 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/playwright.d.ts +2 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/playwright.mjs +6 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.d.ts +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.mjs +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.mjs +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.mjs +8 -0
- package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm-fs.mjs +1 -1
- package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm.mjs +1 -1
- package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm-fs.mjs +1 -1
- package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm.mjs +1 -1
- package/dist/runtime/nitro/og-image/cache.d.ts +7 -0
- package/dist/runtime/{core/cache/htmlPayload.mjs → nitro/og-image/cache.mjs} +3 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/chromium/screenshot.mjs +1 -1
- package/dist/runtime/nitro/og-image/context.d.ts +5 -0
- package/dist/runtime/nitro/og-image/context.mjs +177 -0
- package/dist/runtime/nitro/og-image/instances.d.ts +2 -0
- package/dist/runtime/nitro/og-image/instances.mjs +10 -0
- package/dist/runtime/{core/font/fetch.d.ts → nitro/og-image/satori/font.d.ts} +1 -1
- package/dist/runtime/nitro/og-image/satori/font.mjs +29 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/instances.d.ts +0 -2
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/instances.mjs +2 -11
- package/dist/runtime/nitro/og-image/satori/plugins/classes.mjs +17 -0
- package/dist/runtime/nitro/og-image/satori/plugins/encoding.mjs +17 -0
- package/dist/runtime/nitro/og-image/satori/plugins/imageSrc.mjs +82 -0
- package/dist/runtime/{core/renderers/satori/index.mjs → nitro/og-image/satori/renderer.mjs} +28 -15
- package/dist/runtime/{core/html/applyEmojis.d.ts → nitro/og-image/satori/transforms/emojis.d.ts} +3 -1
- package/dist/runtime/{core/html/applyEmojis.mjs → nitro/og-image/satori/transforms/emojis.mjs} +6 -2
- package/dist/runtime/{core/html/applyInlineCss.d.ts → nitro/og-image/satori/transforms/inlineCss.d.ts} +1 -1
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.mjs +41 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/vnodes.mjs +9 -7
- package/dist/runtime/nitro/og-image/templates/html.d.ts +2 -0
- package/dist/runtime/{core/html/devIframeTemplate.mjs → nitro/og-image/templates/html.mjs} +17 -9
- package/dist/runtime/nitro/plugins/nuxt-content.mjs +7 -4
- package/dist/runtime/nitro/plugins/prerender.d.ts +1 -1
- package/dist/runtime/nitro/plugins/prerender.mjs +8 -16
- package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/debug.json.d.ts +1 -5
- package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/debug.json.mjs +1 -7
- package/dist/runtime/{server/routes/__og-image__/font-[name]-[weight].[extension].mjs → nitro/routes/font.mjs} +22 -3
- package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/image.mjs +9 -12
- package/dist/runtime/nitro/tsconfig.json +3 -0
- package/dist/runtime/{cache.d.ts → nitro/util/cache.d.ts} +1 -1
- package/dist/runtime/nitro/util/encoding.d.ts +3 -0
- package/dist/runtime/nitro/util/encoding.mjs +15 -0
- package/dist/runtime/nitro/util/kit.d.ts +6 -0
- package/dist/runtime/nitro/util/kit.mjs +32 -0
- package/dist/runtime/{components → nuxt/components}/OgImage/OgImage.d.ts +2 -2
- package/dist/runtime/{components → nuxt/components}/OgImage/OgImageScreenshot.d.ts +2 -2
- package/dist/runtime/{components → nuxt/components}/Templates/Community/NuxtSeo.vue +2 -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 → nuxt/composables}/defineOgImage.mjs +6 -11
- package/dist/runtime/{composables → nuxt/composables}/defineOgImageComponent.d.ts +1 -1
- package/dist/runtime/{composables → nuxt/composables}/defineOgImageScreenshot.d.ts +1 -1
- package/dist/runtime/nuxt/composables/mock.d.ts +0 -0
- package/dist/runtime/nuxt/composables/mock.mjs +6 -0
- package/dist/runtime/nuxt/plugins/og-image-canonical-urls.server.mjs +10 -3
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.mjs +1 -1
- package/dist/runtime/nuxt/utils.d.ts +2 -1
- package/dist/runtime/nuxt/utils.mjs +5 -3
- package/dist/runtime/{utils.pure.d.ts → pure.d.ts} +3 -0
- package/dist/runtime/{utils.pure.mjs → pure.mjs} +20 -3
- package/dist/runtime/{utils.d.ts → shared.d.ts} +1 -1
- package/dist/runtime/{utils.mjs → shared.mjs} +1 -1
- package/dist/runtime/types.d.ts +10 -3
- package/dist/types.d.mts +2 -2
- package/package.json +72 -47
- package/dist/client/_nuxt/IconCSS.921d8bb4.js +0 -1
- package/dist/client/_nuxt/IconCSS.f0b56d3e.css +0 -1
- package/dist/client/_nuxt/builds/meta/f3272063-a39c-4336-ba58-ab7e348c7608.json +0 -1
- package/dist/client/_nuxt/entry.81e38674.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/vanilla-picker-NKbIFE8h.23409a58.js +0 -8
- 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/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.mjs +0 -36
- 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/utils/resolveRendererContext.d.ts +0 -3
- package/dist/runtime/core/utils/resolveRendererContext.mjs +0 -96
- package/dist/runtime/nitro/utils.d.ts +0 -2
- package/dist/runtime/nitro/utils.mjs +0 -17
- 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/client/_nuxt/{error-500.69009e70.css → error-500.SLhS9LVu.css} +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 → nitro/og-image}/bindings/resvg/node.mjs +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm-fs.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/node.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/node.mjs +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 → nitro/og-image}/bindings/sharp/node.mjs +0 -0
- /package/dist/runtime/{core/renderers/chromium/index.d.ts → nitro/og-image/chromium/renderer.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/chromium/index.mjs → nitro/og-image/chromium/renderer.mjs} +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/chromium/screenshot.d.ts +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 → nitro/og-image}/satori/plugins/emojis.mjs +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 → nitro/og-image}/satori/plugins/flex.mjs +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/{core/renderers → nitro/og-image}/satori/plugins/unocss.mjs +0 -0
- /package/dist/runtime/{core/renderers/satori/index.d.ts → nitro/og-image/satori/renderer.d.ts} +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/utils.d.ts +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/utils.mjs +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/vnodes.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/{cache.mjs → nitro/util/cache.mjs} +0 -0
- /package/dist/runtime/{core/utils → nitro/util}/wasm.d.ts +0 -0
- /package/dist/runtime/{core/utils → nitro/util}/wasm.mjs +0 -0
- /package/dist/runtime/{components → nuxt/components}/OgImage/OgImage.mjs +0 -0
- /package/dist/runtime/{components → nuxt/components}/OgImage/OgImageScreenshot.mjs +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/BrandedLogo.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/Nuxt.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/Pergel.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 → nuxt/composables}/defineOgImageComponent.mjs +0 -0
- /package/dist/runtime/{composables → nuxt/composables}/defineOgImageScreenshot.mjs +0 -0
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
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, basename, join } 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';
|
|
11
15
|
import { onDevToolsInitialized, extendServerRpc } from '@nuxt/devtools-kit';
|
|
12
|
-
import { readFile, writeFile } from 'node:fs/promises';
|
|
13
16
|
import { createHash } from 'node:crypto';
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
const version = "3.0.0-rc.4";
|
|
17
|
+
import { Launcher } from 'chrome-launcher';
|
|
18
|
+
import { $fetch } from 'ofetch';
|
|
18
19
|
|
|
19
20
|
const autodetectableProviders = {
|
|
20
21
|
azure_static: "azure",
|
|
@@ -31,7 +32,8 @@ const autodetectableStaticProviders = {
|
|
|
31
32
|
};
|
|
32
33
|
const NodeRuntime = {
|
|
33
34
|
// node-server runtime
|
|
34
|
-
"chromium": "
|
|
35
|
+
"chromium": "on-demand",
|
|
36
|
+
// this gets changed build start
|
|
35
37
|
"css-inline": "node",
|
|
36
38
|
"resvg": "node",
|
|
37
39
|
"satori": "node",
|
|
@@ -56,22 +58,24 @@ const awsLambda = {
|
|
|
56
58
|
"sharp": false
|
|
57
59
|
// 0.33.x has issues
|
|
58
60
|
};
|
|
61
|
+
const WebContainer = {
|
|
62
|
+
"chromium": false,
|
|
63
|
+
"css-inline": "wasm-fs",
|
|
64
|
+
"resvg": "wasm-fs",
|
|
65
|
+
"satori": "wasm-fs",
|
|
66
|
+
"sharp": false
|
|
67
|
+
};
|
|
59
68
|
const RuntimeCompatibility = {
|
|
60
69
|
"nitro-dev": NodeRuntime,
|
|
61
70
|
"nitro-prerender": NodeRuntime,
|
|
62
71
|
"node-server": NodeRuntime,
|
|
63
|
-
"stackblitz":
|
|
64
|
-
|
|
65
|
-
"css-inline": false,
|
|
66
|
-
"resvg": "wasm-fs",
|
|
67
|
-
"satori": "wasm-fs",
|
|
68
|
-
"sharp": false
|
|
69
|
-
},
|
|
72
|
+
"stackblitz": WebContainer,
|
|
73
|
+
"codesandbox": WebContainer,
|
|
70
74
|
"aws-lambda": awsLambda,
|
|
71
75
|
"netlify": awsLambda,
|
|
72
76
|
"netlify-edge": {
|
|
73
77
|
"chromium": false,
|
|
74
|
-
"css-inline":
|
|
78
|
+
"css-inline": "wasm",
|
|
75
79
|
"resvg": "wasm",
|
|
76
80
|
"satori": "node",
|
|
77
81
|
"sharp": false,
|
|
@@ -87,6 +91,7 @@ const RuntimeCompatibility = {
|
|
|
87
91
|
"vercel-edge": {
|
|
88
92
|
"chromium": false,
|
|
89
93
|
"css-inline": false,
|
|
94
|
+
// size constraint (2mb is max)
|
|
90
95
|
"resvg": "wasm",
|
|
91
96
|
"satori": "node",
|
|
92
97
|
"sharp": false,
|
|
@@ -96,14 +101,15 @@ const RuntimeCompatibility = {
|
|
|
96
101
|
}
|
|
97
102
|
},
|
|
98
103
|
"cloudflare-pages": cloudflare,
|
|
99
|
-
"cloudflare": cloudflare
|
|
104
|
+
"cloudflare": cloudflare,
|
|
105
|
+
"cloudflare-module": cloudflare
|
|
100
106
|
};
|
|
101
107
|
function detectTarget(options = {}) {
|
|
102
108
|
return options?.static ? autodetectableStaticProviders[provider] : autodetectableProviders[provider];
|
|
103
109
|
}
|
|
104
110
|
function resolveNitroPreset(nitroConfig) {
|
|
105
|
-
if (provider === "stackblitz")
|
|
106
|
-
return
|
|
111
|
+
if (provider === "stackblitz" || provider === "codesandbox")
|
|
112
|
+
return provider;
|
|
107
113
|
let preset;
|
|
108
114
|
if (nitroConfig && nitroConfig?.preset)
|
|
109
115
|
preset = nitroConfig.preset;
|
|
@@ -123,16 +129,18 @@ function applyNitroPresetCompatibility(nitroConfig, options) {
|
|
|
123
129
|
const { resolve } = options;
|
|
124
130
|
const satoriEnabled = typeof options.compatibility?.satori !== "undefined" ? !!options.compatibility.satori : !!compatibility.satori;
|
|
125
131
|
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/
|
|
132
|
+
nitroConfig.alias["#nuxt-og-image/renderers/satori"] = satoriEnabled ? resolve("./runtime/nitro/og-image/satori/renderer") : "unenv/runtime/mock/empty";
|
|
133
|
+
nitroConfig.alias["#nuxt-og-image/renderers/chromium"] = chromiumEnabled ? resolve("./runtime/nitro/og-image/chromium/renderer") : "unenv/runtime/mock/empty";
|
|
128
134
|
const resolvedCompatibility = {};
|
|
129
135
|
function applyBinding(key) {
|
|
130
136
|
let binding = options.compatibility?.[key];
|
|
131
137
|
if (typeof binding === "undefined")
|
|
132
138
|
binding = compatibility[key];
|
|
139
|
+
if (key === "chromium" && binding === "node")
|
|
140
|
+
binding = "playwright";
|
|
133
141
|
resolvedCompatibility[key] = binding;
|
|
134
142
|
return {
|
|
135
|
-
[`#nuxt-og-image/bindings/${key}`]: binding === false ? "unenv/runtime/mock/empty" : resolve(`./runtime/
|
|
143
|
+
[`#nuxt-og-image/bindings/${key}`]: binding === false ? "unenv/runtime/mock/empty" : resolve(`./runtime/nitro/og-image/bindings/${key}/${binding}`)
|
|
136
144
|
};
|
|
137
145
|
}
|
|
138
146
|
nitroConfig.alias = defu(
|
|
@@ -204,6 +212,15 @@ export {}
|
|
|
204
212
|
nuxt.hooks.hook("prepare:types", ({ references }) => {
|
|
205
213
|
references.push({ path: resolve(nuxt.options.buildDir, `module/${module}.d.ts`) });
|
|
206
214
|
});
|
|
215
|
+
nuxt.hooks.hook("nitro:config", (config) => {
|
|
216
|
+
config.typescript = config.typescript || {};
|
|
217
|
+
config.typescript.tsConfig = config.typescript.tsConfig || {};
|
|
218
|
+
config.typescript.tsConfig.include = config.typescript.tsConfig.include || [];
|
|
219
|
+
config.typescript.tsConfig.include.push(`./module/${module}.d.ts`);
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
function isNuxtGenerate(nuxt = useNuxt()) {
|
|
223
|
+
return nuxt.options._generate || nuxt.options.nitro.static || nuxt.options.nitro.preset === "static";
|
|
207
224
|
}
|
|
208
225
|
|
|
209
226
|
const DEVTOOLS_UI_ROUTE = "/__nuxt-og-image";
|
|
@@ -295,7 +312,7 @@ function setupGenerateHandler(options, resolve, nuxt = useNuxt()) {
|
|
|
295
312
|
function setupPrerenderHandler(options, resolve, nuxt = useNuxt()) {
|
|
296
313
|
nuxt.hooks.hook("nitro:init", async (nitro) => {
|
|
297
314
|
nitro.hooks.hook("prerender:config", async (nitroConfig) => {
|
|
298
|
-
applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility
|
|
315
|
+
applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility?.prerender, resolve });
|
|
299
316
|
nitroConfig.wasm = nitroConfig.wasm || {};
|
|
300
317
|
nitroConfig.wasm.esmImport = false;
|
|
301
318
|
const prerenderingPages = (nuxt.options.nitro.prerender?.routes || []).some((r) => r && (!r.includes(".") || r.includes("*")));
|
|
@@ -327,14 +344,20 @@ async function setupBuildHandler(config, resolve, nuxt = useNuxt()) {
|
|
|
327
344
|
return;
|
|
328
345
|
const configuredEntry = nitro.options.rollupConfig?.output.entryFileNames;
|
|
329
346
|
let serverEntry = resolve(_nitro.options.output.serverDir, typeof configuredEntry === "string" ? configuredEntry : "index.mjs");
|
|
330
|
-
|
|
331
|
-
|
|
347
|
+
const isCloudflarePagesOrModule = target === "cloudflare-pages" || target === "cloudflare-module";
|
|
348
|
+
if (isCloudflarePagesOrModule) {
|
|
349
|
+
serverEntry = [
|
|
350
|
+
resolve(dirname(serverEntry), "./chunks/wasm.mjs"),
|
|
351
|
+
resolve(dirname(serverEntry), "./chunks/_/wasm.mjs")
|
|
352
|
+
].filter(existsSync)[0] || serverEntry;
|
|
353
|
+
}
|
|
332
354
|
const contents = await readFile(serverEntry, "utf-8");
|
|
333
355
|
const resvgHash = sha1(await readFile(await resolvePath("@resvg/resvg-wasm/index_bg.wasm")));
|
|
334
356
|
const yogaHash = sha1(await readFile(await resolvePath("yoga-wasm-web/dist/yoga.wasm")));
|
|
357
|
+
const cssInlineHash = sha1(await readFile(await resolvePath("@css-inline/css-inline-wasm/index_bg.wasm")));
|
|
335
358
|
const postfix = target === "vercel-edge" ? "?module" : "";
|
|
336
|
-
const path =
|
|
337
|
-
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" });
|
|
359
|
+
const path = isCloudflarePagesOrModule ? `../wasm/` : `./wasm/`;
|
|
360
|
+
await writeFile(serverEntry, contents.replaceAll('"@resvg/resvg-wasm/index_bg.wasm"', `"${path}index_bg-${resvgHash}.wasm${postfix}"`).replaceAll('"@css-inline/css-inline-wasm/index_bg.wasm"', `"${path}index_bg-${cssInlineHash}.wasm${postfix}"`).replaceAll('"yoga-wasm-web/dist/yoga.wasm"', `"${path}yoga-${yogaHash}.wasm${postfix}"`), { encoding: "utf-8" });
|
|
338
361
|
});
|
|
339
362
|
});
|
|
340
363
|
}
|
|
@@ -342,20 +365,46 @@ function sha1(source) {
|
|
|
342
365
|
return createHash("sha1").update(source).digest("hex").slice(0, 16);
|
|
343
366
|
}
|
|
344
367
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
368
|
+
const isUndefinedOrTruthy = (v) => typeof v === "undefined" || v !== false;
|
|
369
|
+
function checkLocalChrome() {
|
|
370
|
+
if (isCI)
|
|
371
|
+
return false;
|
|
372
|
+
let hasChromeLocally = false;
|
|
373
|
+
try {
|
|
374
|
+
hasChromeLocally = !!Launcher.getFirstInstallation();
|
|
375
|
+
} catch {
|
|
376
|
+
}
|
|
377
|
+
return hasChromeLocally;
|
|
378
|
+
}
|
|
379
|
+
async function checkPlaywrightDependency() {
|
|
380
|
+
return !!await tryResolveModule("playwright");
|
|
381
|
+
}
|
|
382
|
+
async function downloadFont(font, storage, mirror) {
|
|
383
|
+
const { name, weight } = font;
|
|
384
|
+
const key = `${name}-${weight}.ttf.base64`;
|
|
385
|
+
if (await storage.hasItem(key))
|
|
386
|
+
return true;
|
|
387
|
+
const host = typeof mirror === "undefined" ? "fonts.googleapis.com" : mirror === true ? "fonts.font.im" : mirror;
|
|
388
|
+
const css = await $fetch(`https://${host}/css2?family=${name}:wght@${weight}`, {
|
|
389
|
+
timeout: 10 * 1e3,
|
|
390
|
+
// 10 second timeout
|
|
391
|
+
headers: {
|
|
392
|
+
// Make sure it returns TTF.
|
|
393
|
+
"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"
|
|
394
|
+
}
|
|
395
|
+
}).catch(() => {
|
|
396
|
+
return false;
|
|
357
397
|
});
|
|
358
|
-
|
|
398
|
+
if (!css)
|
|
399
|
+
return false;
|
|
400
|
+
const ttfResource = css.match(/src: url\((.+)\) format\('(opentype|truetype)'\)/);
|
|
401
|
+
if (ttfResource?.[1]) {
|
|
402
|
+
const buf = await $fetch(ttfResource[1], { baseURL: host, responseType: "arrayBuffer" });
|
|
403
|
+
const base64Font = Buffer.from(buf).toString("base64");
|
|
404
|
+
await storage.setItem(key, base64Font);
|
|
405
|
+
return true;
|
|
406
|
+
}
|
|
407
|
+
return false;
|
|
359
408
|
}
|
|
360
409
|
|
|
361
410
|
function normaliseFontInput(fonts) {
|
|
@@ -365,7 +414,7 @@ function normaliseFontInput(fonts) {
|
|
|
365
414
|
return {
|
|
366
415
|
cacheKey: f,
|
|
367
416
|
name,
|
|
368
|
-
weight: weight ||
|
|
417
|
+
weight: weight || 400,
|
|
369
418
|
style: "normal",
|
|
370
419
|
path: void 0
|
|
371
420
|
};
|
|
@@ -383,7 +432,7 @@ const module = defineNuxtModule({
|
|
|
383
432
|
meta: {
|
|
384
433
|
name: "nuxt-og-image",
|
|
385
434
|
compatibility: {
|
|
386
|
-
nuxt: "^3.
|
|
435
|
+
nuxt: "^3.9.0",
|
|
387
436
|
bridge: false
|
|
388
437
|
},
|
|
389
438
|
configKey: "ogImage"
|
|
@@ -395,6 +444,7 @@ const module = defineNuxtModule({
|
|
|
395
444
|
emojis: "noto",
|
|
396
445
|
renderer: "satori",
|
|
397
446
|
component: "NuxtSeo",
|
|
447
|
+
extension: "png",
|
|
398
448
|
width: 1200,
|
|
399
449
|
height: 600,
|
|
400
450
|
// default is to cache the image for 3 day (72 hours)
|
|
@@ -407,23 +457,27 @@ const module = defineNuxtModule({
|
|
|
407
457
|
};
|
|
408
458
|
},
|
|
409
459
|
async setup(config, nuxt) {
|
|
410
|
-
const
|
|
460
|
+
const { resolve } = createResolver(import.meta.url);
|
|
461
|
+
const { name, version } = await readPackageJSON(resolve("../package.json"));
|
|
462
|
+
const logger = useLogger(name);
|
|
411
463
|
logger.level = config.debug || nuxt.options.debug ? 4 : 3;
|
|
412
464
|
if (config.enabled === false) {
|
|
413
465
|
logger.debug("The module is disabled, skipping setup.");
|
|
466
|
+
["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((name2) => {
|
|
467
|
+
addImports({ name: name2, from: resolve(`./runtime/nuxt/composables/mock`) });
|
|
468
|
+
});
|
|
414
469
|
return;
|
|
415
470
|
}
|
|
416
471
|
if (config.enabled && !nuxt.options.ssr) {
|
|
417
472
|
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 }`).");
|
|
418
473
|
return;
|
|
419
474
|
}
|
|
420
|
-
|
|
475
|
+
nuxt.options.build.transpile.push(resolve("./runtime"));
|
|
421
476
|
const preset = resolveNitroPreset(nuxt.options.nitro);
|
|
422
477
|
const targetCompatibility = getPresetNitroPresetCompatibility(preset);
|
|
423
478
|
const hasSharpDependency = !!await tryResolveModule("sharp");
|
|
424
479
|
const userConfiguredExtension = config.defaults.extension;
|
|
425
480
|
const hasConfiguredJpegs = userConfiguredExtension && ["jpeg", "jpg"].includes(userConfiguredExtension);
|
|
426
|
-
config.defaults.extension = userConfiguredExtension || (hasSharpDependency && targetCompatibility.sharp ? "jpg" : "png");
|
|
427
481
|
if (hasConfiguredJpegs && config.defaults.renderer !== "chromium") {
|
|
428
482
|
if (hasSharpDependency && !targetCompatibility.sharp) {
|
|
429
483
|
logger.warn(`Rendering JPEGs requires sharp which does not work with ${preset}. Images will be rendered as PNG at runtime.`);
|
|
@@ -442,32 +496,32 @@ const module = defineNuxtModule({
|
|
|
442
496
|
prerender: { sharp: false }
|
|
443
497
|
});
|
|
444
498
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
prerender: { chromium: "node" }
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
} else if (!hasChromeLocally && nuxt.options.dev && config.compatibility?.dev?.chromium === "node") {
|
|
469
|
-
await ensureChromium(logger);
|
|
499
|
+
const hasChromeLocally = checkLocalChrome();
|
|
500
|
+
const hasPlaywrightDependency = await checkPlaywrightDependency();
|
|
501
|
+
const chromeCompatibilityFlags = {
|
|
502
|
+
prerender: config.compatibility?.prerender?.chromium,
|
|
503
|
+
dev: config.compatibility?.dev?.chromium,
|
|
504
|
+
runtime: config.compatibility?.runtime?.chromium
|
|
505
|
+
};
|
|
506
|
+
const chromiumBinding = {
|
|
507
|
+
dev: null,
|
|
508
|
+
prerender: null,
|
|
509
|
+
runtime: null
|
|
510
|
+
};
|
|
511
|
+
if (nuxt.options.dev) {
|
|
512
|
+
if (isUndefinedOrTruthy(chromeCompatibilityFlags.dev))
|
|
513
|
+
chromiumBinding.dev = hasChromeLocally ? "chrome-launcher" : hasPlaywrightDependency ? "playwright" : "on-demand";
|
|
514
|
+
} else {
|
|
515
|
+
if (isUndefinedOrTruthy(chromeCompatibilityFlags.prerender))
|
|
516
|
+
chromiumBinding.prerender = hasChromeLocally ? "chrome-launcher" : hasPlaywrightDependency ? "playwright" : "on-demand";
|
|
517
|
+
if (isUndefinedOrTruthy(chromeCompatibilityFlags.runtime))
|
|
518
|
+
chromiumBinding.runtime = hasPlaywrightDependency ? "playwright" : null;
|
|
470
519
|
}
|
|
520
|
+
config.compatibility = defu(config.compatibility, {
|
|
521
|
+
runtime: { chromium: chromiumBinding.runtime },
|
|
522
|
+
dev: { chromium: chromiumBinding.dev },
|
|
523
|
+
prerender: { chromium: chromiumBinding.prerender }
|
|
524
|
+
});
|
|
471
525
|
await import('@resvg/resvg-js').catch(() => {
|
|
472
526
|
logger.warn("ReSVG is missing dependencies for environment. Falling back to WASM version, this may slow down PNG rendering.");
|
|
473
527
|
config.compatibility = defu(config.compatibility, {
|
|
@@ -483,67 +537,80 @@ const module = defineNuxtModule({
|
|
|
483
537
|
await installNuxtSiteConfig();
|
|
484
538
|
if (hasNuxtModule("@nuxt/content"))
|
|
485
539
|
addServerPlugin(resolve("./runtime/nitro/plugins/nuxt-content"));
|
|
486
|
-
if (!config.fonts.length)
|
|
487
|
-
config.fonts = [
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
540
|
+
if (!config.fonts.length) {
|
|
541
|
+
config.fonts = [
|
|
542
|
+
{ name: "Inter", weight: 400, path: resolve("./runtime/assets/Inter-400.ttf.base64"), absolutePath: true },
|
|
543
|
+
{ name: "Inter", weight: 700, path: resolve("./runtime/assets/Inter-700.ttf.base64"), absolutePath: true }
|
|
544
|
+
];
|
|
545
|
+
}
|
|
546
|
+
const serverFontsDir = resolve(nuxt.options.buildDir, "cache", `nuxt-og-image@${version}`, "_fonts");
|
|
547
|
+
const fontStorage = createStorage({
|
|
548
|
+
driver: fsDriver({
|
|
549
|
+
base: serverFontsDir
|
|
550
|
+
})
|
|
551
|
+
});
|
|
552
|
+
config.fonts = (await Promise.all(normaliseFontInput(config.fonts).map(async (f) => {
|
|
553
|
+
if (!f.key && !f.path) {
|
|
554
|
+
if (preset === "stackblitz") {
|
|
555
|
+
logger.warn(`The ${f.name}:${f.weight} font was skipped because remote fonts are not available in StackBlitz, please use a local font.`);
|
|
492
556
|
return false;
|
|
493
557
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
if (typeof f === "string" && f.startsWith("Inter:")) {
|
|
500
|
-
const [_, weight] = f.split(":");
|
|
501
|
-
return {
|
|
502
|
-
name: "Inter",
|
|
503
|
-
weight,
|
|
504
|
-
// nuxt server assets
|
|
505
|
-
key: `nuxt-og-image:fonts:inter-latin-ext-${weight}-normal.woff`
|
|
506
|
-
};
|
|
558
|
+
if (await downloadFont(f, fontStorage, config.googleFontMirror)) {
|
|
559
|
+
f.key = `nuxt-og-image:fonts:${f.name}-${f.weight}.ttf.base64`;
|
|
560
|
+
} else {
|
|
561
|
+
logger.warn(`Failed to download font ${f.name}:${f.weight}. You may be offline or behind a firewall blocking Google. Consider setting \`googleFontMirror: true\`.`);
|
|
562
|
+
return false;
|
|
507
563
|
}
|
|
508
|
-
|
|
509
|
-
|
|
564
|
+
} else if (f.path) {
|
|
565
|
+
const extension = basename(f.path.replace(".base64", "")).split(".").pop();
|
|
566
|
+
if (!["woff", "ttf", "otf"].includes(extension)) {
|
|
567
|
+
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.`);
|
|
510
568
|
return false;
|
|
511
569
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
570
|
+
if (!f.absolutePath)
|
|
571
|
+
f.path = join(nuxt.options.rootDir, nuxt.options.dir.public, withoutLeadingSlash(f.path));
|
|
572
|
+
if (!existsSync(f.path)) {
|
|
573
|
+
logger.warn(`The ${f.name}:${f.weight} font was skipped because the file does not exist at path ${f.path}.`);
|
|
574
|
+
return false;
|
|
575
|
+
}
|
|
576
|
+
const fontData = await readFile(f.path, f.path.endsWith(".base64") ? "utf-8" : "base64");
|
|
577
|
+
f.key = `nuxt-og-image:fonts:${f.name}-${f.weight}.${extension}.base64`;
|
|
578
|
+
await fontStorage.setItem(`${f.name}-${f.weight}.${extension}.base64`, fontData);
|
|
579
|
+
delete f.path;
|
|
580
|
+
delete f.absolutePath;
|
|
581
|
+
}
|
|
582
|
+
return f;
|
|
583
|
+
}))).filter(Boolean);
|
|
584
|
+
nuxt.options.nitro.serverAssets = nuxt.options.nitro.serverAssets || [];
|
|
585
|
+
nuxt.options.nitro.serverAssets.push({ baseName: "nuxt-og-image:fonts", dir: serverFontsDir });
|
|
519
586
|
nuxt.options.experimental.componentIslands = true;
|
|
520
587
|
addServerHandler({
|
|
521
588
|
lazy: true,
|
|
522
589
|
route: "/__og-image__/font/**",
|
|
523
|
-
handler: resolve("./runtime/
|
|
590
|
+
handler: resolve("./runtime/nitro/routes/font")
|
|
524
591
|
});
|
|
525
592
|
if (config.debug || nuxt.options.dev) {
|
|
526
593
|
addServerHandler({
|
|
527
594
|
lazy: true,
|
|
528
595
|
route: "/__og-image__/debug.json",
|
|
529
|
-
handler: resolve("./runtime/
|
|
596
|
+
handler: resolve("./runtime/nitro/routes/debug.json")
|
|
530
597
|
});
|
|
531
598
|
}
|
|
532
599
|
addServerHandler({
|
|
533
600
|
lazy: true,
|
|
534
601
|
route: "/__og-image__/image/**",
|
|
535
|
-
handler: resolve("./runtime/
|
|
602
|
+
handler: resolve("./runtime/nitro/routes/image")
|
|
536
603
|
});
|
|
537
604
|
nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"] = [];
|
|
538
|
-
["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((
|
|
605
|
+
["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((name2) => {
|
|
539
606
|
addImports({
|
|
540
|
-
name,
|
|
541
|
-
from: resolve(`./runtime/composables/${
|
|
607
|
+
name: name2,
|
|
608
|
+
from: resolve(`./runtime/nuxt/composables/${name2}`)
|
|
542
609
|
});
|
|
543
|
-
nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"].push(
|
|
610
|
+
nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"].push(name2);
|
|
544
611
|
});
|
|
545
612
|
await addComponentsDir({
|
|
546
|
-
path: resolve("./runtime/components/Templates/Community"),
|
|
613
|
+
path: resolve("./runtime/nuxt/components/Templates/Community"),
|
|
547
614
|
island: true,
|
|
548
615
|
watch: true
|
|
549
616
|
});
|
|
@@ -551,10 +618,10 @@ const module = defineNuxtModule({
|
|
|
551
618
|
// new
|
|
552
619
|
"OgImage",
|
|
553
620
|
"OgImageScreenshot"
|
|
554
|
-
].forEach((
|
|
621
|
+
].forEach((name2) => {
|
|
555
622
|
addComponent({
|
|
556
|
-
name,
|
|
557
|
-
filePath: resolve(`./runtime/components/OgImage/${
|
|
623
|
+
name: name2,
|
|
624
|
+
filePath: resolve(`./runtime/nuxt/components/OgImage/${name2}`),
|
|
558
625
|
...config.componentOptions
|
|
559
626
|
});
|
|
560
627
|
});
|
|
@@ -569,13 +636,13 @@ const module = defineNuxtModule({
|
|
|
569
636
|
if (component.pascalName.startsWith(dir) || component.kebabName.startsWith(dir) || component.shortPath.includes(`/${dir}/`))
|
|
570
637
|
valid = true;
|
|
571
638
|
});
|
|
572
|
-
if (component.filePath.includes(resolve("./runtime/components/Templates")))
|
|
639
|
+
if (component.filePath.includes(resolve("./runtime/nuxt/components/Templates")))
|
|
573
640
|
valid = true;
|
|
574
641
|
if (valid && fs.existsSync(component.filePath)) {
|
|
575
642
|
component.island = true;
|
|
576
643
|
component.mode = "server";
|
|
577
644
|
let category = "app";
|
|
578
|
-
if (component.filePath.includes(resolve("./runtime/components/Templates/Community")))
|
|
645
|
+
if (component.filePath.includes(resolve("./runtime/nuxt/components/Templates/Community")))
|
|
579
646
|
category = "community";
|
|
580
647
|
const componentFile = fs.readFileSync(component.filePath, "utf-8");
|
|
581
648
|
const credits = componentFile.split("\n").find((line) => line.startsWith(" * @credits"))?.replace("* @credits", "").trim();
|
|
@@ -603,9 +670,9 @@ const module = defineNuxtModule({
|
|
|
603
670
|
nuxt.options.nitro.virtual["#nuxt-og-image/component-names.mjs"] = () => {
|
|
604
671
|
return `export const componentNames = ${JSON.stringify(ogImageComponentCtx.components)}`;
|
|
605
672
|
};
|
|
606
|
-
let unoCssConfig = {
|
|
673
|
+
let unoCssConfig = {};
|
|
607
674
|
nuxt.hook("tailwindcss:config", (tailwindConfig) => {
|
|
608
|
-
unoCssConfig = defu(tailwindConfig.theme
|
|
675
|
+
unoCssConfig = defu(tailwindConfig.theme?.extend, { ...tailwindConfig.theme, extend: void 0 });
|
|
609
676
|
});
|
|
610
677
|
nuxt.hook("unocss:config", (_unoCssConfig) => {
|
|
611
678
|
unoCssConfig = { ..._unoCssConfig.theme };
|
|
@@ -616,7 +683,10 @@ const module = defineNuxtModule({
|
|
|
616
683
|
extendTypes("nuxt-og-image", ({ typesPath }) => {
|
|
617
684
|
const componentImports = ogImageComponentCtx.components.map((component) => {
|
|
618
685
|
const relativeComponentPath = relative(resolve(nuxt.options.rootDir, nuxt.options.buildDir, "module"), component.path);
|
|
619
|
-
|
|
686
|
+
const name2 = config.componentDirs.sort((a, b) => b.length - a.length).reduce((name3, dir) => {
|
|
687
|
+
return name3.replace(new RegExp(`^${dir}`), "");
|
|
688
|
+
}, component.pascalName);
|
|
689
|
+
return ` '${name2}': typeof import('${relativeComponentPath}')['default']`;
|
|
620
690
|
}).join("\n");
|
|
621
691
|
return `
|
|
622
692
|
declare module 'nitropack' {
|
|
@@ -637,6 +707,9 @@ declare module '#nuxt-og-image/components' {
|
|
|
637
707
|
${componentImports}
|
|
638
708
|
}
|
|
639
709
|
}
|
|
710
|
+
declare module '#nuxt-og-image/unocss-config' {
|
|
711
|
+
export type theme = any
|
|
712
|
+
}
|
|
640
713
|
`;
|
|
641
714
|
});
|
|
642
715
|
const cacheEnabled = typeof config.runtimeCacheStorage !== "undefined" && config.runtimeCacheStorage !== false;
|
|
@@ -650,12 +723,10 @@ ${componentImports}
|
|
|
650
723
|
}
|
|
651
724
|
nuxt.hooks.hook("modules:done", async () => {
|
|
652
725
|
const normalisedFonts = normaliseFontInput(config.fonts);
|
|
653
|
-
if (!
|
|
726
|
+
if (!isNuxtGenerate() && nuxt.options.build) {
|
|
727
|
+
nuxt.options.nitro = nuxt.options.nitro || {};
|
|
654
728
|
nuxt.options.nitro.prerender = nuxt.options.nitro.prerender || {};
|
|
655
729
|
nuxt.options.nitro.prerender.routes = nuxt.options.nitro.prerender.routes || [];
|
|
656
|
-
normalisedFonts.filter((f) => !f.path && !f.key).forEach(({ name, weight }) => {
|
|
657
|
-
nuxt.options.nitro.prerender.routes.push(`/__og-image__/font/${name}/${weight}.ttf`);
|
|
658
|
-
});
|
|
659
730
|
}
|
|
660
731
|
const hasColorModeModule = hasNuxtModule("@nuxtjs/color-mode");
|
|
661
732
|
const colorModeOptions = hasColorModeModule ? await getNuxtModuleOptions("@nuxtjs/color-mode") : {};
|
|
@@ -677,7 +748,9 @@ ${componentImports}
|
|
|
677
748
|
// convert the fonts to uniform type to fix ts issue
|
|
678
749
|
fonts: normalisedFonts,
|
|
679
750
|
hasNuxtIcon: hasNuxtModule("nuxt-icon"),
|
|
680
|
-
colorPreference
|
|
751
|
+
colorPreference,
|
|
752
|
+
// @ts-expect-error runtime type
|
|
753
|
+
isNuxtContentDocumentDriven: !!nuxt.options.content?.documentDriven
|
|
681
754
|
};
|
|
682
755
|
nuxt.hooks.callHook("nuxt-og-image:runtime-config", runtimeConfig);
|
|
683
756
|
nuxt.options.runtimeConfig["nuxt-og-image"] = runtimeConfig;
|
|
@@ -685,7 +758,7 @@ ${componentImports}
|
|
|
685
758
|
if (nuxt.options.dev) {
|
|
686
759
|
setupDevHandler(config, resolve);
|
|
687
760
|
setupDevToolsUI(config, resolve);
|
|
688
|
-
} else if (
|
|
761
|
+
} else if (isNuxtGenerate()) {
|
|
689
762
|
setupGenerateHandler(config, resolve);
|
|
690
763
|
} else if (nuxt.options.build) {
|
|
691
764
|
await setupBuildHandler(config, resolve);
|