dsh-gitnexus-plus 0.1.2 → 0.1.4
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-CN.md +189 -0
- package/README.md +219 -597
- package/lib/bin/graph-helper.d.ts +21 -0
- package/lib/bin/graph-helper.d.ts.map +1 -0
- package/lib/bin/graph-helper.js +71 -0
- package/lib/bin/graph-helper.js.map +1 -0
- package/lib/client.js +4107 -2029
- package/lib/gitnexus/analyze.d.ts +48 -8
- package/lib/gitnexus/analyze.d.ts.map +1 -1
- package/lib/gitnexus/analyze.js +376 -75
- package/lib/gitnexus/analyze.js.map +1 -1
- package/lib/gitnexus/commands.d.ts +8 -1
- package/lib/gitnexus/commands.d.ts.map +1 -1
- package/lib/gitnexus/commands.js +19 -0
- package/lib/gitnexus/commands.js.map +1 -1
- package/lib/gitnexus/coverage.d.ts +16 -0
- package/lib/gitnexus/coverage.d.ts.map +1 -1
- package/lib/gitnexus/coverage.js +58 -1
- package/lib/gitnexus/coverage.js.map +1 -1
- package/lib/gitnexus/delta.d.ts +144 -0
- package/lib/gitnexus/delta.d.ts.map +1 -0
- package/lib/gitnexus/delta.js +347 -0
- package/lib/gitnexus/delta.js.map +1 -0
- package/lib/gitnexus/git-activity.d.ts +77 -0
- package/lib/gitnexus/git-activity.d.ts.map +1 -1
- package/lib/gitnexus/git-activity.js +327 -8
- package/lib/gitnexus/git-activity.js.map +1 -1
- package/lib/gitnexus/graph.d.ts +126 -0
- package/lib/gitnexus/graph.d.ts.map +1 -0
- package/lib/gitnexus/graph.js +472 -0
- package/lib/gitnexus/graph.js.map +1 -0
- package/lib/gitnexus/root.d.ts +0 -3
- package/lib/gitnexus/root.d.ts.map +1 -1
- package/lib/gitnexus/root.js +64 -5
- package/lib/gitnexus/root.js.map +1 -1
- package/lib/gitnexus/scan.d.ts +2 -0
- package/lib/gitnexus/scan.d.ts.map +1 -1
- package/lib/gitnexus/scan.js +3 -2
- package/lib/gitnexus/scan.js.map +1 -1
- package/lib/gitnexus/search.d.ts +21 -8
- package/lib/gitnexus/search.d.ts.map +1 -1
- package/lib/gitnexus/search.js +87 -13
- package/lib/gitnexus/search.js.map +1 -1
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +170 -2
- package/lib/index.js.map +1 -1
- package/lib/routes/analyze.d.ts +3 -2
- package/lib/routes/analyze.d.ts.map +1 -1
- package/lib/routes/analyze.js +8 -2
- package/lib/routes/analyze.js.map +1 -1
- package/lib/routes/coverage.d.ts +2 -1
- package/lib/routes/coverage.d.ts.map +1 -1
- package/lib/routes/coverage.js +53 -1
- package/lib/routes/coverage.js.map +1 -1
- package/lib/routes/delta.d.ts +22 -0
- package/lib/routes/delta.d.ts.map +1 -0
- package/lib/routes/delta.js +50 -0
- package/lib/routes/delta.js.map +1 -0
- package/lib/routes/file-diff.d.ts +19 -0
- package/lib/routes/file-diff.d.ts.map +1 -0
- package/lib/routes/file-diff.js +69 -0
- package/lib/routes/file-diff.js.map +1 -0
- package/lib/routes/file-history.d.ts +21 -0
- package/lib/routes/file-history.d.ts.map +1 -0
- package/lib/routes/file-history.js +69 -0
- package/lib/routes/file-history.js.map +1 -0
- package/lib/routes/graph.d.ts +22 -0
- package/lib/routes/graph.d.ts.map +1 -0
- package/lib/routes/graph.js +71 -0
- package/lib/routes/graph.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Graph projection helper, run by the **system Node** rather than the DSH host.
|
|
4
|
+
*
|
|
5
|
+
* The host is Electron's Node and cannot load GitNexus's LadybugDB native addon
|
|
6
|
+
* (ABI mismatch: "A dynamic link library (DLL) initialization routine failed").
|
|
7
|
+
* This process is started with the platform Node the CLI already uses, imports the
|
|
8
|
+
* same adapter, runs the bounded projection, and prints exactly one JSON object.
|
|
9
|
+
*
|
|
10
|
+
* Invocation:
|
|
11
|
+
* node graph-helper.js <repo> <view> <id> [managedPrefix] [nodeBudget] [edgeBudget]
|
|
12
|
+
*
|
|
13
|
+
* Success: `{ "ok": true, "projection": GraphProjection }`
|
|
14
|
+
* Failure: `{ "ok": false, "status": <number>, "code": <GraphErrorCode>, "message": string }`
|
|
15
|
+
*
|
|
16
|
+
* It always exits 0 for a reported failure, so the host reads a structured answer
|
|
17
|
+
* instead of inferring one from an exit code. A process-level crash (native fault)
|
|
18
|
+
* is the one case the host handles from an unparseable stdout/stderr pair.
|
|
19
|
+
*/
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=graph-helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-helper.d.ts","sourceRoot":"","sources":["../../src/bin/graph-helper.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;GAiBG"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Graph projection helper, run by the **system Node** rather than the DSH host.
|
|
4
|
+
*
|
|
5
|
+
* The host is Electron's Node and cannot load GitNexus's LadybugDB native addon
|
|
6
|
+
* (ABI mismatch: "A dynamic link library (DLL) initialization routine failed").
|
|
7
|
+
* This process is started with the platform Node the CLI already uses, imports the
|
|
8
|
+
* same adapter, runs the bounded projection, and prints exactly one JSON object.
|
|
9
|
+
*
|
|
10
|
+
* Invocation:
|
|
11
|
+
* node graph-helper.js <repo> <view> <id> [managedPrefix] [nodeBudget] [edgeBudget]
|
|
12
|
+
*
|
|
13
|
+
* Success: `{ "ok": true, "projection": GraphProjection }`
|
|
14
|
+
* Failure: `{ "ok": false, "status": <number>, "code": <GraphErrorCode>, "message": string }`
|
|
15
|
+
*
|
|
16
|
+
* It always exits 0 for a reported failure, so the host reads a structured answer
|
|
17
|
+
* instead of inferring one from an exit code. A process-level crash (native fault)
|
|
18
|
+
* is the one case the host handles from an unparseable stdout/stderr pair.
|
|
19
|
+
*/
|
|
20
|
+
import { GraphError, isGraphView, projectGraph } from '../gitnexus/graph.js';
|
|
21
|
+
/** Write the one object, then exit once stdout has flushed. */
|
|
22
|
+
function emit(payload) {
|
|
23
|
+
const text = JSON.stringify(payload);
|
|
24
|
+
process.stdout.write(text, () => process.exit(0));
|
|
25
|
+
// A native handle can keep the event loop alive; the payload is already queued.
|
|
26
|
+
setTimeout(() => process.exit(0), 2000).unref();
|
|
27
|
+
}
|
|
28
|
+
const [, , repoArg, viewArg, idArg, managedArg, nodeArg, edgeArg] = process.argv;
|
|
29
|
+
const parseBudget = (value) => {
|
|
30
|
+
if (value === undefined || value === '')
|
|
31
|
+
return undefined;
|
|
32
|
+
const parsed = Number.parseInt(value, 10);
|
|
33
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
34
|
+
};
|
|
35
|
+
if (typeof repoArg !== 'string' || repoArg === '') {
|
|
36
|
+
emit({
|
|
37
|
+
ok: false,
|
|
38
|
+
status: 400,
|
|
39
|
+
code: 'invalid-view',
|
|
40
|
+
message: 'usage: graph-helper <repo> <view> [id] [managedPrefix] [nodeBudget] [edgeBudget]',
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
else if (!isGraphView(viewArg)) {
|
|
44
|
+
emit({
|
|
45
|
+
ok: false,
|
|
46
|
+
status: 400,
|
|
47
|
+
code: 'invalid-view',
|
|
48
|
+
message: `未知的图视图:${String(viewArg)}(可用:communities、community)`,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
try {
|
|
53
|
+
const projection = await projectGraph(repoArg, {
|
|
54
|
+
view: viewArg,
|
|
55
|
+
id: typeof idArg === 'string' && idArg !== '' ? idArg : undefined,
|
|
56
|
+
managedPrefix: managedArg === undefined || managedArg === '' ? undefined : managedArg,
|
|
57
|
+
nodeBudget: parseBudget(nodeArg),
|
|
58
|
+
edgeBudget: parseBudget(edgeArg),
|
|
59
|
+
});
|
|
60
|
+
emit({ ok: true, projection });
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
emit({
|
|
64
|
+
ok: false,
|
|
65
|
+
status: error instanceof GraphError ? error.status : 500,
|
|
66
|
+
code: error instanceof GraphError ? error.code : 'graph-failed',
|
|
67
|
+
message: error instanceof Error ? error.message : String(error),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=graph-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-helper.js","sourceRoot":"","sources":["../../src/bin/graph-helper.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE7E,+DAA+D;AAC/D,SAAS,IAAI,CAAC,OAAgB;IAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,gFAAgF;IAChF,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,EAAE,AAAD,EAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;AAEjF,MAAM,WAAW,GAAG,CAAC,KAAyB,EAAsB,EAAE;IACpE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAC1D,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1C,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,C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