@ganakailabs/cloudeval-cli 0.26.12 → 0.27.1
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/{App-H7B3T5QW.js → App-XHSK5SJA.js} +2 -2
- package/dist/{Banner-MOLW4ADA.js → Banner-GAOI3CZR.js} +2 -2
- package/dist/{chunk-4AK6A5GF.js → chunk-FJDUSS2S.js} +1 -1
- package/dist/{chunk-GR76HJZF.js → chunk-LWHSK5SO.js} +1 -1
- package/dist/cli.js +56 -22
- package/package.json +1 -1
- package/sbom.spdx.json +1 -1
|
@@ -38,10 +38,10 @@ import {
|
|
|
38
38
|
} from "./chunk-USSCB2ZU.js";
|
|
39
39
|
import {
|
|
40
40
|
Banner
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-LWHSK5SO.js";
|
|
42
42
|
import {
|
|
43
43
|
CLI_VERSION
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-FJDUSS2S.js";
|
|
45
45
|
import {
|
|
46
46
|
raisedButtonStyle,
|
|
47
47
|
terminalTheme
|
package/dist/cli.js
CHANGED
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
} from "./chunk-USSCB2ZU.js";
|
|
40
40
|
import {
|
|
41
41
|
CLI_VERSION
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-FJDUSS2S.js";
|
|
43
43
|
|
|
44
44
|
// src/runtime/prepareInk.ts
|
|
45
45
|
import fs from "fs";
|
|
@@ -2413,14 +2413,41 @@ var parseGateConfig = (configText) => {
|
|
|
2413
2413
|
const match = configText.match(new RegExp(`^\\s*${key}\\s*:\\s*([^\\s#]+)`, "m"));
|
|
2414
2414
|
return match ? match[1].trim() : void 0;
|
|
2415
2415
|
};
|
|
2416
|
+
const firstStringValue = (...keys) => {
|
|
2417
|
+
for (const key of keys) {
|
|
2418
|
+
const value = stringValue2(key);
|
|
2419
|
+
if (value !== void 0) {
|
|
2420
|
+
return value;
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
return void 0;
|
|
2424
|
+
};
|
|
2416
2425
|
const numberValue2 = (key) => {
|
|
2417
2426
|
const match = configText.match(new RegExp(`^\\s*${key}\\s*:\\s*([0-9]+(?:\\.[0-9]+)?)`, "m"));
|
|
2418
2427
|
return match ? Number(match[1]) : void 0;
|
|
2419
2428
|
};
|
|
2429
|
+
const firstNumberValue = (...keys) => {
|
|
2430
|
+
for (const key of keys) {
|
|
2431
|
+
const value = numberValue2(key);
|
|
2432
|
+
if (value !== void 0) {
|
|
2433
|
+
return value;
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
return void 0;
|
|
2437
|
+
};
|
|
2420
2438
|
const booleanValue2 = (key) => {
|
|
2421
2439
|
const match = configText.match(new RegExp(`^\\s*${key}\\s*:\\s*(true|false)`, "im"));
|
|
2422
2440
|
return match ? match[1].toLowerCase() === "true" : void 0;
|
|
2423
2441
|
};
|
|
2442
|
+
const firstBooleanValue = (...keys) => {
|
|
2443
|
+
for (const key of keys) {
|
|
2444
|
+
const value = booleanValue2(key);
|
|
2445
|
+
if (value !== void 0) {
|
|
2446
|
+
return value;
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
return void 0;
|
|
2450
|
+
};
|
|
2424
2451
|
const pillarScoreMins = {};
|
|
2425
2452
|
const pillarBlock = configText.match(/^(\s*)pillars\s*:\s*$(?<body>(?:\n\s+[-\w]+\s*:\s*[0-9]+(?:\.[0-9]+)?\s*)+)/m);
|
|
2426
2453
|
const pillarBody = pillarBlock?.groups?.body ?? "";
|
|
@@ -2442,15 +2469,21 @@ var parseGateConfig = (configText) => {
|
|
|
2442
2469
|
pillarScoreMins[key] = value;
|
|
2443
2470
|
}
|
|
2444
2471
|
}
|
|
2445
|
-
const enforcement =
|
|
2472
|
+
const enforcement = firstStringValue("enforcement", "mode")?.toLowerCase();
|
|
2446
2473
|
return {
|
|
2447
|
-
enforcement: enforcement === "warn" ? "warn" : "required",
|
|
2448
|
-
overallScoreMin:
|
|
2449
|
-
pillarScoreMin:
|
|
2474
|
+
enforcement: enforcement === "warn" || enforcement === "comment_only" ? "warn" : "required",
|
|
2475
|
+
overallScoreMin: firstNumberValue("overall_score_min", "minimum_well_architected_score") ?? 80,
|
|
2476
|
+
pillarScoreMin: firstNumberValue("pillar_score_min", "minimum_pillar_score"),
|
|
2450
2477
|
pillarScoreMins,
|
|
2451
|
-
failOnHighRisk:
|
|
2452
|
-
|
|
2453
|
-
|
|
2478
|
+
failOnHighRisk: firstBooleanValue(
|
|
2479
|
+
"fail_on_high_risk",
|
|
2480
|
+
"fail_when_high_risk_findings_exist"
|
|
2481
|
+
) ?? true,
|
|
2482
|
+
failOnValidationErrors: firstBooleanValue(
|
|
2483
|
+
"fail_on_validation_errors",
|
|
2484
|
+
"fail_when_validation_fails"
|
|
2485
|
+
) ?? true,
|
|
2486
|
+
maxMonthlyCost: firstNumberValue("max_monthly_cost", "max_monthly_cost_usd")
|
|
2454
2487
|
};
|
|
2455
2488
|
};
|
|
2456
2489
|
var numberFrom = (...values) => {
|
|
@@ -2537,7 +2570,8 @@ var formatMoney = (amount, currency, fallback = "not available") => {
|
|
|
2537
2570
|
if (numericAmount === void 0) {
|
|
2538
2571
|
return fallback;
|
|
2539
2572
|
}
|
|
2540
|
-
|
|
2573
|
+
const formattedAmount = trimNumber(numericAmount);
|
|
2574
|
+
return currency ? `${formattedAmount} ${currency}` : formattedAmount;
|
|
2541
2575
|
};
|
|
2542
2576
|
var trimNumber = (value, fractionDigits = 2) => Number.isInteger(value) ? String(value) : String(Number(value.toFixed(fractionDigits)));
|
|
2543
2577
|
var formatScore = (value, fallback = "unknown") => {
|
|
@@ -6127,18 +6161,18 @@ var readWorkspaceConfig = (content) => {
|
|
|
6127
6161
|
};
|
|
6128
6162
|
};
|
|
6129
6163
|
var generateWorkspaceConfig = (entry, parameters, sourceEntry) => {
|
|
6130
|
-
const parameterLine = parameters ? ` parameters: ${parameters}
|
|
6131
|
-
` : "";
|
|
6164
|
+
const parameterLine = parameters ? ` parameters: ${parameters}` : "";
|
|
6132
6165
|
const sourceEntryLine = sourceEntry ? ` source_entry: ${sourceEntry}` : "";
|
|
6133
6166
|
return [
|
|
6134
6167
|
"# CloudEval config v1. Paths are relative to this workspace root.",
|
|
6135
6168
|
"# Visualization source for diagrams and reports.",
|
|
6136
6169
|
"version: 1",
|
|
6137
6170
|
"stacks:",
|
|
6138
|
-
" - id:
|
|
6171
|
+
" - id: primary-architecture",
|
|
6172
|
+
" name: Primary architecture",
|
|
6139
6173
|
` entry: ${entry}`,
|
|
6140
6174
|
sourceEntryLine,
|
|
6141
|
-
parameterLine
|
|
6175
|
+
parameterLine,
|
|
6142
6176
|
"resolve:",
|
|
6143
6177
|
" # Follow relative ARM templateLink files when building the analysis bundle.",
|
|
6144
6178
|
" linked_templates: true",
|
|
@@ -6151,12 +6185,12 @@ var generateWorkspaceConfig = (entry, parameters, sourceEntry) => {
|
|
|
6151
6185
|
"# Uncomment and tune these when pull requests should be blocked by CloudEval.",
|
|
6152
6186
|
"# ci:",
|
|
6153
6187
|
"# gates:",
|
|
6154
|
-
"# enforcement:
|
|
6155
|
-
"#
|
|
6156
|
-
"#
|
|
6157
|
-
"#
|
|
6158
|
-
"#
|
|
6159
|
-
"#
|
|
6188
|
+
"# enforcement: block_pull_request",
|
|
6189
|
+
"# minimum_well_architected_score: 80",
|
|
6190
|
+
"# minimum_pillar_score: 75",
|
|
6191
|
+
"# fail_when_high_risk_findings_exist: true",
|
|
6192
|
+
"# fail_when_validation_fails: true",
|
|
6193
|
+
"# max_monthly_cost_usd: 500",
|
|
6160
6194
|
""
|
|
6161
6195
|
].filter((line) => line.length > 0).join("\n");
|
|
6162
6196
|
};
|
|
@@ -15598,7 +15632,7 @@ program.command("tui").description("Open the CloudEval Terminal UI").option(
|
|
|
15598
15632
|
const { assertSecureBaseUrl } = await import("./dist-PEYJDO7A.js");
|
|
15599
15633
|
const [{ render }, { App }] = await Promise.all([
|
|
15600
15634
|
import("ink"),
|
|
15601
|
-
import("./App-
|
|
15635
|
+
import("./App-XHSK5SJA.js")
|
|
15602
15636
|
]);
|
|
15603
15637
|
const baseUrl = await resolveBaseUrl(options, command);
|
|
15604
15638
|
assertSecureBaseUrl(baseUrl);
|
|
@@ -15656,7 +15690,7 @@ program.command("chat").description("Start an interactive chat session").option(
|
|
|
15656
15690
|
const { assertSecureBaseUrl } = await import("./dist-PEYJDO7A.js");
|
|
15657
15691
|
const [{ render }, { App }] = await Promise.all([
|
|
15658
15692
|
import("ink"),
|
|
15659
|
-
import("./App-
|
|
15693
|
+
import("./App-XHSK5SJA.js")
|
|
15660
15694
|
]);
|
|
15661
15695
|
const baseUrl = await resolveBaseUrl(options, command);
|
|
15662
15696
|
assertSecureBaseUrl(baseUrl);
|
|
@@ -16410,7 +16444,7 @@ Error: ${errorMsg}
|
|
|
16410
16444
|
program.command("banner").description("Preview the startup banner and terminal capabilities").action(async () => {
|
|
16411
16445
|
const { render } = await import("ink");
|
|
16412
16446
|
const BannerPreview = React.lazy(async () => ({
|
|
16413
|
-
default: (await import("./Banner-
|
|
16447
|
+
default: (await import("./Banner-GAOI3CZR.js")).Banner
|
|
16414
16448
|
}));
|
|
16415
16449
|
render(
|
|
16416
16450
|
/* @__PURE__ */ jsx(React.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(BannerPreview, { disable: false }) })
|
package/package.json
CHANGED
package/sbom.spdx.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
{
|
|
15
15
|
"SPDXID": "SPDXRef-Package-CloudEval-CLI",
|
|
16
16
|
"name": "CloudEval CLI",
|
|
17
|
-
"versionInfo": "0.
|
|
17
|
+
"versionInfo": "0.27.1",
|
|
18
18
|
"downloadLocation": "https://github.com/ganakailabs/cloudeval-cli",
|
|
19
19
|
"filesAnalyzed": false,
|
|
20
20
|
"licenseConcluded": "LicenseRef-CloudEval-CLI",
|