@galfus/transport-bun 0.31.1-alpha → 0.32.3-alpha

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.
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galfus/transport-bun",
3
- "version": "0.31.1-alpha",
3
+ "version": "0.32.3-alpha",
4
4
  "description": "Bun native FFI transport for Galfus Engine",
5
5
  "author": "Renato Rodrigues (morbden) <renato@vulppi.dev>",
6
6
  "license": "Apache-2.0",
@@ -34,6 +34,6 @@
34
34
  ".": "./src/index.ts"
35
35
  },
36
36
  "dependencies": {
37
- "@galfus/transport-types": "^0.31.1-alpha"
37
+ "@galfus/transport-types": "^0.32.3-alpha"
38
38
  }
39
39
  }
package/src/sdk/galfus.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  /* Automatically generated by Galfus Engine codegen. Do not edit directly. */
2
2
  import { ptr as bunPtr, CString, dlopen, FFIType, toArrayBuffer } from 'bun:ffi';
3
3
  import { existsSync } from 'fs';
4
- import { resolve } from 'path';
4
+ import { dirname, resolve } from 'path';
5
+ import { getArtifactFileName, resolveNativePlatform } from '@galfus/transport-types';
5
6
  import { ViewportRect } from '@galfus/transport-types';
6
7
  import type {
7
8
  AnimationEvent,
@@ -101,11 +102,25 @@ export type {
101
102
  };
102
103
  export { ViewportRect };
103
104
 
104
- import { getArtifactFileName, resolveNativePlatform } from '@galfus/transport-types';
105
-
106
105
  function locateLibrary(): string {
107
106
  const platform = resolveNativePlatform();
108
107
  const filename = getArtifactFileName('ffi', platform);
108
+
109
+ // 1. Check adjacent to standalone compiled executable
110
+ if (typeof process.execPath === 'string') {
111
+ const execAdjacent = resolve(dirname(process.execPath), filename);
112
+ if (existsSync(execAdjacent)) {
113
+ return execAdjacent;
114
+ }
115
+ }
116
+
117
+ // 2. Check current working directory
118
+ const cwdAdjacent = resolve(process.cwd(), filename);
119
+ if (existsSync(cwdAdjacent)) {
120
+ return cwdAdjacent;
121
+ }
122
+
123
+ // 3. Fallback to package dist directory (monorepo / local dev)
109
124
  const baseDir = typeof import.meta.dir === 'string' ? import.meta.dir : process.cwd();
110
125
  const localDistPath = resolve(baseDir, '../../dist', platform, filename);
111
126
  if (existsSync(localDistPath)) {