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

sourceControlClients.ts

35 lines1.3 KB

1import { builtInSourceControlDefinitions } from "@t3tools/source-control-definitions/registry";
2import {
3 HostCredentialSettings,
4 readSourceControlHostSettings,
5} from "@t3tools/source-control-core/shared/definition";
6import type { ServerSettings } from "@t3tools/contracts";
7​
8export {
9 isMonochromeSourceControlIcon,
10 UNKNOWN_SOURCE_CONTROL_CLIENT,
11 type ChangeRequestLink,
12 type ChangeRequestTerminology,
13 type HostAccountChoice,
14 type HostCredentialSettings,
15 type ParsedChangeRequestUrl,
16 type ReferenceAutolink,
17 type SourceControlDefinition,
18 type SourceControlHostCredentials,
19 type SourceControlIcon,
20} from "@t3tools/source-control-core/shared/definition";
21​
22export const sourceControlClients = builtInSourceControlDefinitions;
23​
24/** The saved per-hostname accounts and tokens of a host whose definition has `credentials`. */
25export function readHostCredentialSettings(
26 settings: Pick<ServerSettings, "sourceControlHosts">,
27 kind: string,
28): HostCredentialSettings {
29 return readSourceControlHostSettings(HostCredentialSettings, settings.sourceControlHosts[kind]);
31​
32/** A host's change request term where it opens a sentence: "Merge request merged". */
33export function capitalizeTerm(term: string): string {
34 return term.charAt(0).toUpperCase() + term.slice(1);