@slatedb/uniffi 0.12.0 → 0.12.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.
package/README.md CHANGED
@@ -127,7 +127,7 @@ You only need these tools when regenerating bindings, running tests from this re
127
127
  Install the generator with:
128
128
 
129
129
  ```bash
130
- cargo install uniffi-bindgen-node-js --version 0.0.7
130
+ cargo install uniffi-bindgen-node-js --version 0.0.13
131
131
  ```
132
132
 
133
133
  Install the package dependency used by the generated bindings with:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slatedb/uniffi",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Node.js bindings for SlateDB generated from UniFFI and packaged with native libraries.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
package/slatedb-ffi.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export interface FfiMetadata {
2
2
  namespace: string;
3
3
  cdylibName: string;
4
- stagedLibraryFileName: string;
5
4
  stagedLibraryPackageRelativePath: string;
6
5
  bundledPrebuilds: boolean;
7
6
  manualLoad: boolean;
package/slatedb-ffi.js CHANGED
@@ -26,7 +26,6 @@ import {
26
26
  export const ffiMetadata = Object.freeze({
27
27
  namespace: "slatedb",
28
28
  cdylibName: "slatedb_uniffi",
29
- stagedLibraryFileName: "libslatedb_uniffi.so",
30
29
  stagedLibraryPackageRelativePath: "prebuilds/linux-x64-gnu/libslatedb_uniffi.so",
31
30
  bundledPrebuilds: true,
32
31
  manualLoad: false,
@@ -342,9 +341,29 @@ function defaultBundledTarget() {
342
341
  return `${platform}-${arch}-${linuxLibc}`;
343
342
  }
344
343
 
344
+ function bundledLibraryFileName(platform) {
345
+ switch (platform) {
346
+ case "win32":
347
+ return `${ffiMetadata.cdylibName}.dll`;
348
+ case "darwin":
349
+ return `lib${ffiMetadata.cdylibName}.dylib`;
350
+ case "aix":
351
+ case "android":
352
+ case "freebsd":
353
+ case "linux":
354
+ case "openbsd":
355
+ return `lib${ffiMetadata.cdylibName}.so`;
356
+ default:
357
+ throw new Error(
358
+ `Unsupported Node platform ${JSON.stringify(platform)} for UniFFI bundled prebuild resolution.`,
359
+ );
360
+ }
361
+ }
362
+
345
363
  function defaultBundledLibrary() {
364
+ const platform = bundledPrebuildPlatform();
346
365
  const target = defaultBundledTarget();
347
- const filename = ffiMetadata.stagedLibraryFileName;
366
+ const filename = bundledLibraryFileName(platform);
348
367
  return Object.freeze({
349
368
  target,
350
369
  packageRelativePath: `prebuilds/${target}/${filename}`,