MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / buildPackages

Function buildPackages

tooling/publish/publish.ts:227–251  ·  view source on GitHub ↗
(
  packages: Record<string, PackageInfo>,
  dependents: string[]
)

Source from the content-addressed store, hash-verified

225};
226
227const buildPackages = (
228 packages: Record<string, PackageInfo>,
229 dependents: string[]
230): void => {
231 const versionEnvs = dependents.map((dep) => {
232 const envName = dep
233 .replace(/@openpanel\//g, '')
234 .toUpperCase()
235 .replace(/[/-]/g, '_');
236 return `--env.${envName}_VERSION=${packages[dep]!.nextVersion}`;
237 });
238
239 for (const dep of dependents) {
240 if (!packages[dep]?.scripts?.build) {
241 console.log(`🔨 Skipping build for ${dep}`);
242 continue;
243 }
244 console.log(`🔨 Building ${dep}`);
245 const cmd = `pnpm build ${versionEnvs.join(' ')}`;
246 console.log(` Running: ${cmd}`);
247 execSync(cmd, {
248 cwd: workspacePath(packages[dep]!.localPath),
249 });
250 }
251};
252
253const publishPackages = (
254 packages: Record<string, PackageInfo>,

Callers 1

mainFunction · 0.85

Calls 5

replaceMethod · 0.80
joinMethod · 0.80
workspacePathFunction · 0.70
mapMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected