@flowscripter/template-bun-rust-library 1.2.57 → 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 +4 -4
- package/dist/package.json +2 -2
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +5 -1
- package/package.json +2 -2
- package/src/lib.ts +5 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# template-bun-rust-library
|
|
2
2
|
|
|
3
3
|
[](https://github.com/flowscripter/template-bun-rust-library/releases)
|
|
4
|
-
[](https://github.com/flowscripter/template-bun-rust-library/actions/workflows/release-bun-rust-library.yml)
|
|
5
|
-
[](https://github.com/flowscripter/template-bun-rust-library/
|
|
4
|
+
[](https://github.com/flowscripter/template-bun-rust-library/actions/workflows/release-bun-rust-library.yml?query=branch%3Amain+is%3Asuccess)
|
|
5
|
+
[](https://github.com/flowscripter/template-bun-rust-library/blob/badges/coverage.md)
|
|
6
6
|
[](https://flowscripter.github.io/template-bun-rust-library/index.html)
|
|
7
7
|
[](https://docs.rs/flowscripter_template_bun_rust_library)
|
|
8
8
|
[](https://github.com/flowscripter/template-bun-rust-library/blob/main/LICENSE)
|
|
@@ -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`
|
|
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.
|
|
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.
|
|
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": [
|
package/dist/src/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"
|
|
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
|
-
}, {
|
|
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.
|
|
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.
|
|
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
|
-
{
|
|
16
|
+
{
|
|
17
|
+
baseUri: packageJson.ffiLibBaseUri,
|
|
18
|
+
releaseDir: path.join(import.meta.dir, "..", "target", "release"),
|
|
19
|
+
},
|
|
16
20
|
);
|
|
17
21
|
|
|
18
22
|
/**
|