nuxt-og-image 3.0.0-rc.4 → 3.0.0-rc.40
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.NC-oxnpY.css +1 -0
- package/dist/client/_nuxt/IconCSS.NJFIBlcf.js +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/6c43a4bf-3a94-4d1d-b019-d8354885743d.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.fFwg0pA-.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.4msf9X3t.js} +1 -1
- package/dist/client/_nuxt/error-404.DkXpI38i.css +1 -0
- package/dist/client/_nuxt/{error-500.17781b5f.js → error-500.arg9BSKV.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 +190 -121
- 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,16 @@ 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
|
-
|
|
347
|
+
const isCloudflarePagesOrModule = target === "cloudflare-pages" || target === "cloudflare-module";
|
|
348
|
+
if (isCloudflarePagesOrModule)
|
|
331
349
|
serverEntry = resolve(dirname(serverEntry), "./chunks/wasm.mjs");
|
|
332
350
|
const contents = await readFile(serverEntry, "utf-8");
|
|
333
351
|
const resvgHash = sha1(await readFile(await resolvePath("@resvg/resvg-wasm/index_bg.wasm")));
|
|
334
352
|
const yogaHash = sha1(await readFile(await resolvePath("yoga-wasm-web/dist/yoga.wasm")));
|
|
353
|
+
const cssInlineHash = sha1(await readFile(await resolvePath("@css-inline/css-inline-wasm/index_bg.wasm")));
|
|
335
354
|
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" });
|
|
355
|
+
const path = isCloudflarePagesOrModule ? `../wasm/` : `./wasm/`;
|
|
356
|
+
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
357
|
});
|
|
339
358
|
});
|
|
340
359
|
}
|
|
@@ -342,20 +361,46 @@ function sha1(source) {
|
|
|
342
361
|
return createHash("sha1").update(source).digest("hex").slice(0, 16);
|
|
343
362
|
}
|
|
344
363
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
364
|
+
const isUndefinedOrTruthy = (v) => typeof v === "undefined" || v !== false;
|
|
365
|
+
function checkLocalChrome() {
|
|
366
|
+
if (isCI)
|
|
367
|
+
return false;
|
|
368
|
+
let hasChromeLocally = false;
|
|
369
|
+
try {
|
|
370
|
+
hasChromeLocally = !!Launcher.getFirstInstallation();
|
|
371
|
+
} catch {
|
|
372
|
+
}
|
|
373
|
+
return hasChromeLocally;
|
|
374
|
+
}
|
|
375
|
+
async function checkPlaywrightDependency() {
|
|
376
|
+
return !!await tryResolveModule("playwright");
|
|
377
|
+
}
|
|
378
|
+
async function downloadFont(font, storage, mirror) {
|
|
379
|
+
const { name, weight } = font;
|
|
380
|
+
const key = `${name}-${weight}.ttf.base64`;
|
|
381
|
+
if (await storage.hasItem(key))
|
|
382
|
+
return true;
|
|
383
|
+
const host = typeof mirror === "undefined" ? "fonts.googleapis.com" : mirror === true ? "fonts.font.im" : mirror;
|
|
384
|
+
const css = await $fetch(`https://${host}/css2?family=${name}:wght@${weight}`, {
|
|
385
|
+
timeout: 10 * 1e3,
|
|
386
|
+
// 10 second timeout
|
|
387
|
+
headers: {
|
|
388
|
+
// Make sure it returns TTF.
|
|
389
|
+
"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"
|
|
390
|
+
}
|
|
391
|
+
}).catch(() => {
|
|
392
|
+
return false;
|
|
357
393
|
});
|
|
358
|
-
|
|
394
|
+
if (!css)
|
|
395
|
+
return false;
|
|
396
|
+
const ttfResource = css.match(/src: url\((.+)\) format\('(opentype|truetype)'\)/);
|
|
397
|
+
if (ttfResource?.[1]) {
|
|
398
|
+
const buf = await $fetch(ttfResource[1], { baseURL: host, responseType: "arrayBuffer" });
|
|
399
|
+
const base64Font = Buffer.from(buf).toString("base64");
|
|
400
|
+
await storage.setItem(key, base64Font);
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
return false;
|
|
359
404
|
}
|
|
360
405
|
|
|
361
406
|
function normaliseFontInput(fonts) {
|
|
@@ -365,7 +410,7 @@ function normaliseFontInput(fonts) {
|
|
|
365
410
|
return {
|
|
366
411
|
cacheKey: f,
|
|
367
412
|
name,
|
|
368
|
-
weight: weight ||
|
|
413
|
+
weight: weight || 400,
|
|
369
414
|
style: "normal",
|
|
370
415
|
path: void 0
|
|
371
416
|
};
|
|
@@ -383,7 +428,7 @@ const module = defineNuxtModule({
|
|
|
383
428
|
meta: {
|
|
384
429
|
name: "nuxt-og-image",
|
|
385
430
|
compatibility: {
|
|
386
|
-
nuxt: "^3.
|
|
431
|
+
nuxt: "^3.9.0",
|
|
387
432
|
bridge: false
|
|
388
433
|
},
|
|
389
434
|
configKey: "ogImage"
|
|
@@ -395,6 +440,7 @@ const module = defineNuxtModule({
|
|
|
395
440
|
emojis: "noto",
|
|
396
441
|
renderer: "satori",
|
|
397
442
|
component: "NuxtSeo",
|
|
443
|
+
extension: "png",
|
|
398
444
|
width: 1200,
|
|
399
445
|
height: 600,
|
|
400
446
|
// default is to cache the image for 3 day (72 hours)
|
|
@@ -407,23 +453,27 @@ const module = defineNuxtModule({
|
|
|
407
453
|
};
|
|
408
454
|
},
|
|
409
455
|
async setup(config, nuxt) {
|
|
410
|
-
const
|
|
456
|
+
const { resolve } = createResolver(import.meta.url);
|
|
457
|
+
const { name, version } = await readPackageJSON(resolve("../package.json"));
|
|
458
|
+
const logger = useLogger(name);
|
|
411
459
|
logger.level = config.debug || nuxt.options.debug ? 4 : 3;
|
|
412
460
|
if (config.enabled === false) {
|
|
413
461
|
logger.debug("The module is disabled, skipping setup.");
|
|
462
|
+
["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((name2) => {
|
|
463
|
+
addImports({ name: name2, from: resolve(`./runtime/nuxt/composables/mock`) });
|
|
464
|
+
});
|
|
414
465
|
return;
|
|
415
466
|
}
|
|
416
467
|
if (config.enabled && !nuxt.options.ssr) {
|
|
417
468
|
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
469
|
return;
|
|
419
470
|
}
|
|
420
|
-
|
|
471
|
+
nuxt.options.build.transpile.push(resolve("./runtime"));
|
|
421
472
|
const preset = resolveNitroPreset(nuxt.options.nitro);
|
|
422
473
|
const targetCompatibility = getPresetNitroPresetCompatibility(preset);
|
|
423
474
|
const hasSharpDependency = !!await tryResolveModule("sharp");
|
|
424
475
|
const userConfiguredExtension = config.defaults.extension;
|
|
425
476
|
const hasConfiguredJpegs = userConfiguredExtension && ["jpeg", "jpg"].includes(userConfiguredExtension);
|
|
426
|
-
config.defaults.extension = userConfiguredExtension || (hasSharpDependency && targetCompatibility.sharp ? "jpg" : "png");
|
|
427
477
|
if (hasConfiguredJpegs && config.defaults.renderer !== "chromium") {
|
|
428
478
|
if (hasSharpDependency && !targetCompatibility.sharp) {
|
|
429
479
|
logger.warn(`Rendering JPEGs requires sharp which does not work with ${preset}. Images will be rendered as PNG at runtime.`);
|
|
@@ -442,32 +492,32 @@ const module = defineNuxtModule({
|
|
|
442
492
|
prerender: { sharp: false }
|
|
443
493
|
});
|
|
444
494
|
}
|
|
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);
|
|
495
|
+
const hasChromeLocally = checkLocalChrome();
|
|
496
|
+
const hasPlaywrightDependency = await checkPlaywrightDependency();
|
|
497
|
+
const chromeCompatibilityFlags = {
|
|
498
|
+
prerender: config.compatibility?.prerender?.chromium,
|
|
499
|
+
dev: config.compatibility?.dev?.chromium,
|
|
500
|
+
runtime: config.compatibility?.runtime?.chromium
|
|
501
|
+
};
|
|
502
|
+
const chromiumBinding = {
|
|
503
|
+
dev: null,
|
|
504
|
+
prerender: null,
|
|
505
|
+
runtime: null
|
|
506
|
+
};
|
|
507
|
+
if (nuxt.options.dev) {
|
|
508
|
+
if (isUndefinedOrTruthy(chromeCompatibilityFlags.dev))
|
|
509
|
+
chromiumBinding.dev = hasChromeLocally ? "chrome-launcher" : hasPlaywrightDependency ? "playwright" : "on-demand";
|
|
510
|
+
} else {
|
|
511
|
+
if (isUndefinedOrTruthy(chromeCompatibilityFlags.prerender))
|
|
512
|
+
chromiumBinding.prerender = hasChromeLocally ? "chrome-launcher" : hasPlaywrightDependency ? "playwright" : "on-demand";
|
|
513
|
+
if (isUndefinedOrTruthy(chromeCompatibilityFlags.runtime))
|
|
514
|
+
chromiumBinding.runtime = hasPlaywrightDependency ? "playwright" : null;
|
|
470
515
|
}
|
|
516
|
+
config.compatibility = defu(config.compatibility, {
|
|
517
|
+
runtime: { chromium: chromiumBinding.runtime },
|
|
518
|
+
dev: { chromium: chromiumBinding.dev },
|
|
519
|
+
prerender: { chromium: chromiumBinding.prerender }
|
|
520
|
+
});
|
|
471
521
|
await import('@resvg/resvg-js').catch(() => {
|
|
472
522
|
logger.warn("ReSVG is missing dependencies for environment. Falling back to WASM version, this may slow down PNG rendering.");
|
|
473
523
|
config.compatibility = defu(config.compatibility, {
|
|
@@ -483,67 +533,80 @@ const module = defineNuxtModule({
|
|
|
483
533
|
await installNuxtSiteConfig();
|
|
484
534
|
if (hasNuxtModule("@nuxt/content"))
|
|
485
535
|
addServerPlugin(resolve("./runtime/nitro/plugins/nuxt-content"));
|
|
486
|
-
if (!config.fonts.length)
|
|
487
|
-
config.fonts = [
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
536
|
+
if (!config.fonts.length) {
|
|
537
|
+
config.fonts = [
|
|
538
|
+
{ name: "Inter", weight: 400, path: resolve("./runtime/assets/Inter-400.ttf.base64"), absolutePath: true },
|
|
539
|
+
{ name: "Inter", weight: 700, path: resolve("./runtime/assets/Inter-700.ttf.base64"), absolutePath: true }
|
|
540
|
+
];
|
|
541
|
+
}
|
|
542
|
+
const serverFontsDir = resolve(nuxt.options.buildDir, "cache", `nuxt-og-image@${version}`, "_fonts");
|
|
543
|
+
const fontStorage = createStorage({
|
|
544
|
+
driver: fsDriver({
|
|
545
|
+
base: serverFontsDir
|
|
546
|
+
})
|
|
547
|
+
});
|
|
548
|
+
config.fonts = (await Promise.all(normaliseFontInput(config.fonts).map(async (f) => {
|
|
549
|
+
if (!f.key && !f.path) {
|
|
550
|
+
if (preset === "stackblitz") {
|
|
551
|
+
logger.warn(`The ${f.name}:${f.weight} font was skipped because remote fonts are not available in StackBlitz, please use a local font.`);
|
|
492
552
|
return false;
|
|
493
553
|
}
|
|
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
|
-
};
|
|
554
|
+
if (await downloadFont(f, fontStorage, config.googleFontMirror)) {
|
|
555
|
+
f.key = `nuxt-og-image:fonts:${f.name}-${f.weight}.ttf.base64`;
|
|
556
|
+
} else {
|
|
557
|
+
logger.warn(`Failed to download font ${f.name}:${f.weight}. You may be offline or behind a firewall blocking Google. Consider setting \`googleFontMirror: true\`.`);
|
|
558
|
+
return false;
|
|
507
559
|
}
|
|
508
|
-
|
|
509
|
-
|
|
560
|
+
} else if (f.path) {
|
|
561
|
+
const extension = basename(f.path.replace(".base64", "")).split(".").pop();
|
|
562
|
+
if (!["woff", "ttf", "otf"].includes(extension)) {
|
|
563
|
+
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
564
|
return false;
|
|
511
565
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
566
|
+
if (!f.absolutePath)
|
|
567
|
+
f.path = join(nuxt.options.rootDir, nuxt.options.dir.public, withoutLeadingSlash(f.path));
|
|
568
|
+
if (!existsSync(f.path)) {
|
|
569
|
+
logger.warn(`The ${f.name}:${f.weight} font was skipped because the file does not exist at path ${f.path}.`);
|
|
570
|
+
return false;
|
|
571
|
+
}
|
|
572
|
+
const fontData = await readFile(f.path, f.path.endsWith(".base64") ? "utf-8" : "base64");
|
|
573
|
+
f.key = `nuxt-og-image:fonts:${f.name}-${f.weight}.${extension}.base64`;
|
|
574
|
+
await fontStorage.setItem(`${f.name}-${f.weight}.${extension}.base64`, fontData);
|
|
575
|
+
delete f.path;
|
|
576
|
+
delete f.absolutePath;
|
|
577
|
+
}
|
|
578
|
+
return f;
|
|
579
|
+
}))).filter(Boolean);
|
|
580
|
+
nuxt.options.nitro.serverAssets = nuxt.options.nitro.serverAssets || [];
|
|
581
|
+
nuxt.options.nitro.serverAssets.push({ baseName: "nuxt-og-image:fonts", dir: serverFontsDir });
|
|
519
582
|
nuxt.options.experimental.componentIslands = true;
|
|
520
583
|
addServerHandler({
|
|
521
584
|
lazy: true,
|
|
522
585
|
route: "/__og-image__/font/**",
|
|
523
|
-
handler: resolve("./runtime/
|
|
586
|
+
handler: resolve("./runtime/nitro/routes/font")
|
|
524
587
|
});
|
|
525
588
|
if (config.debug || nuxt.options.dev) {
|
|
526
589
|
addServerHandler({
|
|
527
590
|
lazy: true,
|
|
528
591
|
route: "/__og-image__/debug.json",
|
|
529
|
-
handler: resolve("./runtime/
|
|
592
|
+
handler: resolve("./runtime/nitro/routes/debug.json")
|
|
530
593
|
});
|
|
531
594
|
}
|
|
532
595
|
addServerHandler({
|
|
533
596
|
lazy: true,
|
|
534
597
|
route: "/__og-image__/image/**",
|
|
535
|
-
handler: resolve("./runtime/
|
|
598
|
+
handler: resolve("./runtime/nitro/routes/image")
|
|
536
599
|
});
|
|
537
600
|
nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"] = [];
|
|
538
|
-
["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((
|
|
601
|
+
["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((name2) => {
|
|
539
602
|
addImports({
|
|
540
|
-
name,
|
|
541
|
-
from: resolve(`./runtime/composables/${
|
|
603
|
+
name: name2,
|
|
604
|
+
from: resolve(`./runtime/nuxt/composables/${name2}`)
|
|
542
605
|
});
|
|
543
|
-
nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"].push(
|
|
606
|
+
nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"].push(name2);
|
|
544
607
|
});
|
|
545
608
|
await addComponentsDir({
|
|
546
|
-
path: resolve("./runtime/components/Templates/Community"),
|
|
609
|
+
path: resolve("./runtime/nuxt/components/Templates/Community"),
|
|
547
610
|
island: true,
|
|
548
611
|
watch: true
|
|
549
612
|
});
|
|
@@ -551,10 +614,10 @@ const module = defineNuxtModule({
|
|
|
551
614
|
// new
|
|
552
615
|
"OgImage",
|
|
553
616
|
"OgImageScreenshot"
|
|
554
|
-
].forEach((
|
|
617
|
+
].forEach((name2) => {
|
|
555
618
|
addComponent({
|
|
556
|
-
name,
|
|
557
|
-
filePath: resolve(`./runtime/components/OgImage/${
|
|
619
|
+
name: name2,
|
|
620
|
+
filePath: resolve(`./runtime/nuxt/components/OgImage/${name2}`),
|
|
558
621
|
...config.componentOptions
|
|
559
622
|
});
|
|
560
623
|
});
|
|
@@ -569,13 +632,13 @@ const module = defineNuxtModule({
|
|
|
569
632
|
if (component.pascalName.startsWith(dir) || component.kebabName.startsWith(dir) || component.shortPath.includes(`/${dir}/`))
|
|
570
633
|
valid = true;
|
|
571
634
|
});
|
|
572
|
-
if (component.filePath.includes(resolve("./runtime/components/Templates")))
|
|
635
|
+
if (component.filePath.includes(resolve("./runtime/nuxt/components/Templates")))
|
|
573
636
|
valid = true;
|
|
574
637
|
if (valid && fs.existsSync(component.filePath)) {
|
|
575
638
|
component.island = true;
|
|
576
639
|
component.mode = "server";
|
|
577
640
|
let category = "app";
|
|
578
|
-
if (component.filePath.includes(resolve("./runtime/components/Templates/Community")))
|
|
641
|
+
if (component.filePath.includes(resolve("./runtime/nuxt/components/Templates/Community")))
|
|
579
642
|
category = "community";
|
|
580
643
|
const componentFile = fs.readFileSync(component.filePath, "utf-8");
|
|
581
644
|
const credits = componentFile.split("\n").find((line) => line.startsWith(" * @credits"))?.replace("* @credits", "").trim();
|
|
@@ -603,9 +666,9 @@ const module = defineNuxtModule({
|
|
|
603
666
|
nuxt.options.nitro.virtual["#nuxt-og-image/component-names.mjs"] = () => {
|
|
604
667
|
return `export const componentNames = ${JSON.stringify(ogImageComponentCtx.components)}`;
|
|
605
668
|
};
|
|
606
|
-
let unoCssConfig = {
|
|
669
|
+
let unoCssConfig = {};
|
|
607
670
|
nuxt.hook("tailwindcss:config", (tailwindConfig) => {
|
|
608
|
-
unoCssConfig = defu(tailwindConfig.theme
|
|
671
|
+
unoCssConfig = defu(tailwindConfig.theme?.extend, { ...tailwindConfig.theme, extend: void 0 });
|
|
609
672
|
});
|
|
610
673
|
nuxt.hook("unocss:config", (_unoCssConfig) => {
|
|
611
674
|
unoCssConfig = { ..._unoCssConfig.theme };
|
|
@@ -616,7 +679,10 @@ const module = defineNuxtModule({
|
|
|
616
679
|
extendTypes("nuxt-og-image", ({ typesPath }) => {
|
|
617
680
|
const componentImports = ogImageComponentCtx.components.map((component) => {
|
|
618
681
|
const relativeComponentPath = relative(resolve(nuxt.options.rootDir, nuxt.options.buildDir, "module"), component.path);
|
|
619
|
-
|
|
682
|
+
const name2 = config.componentDirs.sort((a, b) => b.length - a.length).reduce((name3, dir) => {
|
|
683
|
+
return name3.replace(new RegExp(`^${dir}`), "");
|
|
684
|
+
}, component.pascalName);
|
|
685
|
+
return ` '${name2}': typeof import('${relativeComponentPath}')['default']`;
|
|
620
686
|
}).join("\n");
|
|
621
687
|
return `
|
|
622
688
|
declare module 'nitropack' {
|
|
@@ -637,6 +703,9 @@ declare module '#nuxt-og-image/components' {
|
|
|
637
703
|
${componentImports}
|
|
638
704
|
}
|
|
639
705
|
}
|
|
706
|
+
declare module '#nuxt-og-image/unocss-config' {
|
|
707
|
+
export type theme = any
|
|
708
|
+
}
|
|
640
709
|
`;
|
|
641
710
|
});
|
|
642
711
|
const cacheEnabled = typeof config.runtimeCacheStorage !== "undefined" && config.runtimeCacheStorage !== false;
|
|
@@ -650,12 +719,10 @@ ${componentImports}
|
|
|
650
719
|
}
|
|
651
720
|
nuxt.hooks.hook("modules:done", async () => {
|
|
652
721
|
const normalisedFonts = normaliseFontInput(config.fonts);
|
|
653
|
-
if (!
|
|
722
|
+
if (!isNuxtGenerate() && nuxt.options.build) {
|
|
723
|
+
nuxt.options.nitro = nuxt.options.nitro || {};
|
|
654
724
|
nuxt.options.nitro.prerender = nuxt.options.nitro.prerender || {};
|
|
655
725
|
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
726
|
}
|
|
660
727
|
const hasColorModeModule = hasNuxtModule("@nuxtjs/color-mode");
|
|
661
728
|
const colorModeOptions = hasColorModeModule ? await getNuxtModuleOptions("@nuxtjs/color-mode") : {};
|
|
@@ -677,7 +744,9 @@ ${componentImports}
|
|
|
677
744
|
// convert the fonts to uniform type to fix ts issue
|
|
678
745
|
fonts: normalisedFonts,
|
|
679
746
|
hasNuxtIcon: hasNuxtModule("nuxt-icon"),
|
|
680
|
-
colorPreference
|
|
747
|
+
colorPreference,
|
|
748
|
+
// @ts-expect-error runtime type
|
|
749
|
+
isNuxtContentDocumentDriven: !!nuxt.options.content?.documentDriven
|
|
681
750
|
};
|
|
682
751
|
nuxt.hooks.callHook("nuxt-og-image:runtime-config", runtimeConfig);
|
|
683
752
|
nuxt.options.runtimeConfig["nuxt-og-image"] = runtimeConfig;
|
|
@@ -685,7 +754,7 @@ ${componentImports}
|
|
|
685
754
|
if (nuxt.options.dev) {
|
|
686
755
|
setupDevHandler(config, resolve);
|
|
687
756
|
setupDevToolsUI(config, resolve);
|
|
688
|
-
} else if (
|
|
757
|
+
} else if (isNuxtGenerate()) {
|
|
689
758
|
setupGenerateHandler(config, resolve);
|
|
690
759
|
} else if (nuxt.options.build) {
|
|
691
760
|
await setupBuildHandler(config, resolve);
|