Don't ever import node stuff

This commit is contained in:
Cat /dev/Nulo 2022-12-07 20:49:43 -03:00
parent 61477f34b0
commit 44d1915830
2 changed files with 10 additions and 8 deletions

View file

@ -1,7 +1,10 @@
import { Buffer } from "buffer"; import { Buffer } from "buffer";
import git, { PromiseFsClient } from "isomorphic-git"; import git, {
import http, { GitProgressEvent } from "isomorphic-git/http/node"; GitProgressEvent,
HttpClient,
PromiseFsClient,
} from "isomorphic-git";
import { isVacantAndWriteable, pointsToLFS } from "./util"; import { isVacantAndWriteable, pointsToLFS } from "./util";
import downloadBlobFromPointer from "./download"; import downloadBlobFromPointer from "./download";
@ -26,6 +29,7 @@ type ProgressHandler = (progress: GitProgressEvent) => void;
*/ */
export default async function populateCache( export default async function populateCache(
fs: PromiseFsClient, fs: PromiseFsClient,
http: HttpClient,
workDir: string, workDir: string,
remoteURL: string, remoteURL: string,
ref: string = "HEAD", ref: string = "HEAD",

View file

@ -1,12 +1,10 @@
import type { HttpClient } from 'isomorphic-git/http/node'; import type { HttpClient } from "isomorphic-git";
export interface BasicAuth { export interface BasicAuth {
username: string username: string;
password: string password: string;
} }
// TODO: Restructure HTTPRequest to reuse Isomorphic Gits GitHttpRequest? // TODO: Restructure HTTPRequest to reuse Isomorphic Gits GitHttpRequest?
export interface HTTPRequest { export interface HTTPRequest {
@ -17,5 +15,5 @@ export interface HTTPRequest {
url: string; url: string;
/** Auth data for basic HTTP auth. */ /** Auth data for basic HTTP auth. */
auth?: BasicAuth auth?: BasicAuth;
} }