Refactor Git to accept a nostr object

This commit is contained in:
Alex Gleason committed 2025-09-21 14:31:13 -05:00
1 parent f797ec55c5
commit 69c1000063
16 files changed
+184 -379

No files matched your search

+9 -5
View File
@@ -1,8 +1,7 @@
import { Buffer } from 'buffer';
import { Git } from '@/lib/git';
import type { Git } from '@/lib/git';
import type { JSRuntimeFS } from '@/lib/JSRuntime';
// Polyfill Buffer for browser
if (typeof window !== 'undefined') {
(window as { Buffer?: typeof Buffer }).Buffer = Buffer;
@@ -18,14 +17,19 @@ export interface Project {
lastModified: Date;
}
export interface ProjectsManagerOptions {
fs: JSRuntimeFS;
git: Git;
}
export class ProjectsManager {
fs: JSRuntimeFS;
git: Git;
dir: string;
constructor(fs: JSRuntimeFS) {
this.fs = fs;
this.git = new Git(fs, 'https://cors.isomorphic-git.org');
constructor(options: ProjectsManagerOptions) {
this.fs = options.fs;
this.git = options.git;
this.dir = '/projects';
}