pnpm 8.7.2 → 8.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -230,7 +230,7 @@ hoistedLocations:
230
230
  - node_modules/strip-ansi-cjs
231
231
  /strip-ansi/7.1.0:
232
232
  - node_modules/strip-ansi
233
- /tar/6.1.15:
233
+ /tar/6.2.0:
234
234
  - node_modules/tar
235
235
  /unique-filename/3.0.0:
236
236
  - node_modules/unique-filename
@@ -271,7 +271,7 @@ pendingBuilds:
271
271
  - /rimraf/3.0.2
272
272
  - /semver/7.5.4
273
273
  - /lru-cache/6.0.0
274
- - /tar/6.1.15
274
+ - /tar/6.2.0
275
275
  - /fs-minipass/2.1.0
276
276
  - /minipass/3.3.6
277
277
  - /minipass/5.0.0
@@ -392,7 +392,7 @@ pendingBuilds:
392
392
  - /ansi-styles/6.2.1
393
393
  - /color-convert/2.0.1
394
394
  - /color-name/1.1.4
395
- prunedAt: Mon, 04 Sep 2023 15:02:28 GMT
395
+ prunedAt: Tue, 05 Sep 2023 22:28:41 GMT
396
396
  publicHoistPattern:
397
397
  - '*eslint*'
398
398
  - '*prettier*'
@@ -168,7 +168,7 @@ packages:
168
168
  minipass-pipeline: 1.2.4
169
169
  p-map: 4.0.0
170
170
  ssri: 10.0.5
171
- tar: 6.1.15
171
+ tar: 6.2.0
172
172
  unique-filename: 3.0.0
173
173
  dev: false
174
174
  optional: true
@@ -688,7 +688,7 @@ packages:
688
688
  npmlog: 6.0.2
689
689
  rimraf: 3.0.2
690
690
  semver: 7.5.4
691
- tar: 6.1.15
691
+ tar: 6.2.0
692
692
  which: 2.0.2
693
693
  transitivePeerDependencies:
694
694
  - supports-color
@@ -939,8 +939,8 @@ packages:
939
939
  dev: false
940
940
  optional: true
941
941
 
942
- /tar@6.1.15:
943
- resolution: {integrity: sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==}
942
+ /tar@6.2.0:
943
+ resolution: {integrity: sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==}
944
944
  engines: {node: '>=10'}
945
945
  requiresBuild: true
946
946
  dependencies:
