@flowscripter/template-bun-rust-library 1.2.58 → 1.2.59

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
@@ -70,9 +70,9 @@ classDiagram
70
70
 
71
71
  ### Native Library Loading
72
72
 
73
- `src/lib.ts` opens the compiled Rust library with `loadLibrary` from [@flowscripter/bun-ffi-loader](https://github.com/flowscripter/bun-ffi-loader), passing the `ffiLibBaseUri` from `package.json` as `baseUri`. The loader uses the first of:
73
+ `src/lib.ts` opens the compiled Rust library with `loadLibrary` from [@flowscripter/bun-ffi-loader](https://github.com/flowscripter/bun-ffi-loader), passing the `ffiLibBaseUri` from `package.json` as `baseUri` and this package's own `target/release` as an absolute `releaseDir`. The loader uses the first of:
74
74
 
75
- 1. a local release build in `target/release` relative to the working directory
75
+ 1. a local release build in `target/release` inside this package (never the working directory)
76
76
  2. the installed copy in `~/.flowscripter/lib`
77
77
  3. a download from `ffiLibBaseUri` into `~/.flowscripter/lib`
78
78
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/template-bun-rust-library",
3
- "version": "1.2.57",
3
+ "version": "1.2.58",
4
4
  "description": "Project template for a Rust library with Bun FFI bindings",
5
5
  "keywords": [
6
6
  "bun",
@@ -51,7 +51,7 @@
51
51
  "peerDependencies": {
52
52
  "typescript": "^7.0.2"
53
53
  },
54
- "ffiLibBaseUri": "https://github.com/flowscripter/template-bun-rust-library/releases/download/v1.2.57",
54
+ "ffiLibBaseUri": "https://github.com/flowscripter/template-bun-rust-library/releases/download/v1.2.58",
55
55
  "typedocOptions": {
56
56
  "readme": "none",
57
57
  "exclude": [
@@ -1 +1 @@
1
- {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAE5B"}
1
+ {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAqBA;;GAEG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAE5B"}
package/dist/src/lib.js CHANGED
@@ -1,3 +1,4 @@
1
+ import path from "node:path";
1
2
  import { FFIType } from "bun:ffi";
2
3
  import { loadLibrary } from "@flowscripter/bun-ffi-loader";
3
4
  import packageJson from "../package.json";
@@ -6,7 +7,10 @@ const { symbols: { add }, } = await loadLibrary("flowscripter_template_bun_rust_
6
7
  args: [FFIType.i32, FFIType.i32],
7
8
  returns: FFIType.i32,
8
9
  },
9
- }, { baseUri: packageJson.ffiLibBaseUri });
10
+ }, {
11
+ baseUri: packageJson.ffiLibBaseUri,
12
+ releaseDir: path.join(import.meta.dir, "..", "target", "release"),
13
+ });
10
14
  /**
11
15
  * Adds 2 and 2 and logs the result as "World 4"
12
16
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/template-bun-rust-library",
3
- "version": "1.2.58",
3
+ "version": "1.2.59",
4
4
  "description": "Project template for a Rust library with Bun FFI bindings",
5
5
  "keywords": [
6
6
  "bun",
@@ -51,7 +51,7 @@
51
51
  "peerDependencies": {
52
52
  "typescript": "^7.0.2"
53
53
  },
54
- "ffiLibBaseUri": "https://github.com/flowscripter/template-bun-rust-library/releases/download/v1.2.58",
54
+ "ffiLibBaseUri": "https://github.com/flowscripter/template-bun-rust-library/releases/download/v1.2.59",
55
55
  "typedocOptions": {
56
56
  "readme": "none",
57
57
  "exclude": [
package/src/lib.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import path from "node:path";
1
2
  import { FFIType } from "bun:ffi";
2
3
  import { loadLibrary } from "@flowscripter/bun-ffi-loader";
3
4
  import packageJson from "../package.json";
@@ -12,7 +13,10 @@ const {
12
13
  returns: FFIType.i32,
13
14
  },
14
15
  },
15
- { baseUri: packageJson.ffiLibBaseUri },
16
+ {
17
+ baseUri: packageJson.ffiLibBaseUri,
18
+ releaseDir: path.join(import.meta.dir, "..", "target", "release"),
19
+ },
16
20
  );
17
21
 
18
22
  /**