just-git 1.1.8 → 1.1.11
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 +6 -6
- package/dist/{hooks-1dcjVqc3.d.ts → hooks-OMCbhUGB.d.ts} +5 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +194 -194
- package/dist/repo/index.d.ts +13 -5
- package/dist/repo/index.js +9 -9
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +11 -11
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/just-git)
|
|
5
5
|
[](https://bundlejs.com/?q=just-git)
|
|
6
6
|
|
|
7
|
-
Pure TypeScript git implementation. Zero dependencies. 34 commands. Works in Node, Bun, Deno, Cloudflare Workers, and the browser. [Tested against real git](TESTING.md) across more than a million randomized operations.
|
|
7
|
+
Pure TypeScript git implementation. Zero dependencies. 34 commands. Works in Node, Bun, Deno, Cloudflare Workers, and the browser. [Tested against real git](docs/TESTING.md) across more than a million randomized operations.
|
|
8
8
|
|
|
9
|
-
Two entry points: a **virtual filesystem client** for sandboxed environments (pairs with [just-bash](https://github.com/vercel-labs/just-bash), or use standalone), and an **[embeddable git server](SERVER.md)** that any standard `git` client can clone, fetch, and push to.
|
|
9
|
+
Two entry points: a **virtual filesystem client** for sandboxed environments (pairs with [just-bash](https://github.com/vercel-labs/just-bash), or use standalone), and an **[embeddable git server](docs/SERVER.md)** that any standard `git` client can clone, fetch, and push to.
|
|
10
10
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
@@ -50,7 +50,7 @@ await bash.exec("git add . && git commit -m 'initial commit'");
|
|
|
50
50
|
|
|
51
51
|
### Server
|
|
52
52
|
|
|
53
|
-
Stand up a git server with built-in storage (SQLite or [PostgreSQL](SERVER.md#pgstorage)), branch protection, and push hooks:
|
|
53
|
+
Stand up a git server with built-in storage (SQLite or [PostgreSQL](docs/SERVER.md#pgstorage)), branch protection, and push hooks:
|
|
54
54
|
|
|
55
55
|
```ts
|
|
56
56
|
import { createGitServer, SqliteStorage } from "just-git/server";
|
|
@@ -75,7 +75,7 @@ Bun.serve({ fetch: server.fetch });
|
|
|
75
75
|
// git clone http://localhost:3000/my-repo ← works with real git
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
Uses web-standard `Request`/`Response` — works with Bun, Hono, Cloudflare Workers, or any fetch-compatible runtime. For Node.js, use `toNodeHandler(server)` with `http.createServer` and `wrapBetterSqlite3` for `better-sqlite3`. See [SERVER.md](SERVER.md) for the full API.
|
|
78
|
+
Uses web-standard `Request`/`Response` — works with Bun, Hono, Cloudflare Workers, or any fetch-compatible runtime. For Node.js, use `toNodeHandler(server)` with `http.createServer` and `wrapBetterSqlite3` for `better-sqlite3`. See [SERVER.md](docs/SERVER.md) for the full API.
|
|
79
79
|
|
|
80
80
|
## Options
|
|
81
81
|
|
|
@@ -248,7 +248,7 @@ See [`examples/multi-agent.ts`](examples/multi-agent.ts) for a full working exam
|
|
|
248
248
|
|
|
249
249
|
## Command coverage
|
|
250
250
|
|
|
251
|
-
See [CLI.md](CLI.md) for full usage details.
|
|
251
|
+
See [CLI.md](docs/CLI.md) for full usage details.
|
|
252
252
|
|
|
253
253
|
| Command | Flags / options |
|
|
254
254
|
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
@@ -305,7 +305,7 @@ See [CLI.md](CLI.md) for full usage details.
|
|
|
305
305
|
|
|
306
306
|
## Testing
|
|
307
307
|
|
|
308
|
-
Targets high fidelity to real git (2.53.0). Validated with an [oracle testing framework](test/oracle/README.md) that generates randomized git workflows, runs them against real git, replays each step against just-git, and compares repository state and command output at every step. Run `bun oracle validate` to generate and test a representative set of traces yourself. See [TESTING.md](TESTING.md) for the full methodology and how to interpret results.
|
|
308
|
+
Targets high fidelity to real git (2.53.0). Validated with an [oracle testing framework](test/oracle/README.md) that generates randomized git workflows, runs them against real git, replays each step against just-git, and compares repository state and command output at every step. Run `bun oracle validate` to generate and test a representative set of traces yourself. See [TESTING.md](docs/TESTING.md) for the full methodology and how to interpret results.
|
|
309
309
|
|
|
310
310
|
When backed by a real filesystem (e.g. just-bash `ReadWriteFs`), interoperable with real git on the same repo. Try `bun sandbox "git init"` to explore interactively.
|
|
311
311
|
|
|
@@ -103,8 +103,11 @@ interface RefEntry {
|
|
|
103
103
|
interface RefStore {
|
|
104
104
|
/** Read a single ref without following symbolic refs. */
|
|
105
105
|
readRef(name: string): Promise<Ref | null>;
|
|
106
|
-
/**
|
|
107
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Write a ref. Accepts a `Ref` object or a plain hash string
|
|
108
|
+
* (shorthand for `{ type: "direct", hash }`).
|
|
109
|
+
*/
|
|
110
|
+
writeRef(name: string, ref: Ref | string): Promise<void>;
|
|
108
111
|
/** Delete a ref from storage. */
|
|
109
112
|
deleteRef(name: string): Promise<void>;
|
|
110
113
|
/** List all refs under a prefix, returning resolved hashes. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FileSystem, E as ExecResult, G as GitHooks, C as CredentialProvider, I as IdentityOverride, N as NetworkPolicy, R as RemoteResolver, O as ObjectStore, a as RefStore, b as FetchFunction, c as GitContext } from './hooks-
|
|
2
|
-
export { A as AfterCommandEvent, B as BeforeCommandEvent, d as CommitMsgEvent, e as FileStat, f as GitRepo, H as HttpAuth, M as MergeMsgEvent, g as ObjectWriteEvent, P as PostCheckoutEvent, h as PostCherryPickEvent, i as PostCleanEvent, j as PostCloneEvent, k as PostCommitEvent, l as PostFetchEvent, m as PostMergeEvent, n as PostPullEvent, o as PostPushEvent, p as PostResetEvent, q as PostRevertEvent, r as PostRmEvent, s as PostStashEvent, t as PreCheckoutEvent, u as PreCherryPickEvent, v as PreCleanEvent, w as PreCloneEvent, x as PreCommitEvent, y as PreFetchEvent, z as PreMergeCommitEvent, D as PrePullEvent, J as PrePushEvent, K as PreRebaseEvent, L as PreResetEvent, Q as PreRevertEvent, S as PreRmEvent, T as PreStashEvent, U as RefDeleteEvent, V as RefEntry, W as RefUpdateEvent, X as Rejection, Y as composeGitHooks, Z as isRejection } from './hooks-
|
|
1
|
+
import { F as FileSystem, E as ExecResult, G as GitHooks, C as CredentialProvider, I as IdentityOverride, N as NetworkPolicy, R as RemoteResolver, O as ObjectStore, a as RefStore, b as FetchFunction, c as GitContext } from './hooks-OMCbhUGB.js';
|
|
2
|
+
export { A as AfterCommandEvent, B as BeforeCommandEvent, d as CommitMsgEvent, e as FileStat, f as GitRepo, H as HttpAuth, M as MergeMsgEvent, g as ObjectWriteEvent, P as PostCheckoutEvent, h as PostCherryPickEvent, i as PostCleanEvent, j as PostCloneEvent, k as PostCommitEvent, l as PostFetchEvent, m as PostMergeEvent, n as PostPullEvent, o as PostPushEvent, p as PostResetEvent, q as PostRevertEvent, r as PostRmEvent, s as PostStashEvent, t as PreCheckoutEvent, u as PreCherryPickEvent, v as PreCleanEvent, w as PreCloneEvent, x as PreCommitEvent, y as PreFetchEvent, z as PreMergeCommitEvent, D as PrePullEvent, J as PrePushEvent, K as PreRebaseEvent, L as PreResetEvent, Q as PreRevertEvent, S as PreRmEvent, T as PreStashEvent, U as RefDeleteEvent, V as RefEntry, W as RefUpdateEvent, X as Rejection, Y as composeGitHooks, Z as isRejection } from './hooks-OMCbhUGB.js';
|
|
3
3
|
|
|
4
4
|
/** Options for subcommand execution (mirrors just-bash's CommandExecOptions). */
|
|
5
5
|
interface CommandExecOptions {
|