(target, os, arch, exe)
| 73 | } |
| 74 | |
| 75 | async function package(target, os, arch, exe) { |
| 76 | console.log("[info] Packaging extension for target ", target); |
| 77 | |
| 78 | // Copy config_schema to intellij |
| 79 | await generateAndCopyConfigYamlSchema(); |
| 80 | |
| 81 | // Install node_modules |
| 82 | await npmInstall(); |
| 83 | |
| 84 | // Build gui and copy to extensions |
| 85 | await buildGui(ghAction()); |
| 86 | |
| 87 | // Assets |
| 88 | // Copy tree-sitter-wasm files |
| 89 | await copyTreeSitterWasms(); |
| 90 | |
| 91 | // Install and copy over native modules |
| 92 | // *** onnxruntime-node *** |
| 93 | await copyOnnxRuntimeFromNodeModules(target); |
| 94 | |
| 95 | // copy llama tokenizers to out |
| 96 | copyTokenizers(); |
| 97 | |
| 98 | // Copy Linux scripts |
| 99 | await copyScripts(); |
| 100 | |
| 101 | // *** Install @lancedb binary *** |
| 102 | const lancePackageToInstall = { |
| 103 | "darwin-arm64": "@lancedb/vectordb-darwin-arm64", |
| 104 | "darwin-x64": "@lancedb/vectordb-darwin-x64", |
| 105 | "linux-arm64": "@lancedb/vectordb-linux-arm64-gnu", |
| 106 | "linux-x64": "@lancedb/vectordb-linux-x64-gnu", |
| 107 | "win32-x64": "@lancedb/vectordb-win32-x64-msvc", |
| 108 | "win32-arm64": "@lancedb/vectordb-win32-x64-msvc", // they don't have a win32-arm64 build |
| 109 | }[target]; |
| 110 | await installNodeModuleInTempDirAndCopyToCurrent( |
| 111 | lancePackageToInstall, |
| 112 | "@lancedb", |
| 113 | ); |
| 114 | |
| 115 | // *** sqlite *** |
| 116 | await downloadSqliteBinary(target); |
| 117 | await copySqliteBinary(); |
| 118 | |
| 119 | await downloadRipgrepBinary(target); |
| 120 | |
| 121 | // copy node_modules to out/node_modules |
| 122 | await copyNodeModules(); |
| 123 | |
| 124 | // Copy over any worker files |
| 125 | fs.cpSync( |
| 126 | "node_modules/jsdom/lib/jsdom/living/xhr/xhr-sync-worker.js", |
| 127 | "out/xhr-sync-worker.js", |
| 128 | ); |
| 129 | |
| 130 | // Validate the all of the necessary files are present |
| 131 | validateFilesPresent([ |
| 132 | // Queries used to create the index for @code context provider |
no test coverage detected