@thi.ng/block-fs 0.6.31 → 0.6.33
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/README.md +1 -1
- package/cli/convert.js +4 -4
- package/cli/list.js +1 -1
- package/directory.js +1 -1
- package/fs.js +2 -2
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 211 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/cli/convert.js
CHANGED
|
@@ -54,7 +54,7 @@ const CONVERT = {
|
|
|
54
54
|
logger.info("root dir block:", bfs.rootDirBlockID);
|
|
55
55
|
logger.info("first data block:", bfs.dataStartBlockID);
|
|
56
56
|
logger.info("block data size:", bfs.blockDataSize);
|
|
57
|
-
for (
|
|
57
|
+
for (const f of collected.files) {
|
|
58
58
|
const data = readBinary(f.src, logger);
|
|
59
59
|
logger.info("writing file:", f.dest, "size:", data.length);
|
|
60
60
|
await bfs.writeFile(f.dest, data);
|
|
@@ -83,7 +83,7 @@ const collectFiles = ({
|
|
|
83
83
|
const $include = include?.map((x) => new RegExp(x));
|
|
84
84
|
const $exclude = exclude?.map((x) => new RegExp(x));
|
|
85
85
|
let total = 0;
|
|
86
|
-
for (
|
|
86
|
+
for (const f of files(root)) {
|
|
87
87
|
const stats = statSync(f);
|
|
88
88
|
if ($exclude && $exclude.some((x) => x.test(f))) continue;
|
|
89
89
|
if ($include && !$include.some((x) => x.test(f))) continue;
|
|
@@ -95,7 +95,7 @@ const collectFiles = ({
|
|
|
95
95
|
ctime: stats.ctimeMs,
|
|
96
96
|
mtime: stats.mtimeMs
|
|
97
97
|
});
|
|
98
|
-
for (
|
|
98
|
+
for (const d of pathsForFile(dest)) dirs.add(d);
|
|
99
99
|
total += stats.size;
|
|
100
100
|
}
|
|
101
101
|
return { files: filtered, dirs: [...dirs], size: total };
|
|
@@ -113,7 +113,7 @@ const computeBlockCount = (collected, blockSize, logger, numBlocks) => {
|
|
|
113
113
|
logger.info("num entries:", numEntries);
|
|
114
114
|
logger.info("num entry blocks:", numEntryBlocks);
|
|
115
115
|
blocks += numEntryBlocks;
|
|
116
|
-
for (
|
|
116
|
+
for (const f of collected.files) {
|
|
117
117
|
const size = ceil(f.size / blockDataSize);
|
|
118
118
|
logger.debug("file:", f.src, "blocks:", size);
|
|
119
119
|
blocks += size;
|
package/cli/list.js
CHANGED
package/directory.js
CHANGED
package/fs.js
CHANGED
|
@@ -442,11 +442,11 @@ class BlockFS {
|
|
|
442
442
|
const { blockIndex, storage, tmp } = this;
|
|
443
443
|
const blockSize = storage.blockSize;
|
|
444
444
|
const updatedBlocks = /* @__PURE__ */ new Set();
|
|
445
|
-
for (
|
|
445
|
+
for (const id of ids) {
|
|
446
446
|
blockIndex.setAt(id, state);
|
|
447
447
|
updatedBlocks.add((id >>> 3) / blockSize | 0);
|
|
448
448
|
}
|
|
449
|
-
for (
|
|
449
|
+
for (const id of updatedBlocks) {
|
|
450
450
|
this.opts.logger.debug("update block index", id);
|
|
451
451
|
const chunk = blockIndex.data.subarray(
|
|
452
452
|
id * blockSize,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/block-fs",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.33",
|
|
4
4
|
"description": "Customizable block-based storage, adapters & file system layer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -42,18 +42,18 @@
|
|
|
42
42
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@thi.ng/api": "^8.12.
|
|
46
|
-
"@thi.ng/args": "^3.2.
|
|
47
|
-
"@thi.ng/binary": "^3.
|
|
48
|
-
"@thi.ng/bitfield": "^2.4.
|
|
49
|
-
"@thi.ng/checks": "^3.
|
|
50
|
-
"@thi.ng/compare": "^2.4.
|
|
51
|
-
"@thi.ng/errors": "^2.5.
|
|
52
|
-
"@thi.ng/file-io": "^2.2.
|
|
53
|
-
"@thi.ng/logger": "^3.2.
|
|
54
|
-
"@thi.ng/mime": "^2.8.
|
|
55
|
-
"@thi.ng/random": "^4.1.
|
|
56
|
-
"@thi.ng/strings": "^3.9.
|
|
45
|
+
"@thi.ng/api": "^8.12.10",
|
|
46
|
+
"@thi.ng/args": "^3.2.5",
|
|
47
|
+
"@thi.ng/binary": "^3.5.0",
|
|
48
|
+
"@thi.ng/bitfield": "^2.4.23",
|
|
49
|
+
"@thi.ng/checks": "^3.8.0",
|
|
50
|
+
"@thi.ng/compare": "^2.4.36",
|
|
51
|
+
"@thi.ng/errors": "^2.5.50",
|
|
52
|
+
"@thi.ng/file-io": "^2.2.20",
|
|
53
|
+
"@thi.ng/logger": "^3.2.9",
|
|
54
|
+
"@thi.ng/mime": "^2.8.2",
|
|
55
|
+
"@thi.ng/random": "^4.1.35",
|
|
56
|
+
"@thi.ng/strings": "^3.9.31"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "^24.10.1",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"status": "alpha",
|
|
144
144
|
"year": 2024
|
|
145
145
|
},
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "8625a1c6383737a8fdbe7a3f96ea3cbabc957fa6\n"
|
|
147
147
|
}
|