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

Function buildPackage

scripts/build-packages.js:52–70  ·  view source on GitHub ↗
(packageName, cleanNodeModules = false)

Source from the content-addressed store, hash-verified

50
51// Helper function to build a package (install + build)
52async function buildPackage(packageName, cleanNodeModules = false) {
53 const packagePath = path.join(__dirname, "..", "packages", packageName);
54
55 if (!fs.existsSync(packagePath)) {
56 throw new Error(`Package directory not found: ${packagePath}`);
57 }
58
59 if (cleanNodeModules) {
60 const nodeModulesPath = path.join(packagePath, "node_modules");
61 if (fs.existsSync(nodeModulesPath)) {
62 console.log(`🧹 Cleaning node_modules for ${packageName}`);
63 await fsPromises.rm(nodeModulesPath, { recursive: true, force: true });
64 }
65 }
66
67 await runCommand(npmInstallCmd, packagePath, `${packageName} (install)`);
68
69 return runCommand("npm run build", packagePath, `${packageName} (build)`);
70}
71
72async function buildPackagesInParallel(packages, cleanNodeModules = false) {
73 const buildPromises = packages.map((pkg) =>

Callers 1

buildPackagesInParallelFunction · 0.85

Calls 2

runCommandFunction · 0.85
logMethod · 0.65

Tested by

no test coverage detected