@@ -57,12 +57,12 @@ import { isSshRemoteUrl } from "@t3tools/shared/sourceControl";
5757import {
5858 type ChangeRequestTerminology ,
5959 UNKNOWN_SOURCE_CONTROL_CLIENT ,
60- } from "@t3tools/source-control-core/client /definition" ;
60+ } from "@t3tools/source-control-core/shared /definition" ;
6161import {
6262 normalizeThreadPullRequestKey ,
6363 threadPullRequestKeyOf ,
6464} from "../sourceControl/threadPullRequests.ts" ;
65- import { sourceControlClients } from "../sourceControl/sourceControlClients .ts" ;
65+ import { sourceControlDefinitions } from "../sourceControl/sourceControlDefinitions .ts" ;
6666
6767import { GitManagerError , GitPullRequestMaterializationError } from "@t3tools/contracts" ;
6868import {
@@ -249,10 +249,10 @@ interface BranchHeadContext {
249249}
250250
251251export function pullRequestRepositoryKey ( value : string ) : string | null {
252- const repositoryUrl = sourceControlClients . parseChangeRequestUrl ( value ) ?. link . repositoryUrl ;
252+ const repositoryUrl = sourceControlDefinitions . parseChangeRequestUrl ( value ) ?. link . repositoryUrl ;
253253 return repositoryUrl === undefined
254254 ? null
255- : sourceControlClients . repositoryKeyFromRemote ( repositoryUrl ) ;
255+ : sourceControlDefinitions . repositoryKeyFromRemote ( repositoryUrl ) ;
256256}
257257
258258/** Null when the host did not name the repository the head lives in. */
@@ -666,7 +666,7 @@ export const make = Effect.gen(function* () {
666666 const sourceControlProvider = ( cwd : string ) => sourceControlProviders . resolve ( { cwd } ) ;
667667 const changeRequestTermsFor = ( cwd : string ) =>
668668 sourceControlProvider ( cwd ) . pipe (
669- Effect . map ( ( provider ) => sourceControlClients . get ( provider . kind ) . changeRequest ) ,
669+ Effect . map ( ( provider ) => sourceControlDefinitions . get ( provider . kind ) . changeRequest ) ,
670670 Effect . orElseSucceed ( ( ) => UNKNOWN_SOURCE_CONTROL_CLIENT . changeRequest ) ,
671671 ) ;
672672 const serverSettingsService = yield * ServerSettings . ServerSettingsService ;
@@ -970,7 +970,7 @@ export const make = Effect.gen(function* () {
970970 number : number ,
971971 ) {
972972 const provider = yield * sourceControlProvider ( cwd ) ;
973- const ref = sourceControlClients . get ( provider . kind ) . changeRequestHeadRef ?.( number ) ;
973+ const ref = sourceControlDefinitions . get ( provider . kind ) . changeRequestHeadRef ?.( number ) ;
974974 if ( ref === undefined ) {
975975 return yield * new GitManagerError ( {
976976 operation : "changeRequestHeadRef" ,
@@ -1015,9 +1015,9 @@ export const make = Effect.gen(function* () {
10151015 if (
10161016 remoteUrl === null ||
10171017 pullRequestKey === null ||
1018- sourceControlClients . canonicalRepositoryKey ( pullRequestKey ) !==
1019- sourceControlClients . canonicalRepositoryKey (
1020- sourceControlClients . repositoryKeyFromRemote ( remoteUrl ) ,
1018+ sourceControlDefinitions . canonicalRepositoryKey ( pullRequestKey ) !==
1019+ sourceControlDefinitions . canonicalRepositoryKey (
1020+ sourceControlDefinitions . repositoryKeyFromRemote ( remoteUrl ) ,
10211021 )
10221022 ) {
10231023 return yield * cause ;
@@ -1186,7 +1186,7 @@ export const make = Effect.gen(function* () {
11861186 > ( ) ;
11871187 const noteLookupState = ( pr : PullRequestInfo ) =>
11881188 Effect . suspend ( ( ) => {
1189- const parsed = sourceControlClients . parseChangeRequestUrl ( pr . url ) ?. link ;
1189+ const parsed = sourceControlDefinitions . parseChangeRequestUrl ( pr . url ) ?. link ;
11901190 if ( parsed === undefined || parsed . number !== pr . number ) return Effect . void ;
11911191 const key = normalizeThreadPullRequestKey ( parsed ) ;
11921192 const id = threadPullRequestKeyOf ( key ) ;
@@ -1430,7 +1430,7 @@ export const make = Effect.gen(function* () {
14301430 remote : { readonly remoteUrl : string | null ; readonly repositoryNameWithOwner : string | null } ,
14311431 ) {
14321432 const provider =
1433- remote . remoteUrl === null ? null : sourceControlClients . recognizeRemote ( remote . remoteUrl ) ;
1433+ remote . remoteUrl === null ? null : sourceControlDefinitions . recognizeRemote ( remote . remoteUrl ) ;
14341434 if ( remote . remoteUrl === null || provider === null ) return true ;
14351435 const context = { provider, remoteName, remoteUrl : remote . remoteUrl } ;
14361436 const handle = yield * sourceControlProviders
@@ -1457,7 +1457,7 @@ export const make = Effect.gen(function* () {
14571457 ( yield * readConfigValueNullable ( cwd , `remote.${ preferredRemoteName } .url` ) ) ??
14581458 ( yield * readConfigValueNullable ( cwd , "remote.origin.url" ) ) ;
14591459
1460- const provider = remoteUrl ? sourceControlClients . recognizeRemote ( remoteUrl ) : null ;
1460+ const provider = remoteUrl ? sourceControlDefinitions . recognizeRemote ( remoteUrl ) : null ;
14611461 if ( ! remoteUrl || provider ?. kind !== "unknown" ) return provider ;
14621462 const handle = yield * sourceControlProviders
14631463 . resolveHandle ( {
@@ -1488,7 +1488,7 @@ export const make = Effect.gen(function* () {
14881488 / ^ h t t p s ? : \/ \/ / iu. test ( remoteUrl ) &&
14891489 ( repositoryNameWithOwner ?. split ( "/" ) . length ?? 0 ) > 2
14901490 ) {
1491- const kind = sourceControlClients . recognizeRemote ( remoteUrl ) ?. kind ;
1491+ const kind = sourceControlDefinitions . recognizeRemote ( remoteUrl ) ?. kind ;
14921492 const provider =
14931493 kind === undefined
14941494 ? undefined
@@ -1499,7 +1499,7 @@ export const make = Effect.gen(function* () {
14991499 }
15001500 return {
15011501 remoteUrl,
1502- remoteUrlKey : remoteUrl ? sourceControlClients . repositoryKeyFromRemote ( remoteUrl ) : null ,
1502+ remoteUrlKey : remoteUrl ? sourceControlDefinitions . repositoryKeyFromRemote ( remoteUrl ) : null ,
15031503 repositoryNameWithOwner,
15041504 ownerLogin : parseRepositoryOwnerLogin ( repositoryNameWithOwner ) ,
15051505 } ;
@@ -2246,7 +2246,7 @@ export const make = Effect.gen(function* () {
22462246 emit : GitActionProgressEmitter ,
22472247 ) {
22482248 const provider = yield * sourceControlProvider ( cwd ) ;
2249- const terms = sourceControlClients . get ( provider . kind ) . changeRequest ;
2249+ const terms = sourceControlDefinitions . get ( provider . kind ) . changeRequest ;
22502250 const details = yield * gitCore . statusDetails ( cwd ) ;
22512251 const branch = details . branch ?? fallbackBranch ;
22522252 if ( ! branch ) {
@@ -2454,7 +2454,7 @@ export const make = Effect.gen(function* () {
24542454 ? Effect . succeed ( null )
24552455 : readConfig ( `remote.${ remoteName } .url` ) . pipe (
24562456 Effect . map ( ( remoteUrl ) =>
2457- remoteUrl ? sourceControlClients . repositoryKeyFromRemote ( remoteUrl ) : null ,
2457+ remoteUrl ? sourceControlDefinitions . repositoryKeyFromRemote ( remoteUrl ) : null ,
24582458 ) ,
24592459 ) ;
24602460 const remoteName = remoteNameOverride ?? ( yield * readConfig ( `branch.${ branch } .remote` ) ) ;
0 commit comments