From 44d1915830b9e4618506d06032e859f3123b7ec2 Mon Sep 17 00:00:00 2001 From: Nulo Date: Wed, 7 Dec 2022 20:49:43 -0300 Subject: [PATCH] Don't ever import node stuff --- src/populateCache.ts | 8 ++++++-- src/types.ts | 10 ++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/populateCache.ts b/src/populateCache.ts index f3acc9a..6e407c3 100644 --- a/src/populateCache.ts +++ b/src/populateCache.ts @@ -1,7 +1,10 @@ import { Buffer } from "buffer"; -import git, { PromiseFsClient } from "isomorphic-git"; -import http, { GitProgressEvent } from "isomorphic-git/http/node"; +import git, { + GitProgressEvent, + HttpClient, + PromiseFsClient, +} from "isomorphic-git"; import { isVacantAndWriteable, pointsToLFS } from "./util"; import downloadBlobFromPointer from "./download"; @@ -26,6 +29,7 @@ type ProgressHandler = (progress: GitProgressEvent) => void; */ export default async function populateCache( fs: PromiseFsClient, + http: HttpClient, workDir: string, remoteURL: string, ref: string = "HEAD", diff --git a/src/types.ts b/src/types.ts index b0d42b9..efcd897 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,12 +1,10 @@ -import type { HttpClient } from 'isomorphic-git/http/node'; - +import type { HttpClient } from "isomorphic-git"; export interface BasicAuth { - username: string - password: string + username: string; + password: string; } - // TODO: Restructure HTTPRequest to reuse Isomorphic Git’s GitHttpRequest? export interface HTTPRequest { @@ -17,5 +15,5 @@ export interface HTTPRequest { url: string; /** Auth data for basic HTTP auth. */ - auth?: BasicAuth + auth?: BasicAuth; }