@rljson/fs-agent 0.2.2 → 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.api.md +12 -4
- package/README.architecture.md +48 -1
- package/README.md +2 -2
- package/README.public.md +30 -4
- package/README.tests.md +28 -6
- package/dist/README.api.md +12 -4
- package/dist/README.architecture.md +48 -1
- package/dist/README.md +2 -2
- package/dist/README.public.md +30 -4
- package/dist/README.tests.md +28 -6
- package/dist/fs-agent.d.ts +105 -5
- package/dist/fs-agent.js +619 -203
- package/dist/fs-carry.d.ts +40 -0
- package/dist/fs-ignore.d.ts +9 -0
- package/dist/fs-scanner.d.ts +12 -1
- package/dist/fs_agent_version.d.ts +1 -1
- package/package.json +15 -15
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Tree } from '@rljson/rljson';
|
|
2
|
+
import { FsTree } from './fs-scanner.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The nodes of a tree a scan with this ignore rule leaves out.
|
|
5
|
+
*
|
|
6
|
+
* Walked from the root, as the scanner walks the folder: an ignored directory
|
|
7
|
+
* is taken whole, with everything below it, and nothing below it is asked.
|
|
8
|
+
* @param tree - The tree, typically a head's.
|
|
9
|
+
* @param ignores - The scanner's rule: a path, and whether it is a directory.
|
|
10
|
+
* @returns The left-out nodes, files and directories, by path.
|
|
11
|
+
*/
|
|
12
|
+
export declare const carriedNodes: (tree: FsTree, ignores: (path: string, isDirectory: boolean) => boolean) => Map<string, Tree>;
|
|
13
|
+
/**
|
|
14
|
+
* A file node holding a version of another file under a new path — a merge
|
|
15
|
+
* keeping both versions of one file.
|
|
16
|
+
* @param path - Where the version is kept.
|
|
17
|
+
* @param blobId - The version.
|
|
18
|
+
* @param size - Its size in bytes.
|
|
19
|
+
* @returns The node, hashed, in the scanner's own format.
|
|
20
|
+
*/
|
|
21
|
+
export declare const fileNode: (path: string, blobId: string, size: number) => Tree;
|
|
22
|
+
/**
|
|
23
|
+
* A tree holding what `tree` holds and the carried nodes besides — built as
|
|
24
|
+
* the scanner builds one, so a folder that holds its carried paths after all
|
|
25
|
+
* gives the same ref either way.
|
|
26
|
+
*
|
|
27
|
+
* The folder's own entries come first: a carried path the scan holds itself
|
|
28
|
+
* is not carried, and neither is one below a path the scan holds as a file.
|
|
29
|
+
* A directory a carried path needs and the scan lacks — the folder lost it
|
|
30
|
+
* around a file it does not see — is put back, holding just that.
|
|
31
|
+
* @param tree - The folder, as scanned.
|
|
32
|
+
* @param carried - What to carry, by path — see {@link carriedNodes}. A file
|
|
33
|
+
* node is used as it is; every directory is rebuilt from its children.
|
|
34
|
+
* @returns The tree, and the carried paths it holds; `tree` itself when it
|
|
35
|
+
* holds none of them.
|
|
36
|
+
*/
|
|
37
|
+
export declare const graftTree: (tree: FsTree, carried: ReadonlyMap<string, Tree>) => {
|
|
38
|
+
tree: FsTree;
|
|
39
|
+
carried: Map<string, Tree>;
|
|
40
|
+
};
|
package/dist/fs-ignore.d.ts
CHANGED
|
@@ -17,6 +17,15 @@ export interface IgnoreMatcher {
|
|
|
17
17
|
* @returns True when the sync must not see this path.
|
|
18
18
|
*/
|
|
19
19
|
ignores(relativePath: string, isDirectory?: boolean): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether a scan leaves the path out: the path itself, or a directory above
|
|
22
|
+
* it. A scan does not descend into an ignored directory, so nothing below
|
|
23
|
+
* one is ever seen, whatever a later `!` line says about it.
|
|
24
|
+
* @param relativePath - Path relative to the sync root, either separator.
|
|
25
|
+
* @param isDirectory - Whether the path is a directory.
|
|
26
|
+
* @returns True when no scan of the folder holds this path.
|
|
27
|
+
*/
|
|
28
|
+
excludes(relativePath: string, isDirectory: boolean): boolean;
|
|
20
29
|
}
|
|
21
30
|
/**
|
|
22
31
|
* Compiles an ignore list into a matcher.
|
package/dist/fs-scanner.d.ts
CHANGED
|
@@ -193,6 +193,8 @@ export declare class FsScanner {
|
|
|
193
193
|
/** The single follow-up pass everyone who arrived mid-scan is waiting on. */
|
|
194
194
|
private _pendingScan;
|
|
195
195
|
constructor(rootPath: string, options?: FsScanOptions);
|
|
196
|
+
/** The ignore list this scanner applies, in order, as it was given. */
|
|
197
|
+
get ignore(): readonly string[];
|
|
196
198
|
get tree(): FsTree | null;
|
|
197
199
|
/**
|
|
198
200
|
* The files the last pass left out because they were not finished yet —
|
|
@@ -283,9 +285,18 @@ export declare class FsScanner {
|
|
|
283
285
|
* Whether the sync never sees a path: the ignore list, as the scan applies
|
|
284
286
|
* it.
|
|
285
287
|
* @param relativePath - Relative to the root, either separator.
|
|
288
|
+
* @param isDirectory - Whether the path is a directory, when known.
|
|
286
289
|
* @returns `true` when no tree of this folder can hold the path.
|
|
287
290
|
*/
|
|
288
|
-
ignores(relativePath: string): boolean;
|
|
291
|
+
ignores(relativePath: string, isDirectory?: boolean): boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Whether a scan leaves a path out: the path, or a directory above it — see
|
|
294
|
+
* {@link IgnoreMatcher.excludes}.
|
|
295
|
+
* @param relativePath - Relative to the root, either separator.
|
|
296
|
+
* @param isDirectory - Whether the path is a directory.
|
|
297
|
+
* @returns `true` when no scan of this folder holds the path.
|
|
298
|
+
*/
|
|
299
|
+
excludes(relativePath: string, isDirectory: boolean): boolean;
|
|
289
300
|
watch(): Promise<void>;
|
|
290
301
|
/**
|
|
291
302
|
* One safety-rescan pass: rescans the tree and, if its content differs from
|
|
@@ -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,23 +20,23 @@
|
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@rljson/dna-rljson": "0.
|
|
24
|
-
"@rljson/server": "0.0.
|
|
25
|
-
"@tssuite/helix-js": "0.
|
|
26
|
-
"@types/node": "^26.6.
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
28
|
-
"@typescript-eslint/parser": "^8.
|
|
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.
|
|
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.
|
|
39
|
-
"vite": "^8.3.
|
|
38
|
+
"typescript-eslint": "^8.72.1",
|
|
39
|
+
"vite": "^8.3.5",
|
|
40
40
|
"vite-node": "^6.0.0",
|
|
41
41
|
"vite-plugin-dts": "^5.1.2",
|
|
42
42
|
"vite-tsconfig-paths": "^6.1.1",
|
|
@@ -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
|
},
|