Repository navigation
Description
Summary
@simple-libs/hosted-git-info@1.0.2 truncates SSH repository names that contain dots.
For example, git@github.com:davidsneighbour/kollitsch.dev.git is parsed as davidsneighbour/kollitsch instead of davidsneighbour/kollitsch.dev.
Reproduction
import { parseHostedGitUrl } from "@simple-libs/hosted-git-info";
const cases = [
"git@github.com:davidsneighbour/kollitsch.dev.git",
"git@github.com:davidsneighbour/kollitsch.dev",
"git@github.com:davidsneighbour/foo.bar.git",
"https://github.com/davidsneighbour/kollitsch.dev.git",
"https://github.com/davidsneighbour/kollitsch.dev",
];
for (const input of cases) {
console.log(input, parseHostedGitUrl(input));
}Actual result
parseHostedGitUrl("git@github.com:davidsneighbour/kollitsch.dev.git")
// {
// url: "https://github.com/davidsneighbour/kollitsch",
// type: "github",
// host: "https://github.com",
// owner: "davidsneighbour",
// project: "kollitsch"
// }
parseHostedGitUrl("git@github.com:davidsneighbour/foo.bar.git")
// {
// url: "https://github.com/davidsneighbour/foo",
// type: "github",
// host: "https://github.com",
// owner: "davidsneighbour",
// project: "foo"
// }Expected result
parseHostedGitUrl("git@github.com:davidsneighbour/kollitsch.dev.git")
// {
// url: "https://github.com/davidsneighbour/kollitsch.dev",
// type: "github",
// host: "https://github.com",
// owner: "davidsneighbour",
// project: "kollitsch.dev"
// }
parseHostedGitUrl("git@github.com:davidsneighbour/foo.bar.git")
// {
// url: "https://github.com/davidsneighbour/foo.bar",
// type: "github",
// host: "https://github.com",
// owner: "davidsneighbour",
// project: "foo.bar"
// }Notes
This appears to come from the project capture groups excluding dots, for example ([^/.#]+). In the SSH URL branch, the expression also does not appear to be anchored to the end of the input, so .dev.git is effectively discarded.
HTTPS URLs keep the full path in url, but do not populate owner and project for dotted repository names:
parseHostedGitUrl("https://github.com/davidsneighbour/kollitsch.dev.git")
// {
// url: "https://github.com/davidsneighbour/kollitsch.dev",
// type: "github",
// host: "https://github.com"
// }Downstream impact
This surfaced through @release-it/conventional-changelog, via conventional-changelog, when release notes were generated from a repository whose remote is:
git@github.com:davidsneighbour/kollitsch.dev.git
The generated changelog and GitHub release links pointed to:
https://github.com/davidsneighbour/kollitsch
instead of:
https://github.com/davidsneighbour/kollitsch.dev
Activity
darrachequesne commentedon Sep 25, 2026
We have the same issue at Socket.IO:
The generated changelog is missing all the links.
davidsneighbour commentedon Sep 25, 2026
I added a plugin to my config that replaces the wrong paths:
might help.
feat: apply scopes to the release level and keep dots in repo names