Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

registry.ts

38 lines1.7 KB

1import * as AzureDevOps from "@t3tools/source-control-azure-devops/shared/definition";
2import * as Bitbucket from "@t3tools/source-control-bitbucket/shared/definition";
3import { makeSourceControlDefinitionRegistry } from "@t3tools/source-control-core/shared/definition";
4import * as Forgejo from "@t3tools/source-control-forgejo/shared/definition";
5import * as GitCafe from "@t3tools/source-control-gitcafe/shared/definition";
6import * as GitHub from "@t3tools/source-control-github/shared/definition";
7import * as GitLab from "@t3tools/source-control-gitlab/shared/definition";
8​
9/**
10 * The server and every client read hosts through this one registry, so they agree on which host
11 * owns a URL or remote. GitHub comes first because a repository that has not reported its host
12 * yet reads as GitHub, which is what clients have always shown there. A change request URL goes
13 * to the first host whose shape it has, so GitCafe, which claims `/pull/` and `/pulls/` only on
14 * its own hostnames, claims before GitHub and Forgejo, which claim them everywhere. A hostname can
15 * carry more than one host's label (`gitea.github.example`), so remote recognition has its own
16 * order.
17 */
18export const builtInSourceControlDefinitions = makeSourceControlDefinitionRegistry(
19 [
20 GitHub.definition,
21 GitLab.definition,
22 GitCafe.definition,
23 Forgejo.definition,
24 Bitbucket.definition,
25 AzureDevOps.definition,
26 ],
27 {
28 claimChangeRequestUrlsFirst: [GitCafe.definition.kind],
29 recognizeRemotesIn: [
30 GitCafe.definition.kind,
31 Forgejo.definition.kind,
32 GitHub.definition.kind,
33 GitLab.definition.kind,
34 AzureDevOps.definition.kind,
35 Bitbucket.definition.kind,
36 ],
37 },
38);