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

Function findPackagesMissingFromNpm

packages/bumpy/src/commands/publish.ts:847–863  ·  view source on GitHub ↗

* Filter `toPublish` to package names that don't exist on npm yet. * Skips packages not going through the standard npm publish flow.

(
  toPublish: PlannedRelease[],
  packages: Map<string, WorkspacePackage>,
)

Source from the content-addressed store, hash-verified

845 * Skips packages not going through the standard npm publish flow.
846 */
847async function findPackagesMissingFromNpm(
848 toPublish: PlannedRelease[],
849 packages: Map<string, WorkspacePackage>,
850): Promise<string[]> {
851 const missing: string[] = [];
852 await Promise.all(
853 toPublish.map(async (release) => {
854 const pkg = packages.get(release.name)!;
855 const pkgConfig = pkg.bumpy || {};
856 if (pkgConfig.publishCommand || pkgConfig.skipNpmPublish) return;
857 if (pkg.private && !pkgConfig.publishCommand) return;
858 const exists = await packageExistsOnNpm(release.name, pkgConfig.registry);
859 if (!exists) missing.push(release.name);
860 }),
861 );
862 return missing;
863}

Callers 1

runPublishFlowFunction · 0.85

Calls 1

packageExistsOnNpmFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…