@@ -79,14 +79,26 @@ const Pack = warner(class Pack extends Minipass {
79
79
 
80
80
  this.portable = !!opt.portable
81
81
  this.zip = null
82
- if (opt.gzip) {
83
- if (typeof opt.gzip !== 'object') {
84
- opt.gzip = {}
82
+
83
+ if (opt.gzip || opt.brotli) {
84
+ if (opt.gzip && opt.brotli) {
85
+ throw new TypeError('gzip and brotli are mutually exclusive')
85
86
  }
86
- if (this.portable) {
87
- opt.gzip.portable = true
87
+ if (opt.gzip) {
88
+ if (typeof opt.gzip !== 'object') {
89
+ opt.gzip = {}
90
+ }
91
+ if (this.portable) {
92
+ opt.gzip.portable = true
93
+ }
94
+ this.zip = new zlib.Gzip(opt.gzip)
95
+ }
96
+ if (opt.brotli) {
97
+ if (typeof opt.brotli !== 'object') {
98
+ opt.brotli = {}
99
+ }
100
+ this.zip = new zlib.BrotliCompress(opt.brotli)
88
101
  }
89
- this.zip = new zlib.Gzip(opt.gzip)
90
102
  this.zip.on('data', chunk => super.write(chunk))
91
103
  this.zip.on('end', _ => super.end())
92
104
  this.zip.on('drain', _ => this[ONDRAIN]())
@@ -97,6 +97,16 @@ module.exports = warner(class Parser extends EE {
97
97
  this.strict = !!opt.strict
98
98
  this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize
99
99
  this.filter = typeof opt.filter === 'function' ? opt.filter : noop
100
+ // Unlike gzip, brotli doesn't have any magic bytes to identify it
101
+ // Users need to explicitly tell us they're extracting a brotli file
102
+ // Or we infer from the file extension
103
+ const isTBR = (opt.file && (
104
+ opt.file.endsWith('.tar.br') || opt.file.endsWith('.tbr')))
105
+ // if it's a tbr file it MIGHT be brotli, but we don't know until
106
+ // we look at it and verify it's not a valid tar file.
107
+ this.brotli = !opt.gzip && opt.brotli !== undefined ? opt.brotli
108
+ : isTBR ? undefined
109
+ : false
100
110
 
101
111
  // have to set this so that streams are ok piping into it
102
112
  this.writable = true
@@ -347,7 +357,9 @@ module.exports = warner(class Parser extends EE {
347
357
  }
348
358
 
349
359
  // first write, might be gzipped
350
- if (this[UNZIP] === null && chunk) {
360
+ const needSniff = this[UNZIP] === null ||
361
+ this.brotli === undefined && this[UNZIP] === false
362
+ if (needSniff && chunk) {
351
363
  if (this[BUFFER]) {
352
364
  chunk = Buffer.concat([this[BUFFER], chunk])
353
365
  this[BUFFER] = null
@@ -356,15 +368,45 @@ module.exports = warner(class Parser extends EE {
356
368
  this[BUFFER] = chunk
357
369
  return true
358
370
  }
371
+
372
+ // look for gzip header
359
373
  for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) {
360
374
  if (chunk[i] !== gzipHeader[i]) {
361
375
  this[UNZIP] = false
362
376
  }
363
377
  }
364
- if (this[UNZIP] === null) {
378
+
379
+ const maybeBrotli = this.brotli === undefined
380
+ if (this[UNZIP] === false && maybeBrotli) {
381
+ // read the first header to see if it's a valid tar file. If so,
382
+ // we can safely assume that it's not actually brotli, despite the
383
+ // .tbr or .tar.br file extension.
384
+ // if we ended before getting a full chunk, yes, def brotli
385
+ if (chunk.length < 512) {
386
+ if (this[ENDED]) {
387
+ this.brotli = true
388
+ } else {
389
+ this[BUFFER] = chunk
390
+ return true
391
+ }
392
+ } else {
393
+ // if it's tar, it's pretty reliably not brotli, chances of
394
+ // that happening are astronomical.
395
+ try {
396
+ new Header(chunk.slice(0, 512))
397
+ this.brotli = false
398
+ } catch (_) {
399
+ this.brotli = true
400
+ }
401
+ }
402
+ }
403
+
404
+ if (this[UNZIP] === null || (this[UNZIP] === false && this.brotli)) {
365
405
  const ended = this[ENDED]
366
406
  this[ENDED] = false
367
- this[UNZIP] = new zlib.Unzip()
407
+ this[UNZIP] = this[UNZIP] === null
408
+ ? new zlib.Unzip()
409
+ : new zlib.BrotliDecompress()
368
410
  this[UNZIP].on('data', chunk => this[CONSUMECHUNK](chunk))
369
411
  this[UNZIP].on('error', er => this.abort(er))
370
412
  this[UNZIP].on('end', _ => {
@@ -502,6 +544,7 @@ module.exports = warner(class Parser extends EE {
502
544
  this[UNZIP].end(chunk)
503
545
  } else {
504
546
  this[ENDED] = true
547
+ if (this.brotli === undefined) chunk = chunk || Buffer.alloc(0)
505
548
  this.write(chunk)
506
549
  }
507
550
  }
@@ -23,7 +23,7 @@ module.exports = (opt_, files, cb) => {
23
23
  throw new TypeError('file is required')
24
24
  }
25
25
 
26
- if (opt.gzip) {
26
+ if (opt.gzip || opt.brotli || opt.file.endsWith('.br') || opt.file.endsWith('.tbr')) {
27
27
  throw new TypeError('cannot append to compressed archives')
28
28
  }
29
29
 
@@ -13,7 +13,7 @@ module.exports = (opt_, files, cb) => {
13
13
  throw new TypeError('file is required')
14
14
  }
15
15
 
16
- if (opt.gzip) {
16
+ if (opt.gzip || opt.brotli || opt.file.endsWith('.br') || opt.file.endsWith('.tbr')) {
17
17
  throw new TypeError('cannot append to compressed archives')
18
18
  }
19
19
 
@@ -2,20 +2,15 @@
2
2
  "author": "GitHub Inc.",
3
3
  "name": "tar",
4
4
  "description": "tar for node",
5
- "version": "6.1.15",
5
+ "version": "6.2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/isaacs/node-tar.git"
9
9
  },
10
10
  "scripts": {
11
11
  "genparse": "node scripts/generate-parse-fixtures.js",
12
- "template-oss-apply": "template-oss-apply --force",
13
- "lint": "eslint \"**/*.js\"",
14
- "postlint": "template-oss-check",
15
- "lintfix": "npm run lint -- --fix",
16
12
  "snap": "tap",
17
- "test": "tap",
18
- "posttest": "npm run lint"
13
+ "test": "tap"
19
14
  },
20
15
  "dependencies": {
21
16
  "chownr": "^2.0.0",