@ethercorps/sveltekit-og 4.2.0-next.2 → 4.2.0

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 (2) hide show
  1. package/README.md +29 -7
  2. package/package.json +71 -73
package/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Dynamically generate Open Graph images from an HTML+CSS template or Svelte component using fast and efficient conversion from HTML > SVG > PNG. Based on [Satori](https://github.com/vercel/satori#documentation). No headless browser required.
4
4
 
5
- ## Disclaimer
6
- This project doesn't support edge services like vercel edge and cloudflare workers.
5
+ ## Docs
6
+ - With sveltekit-og@4, we have [official documentation](https://sveltekit-og.dev).
7
7
 
8
8
  ## Installation
9
9
 
@@ -13,12 +13,28 @@ pnpm install @ethercorps/sveltekit-og
13
13
 
14
14
  ## Usage
15
15
 
16
+ ### Vite (Recommended)
17
+
18
+ - Add vite plugin
19
+
20
+ ```typescript title="vite.cofig.js"
21
+ import { sveltekit } from '@sveltejs/kit/vite';
22
+ import { sveltekitOG } from '@ethercorps/sveltekit-og/plugin';
23
+ const config = {
24
+ plugins: [sveltekit(), sveltekitOG()]
25
+ };
26
+
27
+ export default config;
28
+ ```
29
+
30
+ ### Rollup (will be deprecated in v5)
16
31
  - Add `rollupWasm` to `build.rollupOptions.plugins` in `vite.cofig.js` file.
17
- -
18
- ```ts
32
+ - For more information, check [docs](https://sveltekit-og.dev/docs/getting-started)
33
+
34
+ ```ts title="vite.cofig.js"
19
35
  import { sveltekit } from '@sveltejs/kit/vite';
20
36
  import { defineConfig } from 'vitest/config';
21
- import { rollupWasm } from './src/lib/plugin.js';
37
+ import { rollupWasm } from '@ethercorps/sveltekit-og/plugin';
22
38
 
23
39
  export default defineConfig({
24
40
  plugins: [sveltekit()],
@@ -31,8 +47,13 @@ export default defineConfig({
31
47
  ```
32
48
 
33
49
  - For node adapter update config with `rollupWasm`
50
+ - Check node runtime [docs](https://sveltekit-og.dev/docs/runtime/node)
51
+
52
+ ```ts title="vite.cofig.js"
53
+ import { sveltekit } from '@sveltejs/kit/vite';
54
+ import { defineConfig } from 'vitest/config';
55
+ import { rollupWasm } from '@ethercorps/sveltekit-og/plugin';
34
56
 
35
- ```ts
36
57
  export default defineConfig({
37
58
  plugins: [sveltekit()],
38
59
  build: {
@@ -93,7 +114,7 @@ Then run `npm dev` and visit `localhost:5173/og` to view your generated PNG. Rem
93
114
 
94
115
  ## Example Output
95
116
 
96
- ![Rendered OG image](static/demo.png)
117
+ ![Rendered OG image](https://vercel.sveltekit-og.dev)
97
118
 
98
119
  ## Headers
99
120
 
@@ -199,6 +220,7 @@ This project will not be possible without the following projects:
199
220
 
200
221
  - [Satori & @vercel/og](https://github.com/vercel/satori)
201
222
  - [Noto by Google Fonts](https://fonts.google.com/noto)
223
+ - [fineshopdesign](https://github.com/fineshopdesign/cf-wasm)
202
224
 
203
225
  ## Authors
204
226
 
package/package.json CHANGED
@@ -1,75 +1,73 @@
1
1
  {
2
- "name": "@ethercorps/sveltekit-og",
3
- "version": "4.2.0-next.2",
4
- "scripts": {
5
- "dev": "vite dev",
6
- "build": "vite build && npm run package",
7
- "preview": "vite preview",
8
- "package": "svelte-kit sync && svelte-package && publint",
9
- "prepublishOnly": "npm run package",
10
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
11
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
12
- "test": "vitest",
13
- "lint": "prettier --plugin-search-dir . --check . && eslint .",
14
- "format": "prettier --plugin-search-dir . --write .",
15
- "publishBeta": "npm publish --tag beta"
16
- },
17
- "exports": {
18
- ".": {
19
- "types": "./dist/index.d.ts",
20
- "svelte": "./dist/index.js",
21
- "import": "./dist/index.js"
22
- },
23
- "./fonts": {
24
- "types": "./dist/fonts.d.ts",
25
- "import": "./dist/fonts.js"
26
- },
27
- "./plugin": {
28
- "types": "./dist/plugin.d.ts",
29
- "import": "./dist/plugin.js"
30
- }
31
- },
32
- "files": [
33
- "dist",
34
- "!dist/**/*.test.*",
35
- "!dist/**/*.spec.*"
36
- ],
37
- "devDependencies": {
38
- "@sveltejs/adapter-vercel": "^5.10.2",
39
- "@sveltejs/kit": "^2.48.5",
40
- "@sveltejs/package": "^2.5.4",
41
- "@sveltejs/vite-plugin-svelte": "^4.0.4",
42
- "@types/node": "^24.7.1",
43
- "@typescript-eslint/eslint-plugin": "^5.62.0",
44
- "@typescript-eslint/parser": "^5.62.0",
45
- "css-tree": "^2.3.1",
46
- "eslint": "^8.57.1",
47
- "eslint-config-prettier": "^8.10.0",
48
- "eslint-plugin-svelte": "^2.46.1",
49
- "prettier": "^3.6.2",
50
- "prettier-plugin-svelte": "^3.4.0",
51
- "publint": "^0.1.16",
52
- "rollup-plugin-visualizer": "^5.14.0",
53
- "svelte": "^5.43.12",
54
- "svelte-check": "^4.3.2",
55
- "tslib": "^2.8.1",
56
- "typescript": "^5.9.3",
57
- "vite": "^5.4.19",
58
- "vitest": "^1.6.1"
59
- },
60
- "main": "./dist/index.js",
61
- "svelte": "./dist/index.js",
62
- "types": "./dist/index.d.ts",
63
- "type": "module",
64
- "dependencies": {
65
- "@resvg/resvg-wasm": "^2.6.2",
66
- "satori": "^0.10.14",
67
- "satori-html": "0.3.2",
68
- "std-env": "^3.9.0",
69
- "unwasm": "^0.5.0"
70
- },
71
- "peerDependencies": {
72
- "@sveltejs/kit": ">=2.0.0"
73
- },
74
- "packageManager": "pnpm@10.12.1"
2
+ "name": "@ethercorps/sveltekit-og",
3
+ "version": "4.2.0",
4
+ "exports": {
5
+ ".": {
6
+ "types": "./dist/index.d.ts",
7
+ "svelte": "./dist/index.js",
8
+ "import": "./dist/index.js"
9
+ },
10
+ "./fonts": {
11
+ "types": "./dist/fonts.d.ts",
12
+ "import": "./dist/fonts.js"
13
+ },
14
+ "./plugin": {
15
+ "types": "./dist/plugin.d.ts",
16
+ "import": "./dist/plugin.js"
17
+ }
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "!dist/**/*.test.*",
22
+ "!dist/**/*.spec.*"
23
+ ],
24
+ "devDependencies": {
25
+ "@sveltejs/adapter-vercel": "^5.10.2",
26
+ "@sveltejs/kit": "^2.48.5",
27
+ "@sveltejs/package": "^2.5.4",
28
+ "@sveltejs/vite-plugin-svelte": "^4.0.4",
29
+ "@types/node": "^24.7.1",
30
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
31
+ "@typescript-eslint/parser": "^5.62.0",
32
+ "css-tree": "^2.3.1",
33
+ "eslint": "^8.57.1",
34
+ "eslint-config-prettier": "^8.10.0",
35
+ "eslint-plugin-svelte": "^2.46.1",
36
+ "prettier": "^3.6.2",
37
+ "prettier-plugin-svelte": "^3.4.0",
38
+ "publint": "^0.1.16",
39
+ "rollup-plugin-visualizer": "^5.14.0",
40
+ "svelte": "^5.43.12",
41
+ "svelte-check": "^4.3.2",
42
+ "tslib": "^2.8.1",
43
+ "typescript": "^5.9.3",
44
+ "vite": "^5.4.19",
45
+ "vitest": "^1.6.1"
46
+ },
47
+ "main": "./dist/index.js",
48
+ "svelte": "./dist/index.js",
49
+ "types": "./dist/index.d.ts",
50
+ "type": "module",
51
+ "dependencies": {
52
+ "@resvg/resvg-wasm": "^2.6.2",
53
+ "satori": "^0.10.14",
54
+ "satori-html": "0.3.2",
55
+ "std-env": "^3.9.0",
56
+ "unwasm": "^0.5.0"
57
+ },
58
+ "peerDependencies": {
59
+ "@sveltejs/kit": ">=2.0.0"
60
+ },
61
+ "scripts": {
62
+ "dev": "vite dev",
63
+ "build": "vite build && npm run package",
64
+ "preview": "vite preview",
65
+ "package": "svelte-kit sync && svelte-package && publint",
66
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
67
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
68
+ "test": "vitest",
69
+ "lint": "prettier --plugin-search-dir . --check . && eslint .",
70
+ "format": "prettier --plugin-search-dir . --write .",
71
+ "publishBeta": "npm publish --tag beta"
72
+ }
75
73
  }