@ethercorps/sveltekit-og 4.3.1-next.3 → 4.4.0-next.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.
- package/README.md +35 -193
- package/dist/client/assets/NotoSans-Bold.ttf +0 -0
- package/dist/client/assets/NotoSans-Regular.ttf +0 -0
- package/dist/client/component.d.ts +19 -0
- package/dist/client/component.js +32 -0
- package/dist/client/create.d.ts +7 -0
- package/dist/client/create.js +8 -0
- package/dist/client/engines/satori.d.ts +4 -0
- package/dist/client/engines/satori.js +81 -0
- package/dist/client/engines/takumi.d.ts +7 -0
- package/dist/client/engines/takumi.js +9 -0
- package/dist/client/fonts.d.ts +2 -0
- package/dist/client/fonts.js +36 -0
- package/dist/client/image-response.d.ts +13 -0
- package/dist/client/image-response.js +88 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +6 -0
- package/dist/client/render.d.ts +7 -0
- package/dist/client/render.js +37 -0
- package/dist/client/types.d.ts +14 -0
- package/dist/client/types.js +1 -0
- package/dist/fonts.d.ts +4 -4
- package/dist/fonts.js +17 -13
- package/dist/helpers/create.d.ts +7 -4
- package/dist/helpers/create.js +39 -28
- package/dist/helpers/defaults.d.ts +4 -4
- package/dist/helpers/defaults.js +28 -18
- package/dist/helpers/emoji.d.ts +1 -1
- package/dist/helpers/emoji.js +31 -21
- package/dist/helpers/error-handler.d.ts +38 -0
- package/dist/helpers/error-handler.js +76 -0
- package/dist/helpers/logger.d.ts +7 -0
- package/dist/helpers/logger.js +21 -0
- package/dist/helpers/response.d.ts +30 -0
- package/dist/helpers/response.js +52 -0
- package/dist/helpers/to-html.d.ts +10 -0
- package/dist/helpers/to-html.js +10 -0
- package/dist/helpers/toJSX.d.ts +3 -3
- package/dist/helpers/toJSX.js +9 -7
- package/dist/helpers/utils.d.ts +2 -0
- package/dist/helpers/utils.js +25 -0
- package/dist/image-response.d.ts +2 -2
- package/dist/image-response.js +13 -21
- package/dist/plugin.d.ts +11 -0
- package/dist/plugin.js +44 -12
- package/dist/providers/instances.d.ts +3 -3
- package/dist/providers/instances.js +43 -15
- package/dist/providers/resvg/edge.d.ts +1 -1
- package/dist/providers/resvg/edge.js +10 -6
- package/dist/providers/resvg/node.d.ts +1 -1
- package/dist/providers/resvg/node.js +18 -9
- package/dist/providers/satori/edge.d.ts +6 -0
- package/dist/providers/satori/edge.js +12 -0
- package/dist/providers/satori/node.d.ts +1 -1
- package/dist/providers/satori/node.js +4 -4
- package/dist/takumi/fonts.d.ts +16 -0
- package/dist/takumi/fonts.js +15 -0
- package/dist/takumi/image-response.d.ts +6 -0
- package/dist/takumi/image-response.js +27 -0
- package/dist/takumi/index.d.ts +5 -0
- package/dist/takumi/index.js +4 -0
- package/dist/takumi/render.d.ts +4 -0
- package/dist/takumi/render.js +23 -0
- package/dist/takumi/renderer.d.ts +7 -0
- package/dist/takumi/renderer.js +39 -0
- package/dist/takumi/types.d.ts +64 -0
- package/dist/takumi/types.js +1 -0
- package/dist/types.d.ts +10 -14
- package/package.json +76 -21
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { SatoriOptions } from
|
|
2
|
-
import type { EmojiType } from
|
|
3
|
-
export type Font = SatoriOptions[
|
|
1
|
+
import type { SatoriOptions } from "satori";
|
|
2
|
+
import type { EmojiType } from "./helpers/emoji.js";
|
|
3
|
+
export type Font = SatoriOptions["fonts"][number];
|
|
4
4
|
export type Fonts = Font[];
|
|
5
|
-
export type FontStyle = Font[
|
|
6
|
-
export type FontWeight = Font[
|
|
5
|
+
export type FontStyle = Font["style"];
|
|
6
|
+
export type FontWeight = Font["weight"];
|
|
7
7
|
export type FinalFontOptions = NonNullable<Fonts>;
|
|
8
8
|
export type ImageOptions = {
|
|
9
9
|
/**
|
|
@@ -30,7 +30,7 @@ export type ImageOptions = {
|
|
|
30
30
|
* Tailwind config
|
|
31
31
|
* @default provided by satori
|
|
32
32
|
* */
|
|
33
|
-
tailwindConfig?: SatoriOptions[
|
|
33
|
+
tailwindConfig?: SatoriOptions["tailwindConfig"];
|
|
34
34
|
/**
|
|
35
35
|
* Debug operations
|
|
36
36
|
* @default false
|
|
@@ -40,7 +40,7 @@ export type ImageOptions = {
|
|
|
40
40
|
* Image format
|
|
41
41
|
* @default png
|
|
42
42
|
* */
|
|
43
|
-
format?:
|
|
43
|
+
format?: "svg" | "png";
|
|
44
44
|
};
|
|
45
45
|
export type ResponseImageOptions = {
|
|
46
46
|
/**
|
|
@@ -70,7 +70,7 @@ export type ImageResponseOptions = ImageOptions & ResponseImageOptions;
|
|
|
70
70
|
* Svelte Component props to render the component which dynamic content
|
|
71
71
|
* */
|
|
72
72
|
export type ComponentOptions = {
|
|
73
|
-
props?: Record<string,
|
|
73
|
+
props?: Record<string, unknown>;
|
|
74
74
|
};
|
|
75
75
|
/**
|
|
76
76
|
* React virtual node, supported by satori as input (alternative to JSX input).
|
|
@@ -78,14 +78,10 @@ export type ComponentOptions = {
|
|
|
78
78
|
export interface VNode {
|
|
79
79
|
type: string;
|
|
80
80
|
props: {
|
|
81
|
-
style?: Record<string,
|
|
81
|
+
style?: Record<string, unknown>;
|
|
82
82
|
children?: string | VNode | VNode[];
|
|
83
|
-
[prop: string]:
|
|
83
|
+
[prop: string]: unknown;
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
/** utils types */
|
|
87
87
|
export type MayBePromise<T> = T | Promise<T>;
|
|
88
|
-
export type OnlyProps<T, P> = {
|
|
89
|
-
[K in keyof T as K extends P ? K : never]: T[K];
|
|
90
|
-
};
|
|
91
|
-
export type StringWithSuggestions<S extends string> = (string & Record<never, never>) | S;
|
package/package.json
CHANGED
|
@@ -1,22 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethercorps/sveltekit-og",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0-next.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://sveltekit-og.dev",
|
|
6
|
-
"repository": "github:
|
|
6
|
+
"repository": "github:etherCorps/sveltekit-og",
|
|
7
7
|
"funding": "https://github.com/sponsors/ethercorps",
|
|
8
8
|
"author": "Shivam Meena <https://github.com/theetherGit>",
|
|
9
9
|
"description": "Dynamically generate Open Graph images from an HTML, CSS template or Svelte component using fast and efficient conversion from HTML > SVG > PNG",
|
|
10
|
+
"contributors": [
|
|
11
|
+
{
|
|
12
|
+
"name": "Shivam Meena",
|
|
13
|
+
"github": "https://github.com/theetherGit"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "Jason",
|
|
17
|
+
"github": "https://github.com/jasongitmail"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "Mihkel Martin Kasterpalu",
|
|
21
|
+
"github": "https://github.com/MihkelMK"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "Luke Parke",
|
|
25
|
+
"github": "https://github.com/LukasParke"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "Willow (GHOST)",
|
|
29
|
+
"github": "https://github.com/ghostdevv"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "Minseo Lee",
|
|
33
|
+
"github": "https://github.com/quiple"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
10
36
|
"scripts": {
|
|
11
37
|
"dev": "vite dev",
|
|
12
38
|
"build": "vite build && npm run package",
|
|
13
39
|
"preview": "vite preview",
|
|
14
40
|
"package": "svelte-kit sync && svelte-package && publint",
|
|
15
|
-
"
|
|
41
|
+
"prepare": "svelte-kit sync && svelte-package",
|
|
42
|
+
"prepublishOnly": "pnpm run package",
|
|
16
43
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
17
44
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
18
45
|
"test": "vitest",
|
|
19
|
-
"
|
|
46
|
+
"bench": "vitest bench --run",
|
|
47
|
+
"bench:save": "vitest bench --run --outputJson benchmarks/baseline.json",
|
|
48
|
+
"bench:compare": "vitest bench --run --compare benchmarks/baseline.json",
|
|
49
|
+
"bench:snapshot": "node scripts/bench-snapshot.mjs",
|
|
50
|
+
"lint": "oxlint . && eslint .",
|
|
20
51
|
"format": "prettier --plugin-search-dir . --write .",
|
|
21
52
|
"publishBeta": "npm publish --tag beta"
|
|
22
53
|
},
|
|
@@ -30,10 +61,21 @@
|
|
|
30
61
|
"types": "./dist/fonts.d.ts",
|
|
31
62
|
"import": "./dist/fonts.js"
|
|
32
63
|
},
|
|
64
|
+
"./takumi": {
|
|
65
|
+
"types": "./dist/takumi/index.d.ts",
|
|
66
|
+
"svelte": "./dist/takumi/index.js",
|
|
67
|
+
"import": "./dist/takumi/index.js"
|
|
68
|
+
},
|
|
69
|
+
"./client": {
|
|
70
|
+
"types": "./dist/client/index.d.ts",
|
|
71
|
+
"svelte": "./dist/client/index.js",
|
|
72
|
+
"import": "./dist/client/index.js"
|
|
73
|
+
},
|
|
33
74
|
"./plugin": {
|
|
34
75
|
"types": "./dist/plugin.d.ts",
|
|
35
76
|
"import": "./dist/plugin.js"
|
|
36
|
-
}
|
|
77
|
+
},
|
|
78
|
+
"./package.json": "./package.json"
|
|
37
79
|
},
|
|
38
80
|
"files": [
|
|
39
81
|
"dist",
|
|
@@ -41,26 +83,34 @@
|
|
|
41
83
|
"!dist/**/*.spec.*"
|
|
42
84
|
],
|
|
43
85
|
"devDependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@sveltejs/
|
|
86
|
+
"@eslint/compat": "^2.0.3",
|
|
87
|
+
"@eslint/js": "^9.39.3",
|
|
88
|
+
"@sveltejs/adapter-auto": "^3.3.1",
|
|
89
|
+
"@sveltejs/kit": "^2.53.4",
|
|
90
|
+
"@sveltejs/package": "^2.5.7",
|
|
47
91
|
"@sveltejs/vite-plugin-svelte": "^4.0.4",
|
|
48
|
-
"@types/node": "^24.
|
|
92
|
+
"@types/node": "^24.11.0",
|
|
49
93
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
50
94
|
"@typescript-eslint/parser": "^5.62.0",
|
|
51
95
|
"css-tree": "^2.3.1",
|
|
52
96
|
"eslint": "^8.57.1",
|
|
53
|
-
"eslint-config-prettier": "^8.10.
|
|
97
|
+
"eslint-config-prettier": "^8.10.2",
|
|
98
|
+
"eslint-plugin-oxlint": "^1.55.0",
|
|
54
99
|
"eslint-plugin-svelte": "^2.46.1",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
100
|
+
"globals": "^16.5.0",
|
|
101
|
+
"oxlint": "^1.55.0",
|
|
102
|
+
"prettier": "^3.8.1",
|
|
103
|
+
"prettier-plugin-svelte": "^3.5.1",
|
|
104
|
+
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
57
105
|
"publint": "^0.1.16",
|
|
58
106
|
"rollup-plugin-visualizer": "^5.14.0",
|
|
59
|
-
"svelte": "^5.
|
|
60
|
-
"svelte-check": "^4.
|
|
107
|
+
"svelte": "^5.53.10",
|
|
108
|
+
"svelte-check": "^4.4.5",
|
|
61
109
|
"tslib": "^2.8.1",
|
|
62
110
|
"typescript": "^5.9.3",
|
|
63
|
-
"
|
|
111
|
+
"typescript-eslint": "^8.57.0",
|
|
112
|
+
"vite": "^5.4.21",
|
|
113
|
+
"takumi-js": "2.0.1",
|
|
64
114
|
"vitest": "^1.6.1"
|
|
65
115
|
},
|
|
66
116
|
"main": "./dist/index.js",
|
|
@@ -69,13 +119,18 @@
|
|
|
69
119
|
"type": "module",
|
|
70
120
|
"dependencies": {
|
|
71
121
|
"@resvg/resvg-wasm": "^2.6.2",
|
|
72
|
-
"satori": "^0.
|
|
122
|
+
"satori": "^0.25.0",
|
|
73
123
|
"satori-html": "0.3.2",
|
|
74
|
-
"std-env": "^
|
|
75
|
-
"unwasm": "^0.5.
|
|
124
|
+
"std-env": "^4.1.0",
|
|
125
|
+
"unwasm": "^0.5.3"
|
|
76
126
|
},
|
|
77
127
|
"peerDependencies": {
|
|
78
|
-
"@sveltejs/kit": ">=2.0.0"
|
|
128
|
+
"@sveltejs/kit": ">=2.0.0",
|
|
129
|
+
"takumi-js": "^2.0.1"
|
|
79
130
|
},
|
|
80
|
-
"
|
|
81
|
-
|
|
131
|
+
"peerDependenciesMeta": {
|
|
132
|
+
"takumi-js": {
|
|
133
|
+
"optional": true
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|