MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / buildPublishArgs

Function buildPublishArgs

packages/bumpy/src/core/publish-pipeline.ts:347–390  ·  view source on GitHub ↗
(
  pkg: WorkspacePackage,
  pkgConfig: WorkspacePackage['bumpy'] & {},
  config: BumpyConfig,
  opts: PublishOptions,
  tarball?: string,
)

Source from the content-addressed store, hash-verified

345}
346
347function buildPublishArgs(
348 pkg: WorkspacePackage,
349 pkgConfig: WorkspacePackage['bumpy'] & {},
350 config: BumpyConfig,
351 opts: PublishOptions,
352 tarball?: string,
353): string[] {
354 const publishManager = config.publish.publishManager;
355 const args: string[] = [];
356
357 // Base command
358 if (config.publish.npmStaged && publishManager === 'npm') {
359 args.push('npm', 'stage', 'publish');
360 } else if (publishManager === 'yarn') {
361 args.push('yarn', 'npm', 'publish');
362 } else {
363 args.push(publishManager, 'publish');
364 }
365
366 // Tarball path (if pack-then-publish)
367 if (tarball) args.push(tarball);
368
369 // Access
370 const access = pkgConfig?.access || config.access;
371 args.push('--access', access);
372
373 // Registry
374 if (pkgConfig?.registry) args.push('--registry', pkgConfig.registry);
375
376 // Dist tag
377 if (opts.tag) args.push('--tag', opts.tag);
378
379 // Provenance attestation
380 if (config.publish.provenance && publishManager === 'npm') {
381 args.push('--provenance');
382 }
383
384 // Extra user-configured args
385 if (config.publish.publishArgs.length > 0) {
386 args.push(...config.publish.publishArgs);
387 }
388
389 return args;
390}
391
392/**
393 * Parse the tarball path from pack command output.

Callers 2

packThenPublishFunction · 0.85
npmPublishDirectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…