mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Refactor Git to accept a nostr object
This commit is contained in:
16 files changed
+184
-379
No files matched your search
+12
-3
@@ -1,7 +1,14 @@
|
||||
import git from 'isomorphic-git';
|
||||
import http from 'isomorphic-git/http/web';
|
||||
import type { NPool } from '@nostrify/nostrify';
|
||||
import type { JSRuntimeFS } from './JSRuntime';
|
||||
|
||||
export interface GitOptions {
|
||||
fs: JSRuntimeFS;
|
||||
nostr: NPool;
|
||||
corsProxy?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Git class that wraps isomorphic-git and provides a cleaner interface.
|
||||
* Instantiate with an fs implementation, optional corsProxy string, and optional corsProxyRegex.
|
||||
@@ -10,11 +17,13 @@ import type { JSRuntimeFS } from './JSRuntime';
|
||||
*/
|
||||
export class Git {
|
||||
private fs: JSRuntimeFS;
|
||||
private nostr: NPool;
|
||||
private corsProxy?: string;
|
||||
|
||||
constructor(fs: JSRuntimeFS, corsProxy?: string) {
|
||||
this.fs = fs;
|
||||
this.corsProxy = corsProxy;
|
||||
constructor(options: GitOptions) {
|
||||
this.fs = options.fs;
|
||||
this.nostr = options.nostr;
|
||||
this.corsProxy = options.corsProxy;
|
||||
}
|
||||
|
||||
// Repository initialization and configuration
|
||||
|
||||
Reference in new issue
Block a user