@se-studio/core-ui 1.28.5 → 1.28.7
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/CHANGELOG.md +13 -0
- package/dist/route-handlers/createOgImageHandler.d.ts +29 -0
- package/dist/route-handlers/createOgImageHandler.d.ts.map +1 -0
- package/dist/route-handlers/createOgImageHandler.js +122 -0
- package/dist/route-handlers/createOgImageHandler.js.map +1 -0
- package/dist/route-handlers/index.d.ts +2 -0
- package/dist/route-handlers/index.d.ts.map +1 -1
- package/dist/route-handlers/index.js +1 -0
- package/dist/route-handlers/index.js.map +1 -1
- package/docs/PACKAGE_EXPORT_BOUNDARIES.md +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @se-studio/core-ui
|
|
2
2
|
|
|
3
|
+
## 1.28.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0ab8467: Add `createOgImageHandler` so marketing `/og` routes feed Satori a 1200×630 JPEG Images API URL via `contentfulOgImageUrl`.
|
|
8
|
+
|
|
9
|
+
## 1.28.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @se-studio/contentful-rest-api@1.27.0
|
|
15
|
+
|
|
3
16
|
## 1.28.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ContentfulConfig } from '@se-studio/contentful-rest-api';
|
|
2
|
+
export declare const OG_CACHE_CONTROL = "public, s-maxage=86400, stale-while-revalidate=604800";
|
|
3
|
+
export declare const OG_PREVIEW_CACHE_CONTROL = "private, no-store";
|
|
4
|
+
export interface OgImageHandlerConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Function to get the Contentful configuration.
|
|
7
|
+
* Called on each request to allow for dynamic config.
|
|
8
|
+
*/
|
|
9
|
+
getConfig: (preview?: boolean) => ContentfulConfig;
|
|
10
|
+
/** Whether to use the preview API. Defaults to false. */
|
|
11
|
+
preview?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface OgImageRouteContext {
|
|
14
|
+
params: Promise<{
|
|
15
|
+
imageId: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates Next.js App Router GET and HEAD handlers for `/og/[imageId]`.
|
|
20
|
+
*
|
|
21
|
+
* Satori cannot decode WebP. The CMS asset is fetched, then `contentfulOgImageUrl`
|
|
22
|
+
* supplies a 1200×630 JPEG Images API URL as Satori `<img src>` only.
|
|
23
|
+
* Public og:image stays the site `/og/{id}.jpg` path.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createOgImageHandler(config: OgImageHandlerConfig): {
|
|
26
|
+
GET: (request: Request, context: OgImageRouteContext) => Promise<Response>;
|
|
27
|
+
HEAD: (request: Request, context: OgImageRouteContext) => Promise<Response>;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=createOgImageHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOgImageHandler.d.ts","sourceRoot":"","sources":["../../src/route-handlers/createOgImageHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAIvE,eAAO,MAAM,gBAAgB,0DAA0D,CAAC;AACxF,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,gBAAgB,CAAC;IACnD,yDAAyD;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtC;AA8DD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG;IAClE,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3E,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC7E,CAiFA"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { contentfulAssetRest, contentfulOgImageUrl } from '@se-studio/contentful-rest-api';
|
|
3
|
+
import { ImageResponse } from 'next/og';
|
|
4
|
+
export const OG_CACHE_CONTROL = 'public, s-maxage=86400, stale-while-revalidate=604800';
|
|
5
|
+
export const OG_PREVIEW_CACHE_CONTROL = 'private, no-store';
|
|
6
|
+
/**
|
|
7
|
+
* Site og:image stays `/og/{assetId}.jpg` (see buildPageMetadata).
|
|
8
|
+
* Contentful Images API `fm=jpg` is Satori input only — do not put that URL in meta.
|
|
9
|
+
* JPEG drops alpha; featured images should be landscape photos or already-backed logos.
|
|
10
|
+
*/
|
|
11
|
+
async function resolveOgSource(imageId, config) {
|
|
12
|
+
const id = imageId.split('.')[0];
|
|
13
|
+
if (!id) {
|
|
14
|
+
return { ok: false, response: new Response('Invalid image ID', { status: 400 }) };
|
|
15
|
+
}
|
|
16
|
+
const preview = config.preview ?? false;
|
|
17
|
+
const cacheControl = preview ? OG_PREVIEW_CACHE_CONTROL : OG_CACHE_CONTROL;
|
|
18
|
+
const asset = await contentfulAssetRest(config.getConfig(preview), id, {
|
|
19
|
+
preview,
|
|
20
|
+
next: { revalidate: preview ? false : 86400 },
|
|
21
|
+
});
|
|
22
|
+
if (!asset?.fields?.file?.url) {
|
|
23
|
+
return { ok: false, response: new Response('Image not found', { status: 404 }) };
|
|
24
|
+
}
|
|
25
|
+
const imageUrl = contentfulOgImageUrl(asset.fields.file.url, {
|
|
26
|
+
contentType: asset.fields.file.contentType,
|
|
27
|
+
});
|
|
28
|
+
if (!imageUrl) {
|
|
29
|
+
return { ok: false, response: new Response('Image not found', { status: 404 }) };
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
ok: true,
|
|
33
|
+
imageUrl,
|
|
34
|
+
title: asset.fields.title || 'Featured Image',
|
|
35
|
+
cacheControl,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async function assertOgSourceDecodable(imageUrl) {
|
|
39
|
+
const response = await fetch(imageUrl, {
|
|
40
|
+
cache: 'force-cache',
|
|
41
|
+
next: { revalidate: 86400 },
|
|
42
|
+
});
|
|
43
|
+
if (!response.ok) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
const type = response.headers.get('content-type')?.split(';')[0]?.trim() ?? '';
|
|
47
|
+
return type === 'image/jpeg' || type === 'image/jpg' || type === 'image/png';
|
|
48
|
+
}
|
|
49
|
+
function failedToGenerate() {
|
|
50
|
+
return new Response('Failed to generate image', { status: 500 });
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Creates Next.js App Router GET and HEAD handlers for `/og/[imageId]`.
|
|
54
|
+
*
|
|
55
|
+
* Satori cannot decode WebP. The CMS asset is fetched, then `contentfulOgImageUrl`
|
|
56
|
+
* supplies a 1200×630 JPEG Images API URL as Satori `<img src>` only.
|
|
57
|
+
* Public og:image stays the site `/og/{id}.jpg` path.
|
|
58
|
+
*/
|
|
59
|
+
export function createOgImageHandler(config) {
|
|
60
|
+
async function GET(_request, { params }) {
|
|
61
|
+
const { imageId } = await params;
|
|
62
|
+
try {
|
|
63
|
+
const source = await resolveOgSource(imageId, config);
|
|
64
|
+
if (!source.ok) {
|
|
65
|
+
return source.response;
|
|
66
|
+
}
|
|
67
|
+
// Next ImageResponse defaults to max-age=0; options.headers override (Next 16.3).
|
|
68
|
+
return new ImageResponse(_jsx("div", { style: {
|
|
69
|
+
display: 'flex',
|
|
70
|
+
width: '100%',
|
|
71
|
+
height: '100%',
|
|
72
|
+
backgroundColor: '#000',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
justifyContent: 'center',
|
|
75
|
+
}, children: _jsx("img", { src: source.imageUrl, alt: source.title, width: 1200, height: 630, style: {
|
|
76
|
+
width: '100%',
|
|
77
|
+
height: '100%',
|
|
78
|
+
objectFit: 'cover',
|
|
79
|
+
} }) }), {
|
|
80
|
+
width: 1200,
|
|
81
|
+
height: 630,
|
|
82
|
+
headers: {
|
|
83
|
+
'Cache-Control': source.cacheControl,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
console.error('Error generating OG image:', e);
|
|
89
|
+
return failedToGenerate();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* HEAD validates the JPEG Images API source (the WebP 500 cause) without running Satori.
|
|
94
|
+
* Status matches GET for missing/undecodable assets; GET still renders the PNG card.
|
|
95
|
+
*/
|
|
96
|
+
async function HEAD(_request, { params }) {
|
|
97
|
+
const { imageId } = await params;
|
|
98
|
+
try {
|
|
99
|
+
const source = await resolveOgSource(imageId, config);
|
|
100
|
+
if (!source.ok) {
|
|
101
|
+
return source.response;
|
|
102
|
+
}
|
|
103
|
+
const decodable = await assertOgSourceDecodable(source.imageUrl);
|
|
104
|
+
if (!decodable) {
|
|
105
|
+
return failedToGenerate();
|
|
106
|
+
}
|
|
107
|
+
return new Response(null, {
|
|
108
|
+
status: 200,
|
|
109
|
+
headers: {
|
|
110
|
+
'Content-Type': 'image/png',
|
|
111
|
+
'Cache-Control': source.cacheControl,
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
catch (e) {
|
|
116
|
+
console.error('Error generating OG image:', e);
|
|
117
|
+
return failedToGenerate();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return { GET, HEAD };
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=createOgImageHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOgImageHandler.js","sourceRoot":"","sources":["../../src/route-handlers/createOgImageHandler.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,CAAC,MAAM,gBAAgB,GAAG,uDAAuD,CAAC;AACxF,MAAM,CAAC,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAoB5D;;;;GAIG;AACH,KAAK,UAAU,eAAe,CAAC,OAAe,EAAE,MAA4B;IAC1E,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjC,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,QAAQ,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;IACpF,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,KAAK,CAAC;IACxC,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAE3E,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE;QACrE,OAAO;QACP,IAAI,EAAE,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE;KAC9C,CAAC,CAAC;IAEH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QAC9B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,QAAQ,CAAC,iBAAiB,EA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M,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACtD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;gBACf,OAAO,MAAM,CAAC,QAAQ,CAAC;YACzB,CAAC;YAED,MAAM,SAAS,GAAG,MAAM,uBAAuB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACjE,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,OAAO,gBAAgB,EAAE,CAAC;YAC5B,CAAC;YAED,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;gBACxB,MAAM,EAAE,GAAG;gBACX,OAAO,EAAE;oBACP,cAAc,EAAE,WAAW;oBAC3B,eAAe,EAAE,MAAM,CAAC,YAAY;iBACrC;aACF,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;YAC/C,OAAO,gBAAgB,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -6,4 +6,6 @@ export type { GuidelinesHandlerOptions } from './createGuidelinesHandler';
|
|
|
6
6
|
export { createGuidelinesHandler } from './createGuidelinesHandler';
|
|
7
7
|
export type { MediaLibraryHandlerOptions } from './createMediaLibraryHandler';
|
|
8
8
|
export { createMediaLibraryJsonHandler, createMediaLibraryMarkdownHandler, } from './createMediaLibraryHandler';
|
|
9
|
+
export type { OgImageHandlerConfig, OgImageRouteContext } from './createOgImageHandler';
|
|
10
|
+
export { createOgImageHandler, OG_CACHE_CONTROL, OG_PREVIEW_CACHE_CONTROL, } from './createOgImageHandler';
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/route-handlers/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,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MAAM,wBAAwB,CAAC"}
|
|
@@ -2,4 +2,5 @@ export { createCmsTxtHandler } from './createCmsTxtHandler';
|
|
|
2
2
|
export { createDiscoveryHandler } from './createDiscoveryHandler';
|
|
3
3
|
export { createGuidelinesHandler } from './createGuidelinesHandler';
|
|
4
4
|
export { createMediaLibraryJsonHandler, createMediaLibraryMarkdownHandler, } from './createMediaLibraryHandler';
|
|
5
|
+
export { createOgImageHandler, OG_CACHE_CONTROL, OG_PREVIEW_CACHE_CONTROL, } from './createOgImageHandler';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/route-handlers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAW5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,GAClC,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/route-handlers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAW5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,GAClC,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC"}
|
|
@@ -12,7 +12,7 @@ Next.js App Router mixes **Server Components** and **Client Components** (`'use
|
|
|
12
12
|
|-------|----------------|----------|
|
|
13
13
|
| `@se-studio/core-ui` | **Everyone** — `'use client'` files, server components, registrations | React UI, hooks, `cn`, CMS renderers, registration helpers, shared types |
|
|
14
14
|
| `@se-studio/core-ui/server` | **Server only** — `import 'server-only'` at top | `createAppHelpers`, `createRouteHandlers`, `getRelated*`, `filterRelatedArticles`, listing structured-data helpers, etc. |
|
|
15
|
-
| `@se-studio/core-ui/route-handlers` | **App route modules** (Node `fs`) | Discovery/guidelines/cms.txt handlers |
|
|
15
|
+
| `@se-studio/core-ui/route-handlers` | **App route modules** (Node `fs`) | Discovery/guidelines/cms.txt/OG image handlers |
|
|
16
16
|
|
|
17
17
|
**Do not add a `/client` entry** unless you want stricter enforcement. The main barrel *is* the client-safe surface; `/server` is the explicit server escape hatch.
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@se-studio/core-ui",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.7",
|
|
4
4
|
"description": "Shared React UI component library with Tailwind CSS v4 for SE Studio applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@contentful/rich-text-react-renderer": "^16.2.2",
|
|
77
77
|
"@contentful/rich-text-types": "^17.2.7",
|
|
78
78
|
"@radix-ui/react-slot": "1.3.3",
|
|
79
|
-
"@se-studio/contentful-rest-api": "1.
|
|
79
|
+
"@se-studio/contentful-rest-api": "1.27.0",
|
|
80
80
|
"@se-studio/core-data-types": "1.13.3",
|
|
81
81
|
"@types/mustache": "4.2.6",
|
|
82
82
|
"@vimeo/player": "^2.30.4",
|