Skip to content

Commit 65a43e8

Browse files
committed
feat(validate): version repo type inital mercurial detection
1 parent 6f61121 commit 65a43e8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/validate/src/packument/repository.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import {
66
Link,
77
} from '../shared';
88

9-
const REPOSITORY_TYPES = Object.freeze(['git', 'unknown'] as const);
9+
const REPOSITORY_TYPES = Object.freeze([
10+
'git',
11+
'mercurial',
12+
'unknown',
13+
] as const);
1014

1115
type RepositoryType = (typeof REPOSITORY_TYPES)[number];
1216

@@ -30,6 +34,7 @@ export const REPOSITORY_DOMAIN_MAP = Object.freeze({
3034
'gitee.com',
3135
'git.sr.ht',
3236
],
37+
mercurial: ['hg.sr.ht'],
3338
} satisfies Record<Exclude<RepositoryType, 'unknown'>, string[]>);
3439

3540
export const DOMAIN_REPOSITORY_TYPE_MAP = Object.freeze(
@@ -51,6 +56,7 @@ export const RepositoryObjectSchema = v.object({
5156
'bitbucket*': 'git',
5257
'gitlab*': 'git',
5358
'gitee*': 'git',
59+
hg: 'mercurial',
5460
}),
5561
'unknown',
5662
),

0 commit comments

Comments
 (0)