`pnpm pkg fix` left `repository` as written. It now follows the
fixRepositoryField step of `npm pkg fix`: a non-empty string becomes
{ "type": "git", "url": <string> }, and a url that hosted-git-info
recognizes becomes https() for a shortcut and the form of its own
protocol otherwise. Unrecognized urls, other keys, and a shortcut with
no owner stay as written. The legacy `repositories` array step is not
ported.
The TypeScript CLI uses the hosted-git-info fork the git resolver
already depends on. The Rust CLI adds HostedGit::normalized_repository_url,
because HostedGit's Display renders the git and http forms differently
from hosted-git-info's toString(). Rust does not recognize gist urls, so
a `gist:` repository keeps its url there, while the TypeScript CLI
normalizes it like npm.
Closespnpm/pnpm#16980
`pnpm -r pkg get` keyed its JSON report by package name, so when two
selected workspace projects had the same name the later one silently
replaced the earlier one. Workspaces allow duplicate names, so failing
is not an option.
Keep name keys when a name is unique. Key every project that shares a
name by its workspace-relative directory, the same fallback already
used for nameless projects. Re-keying all of them rather than only the
later one keeps the result independent of selection order. A project
whose name equals a directory key that another project falls back to
also moves to its directory, and this repeats until no key collides.
Directories are distinct, so every key is. Workspaces with unique names
keep the same output.
Implemented in both the TypeScript and Rust CLIs, with the docs updated
for both.