pnpm 11.5.1 → 11.5.2
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/node_modules/tinyglobby/dist/index.cjs +19 -18
- package/dist/node_modules/tinyglobby/dist/index.d.cts +1 -1
- package/dist/node_modules/tinyglobby/dist/index.d.mts +1 -1
- package/dist/node_modules/tinyglobby/dist/index.mjs +9 -8
- package/dist/node_modules/tinyglobby/package.json +9 -12
- package/dist/pnpm.mjs +1180 -800
- package/dist/worker.js +83 -152
- package/package.json +1 -1
package/dist/worker.js
CHANGED
|
@@ -8439,21 +8439,21 @@ init_rename_overwrite();
|
|
|
8439
8439
|
var import_sanitize_filename = __toESM(require_sanitize_filename(), 1);
|
|
8440
8440
|
var filenameConflictsLogger = logger("_filename-conflicts");
|
|
8441
8441
|
function importIndexedDir(importer, newDir, filenames, opts2) {
|
|
8442
|
-
if (!opts2.keepModulesDir)
|
|
8443
|
-
|
|
8444
|
-
|
|
8442
|
+
if (!opts2.keepModulesDir) {
|
|
8443
|
+
if (opts2.safeToSkip) {
|
|
8444
|
+
try {
|
|
8445
8445
|
fs9.mkdirSync(newDir, { recursive: true });
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
}
|
|
8449
|
-
|
|
8450
|
-
return;
|
|
8451
|
-
} catch (err) {
|
|
8452
|
-
if (util6.types.isNativeError(err) && "code" in err && err.code === "EEXIST") {
|
|
8453
|
-
if (allFilesMatch(newDir, filenames))
|
|
8446
|
+
tryImportIndexedDir(importer, newDir, filenames);
|
|
8447
|
+
return;
|
|
8448
|
+
} catch (err) {
|
|
8449
|
+
if (util6.types.isNativeError(err) && "code" in err && err.code === "EEXIST" && allFilesMatch(newDir, filenames)) {
|
|
8454
8450
|
return;
|
|
8451
|
+
}
|
|
8455
8452
|
}
|
|
8453
|
+
} else if (tryExclusiveImport(importer, newDir, filenames)) {
|
|
8454
|
+
return;
|
|
8456
8455
|
}
|
|
8456
|
+
}
|
|
8457
8457
|
const stage = fastPathTemp(newDir);
|
|
8458
8458
|
try {
|
|
8459
8459
|
makeEmptyDirSync(stage, { recursive: true });
|
|
@@ -8511,6 +8511,26 @@ function importIndexedDir(importer, newDir, filenames, opts2) {
|
|
|
8511
8511
|
throw renameErr;
|
|
8512
8512
|
}
|
|
8513
8513
|
}
|
|
8514
|
+
function tryExclusiveImport(importer, newDir, filenames) {
|
|
8515
|
+
fs9.mkdirSync(path13.dirname(newDir), { recursive: true });
|
|
8516
|
+
try {
|
|
8517
|
+
fs9.mkdirSync(newDir);
|
|
8518
|
+
} catch (err) {
|
|
8519
|
+
if (util6.types.isNativeError(err) && "code" in err && err.code === "EEXIST")
|
|
8520
|
+
return false;
|
|
8521
|
+
throw err;
|
|
8522
|
+
}
|
|
8523
|
+
try {
|
|
8524
|
+
tryImportIndexedDir(importer, newDir, filenames);
|
|
8525
|
+
return true;
|
|
8526
|
+
} catch {
|
|
8527
|
+
try {
|
|
8528
|
+
rimrafSync(newDir);
|
|
8529
|
+
} catch {
|
|
8530
|
+
}
|
|
8531
|
+
return false;
|
|
8532
|
+
}
|
|
8533
|
+
}
|
|
8514
8534
|
function allFilesMatch(dir, filenames) {
|
|
8515
8535
|
for (const [f, src2] of filenames) {
|
|
8516
8536
|
const target2 = path13.join(dir, f);
|
|
@@ -12313,8 +12333,8 @@ If you want to ignore this issue, set strictStorePkgContentCheck to false in you
|
|
|
12313
12333
|
parentPort.postMessage({ status: "success" });
|
|
12314
12334
|
break;
|
|
12315
12335
|
}
|
|
12316
|
-
case "
|
|
12317
|
-
parentPort.postMessage(await
|
|
12336
|
+
case "write-cafs-files": {
|
|
12337
|
+
parentPort.postMessage(await writeCafsFiles(message));
|
|
12318
12338
|
break;
|
|
12319
12339
|
}
|
|
12320
12340
|
}
|
|
@@ -12552,149 +12572,60 @@ function symlinkAllModules(opts2) {
|
|
|
12552
12572
|
}
|
|
12553
12573
|
return { status: "success" };
|
|
12554
12574
|
}
|
|
12555
|
-
async function
|
|
12556
|
-
const http = await import("node:http");
|
|
12557
|
-
const https = await import("node:https");
|
|
12558
|
-
const { URL } = await import("node:url");
|
|
12559
|
-
const { createGunzip } = await import("node:zlib");
|
|
12575
|
+
async function writeCafsFiles(message) {
|
|
12560
12576
|
const { contentPathFromHex: contentPathFromHex2 } = await Promise.resolve().then(() => (init_lib5(), lib_exports));
|
|
12561
|
-
const
|
|
12562
|
-
const
|
|
12563
|
-
const requestFn = url.protocol === "https:" ? https.request : http.request;
|
|
12564
|
-
const body = JSON.stringify({ digests: message.digests });
|
|
12577
|
+
const payload = Buffer.from(message.payload.buffer, message.payload.byteOffset, message.payload.byteLength);
|
|
12578
|
+
const END_MARKER = Buffer.alloc(64, 0);
|
|
12565
12579
|
const createdDirs = /* @__PURE__ */ new Set();
|
|
12566
|
-
|
|
12567
|
-
|
|
12568
|
-
|
|
12569
|
-
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
|
|
12573
|
-
|
|
12574
|
-
|
|
12575
|
-
|
|
12576
|
-
|
|
12577
|
-
|
|
12578
|
-
|
|
12579
|
-
|
|
12580
|
-
|
|
12581
|
-
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
|
|
12585
|
-
|
|
12586
|
-
|
|
12587
|
-
|
|
12588
|
-
|
|
12589
|
-
|
|
12590
|
-
|
|
12591
|
-
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
const digest = buf.subarray(0, 64).toString("hex");
|
|
12601
|
-
const executable = (buf[68] & 1) !== 0;
|
|
12602
|
-
const requestKey = `${digest}:${executable ? "x" : ""}`;
|
|
12603
|
-
if (!requestedDigests.has(requestKey)) {
|
|
12604
|
-
throw new Error(`pnpm agent /v1/files returned an entry that was not requested: digest=${digest} executable=${String(executable)}`);
|
|
12605
|
-
}
|
|
12606
|
-
requestedDigests.delete(requestKey);
|
|
12607
|
-
const content = buf.subarray(69, entryLen);
|
|
12608
|
-
const relPath = contentPathFromHex2(executable ? "exec" : "nonexec", digest);
|
|
12609
|
-
const fullPath = path16.join(message.storeDir, relPath);
|
|
12610
|
-
const dir = path16.dirname(fullPath);
|
|
12611
|
-
if (!createdDirs.has(dir)) {
|
|
12612
|
-
fs12.mkdirSync(dir, { recursive: true });
|
|
12613
|
-
createdDirs.add(dir);
|
|
12614
|
-
}
|
|
12615
|
-
try {
|
|
12616
|
-
fs12.writeFileSync(fullPath, content, { flag: "wx", mode: executable ? 493 : 420 });
|
|
12617
|
-
} catch (err) {
|
|
12618
|
-
if (!(err instanceof Error && "code" in err && err.code === "EEXIST")) {
|
|
12619
|
-
throw err;
|
|
12620
|
-
}
|
|
12621
|
-
const onDiskSize = fs12.statSync(fullPath).size;
|
|
12622
|
-
if (onDiskSize !== content.length) {
|
|
12623
|
-
const tmpPath = `${fullPath}.tmp-${process.pid}-${Date.now()}`;
|
|
12624
|
-
fs12.writeFileSync(tmpPath, content, { mode: executable ? 493 : 420 });
|
|
12625
|
-
fs12.renameSync(tmpPath, fullPath);
|
|
12626
|
-
}
|
|
12627
|
-
}
|
|
12628
|
-
filesWritten++;
|
|
12629
|
-
buf = buf.subarray(entryLen);
|
|
12630
|
-
}
|
|
12631
|
-
};
|
|
12632
|
-
const safeProcessBuffer = () => {
|
|
12633
|
-
try {
|
|
12634
|
-
processBuffer();
|
|
12635
|
-
return true;
|
|
12636
|
-
} catch (err) {
|
|
12637
|
-
reject(err);
|
|
12638
|
-
req2.destroy();
|
|
12639
|
-
return false;
|
|
12640
|
-
}
|
|
12641
|
-
};
|
|
12642
|
-
const FILES_REQUEST_TIMEOUT_MS = 6e5;
|
|
12643
|
-
const req2 = requestFn(url, {
|
|
12644
|
-
method: "POST",
|
|
12645
|
-
timeout: FILES_REQUEST_TIMEOUT_MS,
|
|
12646
|
-
headers: {
|
|
12647
|
-
"Content-Type": "application/json",
|
|
12648
|
-
"Content-Length": Buffer.byteLength(body),
|
|
12649
|
-
"Accept-Encoding": "gzip"
|
|
12650
|
-
}
|
|
12651
|
-
}, (res) => {
|
|
12652
|
-
if (typeof res.statusCode === "number" && (res.statusCode < 200 || res.statusCode >= 300)) {
|
|
12653
|
-
const chunks = [];
|
|
12654
|
-
res.on("data", (chunk) => chunks.push(chunk));
|
|
12655
|
-
res.on("end", () => {
|
|
12656
|
-
reject(new Error(`pnpm agent /v1/files responded with ${res.statusCode}: ${Buffer.concat(chunks).toString("utf-8")}`));
|
|
12657
|
-
});
|
|
12658
|
-
res.on("error", reject);
|
|
12659
|
-
return;
|
|
12580
|
+
if (payload.length < 4) {
|
|
12581
|
+
throw new Error("pnpr server /v1/install file payload is truncated");
|
|
12582
|
+
}
|
|
12583
|
+
const jsonLen = payload.readUInt32BE(0);
|
|
12584
|
+
let offset = 4 + jsonLen;
|
|
12585
|
+
let filesWritten = 0;
|
|
12586
|
+
let endMarkerSeen = false;
|
|
12587
|
+
while (offset + 64 <= payload.length) {
|
|
12588
|
+
if (payload.subarray(offset, offset + 64).equals(END_MARKER)) {
|
|
12589
|
+
endMarkerSeen = true;
|
|
12590
|
+
offset += 64;
|
|
12591
|
+
break;
|
|
12592
|
+
}
|
|
12593
|
+
if (offset + 69 > payload.length)
|
|
12594
|
+
break;
|
|
12595
|
+
const size = payload.readUInt32BE(offset + 64);
|
|
12596
|
+
const entryLen = 69 + size;
|
|
12597
|
+
if (offset + entryLen > payload.length)
|
|
12598
|
+
break;
|
|
12599
|
+
const digest = payload.subarray(offset, offset + 64).toString("hex");
|
|
12600
|
+
const executable = (payload[offset + 68] & 1) !== 0;
|
|
12601
|
+
const content = payload.subarray(offset + 69, offset + entryLen);
|
|
12602
|
+
const relPath = contentPathFromHex2(executable ? "exec" : "nonexec", digest);
|
|
12603
|
+
const fullPath = path16.join(message.storeDir, relPath);
|
|
12604
|
+
const dir = path16.dirname(fullPath);
|
|
12605
|
+
if (!createdDirs.has(dir)) {
|
|
12606
|
+
fs12.mkdirSync(dir, { recursive: true });
|
|
12607
|
+
createdDirs.add(dir);
|
|
12608
|
+
}
|
|
12609
|
+
try {
|
|
12610
|
+
fs12.writeFileSync(fullPath, content, { flag: "wx", mode: executable ? 493 : 420 });
|
|
12611
|
+
} catch (err) {
|
|
12612
|
+
if (!(err instanceof Error && "code" in err && err.code === "EEXIST")) {
|
|
12613
|
+
throw err;
|
|
12660
12614
|
}
|
|
12661
|
-
|
|
12662
|
-
if (
|
|
12663
|
-
const
|
|
12664
|
-
|
|
12665
|
-
|
|
12615
|
+
const onDiskSize = fs12.statSync(fullPath).size;
|
|
12616
|
+
if (onDiskSize !== content.length) {
|
|
12617
|
+
const tmpPath = `${fullPath}.tmp-${process.pid}-${Date.now()}`;
|
|
12618
|
+
fs12.writeFileSync(tmpPath, content, { mode: executable ? 493 : 420 });
|
|
12619
|
+
fs12.renameSync(tmpPath, fullPath);
|
|
12666
12620
|
}
|
|
12667
|
-
|
|
12668
|
-
|
|
12669
|
-
|
|
12670
|
-
|
|
12671
|
-
|
|
12672
|
-
|
|
12673
|
-
|
|
12674
|
-
|
|
12675
|
-
reject(new Error("pnpm agent /v1/files stream ended without the end marker"));
|
|
12676
|
-
return;
|
|
12677
|
-
}
|
|
12678
|
-
if (buf.length > 0) {
|
|
12679
|
-
reject(new Error(`pnpm agent /v1/files stream left ${buf.length} unparsed bytes after end marker`));
|
|
12680
|
-
return;
|
|
12681
|
-
}
|
|
12682
|
-
if (requestedDigests.size > 0) {
|
|
12683
|
-
const sample = [...requestedDigests].slice(0, 3).join(", ");
|
|
12684
|
-
reject(new Error(`pnpm agent /v1/files omitted ${requestedDigests.size} requested entries (e.g. ${sample})`));
|
|
12685
|
-
return;
|
|
12686
|
-
}
|
|
12687
|
-
resolve({ status: "success", filesWritten });
|
|
12688
|
-
});
|
|
12689
|
-
stream.on("error", reject);
|
|
12690
|
-
});
|
|
12691
|
-
req2.on("timeout", () => {
|
|
12692
|
-
req2.destroy(new Error(`pnpm agent /v1/files request timed out after ${FILES_REQUEST_TIMEOUT_MS / 1e3}s`));
|
|
12693
|
-
});
|
|
12694
|
-
req2.on("error", reject);
|
|
12695
|
-
req2.write(body);
|
|
12696
|
-
req2.end();
|
|
12697
|
-
});
|
|
12621
|
+
}
|
|
12622
|
+
filesWritten++;
|
|
12623
|
+
offset += entryLen;
|
|
12624
|
+
}
|
|
12625
|
+
if (!endMarkerSeen) {
|
|
12626
|
+
throw new Error("pnpr server /v1/install file payload ended without the end marker");
|
|
12627
|
+
}
|
|
12628
|
+
return { status: "success", filesWritten };
|
|
12698
12629
|
}
|
|
12699
12630
|
|
|
12700
12631
|
// ../worker/lib/worker.js
|