@flowscripter/template-bun-rust-library 1.1.19 → 1.2.0

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
@@ -35,6 +35,10 @@ Install dependencies:
35
35
 
36
36
  `bun install`
37
37
 
38
+ Build (produces `dist/` for Node.js and TypeScript consumers; Bun uses raw source directly):
39
+
40
+ `bun run build`
41
+
38
42
  Test:
39
43
 
40
44
  `cargo test`
@@ -0,0 +1,2 @@
1
+ export function world(): void;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":"AAgIA,8BAEC"}
@@ -0,0 +1,2 @@
1
+ export * from "./src/lib.ts";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,134 @@
1
+ // @bun
2
+ // src/lib.ts
3
+ import { dlopen, FFIType } from "bun:ffi";
4
+
5
+ // src/lib-path.ts
6
+ import os from "os";
7
+ import { suffix } from "bun:ffi";
8
+ import path from "path";
9
+ import { mkdir } from "fs/promises";
10
+ // package.json
11
+ var package_default = {
12
+ name: "@flowscripter/template-bun-rust-library",
13
+ version: "1.1.19",
14
+ description: "Project template for a Rust library with Bun FFI bindings",
15
+ keywords: [
16
+ "bun",
17
+ "example",
18
+ "ffi",
19
+ "library",
20
+ "rust",
21
+ "template"
22
+ ],
23
+ homepage: "https://github.com/flowscripter/template-bun-rust-library#readme",
24
+ license: "MIT",
25
+ repository: {
26
+ type: "git",
27
+ url: "git+https://github.com/flowscripter/template-bun-rust-library.git"
28
+ },
29
+ files: [
30
+ "dist",
31
+ "src",
32
+ "index.ts",
33
+ "README.md",
34
+ "LICENSE"
35
+ ],
36
+ type: "module",
37
+ main: "dist/index.js",
38
+ module: "dist/index.js",
39
+ types: "dist/index.d.ts",
40
+ exports: {
41
+ ".": {
42
+ bun: "./index.ts",
43
+ types: "./dist/index.d.ts",
44
+ default: "./dist/index.js"
45
+ }
46
+ },
47
+ publishConfig: {
48
+ access: "public"
49
+ },
50
+ scripts: {
51
+ build: "bun build index.ts --outdir dist --target bun && tsc -p tsconfig.build.json"
52
+ },
53
+ devDependencies: {
54
+ "@types/bun": "^1.3.14",
55
+ oxfmt: "0.56.0",
56
+ oxlint: "1.71.0"
57
+ },
58
+ peerDependencies: {
59
+ typescript: "^6.0.3"
60
+ },
61
+ ffiLibBaseUri: "https://github.com/flowscripter/template-bun-rust-library/releases/download/v1.1.19",
62
+ typedocOptions: {
63
+ readme: "none",
64
+ exclude: [
65
+ "tests/**"
66
+ ]
67
+ }
68
+ };
69
+
70
+ // src/lib-path.ts
71
+ function buildLocalLibName(libName, libSuffix) {
72
+ const base = `${libName}.${libSuffix}`;
73
+ return libSuffix === "dll" ? base : `lib${base}`;
74
+ }
75
+ function buildRemoteLibName(libName, libSuffix, arch) {
76
+ if (libSuffix === "so")
77
+ return `${arch}.${libSuffix}`;
78
+ if (libSuffix === "dll")
79
+ return `${libName}.${arch}.${libSuffix}`;
80
+ return buildLocalLibName(libName, libSuffix);
81
+ }
82
+ function buildRemoteUrl(baseUri, remoteLibName) {
83
+ const base = baseUri.endsWith("/") ? baseUri : baseUri + "/";
84
+ return new URL(remoteLibName, base).href;
85
+ }
86
+ async function getLibPath(libName) {
87
+ const fullLibName = buildLocalLibName(libName, suffix);
88
+ const builtLibPath = path.join("target", "release", fullLibName);
89
+ console.debug(`builtLibPath: ${builtLibPath}`);
90
+ const builtLibFile = Bun.file(builtLibPath);
91
+ let exists = await builtLibFile.exists();
92
+ console.debug(`${builtLibPath} exists: ${exists}`);
93
+ if (exists) {
94
+ return builtLibPath;
95
+ }
96
+ const installedLibFolder = path.join(os.homedir(), ".flowscripter", "lib");
97
+ const installedLibPath = path.join(installedLibFolder, fullLibName);
98
+ const installedLibFile = Bun.file(installedLibPath);
99
+ exists = await installedLibFile.exists();
100
+ console.debug(`${installedLibPath} exists: ${exists}`);
101
+ if (exists) {
102
+ return installedLibPath;
103
+ }
104
+ console.debug(`packageJson.ffiLibBaseUri: ${package_default.ffiLibBaseUri}`);
105
+ const remoteLibName = buildRemoteLibName(libName, suffix, process.arch);
106
+ const remotePath = buildRemoteUrl(package_default.ffiLibBaseUri, remoteLibName);
107
+ console.debug(`remotePath: ${remotePath}`);
108
+ await mkdir(installedLibFolder, { recursive: true });
109
+ try {
110
+ const result = await fetch(remotePath);
111
+ await Bun.write(installedLibPath, result);
112
+ } catch (e) {
113
+ console.error(`Failed to download ${remotePath} to ${installedLibPath}: ${e}`);
114
+ }
115
+ return installedLibPath;
116
+ }
117
+
118
+ // src/lib.ts
119
+ var libPath = await getLibPath("flowscripter_template_bun_rust_library");
120
+ console.debug(`dlopen libPath: ${libPath}`);
121
+ var {
122
+ symbols: { add }
123
+ } = dlopen(libPath, {
124
+ add: {
125
+ args: [FFIType.i32, FFIType.i32],
126
+ returns: FFIType.i32
127
+ }
128
+ });
129
+ function world() {
130
+ console.info(`World ${add(2, 2)}`);
131
+ }
132
+ export {
133
+ world
134
+ };
@@ -0,0 +1,5 @@
1
+ export declare function buildLocalLibName(libName: string, libSuffix: string): string;
2
+ export declare function buildRemoteLibName(libName: string, libSuffix: string, arch: string): string;
3
+ export declare function buildRemoteUrl(baseUri: string, remoteLibName: string): string;
4
+ export declare function getLibPath(libName: string): Promise<string>;
5
+ //# sourceMappingURL=lib-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib-path.d.ts","sourceRoot":"","sources":["../../src/lib-path.ts"],"names":[],"mappings":"AAMA,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI3F;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAG7E;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,mBAgD/C"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Adds 2 and 2 and logs the result as "World 4"
3
+ */
4
+ export declare function world(): void;
5
+ //# sourceMappingURL=lib.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAE5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/template-bun-rust-library",
3
- "version": "1.1.19",
3
+ "version": "1.2.0",
4
4
  "description": "Project template for a Rust library with Bun FFI bindings",
