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

Function validateChangesetLogic

scripts/validate-changesets.ts:930–943  ·  view source on GitHub ↗
(
    packages: readonly PackageInternal[],
    changesets: readonly ChangesetInfoInternal[],
    changedFiles: readonly string[],
    rootDir: string
  )

Source from the content-addressed store, hash-verified

928
929const validateChangesetLogic =
930 (
931 packages: readonly PackageInternal[],
932 changesets: readonly ChangesetInfoInternal[],
933 changedFiles: readonly string[],
934 rootDir: string
935 ) =>
936 (rootPackageJson: { readonly name: string }) => {
937 const errors = validateChangesetPackages(changesets, packages, rootPackageJson);
938
939 return Effect.if(errors.length > 0, {
940 onTrue: () => displayValidationFailure(errors, packages),
941 onFalse: () => handleChangedFiles(changedFiles, changesets, packages, rootDir),
942 });
943 };
944
945// Wrapper provides type safety for JSON.parse (returns any)
946// eslint-disable-next-line effect/no-eta-expansion -- JSON.parse is external and cannot be inlined

Callers 1

validateWithRootPackageFunction · 0.85

Calls 3

displayValidationFailureFunction · 0.85
handleChangedFilesFunction · 0.85

Tested by

no test coverage detected