git-fs-s3 0.8.0 → 0.9.0
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 +3 -3
- package/dist/http.js +5 -3
- package/dist/http.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/ops.js +125 -231
- package/dist/ops.js.map +1 -1
- package/dist/types/errors.d.ts +0 -1
- package/dist/types/http/index.d.ts +2 -2
- package/dist/types/http/pack-reuse.d.ts +2 -1
- package/dist/types/ops/diff.d.ts +7 -3
- package/dist/types/ops/file-history.d.ts +4 -18
- package/dist/types/ops/history.d.ts +30 -43
- package/dist/types/ops/index.d.ts +3 -3
- package/dist/types/ops/last-commit.d.ts +2 -8
- package/dist/types/ops/types.d.ts +10 -16
- package/package.json +1 -1
|
@@ -14,16 +14,16 @@ export interface Repo {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Key/value store for memoizing expensive walk results (commit logs, tree
|
|
17
|
-
* listings, per-
|
|
18
|
-
* so entries self-invalidate on push (new head, new key)
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* listings, per-path history). Keys are namespaced `kind:gitdir:headSha:…`,
|
|
18
|
+
* so entries self-invalidate on push (new head, new key); evict
|
|
19
|
+
* {@link resultKeyPrefixes} to drop a repo's superseded entries early.
|
|
20
|
+
* Values are always objects (arrays or records).
|
|
21
21
|
*/
|
|
22
22
|
export interface ResultCache {
|
|
23
|
-
get<T>(key: string): T | null | undefined;
|
|
24
|
-
set(key: string, value:
|
|
23
|
+
get<T extends object>(key: string): T | null | undefined;
|
|
24
|
+
set(key: string, value: object): void;
|
|
25
25
|
}
|
|
26
|
-
/** Optional instrumentation
|
|
26
|
+
/** Optional instrumentation hooks accepted by every op. */
|
|
27
27
|
export interface OpsHooks {
|
|
28
28
|
resultCache?: ResultCache;
|
|
29
29
|
/** Wrap a timed sub-step (network walk, tree listing). Default: run directly. */
|
|
@@ -31,21 +31,15 @@ export interface OpsHooks {
|
|
|
31
31
|
/** Diagnostic sink for cache hit/miss and walk summaries. */
|
|
32
32
|
onNote?: (message: string) => void;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
* walk doesn't
|
|
36
|
-
* history walks of depth >= `prefetchMinDepth` (see below), and
|
|
37
|
-
* unconditionally on every cache-miss tree read ({@link getTreeFromRef}) —
|
|
38
|
-
* a tree read has no shallow case, it always needs at least the head
|
|
39
|
-
* commit's tree object.
|
|
34
|
+
* Warm every pack (e.g. `GitFs.prefetchPacks`) before a cache-miss read,
|
|
35
|
+
* so a sequential walk doesn't discover packs one round trip at a time.
|
|
40
36
|
*/
|
|
41
37
|
prefetch?: () => Promise<void>;
|
|
42
|
-
/** Minimum walk depth before `prefetch` fires for history walks. Default 5. */
|
|
43
|
-
prefetchMinDepth?: number;
|
|
44
38
|
}
|
|
45
39
|
export declare const runStep: <T>(hooks: OpsHooks | undefined, label: string, fn: () => Promise<T>) => Promise<T>;
|
|
46
40
|
/**
|
|
47
41
|
* The result-cache key prefixes holding entries for `gitdir` — evict these
|
|
48
42
|
* from your {@link ResultCache} when the repo's storage was rewritten outside
|
|
49
|
-
* a normal push (
|
|
43
|
+
* a normal push (rename, repack).
|
|
50
44
|
*/
|
|
51
45
|
export declare function resultKeyPrefixes(gitdir: string): string[];
|
package/package.json
CHANGED