@corelauncher/rod 1.0.4 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corelauncher/rod",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Webview for bun based on tauri's tao and wry.",
5
5
  "keywords": [
6
6
  "corelauncher",
package/src-ts/ffi.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { dlopen, FFIType, suffix } from "bun:ffi";
2
- import { isPackaged } from "./utilities/npm";
1
+ import { dlopen, FFIType } from "bun:ffi";
3
2
 
4
3
  let library: { default: string };
5
- if (isPackaged()) {
6
- library = await import(`../target/release/rod.${suffix}`);
4
+ if (process.env.WEBVIEW_PATH) {
5
+ library = { default: process.env.WEBVIEW_PATH };
6
+ } else if (process.platform === "win32") {
7
+ library = await import("../target/release/rod.dll");
7
8
  } else {
8
- library = await import(`../target/debug/rod.${suffix}`);
9
+ throw new Error("Unsupported platform");
9
10
  }
10
- // const path = join(import.meta.dir, "..", "target", "debug", `rod.${suffix}`);
11
11
 
12
12
  const {
13
13
  symbols: {
package/src-ts/index.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  import Rod from "./classes/rod";
2
+ import type WebView from "./classes/webview";
3
+ import type Window from "./classes/window";
2
4
  export default Rod;
3
5
  export { Rod };
4
6
  export * from "./types";
7
+ export type { WebView };
8
+ export type { Window };
@@ -1,7 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import { join } from "node:path";
3
-
4
- export function isPackaged() {
5
- const modules = join(import.meta.dir, "..", "..", "node_modules");
6
- return !existsSync(modules);
7
- }