@pnpm/exe 11.25.0 → 11.26.0

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.
package/dist/worker.js CHANGED
@@ -8192,17 +8192,42 @@ function verifyFile(filename, fstat, algorithm) {
8192
8192
  return false;
8193
8193
  if (currentFile.isModified) {
8194
8194
  if (currentFile.size !== fstat.size) {
8195
- rimrafSync(filename);
8195
+ scrubDirectoryAtCafsPath(filename);
8196
8196
  return false;
8197
8197
  }
8198
8198
  const passed = tallyVerifyFileIntegrity(filename, { digest: fstat.digest, algorithm });
8199
8199
  if (!passed) {
8200
- lib_default.unlinkSync(filename);
8200
+ scrubDirectoryAtCafsPath(filename);
8201
8201
  }
8202
8202
  return passed;
8203
8203
  }
8204
8204
  return true;
8205
8205
  }
8206
+ var scrubCounter = 0;
8207
+ function scrubDirectoryAtCafsPath(filename) {
8208
+ let stats;
8209
+ try {
8210
+ stats = fs7.lstatSync(filename);
8211
+ } catch {
8212
+ return;
8213
+ }
8214
+ if (!stats.isDirectory())
8215
+ return;
8216
+ const scrubName = `${filename}.pnpm-scrub-${process.pid}-${scrubCounter++}`;
8217
+ try {
8218
+ fs7.renameSync(filename, scrubName);
8219
+ } catch {
8220
+ return;
8221
+ }
8222
+ try {
8223
+ if (fs7.lstatSync(scrubName).isDirectory()) {
8224
+ rimrafSync(scrubName);
8225
+ } else {
8226
+ fs7.renameSync(scrubName, filename);
8227
+ }
8228
+ } catch {
8229
+ }
8230
+ }
8206
8231
  function tallyVerifyFileIntegrity(filename, integrity) {
8207
8232
  const startedAt = performance.now();
8208
8233
  const data = readFileForIntegrity(filename);
@@ -9303,7 +9328,7 @@ import fs12 from "node:fs";
9303
9328
  import { createRequire as createRequire2 } from "node:module";
9304
9329
  import { pathToFileURL } from "node:url";
9305
9330
 
9306
- // ../../../../../setup-pnpm/store/v11/links/@/msgpackr/2.0.6/a2aca5241063066c88f702ea8b49ae301bed78743a72adc0cb6671e2b0499054/node_modules/msgpackr/unpack.js
9331
+ // ../../../../../setup-pnpm/store/v11/links/@/msgpackr/2.1.0/7de4e5dfa9fdd77fa14e279018283444ebf101e28515ed5f67256318898f602f/node_modules/msgpackr/unpack.js
9307
9332
  var decoder;
9308
9333
  try {
9309
9334
  decoder = new TextDecoder();
@@ -10432,7 +10457,7 @@ var f32Array = new Float32Array(1);
10432
10457
  var u8Array = new Uint8Array(f32Array.buffer, 0, 4);
10433
10458
  Unpackr.SUPPORTS_STRUCT_HOOKS = true;
10434
10459
 
10435
- // ../../../../../setup-pnpm/store/v11/links/@/msgpackr/2.0.6/a2aca5241063066c88f702ea8b49ae301bed78743a72adc0cb6671e2b0499054/node_modules/msgpackr/pack.js
10460
+ // ../../../../../setup-pnpm/store/v11/links/@/msgpackr/2.1.0/7de4e5dfa9fdd77fa14e279018283444ebf101e28515ed5f67256318898f602f/node_modules/msgpackr/pack.js
10436
10461
  var textEncoder;
10437
10462
  try {
10438
10463
  textEncoder = new TextEncoder();
@@ -10556,7 +10581,7 @@ var Packr = class extends Unpackr {
10556
10581
  if (packr2._writeStruct && value && typeof value === "object") {
10557
10582
  if (value.constructor === Object) writeStruct(value);
10558
10583
  else if (value.constructor !== Map && !Array.isArray(value) && !extensionClasses.some((extClass) => value instanceof extClass)) {
10559
- writeStruct(value.toJSON ? value.toJSON() : value);
10584
+ writeStruct(packr2.useToJSON !== false && value.toJSON ? value.toJSON() : value);
10560
10585
  } else pack2(value);
10561
10586
  } else
10562
10587
  pack2(value);
@@ -10924,7 +10949,7 @@ var Packr = class extends Unpackr {
10924
10949
  if (Array.isArray(value)) {
10925
10950
  packArray(value);
10926
10951
  } else {
10927
- if (value.toJSON) {
10952
+ if (packr2.useToJSON !== false && value.toJSON) {
10928
10953
  const json = value.toJSON();
10929
10954
  if (json !== value)
10930
10955
  return pack2(json);
@@ -11495,7 +11520,7 @@ var REUSE_BUFFER_MODE = 512;
11495
11520
  var RESET_BUFFER_MODE = 1024;
11496
11521
  var RESERVE_START_SPACE = 2048;
11497
11522
 
11498
- // ../../../../../setup-pnpm/store/v11/links/@/msgpackr/2.0.6/a2aca5241063066c88f702ea8b49ae301bed78743a72adc0cb6671e2b0499054/node_modules/msgpackr/node-index.js
11523
+ // ../../../../../setup-pnpm/store/v11/links/@/msgpackr/2.1.0/7de4e5dfa9fdd77fa14e279018283444ebf101e28515ed5f67256318898f602f/node_modules/msgpackr/node-index.js
11499
11524
  import { createRequire } from "module";
11500
11525
  var nativeAccelerationDisabled = process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED !== void 0 && process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED.toLowerCase() === "true";
11501
11526
  if (!nativeAccelerationDisabled) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/exe",
3
- "version": "11.25.0",
3
+ "version": "11.26.0",
4
4
  "description": "Fast, disk space efficient package manager",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -35,17 +35,17 @@
35
35
  "detect-libc": "^2.1.2"
36
36
  },
37
37
  "optionalDependencies": {
38
- "@pnpm/linux-arm64": "11.25.0",
39
- "@pnpm/linux-x64": "11.25.0",
40
- "@pnpm/linuxstatic-arm64": "11.25.0",
41
- "@pnpm/linuxstatic-x64": "11.25.0",
42
- "@pnpm/macos-arm64": "11.25.0",
43
- "@pnpm/win-arm64": "11.25.0",
44
- "@pnpm/win-x64": "11.25.0"
38
+ "@pnpm/linux-arm64": "11.26.0",
39
+ "@pnpm/linux-x64": "11.26.0",
40
+ "@pnpm/linuxstatic-arm64": "11.26.0",
41
+ "@pnpm/linuxstatic-x64": "11.26.0",
42
+ "@pnpm/macos-arm64": "11.26.0",
43
+ "@pnpm/win-arm64": "11.26.0",
44
+ "@pnpm/win-x64": "11.26.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@jest/globals": "30.4.1",
48
- "@pnpm/exe": "11.25.0",
48
+ "@pnpm/exe": "11.26.0",
49
49
  "@pnpm/jest-config": "1100.0.22",
50
50
  "@zkochan/cmd-shim": "^9.0.7",
51
51
  "execa": "npm:safe-execa@0.3.0"