git-history-ui 1.0.5 → 2.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/CHANGELOG.md +51 -0
- package/README.md +7 -0
- package/build/frontend/index.html +13 -10
- package/build/frontend/main-7AXSFTJM.js +11 -0
- package/build/frontend/styles-YQ73RJ2V.css +1 -0
- package/dist/backend/dev-server.d.ts +0 -1
- package/dist/backend/dev-server.js +8 -4
- package/dist/backend/dev-server.js.map +1 -1
- package/dist/backend/gitService.d.ts +36 -11
- package/dist/backend/gitService.js +341 -197
- package/dist/backend/gitService.js.map +1 -1
- package/dist/backend/server.d.ts +8 -2
- package/dist/backend/server.js +145 -111
- package/dist/backend/server.js.map +1 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +44 -22
- package/dist/cli.js.map +1 -1
- package/package.json +43 -27
- package/build/frontend/main-44CFNHDH.js +0 -8
- package/build/frontend/main-YHO6NCZZ.js +0 -8
- package/build/frontend/styles-26JPPBSI.css +0 -1
- package/build/frontend/styles-J5I4DBTU.css +0 -1
- package/dist/__tests__/gitService.test.d.ts +0 -2
- package/dist/__tests__/gitService.test.d.ts.map +0 -1
- package/dist/__tests__/gitService.test.js +0 -427
- package/dist/__tests__/gitService.test.js.map +0 -1
- package/dist/__tests__/setup.d.ts +0 -2
- package/dist/__tests__/setup.d.ts.map +0 -1
- package/dist/__tests__/setup.js +0 -24
- package/dist/__tests__/setup.js.map +0 -1
- package/dist/backend/dev-server.d.ts.map +0 -1
- package/dist/backend/gitService.d.ts.map +0 -1
- package/dist/backend/server.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/config/paths.d.ts +0 -14
- package/dist/config/paths.d.ts.map +0 -1
- package/dist/config/paths.js +0 -35
- package/dist/config/paths.js.map +0 -1
package/dist/backend/server.js
CHANGED
|
@@ -6,133 +6,167 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.startServer = startServer;
|
|
7
7
|
const express_1 = __importDefault(require("express"));
|
|
8
8
|
const cors_1 = __importDefault(require("cors"));
|
|
9
|
+
const helmet_1 = __importDefault(require("helmet"));
|
|
10
|
+
const compression_1 = __importDefault(require("compression"));
|
|
11
|
+
const express_rate_limit_1 = __importDefault(require("express-rate-limit"));
|
|
9
12
|
const http_1 = require("http");
|
|
10
|
-
const socket_io_1 = require("socket.io");
|
|
11
13
|
const path_1 = __importDefault(require("path"));
|
|
14
|
+
const fs_1 = __importDefault(require("fs"));
|
|
12
15
|
const gitService_1 = require("./gitService");
|
|
13
|
-
|
|
16
|
+
const DEFAULT_PORT = 3000;
|
|
17
|
+
const DEFAULT_HOST = 'localhost';
|
|
18
|
+
async function startServer(port = DEFAULT_PORT, host = DEFAULT_HOST, options = {}) {
|
|
19
|
+
const cwd = options.cwd ?? process.cwd();
|
|
14
20
|
const app = (0, express_1.default)();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
app.disable('x-powered-by');
|
|
22
|
+
app.set('trust proxy', 'loopback');
|
|
23
|
+
app.use((0, helmet_1.default)({
|
|
24
|
+
contentSecurityPolicy: false,
|
|
25
|
+
crossOriginEmbedderPolicy: false,
|
|
26
|
+
crossOriginResourcePolicy: { policy: 'same-origin' }
|
|
27
|
+
}));
|
|
28
|
+
app.use((0, cors_1.default)({
|
|
29
|
+
origin: (origin, cb) => {
|
|
30
|
+
if (!origin)
|
|
31
|
+
return cb(null, true);
|
|
32
|
+
if (/^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/.test(origin)) {
|
|
33
|
+
return cb(null, true);
|
|
34
|
+
}
|
|
35
|
+
return cb(new Error('CORS not allowed'), false);
|
|
36
|
+
},
|
|
37
|
+
methods: ['GET'],
|
|
38
|
+
allowedHeaders: ['Content-Type', 'X-Requested-With']
|
|
39
|
+
}));
|
|
40
|
+
app.use((0, compression_1.default)());
|
|
41
|
+
app.use(express_1.default.json({ limit: '128kb' }));
|
|
42
|
+
const apiLimiter = (0, express_rate_limit_1.default)({
|
|
43
|
+
windowMs: 60_000,
|
|
44
|
+
max: 600,
|
|
45
|
+
standardHeaders: true,
|
|
46
|
+
legacyHeaders: false
|
|
27
47
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
app.use((0, cors_1.default)(corsOptions));
|
|
31
|
-
app.use(express_1.default.json());
|
|
32
|
-
// Check if Angular build exists, otherwise use public folder
|
|
48
|
+
app.use('/api', apiLimiter);
|
|
49
|
+
const gitService = new gitService_1.GitService(cwd);
|
|
33
50
|
const angularBuildPath = path_1.default.join(__dirname, '../../build/frontend');
|
|
34
51
|
const publicPath = path_1.default.join(__dirname, '../../public');
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// Serve public folder as fallback
|
|
41
|
-
app.use(express_1.default.static(publicPath));
|
|
42
|
-
}
|
|
43
|
-
// API Routes
|
|
44
|
-
app.get('/api/commits', async (req, res) => {
|
|
45
|
-
try {
|
|
46
|
-
const { file, since, author, limit = '100' } = req.query;
|
|
47
|
-
const commits = await gitService.getCommits({
|
|
48
|
-
file: file,
|
|
49
|
-
since: since,
|
|
50
|
-
author: author,
|
|
51
|
-
limit: parseInt(limit)
|
|
52
|
-
});
|
|
53
|
-
res.json(commits);
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
57
|
-
res.status(500).json({ error: errorMessage });
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
app.get('/api/commit/:hash', async (req, res) => {
|
|
61
|
-
try {
|
|
62
|
-
const { hash } = req.params;
|
|
63
|
-
const commit = await gitService.getCommit(hash);
|
|
64
|
-
res.json(commit);
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
68
|
-
res.status(500).json({ error: errorMessage });
|
|
69
|
-
}
|
|
52
|
+
const staticDir = fs_1.default.existsSync(angularBuildPath) ? angularBuildPath : publicPath;
|
|
53
|
+
const indexFile = path_1.default.join(staticDir, 'index.html');
|
|
54
|
+
app.use(express_1.default.static(staticDir, { etag: true, maxAge: '1h' }));
|
|
55
|
+
app.get('/api/health', (_req, res) => {
|
|
56
|
+
res.json({ status: 'ok', uptime: process.uptime(), pid: process.pid });
|
|
70
57
|
});
|
|
71
|
-
app.get('/api/
|
|
72
|
-
|
|
73
|
-
const { hash } = req.params;
|
|
74
|
-
const diff = await gitService.getDiff(hash);
|
|
75
|
-
res.json(diff);
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
79
|
-
res.status(500).json({ error: errorMessage });
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
app.get('/api/blame/:file', async (req, res) => {
|
|
83
|
-
try {
|
|
84
|
-
const { file } = req.params;
|
|
85
|
-
const blame = await gitService.getBlame(file);
|
|
86
|
-
res.json(blame);
|
|
87
|
-
}
|
|
88
|
-
catch (error) {
|
|
89
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
90
|
-
res.status(500).json({ error: errorMessage });
|
|
91
|
-
}
|
|
58
|
+
app.get('/api/version', (_req, res) => {
|
|
59
|
+
res.json({ name: 'git-history-ui', version: pkgVersion() });
|
|
92
60
|
});
|
|
93
|
-
app.get('/api/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
61
|
+
app.get('/api/commits', wrap(async (req, res) => {
|
|
62
|
+
const result = await gitService.getCommits({
|
|
63
|
+
file: stringParam(req.query.file),
|
|
64
|
+
since: stringParam(req.query.since),
|
|
65
|
+
until: stringParam(req.query.until),
|
|
66
|
+
author: stringParam(req.query.author),
|
|
67
|
+
search: stringParam(req.query.search ?? req.query.q),
|
|
68
|
+
page: numberParam(req.query.page, 1),
|
|
69
|
+
pageSize: numberParam(req.query.pageSize, 25)
|
|
70
|
+
});
|
|
71
|
+
res.json(result);
|
|
72
|
+
}));
|
|
73
|
+
app.get('/api/commit/:hash', wrap(async (req, res) => {
|
|
74
|
+
const commit = await gitService.getCommit(req.params.hash);
|
|
75
|
+
res.json(commit);
|
|
76
|
+
}));
|
|
77
|
+
app.get('/api/diff/:hash', wrap(async (req, res) => {
|
|
78
|
+
const diff = await gitService.getDiff(req.params.hash);
|
|
79
|
+
res.json(diff);
|
|
80
|
+
}));
|
|
81
|
+
app.get('/api/blame', wrap(async (req, res) => {
|
|
82
|
+
const file = stringParam(req.query.file);
|
|
83
|
+
if (!file) {
|
|
84
|
+
res.status(400).json({ error: 'file query param is required' });
|
|
85
|
+
return;
|
|
101
86
|
}
|
|
87
|
+
const blame = await gitService.getBlame(file);
|
|
88
|
+
res.json(blame);
|
|
89
|
+
}));
|
|
90
|
+
app.get('/api/tags', wrap(async (_req, res) => res.json(await gitService.getTags())));
|
|
91
|
+
app.get('/api/branches', wrap(async (_req, res) => res.json(await gitService.getBranches())));
|
|
92
|
+
app.get('/api/authors', wrap(async (_req, res) => res.json(await gitService.getAuthors())));
|
|
93
|
+
app.all('/api/*', (_req, res) => {
|
|
94
|
+
res.status(404).json({ error: 'Not Found' });
|
|
102
95
|
});
|
|
103
|
-
app.get('
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
110
|
-
res.status(500).json({ error: errorMessage });
|
|
111
|
-
}
|
|
96
|
+
app.get('*', (_req, res) => {
|
|
97
|
+
res.sendFile(indexFile, (err) => {
|
|
98
|
+
if (err)
|
|
99
|
+
res.status(404).end();
|
|
100
|
+
});
|
|
112
101
|
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (require('fs').existsSync(angularIndexPath)) {
|
|
118
|
-
res.sendFile(angularIndexPath);
|
|
102
|
+
app.use((err, _req, res, _next) => {
|
|
103
|
+
if (err instanceof gitService_1.NotARepositoryError) {
|
|
104
|
+
res.status(400).json({ error: err.message });
|
|
105
|
+
return;
|
|
119
106
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
// Socket.IO for real-time updates
|
|
125
|
-
io.on('connection', (socket) => {
|
|
126
|
-
console.log('Client connected');
|
|
127
|
-
socket.on('disconnect', () => {
|
|
128
|
-
console.log('Client disconnected');
|
|
129
|
-
});
|
|
107
|
+
const message = err instanceof Error ? err.message : 'Unknown error';
|
|
108
|
+
// eslint-disable-next-line no-console
|
|
109
|
+
console.error('API error:', message);
|
|
110
|
+
res.status(500).json({ error: message });
|
|
130
111
|
});
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
112
|
+
const httpServer = (0, http_1.createServer)(app);
|
|
113
|
+
await new Promise((resolve, reject) => {
|
|
114
|
+
httpServer.once('error', reject);
|
|
115
|
+
httpServer.listen(port, host, () => {
|
|
116
|
+
httpServer.off('error', reject);
|
|
134
117
|
resolve();
|
|
135
118
|
});
|
|
136
119
|
});
|
|
120
|
+
const url = `http://${host}:${port}`;
|
|
121
|
+
const close = () => new Promise((resolve) => {
|
|
122
|
+
httpServer.close(() => resolve());
|
|
123
|
+
setTimeout(() => resolve(), 5_000).unref();
|
|
124
|
+
});
|
|
125
|
+
return { server: httpServer, url, close };
|
|
126
|
+
}
|
|
127
|
+
function wrap(handler) {
|
|
128
|
+
return (req, res, next) => {
|
|
129
|
+
handler(req, res, next).catch(next);
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function stringParam(v) {
|
|
133
|
+
if (typeof v === 'string' && v.length > 0)
|
|
134
|
+
return v;
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
function numberParam(v, fallback) {
|
|
138
|
+
const n = typeof v === 'string' ? parseInt(v, 10) : NaN;
|
|
139
|
+
return Number.isFinite(n) ? n : fallback;
|
|
140
|
+
}
|
|
141
|
+
function pkgVersion() {
|
|
142
|
+
try {
|
|
143
|
+
const raw = fs_1.default.readFileSync(path_1.default.join(__dirname, '..', '..', 'package.json'), 'utf8');
|
|
144
|
+
return JSON.parse(raw).version;
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return '0.0.0';
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (require.main === module) {
|
|
151
|
+
const port = parseInt(process.env.PORT || '', 10) || DEFAULT_PORT;
|
|
152
|
+
const host = process.env.HOST || DEFAULT_HOST;
|
|
153
|
+
startServer(port, host)
|
|
154
|
+
.then(({ url, close }) => {
|
|
155
|
+
// eslint-disable-next-line no-console
|
|
156
|
+
console.log(`git-history-ui listening on ${url}`);
|
|
157
|
+
const shutdown = (sig) => {
|
|
158
|
+
// eslint-disable-next-line no-console
|
|
159
|
+
console.log(`\nReceived ${sig}, shutting down...`);
|
|
160
|
+
close().then(() => process.exit(0));
|
|
161
|
+
setTimeout(() => process.exit(1), 10_000).unref();
|
|
162
|
+
};
|
|
163
|
+
process.on('SIGINT', () => shutdown('SIGINT'));
|
|
164
|
+
process.on('SIGTERM', () => shutdown('SIGTERM'));
|
|
165
|
+
})
|
|
166
|
+
.catch((err) => {
|
|
167
|
+
// eslint-disable-next-line no-console
|
|
168
|
+
console.error('Failed to start server:', err);
|
|
169
|
+
process.exit(1);
|
|
170
|
+
});
|
|
137
171
|
}
|
|
138
172
|
//# sourceMappingURL=server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/backend/server.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/backend/server.ts"],"names":[],"mappings":";;;;;AA4BA,kCAsJC;AA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AAC;QACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC/C,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACb,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -7,43 +7,65 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const commander_1 = require("commander");
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const open_1 = __importDefault(require("open"));
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const path_1 = require("path");
|
|
10
12
|
const server_1 = require("./backend/server");
|
|
13
|
+
const pkg = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '..', 'package.json'), 'utf8'));
|
|
11
14
|
const program = new commander_1.Command();
|
|
12
15
|
program
|
|
13
16
|
.name('git-history-ui')
|
|
14
17
|
.description('Beautiful git history visualization in your browser')
|
|
15
|
-
.version(
|
|
16
|
-
program
|
|
18
|
+
.version(pkg.version, '-v, --version', 'output the version number')
|
|
17
19
|
.option('-p, --port <number>', 'port to run server on', '3000')
|
|
18
|
-
.option('-
|
|
19
|
-
.option('-
|
|
20
|
+
.option('-H, --host <host>', 'host to bind to', 'localhost')
|
|
21
|
+
.option('-f, --file <path>', 'filter commits by a specific file')
|
|
22
|
+
.option('-s, --since <date>', 'filter commits since a date (YYYY-MM-DD)')
|
|
20
23
|
.option('-a, --author <name>', 'filter commits by author')
|
|
21
24
|
.option('--no-open', 'do not automatically open browser')
|
|
22
|
-
.option('--
|
|
23
|
-
|
|
25
|
+
.option('--cwd <path>', 'path to the git repository (defaults to cwd)')
|
|
26
|
+
.parse();
|
|
24
27
|
const options = program.opts();
|
|
25
28
|
async function main() {
|
|
29
|
+
const port = parseInt(options.port, 10);
|
|
30
|
+
if (!Number.isFinite(port) || port < 1 || port > 65535) {
|
|
31
|
+
console.error(chalk_1.default.red(`Invalid port: ${options.port}`));
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
console.log(chalk_1.default.blue('Starting git-history-ui...'));
|
|
35
|
+
let close = () => Promise.resolve();
|
|
26
36
|
try {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
const result = await (0, server_1.startServer)(port, options.host, {
|
|
38
|
+
file: options.file,
|
|
39
|
+
since: options.since,
|
|
40
|
+
author: options.author,
|
|
41
|
+
cwd: options.cwd
|
|
42
|
+
});
|
|
43
|
+
close = result.close;
|
|
44
|
+
console.log(chalk_1.default.green(`Listening on ${result.url}`));
|
|
45
|
+
if (options.open) {
|
|
46
|
+
try {
|
|
47
|
+
await (0, open_1.default)(result.url);
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
console.log(chalk_1.default.yellow(`(Could not open browser automatically — visit ${result.url})`));
|
|
51
|
+
}
|
|
36
52
|
}
|
|
37
|
-
console.log(chalk_1.default.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
console.log(chalk_1.default.white(' • Press Ctrl+C to stop the server'));
|
|
53
|
+
console.log(chalk_1.default.gray('\nTips:\n' +
|
|
54
|
+
' • Press Cmd/Ctrl+K in the UI to open the command palette\n' +
|
|
55
|
+
' • Press ? to view keyboard shortcuts\n' +
|
|
56
|
+
' • Press Ctrl+C to stop the server\n'));
|
|
42
57
|
}
|
|
43
|
-
catch (
|
|
44
|
-
console.error(chalk_1.default.red('
|
|
58
|
+
catch (err) {
|
|
59
|
+
console.error(chalk_1.default.red('Failed to start server:'), err instanceof Error ? err.message : err);
|
|
45
60
|
process.exit(1);
|
|
46
61
|
}
|
|
62
|
+
const shutdown = (signal) => {
|
|
63
|
+
console.log(chalk_1.default.gray(`\n${signal} received, shutting down...`));
|
|
64
|
+
close().finally(() => process.exit(0));
|
|
65
|
+
setTimeout(() => process.exit(1), 10_000).unref();
|
|
66
|
+
};
|
|
67
|
+
process.on('SIGINT', () => shutdown('SIGINT'));
|
|
68
|
+
process.on('SIGTERM', () => shutdown('SIGTERM'));
|
|
47
69
|
}
|
|
48
70
|
main();
|
|
49
71
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,kDAA0B;AAC1B,gDAAwB;AACxB,2BAAkC;AAClC,+BAA4B;AAC5B,6CAA+C;AAE/C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CACrC,CAAC;AAEzB,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,gBAAgB,CAAC;KACtB,WAAW,CAAC,qDAAqD,CAAC;K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CAAC;IACpD,CAAC,CAAC;IACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-history-ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Beautiful git history visualization in your browser",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Beautiful, fast git history visualization in your browser \u2014 with deterministic swim-lane graphs, virtualized diffs, and a command palette.",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"git-history-ui": "dist/cli.js"
|
|
@@ -9,24 +9,32 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"dist/**/*",
|
|
11
11
|
"build/**/*",
|
|
12
|
-
"public/**/*"
|
|
12
|
+
"public/**/*",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE",
|
|
15
|
+
"CHANGELOG.md"
|
|
13
16
|
],
|
|
14
17
|
"scripts": {
|
|
15
18
|
"build": "npm run build:backend && npm run build:frontend && npm run copy-frontend",
|
|
16
19
|
"build:backend": "tsc -p tsconfig.json",
|
|
17
|
-
"build:frontend": "
|
|
20
|
+
"build:frontend": "npm run --prefix frontend -s build -- --configuration production",
|
|
18
21
|
"build:production": "NODE_ENV=production npm run build",
|
|
19
|
-
"dev": "concurrently \"npm
|
|
22
|
+
"dev": "concurrently -n backend,frontend -c blue,magenta \"npm:dev:backend\" \"npm:dev:frontend\"",
|
|
20
23
|
"dev:backend": "ts-node-dev --respawn --transpile-only src/backend/dev-server.ts",
|
|
21
|
-
"dev:frontend": "
|
|
24
|
+
"dev:frontend": "npm run --prefix frontend start -- --port 4200 --proxy-config proxy.conf.json",
|
|
22
25
|
"start": "node dist/backend/server.js",
|
|
23
26
|
"start:production": "NODE_ENV=production node dist/backend/server.js",
|
|
24
27
|
"test": "jest",
|
|
25
28
|
"test:coverage": "jest --coverage",
|
|
26
29
|
"test:watch": "jest --watch",
|
|
27
|
-
"lint": "eslint src/**/*.ts",
|
|
30
|
+
"lint": "eslint \"src/**/*.ts\"",
|
|
31
|
+
"lint:fix": "eslint \"src/**/*.ts\" --fix",
|
|
32
|
+
"format": "prettier --write \"src/**/*.{ts,js}\" \"frontend/src/**/*.{ts,html,css}\"",
|
|
33
|
+
"format:check": "prettier --check \"src/**/*.{ts,js}\" \"frontend/src/**/*.{ts,html,css}\"",
|
|
34
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
35
|
+
"clean": "rm -rf dist build coverage frontend/dist frontend/.angular",
|
|
28
36
|
"copy-frontend": "mkdir -p build/frontend && cp -r frontend/dist/frontend/browser/* build/frontend/",
|
|
29
|
-
"
|
|
37
|
+
"prepublishOnly": "npm run clean && npm run lint && npm run typecheck && npm test -- --ci && npm run build"
|
|
30
38
|
},
|
|
31
39
|
"keywords": [
|
|
32
40
|
"git",
|
|
@@ -37,41 +45,49 @@
|
|
|
37
45
|
"commit",
|
|
38
46
|
"graph",
|
|
39
47
|
"diff",
|
|
40
|
-
"angular"
|
|
48
|
+
"angular",
|
|
49
|
+
"developer-tools",
|
|
50
|
+
"git-graph",
|
|
51
|
+
"git-log",
|
|
52
|
+
"command-palette"
|
|
41
53
|
],
|
|
42
|
-
"author": "
|
|
54
|
+
"author": "Ankit Sharma <ankit.sharma199803@gmail.com>",
|
|
43
55
|
"license": "MIT",
|
|
44
56
|
"dependencies": {
|
|
45
|
-
"chalk": "^
|
|
46
|
-
"commander": "^
|
|
57
|
+
"chalk": "^4.1.2",
|
|
58
|
+
"commander": "^12.1.0",
|
|
59
|
+
"compression": "^1.7.4",
|
|
47
60
|
"cors": "^2.8.5",
|
|
48
|
-
"express": "^4.
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
61
|
+
"express": "^4.21.0",
|
|
62
|
+
"express-rate-limit": "^7.4.0",
|
|
63
|
+
"helmet": "^8.0.0",
|
|
64
|
+
"open": "^8.4.2"
|
|
52
65
|
},
|
|
53
66
|
"devDependencies": {
|
|
54
|
-
"@types/
|
|
67
|
+
"@types/compression": "^1.7.5",
|
|
55
68
|
"@types/cors": "^2.8.17",
|
|
56
69
|
"@types/express": "^4.17.21",
|
|
57
|
-
"@types/jest": "^29.5.
|
|
58
|
-
"@types/node": "^20.10
|
|
59
|
-
"@types/
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
61
|
-
"@typescript-eslint/parser": "^
|
|
62
|
-
"concurrently": "^
|
|
63
|
-
"eslint": "^8.
|
|
70
|
+
"@types/jest": "^29.5.13",
|
|
71
|
+
"@types/node": "^20.16.10",
|
|
72
|
+
"@types/supertest": "^6.0.2",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^8.8.0",
|
|
74
|
+
"@typescript-eslint/parser": "^8.8.0",
|
|
75
|
+
"concurrently": "^9.0.0",
|
|
76
|
+
"eslint": "^8.57.1",
|
|
77
|
+
"eslint-config-prettier": "^9.1.0",
|
|
64
78
|
"jest": "^29.7.0",
|
|
65
|
-
"
|
|
79
|
+
"prettier": "^3.3.3",
|
|
80
|
+
"supertest": "^7.0.0",
|
|
81
|
+
"ts-jest": "^29.2.5",
|
|
66
82
|
"ts-node-dev": "^2.0.0",
|
|
67
|
-
"typescript": "^5.
|
|
83
|
+
"typescript": "^5.6.2"
|
|
68
84
|
},
|
|
69
85
|
"engines": {
|
|
70
86
|
"node": ">=18.0.0"
|
|
71
87
|
},
|
|
72
88
|
"repository": {
|
|
73
89
|
"type": "git",
|
|
74
|
-
"url": "https://github.com/beingmartinbmc/git-history-ui.git"
|
|
90
|
+
"url": "git+https://github.com/beingmartinbmc/git-history-ui.git"
|
|
75
91
|
},
|
|
76
92
|
"bugs": {
|
|
77
93
|
"url": "https://github.com/beingmartinbmc/git-history-ui/issues"
|