MCPcopy Create free account
hub / github.com/CodeForBreakfast/eventsourcing / validateSinglePackageName

Function validateSinglePackageName

scripts/validate-changesets.ts:510–526  ·  view source on GitHub ↗
(changeset: ChangesetInfoInternal, validPackageNames: ReadonlySet<string>, rootName: string)

Source from the content-addressed store, hash-verified

508
509const validateSinglePackageName =
510 (changeset: ChangesetInfoInternal, validPackageNames: ReadonlySet<string>, rootName: string) =>
511 (pkgName: string): readonly string[] => {
512 const isValid = validPackageNames.has(pkgName);
513 const isRootPackage = pkgName === rootName;
514
515 return isValid
516 ? []
517 : isRootPackage
518 ? [
519 `❌ Changeset ${changeset.filename} references the private monorepo root package: ${pkgName}`,
520 ' The monorepo root is private and cannot be published to npm.',
521 ]
522 : [
523 `❌ Changeset ${changeset.filename} references non-existent package: ${pkgName}`,
524 ' This package does not exist in the workspace.',
525 ];
526 };
527
528const validateChangesetPackages = (
529 changesets: readonly ChangesetInfoInternal[],

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected