@flowscripter/template-bun-rust-library 1.1.18 → 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.18",
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,20 +16,39 @@
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
- "oxfmt": "0.55.0",
27
- "oxlint": "1.70.0"
45
+ "oxfmt": "0.56.0",
46
+ "oxlint": "1.71.0"
28
47
  },
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.18",
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 * * *"
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 * * *"
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.18"
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.18"
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.55.0",
10
- "oxlint": "1.70.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.55.0", "", { "os": "android", "cpu": "arm" }, "sha512-+rFDOqQe5LOWgxrAJaZgLRudr6GQm0wGI6gtu7vVkrdLGjNMUSGbAlaCr8j7F2H2Er97vYQCU8WDb30onqMM1g=="],
19
-
20
- "@oxfmt/binding-android-arm64": ["@oxfmt/binding-android-arm64@0.55.0", "", { "os": "android", "cpu": "arm64" }, "sha512-ctulLq8s3x8Zmvw6+iccB09TIKERAklRSmbJ10gk8mlAn05qZxoyo52dj3Hi9IJcmDSwF54fQaTVh2CbL6PInw=="],
21
-
22
- "@oxfmt/binding-darwin-arm64": ["@oxfmt/binding-darwin-arm64@0.55.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-xDQczLH9pw/RBk1h/GH0qcGMm8hQtmtVHBNLSH3lk1gEIR09hZ4L+mJQl4VqiVAvPK9VG9PYrWWuSQLt7xTbiA=="],
23
-
24
- "@oxfmt/binding-darwin-x64": ["@oxfmt/binding-darwin-x64@0.55.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-JaNoFCkF2CJdGgpPSMbuO9HVyXyoNGIhMHPvp6NYAjeVKw9XEYc0HcUWJLPQa3Q69WV5wMa9m5jPMJPtbLtcRg=="],
25
-
26
- "@oxfmt/binding-freebsd-x64": ["@oxfmt/binding-freebsd-x64@0.55.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-DNbszhpg6S2MIzax5azdHFTTBIVkR5xr8yyRZuA4yoDAwOkzIp3tmldgKZM2+VlT+hJIG0xUksA+elISzMEAfA=="],
27
-
28
- "@oxfmt/binding-linux-arm-gnueabihf": ["@oxfmt/binding-linux-arm-gnueabihf@0.55.0", "", { "os": "linux", "cpu": "arm" }, "sha512-2snoaoRfFFyGnbOcKUK36rREBYxe/Xgz3uHbiA5zbCB/s6R4DQj4mHqYAaWWhgizCUSDxV8cE9zAZ0XleNpKGw=="],
29
-
30
- "@oxfmt/binding-linux-arm-musleabihf": ["@oxfmt/binding-linux-arm-musleabihf@0.55.0", "", { "os": "linux", "cpu": "arm" }, "sha512-q1aktHF/WRpSK81BX1dE/9vWrS2jGw1Nax2kb4DBLGAewubCLcoNyp4Zl/NSMgbv3vUS46Z33wIQkBVYOP3PYg=="],
31
-
32
- "@oxfmt/binding-linux-arm64-gnu": ["@oxfmt/binding-linux-arm64-gnu@0.55.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-VD0y36aENezl/3tsclA/4G53Cc7iV+7Uoh7gz4yvcOTaEYBtJpQsE6PKDGTtUtOvGS4kv51ybfXY/nWZejO5IA=="],
33
-
34
- "@oxfmt/binding-linux-arm64-musl": ["@oxfmt/binding-linux-arm64-musl@0.55.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-r8xlKJFcsRmn0H5jZrdORae6RX9jDBrZVvOoxF+bCQtampQJClv80aZEHsv+NsLsp2KCE5ql79O7DpPVzYWpXA=="],
35
-
36
- "@oxfmt/binding-linux-ppc64-gnu": ["@oxfmt/binding-linux-ppc64-gnu@0.55.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-GRKv/HXHcwIVld/WU61rF0g0R16hl5EJ+ScKdpjevT57lnLnagj/U2YUbXf2mT+2Pg1uCzWC+mvGicPV3CDdLQ=="],
37
-
38
- "@oxfmt/binding-linux-riscv64-gnu": ["@oxfmt/binding-linux-riscv64-gnu@0.55.0", "", { "os": "linux", "cpu": "none" }, "sha512-rdv57enTiPtpSYRMKfAiEbQb0Puw5t9N7isVinDoo5qeLDScro2gznmZqSgSWbVZRzLisTeCTW8Qwgw0bOHv3A=="],
39
-
40
- "@oxfmt/binding-linux-riscv64-musl": ["@oxfmt/binding-linux-riscv64-musl@0.55.0", "", { "os": "linux", "cpu": "none" }, "sha512-7v1nNrlD43VY6+sYQ6efYyb3lE6QY182304PD/768ZxTjOmFd/3dQa3u/nGBUAXYdGSWOQc5N3PnS0QzUXyEIA=="],
41
-
42
- "@oxfmt/binding-linux-s390x-gnu": ["@oxfmt/binding-linux-s390x-gnu@0.55.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-f4lJLUSPOgScjFl9LiflKCTocyNRwE25JmTMbN4XQdDjoZzEHjqf3wA3VESF1/csg7i8m7+EQLbrZyYDqe10UQ=="],
43
-
44
- "@oxfmt/binding-linux-x64-gnu": ["@oxfmt/binding-linux-x64-gnu@0.55.0", "", { "os": "linux", "cpu": "x64" }, "sha512-MihqiPziJNoWy4MqNSV+jVA1g+07iQDjZiR0vaCaDoPgFEiJpCMsxamktzLV07cEeQsSJ04vQaU4CzCQwIvtDA=="],
45
-
46
- "@oxfmt/binding-linux-x64-musl": ["@oxfmt/binding-linux-x64-musl@0.55.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Yqghym7KYAVjP9MmSrNZiDeerMuoejNjo0r3ox5H3GDKk8eAfl8VyJm9i+pWCLDCTnAbcTUMMN2ZKjUYXH1v3g=="],
47
-
48
- "@oxfmt/binding-openharmony-arm64": ["@oxfmt/binding-openharmony-arm64@0.55.0", "", { "os": "none", "cpu": "arm64" }, "sha512-s5SDvVVSbyQl1V5UU3Yl12M+XLUQ3rl5SglNqgAA2K4PXUtQhyNSS00wivONPEnNo5W01rCou8WkDNyvI/RGHg=="],
49
-
50
- "@oxfmt/binding-win32-arm64-msvc": ["@oxfmt/binding-win32-arm64-msvc@0.55.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-7p9FB5R32tw2KyyNX3wpQrR2WHwEHvMEiBlGXxeTCaRMCVNx3UtFMAUbaQ/pRNWIrEUZmYhJ6tcUH52uPTRYjQ=="],
51
-
52
- "@oxfmt/binding-win32-ia32-msvc": ["@oxfmt/binding-win32-ia32-msvc@0.55.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-ZYqj3fDnOT1IaVGMP5kpmkQl4F3tQIm2ZyAxvqkJYmI0xgWWak4ss4XYwv3VDfM+TWXeC9K4uQ/wW5jm/5XABA=="],
53
-
54
- "@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win32-x64-msvc@0.55.0", "", { "os": "win32", "cpu": "x64" }, "sha512-eEYT5tivGnGbPHuOHuQpi6CGLObhh0re/5jcNQHihD2GRYkTM85dyi5a19zjP8Q00t1uqAx+/QGLUGdHeqzWyg=="],
55
-
56
- "@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.70.0", "", { "os": "android", "cpu": "arm" }, "sha512-zFh0P4cswmRvw6nkyb89dr18rRanuaCPAsEXsFDoQY8WdaquI8Pt4NWFjaMJg6L23cy5NeN8J9cBnREbWzZhaw=="],
57
-
58
- "@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.70.0", "", { "os": "android", "cpu": "arm64" }, "sha512-qI8o4HZjeGiBrWv+pJv4lH0Yi2Gl/JSp/EumBUApezJprIKa5PS4nU0lQsQngtky8k+SplQIOjv6hwu0SSxeyg=="],
59
-
60
- "@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.70.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-8KjgVVHI5F9nVwHCRwwA78Ty7zNKP4Wd9OeN5PSv3iu/F/u1RVXoOCgLhWqust6HmwQG6xc8c+RCyaWENy24+w=="],
61
-
62
- "@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.70.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-WVydssv5PSUBXFJTdNBWlmGkbNmvPGaFt/2SUT/EZRB6bq6bEOHmMlbnupZD5jmlEvi9+mZJHi8TCw15lyfSfQ=="],
63
-
64
- "@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.70.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-hJucmUf8OlinHNb1R7fI4Fw6WsAstOz7i8nmkWQfiHoZXtbufNm+MxiDTIMk1ggh2Ro4vLzgQ+bKvRY54MZoRA=="],
65
-
66
- "@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.70.0", "", { "os": "linux", "cpu": "arm" }, "sha512-1BnS7wbCYDSXwWzJJ+mc3NURoha6m6m6RT5c6vgAY3oz7C3OVXP+S0awo2mRq97arrJkVvO3qRQfyAHL+76xtQ=="],
67
-
68
- "@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.70.0", "", { "os": "linux", "cpu": "arm" }, "sha512-yKy/UdbR55+M2yEcuiV5DCNC/gdQAjr/GioUy50QwBzSrKm8ueWADqyRLS9Xk+qjNeCYGg6A8FvUBds56ttfqg=="],
69
-
70
- "@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.70.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-0A5XJ4alvmqFUFP/4oYSyaO+qLto/HrKEWTSaegiVl+HOufFngK2BjYw9x4RbwBt/du5QG6l5q1zeWiJYYG5yg=="],
71
-
72
- "@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.70.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-JiylyurlB0CLSedNtx1gzv3FvfWPF1h/2Y3BJszPLNt5XQFlBsH5ke0Jle3iJb3uqu5m2e7A/DwzpuCAHdiU+A=="],
73
-
74
- "@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.70.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-J8VPG7I3/HmgaU4u8pNU2kFx2+0U+vPLS1dXFxXOaR/2TQ0f8AC7DRz0SRGRI1bfphnX2hVYTTtLuhL4nYKL+Q=="],
75
-
76
- "@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.70.0", "", { "os": "linux", "cpu": "none" }, "sha512-N2+4lV2KLN+oXTIIIwmWDhwkrnvqf5oX7Hw0zPjk+RuIVgiBQSOlJWF7uQoFx2siEYX0ZQ5cfSbEAHm+J3t7Wg=="],
77
-
78
- "@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.70.0", "", { "os": "linux", "cpu": "none" }, "sha512-1e2L7cFCvx9QDzq6NPP+0tABKb5z6nWHyddWTNKprEsjO9xNrAtPowuCGpjNXxkTdsMiZ4jc8YQ5SstZd4XK6g=="],
79
-
80
- "@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.70.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-Kwu/l/8GcYibCWA9m9N5pRXMIKVSsL/YbgpLzYkqDhWTiqdRfnNJ/+nqIKRKQiFbHWsdlHEhzMwruJK+qcEruA=="],
81
-
82
- "@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.70.0", "", { "os": "linux", "cpu": "x64" }, "sha512-tap04CsHYOl0nSAQJfPNIuBxqEPB2HnhQqwaOXLg1jnp2XfRo8Fa814dA4QC4zpvTWXCjAAaCY1W5LOORkEQuQ=="],
83
-
84
- "@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.70.0", "", { "os": "linux", "cpu": "x64" }, "sha512-hzJa/WgvtJpbBD9rgfy0qe+MjbxOXNUT0bfR1S6EQQzfTtBFA9xg5q8KSwRrQ2QfSS+TaP4j+4mVPQrfNc6UNg=="],
85
-
86
- "@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.70.0", "", { "os": "none", "cpu": "arm64" }, "sha512-xbsaNSNzVSnaJACCUYr1HQMyY/Q/Q1LkePmHG3UvZPvGCYGNxrsZp9OmtA6ick8xH47ltRRbRrPCM1YXYcyC+A=="],
87
-
88
- "@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.70.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-icAEsUI7JbW1TMRdEXV83mVAInhRVQYuuAlPpxdGwJ95chNdnCzjloRW8GglT0WvzOEZSio6fnYSk2DJ2Hv7LQ=="],
89
-
90
- "@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.70.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-FHMSWbVsPVs/f+Jcl04ws4JJ2wUnauyTzlpxWRG/lSO/8GpX08Fo2gQZqdA6CrRFI+zvkxl+N/KwJGWfUwYVZA=="],
91
-
92
- "@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.70.0", "", { "os": "win32", "cpu": "x64" }, "sha512-ptOlKwCz7n4AKs5VweMqG6DAg677FmKOK+vBkkL9DMNgFATIQ+upqUYBTOEwRQyRAx1ncGlPlXleV2hIcm3z4g=="],
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.55.0", "", { "dependencies": { "tinypool": "2.1.0" }, "optionalDependencies": { "@oxfmt/binding-android-arm-eabi": "0.55.0", "@oxfmt/binding-android-arm64": "0.55.0", "@oxfmt/binding-darwin-arm64": "0.55.0", "@oxfmt/binding-darwin-x64": "0.55.0", "@oxfmt/binding-freebsd-x64": "0.55.0", "@oxfmt/binding-linux-arm-gnueabihf": "0.55.0", "@oxfmt/binding-linux-arm-musleabihf": "0.55.0", "@oxfmt/binding-linux-arm64-gnu": "0.55.0", "@oxfmt/binding-linux-arm64-musl": "0.55.0", "@oxfmt/binding-linux-ppc64-gnu": "0.55.0", "@oxfmt/binding-linux-riscv64-gnu": "0.55.0", "@oxfmt/binding-linux-riscv64-musl": "0.55.0", "@oxfmt/binding-linux-s390x-gnu": "0.55.0", "@oxfmt/binding-linux-x64-gnu": "0.55.0", "@oxfmt/binding-linux-x64-musl": "0.55.0", "@oxfmt/binding-openharmony-arm64": "0.55.0", "@oxfmt/binding-win32-arm64-msvc": "0.55.0", "@oxfmt/binding-win32-ia32-msvc": "0.55.0", "@oxfmt/binding-win32-x64-msvc": "0.55.0" }, "peerDependencies": { "svelte": "^5.0.0", "vite-plus": "*" }, "optionalPeers": ["svelte", "vite-plus"], "bin": { "oxfmt": "bin/oxfmt" } }, "sha512-jSj2wCTakwgPMxkfiVZX0jf+nX+Nz6xlyAZjqNE0qXTFdCBPYlP6JAN+ODjmealw7DXBjOzYbdsqwBMAZnPZ6A=="],
101
-
102
- "oxlint": ["oxlint@1.70.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.70.0", "@oxlint/binding-android-arm64": "1.70.0", "@oxlint/binding-darwin-arm64": "1.70.0", "@oxlint/binding-darwin-x64": "1.70.0", "@oxlint/binding-freebsd-x64": "1.70.0", "@oxlint/binding-linux-arm-gnueabihf": "1.70.0", "@oxlint/binding-linux-arm-musleabihf": "1.70.0", "@oxlint/binding-linux-arm64-gnu": "1.70.0", "@oxlint/binding-linux-arm64-musl": "1.70.0", "@oxlint/binding-linux-ppc64-gnu": "1.70.0", "@oxlint/binding-linux-riscv64-gnu": "1.70.0", "@oxlint/binding-linux-riscv64-musl": "1.70.0", "@oxlint/binding-linux-s390x-gnu": "1.70.0", "@oxlint/binding-linux-x64-gnu": "1.70.0", "@oxlint/binding-linux-x64-musl": "1.70.0", "@oxlint/binding-openharmony-arm64": "1.70.0", "@oxlint/binding-win32-arm64-msvc": "1.70.0", "@oxlint/binding-win32-ia32-msvc": "1.70.0", "@oxlint/binding-win32-x64-msvc": "1.70.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.22.1", "vite-plus": "*" }, "optionalPeers": ["oxlint-tsgolint", "vite-plus"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-D6JgHtzkhRwvEC+A0Nw5AEc5bk8x5i1pHzvZIEf/a0C4hOzmAACNGtkDGPyFaxxX3ZVGxCPeig3P3rMM8XU3/g=="],
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
- }