@milaboratories/pl-drivers 1.11.21 → 1.11.22
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/drivers/download_blob/sparse_cache/file.cjs +2 -1
- package/dist/drivers/download_blob/sparse_cache/file.cjs.map +1 -1
- package/dist/drivers/download_blob/sparse_cache/file.d.ts.map +1 -1
- package/dist/drivers/download_blob/sparse_cache/file.js +2 -1
- package/dist/drivers/download_blob/sparse_cache/file.js.map +1 -1
- package/package.json +6 -6
- package/src/drivers/download_blob/sparse_cache/file.ts +2 -1
|
@@ -43,7 +43,8 @@ async function createSparseFile(logger, path, platform) {
|
|
|
43
43
|
*/
|
|
44
44
|
async function ensureSparseOnWindows(path, platform) {
|
|
45
45
|
if (platform === 'win32') {
|
|
46
|
-
|
|
46
|
+
// https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-sparse
|
|
47
|
+
await tsHelpers.spawnAsync('fsutil', ['sparse', 'setflag', path], { stdio: 'pipe' });
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
/** Ensures the file is created and writes to it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.cjs","sources":["../../../../src/drivers/download_blob/sparse_cache/file.ts"],"sourcesContent":["import { fileExists, MiLogger, spawnAsync } from \"@milaboratories/ts-helpers\";\nimport * as fs from 'node:fs/promises';\n\n/** Creates a sparse file for all systems\n * Table of what supports sparse files:\n * https://en.wikipedia.org/wiki/Comparison_of_file_systems#Allocation_and_layout_policies */\nexport async function createSparseFile(\n logger: MiLogger,\n path: string,\n platform: NodeJS.Platform,\n) {\n try {\n const ensureCreated = await fs.open(path, 'w');\n await ensureCreated.close();\n\n await ensureSparseOnWindows(path, platform);\n } catch (error: unknown) {\n logger.error(`Error creating file ${path} on platform ${platform}: ${error}`);\n }\n}\n\n/** Sets a sparse flag on Windows.\n * We could check the file is sparse by running:\n * `fsutil sparse queryflag <path>`\n * and\n * `fsutil sparse queryrange <path>`\n */\nasync function ensureSparseOnWindows(path: string, platform: NodeJS.Platform) {\n if (platform === 'win32') {\n await spawnAsync('fsutil', ['sparse', 'setflag',
|
|
1
|
+
{"version":3,"file":"file.cjs","sources":["../../../../src/drivers/download_blob/sparse_cache/file.ts"],"sourcesContent":["import { fileExists, MiLogger, spawnAsync } from \"@milaboratories/ts-helpers\";\nimport * as fs from 'node:fs/promises';\n\n/** Creates a sparse file for all systems\n * Table of what supports sparse files:\n * https://en.wikipedia.org/wiki/Comparison_of_file_systems#Allocation_and_layout_policies */\nexport async function createSparseFile(\n logger: MiLogger,\n path: string,\n platform: NodeJS.Platform,\n) {\n try {\n const ensureCreated = await fs.open(path, 'w');\n await ensureCreated.close();\n\n await ensureSparseOnWindows(path, platform);\n } catch (error: unknown) {\n logger.error(`Error creating file ${path} on platform ${platform}: ${error}`);\n }\n}\n\n/** Sets a sparse flag on Windows.\n * We could check the file is sparse by running:\n * `fsutil sparse queryflag <path>`\n * and\n * `fsutil sparse queryrange <path>`\n */\nasync function ensureSparseOnWindows(path: string, platform: NodeJS.Platform) {\n if (platform === 'win32') {\n // https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-sparse\n await spawnAsync('fsutil', ['sparse', 'setflag', path], { stdio: 'pipe' });\n }\n}\n\n/** Ensures the file is created and writes to it. */\nexport async function writeToSparseFile(\n logger: MiLogger,\n platform: NodeJS.Platform,\n path: string,\n data: Uint8Array,\n from: number\n) {\n if (!(await fileExists(path))) {\n await createSparseFile(logger, path, platform);\n }\n\n const fileHandle = await fs.open(path, 'r+');\n await fileHandle.write(data, 0, data.length, from);\n await fileHandle.close();\n}\n"],"names":["fs","spawnAsync","fileExists"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAE6F;AACtF,eAAe,gBAAgB,CACpC,MAAgB,EAChB,IAAY,EACZ,QAAyB,EAAA;AAEzB,IAAA,IAAI;QACF,MAAM,aAAa,GAAG,MAAMA,cAAE,CAAC,I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,gBAAgB,CACpC,MAAM,EAAE,QAAQ,EAChB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,CAAC,QAAQ,iBAU1B;
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../src/drivers/download_blob/sparse_cache/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAG9E;;6FAE6F;AAC7F,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,QAAQ,EAChB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,CAAC,QAAQ,iBAU1B;AAeD,oDAAoD;AACpD,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,iBASb"}
|
|
@@ -22,7 +22,8 @@ async function createSparseFile(logger, path, platform) {
|
|
|
22
22
|
*/
|
|
23
23
|
async function ensureSparseOnWindows(path, platform) {
|
|
24
24
|
if (platform === 'win32') {
|
|
25
|
-
|
|
25
|
+
// https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-sparse
|
|
26
|
+
await spawnAsync('fsutil', ['sparse', 'setflag', path], { stdio: 'pipe' });
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
/** Ensures the file is created and writes to it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sources":["../../../../src/drivers/download_blob/sparse_cache/file.ts"],"sourcesContent":["import { fileExists, MiLogger, spawnAsync } from \"@milaboratories/ts-helpers\";\nimport * as fs from 'node:fs/promises';\n\n/** Creates a sparse file for all systems\n * Table of what supports sparse files:\n * https://en.wikipedia.org/wiki/Comparison_of_file_systems#Allocation_and_layout_policies */\nexport async function createSparseFile(\n logger: MiLogger,\n path: string,\n platform: NodeJS.Platform,\n) {\n try {\n const ensureCreated = await fs.open(path, 'w');\n await ensureCreated.close();\n\n await ensureSparseOnWindows(path, platform);\n } catch (error: unknown) {\n logger.error(`Error creating file ${path} on platform ${platform}: ${error}`);\n }\n}\n\n/** Sets a sparse flag on Windows.\n * We could check the file is sparse by running:\n * `fsutil sparse queryflag <path>`\n * and\n * `fsutil sparse queryrange <path>`\n */\nasync function ensureSparseOnWindows(path: string, platform: NodeJS.Platform) {\n if (platform === 'win32') {\n await spawnAsync('fsutil', ['sparse', 'setflag',
|
|
1
|
+
{"version":3,"file":"file.js","sources":["../../../../src/drivers/download_blob/sparse_cache/file.ts"],"sourcesContent":["import { fileExists, MiLogger, spawnAsync } from \"@milaboratories/ts-helpers\";\nimport * as fs from 'node:fs/promises';\n\n/** Creates a sparse file for all systems\n * Table of what supports sparse files:\n * https://en.wikipedia.org/wiki/Comparison_of_file_systems#Allocation_and_layout_policies */\nexport async function createSparseFile(\n logger: MiLogger,\n path: string,\n platform: NodeJS.Platform,\n) {\n try {\n const ensureCreated = await fs.open(path, 'w');\n await ensureCreated.close();\n\n await ensureSparseOnWindows(path, platform);\n } catch (error: unknown) {\n logger.error(`Error creating file ${path} on platform ${platform}: ${error}`);\n }\n}\n\n/** Sets a sparse flag on Windows.\n * We could check the file is sparse by running:\n * `fsutil sparse queryflag <path>`\n * and\n * `fsutil sparse queryrange <path>`\n */\nasync function ensureSparseOnWindows(path: string, platform: NodeJS.Platform) {\n if (platform === 'win32') {\n // https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-sparse\n await spawnAsync('fsutil', ['sparse', 'setflag', path], { stdio: 'pipe' });\n }\n}\n\n/** Ensures the file is created and writes to it. */\nexport async function writeToSparseFile(\n logger: MiLogger,\n platform: NodeJS.Platform,\n path: string,\n data: Uint8Array,\n from: number\n) {\n if (!(await fileExists(path))) {\n await createSparseFile(logger, path, platform);\n }\n\n const fileHandle = await fs.open(path, 'r+');\n await fileHandle.write(data, 0, data.length, from);\n await fileHandle.close();\n}\n"],"names":["fs"],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
|
|
2
2
|
"name": "@milaboratories/pl-drivers",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.22",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=22"
|
|
6
6
|
},
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"upath": "^2.0.1",
|
|
34
34
|
"zod": "~3.23.8",
|
|
35
35
|
"@milaboratories/ts-helpers": "1.5.4",
|
|
36
|
+
"@milaboratories/helpers": "1.12.0",
|
|
36
37
|
"@milaboratories/computable": "2.7.4",
|
|
37
38
|
"@milaboratories/pl-client": "2.16.9",
|
|
38
|
-
"@milaboratories/pl-tree": "1.8.16",
|
|
39
39
|
"@milaboratories/pl-model-common": "1.21.8",
|
|
40
|
-
"@milaboratories/
|
|
40
|
+
"@milaboratories/pl-tree": "1.8.16"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/decompress": "^4.2.7",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"eslint": "^9.25.1",
|
|
49
49
|
"typescript": "~5.6.3",
|
|
50
50
|
"vitest": "^4.0.7",
|
|
51
|
-
"@milaboratories/
|
|
51
|
+
"@milaboratories/build-configs": "1.0.8",
|
|
52
52
|
"@milaboratories/ts-builder": "1.0.5",
|
|
53
|
-
"@milaboratories/ts-configs": "1.0.6",
|
|
54
53
|
"@milaboratories/test-helpers": "1.1.1",
|
|
55
|
-
"@milaboratories/
|
|
54
|
+
"@milaboratories/eslint-config": "1.0.5",
|
|
55
|
+
"@milaboratories/ts-configs": "1.0.6"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"type-check": "ts-builder types --target node",
|
|
@@ -27,7 +27,8 @@ export async function createSparseFile(
|
|
|
27
27
|
*/
|
|
28
28
|
async function ensureSparseOnWindows(path: string, platform: NodeJS.Platform) {
|
|
29
29
|
if (platform === 'win32') {
|
|
30
|
-
|
|
30
|
+
// https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-sparse
|
|
31
|
+
await spawnAsync('fsutil', ['sparse', 'setflag', path], { stdio: 'pipe' });
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
|