bun-scikit 0.1.1 → 0.1.2

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
@@ -62,8 +62,8 @@ bun install bun-scikit
62
62
 
63
63
  Postinstall behavior:
64
64
 
65
- - Downloads prebuilt native binaries from GitHub Releases for `linux-x64` and `windows-x64`.
66
- - If prebuilt binaries are unavailable, it falls back to local native build.
65
+ - Prebuilt native binaries for `linux-x64` and `windows-x64` are bundled in the npm package.
66
+ - No `bun pm trust` step is required for normal install/use.
67
67
  - macOS prebuilt binaries are currently not published.
68
68
 
69
69
  ## Usage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bun-scikit",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A scikit-learn-inspired machine learning library for Bun/TypeScript.",
5
5
  "license": "MIT",
6
6
  "module": "index.ts",
@@ -30,6 +30,7 @@
30
30
  },
31
31
  "files": [
32
32
  "index.ts",
33
+ "prebuilt",
33
34
  "src",
34
35
  "zig",
35
36
  "scripts",
@@ -43,7 +44,6 @@
43
44
  "bun": ">=1.3.9"
44
45
  },
45
46
  "scripts": {
46
- "install": "bun run scripts/install-native.ts",
47
47
  "test": "bun test",
48
48
  "typecheck": "bunx tsc --noEmit",
49
49
  "bench": "bun run bench/heart.bench.ts",
@@ -191,9 +191,16 @@ function candidateLibraryPaths(): string[] {
191
191
  const extension = suffix;
192
192
  const fileName = `bun_scikit_kernels.${extension}`;
193
193
  const explicitPath = process.env.BUN_SCIKIT_ZIG_LIB;
194
+ const platformPackagedPath =
195
+ process.platform === "win32"
196
+ ? resolve(import.meta.dir, "../../prebuilt/windows-x64", fileName)
197
+ : process.platform === "linux"
198
+ ? resolve(import.meta.dir, "../../prebuilt/linux-x64", fileName)
199
+ : null;
194
200
 
195
201
  const candidates = [
196
202
  explicitPath,
203
+ platformPackagedPath,
197
204
  resolve(process.cwd(), "dist", "native", fileName),
198
205
  resolve(process.cwd(), "native", fileName),
199
206
  resolve(import.meta.dir, "../../dist/native", fileName),
@@ -204,8 +211,15 @@ function candidateLibraryPaths(): string[] {
204
211
  }
205
212
 
206
213
  function candidateAddonPaths(): string[] {
214
+ const platformPackagedPath =
215
+ process.platform === "win32"
216
+ ? resolve(import.meta.dir, "../../prebuilt/windows-x64", "bun_scikit_node_addon.node")
217
+ : process.platform === "linux"
218
+ ? resolve(import.meta.dir, "../../prebuilt/linux-x64", "bun_scikit_node_addon.node")
219
+ : null;
207
220
  const candidates = [
208
221
  process.env.BUN_SCIKIT_NODE_ADDON,
222
+ platformPackagedPath,
209
223
  resolve(process.cwd(), "dist", "native", "bun_scikit_node_addon.node"),
210
224
  resolve(process.cwd(), "build", "Release", "bun_scikit_node_addon.node"),
211
225
  resolve(import.meta.dir, "../../dist/native", "bun_scikit_node_addon.node"),