@junejs/og 0.2.2 → 0.2.3
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/dist/edge.d.ts +1 -3
- package/dist/edge.js +2 -3
- package/dist/{fonts-Bx7XuIfO.d.ts → fonts-BT0SQd7r.d.ts} +0 -2
- package/dist/fonts.d.ts +1 -1
- package/dist/fonts.js +1 -2
- package/dist/headers.d.ts +1 -3
- package/dist/headers.js +1 -2
- package/dist/node.d.ts +1 -3
- package/dist/node.js +2 -3
- package/dist/types.d.ts +2 -4
- package/dist/workerd.d.ts +1 -3
- package/dist/workerd.js +2 -3
- package/package.json +2 -2
package/dist/edge.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { a as loadGoogleFont, i as loadDefaultFonts, n as OgFont, r as hasCJK, t as OG_HEADERS } from "./fonts-Bx7XuIfO.js";
|
|
2
1
|
import { ImageResponseOptions } from "./types.js";
|
|
2
|
+
import { a as loadGoogleFont, i as loadDefaultFonts, n as OgFont, r as hasCJK, t as OG_HEADERS } from "./fonts-BT0SQd7r.js";
|
|
3
3
|
import { ReactElement } from "react";
|
|
4
|
-
//#region src/edge.d.ts
|
|
5
4
|
export declare class ImageResponse extends Response {
|
|
6
5
|
constructor(element: ReactElement, options?: ImageResponseOptions);
|
|
7
6
|
}
|
|
8
|
-
//#endregion
|
|
9
7
|
export { type ImageResponseOptions, OG_HEADERS, type OgFont, hasCJK, loadDefaultFonts, loadGoogleFont };
|
package/dist/edge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OG_HEADERS, hasCJK, loadDefaultFonts, loadGoogleFont } from "./fonts.js";
|
|
2
1
|
import { ogResponseHeaders } from "./headers.js";
|
|
3
|
-
|
|
2
|
+
import { OG_HEADERS, hasCJK, loadDefaultFonts, loadGoogleFont } from "./fonts.js";
|
|
3
|
+
// src/edge.ts
|
|
4
4
|
const _import = new Function("m", "return import(m)");
|
|
5
5
|
var ImageResponse = class extends Response {
|
|
6
6
|
constructor(element, options = {}) {
|
|
@@ -21,5 +21,4 @@ var ImageResponse = class extends Response {
|
|
|
21
21
|
}).catch((err) => writable.abort(err).catch(() => {}));
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
24
|
export { ImageResponse, OG_HEADERS, hasCJK, loadDefaultFonts, loadGoogleFont };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/fonts.d.ts
|
|
2
1
|
interface OgFont {
|
|
3
2
|
name: string;
|
|
4
3
|
data: ArrayBuffer;
|
|
@@ -31,5 +30,4 @@ declare const OG_HEADERS: {
|
|
|
31
30
|
readonly "content-type": "image/png";
|
|
32
31
|
readonly "cache-control": "public, max-age=86400, stale-while-revalidate=604800";
|
|
33
32
|
};
|
|
34
|
-
//#endregion
|
|
35
33
|
export { loadGoogleFont as a, loadDefaultFonts as i, OgFont as n, hasCJK as r, OG_HEADERS as t };
|
package/dist/fonts.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as loadGoogleFont, i as loadDefaultFonts, n as OgFont, r as hasCJK, t as OG_HEADERS } from "./fonts-
|
|
1
|
+
import { a as loadGoogleFont, i as loadDefaultFonts, n as OgFont, r as hasCJK, t as OG_HEADERS } from "./fonts-BT0SQd7r.js";
|
|
2
2
|
export { OG_HEADERS, OgFont, hasCJK, loadDefaultFonts, loadGoogleFont };
|
package/dist/fonts.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/fonts.ts
|
|
2
2
|
const memoryCache = /* @__PURE__ */ new Map();
|
|
3
3
|
/**
|
|
4
4
|
* Load a Google Font subset for the given text. Only the glyphs that appear in
|
|
@@ -56,5 +56,4 @@ const OG_HEADERS = {
|
|
|
56
56
|
"content-type": "image/png",
|
|
57
57
|
"cache-control": "public, max-age=86400, stale-while-revalidate=604800"
|
|
58
58
|
};
|
|
59
|
-
//#endregion
|
|
60
59
|
export { OG_HEADERS, hasCJK, loadDefaultFonts, loadGoogleFont };
|
package/dist/headers.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ImageResponseOptions } from "./types.js";
|
|
2
|
-
//#region src/headers.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The response headers every backend's ImageResponse answers with.
|
|
5
4
|
*
|
|
@@ -11,5 +10,4 @@ import { ImageResponseOptions } from "./types.js";
|
|
|
11
10
|
* Contract (types.ts): callers may merge or override any header EXCEPT
|
|
12
11
|
* content-type, which is set last so the body is always served as a PNG.
|
|
13
12
|
*/
|
|
14
|
-
export declare function ogResponseHeaders(options: ImageResponseOptions): Headers;
|
|
15
|
-
//#endregion
|
|
13
|
+
export declare function ogResponseHeaders(options: ImageResponseOptions): Headers;
|
package/dist/headers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OG_HEADERS } from "./fonts.js";
|
|
2
|
-
|
|
2
|
+
// src/headers.ts
|
|
3
3
|
/**
|
|
4
4
|
* The response headers every backend's ImageResponse answers with.
|
|
5
5
|
*
|
|
@@ -17,5 +17,4 @@ function ogResponseHeaders(options) {
|
|
|
17
17
|
headers.set("content-type", "image/png");
|
|
18
18
|
return headers;
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { ogResponseHeaders };
|
package/dist/node.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { a as loadGoogleFont, i as loadDefaultFonts, n as OgFont, r as hasCJK, t as OG_HEADERS } from "./fonts-Bx7XuIfO.js";
|
|
2
1
|
import { ImageResponseOptions } from "./types.js";
|
|
2
|
+
import { a as loadGoogleFont, i as loadDefaultFonts, n as OgFont, r as hasCJK, t as OG_HEADERS } from "./fonts-BT0SQd7r.js";
|
|
3
3
|
import { ReactElement } from "react";
|
|
4
|
-
//#region src/node.d.ts
|
|
5
4
|
export declare class ImageResponse extends Response {
|
|
6
5
|
constructor(element: ReactElement, options?: ImageResponseOptions);
|
|
7
6
|
}
|
|
8
|
-
//#endregion
|
|
9
7
|
export { type ImageResponseOptions, OG_HEADERS, type OgFont, hasCJK, loadDefaultFonts, loadGoogleFont };
|
package/dist/node.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OG_HEADERS, hasCJK, loadDefaultFonts, loadGoogleFont } from "./fonts.js";
|
|
2
1
|
import { ogResponseHeaders } from "./headers.js";
|
|
3
|
-
|
|
2
|
+
import { OG_HEADERS, hasCJK, loadDefaultFonts, loadGoogleFont } from "./fonts.js";
|
|
3
|
+
// src/node.ts
|
|
4
4
|
const _import = new Function("m", "return import(m)");
|
|
5
5
|
var ImageResponse = class extends Response {
|
|
6
6
|
constructor(element, options = {}) {
|
|
@@ -21,5 +21,4 @@ var ImageResponse = class extends Response {
|
|
|
21
21
|
})).catch((err) => writer.abort(err));
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
24
|
export { ImageResponse, OG_HEADERS, hasCJK, loadDefaultFonts, loadGoogleFont };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { n as OgFont } from "./fonts-
|
|
2
|
-
//#region src/types.d.ts
|
|
1
|
+
import { n as OgFont } from "./fonts-BT0SQd7r.js";
|
|
3
2
|
/** Options accepted by ImageResponse across all backends. */
|
|
4
3
|
export interface ImageResponseOptions {
|
|
5
4
|
width?: number;
|
|
@@ -14,5 +13,4 @@ export interface ImageResponseOptions {
|
|
|
14
13
|
emoji?: "twemoji" | "blobmoji" | "noto" | "openmoji";
|
|
15
14
|
/** Render debug outlines (satori option). */
|
|
16
15
|
debug?: boolean;
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
16
|
+
}
|
package/dist/workerd.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { a as loadGoogleFont, i as loadDefaultFonts, n as OgFont, r as hasCJK, t as OG_HEADERS } from "./fonts-Bx7XuIfO.js";
|
|
2
1
|
import { ImageResponseOptions } from "./types.js";
|
|
2
|
+
import { a as loadGoogleFont, i as loadDefaultFonts, n as OgFont, r as hasCJK, t as OG_HEADERS } from "./fonts-BT0SQd7r.js";
|
|
3
3
|
import { ReactElement } from "react";
|
|
4
|
-
//#region src/workerd.d.ts
|
|
5
4
|
export declare class ImageResponse extends Response {
|
|
6
5
|
constructor(element: ReactElement, options?: ImageResponseOptions);
|
|
7
6
|
}
|
|
8
|
-
//#endregion
|
|
9
7
|
export { type ImageResponseOptions, OG_HEADERS, type OgFont, hasCJK, loadDefaultFonts, loadGoogleFont };
|
package/dist/workerd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OG_HEADERS, hasCJK, loadDefaultFonts, loadGoogleFont } from "./fonts.js";
|
|
2
1
|
import { ogResponseHeaders } from "./headers.js";
|
|
2
|
+
import { OG_HEADERS, hasCJK, loadDefaultFonts, loadGoogleFont } from "./fonts.js";
|
|
3
3
|
import { ImageResponse as ImageResponse$1 } from "workers-og";
|
|
4
|
-
|
|
4
|
+
// src/workerd.ts
|
|
5
5
|
var ImageResponse = class extends Response {
|
|
6
6
|
constructor(element, options = {}) {
|
|
7
7
|
let cancelled = false;
|
|
@@ -29,5 +29,4 @@ var ImageResponse = class extends Response {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { ImageResponse, OG_HEADERS, hasCJK, loadDefaultFonts, loadGoogleFont };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junejs/og",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "June — cross-platform OG image generation. Cloudflare Workers, Vercel Edge, and Node.js dev all share one import; the right backend is selected at build time via export conditions.",
|
|
6
6
|
"exports": {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@vercel/og": "^0.11.1",
|
|
58
58
|
"@types/react": "^19.3.0",
|
|
59
59
|
"react": "^19.2.0",
|
|
60
|
-
"satori": "^0.
|
|
60
|
+
"satori": "^0.64.3",
|
|
61
61
|
"typescript": "^7.0.0",
|
|
62
62
|
"workers-og": "^0.0.27"
|
|
63
63
|
},
|