git-tm 1.1.1 → 1.1.2
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.md +1 -1
- package/package.json +2 -2
- package/src/cli.js +9 -7
- package/src/public/app.css +1 -1
- package/src/public/js/insights.js +2 -2
package/README.md
CHANGED
|
@@ -153,7 +153,7 @@ cd Git-Time-Machine
|
|
|
153
153
|
node src/cli.js .
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
Run the tests with `npm test`. See [CONTRIBUTING.md](CONTRIBUTING.md) for how the project is organised, its principles and how to send a pull request.
|
|
156
|
+
Run the tests with `npm test`. Questions and ideas are welcome in [Discussions](https://github.com/nandhu-44/Git-Time-Machine/discussions). See [CONTRIBUTING.md](CONTRIBUTING.md) for how the project is organised, its principles and how to send a pull request.
|
|
157
157
|
|
|
158
158
|
## Background
|
|
159
159
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-tm",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Explore any Git repository in your browser: commit graph, diffs, blame, insights and time travel between any two commits. Zero dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"scripts": {
|
|
34
34
|
"start": "node src/cli.js",
|
|
35
|
-
"test": "node --test
|
|
35
|
+
"test": "node --test"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=18.3"
|
package/src/cli.js
CHANGED
|
@@ -114,6 +114,15 @@ async function main() {
|
|
|
114
114
|
fail(`Could not start server: ${err.message}`);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
// Handle Ctrl+C and SIGTERM before printing the address, so a signal that
|
|
118
|
+
// arrives right after startup still shuts down cleanly with exit code 0.
|
|
119
|
+
const stop = () => {
|
|
120
|
+
server.close();
|
|
121
|
+
process.exit(0);
|
|
122
|
+
};
|
|
123
|
+
process.on("SIGINT", stop);
|
|
124
|
+
process.on("SIGTERM", stop);
|
|
125
|
+
|
|
117
126
|
const shownHost = ["127.0.0.1", "::1", "0.0.0.0", "::"].includes(values.host) ? "localhost" : values.host;
|
|
118
127
|
const url = `http://${shownHost}:${actual}`;
|
|
119
128
|
const info = await repo.info().catch(() => ({}));
|
|
@@ -135,13 +144,6 @@ async function main() {
|
|
|
135
144
|
const report = (err) => console.error(`${c.red("error")} ${err?.stack || err}`);
|
|
136
145
|
process.on("uncaughtException", report);
|
|
137
146
|
process.on("unhandledRejection", report);
|
|
138
|
-
|
|
139
|
-
const stop = () => {
|
|
140
|
-
server.close();
|
|
141
|
-
process.exit(0);
|
|
142
|
-
};
|
|
143
|
-
process.on("SIGINT", stop);
|
|
144
|
-
process.on("SIGTERM", stop);
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
main();
|
package/src/public/app.css
CHANGED
|
@@ -50,7 +50,7 @@ function heatmap(days, endTs) {
|
|
|
50
50
|
|
|
51
51
|
function punchcard(punch) {
|
|
52
52
|
const max = Math.max(1, ...punch.flat());
|
|
53
|
-
const cw =
|
|
53
|
+
const cw = 16;
|
|
54
54
|
const rh = 24;
|
|
55
55
|
const w = 40 + 24 * cw + 12; // room for the last hour label
|
|
56
56
|
const h = 7 * rh + 20;
|
|
@@ -60,7 +60,7 @@ function punchcard(punch) {
|
|
|
60
60
|
for (let hr = 0; hr < 24; hr++) {
|
|
61
61
|
const v = punch[d][hr];
|
|
62
62
|
if (!v) continue;
|
|
63
|
-
const r = 2 + Math.sqrt(v / max) *
|
|
63
|
+
const r = 2 + Math.sqrt(v / max) * 5; // at most 7, so neighbouring hours never overlap
|
|
64
64
|
svg += `<circle cx="${40 + hr * cw + cw / 2}" cy="${d * rh + rh / 2}" r="${r.toFixed(1)}"><title>${plural(v, "commit")} · ${DAYS[d]} ${hr}:00</title></circle>`;
|
|
65
65
|
}
|
|
66
66
|
}
|