takumi-js 2.0.2 → 2.1.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.
- package/README.md +1 -0
- package/dist/backend/node.cjs +2 -1
- package/dist/backend/node.mjs +2 -1
- package/package.json +14 -4
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# takumi-js
|
|
5
5
|
|
|
6
6
|
**Render JSX to SVG or images. Drop-in next/og replacement.**
|
|
7
|
+
|
|
7
8
|
OG cards, banners, and lightweight animations from one Rust engine, no headless browser required.
|
|
8
9
|
|
|
9
10
|
[Documentation](https://takumi.kane.tw/docs/) · [Playground](https://takumi.kane.tw/playground)
|
package/dist/backend/node.cjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/backend/node.ts
|
|
3
|
-
const
|
|
3
|
+
const loadNative = () => import("@takumi-rs/core").catch((cause) => {
|
|
4
4
|
throw new Error("Failed to load the native @takumi-rs/core backend. On a runtime without the native addon, pass a `module` (a WASM binary) to render with the WASM backend instead.", { cause });
|
|
5
5
|
});
|
|
6
|
+
const loadBackend = (module) => typeof process !== "undefined" && process.versions?.webcontainer ? Promise.resolve().then(() => require("./wasm.cjs")).then((backend) => backend.loadBackend(module)) : loadNative(module);
|
|
6
7
|
//#endregion
|
|
7
8
|
exports.loadBackend = loadBackend;
|
package/dist/backend/node.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/backend/node.ts
|
|
2
|
-
const
|
|
2
|
+
const loadNative = () => import("@takumi-rs/core").catch((cause) => {
|
|
3
3
|
throw new Error("Failed to load the native @takumi-rs/core backend. On a runtime without the native addon, pass a `module` (a WASM binary) to render with the WASM backend instead.", { cause });
|
|
4
4
|
});
|
|
5
|
+
const loadBackend = (module) => typeof process !== "undefined" && process.versions?.webcontainer ? import("./wasm.mjs").then((backend) => backend.loadBackend(module)) : loadNative(module);
|
|
5
6
|
//#endregion
|
|
6
7
|
export { loadBackend };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "takumi-js",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "All-in-one Takumi package for Node.js and WebAssembly runtimes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -77,6 +77,16 @@
|
|
|
77
77
|
"default": "./dist/backend/wasm.cjs"
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
+
"unwasm": {
|
|
81
|
+
"import": {
|
|
82
|
+
"types": "./dist/backend/wasm.d.mts",
|
|
83
|
+
"default": "./dist/backend/wasm.mjs"
|
|
84
|
+
},
|
|
85
|
+
"require": {
|
|
86
|
+
"types": "./dist/backend/wasm.d.cts",
|
|
87
|
+
"default": "./dist/backend/wasm.cjs"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
80
90
|
"bun": {
|
|
81
91
|
"import": {
|
|
82
92
|
"types": "./dist/backend/node.d.mts",
|
|
@@ -202,9 +212,9 @@
|
|
|
202
212
|
"publish-lint": "attw --pack . && publint --strict ."
|
|
203
213
|
},
|
|
204
214
|
"dependencies": {
|
|
205
|
-
"@takumi-rs/core": "2.0
|
|
206
|
-
"@takumi-rs/helpers": "2.0
|
|
207
|
-
"@takumi-rs/wasm": "2.0
|
|
215
|
+
"@takumi-rs/core": "2.1.0",
|
|
216
|
+
"@takumi-rs/helpers": "2.1.0",
|
|
217
|
+
"@takumi-rs/wasm": "2.1.0"
|
|
208
218
|
},
|
|
209
219
|
"devDependencies": {
|
|
210
220
|
"@types/bun": "^1.3.14",
|