work-chronicler 0.3.1 → 0.3.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reports.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/analyze/reports.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"reports.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/analyze/reports.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyBH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;GAEG;AACH,eAAO,MAAM,cAAc,SAmUvB,CAAC"}
|
|
@@ -7,17 +7,19 @@ import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
|
7
7
|
import { dirname } from 'node:path';
|
|
8
8
|
import { classifyPRImpact, detectProjects, generateStats, generateTimeline, } from '../../analyzer/index.js';
|
|
9
9
|
import { getAnalysisFilePath, readAllPRs, readAllTickets, writeMarkdownFile, } from '../../../core/index.js';
|
|
10
|
+
import { select } from '@inquirer/prompts';
|
|
10
11
|
import { getActiveProfile } from '../../../core/workspace/global-config.js';
|
|
12
|
+
import { listReports } from '../../../core/workspace/report-manager.js';
|
|
11
13
|
import { getReportAnalysisDir, getReportWorkLogDir, isManagerMode, } from '../../../core/workspace/resolver.js';
|
|
12
14
|
import chalk from 'chalk';
|
|
13
15
|
import { Command } from 'commander';
|
|
14
16
|
import ora from 'ora';
|
|
15
17
|
/**
|
|
16
|
-
* analyze reports
|
|
18
|
+
* analyze reports [id] command
|
|
17
19
|
*/
|
|
18
20
|
export const reportsCommand = new Command('reports')
|
|
19
21
|
.description('Generate per-report analysis (manager mode only)')
|
|
20
|
-
.argument('
|
|
22
|
+
.argument('[id]', 'Report ID (e.g., "alice-smith")')
|
|
21
23
|
.option('--tag-prs', 'Update PR files with impact tags')
|
|
22
24
|
.option('--projects', 'Detect and group related PRs/tickets into projects')
|
|
23
25
|
.option('--timeline', 'Generate chronological timeline grouped by week/month')
|
|
@@ -32,6 +34,22 @@ export const reportsCommand = new Command('reports')
|
|
|
32
34
|
process.exit(1);
|
|
33
35
|
}
|
|
34
36
|
const profileName = activeProfile;
|
|
37
|
+
// If no report ID provided, prompt to select one
|
|
38
|
+
if (!reportId) {
|
|
39
|
+
const reports = listReports(profileName);
|
|
40
|
+
if (reports.length === 0) {
|
|
41
|
+
console.error(chalk.red('\n❌ No reports configured.'));
|
|
42
|
+
console.log(chalk.gray('Add reports with "reports add"'));
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
reportId = await select({
|
|
46
|
+
message: 'Select a report to analyze:',
|
|
47
|
+
choices: reports.map((r) => ({
|
|
48
|
+
name: `${r.name} (${r.github})`,
|
|
49
|
+
value: r.id,
|
|
50
|
+
})),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
35
53
|
// Get report-specific paths
|
|
36
54
|
const workLogDir = getReportWorkLogDir(profileName, reportId);
|
|
37
55
|
const analysisDir = getReportAnalysisDir(profileName, reportId);
|
package/package.json
CHANGED