MCPcopy Create free account
hub / github.com/continuedev/continue / bundleForBinary

Function bundleForBinary

binary/utils/bundle-binary.js:46–69  ·  view source on GitHub ↗

* @param {string} target the platform to build for

(target)

Source from the content-addressed store, hash-verified

44 * @param {string} target the platform to build for
45 */
46async function bundleForBinary(target) {
47 const targetDir = `bin/${target}`;
48 fs.mkdirSync(targetDir, { recursive: true });
49 console.log(`[info] Building ${target}...`);
50 execCmdSync(
51 `npx pkg --no-bytecode --public-packages "*" --public --compress GZip pkgJson/${target} --out-path ${targetDir}`,
52 );
53
54 // copy @lancedb to bin folders
55 console.log("[info] Copying @lancedb files to bin");
56 fs.copyFileSync(
57 `node_modules/${TARGET_TO_LANCEDB[target]}/index.node`,
58 `${targetDir}/index.node`,
59 );
60
61 const downloadPromises = [];
62 downloadPromises.push(downloadRipgrep(target, targetDir));
63 downloadPromises.push(downloadNodeSqlite(target, targetDir));
64 await Promise.all(downloadPromises);
65
66 // Informs the `continue-binary` of where to look for node_sqlite3.node
67 // https://www.npmjs.com/package/bindings#:~:text=The%20searching%20for,file%20is%20found
68 fs.writeFileSync(`${targetDir}/package.json`, "");
69}
70
71process.on("message", (msg) => {
72 bundleForBinary(msg.payload.target)

Callers 1

bundle-binary.jsFile · 0.85

Calls 5

execCmdSyncFunction · 0.85
downloadRipgrepFunction · 0.85
downloadNodeSqliteFunction · 0.85
logMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected