Make FS paths configurable

This commit is contained in:
Alex Gleason committed 2025-10-23 14:50:05 -05:00
1 parent f89a481c9c
commit d75bd386aa
43 files changed
+393 -124

No files matched your search

+5 -3
View File
@@ -1,19 +1,21 @@
import { useMemo } from 'react';
import { ProjectsManager } from '@/lib/ProjectsManager';
import { useFS } from '@/hooks/useFS';
import { useFSPaths } from '@/hooks/useFSPaths';
import { useGit } from './useGit';
/**
* Hook that provides a ProjectsManager instance.
* The ProjectsManager is memoized based on the fs instance.
* The ProjectsManager is memoized based on the fs instance and configured paths.
*/
export function useProjectsManager() {
const { fs } = useFS();
const { git } = useGit();
const { projectsPath } = useFSPaths();
const projectsManager = useMemo(() => {
return new ProjectsManager({ fs, git });
}, [fs, git]);
return new ProjectsManager({ fs, git, projectsPath });
}, [fs, git, projectsPath]);
return projectsManager;
}