monorepo icon indicating copy to clipboard operation
monorepo copied to clipboard

unexpected return type of `repo.getOrigin()`

Open samuelstroschein opened this issue 7 months ago • 3 comments

Problem

repo.getOrigin() returns "unknown" if a repo can't be found (1), conflicting with the type definition of ReturnType<string> (2), aka an origin always exists.

CleanShot 2024-01-22 at 22 41 31

Proposal

Change the return type of repo.getOrigin() to be string | undefined to align with "maybe an origin exists" line of thought.

samuelstroschein avatar Jan 22 '24 21:01 samuelstroschein

Agree! (also need this for the vsc extension)

felixhaeberle avatar Jan 22 '24 21:01 felixhaeberle

100%

janfjohannes avatar Jan 23 '24 12:01 janfjohannes

@janfjohannes can we remove safeHashOnly from getOrigin()?

  • no need anymore
  • re-introduce as utility functions to avoid conditional logic and bloat of repo.* API

samuelstroschein avatar Jan 23 '24 14:01 samuelstroschein

closing as done becuase prio list says its done

samuelstroschein avatar May 21 '24 20:05 samuelstroschein