@hardlydifficult/repo-processor 1.0.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/RepoProcessor.d.ts +26 -0
- package/dist/RepoProcessor.d.ts.map +1 -0
- package/dist/RepoProcessor.js +178 -0
- package/dist/RepoProcessor.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/resolveDirectories.d.ts +14 -0
- package/dist/resolveDirectories.d.ts.map +1 -0
- package/dist/resolveDirectories.js +52 -0
- package/dist/resolveDirectories.js.map +1 -0
- package/dist/types.d.ts +66 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type GitHubClient } from "@hardlydifficult/github";
|
|
2
|
+
import type { ProcessingResult, ProcessorCallbacks, ProcessorStore, ProgressCallback } from "./types.js";
|
|
3
|
+
export interface RepoProcessorConfig {
|
|
4
|
+
githubClient: GitHubClient;
|
|
5
|
+
store: ProcessorStore;
|
|
6
|
+
callbacks: ProcessorCallbacks;
|
|
7
|
+
concurrency?: number;
|
|
8
|
+
branch?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generic pipeline for incrementally processing a GitHub repo's file tree.
|
|
12
|
+
*
|
|
13
|
+
* Pipeline: init → fetch tree → filter → diff → process changed files →
|
|
14
|
+
* remove deleted files → resolve stale dirs → process dirs bottom-up → commit.
|
|
15
|
+
*/
|
|
16
|
+
export declare class RepoProcessor {
|
|
17
|
+
private readonly github;
|
|
18
|
+
private readonly store;
|
|
19
|
+
private readonly callbacks;
|
|
20
|
+
private readonly concurrency;
|
|
21
|
+
private readonly branch;
|
|
22
|
+
constructor(config: RepoProcessorConfig);
|
|
23
|
+
run(owner: string, repo: string, onProgress?: ProgressCallback): Promise<ProcessingResult>;
|
|
24
|
+
private buildDirectoryContext;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=RepoProcessor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepoProcessor.d.ts","sourceRoot":"","sources":["../src/RepoProcessor.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAIV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,cAAc,CAAC;IACtB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAC/C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,MAAM,EAAE,mBAAmB;IAQjC,GAAG,CACP,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,gBAAgB,GAC5B,OAAO,CAAC,gBAAgB,CAAC;IA6N5B,OAAO,CAAC,qBAAqB;CAqC9B"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RepoProcessor = void 0;
|
|
4
|
+
const collections_1 = require("@hardlydifficult/collections");
|
|
5
|
+
const github_1 = require("@hardlydifficult/github");
|
|
6
|
+
const text_1 = require("@hardlydifficult/text");
|
|
7
|
+
const resolveDirectories_js_1 = require("./resolveDirectories.js");
|
|
8
|
+
/**
|
|
9
|
+
* Generic pipeline for incrementally processing a GitHub repo's file tree.
|
|
10
|
+
*
|
|
11
|
+
* Pipeline: init → fetch tree → filter → diff → process changed files →
|
|
12
|
+
* remove deleted files → resolve stale dirs → process dirs bottom-up → commit.
|
|
13
|
+
*/
|
|
14
|
+
class RepoProcessor {
|
|
15
|
+
github;
|
|
16
|
+
store;
|
|
17
|
+
callbacks;
|
|
18
|
+
concurrency;
|
|
19
|
+
branch;
|
|
20
|
+
constructor(config) {
|
|
21
|
+
this.github = config.githubClient;
|
|
22
|
+
this.store = config.store;
|
|
23
|
+
this.callbacks = config.callbacks;
|
|
24
|
+
this.concurrency = config.concurrency ?? 5;
|
|
25
|
+
this.branch = config.branch ?? "main";
|
|
26
|
+
}
|
|
27
|
+
async run(owner, repo, onProgress) {
|
|
28
|
+
const emitProgress = (phase, message, filesTotal, filesCompleted, dirsTotal, dirsCompleted) => {
|
|
29
|
+
onProgress?.({
|
|
30
|
+
phase,
|
|
31
|
+
message,
|
|
32
|
+
filesTotal,
|
|
33
|
+
filesCompleted,
|
|
34
|
+
dirsTotal,
|
|
35
|
+
dirsCompleted,
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
// 1. Init store
|
|
39
|
+
emitProgress("loading", "Initializing store...", 0, 0, 0, 0);
|
|
40
|
+
await this.store.ensureReady?.(owner, repo);
|
|
41
|
+
// 2. Fetch tree
|
|
42
|
+
emitProgress("loading", "Fetching file tree...", 0, 0, 0, 0);
|
|
43
|
+
const { entries, rootSha } = await this.github
|
|
44
|
+
.repo(owner, repo)
|
|
45
|
+
.getFileTree();
|
|
46
|
+
const tree = [
|
|
47
|
+
...entries,
|
|
48
|
+
{ path: "", type: "tree", sha: rootSha },
|
|
49
|
+
];
|
|
50
|
+
// 3. Filter blobs
|
|
51
|
+
const blobs = entries.filter((e) => e.type === "blob" && this.callbacks.shouldProcess(e));
|
|
52
|
+
// 4. Diff
|
|
53
|
+
const currentManifest = await this.store.getFileManifest(owner, repo);
|
|
54
|
+
const diff = (0, github_1.diffTree)(blobs, currentManifest);
|
|
55
|
+
const filesTotal = diff.changedFiles.length;
|
|
56
|
+
let filesCompleted = 0;
|
|
57
|
+
emitProgress("files", `Processing ${String(filesTotal)} files...`, filesTotal, 0, diff.staleDirs.length, 0);
|
|
58
|
+
// 5. Process changed files in batches
|
|
59
|
+
const fileBatches = (0, collections_1.chunk)(diff.changedFiles, this.concurrency);
|
|
60
|
+
for (const batch of fileBatches) {
|
|
61
|
+
const results = await Promise.allSettled(batch.map(async (entry) => {
|
|
62
|
+
const content = await this.github
|
|
63
|
+
.repo(owner, repo)
|
|
64
|
+
.getFileContent(entry.path);
|
|
65
|
+
const result = await this.callbacks.processFile({ entry, content });
|
|
66
|
+
await this.store.writeFileResult(owner, repo, entry.path, entry.sha, result);
|
|
67
|
+
}));
|
|
68
|
+
const failures = [];
|
|
69
|
+
let succeededCount = 0;
|
|
70
|
+
for (let i = 0; i < results.length; i++) {
|
|
71
|
+
const result = results[i];
|
|
72
|
+
filesCompleted++;
|
|
73
|
+
if (result.status === "rejected") {
|
|
74
|
+
failures.push({
|
|
75
|
+
path: batch[i]?.path ?? `unknown-${String(i)}`,
|
|
76
|
+
reason: result.reason,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
succeededCount++;
|
|
81
|
+
}
|
|
82
|
+
emitProgress("files", `Files: ${String(filesCompleted)}/${String(filesTotal)}`, filesTotal, filesCompleted, diff.staleDirs.length, 0);
|
|
83
|
+
}
|
|
84
|
+
if (failures.length > 0) {
|
|
85
|
+
const details = failures
|
|
86
|
+
.map((f) => ` ${f.path}: ${(0, text_1.getErrorMessage)(f.reason)}`)
|
|
87
|
+
.join("\n");
|
|
88
|
+
throw new Error(`${String(failures.length)} file(s) failed to process:\n${details}`);
|
|
89
|
+
}
|
|
90
|
+
if (succeededCount > 0) {
|
|
91
|
+
await this.store.commitBatch(owner, repo, succeededCount);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// 6. Remove deleted files
|
|
95
|
+
for (const removedPath of diff.removedFiles) {
|
|
96
|
+
await this.store.deleteFileResult(owner, repo, removedPath);
|
|
97
|
+
}
|
|
98
|
+
if (diff.removedFiles.length > 0) {
|
|
99
|
+
await this.store.commitBatch(owner, repo, diff.removedFiles.length);
|
|
100
|
+
}
|
|
101
|
+
// 7. Resolve stale directories
|
|
102
|
+
const allFilePaths = blobs.map((b) => b.path);
|
|
103
|
+
const allDirs = await (0, resolveDirectories_js_1.resolveStaleDirectories)(owner, repo, diff.staleDirs, allFilePaths, tree, this.store);
|
|
104
|
+
let dirsCompleted = 0;
|
|
105
|
+
if (allDirs.length > 0) {
|
|
106
|
+
emitProgress("directories", `Processing ${String(allDirs.length)} directories...`, filesTotal, filesCompleted, allDirs.length, 0);
|
|
107
|
+
// 8. Process directories bottom-up by depth
|
|
108
|
+
const depthGroups = (0, collections_1.groupByDepth)(allDirs);
|
|
109
|
+
for (const { paths: dirsAtDepth } of depthGroups) {
|
|
110
|
+
const batches = (0, collections_1.chunk)(dirsAtDepth, this.concurrency);
|
|
111
|
+
let dirsInDepthGroup = 0;
|
|
112
|
+
for (const batch of batches) {
|
|
113
|
+
const results = await Promise.allSettled(batch.map(async (dirPath) => {
|
|
114
|
+
const ctx = this.buildDirectoryContext(dirPath, tree, allFilePaths);
|
|
115
|
+
const result = await this.callbacks.processDirectory(ctx);
|
|
116
|
+
await this.store.writeDirResult(owner, repo, dirPath, ctx.sha, result);
|
|
117
|
+
}));
|
|
118
|
+
const failures = [];
|
|
119
|
+
for (let i = 0; i < results.length; i++) {
|
|
120
|
+
const result = results[i];
|
|
121
|
+
dirsCompleted++;
|
|
122
|
+
dirsInDepthGroup++;
|
|
123
|
+
if (result.status === "rejected") {
|
|
124
|
+
failures.push({
|
|
125
|
+
path: batch[i] ?? `unknown-${String(i)}`,
|
|
126
|
+
reason: result.reason,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
emitProgress("directories", `Dirs: ${String(dirsCompleted)}/${String(allDirs.length)}`, filesTotal, filesCompleted, allDirs.length, dirsCompleted);
|
|
130
|
+
}
|
|
131
|
+
if (failures.length > 0) {
|
|
132
|
+
const details = failures
|
|
133
|
+
.map((f) => ` ${f.path}: ${(0, text_1.getErrorMessage)(f.reason)}`)
|
|
134
|
+
.join("\n");
|
|
135
|
+
throw new Error(`${String(failures.length)} directory(ies) failed to process:\n${details}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (dirsInDepthGroup > 0) {
|
|
139
|
+
await this.store.commitBatch(owner, repo, dirsInDepthGroup);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// 9. Final safety commit
|
|
144
|
+
emitProgress("committing", "Final commit...", filesTotal, filesCompleted, allDirs.length, dirsCompleted);
|
|
145
|
+
await this.store.commitBatch(owner, repo, 0);
|
|
146
|
+
return {
|
|
147
|
+
filesProcessed: filesCompleted,
|
|
148
|
+
filesRemoved: diff.removedFiles.length,
|
|
149
|
+
dirsProcessed: dirsCompleted,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
buildDirectoryContext(dirPath, tree, allFilePaths) {
|
|
153
|
+
const dirTreeEntry = tree.find((e) => e.type === "tree" && e.path === dirPath);
|
|
154
|
+
const sha = dirTreeEntry?.sha ?? "";
|
|
155
|
+
const prefix = dirPath === "" ? "" : `${dirPath}/`;
|
|
156
|
+
const subtreeFilePaths = allFilePaths.filter((fp) => dirPath === "" || fp.startsWith(prefix));
|
|
157
|
+
// Build immediate children list
|
|
158
|
+
const seen = new Set();
|
|
159
|
+
const children = [];
|
|
160
|
+
for (const fp of subtreeFilePaths) {
|
|
161
|
+
const relative = prefix ? fp.slice(prefix.length) : fp;
|
|
162
|
+
const slashIndex = relative.indexOf("/");
|
|
163
|
+
const isDir = slashIndex !== -1;
|
|
164
|
+
const childName = isDir ? relative.slice(0, slashIndex) : relative;
|
|
165
|
+
if (!seen.has(childName)) {
|
|
166
|
+
seen.add(childName);
|
|
167
|
+
children.push({
|
|
168
|
+
name: childName,
|
|
169
|
+
isDir,
|
|
170
|
+
fullPath: dirPath === "" ? childName : `${dirPath}/${childName}`,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return { path: dirPath, sha, subtreeFilePaths, children, tree };
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.RepoProcessor = RepoProcessor;
|
|
178
|
+
//# sourceMappingURL=RepoProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepoProcessor.js","sourceRoot":"","sources":["../src/RepoProcessor.ts"],"names":[],"mappings":";;;AAAA,8DAAmE;AACnE,oDAIiC;AACjC,gDAAwD;AAExD,mEAAkE;AAmBlE;;;;;GAKG;AACH,MAAa,aAAa;IACP,MAAM,CAAe;IACrB,KAAK,CAAiB;IACtB,SAAS,CAAqB;IAC9B,WAAW,CAAS;IACpB,MAAM,CAAS;IAEhC,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,GAAG,CACP,KAAa,EACb,IAAY,EACZ,UAA6B;QAE7B,MAAM,YAAY,GAAG,CACnB,KAAkC,EAClC,OAAe,EACf,UAAkB,EAClB,cAAsB,EACtB,SAAiB,EACjB,aAAqB,EACf,EAAE;YACR,UAAU,EAAE,CAAC;gBACX,KAAK;gBACL,OAAO;gBACP,UAAU;g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KAAK,GAAG,UAAU,KAAK,CAAC,CAAC,CAAC;YAChC,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;YAEnE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;gBACzB,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBACpB,QAAQ,CAAC,IAAI,CAAC;oBACZ,IAAI,EAAE,SAAS;oBACf,KAAK;oBACL,QAAQ,EAAE,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,SAAS,EAAE;iBACjE,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAClE,CAAC;CACF;AArRD,sCAqRC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { RepoProcessor } from "./RepoProcessor.js";
|
|
2
|
+
export type { RepoProcessorConfig } from "./RepoProcessor.js";
|
|
3
|
+
export { resolveStaleDirectories } from "./resolveDirectories.js";
|
|
4
|
+
export type { ProcessorStore, ProcessorCallbacks, FileContext, DirectoryContext, DirectoryChild, ProcessingProgress, ProgressCallback, ProcessingResult, } from "./types.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveStaleDirectories = exports.RepoProcessor = void 0;
|
|
4
|
+
var RepoProcessor_js_1 = require("./RepoProcessor.js");
|
|
5
|
+
Object.defineProperty(exports, "RepoProcessor", { enumerable: true, get: function () { return RepoProcessor_js_1.RepoProcessor; } });
|
|
6
|
+
var resolveDirectories_js_1 = require("./resolveDirectories.js");
|
|
7
|
+
Object.defineProperty(exports, "resolveStaleDirectories", { enumerable: true, get: function () { return resolveDirectories_js_1.resolveStaleDirectories; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AAEtB,iEAAkE;AAAzD,gIAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TreeEntry } from "@hardlydifficult/github";
|
|
2
|
+
import type { ProcessorStore } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Find all directories that need (re-)processing.
|
|
5
|
+
*
|
|
6
|
+
* Combines two sources:
|
|
7
|
+
* 1. Stale dirs from diffTree (directories with changed/removed children)
|
|
8
|
+
* 2. Any directory whose stored SHA is missing or differs from the current tree SHA
|
|
9
|
+
*
|
|
10
|
+
* The second source handles recovery after partial failures and catches
|
|
11
|
+
* directories whose tree SHA changed without any processable file changes.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveStaleDirectories(owner: string, repo: string, staleDirsFromDiff: readonly string[], allFilePaths: readonly string[], tree: readonly TreeEntry[], store: ProcessorStore): Promise<string[]>;
|
|
14
|
+
//# sourceMappingURL=resolveDirectories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveDirectories.d.ts","sourceRoot":"","sources":["../src/resolveDirectories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,iBAAiB,EAAE,SAAS,MAAM,EAAE,EACpC,YAAY,EAAE,SAAS,MAAM,EAAE,EAC/B,IAAI,EAAE,SAAS,SAAS,EAAE,EAC1B,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,MAAM,EAAE,CAAC,CAyCnB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveStaleDirectories = resolveStaleDirectories;
|
|
4
|
+
/**
|
|
5
|
+
* Find all directories that need (re-)processing.
|
|
6
|
+
*
|
|
7
|
+
* Combines two sources:
|
|
8
|
+
* 1. Stale dirs from diffTree (directories with changed/removed children)
|
|
9
|
+
* 2. Any directory whose stored SHA is missing or differs from the current tree SHA
|
|
10
|
+
*
|
|
11
|
+
* The second source handles recovery after partial failures and catches
|
|
12
|
+
* directories whose tree SHA changed without any processable file changes.
|
|
13
|
+
*/
|
|
14
|
+
async function resolveStaleDirectories(owner, repo, staleDirsFromDiff, allFilePaths, tree, store) {
|
|
15
|
+
// Build map of directory path → current tree SHA
|
|
16
|
+
const treeShaByDir = new Map();
|
|
17
|
+
for (const entry of tree) {
|
|
18
|
+
if (entry.type === "tree") {
|
|
19
|
+
treeShaByDir.set(entry.path, entry.sha);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
// Collect all directories that should be processed (derived from file paths + root)
|
|
23
|
+
const allExpectedDirs = new Set();
|
|
24
|
+
for (const filePath of allFilePaths) {
|
|
25
|
+
const parts = filePath.split("/");
|
|
26
|
+
for (let i = 1; i < parts.length; i++) {
|
|
27
|
+
allExpectedDirs.add(parts.slice(0, i).join("/"));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// Always include root
|
|
31
|
+
allExpectedDirs.add("");
|
|
32
|
+
// Start with stale dirs from diff
|
|
33
|
+
const needed = new Set(staleDirsFromDiff);
|
|
34
|
+
// Check every expected directory for a missing or stale stored SHA
|
|
35
|
+
for (const dirPath of allExpectedDirs) {
|
|
36
|
+
if (needed.has(dirPath)) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const storedSha = await store.getDirSha(owner, repo, dirPath);
|
|
40
|
+
if (storedSha === null) {
|
|
41
|
+
needed.add(dirPath);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
const currentSha = treeShaByDir.get(dirPath) ?? "";
|
|
45
|
+
if (storedSha !== currentSha) {
|
|
46
|
+
needed.add(dirPath);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return [...needed];
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=resolveDirectories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveDirectories.js","sourceRoot":"","sources":["../src/resolveDirectories.ts"],"names":[],"mappings":";;AAcA,0DAgDC;AA1DD;;;;;;;;;GASG;AACI,KAAK,UAAU,uBAAuB,CAC3C,KAAa,EACb,IAAY,EACZ,iBAAoC,EACpC,YAA+B,EAC/B,IAA0B,EAC1B,KAAqB;IAErB,iDAAiD;IACjD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC/C,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QACzB,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC1B,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AAO,CAAC,GAAG,MAAM,CAAC,CAAC;AACrB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { FileManifest, TreeEntry } from "@hardlydifficult/github";
|
|
2
|
+
export type { TreeEntry, FileManifest };
|
|
3
|
+
/** Manifest of previously processed file SHAs (path → blob SHA). */
|
|
4
|
+
export type { FileManifest as ProcessorFileManifest };
|
|
5
|
+
/** Consumer-implemented persistence layer. */
|
|
6
|
+
export interface ProcessorStore {
|
|
7
|
+
/** One-time init (e.g. ensure local clone). Optional. */
|
|
8
|
+
ensureReady?(owner: string, repo: string): Promise<void>;
|
|
9
|
+
/** Return manifest of previously processed file SHAs (path → blob SHA). */
|
|
10
|
+
getFileManifest(owner: string, repo: string): Promise<FileManifest>;
|
|
11
|
+
/** Return stored SHA for a directory. Null if not stored. */
|
|
12
|
+
getDirSha(owner: string, repo: string, dirPath: string): Promise<string | null>;
|
|
13
|
+
/** Persist result for a processed file. */
|
|
14
|
+
writeFileResult(owner: string, repo: string, path: string, sha: string, result: unknown): Promise<void>;
|
|
15
|
+
/** Persist result for a processed directory. */
|
|
16
|
+
writeDirResult(owner: string, repo: string, path: string, sha: string, result: unknown): Promise<void>;
|
|
17
|
+
/** Delete stored result for a removed file. */
|
|
18
|
+
deleteFileResult(owner: string, repo: string, path: string): Promise<void>;
|
|
19
|
+
/** Commit current batch of changes. */
|
|
20
|
+
commitBatch(owner: string, repo: string, count: number): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
/** Context passed to processFile callback. */
|
|
23
|
+
export interface FileContext {
|
|
24
|
+
readonly entry: TreeEntry;
|
|
25
|
+
readonly content: string;
|
|
26
|
+
}
|
|
27
|
+
/** An immediate child of a directory being processed. */
|
|
28
|
+
export interface DirectoryChild {
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly isDir: boolean;
|
|
31
|
+
readonly fullPath: string;
|
|
32
|
+
}
|
|
33
|
+
/** Context passed to processDirectory callback. */
|
|
34
|
+
export interface DirectoryContext {
|
|
35
|
+
readonly path: string;
|
|
36
|
+
readonly sha: string;
|
|
37
|
+
readonly subtreeFilePaths: readonly string[];
|
|
38
|
+
readonly children: readonly DirectoryChild[];
|
|
39
|
+
readonly tree: readonly TreeEntry[];
|
|
40
|
+
}
|
|
41
|
+
/** Consumer-provided domain logic. */
|
|
42
|
+
export interface ProcessorCallbacks {
|
|
43
|
+
/** Filter: which tree entries should be processed? */
|
|
44
|
+
shouldProcess(entry: TreeEntry): boolean;
|
|
45
|
+
/** Process a single changed file. Return value passed to store.writeFileResult. */
|
|
46
|
+
processFile(ctx: FileContext): Promise<unknown>;
|
|
47
|
+
/** Process a directory after all children. Return value passed to store.writeDirResult. */
|
|
48
|
+
processDirectory(ctx: DirectoryContext): Promise<unknown>;
|
|
49
|
+
}
|
|
50
|
+
/** Progress reported during a run. */
|
|
51
|
+
export interface ProcessingProgress {
|
|
52
|
+
phase: "loading" | "files" | "directories" | "committing";
|
|
53
|
+
message: string;
|
|
54
|
+
filesTotal: number;
|
|
55
|
+
filesCompleted: number;
|
|
56
|
+
dirsTotal: number;
|
|
57
|
+
dirsCompleted: number;
|
|
58
|
+
}
|
|
59
|
+
export type ProgressCallback = (progress: ProcessingProgress) => void;
|
|
60
|
+
/** Result returned by RepoProcessor.run(). */
|
|
61
|
+
export interface ProcessingResult {
|
|
62
|
+
filesProcessed: number;
|
|
63
|
+
filesRemoved: number;
|
|
64
|
+
dirsProcessed: number;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEvE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;AAExC,oEAAoE;AACpE,YAAY,EAAE,YAAY,IAAI,qBAAqB,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
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hardlydifficult/repo-processor",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"test": "vitest run",
|
|
12
|
+
"test:watch": "vitest",
|
|
13
|
+
"test:coverage": "vitest run --coverage",
|
|
14
|
+
"lint": "tsc --noEmit",
|
|
15
|
+
"clean": "rm -rf dist"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@hardlydifficult/collections": "1.0.0",
|
|
19
|
+
"@hardlydifficult/github": "1.0.22",
|
|
20
|
+
"@hardlydifficult/text": "1.0.15"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "25.2.3",
|
|
24
|
+
"typescript": "5.9.3",
|
|
25
|
+
"vitest": "4.0.18"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18.0.0"
|
|
29
|
+
}
|
|
30
|
+
}
|