@ricsam/r5d-worker 0.0.96 → 0.0.99
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/cjs/package.json +1 -1
- package/dist/cjs/working-tree-mirror.cjs +256 -4
- package/dist/cjs/workspace-git-sync.cjs +127 -51
- package/dist/cjs/workspace-merge-projection.cjs +19 -1
- package/dist/mjs/package.json +1 -1
- package/dist/mjs/working-tree-mirror.mjs +250 -3
- package/dist/mjs/workspace-git-sync.mjs +136 -52
- package/dist/mjs/workspace-merge-projection.mjs +19 -1
- package/dist/types/working-tree-mirror.d.ts +80 -1
- package/package.json +1 -1
|
@@ -20,7 +20,14 @@ export type TreeEntry = {
|
|
|
20
20
|
* every portable alias must be remediated before the old tree is retired.
|
|
21
21
|
*/
|
|
22
22
|
export declare function assertWorkingTreeHasNoPortableGitMetadataAliases(root: string): void;
|
|
23
|
-
export declare function inspectWorkingTree(root: string, mode: WorkingTreeSourceMode
|
|
23
|
+
export declare function inspectWorkingTree(root: string, mode: WorkingTreeSourceMode, options?: {
|
|
24
|
+
/**
|
|
25
|
+
* Leave an uninitialized submodule (index gitlink whose directory is
|
|
26
|
+
* empty) out of a Git-mode inspection. Its empty directory is what keeps
|
|
27
|
+
* `git status` clean, so a deletion set must never remove it.
|
|
28
|
+
*/
|
|
29
|
+
omitUnpopulatedGitlinks?: boolean;
|
|
30
|
+
}): Map<string, TreeEntry>;
|
|
24
31
|
export declare function mirrorWorkingTree(input: {
|
|
25
32
|
sourceRoot: string;
|
|
26
33
|
targetRoot: string;
|
|
@@ -35,3 +42,75 @@ export declare function mirrorWorkingTree(input: {
|
|
|
35
42
|
}): {
|
|
36
43
|
paths: string[];
|
|
37
44
|
};
|
|
45
|
+
/** Canonical relative form used by mirror plans and scopes, or null when the value is unsafe. */
|
|
46
|
+
export declare function normalizeWorkingTreeRelativePath(value: string): string | null;
|
|
47
|
+
export type WorkingTreeMirrorPlan = {
|
|
48
|
+
/** Every target path the mirror creates, rewrites, or verifies, ancestor directories included. */
|
|
49
|
+
desired: Map<string, TreeEntry>;
|
|
50
|
+
/**
|
|
51
|
+
* Target entries the mirror removes or overwrites, as they are before it
|
|
52
|
+
* runs. A directory entry means the whole subtree goes, ignored files
|
|
53
|
+
* included; entries beneath it are folded into it.
|
|
54
|
+
*/
|
|
55
|
+
replaced: Map<string, TreeEntry>;
|
|
56
|
+
/** Desired paths that have no target entry yet. */
|
|
57
|
+
absent: string[];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Compute exactly which target entries `mirrorWorkingTree` would remove,
|
|
61
|
+
* overwrite, or create for the same input, without changing anything. The
|
|
62
|
+
* removal set is the target's deletion-mode file set minus the desired paths.
|
|
63
|
+
* A desired path replaces its target entry when the kinds differ, a symlink
|
|
64
|
+
* points elsewhere, or a file's bytes or mode differ; an equal entry is left
|
|
65
|
+
* alone, so the plan covers only what the mirror actually touches. A Git
|
|
66
|
+
* target's ignored trees appear only where a desired path lands on them.
|
|
67
|
+
*/
|
|
68
|
+
export declare function planWorkingTreeMirror(input: {
|
|
69
|
+
sourceRoot: string;
|
|
70
|
+
targetRoot: string;
|
|
71
|
+
sourceMode: WorkingTreeSourceMode;
|
|
72
|
+
deletionMode: WorkingTreeDeletionMode;
|
|
73
|
+
}): WorkingTreeMirrorPlan;
|
|
74
|
+
export type WorkingTreeMirrorScope = {
|
|
75
|
+
/** Desired paths that did not exist before the mirror ran; a restore removes them. */
|
|
76
|
+
absent: string[];
|
|
77
|
+
/** Directories captured whole; a restore makes them identical to the snapshot again. */
|
|
78
|
+
trees: string[];
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Copy the entries a mirror plan replaces into `snapshotRoot` at their
|
|
82
|
+
* target-relative paths, so that `restoreWorkingTreeMirrorScope` can undo the
|
|
83
|
+
* mirror. Files and symlinks are copied individually and a replaced directory
|
|
84
|
+
* is copied whole; ancestor directories appear only as containers. Returns
|
|
85
|
+
* the scope that must be kept beside the snapshot.
|
|
86
|
+
*/
|
|
87
|
+
export declare function captureWorkingTreeMirrorPlan(input: {
|
|
88
|
+
plan: WorkingTreeMirrorPlan;
|
|
89
|
+
targetRoot: string;
|
|
90
|
+
snapshotRoot: string;
|
|
91
|
+
durability?: WorkingTreeMirrorDurability;
|
|
92
|
+
}): WorkingTreeMirrorScope;
|
|
93
|
+
/**
|
|
94
|
+
* Undo a mirror whose plan was captured with `captureWorkingTreeMirrorPlan`:
|
|
95
|
+
* remove everything the mirror may have created, sweep its interrupted
|
|
96
|
+
* temporary files, and put every captured entry back. Entries the plan did
|
|
97
|
+
* not cover (a Git target's ignored files, for instance) are never read or
|
|
98
|
+
* written. Safe to repeat after a partial run. Returns the target-relative
|
|
99
|
+
* paths it removed or restored, for the caller's durability barrier.
|
|
100
|
+
*/
|
|
101
|
+
export declare function restoreWorkingTreeMirrorScope(input: {
|
|
102
|
+
snapshotRoot: string;
|
|
103
|
+
targetRoot: string;
|
|
104
|
+
scope: WorkingTreeMirrorScope;
|
|
105
|
+
}): {
|
|
106
|
+
paths: string[];
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Make the listed target-relative entries durable together with the directory
|
|
110
|
+
* entries that name them: every listed regular file and real directory is
|
|
111
|
+
* fsynced, and so is each listed path's parent directory and the root.
|
|
112
|
+
* Symlinks and missing paths contribute only their parent, which is what
|
|
113
|
+
* records their creation or removal. Ancestors are never followed through
|
|
114
|
+
* symlinks. Nothing outside the listed paths is read.
|
|
115
|
+
*/
|
|
116
|
+
export declare function fsyncWorkingTreePaths(root: string, relativePaths: Iterable<string>): void;
|