dx-devkit 0.0.0-stage → 1.1.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 +81 -0
- package/LICENSE +21 -0
- package/README.md +475 -2
- package/bin/dx-mcp.js +2 -0
- package/dist/command.d.ts +9 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +2 -0
- package/dist/command.js.map +1 -0
- package/dist/commands/ai.d.ts +7 -0
- package/dist/commands/ai.d.ts.map +1 -0
- package/dist/commands/ai.js +148 -0
- package/dist/commands/ai.js.map +1 -0
- package/dist/commands/clean.d.ts +3 -0
- package/dist/commands/clean.d.ts.map +1 -0
- package/dist/commands/clean.js +72 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/deps.d.ts +3 -0
- package/dist/commands/deps.d.ts.map +1 -0
- package/dist/commands/deps.js +98 -0
- package/dist/commands/deps.js.map +1 -0
- package/dist/commands/go.d.ts +3 -0
- package/dist/commands/go.d.ts.map +1 -0
- package/dist/commands/go.js +202 -0
- package/dist/commands/go.js.map +1 -0
- package/dist/commands/log.d.ts +3 -0
- package/dist/commands/log.d.ts.map +1 -0
- package/dist/commands/log.js +51 -0
- package/dist/commands/log.js.map +1 -0
- package/dist/commands/new.d.ts +3 -0
- package/dist/commands/new.d.ts.map +1 -0
- package/dist/commands/new.js +117 -0
- package/dist/commands/new.js.map +1 -0
- package/dist/commands/port.d.ts +4 -0
- package/dist/commands/port.d.ts.map +1 -0
- package/dist/commands/port.js +106 -0
- package/dist/commands/port.js.map +1 -0
- package/dist/commands/projects.d.ts +5 -0
- package/dist/commands/projects.d.ts.map +1 -0
- package/dist/commands/projects.js +46 -0
- package/dist/commands/projects.js.map +1 -0
- package/dist/commands/stack.d.ts +34 -0
- package/dist/commands/stack.d.ts.map +1 -0
- package/dist/commands/stack.js +140 -0
- package/dist/commands/stack.js.map +1 -0
- package/dist/commands/summary.d.ts +3 -0
- package/dist/commands/summary.d.ts.map +1 -0
- package/dist/commands/summary.js +88 -0
- package/dist/commands/summary.js.map +1 -0
- package/dist/commands/system.d.ts +5 -0
- package/dist/commands/system.d.ts.map +1 -0
- package/dist/commands/system.js +104 -0
- package/dist/commands/system.js.map +1 -0
- package/dist/commands/ui.d.ts +3 -0
- package/dist/commands/ui.d.ts.map +1 -0
- package/dist/commands/ui.js +96 -0
- package/dist/commands/ui.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +103 -0
- package/dist/index.js.map +1 -0
- package/dist/ui.d.ts +27 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +104 -0
- package/dist/ui.js.map +1 -0
- package/node_modules/@dx/core/dist/config.d.ts +46 -0
- package/node_modules/@dx/core/dist/config.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/config.js +131 -0
- package/node_modules/@dx/core/dist/config.js.map +1 -0
- package/node_modules/@dx/core/dist/fuzzy.d.ts +15 -0
- package/node_modules/@dx/core/dist/fuzzy.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/fuzzy.js +63 -0
- package/node_modules/@dx/core/dist/fuzzy.js.map +1 -0
- package/node_modules/@dx/core/dist/index.d.ts +17 -0
- package/node_modules/@dx/core/dist/index.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/index.js +19 -0
- package/node_modules/@dx/core/dist/index.js.map +1 -0
- package/node_modules/@dx/core/dist/runs.d.ts +19 -0
- package/node_modules/@dx/core/dist/runs.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/runs.js +41 -0
- package/node_modules/@dx/core/dist/runs.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/aiSetup.d.ts +58 -0
- package/node_modules/@dx/core/dist/tools/aiSetup.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/aiSetup.js +243 -0
- package/node_modules/@dx/core/dist/tools/aiSetup.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/cleanup.d.ts +61 -0
- package/node_modules/@dx/core/dist/tools/cleanup.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/cleanup.js +171 -0
- package/node_modules/@dx/core/dist/tools/cleanup.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/deps.d.ts +57 -0
- package/node_modules/@dx/core/dist/tools/deps.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/deps.js +151 -0
- package/node_modules/@dx/core/dist/tools/deps.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/devErrors.d.ts +74 -0
- package/node_modules/@dx/core/dist/tools/devErrors.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/devErrors.js +261 -0
- package/node_modules/@dx/core/dist/tools/devErrors.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/doctor.d.ts +12 -0
- package/node_modules/@dx/core/dist/tools/doctor.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/doctor.js +176 -0
- package/node_modules/@dx/core/dist/tools/doctor.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/github.d.ts +31 -0
- package/node_modules/@dx/core/dist/tools/github.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/github.js +80 -0
- package/node_modules/@dx/core/dist/tools/github.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/journal.d.ts +23 -0
- package/node_modules/@dx/core/dist/tools/journal.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/journal.js +80 -0
- package/node_modules/@dx/core/dist/tools/journal.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/launch.d.ts +24 -0
- package/node_modules/@dx/core/dist/tools/launch.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/launch.js +137 -0
- package/node_modules/@dx/core/dist/tools/launch.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/ports.d.ts +42 -0
- package/node_modules/@dx/core/dist/tools/ports.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/ports.js +220 -0
- package/node_modules/@dx/core/dist/tools/ports.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/projects.d.ts +58 -0
- package/node_modules/@dx/core/dist/tools/projects.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/projects.js +208 -0
- package/node_modules/@dx/core/dist/tools/projects.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/scaffold.d.ts +40 -0
- package/node_modules/@dx/core/dist/tools/scaffold.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/scaffold.js +188 -0
- package/node_modules/@dx/core/dist/tools/scaffold.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/stacks.d.ts +119 -0
- package/node_modules/@dx/core/dist/tools/stacks.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/stacks.js +386 -0
- package/node_modules/@dx/core/dist/tools/stacks.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/summary.d.ts +87 -0
- package/node_modules/@dx/core/dist/tools/summary.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/summary.js +331 -0
- package/node_modules/@dx/core/dist/tools/summary.js.map +1 -0
- package/node_modules/@dx/core/package.json +20 -0
- package/node_modules/@dx/mcp/dist/index.d.ts +3 -0
- package/node_modules/@dx/mcp/dist/index.d.ts.map +1 -0
- package/node_modules/@dx/mcp/dist/index.js +540 -0
- package/node_modules/@dx/mcp/dist/index.js.map +1 -0
- package/node_modules/@dx/mcp/package.json +8 -0
- package/node_modules/@dx/web/dist/api.d.ts +13 -0
- package/node_modules/@dx/web/dist/api.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/api.js +351 -0
- package/node_modules/@dx/web/dist/api.js.map +1 -0
- package/node_modules/@dx/web/dist/background.d.ts +2 -0
- package/node_modules/@dx/web/dist/background.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/background.js +24 -0
- package/node_modules/@dx/web/dist/background.js.map +1 -0
- package/node_modules/@dx/web/dist/check.d.ts +39 -0
- package/node_modules/@dx/web/dist/check.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/check.js +97 -0
- package/node_modules/@dx/web/dist/check.js.map +1 -0
- package/node_modules/@dx/web/dist/dev.d.ts +109 -0
- package/node_modules/@dx/web/dist/dev.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/dev.js +645 -0
- package/node_modules/@dx/web/dist/dev.js.map +1 -0
- package/node_modules/@dx/web/dist/link.d.ts +45 -0
- package/node_modules/@dx/web/dist/link.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/link.js +150 -0
- package/node_modules/@dx/web/dist/link.js.map +1 -0
- package/node_modules/@dx/web/dist/proxy.d.ts +21 -0
- package/node_modules/@dx/web/dist/proxy.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/proxy.js +140 -0
- package/node_modules/@dx/web/dist/proxy.js.map +1 -0
- package/node_modules/@dx/web/dist/server.d.ts +33 -0
- package/node_modules/@dx/web/dist/server.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/server.js +184 -0
- package/node_modules/@dx/web/dist/server.js.map +1 -0
- package/node_modules/@dx/web/package.json +26 -0
- package/node_modules/@dx/web/public/app.js +1553 -0
- package/node_modules/@dx/web/public/icon.svg +1 -0
- package/node_modules/@dx/web/public/index.html +47 -0
- package/node_modules/@dx/web/public/styles.css +1124 -0
- package/package.json +52 -4
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import { promisify } from "node:util";
|
|
4
|
+
import { dxPath, ensureDxHome, loadConfig } from "../config.js";
|
|
5
|
+
import { readRuns } from "../runs.js";
|
|
6
|
+
import { fetchGithubActivity, githubToken, mostCommonOwner } from "./github.js";
|
|
7
|
+
import { localDate, localTime, readJournal } from "./journal.js";
|
|
8
|
+
import { scanProjects } from "./projects.js";
|
|
9
|
+
const run = promisify(execFile);
|
|
10
|
+
const FIELD = "\x1f";
|
|
11
|
+
const MAX_PARALLEL = 6;
|
|
12
|
+
export async function buildSummary(options = {}) {
|
|
13
|
+
const days = Math.max(1, Math.floor(options.days ?? 7));
|
|
14
|
+
const now = options.now ?? new Date();
|
|
15
|
+
const start = new Date(now.getFullYear(), now.getMonth(), now.getDate() - (days - 1));
|
|
16
|
+
const config = options.config ?? loadConfig();
|
|
17
|
+
const all = scanProjects(config);
|
|
18
|
+
const repos = all.filter((p) => p.hasGit);
|
|
19
|
+
const projects = [];
|
|
20
|
+
const skipped = [];
|
|
21
|
+
const uncommitted = [];
|
|
22
|
+
const remotes = [];
|
|
23
|
+
let gitMissing = false;
|
|
24
|
+
const authors = new Set();
|
|
25
|
+
await inBatches(repos, MAX_PARALLEL, async (project) => {
|
|
26
|
+
try {
|
|
27
|
+
const who = options.allAuthors ? [] : await gitIdentity(project.dir);
|
|
28
|
+
who.forEach((w) => authors.add(w));
|
|
29
|
+
const commits = await commitsSince(project, start, who);
|
|
30
|
+
if (commits.length)
|
|
31
|
+
projects.push({ project: project.name, dir: project.dir, commits });
|
|
32
|
+
if (commits.length || project.lastActive >= start.getTime()) {
|
|
33
|
+
const files = await changedFiles(project.dir);
|
|
34
|
+
if (files)
|
|
35
|
+
uncommitted.push({ project: project.name, files });
|
|
36
|
+
}
|
|
37
|
+
if (options.github && !config.githubUser) {
|
|
38
|
+
const url = await gitOutput(project.dir, ["remote", "get-url", "origin"]);
|
|
39
|
+
if (url)
|
|
40
|
+
remotes.push(url);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
const e = err;
|
|
45
|
+
if (e.code === "ENOENT")
|
|
46
|
+
gitMissing = true;
|
|
47
|
+
skipped.push({ project: project.name, reason: firstLine(e.stderr) || e.message });
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
if (gitMissing && projects.length === 0) {
|
|
51
|
+
throw new Error("Git isn't installed or isn't on your PATH, so there are no commits to summarize.");
|
|
52
|
+
}
|
|
53
|
+
projects.sort((a, b) => b.commits.length - a.commits.length || a.project.localeCompare(b.project));
|
|
54
|
+
skipped.sort((a, b) => a.project.localeCompare(b.project));
|
|
55
|
+
uncommitted.sort((a, b) => b.files - a.files || a.project.localeCompare(b.project));
|
|
56
|
+
let github;
|
|
57
|
+
if (options.github) {
|
|
58
|
+
const user = config.githubUser || mostCommonOwner(remotes);
|
|
59
|
+
if (!user) {
|
|
60
|
+
github = { error: "no GitHub username: set it with dx config github <username>" };
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
try {
|
|
64
|
+
github = await fetchGithubActivity(user, localDate(start), await githubToken());
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
github = { error: err.message };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
from: localDate(start),
|
|
73
|
+
to: localDate(now),
|
|
74
|
+
days,
|
|
75
|
+
author: options.allAuthors ? "everyone" : [...authors].join(", ") || "you",
|
|
76
|
+
projects,
|
|
77
|
+
journal: readJournal({ sinceDays: days, now }),
|
|
78
|
+
skipped,
|
|
79
|
+
time: timePerProject(projects, readRuns(0), start, all.map((p) => p.name)),
|
|
80
|
+
uncommitted,
|
|
81
|
+
github,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Combines commit days with `dx go` runs from the run log. Old run records have no project field,
|
|
86
|
+
* so for those the project is read from the start of the detail text.
|
|
87
|
+
*/
|
|
88
|
+
export function timePerProject(projects, runs, start, knownNames) {
|
|
89
|
+
const byName = new Map();
|
|
90
|
+
const get = (name) => {
|
|
91
|
+
let t = byName.get(name);
|
|
92
|
+
if (!t)
|
|
93
|
+
byName.set(name, (t = { project: name, days: 0, commits: 0, opens: 0, devMs: 0, dayset: new Set() }));
|
|
94
|
+
return t;
|
|
95
|
+
};
|
|
96
|
+
for (const p of projects) {
|
|
97
|
+
const t = get(p.project);
|
|
98
|
+
t.commits += p.commits.length;
|
|
99
|
+
p.commits.forEach((c) => t.dayset.add(c.date));
|
|
100
|
+
}
|
|
101
|
+
const names = [...knownNames].sort((a, b) => b.length - a.length);
|
|
102
|
+
for (const r of runs) {
|
|
103
|
+
if (r.tool !== "go")
|
|
104
|
+
continue;
|
|
105
|
+
const at = new Date(r.at);
|
|
106
|
+
if (Number.isNaN(at.getTime()) || at < start)
|
|
107
|
+
continue;
|
|
108
|
+
const name = r.project ?? names.find((n) => r.detail === n || r.detail?.startsWith(`${n} `) || r.detail?.startsWith(`${n}:`));
|
|
109
|
+
if (!name)
|
|
110
|
+
continue;
|
|
111
|
+
const t = get(name);
|
|
112
|
+
// Each dx go writes one record (a foreground run writes it when the server stops), so one record is one open.
|
|
113
|
+
t.opens++;
|
|
114
|
+
t.devMs += r.ms ?? 0;
|
|
115
|
+
t.dayset.add(localDate(at));
|
|
116
|
+
}
|
|
117
|
+
return [...byName.values()]
|
|
118
|
+
.map(({ dayset, ...t }) => ({ ...t, days: dayset.size }))
|
|
119
|
+
.sort((a, b) => b.days - a.days || b.commits - a.commits || a.project.localeCompare(b.project));
|
|
120
|
+
}
|
|
121
|
+
async function changedFiles(dir) {
|
|
122
|
+
const out = await gitOutput(dir, ["status", "--porcelain"]);
|
|
123
|
+
return out ? out.split(/\r?\n/).filter(Boolean).length : 0;
|
|
124
|
+
}
|
|
125
|
+
async function gitOutput(dir, args) {
|
|
126
|
+
try {
|
|
127
|
+
const { stdout } = await run("git", ["-C", dir, ...args], { windowsHide: true, maxBuffer: 16 * 1024 * 1024 });
|
|
128
|
+
return stdout.trim();
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
return "";
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/** Your name and email as git knows them for this repo (a repo can override the global ones). */
|
|
135
|
+
async function gitIdentity(dir) {
|
|
136
|
+
const read = async (key) => {
|
|
137
|
+
try {
|
|
138
|
+
const { stdout } = await run("git", ["-C", dir, "config", key], { windowsHide: true });
|
|
139
|
+
return stdout.trim();
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
return "";
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const [name, email] = await Promise.all([read("user.name"), read("user.email")]);
|
|
146
|
+
const who = [name, email].filter(Boolean);
|
|
147
|
+
if (who.length === 0)
|
|
148
|
+
throw new Error("git has no user.name or user.email set, so your commits can't be told apart");
|
|
149
|
+
return who;
|
|
150
|
+
}
|
|
151
|
+
async function commitsSince(project, start, authors) {
|
|
152
|
+
const args = [
|
|
153
|
+
"-C",
|
|
154
|
+
project.dir,
|
|
155
|
+
"log",
|
|
156
|
+
"--all",
|
|
157
|
+
"--no-merges",
|
|
158
|
+
`--since=${start.toISOString()}`,
|
|
159
|
+
`--format=%H${FIELD}%aI${FIELD}%s`,
|
|
160
|
+
];
|
|
161
|
+
// Several --author patterns match any of them: commits made under your name or your email.
|
|
162
|
+
if (authors.length)
|
|
163
|
+
args.push("--fixed-strings", ...authors.map((a) => `--author=${a}`));
|
|
164
|
+
try {
|
|
165
|
+
const { stdout } = await run("git", args, { windowsHide: true, maxBuffer: 16 * 1024 * 1024 });
|
|
166
|
+
return parseGitLog(stdout);
|
|
167
|
+
}
|
|
168
|
+
catch (err) {
|
|
169
|
+
// A repo with no commits yet isn't an error, it just has nothing to report.
|
|
170
|
+
if (/does not have any commits|unknown revision/i.test(String(err.stderr)))
|
|
171
|
+
return [];
|
|
172
|
+
throw err;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/** Parses `git log --format=%H<US>%aI<US>%s` output. Newest first, like git prints it. */
|
|
176
|
+
export function parseGitLog(stdout) {
|
|
177
|
+
const commits = [];
|
|
178
|
+
for (const line of stdout.split(/\r?\n/)) {
|
|
179
|
+
const [hash, iso, ...rest] = line.split(FIELD);
|
|
180
|
+
if (!hash || !iso)
|
|
181
|
+
continue;
|
|
182
|
+
const at = new Date(iso);
|
|
183
|
+
if (Number.isNaN(at.getTime()))
|
|
184
|
+
continue;
|
|
185
|
+
commits.push({ hash, date: localDate(at), time: localTime(at), subject: rest.join(FIELD).trim() });
|
|
186
|
+
}
|
|
187
|
+
return commits;
|
|
188
|
+
}
|
|
189
|
+
const WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
190
|
+
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
191
|
+
const COMMITS_PER_PROJECT = 12;
|
|
192
|
+
/** "2026-11-02" → "Mon 2 Nov" */
|
|
193
|
+
export function dayLabel(date) {
|
|
194
|
+
const [y, m, d] = date.split("-").map(Number);
|
|
195
|
+
const at = new Date(y, m - 1, d);
|
|
196
|
+
return `${WEEKDAYS[at.getDay()]} ${d} ${MONTHS[m - 1]}`;
|
|
197
|
+
}
|
|
198
|
+
/** "27 Oct – 2 Nov 2026", or "Mon 2 Nov 2026" for one day. */
|
|
199
|
+
export function rangeLabel(from, to) {
|
|
200
|
+
const year = to.slice(0, 4);
|
|
201
|
+
if (from === to)
|
|
202
|
+
return `${dayLabel(to)} ${year}`;
|
|
203
|
+
const short = (date) => dayLabel(date).split(" ").slice(1).join(" ");
|
|
204
|
+
const fromLabel = from.slice(0, 4) === year ? short(from) : `${short(from)} ${from.slice(0, 4)}`;
|
|
205
|
+
return `${fromLabel} – ${short(to)} ${year}`;
|
|
206
|
+
}
|
|
207
|
+
/** The summary as markdown, ready to paste. */
|
|
208
|
+
export function formatSummary(s) {
|
|
209
|
+
const commitCount = s.projects.reduce((n, p) => n + p.commits.length, 0);
|
|
210
|
+
const out = [`# Work summary · ${rangeLabel(s.from, s.to)}`, ""];
|
|
211
|
+
const gh = s.github && "user" in s.github ? s.github : undefined;
|
|
212
|
+
const prCount = gh ? gh.merged.length + gh.reviewed.length : 0;
|
|
213
|
+
const totals = [
|
|
214
|
+
plural(commitCount, "commit") + (s.projects.length ? ` in ${plural(s.projects.length, "project")}` : ""),
|
|
215
|
+
...(gh ? [`${gh.merged.length} PR(s) merged`, `${gh.reviewed.length} reviewed`] : []),
|
|
216
|
+
plural(s.journal.length, "journal entry", "journal entries"),
|
|
217
|
+
];
|
|
218
|
+
out.push(`**${totals.join(" · ")}**`, "");
|
|
219
|
+
if (commitCount === 0 && s.journal.length === 0 && prCount === 0) {
|
|
220
|
+
out.push(`Nothing to report: no commits and no journal entries in the last ${plural(s.days, "day")}.`, "");
|
|
221
|
+
out.push(...uncommittedSection(s), ...skippedNote(s));
|
|
222
|
+
return out.join("\n").trimEnd() + "\n";
|
|
223
|
+
}
|
|
224
|
+
if (s.journal.length) {
|
|
225
|
+
out.push("## Journal", "");
|
|
226
|
+
let day = "";
|
|
227
|
+
for (const e of s.journal) {
|
|
228
|
+
if (e.date !== day) {
|
|
229
|
+
if (day)
|
|
230
|
+
out.push("");
|
|
231
|
+
out.push(`**${dayLabel(e.date)}**`);
|
|
232
|
+
day = e.date;
|
|
233
|
+
}
|
|
234
|
+
out.push(`- ${e.text}`);
|
|
235
|
+
}
|
|
236
|
+
out.push("");
|
|
237
|
+
}
|
|
238
|
+
if (gh && prCount) {
|
|
239
|
+
out.push("## Pull requests", "");
|
|
240
|
+
const line = (pr) => `- ${pr.title} ([${pr.repo}#${pr.number}](${pr.url}))${pr.date ? ` · ${dayLabel(pr.date).split(" ")[0]}` : ""}`;
|
|
241
|
+
if (gh.merged.length)
|
|
242
|
+
out.push("**Merged**", ...gh.merged.map(line), "");
|
|
243
|
+
if (gh.reviewed.length)
|
|
244
|
+
out.push("**Reviewed**", ...gh.reviewed.map(line), "");
|
|
245
|
+
}
|
|
246
|
+
if (s.projects.length) {
|
|
247
|
+
out.push("## Commits", "");
|
|
248
|
+
for (const p of s.projects) {
|
|
249
|
+
out.push(`### ${p.project} (${p.commits.length})`, "");
|
|
250
|
+
// Oldest first reads like a story of the week; identical subjects (amends, retries) once, with a count.
|
|
251
|
+
const counts = new Map();
|
|
252
|
+
const unique = [...p.commits].reverse().filter((c) => {
|
|
253
|
+
const key = c.subject.toLowerCase();
|
|
254
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
255
|
+
return counts.get(key) === 1;
|
|
256
|
+
});
|
|
257
|
+
for (const c of unique.slice(0, COMMITS_PER_PROJECT)) {
|
|
258
|
+
const times = counts.get(c.subject.toLowerCase()) ?? 1;
|
|
259
|
+
out.push(`- ${c.subject || "(no message)"}${times > 1 ? ` ×${times}` : ""} · ${dayLabel(c.date).split(" ")[0]}`);
|
|
260
|
+
}
|
|
261
|
+
if (unique.length > COMMITS_PER_PROJECT)
|
|
262
|
+
out.push(`- …and ${unique.length - COMMITS_PER_PROJECT} more`);
|
|
263
|
+
out.push("");
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (s.time.length) {
|
|
267
|
+
out.push("## Where the time went", "");
|
|
268
|
+
for (const t of s.time) {
|
|
269
|
+
const parts = [plural(t.days, "day")];
|
|
270
|
+
if (t.commits)
|
|
271
|
+
parts.push(plural(t.commits, "commit"));
|
|
272
|
+
if (t.opens)
|
|
273
|
+
parts.push(`opened ${t.opens}×`);
|
|
274
|
+
if (t.devMs >= 60_000)
|
|
275
|
+
parts.push(`${formatDuration(t.devMs)} dev server`);
|
|
276
|
+
out.push(`- ${t.project}: ${parts.join(" · ")}`);
|
|
277
|
+
}
|
|
278
|
+
out.push("");
|
|
279
|
+
}
|
|
280
|
+
out.push(...uncommittedSection(s), ...skippedNote(s));
|
|
281
|
+
return out.join("\n").trimEnd() + "\n";
|
|
282
|
+
}
|
|
283
|
+
function uncommittedSection(s) {
|
|
284
|
+
if (!s.uncommitted.length)
|
|
285
|
+
return [];
|
|
286
|
+
return ["## Not committed yet", "", ...s.uncommitted.map((u) => `- ${u.project}: ${plural(u.files, "changed file")}`), ""];
|
|
287
|
+
}
|
|
288
|
+
function skippedNote(s) {
|
|
289
|
+
const notes = [];
|
|
290
|
+
if (s.skipped.length)
|
|
291
|
+
notes.push(`_Couldn't read ${s.skipped.map((x) => x.project).join(", ")}; run \`dx summary\` in a terminal for details._`);
|
|
292
|
+
if (s.github && "error" in s.github)
|
|
293
|
+
notes.push(`_No pull requests: ${s.github.error}._`);
|
|
294
|
+
else if (s.github && !s.github.authenticated)
|
|
295
|
+
notes.push("_Pull requests from public repos only; set GITHUB_TOKEN to include private ones._");
|
|
296
|
+
return notes.length ? [...notes, ""] : [];
|
|
297
|
+
}
|
|
298
|
+
/** 4_500_000 → "1h 15m" */
|
|
299
|
+
export function formatDuration(ms) {
|
|
300
|
+
const minutes = Math.round(ms / 60_000);
|
|
301
|
+
const h = Math.floor(minutes / 60);
|
|
302
|
+
const m = minutes % 60;
|
|
303
|
+
return h ? (m ? `${h}h ${m}m` : `${h}h`) : `${m}m`;
|
|
304
|
+
}
|
|
305
|
+
/** Saves the markdown to ~/.dx/summaries/<last day>.md and returns the path. */
|
|
306
|
+
export function saveSummary(markdown, summary) {
|
|
307
|
+
ensureDxHome();
|
|
308
|
+
const dir = dxPath("summaries");
|
|
309
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
310
|
+
const file = dxPath("summaries", `${summary.to}.md`);
|
|
311
|
+
fs.writeFileSync(file, markdown, "utf8");
|
|
312
|
+
return file;
|
|
313
|
+
}
|
|
314
|
+
export function summariesDir() {
|
|
315
|
+
return dxPath("summaries");
|
|
316
|
+
}
|
|
317
|
+
function plural(n, one, many = `${one}s`) {
|
|
318
|
+
return `${n} ${n === 1 ? one : many}`;
|
|
319
|
+
}
|
|
320
|
+
function firstLine(text) {
|
|
321
|
+
return (text ?? "").split(/\r?\n/).map((l) => l.replace(/^(fatal|error):\s*/i, "").trim()).find(Boolean) ?? "";
|
|
322
|
+
}
|
|
323
|
+
async function inBatches(items, size, fn) {
|
|
324
|
+
let next = 0;
|
|
325
|
+
const worker = async () => {
|
|
326
|
+
while (next < items.length)
|
|
327
|
+
await fn(items[next++]);
|
|
328
|
+
};
|
|
329
|
+
await Promise.all(Array.from({ length: Math.min(size, items.length) }, worker));
|
|
330
|
+
}
|
|
331
|
+
//# sourceMappingURL=summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.js","sourceRoot":"","sources":["../../src/tools/summary.ts"],"names":[],"mappings":"AAAA,OA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AC,OAAO,CAAC,IAAI,EAAE,CAAC;AACjH,CAAC;AAED,KAAK,UAAU,SAAS,CAAI,KAAU,EAAE,IAAY,EAAE,EAA8B;IAClF,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,MAAM,MAAM,GAAG,KAAK,IAAI,EAAE;QACxB,OAAO,IAAI,GAAG,KAAK,CAAC,MAAM;YAAE,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC;IACF,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dx/core",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"private": true,
|
|
6
|
+
"description": "The tools themselves. No dependencies beyond Node, so every front end can bundle it.",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|