@@ -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. */
@@ -668,7 +668,7 @@ export const make = Effect.gen(function* () {
668668 cwd : string ,
669669 ) {
670670 return yield * sourceControlProvider ( cwd ) . pipe (
671- Effect . map ( ( provider ) => sourceControlClients . get ( provider . kind ) . changeRequest ) ,
671+ Effect . map ( ( provider ) => sourceControlDefinitions . get ( provider . kind ) . changeRequest ) ,
672672 Effect . orElseSucceed ( ( ) => UNKNOWN_SOURCE_CONTROL_CLIENT . changeRequest ) ,
673673 ) ;
674674 } ) ;
@@ -976,7 +976,7 @@ export const make = Effect.gen(function* () {
976976 number : number ,
977977 ) {
978978 const provider = yield * sourceControlProvider ( cwd ) ;
979- const ref = sourceControlClients . get ( provider . kind ) . changeRequestHeadRef ?.( number ) ;
979+ const ref = sourceControlDefinitions . get ( provider . kind ) . changeRequestHeadRef ?.( number ) ;
980980 if ( ref === undefined ) {
981981 return yield * new GitManagerError ( {
982982 operation : "changeRequestHeadRef" ,
@@ -1019,9 +1019,9 @@ export const make = Effect.gen(function* () {
10191019 if (
10201020 remoteUrl === null ||
10211021 pullRequestKey === null ||
1022- sourceControlClients . canonicalRepositoryKey ( pullRequestKey ) !==
1023- sourceControlClients . canonicalRepositoryKey (
1024- sourceControlClients . repositoryKeyFromRemote ( remoteUrl ) ,
1022+ sourceControlDefinitions . canonicalRepositoryKey ( pullRequestKey ) !==
1023+ sourceControlDefinitions . canonicalRepositoryKey (
1024+ sourceControlDefinitions . repositoryKeyFromRemote ( remoteUrl ) ,
10251025 )
10261026 ) {
10271027 return yield * cause ;
@@ -1190,7 +1190,7 @@ export const make = Effect.gen(function* () {
11901190 > ( ) ;
11911191 const noteLookupState = ( pr : PullRequestInfo ) =>
11921192 Effect . suspend ( ( ) => {
1193- const parsed = sourceControlClients . parseChangeRequestUrl ( pr . url ) ?. link ;
1193+ const parsed = sourceControlDefinitions . parseChangeRequestUrl ( pr . url ) ?. link ;
11941194 if ( parsed === undefined || parsed . number !== pr . number ) return Effect . void ;
11951195 const key = normalizeThreadPullRequestKey ( parsed ) ;
11961196 const id = threadPullRequestKeyOf ( key ) ;
@@ -1434,7 +1434,7 @@ export const make = Effect.gen(function* () {
14341434 remote : { readonly remoteUrl : string | null ; readonly repositoryNameWithOwner : string | null } ,
14351435 ) {
14361436 const provider =
1437- remote . remoteUrl === null ? null : sourceControlClients . recognizeRemote ( remote . remoteUrl ) ;
1437+ remote . remoteUrl === null ? null : sourceControlDefinitions . recognizeRemote ( remote . remoteUrl ) ;
14381438 if ( remote . remoteUrl === null || provider === null ) return true ;
14391439 const context = { provider, remoteName, remoteUrl : remote . remoteUrl } ;
14401440 const handle = yield * sourceControlProviders
@@ -1461,7 +1461,7 @@ export const make = Effect.gen(function* () {
14611461 ( yield * readConfigValueNullable ( cwd , `remote.${ preferredRemoteName } .url` ) ) ??
14621462 ( yield * readConfigValueNullable ( cwd , "remote.origin.url" ) ) ;
14631463
1464- const provider = remoteUrl ? sourceControlClients . recognizeRemote ( remoteUrl ) : null ;
1464+ const provider = remoteUrl ? sourceControlDefinitions . recognizeRemote ( remoteUrl ) : null ;
14651465 if ( ! remoteUrl || provider ?. kind !== "unknown" ) return provider ;
14661466 const handle = yield * sourceControlProviders
14671467 . resolveHandle ( {
@@ -1492,7 +1492,7 @@ export const make = Effect.gen(function* () {
14921492 / ^ h t t p s ? : \/ \/ / iu. test ( remoteUrl ) &&
14931493 ( repositoryNameWithOwner ?. split ( "/" ) . length ?? 0 ) > 2
14941494 ) {
1495- const kind = sourceControlClients . recognizeRemote ( remoteUrl ) ?. kind ;
1495+ const kind = sourceControlDefinitions . recognizeRemote ( remoteUrl ) ?. kind ;
14961496 const provider =
14971497 kind === undefined
14981498 ? undefined
@@ -1503,7 +1503,7 @@ export const make = Effect.gen(function* () {
15031503 }
15041504 return {
15051505 remoteUrl,
1506- remoteUrlKey : remoteUrl ? sourceControlClients . repositoryKeyFromRemote ( remoteUrl ) : null ,
1506+ remoteUrlKey : remoteUrl ? sourceControlDefinitions . repositoryKeyFromRemote ( remoteUrl ) : null ,
15071507 repositoryNameWithOwner,
15081508 ownerLogin : parseRepositoryOwnerLogin ( repositoryNameWithOwner ) ,
15091509 } ;
@@ -2250,7 +2250,7 @@ export const make = Effect.gen(function* () {
22502250 emit : GitActionProgressEmitter ,
22512251 ) {
22522252 const provider = yield * sourceControlProvider ( cwd ) ;
2253- const terms = sourceControlClients . get ( provider . kind ) . changeRequest ;
2253+ const terms = sourceControlDefinitions . get ( provider . kind ) . changeRequest ;
22542254 const details = yield * gitCore . statusDetails ( cwd ) ;
22552255 const branch = details . branch ?? fallbackBranch ;
22562256 if ( ! branch ) {
@@ -2458,7 +2458,7 @@ export const make = Effect.gen(function* () {
24582458 ? Effect . succeed ( null )
24592459 : readConfig ( `remote.${ remoteName } .url` ) . pipe (
24602460 Effect . map ( ( remoteUrl ) =>
2461- remoteUrl ? sourceControlClients . repositoryKeyFromRemote ( remoteUrl ) : null ,
2461+ remoteUrl ? sourceControlDefinitions . repositoryKeyFromRemote ( remoteUrl ) : null ,
24622462 ) ,
24632463 ) ;
24642464 const remoteName = remoteNameOverride ?? ( yield * readConfig ( `branch.${ branch } .remote` ) ) ;
0 commit comments