@git-stunts/git-cas 6.5.7 → 6.5.8
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/CHANGELOG.md +17 -0
- package/GUIDE.md +29 -0
- package/README.md +11 -7
- package/UPGRADING.md +29 -0
- package/build-info.json +2 -2
- package/docs/API.md +66 -12
- package/docs/releases/v6.5.8.md +89 -0
- package/index.d.ts +50 -0
- package/index.js +15 -1
- package/package.json +3 -2
- package/src/domain/services/AssetService.js +201 -10
- package/src/domain/services/BoundedWriteWavePersistence.js +235 -0
- package/src/domain/services/BundleBatchPlanner.js +349 -0
- package/src/domain/services/BundleService.js +225 -2
- package/src/domain/services/CasService.d.ts +16 -0
- package/src/domain/services/CasService.js +9 -18
- package/src/domain/services/ManifestRepository.js +129 -50
- package/src/domain/services/ManifestTreeService.js +47 -0
- package/src/domain/services/PageService.js +26 -9
- package/src/domain/services/RootSet.js +32 -0
- package/src/domain/services/RootSetPersistence.js +58 -1
- package/src/domain/services/StagedTarget.js +19 -0
- package/src/domain/services/StagingWorkspace.js +21 -7
- package/src/domain/services/forkCasPersistence.js +20 -0
- package/src/infrastructure/adapters/GitObjectSessionPool.js +47 -5
- package/src/infrastructure/adapters/GitPersistenceAdapter.js +169 -0
- package/src/infrastructure/adapters/GitPersistenceWriteScope.js +154 -0
- package/src/infrastructure/adapters/GitRefAdapter.js +38 -3
- package/src/infrastructure/adapters/GitUpdateRefSessionPool.js +115 -0
- package/src/package-version.js +1 -1
- package/src/ports/GitPersistencePort.js +43 -0
- package/src/ports/GitRefPort.js +8 -0
|
@@ -35,6 +35,20 @@ export default class GitPersistencePort {
|
|
|
35
35
|
throw new Error('Not implemented');
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Creates a bounded group of independent Git tree objects in input order.
|
|
40
|
+
* Adapters may override this to pipeline one typed protocol request.
|
|
41
|
+
* @param {Iterable<string[]>} trees
|
|
42
|
+
* @returns {Promise<string[]>} Git OIDs in input order.
|
|
43
|
+
*/
|
|
44
|
+
async writeTrees(trees) {
|
|
45
|
+
const oids = [];
|
|
46
|
+
for (const entries of trees) {
|
|
47
|
+
oids.push(await this.writeTree(entries));
|
|
48
|
+
}
|
|
49
|
+
return oids;
|
|
50
|
+
}
|
|
51
|
+
|
|
38
52
|
/**
|
|
39
53
|
* Reads a Git blob by its OID.
|
|
40
54
|
* @param {string} _oid - Git object ID.
|
|
@@ -102,6 +116,35 @@ export default class GitPersistencePort {
|
|
|
102
116
|
throw new Error('Not implemented');
|
|
103
117
|
}
|
|
104
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Reads metadata for a bounded group of Git objects in input order.
|
|
121
|
+
* @param {Iterable<string>} oids - Git object IDs.
|
|
122
|
+
* @returns {Promise<Array<{oid: string, type: string, size: number}>>}
|
|
123
|
+
*/
|
|
124
|
+
async readObjectInfos(oids) {
|
|
125
|
+
const infos = [];
|
|
126
|
+
for (const oid of oids) {
|
|
127
|
+
infos.push({
|
|
128
|
+
oid,
|
|
129
|
+
type: await this.readObjectType(oid),
|
|
130
|
+
size: await this.readObjectSize(oid),
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return infos;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Runs one bounded operation against an operation-owned write scope.
|
|
138
|
+
* Adapters may override this to retain protocol processes until the callback
|
|
139
|
+
* settles. The default preserves compatibility for custom persistence ports.
|
|
140
|
+
* @template T
|
|
141
|
+
* @param {(persistence: GitPersistencePort) => Promise<T>} operation
|
|
142
|
+
* @returns {Promise<T>}
|
|
143
|
+
*/
|
|
144
|
+
async withWriteScope(operation) {
|
|
145
|
+
return await operation(this);
|
|
146
|
+
}
|
|
147
|
+
|
|
105
148
|
/**
|
|
106
149
|
* Releases adapter-owned local resources. The default implementation is a
|
|
107
150
|
* no-op so persistence adapters without long-lived resources remain valid.
|
package/src/ports/GitRefPort.js
CHANGED
|
@@ -99,6 +99,14 @@ export default class GitRefPort {
|
|
|
99
99
|
iterateRefs(_options) {
|
|
100
100
|
throw unsupportedAcquisitionCapability('iterateRefs');
|
|
101
101
|
}
|
|
102
|
+
|
|
103
|
+
/** Releases adapter-owned local resources. */
|
|
104
|
+
async close() {}
|
|
105
|
+
|
|
106
|
+
/** @returns {Promise<void>} */
|
|
107
|
+
async [Symbol.asyncDispose]() {
|
|
108
|
+
await this.close();
|
|
109
|
+
}
|
|
102
110
|
}
|
|
103
111
|
|
|
104
112
|
function unsupportedAcquisitionCapability(capability) {
|