@pnpm/exe 11.0.8 → 11.0.9

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.
@@ -15,6 +15,7 @@ export class PackJob {
15
15
  stat;
16
16
  readdir;
17
17
  pending = false;
18
+ pendingLink = false;
18
19
  ignore = false;
19
20
  piped = false;
20
21
  constructor(path, absolute) {
@@ -31,6 +32,7 @@ const EOF = Buffer.alloc(1024);
31
32
  const ONSTAT = Symbol('onStat');
32
33
  const ENDED = Symbol('ended');
33
34
  const QUEUE = Symbol('queue');
35
+ const PENDINGLINKS = Symbol('queue');
34
36
  const CURRENT = Symbol('current');
35
37
  const PROCESS = Symbol('process');
36
38
  const PROCESSING = Symbol('processing');
@@ -82,6 +84,7 @@ export class Pack extends Minipass {
82
84
  // class, but then we'd have to be tracking the tail of the queue the
83
85
  // whole time, and Yallist just does that for us anyway.
84
86
  [QUEUE];
87
+ [PENDINGLINKS] = new Map();
85
88
  [JOBS] = 0;
86
89
  [PROCESSING] = false;
87
90
  [ENDED] = false;
@@ -239,14 +242,26 @@ export class Pack extends Minipass {
239
242
  }
240
243
  else if (stat.isFile() &&
241
244
  stat.nlink > 1 &&
242
- job === this[CURRENT] &&
243
245
  !this.linkCache.get(`${stat.dev}:${stat.ino}`) &&
244
246
  !this.sync) {
245
- // if it's not filtered, and it's a new File entry,
246
- // jump the queue in case any pending Link entries are about
247
- // to try to link to it. This prevents a hardlink from coming ahead
248
- // of its target in the archive.
249
- this[PROCESSJOB](job);
247
+ // if it's not filtered, and it's a new File entry, and next anyway
248
+ // process right away in case any pending Link entries are about
249
+ // to try to link to it.
250
+ if (job === this[CURRENT]) {
251
+ this[PROCESSJOB](job);
252
+ }
253
+ else {
254
+ // if it's NOT the current entry, it needs to be deferred,
255
+ // so that the link target can be built first.
256
+ const key = `${stat.dev}:${stat.ino}`;
257
+ const pending = this[PENDINGLINKS].get(key);
258
+ if (pending)
259
+ pending.push(job);
260
+ else
261
+ this[PENDINGLINKS].set(key, [job]);
262
+ job.pendingLink = true;
263
+ job.pending = true;
264
+ }
250
265
  }
251
266
  this[PROCESS]();
252
267
  }
@@ -294,12 +309,31 @@ export class Pack extends Minipass {
294
309
  get [CURRENT]() {
295
310
  return this[QUEUE] && this[QUEUE].head && this[QUEUE].head.value;
296
311
  }
297
- [JOBDONE](_job) {
312
+ [JOBDONE](job) {
298
313
  this[QUEUE].shift();
299
314
  this[JOBS] -= 1;
315
+ const { stat } = job;
316
+ if (stat && stat.isFile() && stat.nlink > 1) {
317
+ // might be a file with pending links
318
+ const key = `${stat.dev}:${stat.ino}`;
319
+ const pending = this[PENDINGLINKS].get(key);
320
+ if (pending) {
321
+ this[PENDINGLINKS].delete(key);
322
+ for (const job of pending) {
323
+ job.pending = false;
324
+ this[PROCESSJOB](job);
325
+ }
326
+ }
327
+ }
300
328
  this[PROCESS]();
301
329
  }
302
330
  [PROCESSJOB](job) {
331
+ if (job.pending && job.pendingLink && job === this[CURRENT]) {
332
+ // At least one of the links to this file are not being included
333
+ // in the tarball, so we need to just proceed.
334
+ job.pending = false;
335
+ job.pendingLink = false;
336
+ }
303
337
  if (job.pending) {
304
338
  return;
305
339
  }
@@ -2,7 +2,7 @@
2
2
  "author": "Isaac Z. Schlueter",
3
3
  "name": "tar",
4
4
  "description": "tar for node",
5
- "version": "7.5.13",
5
+ "version": "7.5.15",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/isaacs/node-tar.git"
@@ -38,13 +38,13 @@
38
38
  "events-to-array": "^2.0.3",
39
39
  "mutate-fs": "^2.1.1",
40
40
  "nock": "^13.5.4",
41
- "oxlint": "^1.56.0",
42
- "oxlint-tsgolint": "^0.17.0",
41
+ "oxlint": "^1.57.0",
42
+ "oxlint-tsgolint": "^0.17.3",
43
43
  "prettier": "^3.8.1",
44
44
  "rimraf": "^6.1.2",
45
45
  "tap": "^21.6.2",
46
46
  "tshy": "^3.3.2",
47
- "typedoc": "^0.28.17"
47
+ "typedoc": "^0.28.18"
48
48
  },
49
49
  "license": "BlueOak-1.0.0",
50
50
  "engines": {