git-history-ui 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/.eslintrc.js +21 -0
- package/README.md +304 -0
- package/demo.js +45 -0
- package/dist/__tests__/gitService.test.d.ts +2 -0
- package/dist/__tests__/gitService.test.d.ts.map +1 -0
- package/dist/__tests__/gitService.test.js +32 -0
- package/dist/__tests__/gitService.test.js.map +1 -0
- package/dist/backend/dev-server.d.ts +2 -0
- package/dist/backend/dev-server.d.ts.map +1 -0
- package/dist/backend/dev-server.js +16 -0
- package/dist/backend/dev-server.js.map +1 -0
- package/dist/backend/gitService.d.ts +45 -0
- package/dist/backend/gitService.d.ts.map +1 -0
- package/dist/backend/gitService.js +239 -0
- package/dist/backend/gitService.js.map +1 -0
- package/dist/backend/server.d.ts +9 -0
- package/dist/backend/server.d.ts.map +1 -0
- package/dist/backend/server.js +118 -0
- package/dist/backend/server.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +49 -0
- package/dist/cli.js.map +1 -0
- package/frontend/.editorconfig +17 -0
- package/frontend/.vscode/extensions.json +4 -0
- package/frontend/.vscode/launch.json +20 -0
- package/frontend/.vscode/tasks.json +42 -0
- package/frontend/README.md +59 -0
- package/frontend/angular.json +99 -0
- package/frontend/package-lock.json +10566 -0
- package/frontend/package.json +55 -0
- package/frontend/proxy.conf.json +7 -0
- package/frontend/public/favicon.ico +0 -0
- package/frontend/src/app/app.component.ts +598 -0
- package/frontend/src/app/app.config.ts +12 -0
- package/frontend/src/app/app.css +0 -0
- package/frontend/src/app/app.html +342 -0
- package/frontend/src/app/app.routes.ts +3 -0
- package/frontend/src/app/app.spec.ts +23 -0
- package/frontend/src/app/app.ts +12 -0
- package/frontend/src/app/components/color-palette-selector/color-palette-selector.component.ts +137 -0
- package/frontend/src/app/components/commit-detail/commit-detail.component.ts +327 -0
- package/frontend/src/app/components/commit-graph/commit-graph.component.ts +294 -0
- package/frontend/src/app/components/commit-list/commit-list.component.ts +199 -0
- package/frontend/src/app/components/diff-viewer/diff-viewer.component.ts +311 -0
- package/frontend/src/app/models/color-palette.models.ts +229 -0
- package/frontend/src/app/models/git.models.ts +39 -0
- package/frontend/src/app/services/git.service.ts +43 -0
- package/frontend/src/index.html +13 -0
- package/frontend/src/main.ts +6 -0
- package/frontend/src/styles.css +397 -0
- package/frontend/tsconfig.app.json +15 -0
- package/frontend/tsconfig.json +34 -0
- package/frontend/tsconfig.spec.json +14 -0
- package/jest.config.js +13 -0
- package/package.json +70 -0
- package/public/app.js +403 -0
- package/public/index.html +172 -0
- package/src/__tests__/gitService.test.ts +35 -0
- package/src/backend/dev-server.ts +14 -0
- package/src/backend/gitService.ts +277 -0
- package/src/backend/server.ts +132 -0
- package/src/cli.ts +56 -0
- package/tsconfig.json +25 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GitService = void 0;
|
|
7
|
+
const simple_git_1 = __importDefault(require("simple-git"));
|
|
8
|
+
class GitService {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.git = (0, simple_git_1.default)();
|
|
11
|
+
}
|
|
12
|
+
async getCommits(options = {}) {
|
|
13
|
+
try {
|
|
14
|
+
const logOptions = {
|
|
15
|
+
maxCount: options.limit || 100
|
|
16
|
+
};
|
|
17
|
+
let log;
|
|
18
|
+
if (options.file) {
|
|
19
|
+
log = await this.git.log({
|
|
20
|
+
...logOptions,
|
|
21
|
+
file: options.file
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
else if (options.since) {
|
|
25
|
+
log = await this.git.log({
|
|
26
|
+
...logOptions,
|
|
27
|
+
from: options.since
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
else if (options.author) {
|
|
31
|
+
log = await this.git.log({
|
|
32
|
+
...logOptions,
|
|
33
|
+
author: options.author
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
log = await this.git.log(logOptions);
|
|
38
|
+
}
|
|
39
|
+
const commits = await Promise.all(log.all.map(async (commit) => {
|
|
40
|
+
const [branches, tags] = await Promise.all([
|
|
41
|
+
this.getBranchesForCommit(commit.hash),
|
|
42
|
+
this.getTagsForCommit(commit.hash)
|
|
43
|
+
]);
|
|
44
|
+
return {
|
|
45
|
+
hash: commit.hash,
|
|
46
|
+
author: commit.author_name,
|
|
47
|
+
date: commit.date,
|
|
48
|
+
message: commit.message,
|
|
49
|
+
files: await this.getFilesForCommit(commit.hash),
|
|
50
|
+
parents: [], // We'll get this from git show if needed
|
|
51
|
+
branches,
|
|
52
|
+
tags
|
|
53
|
+
};
|
|
54
|
+
}));
|
|
55
|
+
return commits;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
59
|
+
throw new Error(`Failed to get commits: ${errorMessage}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async getCommit(hash) {
|
|
63
|
+
try {
|
|
64
|
+
const log = await this.git.log({
|
|
65
|
+
from: hash,
|
|
66
|
+
to: hash,
|
|
67
|
+
maxCount: 1
|
|
68
|
+
});
|
|
69
|
+
if (log.all.length === 0) {
|
|
70
|
+
throw new Error('Commit not found');
|
|
71
|
+
}
|
|
72
|
+
const commit = log.all[0];
|
|
73
|
+
const [branches, tags] = await Promise.all([
|
|
74
|
+
this.getBranchesForCommit(hash),
|
|
75
|
+
this.getTagsForCommit(hash)
|
|
76
|
+
]);
|
|
77
|
+
return {
|
|
78
|
+
hash: commit.hash,
|
|
79
|
+
author: commit.author_name,
|
|
80
|
+
date: commit.date,
|
|
81
|
+
message: commit.message,
|
|
82
|
+
files: await this.getFilesForCommit(hash),
|
|
83
|
+
parents: [], // We'll get this from git show if needed
|
|
84
|
+
branches,
|
|
85
|
+
tags
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
90
|
+
throw new Error(`Failed to get commit: ${errorMessage}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async getDiff(hash) {
|
|
94
|
+
try {
|
|
95
|
+
const diff = await this.git.diff([hash + '^', hash]);
|
|
96
|
+
return this.parseDiff(diff);
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
100
|
+
throw new Error(`Failed to get diff: ${errorMessage}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async getBlame(filePath) {
|
|
104
|
+
try {
|
|
105
|
+
const blame = await this.git.raw(['blame', '--porcelain', filePath]);
|
|
106
|
+
return this.parseBlame(blame);
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
110
|
+
throw new Error(`Failed to get blame: ${errorMessage}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
async getTags() {
|
|
114
|
+
try {
|
|
115
|
+
const tags = await this.git.tags();
|
|
116
|
+
return tags.all;
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
120
|
+
throw new Error(`Failed to get tags: ${errorMessage}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
async getBranches() {
|
|
124
|
+
try {
|
|
125
|
+
const branches = await this.git.branch();
|
|
126
|
+
return branches.all;
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
130
|
+
throw new Error(`Failed to get branches: ${errorMessage}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async getFilesForCommit(hash) {
|
|
134
|
+
try {
|
|
135
|
+
const diff = await this.git.diff([hash + '^', hash, '--name-only']);
|
|
136
|
+
return diff.split('\n').filter(Boolean);
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
return [];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async getBranchesForCommit(hash) {
|
|
143
|
+
try {
|
|
144
|
+
const branches = await this.git.branch(['--contains', hash]);
|
|
145
|
+
return branches.all;
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
return [];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
async getTagsForCommit(hash) {
|
|
152
|
+
try {
|
|
153
|
+
const tags = await this.git.raw(['tag', '--contains', hash]);
|
|
154
|
+
return tags.split('\n').filter(Boolean);
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
parseDiff(diff) {
|
|
161
|
+
const files = [];
|
|
162
|
+
const lines = diff.split('\n');
|
|
163
|
+
let currentFile = null;
|
|
164
|
+
let currentFileLines = [];
|
|
165
|
+
for (const line of lines) {
|
|
166
|
+
if (line.startsWith('diff --git')) {
|
|
167
|
+
if (currentFile) {
|
|
168
|
+
currentFile.changes = currentFileLines.join('\n');
|
|
169
|
+
files.push(currentFile);
|
|
170
|
+
}
|
|
171
|
+
const fileMatch = line.match(/b\/(.+)$/);
|
|
172
|
+
currentFile = {
|
|
173
|
+
file: fileMatch ? fileMatch[1] : '',
|
|
174
|
+
additions: 0,
|
|
175
|
+
deletions: 0,
|
|
176
|
+
changes: ''
|
|
177
|
+
};
|
|
178
|
+
currentFileLines = [];
|
|
179
|
+
}
|
|
180
|
+
else if (line.startsWith('+') && !line.startsWith('+++')) {
|
|
181
|
+
if (currentFile)
|
|
182
|
+
currentFile.additions++;
|
|
183
|
+
currentFileLines.push(line);
|
|
184
|
+
}
|
|
185
|
+
else if (line.startsWith('-') && !line.startsWith('---')) {
|
|
186
|
+
if (currentFile)
|
|
187
|
+
currentFile.deletions++;
|
|
188
|
+
currentFileLines.push(line);
|
|
189
|
+
}
|
|
190
|
+
else if (line.startsWith('@@') || line.startsWith('---') || line.startsWith('+++') || line.trim() === '') {
|
|
191
|
+
// Include git diff headers and context lines
|
|
192
|
+
currentFileLines.push(line);
|
|
193
|
+
}
|
|
194
|
+
else if (line.startsWith(' ')) {
|
|
195
|
+
// Context lines (unchanged)
|
|
196
|
+
currentFileLines.push(line);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (currentFile) {
|
|
200
|
+
currentFile.changes = currentFileLines.join('\n');
|
|
201
|
+
files.push(currentFile);
|
|
202
|
+
}
|
|
203
|
+
return files;
|
|
204
|
+
}
|
|
205
|
+
parseBlame(blame) {
|
|
206
|
+
const lines = [];
|
|
207
|
+
const blameLines = blame.split('\n');
|
|
208
|
+
let currentLine = null;
|
|
209
|
+
for (const line of blameLines) {
|
|
210
|
+
if (line.startsWith('author ')) {
|
|
211
|
+
if (currentLine) {
|
|
212
|
+
lines.push(currentLine);
|
|
213
|
+
}
|
|
214
|
+
const hash = blameLines[blameLines.indexOf(line) - 1].split(' ')[0];
|
|
215
|
+
const author = line.substring(7);
|
|
216
|
+
const dateLine = blameLines[blameLines.indexOf(line) + 1];
|
|
217
|
+
const date = dateLine.startsWith('author-time ')
|
|
218
|
+
? new Date(parseInt(dateLine.substring(12)) * 1000).toISOString()
|
|
219
|
+
: '';
|
|
220
|
+
currentLine = {
|
|
221
|
+
line: lines.length + 1,
|
|
222
|
+
hash,
|
|
223
|
+
author,
|
|
224
|
+
date,
|
|
225
|
+
content: ''
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
else if (line.startsWith('\t') && currentLine) {
|
|
229
|
+
currentLine.content = line.substring(1);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (currentLine) {
|
|
233
|
+
lines.push(currentLine);
|
|
234
|
+
}
|
|
235
|
+
return lines;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
exports.GitService = GitService;
|
|
239
|
+
//# sourceMappingURL=gitService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitService.js","sourceRoot":"","sources":["../../src/backend/gitService.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+E;AAoC/E,MAAa,UAAU;IAGrB;QACE,IAAI,CAAC,GAAG,GAAG,IAAA,oBAAS,GAAE,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,UAAsB,EAAE;QACvC,IAAI,CAAC;YACH,MAAM,UAAU,GAAG;gBACjB,QAAQ,EAAE,OAAO,CAAC,KAAK,IAAI,GAAG;aAC/B,CAAC;YAEF,IAAI,GAAgC,CAAC;YAErC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;gBACjB,GAAG,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;oBACvB,GAAG,UAAU;oBACb,IAAI,EAAE,OAAO,CAAC,IAAI;iBACnB,CAAC,CAAC;YACL,CAAC;iBAAM,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBACzB,GAAG,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;oBACvB,GAAG,UAAU;oBACb,IAAI,EAAE,OAAO,CAAC,KAAK;iBACpB,CAAC,CAAC;YACL,CAAC;iBAAM,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;gBAC1B,GAAG,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;oBACvB,GAAG,UAAU;oBACb,MAAM,EAAE,OAAO,CAAC,MAAM;iBACvB,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,GAAG,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACvC,CAAC;YAED,MAAM,OAAO,GAAa,MAAM,OAAO,CAAC,GAA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C,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE;oBACjE,CAAC,CAAC,EAAE,CAAC;gBAEP,WAAW,GAAG;oBACZ,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;oBACtB,IAAI;oBACJ,MAAM;oBACN,IAAI;oBACJ,OAAO,EAAE,EAAE;iBACZ,CAAC;YACJ,CAAC;iBAAM,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,WAAW,EAAE,CAAC;gBAChD,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC;QAED,IAAI,WAAW,EAAE,CAAC;YAChB,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1B,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAhPD,gCAgPC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ServerOptions {
|
|
2
|
+
port?: number;
|
|
3
|
+
host?: string;
|
|
4
|
+
file?: string;
|
|
5
|
+
since?: string;
|
|
6
|
+
author?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function startServer(port?: number, host?: string, options?: Partial<ServerOptions>): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/backend/server.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,WAAW,CAC/B,IAAI,GAAE,MAAa,EACnB,IAAI,GAAE,MAAoB,EAC1B,OAAO,GAAE,OAAO,CAAC,aAAa,CAAM,iBAiHrC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.startServer = startServer;
|
|
7
|
+
const express_1 = __importDefault(require("express"));
|
|
8
|
+
const cors_1 = __importDefault(require("cors"));
|
|
9
|
+
const http_1 = require("http");
|
|
10
|
+
const socket_io_1 = require("socket.io");
|
|
11
|
+
const path_1 = __importDefault(require("path"));
|
|
12
|
+
const gitService_1 = require("./gitService");
|
|
13
|
+
async function startServer(port = 3000, host = 'localhost', options = {}) {
|
|
14
|
+
const app = (0, express_1.default)();
|
|
15
|
+
const server = (0, http_1.createServer)(app);
|
|
16
|
+
const io = new socket_io_1.Server(server, {
|
|
17
|
+
cors: {
|
|
18
|
+
origin: "*",
|
|
19
|
+
methods: ["GET", "POST"]
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const gitService = new gitService_1.GitService();
|
|
23
|
+
// Middleware
|
|
24
|
+
app.use((0, cors_1.default)());
|
|
25
|
+
app.use(express_1.default.json());
|
|
26
|
+
// Serve Angular build files
|
|
27
|
+
app.use(express_1.default.static(path_1.default.join(__dirname, '../../frontend/dist/frontend/browser')));
|
|
28
|
+
// Serve public folder as fallback
|
|
29
|
+
app.use(express_1.default.static(path_1.default.join(__dirname, '../../public')));
|
|
30
|
+
// API Routes
|
|
31
|
+
app.get('/api/commits', async (req, res) => {
|
|
32
|
+
try {
|
|
33
|
+
const { file, since, author, limit = '100' } = req.query;
|
|
34
|
+
const commits = await gitService.getCommits({
|
|
35
|
+
file: file,
|
|
36
|
+
since: since,
|
|
37
|
+
author: author,
|
|
38
|
+
limit: parseInt(limit)
|
|
39
|
+
});
|
|
40
|
+
res.json(commits);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
44
|
+
res.status(500).json({ error: errorMessage });
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
app.get('/api/commit/:hash', async (req, res) => {
|
|
48
|
+
try {
|
|
49
|
+
const { hash } = req.params;
|
|
50
|
+
const commit = await gitService.getCommit(hash);
|
|
51
|
+
res.json(commit);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
55
|
+
res.status(500).json({ error: errorMessage });
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
app.get('/api/diff/:hash', async (req, res) => {
|
|
59
|
+
try {
|
|
60
|
+
const { hash } = req.params;
|
|
61
|
+
const diff = await gitService.getDiff(hash);
|
|
62
|
+
res.json(diff);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
66
|
+
res.status(500).json({ error: errorMessage });
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
app.get('/api/blame/:file', async (req, res) => {
|
|
70
|
+
try {
|
|
71
|
+
const { file } = req.params;
|
|
72
|
+
const blame = await gitService.getBlame(file);
|
|
73
|
+
res.json(blame);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
77
|
+
res.status(500).json({ error: errorMessage });
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
app.get('/api/tags', async (req, res) => {
|
|
81
|
+
try {
|
|
82
|
+
const tags = await gitService.getTags();
|
|
83
|
+
res.json(tags);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
87
|
+
res.status(500).json({ error: errorMessage });
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
app.get('/api/branches', async (req, res) => {
|
|
91
|
+
try {
|
|
92
|
+
const branches = await gitService.getBranches();
|
|
93
|
+
res.json(branches);
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
97
|
+
res.status(500).json({ error: errorMessage });
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
// Serve the main HTML file for Angular routing
|
|
101
|
+
app.get('*', (req, res) => {
|
|
102
|
+
res.sendFile(path_1.default.join(__dirname, '../../frontend/dist/frontend/browser/index.html'));
|
|
103
|
+
});
|
|
104
|
+
// Socket.IO for real-time updates
|
|
105
|
+
io.on('connection', (socket) => {
|
|
106
|
+
console.log('Client connected');
|
|
107
|
+
socket.on('disconnect', () => {
|
|
108
|
+
console.log('Client disconnected');
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
return new Promise((resolve) => {
|
|
112
|
+
server.listen(port, host, () => {
|
|
113
|
+
console.log(`Server running on http://${host}:${port}`);
|
|
114
|
+
resolve();
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/backend/server.ts"],"names":[],"mappings":";;;;;AAeA,kCAoHC;AAnID,sDAA8B;AAC9B,gDAAwB;AACxB,+BAAoC;AACpC,yCAAmC;AACnC,gDAAwB;AACxB,6CAA0C;AAUnC,KAAK,UAAU,WAAW,CAC/B,OAAe,IAAI,EACnB,OAAe,WAAW,EAC1B,UAAkC,EAAE;IAEpC,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;IACtB,MAAM,MAAM,GAAG,IAAA,mBAAY,EAAC,GAAG,CAAC,CAAC;IACjC,MAAM,EAAE,GAAG,IAAI,kBAAM,CAAC,MAAM,EAAE;QAC5B,IAAI,EAAE;YAC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""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const open_1 = __importDefault(require("open"));
|
|
10
|
+
const server_1 = require("./backend/server");
|
|
11
|
+
const program = new commander_1.Command();
|
|
12
|
+
program
|
|
13
|
+
.name('git-history-ui')
|
|
14
|
+
.description('Beautiful git history visualization in your browser')
|
|
15
|
+
.version('1.0.0');
|
|
16
|
+
program
|
|
17
|
+
.option('-p, --port <number>', 'port to run server on', '3000')
|
|
18
|
+
.option('-f, --file <path>', 'show history only for a specific file')
|
|
19
|
+
.option('-s, --since <ref>', 'show commits since a specific reference (e.g., v2.0.0)')
|
|
20
|
+
.option('-a, --author <name>', 'filter commits by author')
|
|
21
|
+
.option('--no-open', 'do not automatically open browser')
|
|
22
|
+
.option('--host <host>', 'host to bind to', 'localhost');
|
|
23
|
+
program.parse();
|
|
24
|
+
const options = program.opts();
|
|
25
|
+
async function main() {
|
|
26
|
+
try {
|
|
27
|
+
console.log(chalk_1.default.blue('🚀 Starting Git History UI...'));
|
|
28
|
+
const port = parseInt(options.port);
|
|
29
|
+
const serverUrl = `http://${options.host}:${port}`;
|
|
30
|
+
// Start the server
|
|
31
|
+
await (0, server_1.startServer)(port, options.host);
|
|
32
|
+
console.log(chalk_1.default.green(`✅ Server running at ${serverUrl}`));
|
|
33
|
+
if (options.open !== false) {
|
|
34
|
+
console.log(chalk_1.default.yellow('🌐 Opening browser...'));
|
|
35
|
+
await (0, open_1.default)(serverUrl);
|
|
36
|
+
}
|
|
37
|
+
console.log(chalk_1.default.cyan('\n📝 Usage:'));
|
|
38
|
+
console.log(chalk_1.default.white(' • Use the search bar to filter commits'));
|
|
39
|
+
console.log(chalk_1.default.white(' • Click on commits to view diffs'));
|
|
40
|
+
console.log(chalk_1.default.white(' • Use the graph view to see branch structure'));
|
|
41
|
+
console.log(chalk_1.default.white(' • Press Ctrl+C to stop the server'));
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error(chalk_1.default.red('❌ Error starting server:'), error);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
main();
|
|
49
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,kDAA0B;AAC1B,gDAAwB;AACxB,6CAA+C;AAE/C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,gBAAgB,CAAC;KACtB,WAAW,CAAC,qDAAqD,CAAC;KAClE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,MAAM,CAAC,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,CAAC;KAC9D,MAAM,CAAC,mBAAmB,EAAE,uCAAuC,CAAC;KACpE,MAAM,CAAC,mBAAmB,EAAE,wDAAwD,CAAC;KACrF,MAAM,CAAC,qBAAqB,EAAE,0BAA0B,CAAC;KACzD,MAAM,CAAC,WAAW,EAAE,mCAAmC,CAAC;KACxD,MAAM,CAAC,eAAe,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC;AAE3D,OAAO,CAAC,KAAK,EAAE,CAAC;AAEhB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;AAE/B,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,+BA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fig.org
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 2
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
|
|
11
|
+
[*.ts]
|
|
12
|
+
quote_type = single
|
|
13
|
+
ij_typescript_use_double_quotes = false
|
|
14
|
+
|
|
15
|
+
[*.md]
|
|
16
|
+
max_line_length = off
|
|
17
|
+
trim_trailing_whitespace = false
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"configurations": [
|
|
5
|
+
{
|
|
6
|
+
"name": "ng serve",
|
|
7
|
+
"type": "chrome",
|
|
8
|
+
"request": "launch",
|
|
9
|
+
"preLaunchTask": "npm: start",
|
|
10
|
+
"url": "http://localhost:4200/"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "ng test",
|
|
14
|
+
"type": "chrome",
|
|
15
|
+
"request": "launch",
|
|
16
|
+
"preLaunchTask": "npm: test",
|
|
17
|
+
"url": "http://localhost:9876/debug.html"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"tasks": [
|
|
5
|
+
{
|
|
6
|
+
"type": "npm",
|
|
7
|
+
"script": "start",
|
|
8
|
+
"isBackground": true,
|
|
9
|
+
"problemMatcher": {
|
|
10
|
+
"owner": "typescript",
|
|
11
|
+
"pattern": "$tsc",
|
|
12
|
+
"background": {
|
|
13
|
+
"activeOnStart": true,
|
|
14
|
+
"beginsPattern": {
|
|
15
|
+
"regexp": "(.*?)"
|
|
16
|
+
},
|
|
17
|
+
"endsPattern": {
|
|
18
|
+
"regexp": "bundle generation complete"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "npm",
|
|
25
|
+
"script": "test",
|
|
26
|
+
"isBackground": true,
|
|
27
|
+
"problemMatcher": {
|
|
28
|
+
"owner": "typescript",
|
|
29
|
+
"pattern": "$tsc",
|
|
30
|
+
"background": {
|
|
31
|
+
"activeOnStart": true,
|
|
32
|
+
"beginsPattern": {
|
|
33
|
+
"regexp": "(.*?)"
|
|
34
|
+
},
|
|
35
|
+
"endsPattern": {
|
|
36
|
+
"regexp": "bundle generation complete"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Frontend
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.2.0.
|
|
4
|
+
|
|
5
|
+
## Development server
|
|
6
|
+
|
|
7
|
+
To start a local development server, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng serve
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
|
14
|
+
|
|
15
|
+
## Code scaffolding
|
|
16
|
+
|
|
17
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
ng generate component component-name
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
ng generate --help
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Building
|
|
30
|
+
|
|
31
|
+
To build the project run:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
ng build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
|
|
38
|
+
|
|
39
|
+
## Running unit tests
|
|
40
|
+
|
|
41
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
ng test
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Running end-to-end tests
|
|
48
|
+
|
|
49
|
+
For end-to-end (e2e) testing, run:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
ng e2e
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
56
|
+
|
|
57
|
+
## Additional Resources
|
|
58
|
+
|
|
59
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|