nuxt-og-image 3.0.0 → 3.0.1

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.
@@ -272,4 +272,4 @@
272
272
  <link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-500.BJ-KsTwR.css">
273
273
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/CFTaR7kf.js">
274
274
  <script type="module" src="/__nuxt-og-image/_nuxt/DkfuXiRx.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"serverRendered":1},false]</script>
275
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildId:"c0255dff-4096-412a-b1f2-8c73ec29c527",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
275
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildId:"d105fb01-545e-4b40-b706-5b2d4c655752",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -272,4 +272,4 @@
272
272
  <link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-500.BJ-KsTwR.css">
273
273
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/CFTaR7kf.js">
274
274
  <script type="module" src="/__nuxt-og-image/_nuxt/DkfuXiRx.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"serverRendered":1},false]</script>
275
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildId:"c0255dff-4096-412a-b1f2-8c73ec29c527",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
275
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildId:"d105fb01-545e-4b40-b706-5b2d4c655752",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -1 +1 @@
1
- {"id":"c0255dff-4096-412a-b1f2-8c73ec29c527","timestamp":1726070625217}
1
+ {"id":"d105fb01-545e-4b40-b706-5b2d4c655752","timestamp":1726080816101}
@@ -0,0 +1 @@
1
+ {"id":"d105fb01-545e-4b40-b706-5b2d4c655752","timestamp":1726080816101,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -272,4 +272,4 @@
272
272
  <link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-500.BJ-KsTwR.css">
273
273
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/CFTaR7kf.js">
274
274
  <script type="module" src="/__nuxt-og-image/_nuxt/DkfuXiRx.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"serverRendered":1},false]</script>
275
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildId:"c0255dff-4096-412a-b1f2-8c73ec29c527",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
275
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildId:"d105fb01-545e-4b40-b706-5b2d4c655752",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
package/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "bridge": false
6
6
  },
7
7
  "configKey": "ogImage",
8
- "version": "3.0.0-rc.69",
8
+ "version": "3.0.0",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "0.8.4",
11
11
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -400,11 +400,7 @@ const TreeShakeComposablesPlugin = createUnplugin(() => {
400
400
  },
401
401
  transform(code, id) {
402
402
  const s = new MagicString(code);
403
- if (id.endsWith("components.islands.mjs")) {
404
- for (const match of code.matchAll(/"OgImage.*": defineAsyncComponent\(.*\),?/g)) {
405
- s.overwrite(match.index, match.index + match[0].length, "");
406
- }
407
- } else {
403
+ if (id.endsWith("components.islands.mjs")) ; else {
408
404
  const strippedCode = stripLiteral(code);
409
405
  if (!COMPOSABLE_RE.test(code)) {
410
406
  return;
@@ -156,7 +156,11 @@ async function fetchPathHtmlAndExtractOptions(e, path, key) {
156
156
  return cachedHtmlPayload.value;
157
157
  let html;
158
158
  try {
159
- html = await e.$fetch(path);
159
+ html = await e.$fetch(path, {
160
+ // follow redirects
161
+ redirect: "follow",
162
+ responseType: "text"
163
+ });
160
164
  } catch (err) {
161
165
  return createError({
162
166
  statusCode: 500,
@@ -17,7 +17,19 @@ export default defineSatoriTransformer({
17
17
  const parsedToken = await uno.parseToken(token);
18
18
  if (parsedToken) {
19
19
  const inlineStyles = parsedToken[0][2].split(";").filter((s) => !!s?.trim());
20
- const vars = {};
20
+ const vars = {
21
+ "--color-gray-50": "249 250 251",
22
+ "--color-gray-100": "243 244 246",
23
+ "--color-gray-200": "229 231 235",
24
+ "--color-gray-300": "209 213 219",
25
+ "--color-gray-400": "156 163 175",
26
+ "--color-gray-500": "107 114 128",
27
+ "--color-gray-600": "75 85 99",
28
+ "--color-gray-700": "55 65 81",
29
+ "--color-gray-800": "31 41 55",
30
+ "--color-gray-900": "17 24 39",
31
+ "--color-gray-950": "3 7 18"
32
+ };
21
33
  inlineStyles.filter((s) => s.startsWith("--")).forEach((s) => {
22
34
  const [key, value] = s.split(":");
23
35
  vars[key] = value;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-og-image",
3
3
  "type": "module",
4
- "version": "3.0.0",
4
+ "version": "3.0.1",
5
5
  "description": "Enlightened OG Image generation for Nuxt.",
6
6
  "author": {
7
7
  "website": "https://harlanzw.com",
@@ -131,6 +131,6 @@
131
131
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && nuxi prepare client",
132
132
  "release": "pnpm build && bumpp && pnpm -r publish --no-git-checks",
133
133
  "typecheck": "tsc --noEmit",
134
- "test": "vitest integration/endpoints"
134
+ "test": "vitest"
135
135
  }
136
136
  }
@@ -1 +0,0 @@
1
- {"id":"c0255dff-4096-412a-b1f2-8c73ec29c527","timestamp":1726070625217,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}