5
5
  "keywords": [
6
6
  "bun",
@@ -16,11 +16,30 @@
16
16
  "type": "git",
17
17
  "url": "git+https://github.com/flowscripter/template-bun-rust-library.git"
18
18
  },
19
+ "files": [
20
+ "dist",
21
+ "src",
22
+ "index.ts",
23
+ "README.md",
24
+ "LICENSE"
25
+ ],
19
26
  "type": "module",
20
- "module": "index.ts",
27
+ "main": "dist/index.js",
28
+ "module": "dist/index.js",
29
+ "types": "dist/index.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "bun": "./index.ts",
33
+ "types": "./dist/index.d.ts",
34
+ "default": "./dist/index.js"
35
+ }
36
+ },
21
37
  "publishConfig": {
22
38
  "access": "public"
23
39
  },
40
+ "scripts": {
41
+ "build": "bun build index.ts --outdir dist --target bun && tsc -p tsconfig.build.json"
42
+ },
24
43
  "devDependencies": {
25
44
  "@types/bun": "^1.3.14",
26
45
  "oxfmt": "0.56.0",
@@ -29,7 +48,7 @@
29
48
  "peerDependencies": {
30
49
  "typescript": "^6.0.3"
31
50
  },
32
- "ffiLibBaseUri": "https://github.com/flowscripter/template-bun-rust-library/releases/download/v1.1.19",
51
+ "ffiLibBaseUri": "https://github.com/flowscripter/template-bun-rust-library/releases/download/v1.2.0",
33
52
  "typedocOptions": {
34
53
  "readme": "none",
35
54
  "exclude": [
@@ -1,12 +0,0 @@
1
- name: check-bun-dependencies
2
- on:
3
- workflow_dispatch:
4
- schedule:
5
- - cron: "0 0 * * 1,4"
6
- permissions:
7
- contents: read
8
- pull-requests: write
9
- jobs:
10
- call-check-bun-dependencies:
11
- uses: flowscripter/.github/.github/workflows/check-bun-dependencies.yml@v1
12
- secrets: inherit
@@ -1,12 +0,0 @@
1
- name: check-rust-dependencies
2
- on:
3
- workflow_dispatch:
4
- schedule:
5
- - cron: "0 1 * * 1,4"
6
- permissions:
7
- contents: read
8
- pull-requests: write
9
- jobs:
10
- call-check-deno-dependencies:
11
- uses: flowscripter/.github/.github/workflows/check-rust-dependencies.yml@v1
12
- secrets: inherit
@@ -1,13 +0,0 @@
1
- name: lint-pr-message
2
- on:
3
- pull_request_target:
4
- types:
5
- - opened
6
- - edited
7
- - synchronize
8
- permissions:
9
- contents: read
10
- jobs:
11
- call-lint-pr-message:
12
- uses: flowscripter/.github/.github/workflows/lint-pr-message.yml@v1
13
- secrets: inherit
@@ -1,15 +0,0 @@
1
- name: release-bun-rust-library
2
- on:
3
- push:
4
- branches: [main]
5
- permissions:
6
- contents: write
7
- issues: write
8
- pull-requests: write
9
- id-token: write
10
- pages: write
11
- packages: write
12
- jobs:
13
- call-release-bun-rust-library:
14
- uses: flowscripter/.github/.github/workflows/release-bun-rust-library.yml@v1
15
- secrets: inherit
@@ -1,10 +0,0 @@
1
- name: validate-bun-rust-library-pr
2
- on:
3
- pull_request:
4
- branches: [main]
5
- permissions:
6
- contents: read
7
- jobs:
8
- call-validate-bun-rust-library-pr:
9
- uses: flowscripter/.github/.github/workflows/validate-bun-rust-library-pr.yml@v1
10
- secrets: inherit
package/Cargo.lock DELETED
@@ -1,16 +0,0 @@
1
- # This file is automatically @generated by Cargo.
2
- # It is not intended for manual editing.
3
- version = 4
4
-
5
- [[package]]
6
- name = "flowscripter_template_bun_rust_library"
7
- version = "1.1.19"
8
- dependencies = [
9
- "flowscripter_template_rust_library",
10
- ]
11
-
12
- [[package]]
13
- name = "flowscripter_template_rust_library"
14
- version = "1.1.12"
15
- source = "registry+https://github.com/rust-lang/crates.io-index"
16
- checksum = "efde44ad50aba46f123ab73240f242bdc47de1ae88ce4ef6765aeadda9564071"
package/Cargo.toml DELETED
@@ -1,15 +0,0 @@
1
- [package]
2
- name = "flowscripter_template_bun_rust_library"
3
- version = "1.1.19"
4
- edition = "2021"
5
- description = "Project template for a Rust library with Bun FFI bindings."
6
- homepage = "https://github.com/flowscripter"
7
- license = "MIT"
8
- repository = "https://github.com/flowscripter/template-bun-rust-library"
9
- exclude = [".github/"]
10
-
11
- [lib]
12
- crate-type = ["cdylib", "lib"]
13
-
14
- [dependencies]
15
- flowscripter_template_rust_library = "1.1.12"
package/bun.lock DELETED
@@ -1,110 +0,0 @@
1
- {
2
- "lockfileVersion": 1,
3
- "configVersion": 0,
4
- "workspaces": {
5
- "": {
6
- "name": "@flowscripter/template-bun-rust-library",
7
- "devDependencies": {
8
- "@types/bun": "^1.3.14",
9
- "oxfmt": "0.56.0",
10
- "oxlint": "1.71.0",
11
- },
12
- "peerDependencies": {
13
- "typescript": "^6.0.3",
14
- },
15
- },
16
- },
17
- "packages": {
18
- "@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.56.0", "", { "os": "android", "cpu": "arm" }, "sha512-CSCxi7ovYojgfdPOdUb9T508HKeAdDIKeRGg7x8IZwVJrWz9gVgX7MbUnFqtQAE4QvoNo07mj2JlwnOzJw4qqA=="],
19
-
20
- "@oxfmt/binding-android-arm64": ["@oxfmt/binding-android-arm64@0.56.0", "", { "os": "android", "cpu": "arm64" }, "sha512-HYJFnd+PkDwf6S9ZPGzXXtjNqvRWFnnhdbWaouh4mi/SxU8wmDuzlMn3xo/wDTGnr4Q1VA7ZzOaE/D4biW0W6A=="],
21
-
22
- "@oxfmt/binding-darwin-arm64": ["@oxfmt/binding-darwin-arm64@0.56.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-sftR/bEOr+t1gs+evwsHi/Xbq2FAPA2uU3VMr8n6ZU9PoK/IMSfnfu7+OEe/uy1+knhrFl4Wvy7Vkm3uo9mJ7g=="],
23
-
24
- "@oxfmt/binding-darwin-x64": ["@oxfmt/binding-darwin-x64@0.56.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-z66SdjLqa3MUPKvTp3Mbb5nSjKSbnYxJGeB+Wx987s8T5hPcIRiBMfnJ6zcPgYtQn3x5xjvdzNVkXrSeYH6ZFg=="],
25
-
26
- "@oxfmt/binding-freebsd-x64": ["@oxfmt/binding-freebsd-x64@0.56.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-t2tkrV1vtZyaItSQ71dTi2ZVKZEI39b/LqLT12V5KMfIeXK6N32TUC1jhOXKVQmhECq9j2ZXMQV3JeT1kh9Vmg=="],
27
-
28
- "@oxfmt/binding-linux-arm-gnueabihf": ["@oxfmt/binding-linux-arm-gnueabihf@0.56.0", "", { "os": "linux", "cpu": "arm" }, "sha512-+gCy+Tp3RHeXQ9y/QrS76lXIpZkbziTyp6hIgjB2MssCwfMph3vG/GEfkhO34Rai1vhYIaUkvv8UT1BcDorJPw=="],
29
-
30
- "@oxfmt/binding-linux-arm-musleabihf": ["@oxfmt/binding-linux-arm-musleabihf@0.56.0", "", { "os": "linux", "cpu": "arm" }, "sha512-0kKkVvQ2I+FJ2sxQyUu1zJ0yWP5kcWse/yVFnGQSFCXMwSSkfEaUGu0dW774O7nyy3jrcBGap7OSc8dZmU/CdA=="],
31
-
32
- "@oxfmt/binding-linux-arm64-gnu": ["@oxfmt/binding-linux-arm64-gnu@0.56.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-npkA2siMbyWRh+wEhi1aTAx4RirukGcGNt8V4Ch86pG+xU9aurqS1MZOnKYMu03ISwat3rB6zkQx51SsB9obNw=="],
33
-
34
- "@oxfmt/binding-linux-arm64-musl": ["@oxfmt/binding-linux-arm64-musl@0.56.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-UekqOjGkV4/MkqreCV9SPIB2jlR3/HbXrmhV1rVXJZ9wfDXMyCMriLtq3tHqLY4PkbVWNtfcm1kMojJ26KLSJw=="],
35
-
36
- "@oxfmt/binding-linux-ppc64-gnu": ["@oxfmt/binding-linux-ppc64-gnu@0.56.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-XSzveSpeZMD5XJpew5lRFVtNnT04xd3rJxENXmk7wkZzN9oWzv2aFJyoNDhOtoz69BYaS/fg4SYl+CfEZRpB0Q=="],
37
-
38
- "@oxfmt/binding-linux-riscv64-gnu": ["@oxfmt/binding-linux-riscv64-gnu@0.56.0", "", { "os": "linux", "cpu": "none" }, "sha512-EkQ0nJa7k7HDDIVuPF7WY+k4k+bzdclLYtyIXNt7/OqVghfNiMym6YGppFBgx1XRIHW6QylxBz5OogumPjPJbQ=="],
39
-
40
- "@oxfmt/binding-linux-riscv64-musl": ["@oxfmt/binding-linux-riscv64-musl@0.56.0", "", { "os": "linux", "cpu": "none" }, "sha512-dyjAGW8jKRge0ik6U/dgvQG0nVpA3iBlRskQTz5qJLvQWIrySxX5jpqzPetLBNIIZ231KA82fDdi1nLTk8ENCw=="],
41
-
42
- "@oxfmt/binding-linux-s390x-gnu": ["@oxfmt/binding-linux-s390x-gnu@0.56.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-60ZGH3LtfqlW8X6vcLdSFY4lvCQYINurttYBKaALnHCDVAUCYJ1LsUgS6p1XOzVlzEDx3yNUZvDF1Lvt59zoZw=="],
43
-
44
- "@oxfmt/binding-linux-x64-gnu": ["@oxfmt/binding-linux-x64-gnu@0.56.0", "", { "os": "linux", "cpu": "x64" }, "sha512-u1suj1tgJHK4ZqB7buCtdbNef2n8+d0lXTPJwLHNmtyK6p+DTpsaoDvmqhQrA56fgKYv4LuRxNtL8YooebKOew=="],
45
-
46
- "@oxfmt/binding-linux-x64-musl": ["@oxfmt/binding-linux-x64-musl@0.56.0", "", { "os": "linux", "cpu": "x64" }, "sha512-aYGLvlQHt80y+qKEtfJY/Nm27G0125Lv+qyh9SJ4Cjc6lXnXjD+ndfhqQnbV24POpMi7rNRi0jvx/0d70FRpCQ=="],
47
-
48
- "@oxfmt/binding-openharmony-arm64": ["@oxfmt/binding-openharmony-arm64@0.56.0", "", { "os": "none", "cpu": "arm64" }, "sha512-H/re/gO+7ysVc+kywHNuzY3C33EN9sQcZhg0kp1ZwOZl7y998ZE5mhnBiuGR/nYI0pqLL5xQfrHVUOJ/cIJsCA=="],
49
-
50
- "@oxfmt/binding-win32-arm64-msvc": ["@oxfmt/binding-win32-arm64-msvc@0.56.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-6qLNXfXmtAs8jXDvYMkxk6Wec5SUJoew+ZX1uOZmqaR7ks0EJFbAohuOCELDyJMWyVlxotVG8Xf8m74Bfq0O2w=="],
51
-
52
- "@oxfmt/binding-win32-ia32-msvc": ["@oxfmt/binding-win32-ia32-msvc@0.56.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-UXEXuKphAe15bsob4AswNMArCw38XSmUIs3wk1s6e6MX9OWGW/IRWU95s1hZDiVg09STy1jHgyN2qkqbu1FT0w=="],
53
-
54
- "@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win32-x64-msvc@0.56.0", "", { "os": "win32", "cpu": "x64" }, "sha512-HPyNDjky+NIOuaMvHZflR+kst3YWdUOH2JUQYkf99grqZ5mEBTQM6h9iGy501Z8Xt5xMScrwHOuVCOlqDrktRw=="],
55
-
56
- "@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.71.0", "", { "os": "android", "cpu": "arm" }, "sha512-ImGmd1njEg4FEJH03jhRnveEegtO3czCtfptvaHivKAZQIYATbVFBrrzbaYMYv0oJioTnxZAZVSyV+oL7W8S2g=="],
57
-
58
- "@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.71.0", "", { "os": "android", "cpu": "arm64" }, "sha512-4A5BEexBrwY1YFF8Kiq/lp/wQPRG79G3BWIE1FuWaM5MvmpYSd+7ZySVcKkHdwo0UDzdQGddp6pD9mpctMqLnw=="],
59
-
60
- "@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.71.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-9wJA9GJulLwS2usU3CEisI/ESDO1n1z9eyTCvApMDrAkbJ1ve0mORgTMjcWWsKxkzkeZ2N/Gpra5IQE7x8tYgQ=="],
61
-
62
- "@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.71.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-PlLCjS06V0PeJMAJwzjrExw1sYNW9Gch3JtNlcwwZDXGlTYDuwHNN89zYH8LTXFfgkVtsYvs2nv0FqrzyuFDzg=="],
63
-
64
- "@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.71.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-Lhil7bWre0ncxbUoDoxfS0JzpTz17BRQKW7iwoAUY8GJ66+WwJEfYPCFJ1P0WgVZR5/O/b3Q2pENlHOjeXLOGQ=="],
65
-
66
- "@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.71.0", "", { "os": "linux", "cpu": "arm" }, "sha512-Oo9/L58PYD3RC0x05d2upAPLllHytTjHQGsnC06P6Ynn7jKkp5mdImQxXdJ3+FnBaKspNpGogzgVsi6g872LiA=="],
67
-
68
- "@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.71.0", "", { "os": "linux", "cpu": "arm" }, "sha512-mSHfyfgJrEbyIR29ejaeS50BdPk+GoNPlC1dckpDiUZbJAIel68sjSMdOt4WY0/gva+ECC7FNITQkxMJU+vSBw=="],
69
-
70
- "@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.71.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-n9yY4M2tiy3aij4AqtlnspzpfdpeT5JQfK2/w2d8oyp5W0FRwOb1dIeX99nORNcxGr08iD9bH8N5XFz3I2iy8w=="],
71
-
72
- "@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.71.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-fJZrs5sDZtTaPIOiemRQQmo82Ezy+vOGXemPc4Ok7iVVsYsFa7SlW6Z5XN819VfsqBHRm3NJ3rTdnR8+bJYJdQ=="],
73
-
74
- "@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.71.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-cwl7VKGERIy9p+G+AvZdfy/06q0aHXaTt/mMRReC751iuNYJgqKjB7NydXSS30nBT9vtr2tunciOtrR4fD6FUA=="],
75
-
76
- "@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.71.0", "", { "os": "linux", "cpu": "none" }, "sha512-eZ8ieVXvzGi8jr7+ybQGPK2STw3mldfxZlgA2738iflfB/rzA69sE6m5rDRpQaxC7dpm745Enlh1Tod0QAk9Gg=="],
77
-
78
- "@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.71.0", "", { "os": "linux", "cpu": "none" }, "sha512-puMDbQYe6+NXwfMusojoA7CXGn2b3utukmd23PQqc1E3XhVCwyZ+FueSMzDYeNgDV2dUfIVXAAKZBcFDeCL6sA=="],
79
-
80
- "@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.71.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-4NJLxBs1ujISCt3L/1FcywLs73PWtJuw+piD6feK2V6h6OS6P7xu9/sWt1DTRLibe6QCzmfZzmM/2HPORoV/Lg=="],
81
-
82
- "@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.71.0", "", { "os": "linux", "cpu": "x64" }, "sha512-cFDaiR8L3430qp88tfZnvFlt3KotFhR/DlbIL0nHOMMYiG/9Wy4l+6f7t8G8pTa9bd8Lt8+M0y/qjRQ/xcB74g=="],
83
-
84
- "@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.71.0", "", { "os": "linux", "cpu": "x64" }, "sha512-orfixdt76KlpNly9z0PkWBBNfwjKz+JFVLP/7wnVchlKNU9Dpt9InU/ZggeSej6fC7qwHmHNOGlhLnQXcYoGuA=="],
85
-
86
- "@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.71.0", "", { "os": "none", "cpu": "arm64" }, "sha512-9emQu2lAp6yhPB3XuI+++vR+l/o6JR1X+EpxwcumPdQXBWXEPAsquPGL7l158EqU8SebQMXTUa/S5zN98juyHw=="],
87
-
88
- "@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.71.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-bd5kI8spYwTm3BILDtGhi73zoup5dw8MlPQNT8YB3BD5UIsjNe3K9/4ctrzQMX4SZMoK5HgzVLkLJzacEXB7fA=="],
89
-
90
- "@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.71.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-W4HvOHGzVLHcrmFu+bMrJlho+/yrlX5ZNdJZqGe8MEldkQG+RHYhxxad9P4jvWAYFmIqUA5i9DQ8QsJqSU9GIw=="],
91
-
92
- "@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.71.0", "", { "os": "win32", "cpu": "x64" }, "sha512-D2kyEIPHk/G/wiZLnwTVC/sVst+T/lKldVOjAFpgTIBUAOlry72e5OiapDbDBF4LfJLkN5ypJb/8Eu6yJzkveQ=="],
93
-
94
- "@types/bun": ["@types/bun@1.3.14", "", { "dependencies": { "bun-types": "1.3.14" } }, "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw=="],
95
-
96
- "@types/node": ["@types/node@22.13.4", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-ywP2X0DYtX3y08eFVx5fNIw7/uIv8hYUKgXoK8oayJlLnKcRfEYCxWMVE1XagUdVtCJlZT1AU4LXEABW+L1Peg=="],
97
-
98
- "bun-types": ["bun-types@1.3.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="],
99
-
100
- "oxfmt": ["oxfmt@0.56.0", "", { "dependencies": { "tinypool": "2.1.0" }, "optionalDependencies": { "@oxfmt/binding-android-arm-eabi": "0.56.0", "@oxfmt/binding-android-arm64": "0.56.0", "@oxfmt/binding-darwin-arm64": "0.56.0", "@oxfmt/binding-darwin-x64": "0.56.0", "@oxfmt/binding-freebsd-x64": "0.56.0", "@oxfmt/binding-linux-arm-gnueabihf": "0.56.0", "@oxfmt/binding-linux-arm-musleabihf": "0.56.0", "@oxfmt/binding-linux-arm64-gnu": "0.56.0", "@oxfmt/binding-linux-arm64-musl": "0.56.0", "@oxfmt/binding-linux-ppc64-gnu": "0.56.0", "@oxfmt/binding-linux-riscv64-gnu": "0.56.0", "@oxfmt/binding-linux-riscv64-musl": "0.56.0", "@oxfmt/binding-linux-s390x-gnu": "0.56.0", "@oxfmt/binding-linux-x64-gnu": "0.56.0", "@oxfmt/binding-linux-x64-musl": "0.56.0", "@oxfmt/binding-openharmony-arm64": "0.56.0", "@oxfmt/binding-win32-arm64-msvc": "0.56.0", "@oxfmt/binding-win32-ia32-msvc": "0.56.0", "@oxfmt/binding-win32-x64-msvc": "0.56.0" }, "peerDependencies": { "svelte": "^5.0.0", "vite-plus": "*" }, "optionalPeers": ["svelte", "vite-plus"], "bin": { "oxfmt": "bin/oxfmt" } }, "sha512-9Dv0wV3zKiyvhjD7bRKaInKmHQ1sPx3RGOjQkGFJbbdQ16576yf8qhMSO9Q9cvHcs+1NpBsRTkuDDYFFPTJ6gw=="],
101
-
102
- "oxlint": ["oxlint@1.71.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.71.0", "@oxlint/binding-android-arm64": "1.71.0", "@oxlint/binding-darwin-arm64": "1.71.0", "@oxlint/binding-darwin-x64": "1.71.0", "@oxlint/binding-freebsd-x64": "1.71.0", "@oxlint/binding-linux-arm-gnueabihf": "1.71.0", "@oxlint/binding-linux-arm-musleabihf": "1.71.0", "@oxlint/binding-linux-arm64-gnu": "1.71.0", "@oxlint/binding-linux-arm64-musl": "1.71.0", "@oxlint/binding-linux-ppc64-gnu": "1.71.0", "@oxlint/binding-linux-riscv64-gnu": "1.71.0", "@oxlint/binding-linux-riscv64-musl": "1.71.0", "@oxlint/binding-linux-s390x-gnu": "1.71.0", "@oxlint/binding-linux-x64-gnu": "1.71.0", "@oxlint/binding-linux-x64-musl": "1.71.0", "@oxlint/binding-openharmony-arm64": "1.71.0", "@oxlint/binding-win32-arm64-msvc": "1.71.0", "@oxlint/binding-win32-ia32-msvc": "1.71.0", "@oxlint/binding-win32-x64-msvc": "1.71.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.22.1", "vite-plus": "*" }, "optionalPeers": ["oxlint-tsgolint", "vite-plus"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-U1m1X+C0vDj7DC1e13IoZULzEcPczE7UOMTs8VlZGHUEIUaSTZKo5qkPsQEfzpgnQ29Pea/w3Xntk62UCecxZw=="],
103
-
104
- "tinypool": ["tinypool@2.1.0", "", {}, "sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw=="],
105
-
106
- "typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="],
107
-
108
- "undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="],
109
- }
110
- }
@@ -1,6 +0,0 @@
1
- use flowscripter_template_bun_rust_library;
2
-
3
- #[test]
4
- fn world_works() {
5
- assert_eq!(4, flowscripter_template_bun_rust_library::add(2, 2));
6
- }
@@ -1,69 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { buildLocalLibName, buildRemoteLibName, buildRemoteUrl } from "../src/lib-path.ts";
3
-
4
- describe("buildLocalLibName", () => {
5
- test("Linux .so gets lib prefix", () => {
6
- expect(buildLocalLibName("foo", "so")).toBe("libfoo.so");
7
- });
8
-
9
- test("macOS .dylib gets lib prefix", () => {
10
- expect(buildLocalLibName("foo", "dylib")).toBe("libfoo.dylib");
11
- });
12
-
13
- test("Windows .dll has no lib prefix", () => {
14
- expect(buildLocalLibName("foo", "dll")).toBe("foo.dll");
15
- });
16
- });
17
-
18
- describe("buildRemoteLibName", () => {
19
- test("Linux x64", () => {
20
- expect(buildRemoteLibName("foo", "so", "x64")).toBe("x64.so");
21
- });
22
-
23
- test("Linux arm64", () => {
24
- expect(buildRemoteLibName("foo", "so", "arm64")).toBe("arm64.so");
25
- });
26
-
27
- test("macOS uses local naming (no arch suffix)", () => {
28
- expect(buildRemoteLibName("foo", "dylib", "arm64")).toBe("libfoo.dylib");
29
- expect(buildRemoteLibName("foo", "dylib", "x64")).toBe("libfoo.dylib");
30
- });
31
-
32
- test("Windows x64", () => {
33
- expect(buildRemoteLibName("foo", "dll", "x64")).toBe("foo.x64.dll");
34
- });
35
-
36
- test("Windows arm64", () => {
37
- expect(buildRemoteLibName("foo", "dll", "arm64")).toBe("foo.arm64.dll");
38
- });
39
- });
40
-
41
- describe("buildRemoteUrl", () => {
42
- test("base without trailing slash", () => {
43
- expect(buildRemoteUrl("https://example.com/releases/v1.0", "x64.so")).toBe(
44
- "https://example.com/releases/v1.0/x64.so",
45
- );
46
- });
47
-
48
- test("base with trailing slash", () => {
49
- expect(buildRemoteUrl("https://example.com/releases/v1.0/", "x64.so")).toBe(
50
- "https://example.com/releases/v1.0/x64.so",
51
- );
52
- });
53
-
54
- test("does not corrupt https:// into https:/", () => {
55
- const url = buildRemoteUrl("https://github.com/org/repo/releases/download/v1.0", "x64.so");
56
- expect(url).toBe("https://github.com/org/repo/releases/download/v1.0/x64.so");
57
- expect(url.startsWith("https://")).toBe(true);
58
- });
59
-
60
- test("real-world example matches expected release asset URL", () => {
61
- const url = buildRemoteUrl(
62
- "https://github.com/flowscripter/template-bun-rust-library/releases/download/v1.1.5",
63
- "x64.so",
64
- );
65
- expect(url).toBe(
66
- "https://github.com/flowscripter/template-bun-rust-library/releases/download/v1.1.5/x64.so",
67
- );
68
- });
69
- });
@@ -1,9 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { world } from "../src/lib.ts";
3
-
4
- describe("World Tests", () => {
5
- test("Simple Test", () => {
6
- world();
7
- expect(true);
8
- });
9
- });
package/tsconfig.json DELETED
@@ -1,31 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- // Enable latest features
4
- "lib": ["ESNext", "DOM"],
5
- "target": "ESNext",
6
- "module": "ESNext",
7
- "moduleDetection": "force",
8
- "jsx": "react-jsx",
9
- "allowJs": true,
10
-
11
- // Bundler mode
12
- "moduleResolution": "bundler",
13
- "allowImportingTsExtensions": true,
14
- "verbatimModuleSyntax": true,
15
- "noEmit": true,
16
-
17
- // Types
18
- "types": ["bun", "node"],
19
-
20
- // Best practices
21
- "strict": true,
22
- "skipLibCheck": true,
23
- "noFallthroughCasesInSwitch": true,
24
-
25
- // Some stricter flags (disabled by default)
26
- "noUnusedLocals": false,
27
- "noUnusedParameters": false,
28
- "noPropertyAccessFromIndexSignature": false
29
- },
30
- "exclude": ["tests"]
31
- }