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.
@@ -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-file history). Keys are namespaced `kind:gitdir:headSha:…`,
18
- * so entries self-invalidate on push (new head, new key) — but evict entries
19
- * under {@link resultKeyPrefixes} after rewriting a repo's storage out of
20
- * band, or stale walks leak until your store's own eviction.
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: unknown): void;
23
+ get<T extends object>(key: string): T | null | undefined;
24
+ set(key: string, value: object): void;
25
25
  }
26
- /** Optional instrumentation and tuning hooks accepted by every op. */
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
- * Wire pack prefetching (e.g. `GitFs.prefetchPacks`) here so a sequential
35
- * walk doesn't pay one network round trip per commit. Called once before
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 (bulk sync, rename, repack cleanup).
43
+ * a normal push (rename, repack).
50
44
  */
51
45
  export declare function resultKeyPrefixes(gitdir: string): string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-fs-s3",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "isomorphic-git filesystem backend for S3-compatible object storage (AWS S3, Cloudflare R2, MinIO) \u2014 run git servers without a disk",
5
5
  "type": "module",
6
6
  "exports": {