@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.
Files changed (69) hide show
  1. package/README.md +35 -193
  2. package/dist/client/assets/NotoSans-Bold.ttf +0 -0
  3. package/dist/client/assets/NotoSans-Regular.ttf +0 -0
  4. package/dist/client/component.d.ts +19 -0
  5. package/dist/client/component.js +32 -0
  6. package/dist/client/create.d.ts +7 -0
  7. package/dist/client/create.js +8 -0
  8. package/dist/client/engines/satori.d.ts +4 -0
  9. package/dist/client/engines/satori.js +81 -0
  10. package/dist/client/engines/takumi.d.ts +7 -0
  11. package/dist/client/engines/takumi.js +9 -0
  12. package/dist/client/fonts.d.ts +2 -0
  13. package/dist/client/fonts.js +36 -0
  14. package/dist/client/image-response.d.ts +13 -0
  15. package/dist/client/image-response.js +88 -0
  16. package/dist/client/index.d.ts +4 -0
  17. package/dist/client/index.js +6 -0
  18. package/dist/client/render.d.ts +7 -0
  19. package/dist/client/render.js +37 -0
  20. package/dist/client/types.d.ts +14 -0
  21. package/dist/client/types.js +1 -0
  22. package/dist/fonts.d.ts +4 -4
  23. package/dist/fonts.js +17 -13
  24. package/dist/helpers/create.d.ts +7 -4
  25. package/dist/helpers/create.js +39 -28
  26. package/dist/helpers/defaults.d.ts +4 -4
  27. package/dist/helpers/defaults.js +28 -18
  28. package/dist/helpers/emoji.d.ts +1 -1
  29. package/dist/helpers/emoji.js +31 -21
  30. package/dist/helpers/error-handler.d.ts +38 -0
  31. package/dist/helpers/error-handler.js +76 -0
  32. package/dist/helpers/logger.d.ts +7 -0
  33. package/dist/helpers/logger.js +21 -0
  34. package/dist/helpers/response.d.ts +30 -0
  35. package/dist/helpers/response.js +52 -0
  36. package/dist/helpers/to-html.d.ts +10 -0
  37. package/dist/helpers/to-html.js +10 -0
  38. package/dist/helpers/toJSX.d.ts +3 -3
  39. package/dist/helpers/toJSX.js +9 -7
  40. package/dist/helpers/utils.d.ts +2 -0
  41. package/dist/helpers/utils.js +25 -0
  42. package/dist/image-response.d.ts +2 -2
  43. package/dist/image-response.js +13 -21
  44. package/dist/plugin.d.ts +11 -0
  45. package/dist/plugin.js +44 -12
  46. package/dist/providers/instances.d.ts +3 -3
  47. package/dist/providers/instances.js +43 -15
  48. package/dist/providers/resvg/edge.d.ts +1 -1
  49. package/dist/providers/resvg/edge.js +10 -6
  50. package/dist/providers/resvg/node.d.ts +1 -1
  51. package/dist/providers/resvg/node.js +18 -9
  52. package/dist/providers/satori/edge.d.ts +6 -0
  53. package/dist/providers/satori/edge.js +12 -0
  54. package/dist/providers/satori/node.d.ts +1 -1
  55. package/dist/providers/satori/node.js +4 -4
  56. package/dist/takumi/fonts.d.ts +16 -0
  57. package/dist/takumi/fonts.js +15 -0
  58. package/dist/takumi/image-response.d.ts +6 -0
  59. package/dist/takumi/image-response.js +27 -0
  60. package/dist/takumi/index.d.ts +5 -0
  61. package/dist/takumi/index.js +4 -0
  62. package/dist/takumi/render.d.ts +4 -0
  63. package/dist/takumi/render.js +23 -0
  64. package/dist/takumi/renderer.d.ts +7 -0
  65. package/dist/takumi/renderer.js +39 -0
  66. package/dist/takumi/types.d.ts +64 -0
  67. package/dist/takumi/types.js +1 -0
  68. package/dist/types.d.ts +10 -14
  69. package/package.json +76 -21
package/dist/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import type { SatoriOptions } from 'satori/wasm';
2
- import type { EmojiType } from './helpers/emoji.js';
3
- export type Font = SatoriOptions['fonts'][number];
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['style'];
6
- export type FontWeight = Font['weight'];
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['tailwindConfig'];
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?: 'svg' | 'png';
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, any>;
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, any>;
81
+ style?: Record<string, unknown>;
82
82
  children?: string | VNode | VNode[];
83
- [prop: string]: any;
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.1-next.3",
3
+ "version": "4.4.0-next.1",
4
4
  "license": "MIT",
5
5
  "homepage": "https://sveltekit-og.dev",
6
- "repository": "github:ethercorps/sveltekit-og",
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
- "prepublishOnly": "npm run package",
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
- "lint": "prettier --plugin-search-dir . --check . && eslint .",
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
- "@sveltejs/adapter-vercel": "^5.10.2",
45
- "@sveltejs/kit": "^2.48.5",
46
- "@sveltejs/package": "^2.5.4",
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.7.1",
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.0",
97
+ "eslint-config-prettier": "^8.10.2",
98
+ "eslint-plugin-oxlint": "^1.55.0",
54
99
  "eslint-plugin-svelte": "^2.46.1",
55
- "prettier": "^3.6.2",
56
- "prettier-plugin-svelte": "^3.4.0",
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.43.12",
60
- "svelte-check": "^4.3.2",
107
+ "svelte": "^5.53.10",
108
+ "svelte-check": "^4.4.5",
61
109
  "tslib": "^2.8.1",
62
110
  "typescript": "^5.9.3",
63
- "vite": "^5.4.19",
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.10.14",
122
+ "satori": "^0.25.0",
73
123
  "satori-html": "0.3.2",
74
- "std-env": "^3.9.0",
75
- "unwasm": "^0.5.0"
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
- "packageManager": "pnpm@10.12.1"
81
- }
131
+ "peerDependenciesMeta": {
132
+ "takumi-js": {
133
+ "optional": true
134
+ }
135
+ }
136
+ }