@meltstudio/meltctl 4.24.0 → 4.25.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/dist/commands/report.js +16 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/commands/report.js
CHANGED
|
@@ -141,6 +141,9 @@ async function autoDetectAuditFile() {
|
|
|
141
141
|
}
|
|
142
142
|
return null;
|
|
143
143
|
}
|
|
144
|
+
function detectAuditType(filename) {
|
|
145
|
+
return filename.toLowerCase().includes('ux-audit') ? 'ux-audit' : 'audit';
|
|
146
|
+
}
|
|
144
147
|
function buildReportPayload(type, content, filename) {
|
|
145
148
|
const project = getProjectName();
|
|
146
149
|
const branch = getGitBranch();
|
|
@@ -221,7 +224,8 @@ export async function reportAuditCommand(file) {
|
|
|
221
224
|
}
|
|
222
225
|
const content = await fs.readFile(filePath, 'utf-8');
|
|
223
226
|
const filename = path.basename(filePath);
|
|
224
|
-
const
|
|
227
|
+
const auditType = detectAuditType(filename);
|
|
228
|
+
const payload = buildReportPayload(auditType, content, filename);
|
|
225
229
|
try {
|
|
226
230
|
const res = await tokenFetch(token, '/reports', {
|
|
227
231
|
method: 'POST',
|
|
@@ -271,6 +275,13 @@ export async function reportListCommand(options) {
|
|
|
271
275
|
return;
|
|
272
276
|
}
|
|
273
277
|
console.log(chalk.bold(`\n Reports (${body.count}):\n`));
|
|
278
|
+
console.log(chalk.dim(` ${'TYPE'.padEnd(12)} ${'REPOSITORY'.padEnd(40)} ${'AUTHOR'.padEnd(30)} DATE`));
|
|
279
|
+
console.log();
|
|
280
|
+
const typeLabels = {
|
|
281
|
+
plan: 'Plan',
|
|
282
|
+
audit: 'Tech Audit',
|
|
283
|
+
'ux-audit': 'UX Audit',
|
|
284
|
+
};
|
|
274
285
|
for (const r of body.reports) {
|
|
275
286
|
const date = new Date(r.createdAt).toLocaleDateString('en-US', {
|
|
276
287
|
month: 'short',
|
|
@@ -280,10 +291,11 @@ export async function reportListCommand(options) {
|
|
|
280
291
|
minute: '2-digit',
|
|
281
292
|
});
|
|
282
293
|
const repo = r.repository ?? r.project;
|
|
283
|
-
const
|
|
284
|
-
|
|
294
|
+
const label = typeLabels[r.type] ?? r.type;
|
|
295
|
+
const typeColor = r.type === 'plan' ? chalk.cyan : r.type === 'ux-audit' ? chalk.yellow : chalk.magenta;
|
|
296
|
+
console.log(` ${typeColor(label.padEnd(12))} ${chalk.white(repo.padEnd(40))} ${chalk.dim(r.author.padEnd(30))} ${chalk.dim(date)}`);
|
|
285
297
|
if (r.branch && r.branch !== 'main') {
|
|
286
|
-
console.log(`
|
|
298
|
+
console.log(` ${' '.padEnd(12)} ${chalk.dim(`branch: ${r.branch} commit: ${r.commit ?? 'N/A'}`)}`);
|
|
287
299
|
}
|
|
288
300
|
}
|
|
289
301
|
console.log();
|
package/dist/index.js
CHANGED
|
@@ -108,7 +108,7 @@ report
|
|
|
108
108
|
report
|
|
109
109
|
.command('list')
|
|
110
110
|
.description('list submitted reports (Team Managers only)')
|
|
111
|
-
.option('--type <type>', 'filter by type (plan, audit)')
|
|
111
|
+
.option('--type <type>', 'filter by type (plan, audit, ux-audit)')
|
|
112
112
|
.option('--repository <repo>', 'filter by repository (owner/repo)')
|
|
113
113
|
.option('--limit <n>', 'max results (default 50, max 200)')
|
|
114
114
|
.action(async (options) => {
|
package/package.json
CHANGED