just-git 1.5.11 → 1.5.13

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 CHANGED
@@ -65,7 +65,7 @@ Both `fs` and `cwd` can be set once in `createGit` and overridden per-call. `cwd
65
65
 
66
66
  ### Server
67
67
 
68
- Stand up a git server in two lines. Storage defaults to in-memory; swap in SQLite, PostgreSQL, or your own backend for persistence:
68
+ Stand up a git server in two lines. Storage defaults to in-memory; swap in SQLite, PostgreSQL, [Cloudflare Durable Objects](docs/SERVER.md#durableobjectsqlitestorage), or your own backend for persistence:
69
69
 
70
70
  ```ts
71
71
  import { createServer } from "just-git/server";
@@ -117,7 +117,7 @@ await server.gc("my-repo");
117
117
  Bun.serve({ fetch: server.fetch });
118
118
  ```
119
119
 
120
- Uses web-standard `Request`/`Response`. Works with Bun, Hono, Cloudflare Workers, or any fetch-compatible runtime. For Node.js, use `server.nodeHandler` with `http.createServer` and `BetterSqlite3Storage` for `better-sqlite3`. SSH is supported via `server.handleSession`. The [`Storage` interface](docs/SERVER.md#custom-storage) is small enough to plug in any datastore. See [SERVER.md](docs/SERVER.md) for the full API.
120
+ Uses web-standard `Request`/`Response`. Works with Bun, Hono, Cloudflare Workers, Durable Objects, or any fetch-compatible runtime. For Node.js, use `server.nodeHandler` with `http.createServer` and `BetterSqlite3Storage` for `better-sqlite3`. SSH is supported via `server.handleSession`. The [`Storage` interface](docs/SERVER.md#custom-storage) is small enough to plug in any datastore. See [SERVER.md](docs/SERVER.md) for the full API.
121
121
 
122
122
  ## Repo module
123
123
 
@@ -273,6 +273,8 @@ interface GitContext extends GitRepo {
273
273
  configOverrides?: ConfigOverrides;
274
274
  /** In-memory credential cache for URL-extracted auth, keyed by origin. */
275
275
  credentialCache?: CredentialCache;
276
+ /** Callback for server progress messages (sideband band-2). */
277
+ onProgress?: ProgressCallback;
276
278
  }
277
279
  type DiffStatus = "added" | "deleted" | "modified";
278
280
  interface TreeDiffEntry {
@@ -303,6 +305,12 @@ interface ExecResult {
303
305
  exitCode: number;
304
306
  }
305
307
 
308
+ /**
309
+ * Called with server progress messages (sideband band-2) during
310
+ * network operations (fetch, clone, push). Messages are raw text
311
+ * from the remote — format varies by server.
312
+ */
313
+ type ProgressCallback = (message: string) => void;
306
314
  /**
307
315
  * Callback that provides HTTP authentication for remote operations.
308
316
  * Called with the remote URL; return credentials or null for anonymous access.
@@ -613,4 +621,4 @@ interface GitHooks {
613
621
  */
614
622
  declare function composeGitHooks(...hookSets: (GitHooks | undefined)[]): GitHooks;
615
623
 
616
- export { type Rejection as $, type AfterCommandEvent as A, type BeforeCommandEvent as B, type CredentialProvider as C, type DirectRef as D, type ExecResult as E, type FileSystem as F, type GitHooks as G, type HttpAuth as H, type IdentityOverride as I, type PreCommitEvent as J, type PreFetchEvent as K, type PreMergeCommitEvent as L, type MergeMsgEvent as M, type NetworkPolicy as N, type ObjectStore as O, type PackObject as P, type PrePullEvent as Q, type RemoteResolver as R, type PrePushEvent as S, type PreRebaseEvent as T, type PreResetEvent as U, type PreRevertEvent as V, type RawObject as W, type Ref as X, type RefDeleteEvent as Y, type RefEntry as Z, type RefUpdateEvent as _, type RefStore as a, type SymbolicRef as a0, composeGitHooks as a1, isRejection as a2, type TreeEntry as a3, type TreeDiffEntry as a4, type ConfigOverrides as b, type FileStat as c, type GitContext as d, type Commit as e, type CommitMsgEvent as f, type GitRepo as g, type Identity as h, type ObjectId as i, type ObjectType as j, type ObjectWriteEvent as k, type PostApplyEvent as l, type PostCheckoutEvent as m, type PostCherryPickEvent as n, type PostCloneEvent as o, type PostCommitEvent as p, type PostFetchEvent as q, type PostMergeEvent as r, type PostPullEvent as s, type PostPushEvent as t, type PostResetEvent as u, type PostRevertEvent as v, type PreApplyEvent as w, type PreCheckoutEvent as x, type PreCherryPickEvent as y, type PreCloneEvent as z };
624
+ export { type RefUpdateEvent as $, type AfterCommandEvent as A, type BeforeCommandEvent as B, type CredentialProvider as C, type DirectRef as D, type ExecResult as E, type FileSystem as F, type GitHooks as G, type HttpAuth as H, type IdentityOverride as I, type PreCloneEvent as J, type PreCommitEvent as K, type PreFetchEvent as L, type MergeMsgEvent as M, type NetworkPolicy as N, type ObjectStore as O, type ProgressCallback as P, type PreMergeCommitEvent as Q, type RemoteResolver as R, type PrePullEvent as S, type PrePushEvent as T, type PreRebaseEvent as U, type PreResetEvent as V, type PreRevertEvent as W, type RawObject as X, type Ref as Y, type RefDeleteEvent as Z, type RefEntry as _, type RefStore as a, type Rejection as a0, type SymbolicRef as a1, composeGitHooks as a2, isRejection as a3, type TreeEntry as a4, type TreeDiffEntry as a5, type ConfigOverrides as b, type FileStat as c, type GitContext as d, type Commit as e, type CommitMsgEvent as f, type GitRepo as g, type Identity as h, type ObjectId as i, type ObjectType as j, type ObjectWriteEvent as k, type PackObject as l, type PostApplyEvent as m, type PostCheckoutEvent as n, type PostCherryPickEvent as o, type PostCloneEvent as p, type PostCommitEvent as q, type PostFetchEvent as r, type PostMergeEvent as s, type PostPullEvent as t, type PostPushEvent as u, type PostResetEvent as v, type PostRevertEvent as w, type PreApplyEvent as x, type PreCheckoutEvent as y, type PreCherryPickEvent as z };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FileSystem, G as GitHooks, C as CredentialProvider, I as IdentityOverride, N as NetworkPolicy, R as RemoteResolver, O as ObjectStore, a as RefStore, b as ConfigOverrides, E as ExecResult, c as FileStat, d as GitContext } from './hooks-CimfP56a.js';
2
- export { A as AfterCommandEvent, B as BeforeCommandEvent, e as Commit, f as CommitMsgEvent, D as DirectRef, g as GitRepo, H as HttpAuth, h as Identity, M as MergeMsgEvent, i as ObjectId, j as ObjectType, k as ObjectWriteEvent, P as PackObject, l as PostApplyEvent, m as PostCheckoutEvent, n as PostCherryPickEvent, o as PostCloneEvent, p as PostCommitEvent, q as PostFetchEvent, r as PostMergeEvent, s as PostPullEvent, t as PostPushEvent, u as PostResetEvent, v as PostRevertEvent, w as PreApplyEvent, x as PreCheckoutEvent, y as PreCherryPickEvent, z as PreCloneEvent, J as PreCommitEvent, K as PreFetchEvent, L as PreMergeCommitEvent, Q as PrePullEvent, S as PrePushEvent, T as PreRebaseEvent, U as PreResetEvent, V as PreRevertEvent, W as RawObject, X as Ref, Y as RefDeleteEvent, Z as RefEntry, _ as RefUpdateEvent, $ as Rejection, a0 as SymbolicRef, a1 as composeGitHooks, a2 as isRejection } from './hooks-CimfP56a.js';
1
+ import { F as FileSystem, G as GitHooks, C as CredentialProvider, I as IdentityOverride, N as NetworkPolicy, R as RemoteResolver, O as ObjectStore, a as RefStore, b as ConfigOverrides, P as ProgressCallback, E as ExecResult, c as FileStat, d as GitContext } from './hooks-B50z7ycn.js';
2
+ export { A as AfterCommandEvent, B as BeforeCommandEvent, e as Commit, f as CommitMsgEvent, D as DirectRef, g as GitRepo, H as HttpAuth, h as Identity, M as MergeMsgEvent, i as ObjectId, j as ObjectType, k as ObjectWriteEvent, l as PackObject, m as PostApplyEvent, n as PostCheckoutEvent, o as PostCherryPickEvent, p as PostCloneEvent, q as PostCommitEvent, r as PostFetchEvent, s as PostMergeEvent, t as PostPullEvent, u as PostPushEvent, v as PostResetEvent, w as PostRevertEvent, x as PreApplyEvent, y as PreCheckoutEvent, z as PreCherryPickEvent, J as PreCloneEvent, K as PreCommitEvent, L as PreFetchEvent, Q as PreMergeCommitEvent, S as PrePullEvent, T as PrePushEvent, U as PreRebaseEvent, V as PreResetEvent, W as PreRevertEvent, X as RawObject, Y as Ref, Z as RefDeleteEvent, _ as RefEntry, $ as RefUpdateEvent, a0 as Rejection, a1 as SymbolicRef, a2 as composeGitHooks, a3 as isRejection } from './hooks-B50z7ycn.js';
3
3
 
4
4
  /** Options for subcommand execution (mirrors just-bash's CommandExecOptions). */
5
5
  interface CommandExecOptions {
@@ -80,6 +80,12 @@ interface GitOptions {
80
80
  * `defaults` supply fallbacks when a key is absent from config.
81
81
  */
82
82
  config?: ConfigOverrides;
83
+ /**
84
+ * Called with server progress messages during network operations
85
+ * (fetch, clone, push). Messages are raw sideband text from the
86
+ * remote — format varies by server.
87
+ */
88
+ onProgress?: ProgressCallback;
83
89
  }
84
90
  /** Simplified context for {@link Git.exec}. */
85
91
  interface ExecContext {
@@ -169,4 +175,4 @@ declare class MemoryFileSystem implements FileSystem {
169
175
  */
170
176
  declare function findRepo(fs: FileSystem, startPath: string): Promise<GitContext | null>;
171
177
 
172
- export { ConfigOverrides, CredentialProvider, type ExecContext, ExecResult, FileStat, FileSystem, Git, type GitCommandName, GitContext, GitHooks, type GitOptions, IdentityOverride, MemoryFileSystem, NetworkPolicy, ObjectStore, RefStore, RemoteResolver, createGit, findRepo };
178
+ export { ConfigOverrides, CredentialProvider, type ExecContext, ExecResult, FileStat, FileSystem, Git, type GitCommandName, GitContext, GitHooks, type GitOptions, IdentityOverride, MemoryFileSystem, NetworkPolicy, ObjectStore, ProgressCallback, RefStore, RemoteResolver, createGit, findRepo };