@ref0/git 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/dist/contracts/calls-spent.d.mts +2 -12
- package/dist/contracts/calls-spent.mjs +4 -5
- package/dist/contracts/events.d.mts +70 -4
- package/dist/contracts/events.mjs +27 -3
- package/dist/contracts/git.d.mts +13 -3
- package/dist/contracts/objects.d.mts +18 -0
- package/dist/contracts/queue.d.mts +3 -2
- package/dist/contracts/queue.mjs +4 -2
- package/dist/core/ancestry.mjs +5 -4
- package/dist/core/index-job.mjs +23 -1
- package/dist/core/index-lost.d.mts +11 -0
- package/dist/core/index-lost.mjs +55 -0
- package/dist/core/objects/commit-writes.mjs +1 -1
- package/dist/core/objects/commits.mjs +10 -9
- package/dist/core/objects/merges.mjs +1 -1
- package/dist/core/objects/reading.mjs +28 -13
- package/dist/core/objects/trees.mjs +1 -1
- package/dist/core/parts.d.mts +7 -0
- package/dist/core/publish.mjs +9 -5
- package/dist/core/purge.mjs +16 -3
- package/dist/core/push.mjs +27 -11
- package/dist/core/repack.mjs +36 -14
- package/dist/core/view.d.mts +10 -1
- package/dist/core/view.mjs +15 -6
- package/dist/effect.d.mts +2 -3
- package/dist/effect.mjs +2 -3
- package/dist/engine/commits.mjs +4 -3
- package/dist/engine/merge-bases.mjs +5 -3
- package/dist/engine/merge.mjs +4 -3
- package/dist/engine/parts.d.mts +1 -0
- package/dist/engine/parts.mjs +1 -1
- package/dist/engine/walk.mjs +15 -11
- package/dist/http/core-parts.mjs +17 -8
- package/dist/index.d.mts +2 -2
- package/dist/lfs/objects.mjs +7 -4
- package/dist/lfs/upkeep.mjs +6 -5
- package/dist/lfs/upload-most.mjs +7 -1
- package/dist/protocol/bytes/streams.mjs +84 -2
- package/dist/protocol/diff/read.d.mts +1 -0
- package/dist/protocol/diff/read.mjs +5 -2
- package/dist/protocol/objects/commit.d.mts +7 -0
- package/dist/protocol/objects/commit.mjs +5 -1
- package/dist/queue/advance.mjs +39 -10
- package/dist/queue/host.d.mts +4 -0
- package/dist/queue/layer.mjs +4 -2
- package/dist/queue/limits.mjs +18 -2
- package/dist/queue/rows.mjs +2 -1
- package/dist/queue/trim.mjs +2 -2
- package/dist/rest/commits.d.mts +238 -238
- package/dist/rest/forks.d.mts +71 -71
- package/dist/rest/refs.d.mts +143 -143
- package/dist/rest/repos.d.mts +81 -81
- package/dist/rest/topics.d.mts +112 -112
- package/dist/rest/trees.d.mts +77 -77
- package/dist/rest/wire.d.mts +19 -1
- package/dist/rest/work.d.mts +39 -39
- package/dist/server/joined.d.mts +11 -5
- package/dist/server/joined.mjs +3 -2
- package/dist/server/registry.mjs +11 -5
- package/dist/server/server.mjs +16 -4
- package/dist/storage/index-bitmaps.mjs +16 -10
- package/dist/storage/index-build.mjs +61 -13
- package/dist/storage/index-graph.d.mts +1 -0
- package/dist/storage/index-graph.mjs +29 -5
- package/dist/storage/index-layers.d.mts +1 -0
- package/dist/storage/index-layers.mjs +5 -2
- package/dist/storage/index-reach.mjs +7 -5
- package/dist/storage/index-remap.mjs +5 -5
- package/dist/storage/index-visible.mjs +16 -5
- package/dist/storage/links.mjs +3 -3
- package/dist/storage/pack-order.d.mts +1 -0
- package/dist/storage/pack-order.mjs +18 -1
- package/dist/storage/prune-walk.mjs +5 -2
- package/dist/storage/prune.mjs +107 -37
- package/dist/storage/receive-bounds.mjs +3 -2
- package/dist/storage/visible.mjs +3 -2
- package/dist/storage/walk.d.mts +1 -0
- package/dist/storage/walk.mjs +9 -5
- package/dist/storage/wants.mjs +17 -11
- package/dist/store/call-count.d.mts +8 -0
- package/dist/store/call-count.mjs +15 -7
- package/dist/store/errors.d.mts +7 -1
- package/dist/store/errors.mjs +7 -1
- package/dist/store/job-try.mjs +3 -1
- package/dist/store/records.mjs +17 -2
- package/dist/store/repo-record.mjs +9 -2
- package/dist/store/scopes.mjs +10 -2
- package/dist/sync/bound.d.mts +1 -1
- package/dist/sync/import.mjs +1 -1
- package/dist/sync/layer.mjs +4 -7
- package/dist/sync/mirror.mjs +1 -1
- package/dist/topics/advance.mjs +4 -4
- package/dist/topics/layer.mjs +1 -1
- package/package.json +3 -3
package/dist/store/scopes.mjs
CHANGED
|
@@ -43,7 +43,7 @@ const collections = {
|
|
|
43
43
|
publicCreated: "public-created",
|
|
44
44
|
/** In `git/repos`: the server's own keys, by use: `cursor`, which seals every list's cursor. */
|
|
45
45
|
keys: "keys",
|
|
46
|
-
/** In a repo's scope: its own record, `self`. */
|
|
46
|
+
/** In a repo's scope: its own record, `self`, and its roots, `roots`. */
|
|
47
47
|
repo: "repo",
|
|
48
48
|
/** In a repo's scope: each ref's `RefRow`, by its full name. */
|
|
49
49
|
refs: "refs",
|
|
@@ -123,6 +123,14 @@ const selfKey = {
|
|
|
123
123
|
id: "self"
|
|
124
124
|
};
|
|
125
125
|
/**
|
|
126
|
+
* A repo's roots, its `RepoRootsRow`, read with every open whose reads walk parents. Only an
|
|
127
|
+
* import's landing writes it, before its first ref page publishes; a repo with no row has none.
|
|
128
|
+
*/
|
|
129
|
+
const repoRootsKey = {
|
|
130
|
+
collection: collections.repo,
|
|
131
|
+
id: "roots"
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
126
134
|
* The repo's prune mark: a new ID each time a prune drops objects. A push reads it first and
|
|
127
135
|
* again at its commit, and fails if it moved, so no ref names an object a prune dropped (Q270).
|
|
128
136
|
*/
|
|
@@ -176,4 +184,4 @@ const jobRepo = (job) => {
|
|
|
176
184
|
};
|
|
177
185
|
/** A commit's own ID, for a change no caller's key names. */
|
|
178
186
|
const newChangeId = () => randomText(16);
|
|
179
|
-
export { catalogueScope, collections, forkId, jobRepo, looseKey, maintainedKey, newChangeId, newInternalId, prunedKey, pushedKey, pushedUnder, reachedKey, repoScope, scopeRepo, selfKey, topicScope, topicsScope };
|
|
187
|
+
export { catalogueScope, collections, forkId, jobRepo, looseKey, maintainedKey, newChangeId, newInternalId, prunedKey, pushedKey, pushedUnder, reachedKey, repoRootsKey, repoScope, scopeRepo, selfKey, topicScope, topicsScope };
|
package/dist/sync/bound.d.mts
CHANGED
package/dist/sync/import.mjs
CHANGED
|
@@ -128,7 +128,7 @@ const importWith = /* @__PURE__ */ Effect.fnUntraced(function* (bound, input) {
|
|
|
128
128
|
source.repo
|
|
129
129
|
],
|
|
130
130
|
put: [importRow(startRow(bound, input, by))],
|
|
131
|
-
jobs: [bound.importJob.
|
|
131
|
+
jobs: [bound.importJob.encodedJob({
|
|
132
132
|
key: importJobKey,
|
|
133
133
|
data
|
|
134
134
|
})],
|
package/dist/sync/layer.mjs
CHANGED
|
@@ -4,7 +4,6 @@ import { ImportJobData, MirrorJobData, Sync } from "../contracts/sync.mjs";
|
|
|
4
4
|
import { SyncBase } from "../core/parts.mjs";
|
|
5
5
|
import { withAudienceMemo } from "../core/ref-view.mjs";
|
|
6
6
|
import { CallBudget } from "../store/call-count.mjs";
|
|
7
|
-
import { gitJob } from "../store/job-try.mjs";
|
|
8
7
|
import { importJobName, mirrorJobName } from "../store/records.mjs";
|
|
9
8
|
import { importTryTimeout } from "../storage/receive-bounds.mjs";
|
|
10
9
|
import { SyncState, importLimits } from "./bound.mjs";
|
|
@@ -39,8 +38,6 @@ const layerWith = (options, limits) => Layer.effectContext(Effect.gen(function*
|
|
|
39
38
|
const base = yield* SyncBase;
|
|
40
39
|
const registration = yield* register({ name: "sync" });
|
|
41
40
|
const http = CallBudget.charged(yield* HttpClient.HttpClient);
|
|
42
|
-
const importJob = gitJob(Import, () => importTry(bound), { onFailure: (_data, failure) => importFailed(bound, failure) });
|
|
43
|
-
const mirrorJob = gitJob(Mirror, (data) => mirrorTry(bound, data));
|
|
44
41
|
const bound = {
|
|
45
42
|
needs: Context.add(base.needs, HttpClient.HttpClient, http),
|
|
46
43
|
providers,
|
|
@@ -49,11 +46,11 @@ const layerWith = (options, limits) => Layer.effectContext(Effect.gen(function*
|
|
|
49
46
|
...limits,
|
|
50
47
|
publishBatch: Math.min(limits.publishBatch, base.pushRefsMost)
|
|
51
48
|
},
|
|
52
|
-
importJob,
|
|
53
|
-
mirrorJob
|
|
49
|
+
importJob: Import,
|
|
50
|
+
mirrorJob: Mirror
|
|
54
51
|
};
|
|
55
|
-
yield* registration.addJob(
|
|
56
|
-
yield* registration.addJob(
|
|
52
|
+
yield* registration.addJob(Import, () => importTry(bound), { onFailure: (_data, failure) => importFailed(bound, failure) });
|
|
53
|
+
yield* registration.addJob(Mirror, (data) => mirrorTry(bound, data));
|
|
57
54
|
const run = (effect) => base.through(withAudienceMemo(Effect.provide(effect, bound.needs)));
|
|
58
55
|
return Context.make(SyncState, bound).pipe(Context.add(Sync, {
|
|
59
56
|
import: (input) => run(importWith(bound, input)),
|
package/dist/sync/mirror.mjs
CHANGED
|
@@ -106,7 +106,7 @@ const mirrorWith = /* @__PURE__ */ Effect.fnUntraced(function* (bound, input) {
|
|
|
106
106
|
};
|
|
107
107
|
const bytes = jsonBytes(mirrorRow(ref, largest));
|
|
108
108
|
if (bytes > mirrorLimits.rowBytes) return yield* fail("INVALID_ARGUMENT", `The mirror of '${ref}' takes ${bytes} bytes: a mirror takes at most ${mirrorLimits.rowBytes}`, { hint: "Name a shorter destination or ref" });
|
|
109
|
-
const job = bound.mirrorJob.
|
|
109
|
+
const job = bound.mirrorJob.encodedJob({
|
|
110
110
|
key: ref,
|
|
111
111
|
data: { ref }
|
|
112
112
|
});
|
package/dist/topics/advance.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { millis } from "../contracts/promises.mjs";
|
|
|
2
2
|
import { hostCall, hostEffect } from "../auth/host-function.mjs";
|
|
3
3
|
import { checkPublish } from "../queue/advance.mjs";
|
|
4
4
|
import { advanceRow } from "../store/queue-jobs.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { jobParts } from "../store/job-try.mjs";
|
|
6
6
|
import { storeCall } from "../store/errors.mjs";
|
|
7
7
|
import { untilAborted } from "../store/crossing.mjs";
|
|
8
8
|
import { repoScope, topicScope } from "../store/scopes.mjs";
|
|
@@ -680,9 +680,9 @@ const topicJobs = (host) => {
|
|
|
680
680
|
timeout: (host.prepare?.timeout ?? 0) + saveMargin
|
|
681
681
|
});
|
|
682
682
|
return [
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
683
|
+
jobParts(AdvanceJob, (data) => overCore(host, data, (job) => advance(host, job))),
|
|
684
|
+
jobParts(PrepareJob, (data) => overCore(host, data, (job) => prepareStep(host, job)), { onFailure: (data) => prepareFailed(host, data) }),
|
|
685
|
+
jobParts(ReportTimeoutJob, (data) => overCore(host, data, (job) => reportTimeoutStep(host, job)))
|
|
686
686
|
];
|
|
687
687
|
};
|
|
688
688
|
export { addMissing, block, inOrder, outOfTries, pollEvery, saysFailed, topicJobs };
|
package/dist/topics/layer.mjs
CHANGED
|
@@ -42,7 +42,7 @@ const topicsRegistration = /* @__PURE__ */ Effect.fnUntraced(function* (registra
|
|
|
42
42
|
remove: (id, input, by) => Effect.provideContext(acting(by, over(by).remove(id, input)), needs),
|
|
43
43
|
report: (id, input, by) => Effect.provideContext(acting(by, over(by).report(id, input)), needs)
|
|
44
44
|
};
|
|
45
|
-
for (const job of topicJobs(host)) yield* registration.addJob
|
|
45
|
+
for (const job of topicJobs(host)) yield* job(registration.addJob);
|
|
46
46
|
yield* (yield* TopicsBase).attach(service);
|
|
47
47
|
return Topics.of(service);
|
|
48
48
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ref0/git",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Git hosting as a library: a server, a client and their merges",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@ref0/infra": "0.
|
|
65
|
+
"@ref0/infra": "0.9.0",
|
|
66
66
|
"pako": "2.1.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@effect/vitest": "4.1.7",
|
|
70
|
-
"@ref0/xdiff-wasm": "0.
|
|
70
|
+
"@ref0/xdiff-wasm": "0.9.0",
|
|
71
71
|
"effect": "4.1.7",
|
|
72
72
|
"vite-plus": "1.8.0",
|
|
73
73
|
"vitest": "5.1.1"
|