diff --git a/package.json b/package.json index 81b0a97..87913c8 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,13 @@ { "name": "git-repo-loader", - "version": "1.0.0", + "version": "1.0.2", "description": "A lightweight library to fetch and stream GitHub repository content efficiently with rate-limit handling.", "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build": "tsup" + "build": "tsup", + "prepublishOnly": "npm run build" }, "repository": { "type": "git", diff --git a/src/index.ts b/src/index.ts index cc701e7..bce7c6a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,13 +10,15 @@ export class GitHubRepoLoader { constructor( authToken: string, - { - concurrency = 50, - intervalMs = 3600000, - requestsPerInterval = 5000, // https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28 - retries, - }: RateLimitConfig + options?: Partial ) { + const { + concurrency = 1, + intervalMs = 1000, + requestsPerInterval = 1, + retries = 3, + } = options || {}; + this.octokit = new Octokit({ auth: authToken }); this.rateLimitManager = new RateLimitManager({