fix intellij build

This commit is contained in:
Nate Sesti 2024-06-04 15:15:41 -07:00
parent a64ad56d06
commit e694218541
4 changed files with 12 additions and 7 deletions

View file

@ -51,7 +51,7 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) {
console.log(`Copying ${packageName} to ${toCopy}`);
// This is a way to install only one package without npm trying to install all the dependencies
// Create a temporary directory for installing the package
const adjustedName = toCopy.replace(/^@/, "").replace("/", "-");
const adjustedName = packageName.replace(/^@/, "").replace("/", "-");
const tempDir = path.join(
__dirname,
"tmp",
@ -78,7 +78,6 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) {
);
// Without this it seems the file isn't completely written to disk
// Ideally we validate file integrity in the validation at the end
await new Promise((resolve) => setTimeout(resolve, 2000));
// Copy the installed package back to the current directory
@ -169,7 +168,7 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) {
entryPoints: ["src/index.ts"],
bundle: true,
outfile: esbuildOutputFile,
external: ["esbuild", "./xhr-sync-worker.js", "vscode"],
external: ["esbuild", "./xhr-sync-worker.js", "vscode", "./index.node"],
format: "cjs",
platform: "node",
sourcemap: true,

View file

@ -69,7 +69,7 @@ class Ollama extends BaseLLM {
}
})
.catch((e) => {
console.warn(`Error calling Ollama /api/show endpoint: ${e}`);
// console.warn(`Error calling Ollama /api/show endpoint: ${e}`);
});
}

View file

@ -320,7 +320,7 @@ const exe = os === "win32" ? ".exe" : "";
console.log(`Copying ${packageName} to ${toCopy}`);
// This is a way to install only one package without npm trying to install all the dependencies
// Create a temporary directory for installing the package
const adjustedName = toCopy.replace(/^@/, "").replace("/", "-");
const adjustedName = packageName.replace(/^@/, "").replace("/", "-");
const tempDir = `/tmp/continue-node_modules-${adjustedName}`;
const currentDir = process.cwd();

View file

@ -15,6 +15,7 @@ function validateFilesPresent(pathsToVerify) {
// In many cases just taking a sample file from the folder when they are all roughly the same thing
let missingFiles = [];
let emptyFiles = [];
for (const path of pathsToVerify) {
if (!fs.existsSync(path)) {
const parentFolder = path.split("/").slice(0, -1).join("/");
@ -51,11 +52,16 @@ function validateFilesPresent(pathsToVerify) {
missingFiles.push(path);
}
if (fs.existsSync(path) && fs.statSync(path).size === 0) {
console.error(`File ${path} is empty`);
emptyFiles.push(path);
}
}
if (missingFiles.length > 0) {
if (missingFiles.length > 0 || emptyFiles.length > 0) {
throw new Error(
`The following files were missing:\n- ${missingFiles.join("\n- ")}`,
`The following files were missing:\n- ${missingFiles.join("\n- ")}\n\nThe following files were empty:\n- ${emptyFiles.join("\n- ")}`,
);
} else {
console.log("All paths exist");