Skip to content

Commit 960fbe2

Browse files
committed
update the tar package
1 parent 46670d8 commit 960fbe2

File tree

4 files changed

+70
-107
lines changed

4 files changed

+70
-107
lines changed

package-lock.json

Lines changed: 60 additions & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"commander": "^12.0.0",
7070
"ignore": "^5.3.0",
7171
"minimatch": "^9.0.0",
72-
"tar": "^6.2.0"
72+
"tar": "^7.0.0"
7373
},
7474
"devDependencies": {
7575
"@ai-sdk/anthropic": "^2.0.0",
@@ -80,7 +80,7 @@
8080
"@octokit/rest": "^22.0.1",
8181
"@types/express": "^5.0.6",
8282
"@types/node": "^20.10.0",
83-
"@types/tar": "^6.1.10",
83+
8484
"tsx": "^4.7.0",
8585
"typescript": "^5.3.3",
8686
"vitest": "^1.1.0"

src/sources/github.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131

3232
import { Readable } from "node:stream";
3333
import ignoreFactory, { type Ignore } from "ignore";
34-
import tar from "tar";
34+
import * as tar from "tar";
35+
import type { ReadEntry } from "tar";
3536
import { shouldFilterFile } from "../core/file-filter.js";
3637
import { isoTimestamp } from "../core/utils.js";
3738
import type { FileEntry, FileInfo, SourceMetadata } from "../core/types.js";
@@ -302,7 +303,7 @@ export class GitHubSource implements Source {
302303

303304
await new Promise<void>((resolve, reject) => {
304305
const parser = tar.list({
305-
onentry: (entry) => {
306+
onReadEntry: (entry: ReadEntry) => {
306307
// Skip directories and symlinks
307308
if (entry.type !== "File") {
308309
return;
@@ -315,7 +316,7 @@ export class GitHubSource implements Source {
315316

316317
// Read file contents
317318
const chunks: Buffer[] = [];
318-
entry.on("data", (chunk) => chunks.push(chunk));
319+
entry.on("data", (chunk: Buffer) => chunks.push(chunk));
319320
entry.on("end", () => {
320321
const contentBuffer = Buffer.concat(chunks);
321322

src/sources/gitlab.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
import { Readable } from "node:stream";
66
import ignoreFactory, { type Ignore } from "ignore";
7-
import tar from "tar";
7+
import * as tar from "tar";
8+
import type { ReadEntry } from "tar";
89
import { shouldFilterFile } from "../core/file-filter.js";
910
import { isoTimestamp } from "../core/utils.js";
1011
import type { FileEntry, FileInfo, SourceMetadata } from "../core/types.js";
@@ -256,7 +257,7 @@ export class GitLabSource implements Source {
256257

257258
await new Promise<void>((resolve, reject) => {
258259
const parser = tar.list({
259-
onentry: (entry) => {
260+
onReadEntry: (entry: ReadEntry) => {
260261
// Skip directories and symlinks
261262
if (entry.type !== "File") {
262263
return;
@@ -269,7 +270,7 @@ export class GitLabSource implements Source {
269270

270271
// Read file contents
271272
const chunks: Buffer[] = [];
272-
entry.on("data", (chunk) => chunks.push(chunk));
273+
entry.on("data", (chunk: Buffer) => chunks.push(chunk));
273274
entry.on("end", () => {
274275
const contentBuffer = Buffer.concat(chunks);
275276

0 commit comments

Comments
 (0)