Skip to content

Commit 8ab8396

Browse files
Merge pull request #1 from iHiteshAgrawal/fix/type-errors
feat: update package version to 1.0.2 and add prepublish script; adju…
2 parents d9717be + b69fcc0 commit 8ab8396

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "git-repo-loader",
3-
"version": "1.0.0",
3+
"version": "1.0.2",
44
"description": "A lightweight library to fetch and stream GitHub repository content efficiently with rate-limit handling.",
55
"type": "module",
66
"main": "dist/index.js",
77
"types": "dist/index.d.ts",
88
"scripts": {
9-
"build": "tsup"
9+
"build": "tsup",
10+
"prepublishOnly": "npm run build"
1011
},
1112
"repository": {
1213
"type": "git",

src/index.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ export class GitHubRepoLoader {
1010

1111
constructor(
1212
authToken: string,
13-
{
14-
concurrency = 50,
15-
intervalMs = 3600000,
16-
requestsPerInterval = 5000, // https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28
17-
retries,
18-
}: RateLimitConfig
13+
options?: Partial<RateLimitConfig>
1914
) {
15+
const {
16+
concurrency = 1,
17+
intervalMs = 1000,
18+
requestsPerInterval = 1,
19+
retries = 3,
20+
} = options || {};
21+
2022
this.octokit = new Octokit({ auth: authToken });
2123

2224
this.rateLimitManager = new RateLimitManager({

0 commit comments

Comments
 (0)