@rljson/fs-agent 0.2.3 → 0.2.4
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.tests.md +1 -1
- package/dist/README.tests.md +1 -1
- package/dist/fs-agent.js +16 -32
- package/dist/fs_agent_version.d.ts +1 -1
- package/package.json +14 -14
package/README.tests.md
CHANGED
|
@@ -9,7 +9,7 @@ found in the LICENSE file in the root of this package.
|
|
|
9
9
|
# The test suite, as a document
|
|
10
10
|
|
|
11
11
|
**70 files, 807 scenarios, 100 % coverage on statements, branches, functions and
|
|
12
|
-
lines.**
|
|
12
|
+
lines.** 806 must pass; one is committed inverted, and §2.11 says which and why.
|
|
13
13
|
One command runs all of it:
|
|
14
14
|
|
|
15
15
|
```bash
|
package/dist/README.tests.md
CHANGED
|
@@ -9,7 +9,7 @@ found in the LICENSE file in the root of this package.
|
|
|
9
9
|
# The test suite, as a document
|
|
10
10
|
|
|
11
11
|
**70 files, 807 scenarios, 100 % coverage on statements, branches, functions and
|
|
12
|
-
lines.**
|
|
12
|
+
lines.** 806 must pass; one is committed inverted, and §2.11 says which and why.
|
|
13
13
|
One command runs all of it:
|
|
14
14
|
|
|
15
15
|
```bash
|
package/dist/fs-agent.js
CHANGED
|
@@ -8,7 +8,7 @@ import { dirname, join, relative, resolve, sep } from "path";
|
|
|
8
8
|
import { Db, stateBeaconEvent } from "@rljson/db";
|
|
9
9
|
import { IoMem, createSocketPair } from "@rljson/io";
|
|
10
10
|
import { Client, Server } from "@rljson/server";
|
|
11
|
-
|
|
11
|
+
// src/fs-signals.ts
|
|
12
12
|
// @license
|
|
13
13
|
/** How many signals {@link FsSignals.all} keeps. */
|
|
14
14
|
var SIGNAL_LOG_MAX = 200;
|
|
@@ -196,8 +196,7 @@ var FsSignals = class FsSignals {
|
|
|
196
196
|
return typeof entry.kind === "string" && typeof entry.at === "number" && Array.isArray(entry.paths) && typeof entry.pathCount === "number" && typeof entry.action === "string";
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
|
-
|
|
200
|
-
//#region src/fs-atomic-write.ts
|
|
199
|
+
// src/fs-atomic-write.ts
|
|
201
200
|
// @license
|
|
202
201
|
/**
|
|
203
202
|
* Filename prefix for the staging files used by atomic writes.
|
|
@@ -327,8 +326,7 @@ var storeFileAsBlob = async (bs, handle, size) => {
|
|
|
327
326
|
if (size <= 4194304) return bs.setBlob(await handle.readFile());
|
|
328
327
|
return bs.setBlob(handle.readableWebStream());
|
|
329
328
|
};
|
|
330
|
-
|
|
331
|
-
//#region src/fs-blob-adapter.ts
|
|
329
|
+
// src/fs-blob-adapter.ts
|
|
332
330
|
// @license
|
|
333
331
|
/**
|
|
334
332
|
* Handles conversion between files and blobs in blob storage
|
|
@@ -442,8 +440,7 @@ var FsBlobAdapter = class FsBlobAdapter {
|
|
|
442
440
|
return new FsBlobAdapter();
|
|
443
441
|
}
|
|
444
442
|
};
|
|
445
|
-
|
|
446
|
-
//#region src/fs-carry.ts
|
|
443
|
+
// src/fs-carry.ts
|
|
447
444
|
// @license
|
|
448
445
|
/**
|
|
449
446
|
* A node's path, `.` for the root.
|
|
@@ -619,8 +616,7 @@ var graftTree = (tree, carried) => {
|
|
|
619
616
|
carried: added
|
|
620
617
|
};
|
|
621
618
|
};
|
|
622
|
-
|
|
623
|
-
//#region src/fs-db-adapter.ts
|
|
619
|
+
// src/fs-db-adapter.ts
|
|
624
620
|
// @license
|
|
625
621
|
/**
|
|
626
622
|
* Adapter for storing filesystem trees in a database.
|
|
@@ -670,8 +666,7 @@ var FsDbAdapter = class {
|
|
|
670
666
|
return this.db;
|
|
671
667
|
}
|
|
672
668
|
};
|
|
673
|
-
|
|
674
|
-
//#region src/fs-edit-chain.ts
|
|
669
|
+
// src/fs-edit-chain.ts
|
|
675
670
|
// @license
|
|
676
671
|
/** The `EditAction.type` every fs chain entry carries. */
|
|
677
672
|
var FS_EDIT_ACTION = "putFsTree";
|
|
@@ -1145,8 +1140,7 @@ var planJoin = (q) => {
|
|
|
1145
1140
|
conflict: conflict.sort()
|
|
1146
1141
|
};
|
|
1147
1142
|
};
|
|
1148
|
-
|
|
1149
|
-
//#region src/fs-ignore.ts
|
|
1143
|
+
// src/fs-ignore.ts
|
|
1150
1144
|
// @license
|
|
1151
1145
|
/** Characters whose presence makes a pattern a glob rather than a prefix. */
|
|
1152
1146
|
var GLOB_CHARS = /[*?/\\]/;
|
|
@@ -1292,8 +1286,7 @@ var compileIgnore = (patterns) => {
|
|
|
1292
1286
|
}
|
|
1293
1287
|
};
|
|
1294
1288
|
};
|
|
1295
|
-
|
|
1296
|
-
//#region src/fs-merge.ts
|
|
1289
|
+
// src/fs-merge.ts
|
|
1297
1290
|
// @license
|
|
1298
1291
|
/** The value a directory has in a {@link ContentMap}. */
|
|
1299
1292
|
var DIR_MARKER = "<dir>";
|
|
@@ -1487,8 +1480,7 @@ var unusedName = (path, marker, taken) => {
|
|
|
1487
1480
|
taken.add(candidate);
|
|
1488
1481
|
return candidate;
|
|
1489
1482
|
};
|
|
1490
|
-
|
|
1491
|
-
//#region src/fs-stamps.ts
|
|
1483
|
+
// src/fs-stamps.ts
|
|
1492
1484
|
// @license
|
|
1493
1485
|
/**
|
|
1494
1486
|
* The table the stamps of one route's chain entries are kept in.
|
|
@@ -1733,8 +1725,7 @@ var FsStamps = class {
|
|
|
1733
1725
|
return order < 0 || order === 0 && a < b;
|
|
1734
1726
|
}
|
|
1735
1727
|
};
|
|
1736
|
-
|
|
1737
|
-
//#region src/fs-history.ts
|
|
1728
|
+
// src/fs-history.ts
|
|
1738
1729
|
// @license
|
|
1739
1730
|
/** How many entries a page holds when the caller does not say. */
|
|
1740
1731
|
var FS_HISTORY_PAGE = 50;
|
|
@@ -1867,8 +1858,7 @@ var readCursor = (cursor) => {
|
|
|
1867
1858
|
if (!(Array.isArray(parsed) && parsed.every((item) => Array.isArray(item) && item.length === 2 && typeof item[0] === "string" && (item[1] === null || typeof item[1] === "number")))) throw new Error(`fs history: not a cursor: ${cursor}`);
|
|
1868
1859
|
return parsed;
|
|
1869
1860
|
};
|
|
1870
|
-
|
|
1871
|
-
//#region src/fs-receive.ts
|
|
1861
|
+
// src/fs-receive.ts
|
|
1872
1862
|
// @license
|
|
1873
1863
|
/**
|
|
1874
1864
|
* What a node does with a head that arrived.
|
|
@@ -1922,8 +1912,7 @@ var receive = async (head, deps) => {
|
|
|
1922
1912
|
}
|
|
1923
1913
|
return deps.merge(head, relation.base);
|
|
1924
1914
|
};
|
|
1925
|
-
|
|
1926
|
-
//#region src/fs-send.ts
|
|
1915
|
+
// src/fs-send.ts
|
|
1927
1916
|
// @license
|
|
1928
1917
|
/** Nothing held back. */
|
|
1929
1918
|
var NOTHING_HELD = /* @__PURE__ */ new Set();
|
|
@@ -1991,8 +1980,7 @@ var planAuthoring = (q) => {
|
|
|
1991
1980
|
removed: removed.sort()
|
|
1992
1981
|
};
|
|
1993
1982
|
};
|
|
1994
|
-
|
|
1995
|
-
//#region src/fs-scanner.ts
|
|
1983
|
+
// src/fs-scanner.ts
|
|
1996
1984
|
// @license
|
|
1997
1985
|
/**
|
|
1998
1986
|
* How often the safety rescan runs.
|
|
@@ -2898,8 +2886,7 @@ var FsScanner = class FsScanner {
|
|
|
2898
2886
|
] });
|
|
2899
2887
|
}
|
|
2900
2888
|
};
|
|
2901
|
-
|
|
2902
|
-
//#region src/fs-agent.ts
|
|
2889
|
+
// src/fs-agent.ts
|
|
2903
2890
|
// @license
|
|
2904
2891
|
/** Sensible defaults – every operation is bounded */
|
|
2905
2892
|
var DEFAULT_TIMEOUTS = {
|
|
@@ -5351,8 +5338,7 @@ var FsAgent = class FsAgent {
|
|
|
5351
5338
|
return new FsAgent(process.cwd());
|
|
5352
5339
|
}
|
|
5353
5340
|
};
|
|
5354
|
-
|
|
5355
|
-
//#region src/client-server/client-server-setup.ts
|
|
5341
|
+
// src/client-server/client-server-setup.ts
|
|
5356
5342
|
// @license
|
|
5357
5343
|
async function createSharedTreeTable(io, treeKey) {
|
|
5358
5344
|
const db = new Db(io);
|
|
@@ -5430,8 +5416,6 @@ async function runClientServerSetup(opts = {}) {
|
|
|
5430
5416
|
cleanup
|
|
5431
5417
|
};
|
|
5432
5418
|
}
|
|
5433
|
-
|
|
5434
|
-
//#region src/index.ts
|
|
5419
|
+
// src/index.ts
|
|
5435
5420
|
// @license
|
|
5436
|
-
//#endregion
|
|
5437
5421
|
export { ATOMIC_TMP_PREFIX, BlobUnavailableError, DiskFullError, FS_EDIT_ACTION, FS_HISTORY_PAGE, FsAgent, FsBlobAdapter, FsDbAdapter, FsEditChain, FsScanner, FsSignals, MassDeleteRefusedError, PartialRestoreError, RestoreIncompleteError, SIGNAL_LOG_FILE, SIGNAL_LOG_MAX, SIGNAL_ONCE_MAX, SIGNAL_PATHS_MAX, SYNC_ERROR_FILE, UnwritablePathError, atomicTmpPath, atomicWriteFile, atomicWriteFileSync, atomicWriteStream, compileIgnore, createFsChainTables, globToRegExp, readFsHistory, readFsStamps, runClientServerSetup, walkFsHistory };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The version of the `@rljson/fs-agent` package. */
|
|
2
|
-
export declare const fsAgentVersion = "0.2.
|
|
2
|
+
export declare const fsAgentVersion = "0.2.4";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rljson/fs-agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Rljson fs-agent description",
|
|
5
5
|
"homepage": "https://github.com/rljson/fs-agent",
|
|
6
6
|
"bugs": "https://github.com/rljson/fs-agent/issues",
|
|
@@ -20,22 +20,22 @@
|
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@rljson/dna-rljson": "0.
|
|
24
|
-
"@rljson/server": "0.0.
|
|
25
|
-
"@tssuite/helix-js": "0.5.
|
|
26
|
-
"@types/node": "^26.6.
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "^8.72.
|
|
28
|
-
"@typescript-eslint/parser": "^8.72.
|
|
23
|
+
"@rljson/dna-rljson": "^0.3.1",
|
|
24
|
+
"@rljson/server": "0.0.79",
|
|
25
|
+
"@tssuite/helix-js": "0.5.1",
|
|
26
|
+
"@types/node": "^26.6.6",
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^8.72.1",
|
|
28
|
+
"@typescript-eslint/parser": "^8.72.1",
|
|
29
29
|
"@vitest/coverage-v8": "^5.0.5",
|
|
30
30
|
"cross-env": "^10.1.0",
|
|
31
31
|
"eslint": "~10.13.0",
|
|
32
|
-
"eslint-plugin-jsdoc": "^65.4.
|
|
32
|
+
"eslint-plugin-jsdoc": "^65.4.2",
|
|
33
33
|
"eslint-plugin-tsdoc": "^0.5.4",
|
|
34
34
|
"globals": "^17.13.0",
|
|
35
35
|
"jsdoc": "^4.0.5",
|
|
36
36
|
"read-pkg": "^10.1.0",
|
|
37
37
|
"typescript": "~6.0.3",
|
|
38
|
-
"typescript-eslint": "^8.72.
|
|
38
|
+
"typescript-eslint": "^8.72.1",
|
|
39
39
|
"vite": "^8.3.5",
|
|
40
40
|
"vite-node": "^6.0.0",
|
|
41
41
|
"vite-plugin-dts": "^5.1.2",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"vitest-dom": "^0.1.1"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@rljson/bs": "0.0.
|
|
48
|
-
"@rljson/db": "0.1.
|
|
49
|
-
"@rljson/hash": "0.0.
|
|
50
|
-
"@rljson/io": "0.0.
|
|
47
|
+
"@rljson/bs": "0.0.30",
|
|
48
|
+
"@rljson/db": "0.1.2",
|
|
49
|
+
"@rljson/hash": "0.0.20",
|
|
50
|
+
"@rljson/io": "0.0.86",
|
|
51
51
|
"@rljson/json": "0.0.23",
|
|
52
|
-
"@rljson/rljson": "0.0.
|
|
52
|
+
"@rljson/rljson": "0.0.87",
|
|
53
53
|
"socket.io": "^4.8.4",
|
|
54
54
|
"socket.io-client": "^4.8.4"
|
|
55
55
|
},
|