@decantr/cli 1.11.0 → 2.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/README.md +2 -0
- package/dist/bin.js +3 -3
- package/dist/{chunk-5RODH77L.js → chunk-5QM6XDZU.js} +3228 -3076
- package/dist/{chunk-6YCFRZZI.js → chunk-KGEEYXSU.js} +42 -3
- package/dist/{chunk-USOO77A5.js → chunk-WDA4SHIQ.js} +190 -283
- package/dist/{chunk-RSDCWAHD.js → chunk-X2HIXQAY.js} +9 -6
- package/dist/{chunk-DI2PLOJ6.js → chunk-ZUUJ24YU.js} +418 -180
- package/dist/{heal-5JHGCLDX.js → heal-MQ56WYX4.js} +2 -2
- package/dist/{health-3TJYYTX6.js → health-DCT625XN.js} +3 -3
- package/dist/index.js +3 -3
- package/dist/{studio-7TE7YXFG.js → studio-CI7OOGHV.js} +21 -4
- package/dist/{upgrade-4NRDVD5N.js → upgrade-PL755AF7.js} +21 -41
- package/package.json +6 -6
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
collectCheckIssues
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X2HIXQAY.js";
|
|
4
|
+
import {
|
|
5
|
+
sendProjectHealthCiFailedTelemetry,
|
|
6
|
+
sendProjectHealthPromptTelemetry,
|
|
7
|
+
sendProjectHealthReportTelemetry
|
|
8
|
+
} from "./chunk-ZUUJ24YU.js";
|
|
4
9
|
|
|
5
10
|
// src/commands/health.ts
|
|
6
11
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -62,7 +67,7 @@ function normalizeCliPackageSpecifier(version) {
|
|
|
62
67
|
const versionToken = value.startsWith("@decantr/cli@") ? value.slice("@decantr/cli@".length) : value;
|
|
63
68
|
if (!/^[A-Za-z0-9._~^*-]+$/.test(versionToken)) {
|
|
64
69
|
throw new Error(
|
|
65
|
-
"Invalid --cli-version value. Use a package version or dist-tag such as latest,
|
|
70
|
+
"Invalid --cli-version value. Use a package version or dist-tag such as latest, 2.0.0, or next."
|
|
66
71
|
);
|
|
67
72
|
}
|
|
68
73
|
return `@decantr/cli@${versionToken}`;
|
|
@@ -531,9 +536,22 @@ async function cmdHealth(projectRoot = process.cwd(), options = {}) {
|
|
|
531
536
|
}
|
|
532
537
|
return;
|
|
533
538
|
}
|
|
539
|
+
const startedAt = Date.now();
|
|
534
540
|
const report = await createProjectHealthReport(projectRoot);
|
|
535
541
|
if (options.promptId) {
|
|
536
542
|
const finding = report.findings.find((entry) => entry.id === options.promptId);
|
|
543
|
+
await sendProjectHealthReportTelemetry({
|
|
544
|
+
ci: options.ci ?? false,
|
|
545
|
+
durationMs: Date.now() - startedAt,
|
|
546
|
+
projectRoot,
|
|
547
|
+
report
|
|
548
|
+
});
|
|
549
|
+
await sendProjectHealthPromptTelemetry({
|
|
550
|
+
ci: options.ci ?? false,
|
|
551
|
+
finding,
|
|
552
|
+
projectRoot,
|
|
553
|
+
report
|
|
554
|
+
});
|
|
537
555
|
if (!finding) {
|
|
538
556
|
console.error(`${RED}No health finding found for id: ${options.promptId}${RESET}`);
|
|
539
557
|
process.exitCode = 1;
|
|
@@ -543,6 +561,7 @@ async function cmdHealth(projectRoot = process.cwd(), options = {}) {
|
|
|
543
561
|
return;
|
|
544
562
|
}
|
|
545
563
|
const format = resolveFormat(options);
|
|
564
|
+
const failOn = options.failOn ?? "error";
|
|
546
565
|
const payload = format === "json" ? formatProjectHealthJson(report) : format === "markdown" ? formatProjectHealthMarkdown(report) : formatProjectHealthText(report);
|
|
547
566
|
if (options.output) {
|
|
548
567
|
writeFileSync(options.output, payload, "utf-8");
|
|
@@ -552,7 +571,27 @@ async function cmdHealth(projectRoot = process.cwd(), options = {}) {
|
|
|
552
571
|
} else {
|
|
553
572
|
process.stdout.write(payload);
|
|
554
573
|
}
|
|
555
|
-
|
|
574
|
+
await sendProjectHealthReportTelemetry({
|
|
575
|
+
ci: options.ci ?? false,
|
|
576
|
+
durationMs: Date.now() - startedAt,
|
|
577
|
+
failOn,
|
|
578
|
+
format,
|
|
579
|
+
outputWritten: Boolean(options.output),
|
|
580
|
+
projectRoot,
|
|
581
|
+
report
|
|
582
|
+
});
|
|
583
|
+
if (options.ci && shouldFailHealth(report, failOn)) {
|
|
584
|
+
if (failOn !== "none") {
|
|
585
|
+
await sendProjectHealthCiFailedTelemetry({
|
|
586
|
+
ci: true,
|
|
587
|
+
durationMs: Date.now() - startedAt,
|
|
588
|
+
failOn,
|
|
589
|
+
format,
|
|
590
|
+
outputWritten: Boolean(options.output),
|
|
591
|
+
projectRoot,
|
|
592
|
+
report
|
|
593
|
+
});
|
|
594
|
+
}
|
|
556
595
|
process.exitCode = 1;
|
|
557
596
|
}
|
|
558
597
|
}
|