refactor(server): consolidate git utilities into dedicated module with documentation (#435)
* refactor:move_git_service_module_to_lib_git * refactor:move_git_credentials_module_to_lib_git * refactor:move_git_identity_storage_module_to_lib_git * refactor:add_git_domain_entrypoint_reexports * refactor:update_server_git_imports_to_domain_entrypoint * refactor:update_github_repo_git_import_to_domain_entrypoint * chore:remove_legacy_git_service_module_path * chore:remove_legacy_git_credentials_module_path * chore:remove_legacy_git_identity_storage_module_path * docs:add_git_module_documentation_in_domain_folder * docs:add_git_module_to_agents_documentation_map
This commit is contained in:
@@ -277,7 +277,7 @@ const resolveWorkspacePathFromWorktrees = async (targetPath, baseDirectory) => {
|
||||
const resolvedBase = path.resolve(baseDirectory || os.homedir());
|
||||
|
||||
try {
|
||||
const { getWorktrees } = await import('./lib/git-service.js');
|
||||
const { getWorktrees } = await import('./lib/git/index.js');
|
||||
const worktrees = await getWorktrees(resolvedBase);
|
||||
|
||||
for (const worktree of worktrees) {
|
||||
@@ -6712,7 +6712,7 @@ async function main(options = {}) {
|
||||
const { scanSkillsRepository } = await import('./lib/skills-catalog/scan.js');
|
||||
const { installSkillsFromRepository } = await import('./lib/skills-catalog/install.js');
|
||||
const { scanClawdHubPage, installSkillsFromClawdHub, isClawdHubSource } = await import('./lib/skills-catalog/clawdhub/index.js');
|
||||
const { getProfiles, getProfile } = await import('./lib/git-identity-storage.js');
|
||||
const { getProfiles, getProfile } = await import('./lib/git/index.js');
|
||||
|
||||
const listGitIdentitiesForResponse = () => {
|
||||
try {
|
||||
@@ -7491,7 +7491,7 @@ async function main(options = {}) {
|
||||
let headOwnerForSearch = null;
|
||||
|
||||
// First, check the branch's tracking info to see which remote it's on
|
||||
const { getStatus } = await import('./lib/git-service.js');
|
||||
const { getStatus } = await import('./lib/git/index.js');
|
||||
const status = await getStatus(directory).catch(() => null);
|
||||
if (status?.tracking) {
|
||||
const trackingRemote = status.tracking.split('/')[0];
|
||||
@@ -7744,7 +7744,7 @@ async function main(options = {}) {
|
||||
// Determine the source remote for the head branch
|
||||
// Priority: 1) explicit headRemote, 2) tracking branch remote, 3) 'origin' if targeting non-origin
|
||||
let sourceRemote = headRemote;
|
||||
const { getStatus, getRemotes } = await import('./lib/git-service.js');
|
||||
const { getStatus, getRemotes } = await import('./lib/git/index.js');
|
||||
|
||||
// If no explicit headRemote, check the branch's tracking info
|
||||
if (!sourceRemote) {
|
||||
@@ -8744,11 +8744,7 @@ async function main(options = {}) {
|
||||
let gitLibraries = null;
|
||||
const getGitLibraries = async () => {
|
||||
if (!gitLibraries) {
|
||||
const [storage, service] = await Promise.all([
|
||||
import('./lib/git-identity-storage.js'),
|
||||
import('./lib/git-service.js')
|
||||
]);
|
||||
gitLibraries = { ...storage, ...service };
|
||||
gitLibraries = await import('./lib/git/index.js');
|
||||
}
|
||||
return gitLibraries;
|
||||
};
|
||||
@@ -8813,7 +8809,7 @@ async function main(options = {}) {
|
||||
|
||||
app.get('/api/git/discover-credentials', async (req, res) => {
|
||||
try {
|
||||
const { discoverGitCredentials } = await import('./lib/git-credentials.js');
|
||||
const { discoverGitCredentials } = await import('./lib/git/index.js');
|
||||
const credentials = discoverGitCredentials();
|
||||
res.json(credentials);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user