Skip to content

Commit d936b11

Browse files
committed
build: update dependency tar to v7
1 parent 7554cc1 commit d936b11

File tree

4 files changed

+13
-34
lines changed

4 files changed

+13
-34
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
"@types/resolve": "^1.17.1",
112112
"@types/semver": "^7.3.12",
113113
"@types/shelljs": "^0.8.11",
114-
"@types/tar": "^6.1.2",
115114
"@types/watchpack": "^2.4.4",
116115
"@types/yargs": "^17.0.20",
117116
"@types/yargs-parser": "^21.0.0",
@@ -197,7 +196,7 @@
197196
"source-map-loader": "5.0.0",
198197
"source-map-support": "0.5.21",
199198
"symbol-observable": "4.0.0",
200-
"tar": "^6.1.6",
199+
"tar": "^7.0.0",
201200
"terser": "5.36.0",
202201
"tree-kill": "1.2.2",
203202
"ts-node": "^10.9.1",

tests/legacy-cli/e2e/utils/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ ts_library(
1010
visibility = ["//visibility:public"],
1111
deps = [
1212
"@npm//@types/semver",
13-
"@npm//@types/tar",
1413
"@npm//ansi-colors",
1514
"@npm//fast-glob",
1615
"@npm//npm",

tests/legacy-cli/e2e/utils/tar.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import fs from 'fs';
10-
import { normalize } from 'path';
11-
import { Parse } from 'tar';
9+
import { createReadStream } from 'node:fs';
10+
import { normalize } from 'node:path';
11+
import { Parser } from 'tar';
1212

1313
/**
1414
* Extract and return the contents of a single file out of a tar file.
@@ -17,20 +17,19 @@ import { Parse } from 'tar';
1717
* @param filePath the path of the file to extract
1818
* @returns the Buffer of file or an error on fs/tar error or file not found
1919
*/
20-
export async function extractFile(tarball: string, filePath: string): Promise<Buffer> {
20+
export function extractFile(tarball: string, filePath: string): Promise<Buffer> {
2121
return new Promise((resolve, reject) => {
22-
fs.createReadStream(tarball)
22+
createReadStream(tarball)
2323
.pipe(
24-
new Parse({
24+
new Parser({
2525
strict: true,
2626
filter: (p) => normalize(p) === normalize(filePath),
27-
// TODO: @types/tar 'entry' does not have ReadEntry.on
28-
onentry: (entry: any) => {
27+
onentry: (entry) => {
2928
const chunks: Buffer[] = [];
3029

31-
entry.on('data', (chunk: any) => chunks!.push(chunk));
30+
entry.on('data', (chunk) => chunks.push(chunk));
3231
entry.on('error', reject);
33-
entry.on('finish', () => resolve(Buffer.concat(chunks!)));
32+
entry.on('finish', () => resolve(Buffer.concat(chunks)));
3433
},
3534
}),
3635
)

yarn.lock

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,6 @@ __metadata:
686686
"@types/resolve": "npm:^1.17.1"
687687
"@types/semver": "npm:^7.3.12"
688688
"@types/shelljs": "npm:^0.8.11"
689-
"@types/tar": "npm:^6.1.2"
690689
"@types/watchpack": "npm:^2.4.4"
691690
"@types/yargs": "npm:^17.0.20"
692691
"@types/yargs-parser": "npm:^21.0.0"
@@ -772,7 +771,7 @@ __metadata:
772771
source-map-loader: "npm:5.0.0"
773772
source-map-support: "npm:0.5.21"
774773
symbol-observable: "npm:4.0.0"
775-
tar: "npm:^6.1.6"
774+
tar: "npm:^7.0.0"
776775
terser: "npm:5.36.0"
777776
tree-kill: "npm:1.2.2"
778777
ts-node: "npm:^10.9.1"
@@ -5706,16 +5705,6 @@ __metadata:
57065705
languageName: node
57075706
linkType: hard
57085707

5709-
"@types/tar@npm:^6.1.2":
5710-
version: 6.1.13
5711-
resolution: "@types/tar@npm:6.1.13"
5712-
dependencies:
5713-
"@types/node": "npm:*"
5714-
minipass: "npm:^4.0.0"
5715-
checksum: 10c0/98cc72d444fa622049e86e457a64d859c6effd7c7518d36e7b40b4ab1e7aa9e2412cc868cbef396650485dae07d50d98f662e8a53bb45f4a70eb6c61f80a63c7
5716-
languageName: node
5717-
linkType: hard
5718-
57195708
"@types/tmp@npm:^0.2.1":
57205709
version: 0.2.6
57215710
resolution: "@types/tmp@npm:0.2.6"
@@ -13798,13 +13787,6 @@ __metadata:
1379813787
languageName: node
1379913788
linkType: hard
1380013789

13801-
"minipass@npm:^4.0.0":
13802-
version: 4.2.8
13803-
resolution: "minipass@npm:4.2.8"
13804-
checksum: 10c0/4ea76b030d97079f4429d6e8a8affd90baf1b6a1898977c8ccce4701c5a2ba2792e033abc6709373f25c2c4d4d95440d9d5e9464b46b7b76ca44d2ce26d939ce
13805-
languageName: node
13806-
linkType: hard
13807-
1380813790
"minipass@npm:^5.0.0":
1380913791
version: 5.0.0
1381013792
resolution: "minipass@npm:5.0.0"
@@ -17682,7 +17664,7 @@ __metadata:
1768217664
languageName: node
1768317665
linkType: hard
1768417666

17685-
"tar@npm:^6.1.11, tar@npm:^6.1.6, tar@npm:^6.2.1":
17667+
"tar@npm:^6.1.11, tar@npm:^6.2.1":
1768617668
version: 6.2.1
1768717669
resolution: "tar@npm:6.2.1"
1768817670
dependencies:
@@ -17696,7 +17678,7 @@ __metadata:
1769617678
languageName: node
1769717679
linkType: hard
1769817680

17699-
"tar@npm:^7.4.3":
17681+
"tar@npm:^7.0.0, tar@npm:^7.4.3":
1770017682
version: 7.4.3
1770117683
resolution: "tar@npm:7.4.3"
1770217684
dependencies:

0 commit comments

Comments
 (0)