@hyperframes/core 0.8.210 → 0.8.211
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.
|
@@ -3,6 +3,7 @@ interface Options {
|
|
|
3
3
|
/** Copy the bytes when Windows keeps refusing (a TEMP that denies delete). Not atomic: scratch files only. */
|
|
4
4
|
copyFallback?: boolean;
|
|
5
5
|
}
|
|
6
|
+
export declare function isWindowsHold(error: unknown, platform?: NodeJS.Platform): boolean;
|
|
6
7
|
/** `renameSync` that rides out Windows' transient file locks; other platforms and errors throw at once. */
|
|
7
8
|
export declare function renameWithRetry(from: string, to: string, options?: Options & {
|
|
8
9
|
rename?: (from: string, to: string) => void;
|
package/dist/renameWithRetry.js
CHANGED
|
@@ -5,14 +5,14 @@ import { removeScratch } from "./removeScratch.js";
|
|
|
5
5
|
// file; the hold clears within milliseconds. Total wait before giving up: about 1.3 s.
|
|
6
6
|
const RETRYABLE = new Set(["EPERM", "EACCES", "EBUSY"]);
|
|
7
7
|
const BACKOFF_MS = [10, 20, 40, 80, 160, 320, 640];
|
|
8
|
-
function
|
|
8
|
+
export function isWindowsHold(error, platform = process.platform) {
|
|
9
9
|
if (platform !== "win32")
|
|
10
10
|
return false;
|
|
11
11
|
return RETRYABLE.has(error?.code ?? "");
|
|
12
12
|
}
|
|
13
13
|
/** What a refused rename does next: wait and try again, fall back to a copy, or give up with the error. */
|
|
14
14
|
function nextStep(error, attempt, options, platform) {
|
|
15
|
-
if (!
|
|
15
|
+
if (!isWindowsHold(error, platform))
|
|
16
16
|
return "throw";
|
|
17
17
|
if (attempt < BACKOFF_MS.length)
|
|
18
18
|
return "wait";
|
package/dist/runtime/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.211",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -425,9 +425,9 @@
|
|
|
425
425
|
"linkedom": "^0.18.12",
|
|
426
426
|
"postcss": "^8.5.8",
|
|
427
427
|
"wawoff2": "^2.0.1",
|
|
428
|
-
"@hyperframes/
|
|
429
|
-
"@hyperframes/
|
|
430
|
-
"@hyperframes/
|
|
428
|
+
"@hyperframes/parsers": "0.8.211",
|
|
429
|
+
"@hyperframes/lint": "0.8.211",
|
|
430
|
+
"@hyperframes/studio-server": "0.8.211"
|
|
431
431
|
},
|
|
432
432
|
"devDependencies": {
|
|
433
433
|
"@fontsource/archivo-black": "^5.2.8",
|