Skip to content

Commit

Permalink
fix: remove sourcehut bugstemplate (#213)
Browse files Browse the repository at this point in the history
Currently, using https://git.sr.ht/~user/repo in `npm init` results in
the package.json file having a `bugs` URL of
https://todo.sr.ht/~user/repo. However, this is not how SourceHut works.
An issue tracker need not exist at that URL, and often projects have
issue trackers that are named differently from the repository.
Therefore, no information can be inferred about the issue tracker from
the git URL.
  • Loading branch information
vladh committed Sep 13, 2023
1 parent 6caaf86 commit d7bac33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/hosts.js
Expand Up @@ -199,8 +199,7 @@ hosts.sourcehut = {
`https://${domain}/${user}/${project}.git${maybeJoin('#', committish)}`,
tarballtemplate: ({ domain, user, project, committish }) =>
`https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || 'HEAD'}.tar.gz`,
bugstemplate: ({ user, project }) =>
`https://todo.sr.ht/${user}/${project}`,
bugstemplate: ({ user, project }) => null,
extract: (url) => {
let [, user, project, aux] = url.pathname.split('/', 4)

Expand Down
2 changes: 1 addition & 1 deletion test/sourcehut.js
Expand Up @@ -106,7 +106,7 @@ t.test('string methods populate correctly', t => {
t.equal(parsed.tarball(), 'https://git.sr.ht/~foo/bar/archive/HEAD.tar.gz')
t.equal(parsed.file(), 'https://git.sr.ht/~foo/bar/blob/HEAD/')
t.equal(parsed.file('/lib/index.js'), 'https://git.sr.ht/~foo/bar/blob/HEAD/lib/index.js')
t.equal(parsed.bugs(), 'https://todo.sr.ht/~foo/bar')
t.equal(parsed.bugs(), null)

t.equal(
parsed.docs({ committish: 'fix/bug' }),
Expand Down

0 comments on commit d7bac33

Please sign in to comment.