diff --git a/pkg/README.md b/pkg/README.md index bffd6b148..bc0716b7d 100644 --- a/pkg/README.md +++ b/pkg/README.md @@ -8,9 +8,11 @@ The build process is otherwise defined entirely in `build.js`. ### List of native modules -- sqlite3 -- lancedb -- esbuild +- sqlite3/build/Release/node_sqlite3.node (\*) +- @lancedb/\*\* +- esbuild? +- @esbuild? +- onnxruntime-node? ### List of dynamically imported modules @@ -22,3 +24,5 @@ The build process is otherwise defined entirely in `build.js`. - tree-sitter.wasm - tree-sitter-wasms/ + +(\*) = need to download for each platform manually diff --git a/pkg/build.js b/pkg/build.js index f9b7eeb13..bd2926b0f 100644 --- a/pkg/build.js +++ b/pkg/build.js @@ -4,6 +4,11 @@ const fs = require("fs"); const ncp = require("ncp").ncp; const esbuildOutputFile = "out/index.js"; +const platforms = ["darwin", "linux", "win32"]; +const architectures = ["x64", "arm64"]; +const targets = platforms.flatMap((platform) => + architectures.map((arch) => `${platform}-${arch}`) +); let esbuildOnly = false; for (let i = 2; i < process.argv.length; i++) { @@ -86,10 +91,13 @@ for (let i = 2; i < process.argv.length; i++) { return; } - console.log("[info] Building binary with pkg..."); - execSync( - `npx pkg --no-bytecode --public-packages "*" --public pkgJson/darwin-arm64` - ); + console.log("[info] Building binaries with pkg..."); + for (const target of targets) { + console.log(`[info] Building ${target}...`); + execSync( + `npx pkg --no-bytecode --public-packages "*" --public pkgJson/${target} --out-path bin/${target}` + ); + } // execSync( // `npx pkg out/index.js --target node18-darwin-arm64 --no-bytecode --public-packages "*" --public -o bin/pkg` // );